起步软件技术论坛
搜索
 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 2476|回复: 3

[结贴] justep_oa.getDate does not exist

[复制链接]

152

主题

413

帖子

2182

积分

金牌会员

Rank: 6Rank: 6

积分
2182
QQ
发表于 2016-11-19 10:41:17 | 显示全部楼层 |阅读模式
本帖最后由 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



1

主题

76

帖子

163

积分

初级会员

Rank: 2

积分
163
QQ
发表于 2016-11-21 10:45:48 | 显示全部楼层
请问X5是什么版本?请检查是不是X5版本与数据库没有同步更新?BIZ层进行模型编译,UI层进行源码编译,清除缓存,重启tomcat再试试。另外我们发布的OA系统中的新闻是不需要审批的。

152

主题

413

帖子

2182

积分

金牌会员

Rank: 6Rank: 6

积分
2182
QQ
 楼主| 发表于 2016-11-21 12:48:52 | 显示全部楼层
本帖最后由 John913 于 2016-11-21 12:50 编辑

已经查明原因。之前以为 justep_oa.getDate 是BIZ中的fn,以为这是一个KSQL错误。实际上,justep_oa是数据库名,这是一条sql错误,就是getDate函数不存在。MySql取当前日期时间的函数是now,而getDate函数是sqlserver的取当前日期的函数,所以出这个错误了。
起步OA小问题不少
请结帖

1

主题

76

帖子

163

积分

初级会员

Rank: 2

积分
163
QQ
发表于 2016-11-22 16:49:14 | 显示全部楼层
解决问题就好
高级模式
B Color Image Link Quote Code Smilies |上传

本版积分规则

小黑屋|手机版|X3技术论坛|Justep Inc.    

GMT+8, 2024-11-24 11:11 , Processed in 0.057283 second(s), 23 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表