|
楼主 |
发表于 2021-5-27 10:09:30
|
显示全部楼层
//import java.util.Iterator;
import com.justep.system.util.*;
import com.justep.system.process.*;
import com.justep.system.context.*;
import com.justep.system.opm.*;
import com.justep.system.data.*;
import com.justep.system.action.*;
import com.justep.model.*;
import com.justep.model.ModelUtils;
import java.util.*;
public class SOProcess {
public static void sOProcessAfterAbort() {
try{
String key=ProcessUtils.getProcessData1();
String MSQL5="update SOH SOH SET SOH.FLOWSTATUS='已终止' where SOH='"+key+"'";
KSQL.executeUpdate(MSQL5,null,"/E2018/BASE/data",null);
} catch(Exception e)
{
throw new RuntimeException(e.getMessage());
}
}
public static void sOProcessAfterFinish() {
try{
//String MNAME=this.Context.getCurrentProcess();
//获取当前环节显示名称
//justep.Context.getCurrentProcessLabel();//获取当前流程显示名称
String key=ProcessUtils.getProcessData1();
String MSQL6="update SOH SOH SET SOH.FLOWSTATUS='已完成' where SOH='"+key+"'";
KSQL.executeUpdate(MSQL6,null,"/E2018/BASE/data",null);
} catch(Exception e)
{
throw new RuntimeException(e.getMessage());
}
}
public static void businessActivity2AfterAdvance() {
try{
String taskID=ProcessUtils.getProcessContext().getTask().getId();
String MSQL3="SELECT sContent as sContent from SA_Task SA_Task where SA_Task='"+taskID+"'";
com.justep.system.data.Table table=KSQL.select(MSQL3,null,"/system/data",null);
Iterator<Row> rows=table.iterator();
Row row =rows.next();
String sContent=row.getString("sContent");
String key=ProcessUtils.getProcessData1();
if(sContent==null)
{
sContent="批核";
}
String MSQL4="update SOH SOH SET SOH.FLOWREMARK2='"+sContent+"',SOH.APPR_FLAG='V',SOH.APPR_DATE=SQL.GETDATE(),SOH.APPR_USER=peratorName(),SOH.APPR_DATE_FST=CASE WHEN SQL.ISNULL(SOH.APPR_DATE_FST,'1900-01-01')='1900-01-01' THEN SQL.GETDATE() ELSE SOH.APPR_DATE_FST END where SOH='"+key+"'";
KSQL.executeUpdate(MSQL4,null,"/E2018/BASE/data",null);
//String ret = ZP_CQTD_SAVEAF(client_id,key);
} catch(Exception e)
{
throw new RuntimeException(e.getMessage());
}
}
public static void businessActivity1AfterAdvance() {
try{
String taskID=ProcessUtils.getProcessContext().getTask().getId();
String MSQL1="SELECT sContent as sContent from SA_Task SA_Task where SA_Task='"+taskID+"'";
com.justep.system.data.Table table=KSQL.select(MSQL1,null,"/system/data",null);
Iterator<Row> rows=table.iterator();
Row row =rows.next();
String sContent=row.getString("sContent");
if(sContent!=null)
{
String key=ProcessUtils.getProcessData1();
String MSQL2="update SOH SOH SET SOH.FLOWREMARK1='"+sContent+"' where SOH='"+key+"'";
KSQL.executeUpdate(MSQL2,null,"/E2018/BASE/data",null);
}
} catch(Exception e)
{
throw new RuntimeException(e.getMessage());
}
}
public static void businessActivity2AfterBack() {
try{
String taskID=ProcessUtils.getProcessContext().getTask().getId();
String MSQL1="SELECT sContent as sContent from SA_Task SA_Task where SA_Task='"+taskID+"'";
com.justep.system.data.Table table=KSQL.select(MSQL1,null,"/system/data",null);
Iterator<Row> rows=table.iterator();
Row row =rows.next();
String sContent=row.getString("sContent");
if(sContent!=null)
{
String key=ProcessUtils.getProcessData1();
String MSQL2="update SOH SOH SET SOH.BACK_REMARK='"+sContent+"' where SOH='"+key+"'";
KSQL.executeUpdate(MSQL2,null,"/E2018/BASE/data",null);
}
} catch(Exception e)
{
throw new RuntimeException(e.getMessage());
}
}
public static void sOProcessBeforeSaveSODAction() {
//获得table参数
Table table = (Table)ContextHelper.getActionContext().getParameter("table");
//获得所有修改的行
Iterator<Row> rows = table.iterator(com.justep.system.data.ModifyState.EDIT);
Row row;
Collection<String> list=table.getColumnNames();
String[] strArray1 = (String[])list.toArray(new String[0]);
System.out.println("修改的行");
System.out.println(new com.justep.system.transform.Table2Row().transform(table,null).asXML());
//while (rows.hasNext()){
//row = rows.next();
//for(int i=0;i<table.getColumnCount();i++){
//if(row.isModified(strArray1)){
//System.out.println(row.getValue(i));
//System.out.println(row.getOldValue(strArray1));
//}
//}
//}
//获得所有新增的行
rows = table.iterator(com.justep.system.data.ModifyState.NEW);
System.out.println("新增的行");
System.out.println(new com.justep.system.transform.Table2Row().transform(table,null).asXML());
//while (rows.hasNext()){
//row = rows.next();
//for(int i=0;i<table.getColumnCount();i++){
//System.out.println(strArray1+"-"+row.getValue(strArray1));
//}
//}
//获得所有被删除的行
rows = table.iterator(com.justep.system.data.ModifyState.DELETE);
System.out.println("删除的行");
System.out.println(new com.justep.system.transform.Table2Row().transform(table,null).asXML());
//while (rows.hasNext()){
//row = rows.next();
//for(int i=0;i<table.getColumnCount();i++){
//System.out.println(strArray1+"-"+row.getValue(strArray1));
//}
//}
}
}
|
|