|
楼主 |
发表于 2016-8-9 19:57:45
|
显示全部楼层
不行的,我把guid()去掉都不行,语法有问题?
chID) (SELECT p1.fXSDD FROM salestable p1 WHERE p1.fXSDD = 'ttt')
隐藏详细
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.justep.system.action.Engine.invokeActions(Native Method)
at com.justep.system.action.Engine.invokeActions(Unknown Source)
at com.justep.business.server.BusinessServer.doAction(Unknown Source)
at com.justep.business.server.BusinessServer.doExcute(Unknown Source)
at com.justep.business.server.BusinessServer.excute(Unknown Source)
at com.justep.business.server.BusinessServer.excute(Unknown Source)
at com.justep.business.server.BusinessServerServlet.execService(Unknown Source)
at com.justep.business.server.BusinessServerServlet.service(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
at com.justep.x.bs.BusinessServerServlet.service(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: 编码: JUSTEP150210; 提示: 执行KSQL出错, KSQL: INSERT INTO PurchTable p ( p.fPurchID) (SELECT p1.fXSDD FROM salestable p1 WHERE p1.fXSDD = 'ttt')
at Actions.SalesOrderActionParams(Actions.java:53)
... 27 more
完整代码
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import com.justep.filesystem.FileSystemWrapper;
import com.justep.model.ModelUtils;
import com.justep.system.context.ContextHelper;
import com.justep.system.data.*;
import com.justep.system.opm.api.AuthorizeHelper;
import com.justep.system.opm.api.DataPolicy;
import com.justep.system.opm.api.PermissionHelper;
import com.justep.system.opm.api.RoleHelper;
import com.justep.system.opm.api.RoleKind;
import com.justep.system.process.ProcessUtils;
import com.justep.system.process.TaskDB;
import com.justep.system.transform.Transform;
import com.justep.system.util.CommonUtils;
import com.justep.util.Utils;
public class Actions {
public static String SalesOrderActionParams(String param_SalesID) {
try{
String ksql="select SalesTable.fXSDD,SalesTable from SalesTable SalesTable where SalesTable.fXSDD='"+param_SalesID+"'";
com.justep.system.data.Table table=KSQL.select(ksql, null, "/ERP/Cust/data", null);
Iterator<Row> rows=table.iterator();
Row row=rows.next();
String strfID=row.getString("SalesTable");
String strfXSDD = row.getString("fXSDD");
//string str
//如果操作者留下了附言,将附言记到库表中
String ksql1=" INSERT INTO PurchTable p ( p.fPurchID) (SELECT p1.fXSDD FROM salestable p1 WHERE p1.fXSDD = '"+strfXSDD+"')";
KSQL.executeUpdate(ksql1, null, "/ERP/Cust/data", null); //将操作者意见存回库表
String ksql2=" INSERT INTO purchLine p (p, p.fCPBH,p.fPurchId) (SELECT :guid() , p1.fCPBH,(select p2 from PurchTable p2 where p2.fXSDD = p1.fXSDD) FROM salesline p1 WHERE p1.fXSDD = '"+strfID+"')";
KSQL.executeUpdate(ksql2, null, "/ERP/Cust/data", null); //将操作者意见存回库表
}catch(Exception e){
throw new RuntimeException(e.getMessage());
}
return "test";
}
}
哪里有问题呢? |
|