From 6de34de6b4da7c778993fce58ad6e6ea4c8a5049 Mon Sep 17 00:00:00 2001 From: yangzt Date: Mon, 3 Mar 2025 14:22:56 +0800 Subject: [PATCH] =?UTF-8?q?yzt-20250303-=E9=97=AE=E9=A2=98=E6=B8=85?= =?UTF-8?q?=E5=8D=95=E5=BA=8F=E5=8F=B7351-=E6=8E=A5=E5=8F=A3=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflow/action/ZOA_SL_GNCC_Action.java | 70 +++++++++++++------ 1 file changed, 48 insertions(+), 22 deletions(-) diff --git a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_SL_GNCC_Action.java b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_SL_GNCC_Action.java index 1235b99..f398e85 100644 --- a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_SL_GNCC_Action.java +++ b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_SL_GNCC_Action.java @@ -527,18 +527,20 @@ public class ZOA_SL_GNCC_Action extends BaseBean implements Action, EsbServerles if (str.length() > 150) { str = str.substring(0, 150); } -// String sql = "insert into chuchai_qingjia_log(requestId,gh,lbbh,kssj,jssj,message,state,qjss) values('" + reid + "','','A11','" + beginDateTime + "','" + endDateTime + "','" + str + "','" + hrstate + "','" + qjss + "')"; + long generate = IdGenerator.generate(); + String sql = "insert into e10_common.dbo.chuchai_qingjia_log(id,requestId,gh,lbbh,kssj,jssj,message,state,qjss) values("+generate + ",'" + reid + "','','A11','" + beginDateTime + "','" + endDateTime + "','" + str + "','" + hrstate + "','" + qjss + "')"; // String poolname = CONN_TYPE.workflow.getType(); // /* *TODO 检测到insert语句 -> E9插入sql迁移到E10需要特殊处理请参考文档进行调整 https://www.e-cology.com.cn/sp/doc/docShare/1027709301045985331?tenantKey=t7akvdnf84 // TODO E10执行sql方法第二参数必须指定源,默认使用流程源,单体客户无需修改,微服务/组合客户需根据查询表所属服务切换源,或使用外部数据源*/ + // long generate = IdGenerator.generate(); // rs.executeSql(sql, poolname,generate); - Long uf_CustomFlow_formId1 = commonDevUtil.getObjId("chuchai_qingjia_log"); - logger_5e8d517a.error("uf_CustomFlow_formId = " + uf_CustomFlow_formId1); - SimpleEmployee currentEmployee = HrmContextUtil.getCurrentUser(); - Long recodId = ebFormDataDubboService.addEmptyData(uf_CustomFlow_formId1, currentEmployee);// 获取插入的空的建模id +// Long uf_CustomFlow_formId1 = commonDevUtil.getObjId("chuchai_qingjia_log"); +// logger_5e8d517a.error("uf_CustomFlow_formId = " + uf_CustomFlow_formId1); +// SimpleEmployee currentEmployee = HrmContextUtil.getCurrentUser(); +// Long recodId = ebFormDataDubboService.addEmptyData(uf_CustomFlow_formId1, currentEmployee);// 获取插入的空的建模id String poolname1 = CONN_TYPE.workflow.getType(); - String sql = "update e10_common.dbo.sync_eas_log set requestId = '" + reid + "',gh = '',lbbh='A11',kssj='" + beginDateTime + "',jssj='" + endDateTime + "',message='" + str + "',state='" + hrstate + "',qjss='" + qjss + "' where id = " + recodId + " and delete_type = 0 "; +// String sql = "update e10_common.dbo.sync_eas_log set requestId = '" + reid + "',gh = '',lbbh='A11',kssj='" + beginDateTime + "',jssj='" + endDateTime + "',message='" + str + "',state='" + hrstate + "',qjss='" + qjss + "' where id = " + recodId + " and delete_type = 0 "; boolean b = rs.executeSql(sql, poolname1); logger_5e8d517a.error("sql3 = " + sql); logger_5e8d517a.error("添加 = " + b); @@ -763,43 +765,67 @@ public class ZOA_SL_GNCC_Action extends BaseBean implements Action, EsbServerles String[] result = callTravelApply.call(); sta = result[0]; message = result[1]; -// String sql_log = "insert into sync_eas_log(requestId,lcbh,kssj,jssj,sqrq,ccmdd,gh,name,sxrgh,sxrxm,reason,title,sqbm,sqdw,status,message) " + "values('" + reid + "','" + sourceKey + "','" + kssj + "','" + jssj + "','" + sqrq + "','" + attribute8 + "','" + errandEmpNum + "','" + attribute3 + "','" + synergeticNumbers + "'" + ",'" + synergeticNames + "','" + reason + "','" + title + "','" + attribute4 + "','" + attribute5 + "','" + sta + "','" + message + "')"; -// String poolname_ui = CONN_TYPE.workflow.getType(); + + String poolname_ui = CONN_TYPE.workflow.getType(); + //generate过长 新id=获取id最大值+1 + String newIdSql = "SELECT ISNULL((SELECT TOP 1 id FROM e10_common.dbo.sync_eas_log ORDER BY id DESC), 0) + 1 AS id"; + boolean flag = rs.executeSql(newIdSql, poolname_ui); + logger_5e8d517a.error("flag---"+flag); + long newId = 0; + if (rs.next()) { + newId = Long.parseLong(rs.getString("id")); + } + String sql3 = "insert into e10_common.dbo.sync_eas_log(id,requestId,lcbh,kssj,jssj,sqrq,ccmdd,gh,name,sxrgh,sxrxm,reason,title,sqbm,sqdw,status,message) " + "values(" + newId + ",'" + reid + "','" + sourceKey + "','" + kssj + "','" + jssj + "','" + sqrq + "','" + attribute8 + "','" + errandEmpNum + "','" + attribute3 + "','" + synergeticNumbers + "'" + ",'" + synergeticNames + "','" + reason + "','" + title + "','" + attribute4 + "','" + attribute5 + "','" + sta + "','" + message + "')"; // /* *TODO 检测到insert语句 -> E9插入sql迁移到E10需要特殊处理请参考文档进行调整 https://www.e-cology.com.cn/sp/doc/docShare/1027709301045985331?tenantKey=t7akvdnf84 // TODO E10执行sql方法第二参数必须指定源,默认使用流程源,单体客户无需修改,微服务/组合客户需根据查询表所属服务切换源,或使用外部数据源*/ + // generate = IdGenerator.generate(); // rs1.executeSql(sql_log, poolname_ui,generate); - Long uf_CustomFlow_formId = commonDevUtil.getObjId("sync_eas_log"); - logger_5e8d517a.error("uf_CustomFlow_formId = " + uf_CustomFlow_formId); - String poolname_5v = CONN_TYPE.workflow.getType(); - Long recodId1 = ebFormDataDubboService.addEmptyData(uf_CustomFlow_formId, currentEmployee);// 获取插入的空的建模id - String sql3 = "update e10_common.dbo.sync_eas_log set requestId = '" + reid + "',lcbh = '" + sourceKey + "',kssj='" + kssj + "',jssj='" + jssj + "',sqrq='" + sqrq + "',ccmdd='" + attribute8 + "',gh='" + errandEmpNum + "',name='" + attribute3 + "',sxrgh='" + synergeticNumbers + "' " + ",sxrxm='" + synergeticNames + "',reason='" + reason + "',title='" + title + "',sqbm='" + attribute4 + "',sqdw='" + attribute5 + "',status='" + sta + "',message='" + message + "' where id = " + recodId1 + " and delete_type = 0 "; - boolean b1 = rs.executeSql(sql3, poolname_5v); +// Long uf_CustomFlow_formId = commonDevUtil.getObjId("sync_eas_log"); +// logger_5e8d517a.error("uf_CustomFlow_formId = " + uf_CustomFlow_formId); +// String poolname_5v = CONN_TYPE.workflow.getType(); +// Long recodId1 = ebFormDataDubboService.addEmptyData(uf_CustomFlow_formId, currentEmployee);// 获取插入的空的建模id +// String sql3 = "update e10_common.dbo.sync_eas_log set requestId = '" + reid + "',lcbh = '" + sourceKey + "',kssj='" + kssj + "',jssj='" + jssj + "',sqrq='" + sqrq + "',ccmdd='" + attribute8 + "',gh='" + errandEmpNum + "',name='" + attribute3 + "',sxrgh='" + synergeticNumbers + "' " + ",sxrxm='" + synergeticNames + "',reason='" + reason + "',title='" + title + "',sqbm='" + attribute4 + "',sqdw='" + attribute5 + "',status='" + sta + "',message='" + message + "' where id = " + recodId1 + " and delete_type = 0 "; + boolean b1 = rs.executeSql(sql3, poolname_ui); + logger_5e8d517a.error("rs = " + rs.getExecuteResult()); + logger_5e8d517a.error("sql3 = " + sql3); logger_5e8d517a.error(String.valueOf("b1:" + b1)); logger_5e8d517a.error(String.valueOf(reid + "同步数据到EAS完成")); } catch (Exception e) { message = e.getMessage(); -// String sql_log = "insert into sync_eas_log(requestId,lcbh,kssj,jssj,sqrq,ccmdd,gh,name,sxrgh,sxrxm,reason,title,sqbm,sqdw,status,message) " + "values('" + reid + "','" + sourceKey + "','" + kssj + "','" + jssj + "','" + sqrq + "','" + attribute8 + "','" + errandEmpNum + "','" + attribute3 + "','" + synergeticNumbers + "'" + ",'" + synergeticNames + "','" + reason + "','" + title + "','" + attribute4 + "','" + attribute5 + "','" + sta + "','" + message + "')"; + String poolname_5v = CONN_TYPE.workflow.getType(); + //generate过长 新id=获取id最大值+1 + String newIdSql = "SELECT ISNULL((SELECT TOP 1 id FROM e10_common.dbo.sync_eas_log ORDER BY id DESC), 0) + 1 AS id"; + boolean flag = rs.executeSql(newIdSql, poolname_5v); + logger_5e8d517a.error("flag---"+flag); + long newId = 0; + if (rs.next()) { + newId = Long.parseLong(rs.getString("id")); + } + + String sql3 = "insert into e10_common.dbo.sync_eas_log(id,requestId,lcbh,kssj,jssj,sqrq,ccmdd,gh,name,sxrgh,sxrxm,reason,title,sqbm,sqdw,status,message) " + "values(" + newId + ",'" + reid + "','" + sourceKey + "','" + kssj + "','" + jssj + "','" + sqrq + "','" + attribute8 + "','" + errandEmpNum + "','" + attribute3 + "','" + synergeticNumbers + "'" + ",'" + synergeticNames + "','" + reason + "','" + title + "','" + attribute4 + "','" + attribute5 + "','" + sta + "','" + message + "')"; // String poolname_5v = CONN_TYPE.workflow.getType(); // /* *TODO 检测到insert语句 -> E9插入sql迁移到E10需要特殊处理请参考文档进行调整 https://www.e-cology.com.cn/sp/doc/docShare/1027709301045985331?tenantKey=t7akvdnf84 // TODO E10执行sql方法第二参数必须指定源,默认使用流程源,单体客户无需修改,微服务/组合客户需根据查询表所属服务切换源,或使用外部数据源*/ + // generate = IdGenerator.generate(); // rs1.executeSql(sql_log, poolname_5v,generate); - Long uf_CustomFlow_formId = commonDevUtil.getObjId("sync_eas_log"); - logger_5e8d517a.error("uf_CustomFlow_formId = " + uf_CustomFlow_formId); - String poolname_5v = CONN_TYPE.workflow.getType(); - Long recodId2 = ebFormDataDubboService.addEmptyData(uf_CustomFlow_formId, currentEmployee);// 获取插入的空的建模id - String sql3 = "update e10_common.dbo.sync_eas_log set requestId = '" + reid + "',lcbh = '" + sourceKey + "',kssj='" + kssj + "',jssj='" + jssj + "',sqrq='" + sqrq + "',ccmdd='" + attribute8 + "',gh='" + errandEmpNum + "',name='" + attribute3 + "',sxrgh='" + synergeticNumbers + "' " + ",sxrxm='" + synergeticNames + "',reason='" + reason + "',title='" + title + "',sqbm='" + attribute4 + "',sqdw='" + attribute5 + "',status='" + sta + "',message='" + message + "' where id = " + recodId2 + " and delete_type = 0 "; +// Long uf_CustomFlow_formId = commonDevUtil.getObjId("sync_eas_log"); +// logger_5e8d517a.error("uf_CustomFlow_formId = " + uf_CustomFlow_formId); +// String poolname_5v = CONN_TYPE.workflow.getType(); +// Long recodId2 = ebFormDataDubboService.addEmptyData(uf_CustomFlow_formId, currentEmployee);// 获取插入的空的建模id +// String sql3 = "update e10_common.dbo.sync_eas_log set requestId = '" + reid + "',lcbh = '" + sourceKey + "',kssj='" + kssj + "',jssj='" + jssj + "',sqrq='" + sqrq + "',ccmdd='" + attribute8 + "',gh='" + errandEmpNum + "',name='" + attribute3 + "',sxrgh='" + synergeticNumbers + "' " + ",sxrxm='" + synergeticNames + "',reason='" + reason + "',title='" + title + "',sqbm='" + attribute4 + "',sqdw='" + attribute5 + "',status='" + sta + "',message='" + message + "' where id = " + recodId2 + " and delete_type = 0 "; boolean b1 = rs.executeSql(sql3, poolname_5v); + logger_5e8d517a.error("rs = " + rs.getExecuteResult()); logger_5e8d517a.error("sql3 = " + sql3); logger_5e8d517a.error("添加 = " + b1); logger_5e8d517a.error(String.valueOf(reid + "同步数据到EAS异常:" + e.toString())); - return WeaResult.fail(500, reid + "同步数据到EAS异常:" + e, getResultMapForAction(weaverResultMap, "result", "", request.getRequestManager())); + return WeaResult.fail(500, reid + "同步数据到EAS异常:" + e.toString(), getResultMapForAction(weaverResultMap, "result", "", request.getRequestManager())); } } catch (Exception e) { logger_5e8d517a.error(String.valueOf(reid + "Exception:" + e.toString())); - return WeaResult.fail(500, reid + "Exception:" + e, getResultMapForAction(weaverResultMap, "result", "", request.getRequestManager())); + return WeaResult.fail(500, reid + "Exception:" + e.toString(), getResultMapForAction(weaverResultMap, "result", "", request.getRequestManager())); // e.printStackTrace(); }