|
版本: |
BeX5V3.5 |
小版本号: |
|
|
|
数据库: |
MS SQLServer |
服务器操作系统: |
Windows |
应用服务器: |
Tomcat |
客户端操作系统: |
Windows 7 |
浏览器: |
Chrome |
|
|
总是提示这个错误,可以确认,是KSQL拼接的问题,怎么修改?
编码: JUSTEP150210; 提示: 执行KSQL出错, KSQL: UPDATE articleMove articleMove SET articleMove.f1stName='system', articleMove.f1sID='PSN01', articleMove.f1stTime=:currentDateTime()articleMove.f1stAdvice ='已确认!' where articleMove='3AB07020D64B43A29FD89F3BCAD10B63'
import java.text.SimpleDateFormat;
import java.util.Iterator;
import com.justep.system.context.ContextHelper;
import com.justep.system.data.KSQL;
import com.justep.system.data.Row;
import com.justep.system.data.Table;
import com.justep.system.process.ProcessUtils;
import com.justep.system.util.BizUtils;
public class OutboundProcess {
//生成连续的出库单编号CKD20161010001
public static void outboundProcessBeforeSaveArticleMoveAction() {
//拿到前台传过来的TABLE参数
Table table=(Table)ContextHelper.getActionContext().getParameter("table");
//拿到新增的行
Iterator<Row> rows=table.iterator(com.justep.system.data.ModifyState.NEW);
//生成当前日期的字符串
SimpleDateFormat sDateFormat=new SimpleDateFormat("yyyyMMdd");
String sDate=sDateFormat.format(new java.util.Date());
//配置单据编号字符串
while (rows.hasNext()){
Row row=rows.next();
//给FNO字段赋值
row.setValue("fNo", BizUtils.createNextSequenceString("CKD"+sDate, "0000"));
}
}
//出库申请环节完毕后,将销售计划意见加入库表
public static void applyAfterAdvance() {
try{
String taskID=ProcessUtils.getProcessContext().getTask().getId(); //拿到当前流程ID
String ksql = "select SA_Task.sContent from SA_Task SA_Task where SA_Task= '"+taskID+"'";
com.justep.system.data.Table table = KSQL.select(ksql, 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 ksql1="UPDATE articleMove articleMove SET articleMove.fReportAdvice ='"+sContent+"' where articleMove='"+key+"'";
KSQL.executeUpdate(ksql1, null, "/DEMOERP/DEMOERP/data", null);//将操作者意见存进库表中
}
}catch(Exception e){
throw new RuntimeException(e.getMessage());
}
}
//出库环节完毕后,将库管员姓名,ID,时间,意见写出库表中
public static void outboundAfterAdvance() {
try{
String taskID=ProcessUtils.getProcessContext().getTask().getId(); //拿到当前流程ID
String ksql = "select SA_Task.sContent from SA_Task SA_Task where SA_Task='"+taskID+"'";
com.justep.system.data.Table table=KSQL.select(ksql, null, "/system/data", null);//查出当前流程记录
Iterator<Row> rows=table.iterator(); //拿到操作者意见
Row row=rows.next();
String sContent=row.getString("sContent");
//如果操作者留下了附言,将附言记录到库表中
String key=ProcessUtils.getProcessData1();
String ksql1="UPDATE articleMove articleMove SET articleMove.f1stName='"+ContextHelper.getOperator().getName()+"', articleMove.f1sID='"+ContextHelper.getOperator().getID()+"', articleMove.f1stTime=:currentDateTime()";
if(sContent!=null)
ksql1=ksql1+"articleMove.f1stAdvice ='"+sContent+"'" ;
ksql1=ksql1+" where articleMove='"+key+"'";
KSQL.executeUpdate(ksql1, null, "/DEMOERP/DEMOERP/data", null);//将操作者意见存进库表中
/**更新收货意见
if(sContent!=null){
String key=ProcessUtils.getProcessData1();
String ksql1 = "UPDATE articleMove articleMove SET articleMove.f1stAdvice ='"+sContent+"' where articleMove='"+key+"'";
KSQL.executeUpdate(ksql1, null, "/DEMOERP/DEMOERP/data", null);//将操作者意见存进库表中
}
**/
}catch(Exception e){
throw new RuntimeException(e.getMessage());
}
}
//流程异常结束时,更新流程状态
public static void outboundProcessAfterAbort() {
try{
String key=ProcessUtils.getProcessData1();//拿到当前主表ID
String ksql = "UPDATE articleMove articleMove SET articleMove.fProcState='已终止' where articleMove='"+key+"'";
KSQL.executeUpdate(ksql, null, "/DEMOERP/DEMOERP/data", null);
}catch(Exception e){
throw new RuntimeException(e.getMessage());
}
}
//流程正常结束时,更新流程状态
public static void outboundProcessAfterAdvance() {
try{
String key=ProcessUtils.getProcessData1();//拿到当前主表ID
String ksql = "UPDATE articleMove articleMove SET articleMove.fProcState='已完成' where articleMove='"+key+"'";
KSQL.executeUpdate(ksql, null, "/DEMOERP/DEMOERP/data", null);
}catch(Exception e){
throw new RuntimeException(e.getMessage());
}
}
}
|
|