|
本帖最后由 John913 于 2016-11-19 10:42 编辑
起步OA,新闻审批最后一个环节“管理员发布”,流转结束确定时出错:justep_oa.getDate does not exist
经排查,SimplePublishKnowledgeProcess.updateKWReleaseStatus方法中的代码出错,代码如下:
private static void updateKWReleaseStatus(Connection conn, int status)
throws Exception {
String currentDate = null;
String strDatabaseType = conn.getMetaData().getDatabaseProductName();
if (strDatabaseType.equalsIgnoreCase("Oracle")) {
currentDate = "current_date";
} else {
currentDate = "getDate()";
}
String fReleaseStatus = null;
String fReleaseStatusName = null;
if (status == 0) {
fReleaseStatus = "0";
fReleaseStatusName = "未发布";
} else if (status == 1) {
fReleaseStatus = "1";
fReleaseStatusName = "已发布";
} else if (status == 2) {
fReleaseStatus = "2";
fReleaseStatusName = "已取消";
} else {
throw new Exception("对不起,更新知识状态失败!");
}
String fReleaseOgnID = SysUtils.getCurrentOgnID();
String fReleaseOgnName = SysUtils.getCurrentOgnName();
String fReleaseDeptID = SysUtils.getCurrentDeptID() != null ? SysUtils.getCurrentDeptID() : SysUtils.getCurrentOgnID();
String fReleaseDeptName = SysUtils.getCurrentDeptName() != null ? SysUtils.getCurrentDeptName() : SysUtils.getCurrentOgnName();
String fReleasePsnID = SysUtils.getCurrentPersonID();
String fReleasePsnName = SysUtils.getCurrentPersonName();
String fReleasePsnFID = SysUtils.getCurrentPersonMemberFID();
String fReleasePsnFName = SysUtils.getCurrentPersonMemberFName();
String kwid = ProcessUtils.getProcessData1();
String sql = String.format(
"update OA_KM_Knowledge "
+ " set fReleaseOgnID='%s',fReleaseOgnName='%s',"
+ " fReleaseDeptID='%s',fReleaseDeptName='%s',"
+ " fReleasePsnID='%s',fReleasePsnName='%s',"
+ " fReleasePsnFID='%s',fReleasePsnFName='%s',"
+ " fReleaseTime=%s,fReleaseStatus = '%s',fReleaseStatusName = '%s' "
+ " where fid = '%s'", fReleaseOgnID, fReleaseOgnName,
fReleaseDeptID, fReleaseDeptName, fReleasePsnID,
fReleasePsnName, fReleasePsnFID, fReleasePsnFName, currentDate,
fReleaseStatus, fReleaseStatusName, kwid);
Statement stmt = conn.createStatement();
try {
stmt.executeUpdate(sql);
} finally {
stmt.close();
stmt = null;
}
}
控制台出错信息:
2016-11-19 10:34:39 excute stream action, params:{"actions":[{"accept":"application/json","action":"externalAdvanceProcessAction","actionFlag":"__action_0__","activity":"publishActivity","contentType":"application/json","executeContext":"","executor":"[url=]/V9HPpe4XsYZcSnJoUYY.ogn/FfZgxh57GZuaSBG1uLU.ogn/egHPYCKnBxQjVbnzc3L.dpt/uzmsAl6TC48v3KrrVqG.pos/ydCMPcVWz6VdNgNAI9J@uzmsAl6TC48v3KrrVqG.psm","parameters":{"control":{"class":"com.justep.system.process.ProcessControl","object":{"@@tag":"process-control","customized-enabled":"false","dialog-enabled":"true","jump-enabled":"false","message":"","notice":[],"postscript":"","save-history":"true","status":"none","task-join":"false","task-join-mode":"tjmMultiple","to":[{"@activity-id":"5FD61737A9A64EEB8356E4C6706481D0","@id":"5FD61737A9A64EEB8356E4C6706481D0","@is-end":"true","@readonly":"true","@selected":"true","executor-kinds":"","executor-range":[],"executors":[],"process":"/OA/knowledge/process/simplePublishKnowledge/simplePublishKnowledgeProcess","task-relation-value":{"@@tag":"task-relation-value","SA_Task":"50517D02596C49FF9400592391155E4F","sActivityInTemplate":"end1","sActivityName":"","sLastModifyTime":"2016-11-19T10:34:27.794Z","sLock":"FEA750BDAA52446ABE528AD12EC4466B","sProcess":"/OA/knowledge/process/simplePublishKnowledge/simplePublishKnowledgeProcess","sProcessName[/url]":"信息发布","sProcessTemplateID2":"","sTypeName":"信息发布"},"template":"","unit":"end1"}]}},"task":"2359260C4C6E43F3BA45F18F4650CD05"},"process":"/OA/knowledge/process/simplePublishKnowledge/simplePublishKnowledgeProcess"}]}
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
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.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.justep.system.action.Engine.invokeAction(Native Method)
at com.justep.system.action.Engine.invokeAction(Unknown Source)
at com.justep.model.impl.UtilImplementInstance.invokeAction(Unknown Source)
at com.justep.model.impl.UtilImplementInstance.invokeAction(Unknown Source)
at com.justep.system.action.ActionUtils.invokeAction(Unknown Source)
at com.justep.system.process.ProcessUtils.advanceProcess(Unknown Source)
at ExternalProcessProcedure.advanceProcess(ExternalProcessProcedure.java:30)
... 27 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: FUNCTION justep_oa.getDate does not exist
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:400)
at com.mysql.jdbc.Util.getInstance(Util.java:383)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:980)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3847)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3783)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2447)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2594)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2541)
at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1604)
at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1535)
at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228)
at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228)
at com.justep.system.data.Transaction$WrappedStatement.executeUpdate(Unknown Source)
at SimplePublishKnowledgeProcess.updateKWReleaseStatus(SimplePublishKnowledgeProcess.java:89)
at SimplePublishKnowledgeProcess.simplePublishKnowledgeProcessAfterAdvance(SimplePublishKnowledgeProcess.java:33)
... 38 more
|
|