From af04ed76b36762d8af60a1a45b6424c9644ce052 Mon Sep 17 00:00:00 2001 From: qijirenjian Date: Thu, 13 Mar 2025 16:34:26 +0800 Subject: [PATCH] detail des --- .../workflow/action/OaSrmVendorAdmitAction.java | 8 ++++++-- .../workflow/action/OaSrmVendorCheckAction.java | 12 ++++++++---- .../workflow/action/OaSrmVendorReapplyAction.java | 10 +++++++--- .../workflow/action/OaSrmVendorSyncAction.java | 10 +++++++--- .../workflow/action/TransferBillToK3Action.java | 11 ++++++++--- .../workflow/action/UpdateTaskNumber.java | 12 ++++++++++-- .../workflow/action/ZOA_MM_PR_RELEASEAction.java | 8 +++++++- .../workflow/action/ZSR_PUR_INFO_OEM_Action.java | 9 +++++++-- .../interfaces/workflow/util/CommonDevUtil.java | 15 +++++++++++++++ 9 files changed, 75 insertions(+), 20 deletions(-) diff --git a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/OaSrmVendorAdmitAction.java b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/OaSrmVendorAdmitAction.java index a1eacb1..29db9b5 100644 --- a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/OaSrmVendorAdmitAction.java +++ b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/OaSrmVendorAdmitAction.java @@ -8,6 +8,7 @@ import com.weaver.seconddev.interfaces.swfa.BillFieldUtil; import java.util.HashMap; import java.util.Map; import com.weaver.common.i18n.tool.util.I18nContextUtil; +import com.weaver.seconddev.interfaces.workflow.util.CommonDevUtil; import com.weaver.verupgrade.conn.CONN_TYPE; import java.lang.*; import java.util.*; @@ -38,7 +39,8 @@ public class OaSrmVendorAdmitAction extends BaseBean implements Action, EsbServe @Autowired private ConfigProp configProp; - + @Autowired + private CommonDevUtil commonDevUtil; @Autowired private CallVdDlvApplyServices service; private static final Logger logger_9af84826 = LoggerFactory.getLogger(OaSrmVendorAdmitAction.class); @@ -156,7 +158,9 @@ public class OaSrmVendorAdmitAction extends BaseBean implements Action, EsbServe dlvapplyin.setInspectFlag(xcsh); dlvapplyin.setVendorType(gyslxmc); int dtcount = 0; - String sql = "select b.* from e10_core_business.dbo." + tablename + " a,e10_core_business.dbo." + tablename + "_dt3 b where a.form_data_id=b.form_data_id and a.id=" + requestid; + + String detailTablename3 = commonDevUtil.getDetailTableName(tablename,"3"); + String sql = "select b.* from e10_core_business.dbo." + tablename + " a,e10_core_business.dbo." + detailTablename3 + " b where a.form_data_id=b.form_data_id and a.id=" + requestid; logger_9af84826.error("OaSrmVendorAdmitAction sql-->" + sql); String poolname = CONN_TYPE.workflow.getType(); // TODO E10执行sql方法第二参数必须指定源,默认使用流程源,单体客户无需修改,微服务/组合客户需根据查询表所属服务切换源,或使用外部数据源 diff --git a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/OaSrmVendorCheckAction.java b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/OaSrmVendorCheckAction.java index 66b4bbc..7a76084 100644 --- a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/OaSrmVendorCheckAction.java +++ b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/OaSrmVendorCheckAction.java @@ -2,6 +2,7 @@ package com.weaver.seconddev.interfaces.workflow.action; import com.weaver.seconddev.interfaces.htjt.util.TransUtil; import com.weaver.seconddev.interfaces.prop.ConfigProp; +import com.weaver.seconddev.interfaces.workflow.util.CommonDevUtil; import org.apache.commons.lang.StringEscapeUtils; import com.weaver.seconddev.interfaces.srmoa.CallSrmServices; import com.weaver.seconddev.interfaces.srmoa.OaSrmVenMatExtService; @@ -54,7 +55,8 @@ public class OaSrmVendorCheckAction extends BaseBean implements Action, EsbServe @Autowired private CallVdDlvApplyServices vddservice; - + @Autowired + private CommonDevUtil commonDevUtil; @Autowired private CallSrmServices srm; private static final Logger logger_a864d799 = LoggerFactory.getLogger(OaSrmVendorCheckAction.class); @@ -74,6 +76,8 @@ public class OaSrmVendorCheckAction extends BaseBean implements Action, EsbServe String tablename = requestinfo.getRequestManager().getBillTableName(); RecordSet rs = I18nContextUtil.getBean(RecordSet.class); logger_a864d799.error(String.valueOf("OaSrmVendorCheckAction--start--" + requestid)); + String detailTablename2 = commonDevUtil.getDetailTableName(tablename,"2"); + String detailTablename3 = commonDevUtil.getDetailTableName(tablename,"3"); try { ResourceComInfo resourcecominfo = I18nContextUtil.getBean(ResourceComInfo.class); DepartmentComInfo departmentComInfo = I18nContextUtil.getBean(DepartmentComInfo.class); @@ -187,7 +191,7 @@ public class OaSrmVendorCheckAction extends BaseBean implements Action, EsbServe dlvapplyin.setInspectFlag(xcsh); dlvapplyin.setVendorType(gyslxmc); int dtcount = 0; - String sql = "select b.* from e10_core_business.dbo." + tablename + " a,e10_core_business.dbo." + tablename + "_dt3 b where a.form_data_id=b.form_data_id and a.id=" + requestid; + String sql = "select b.* from e10_core_business.dbo." + tablename + " a,e10_core_business.dbo." + detailTablename3 + " b where a.form_data_id=b.form_data_id and a.id=" + requestid; String poolname_6g = CONN_TYPE.workflow.getType(); // TODO E10执行sql方法第二参数必须指定源,默认使用流程源,单体客户无需修改,微服务/组合客户需根据查询表所属服务切换源,或使用外部数据源 boolean b = rs.executeSql(sql, poolname_6g); @@ -245,7 +249,7 @@ public class OaSrmVendorCheckAction extends BaseBean implements Action, EsbServe oainputvendor.setShzt("1"); if (val.equals("0")) { int dtcount = 0; - String sql = "select b.* from e10_core_business.dbo." + tablename + " a,e10_core_business.dbo." + tablename + "_dt3 b where a.form_data_id=b.form_data_id and a.id=" + requestid; + String sql = "select b.* from e10_core_business.dbo." + tablename + " a,e10_core_business.dbo." + detailTablename3 + " b where a.form_data_id=b.form_data_id and a.id=" + requestid; String poolname = CONN_TYPE.workflow.getType(); // TODO E10执行sql方法第二参数必须指定源,默认使用流程源,单体客户无需修改,微服务/组合客户需根据查询表所属服务切换源,或使用外部数据源 boolean b = rs.executeSql(sql, poolname); @@ -298,7 +302,7 @@ public class OaSrmVendorCheckAction extends BaseBean implements Action, EsbServe List list = new ArrayList(); StringBuilder sb = new StringBuilder(); int dtcount = 0; - String sql = "select distinct wlh from e10_core_business.dbo." + tablename + " a,e10_core_business.dbo." + tablename + "_dt2 b where a.form_data_id=b.form_data_id and a.id=" + requestid; + String sql = "select distinct wlh from e10_core_business.dbo." + tablename + " a,e10_core_business.dbo." + detailTablename2 + " b where a.form_data_id=b.form_data_id and a.id=" + requestid; logger_a864d799.error("sql-->" + sql); String poolname_4c = CONN_TYPE.workflow.getType(); // TODO E10执行sql方法第二参数必须指定源,默认使用流程源,单体客户无需修改,微服务/组合客户需根据查询表所属服务切换源,或使用外部数据源 diff --git a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/OaSrmVendorReapplyAction.java b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/OaSrmVendorReapplyAction.java index 5dfb26c..8f7bf7a 100644 --- a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/OaSrmVendorReapplyAction.java +++ b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/OaSrmVendorReapplyAction.java @@ -4,6 +4,7 @@ import java.text.SimpleDateFormat; import java.util.*; import com.weaver.seconddev.interfaces.htjt.util.TransUtil; import com.weaver.seconddev.interfaces.prop.ConfigProp; +import com.weaver.seconddev.interfaces.workflow.util.CommonDevUtil; import org.apache.commons.lang.StringEscapeUtils; import com.weaver.seconddev.interfaces.srmoa.CallSrmServices; import com.weaver.seconddev.interfaces.srmoa.OaSrmVenMatExtService; @@ -49,7 +50,8 @@ public class OaSrmVendorReapplyAction extends BaseBean implements Action, EsbSer @Autowired private CallSrmServices srm; - + @Autowired + private CommonDevUtil commonDevUtil; private static final Logger logger_a5e612ac = LoggerFactory.getLogger(OaSrmVendorReapplyAction.class); @Override @@ -67,6 +69,8 @@ public class OaSrmVendorReapplyAction extends BaseBean implements Action, EsbSer String tablename = requestinfo.getRequestManager().getBillTableName(); RecordSet rs = I18nContextUtil.getBean(RecordSet.class); logger_a5e612ac.error(String.valueOf("OaSrmVendorReapplyAction--start:" + requestid)); + String detailTablename2 = commonDevUtil.getDetailTableName(tablename,"2"); + String detailTablename3 = commonDevUtil.getDetailTableName(tablename,"3"); try { String state = "E"; String message = ""; @@ -157,7 +161,7 @@ public class OaSrmVendorReapplyAction extends BaseBean implements Action, EsbSer oainputvendor.setSyncErp(Integer.valueOf(sftserp)); } int dtcount = 0; - String sql = "select b.* from e10_core_business.dbo." + tablename + " a,e10_core_business.dbo." + tablename + "_dt3 b where a.form_data_id=b.form_data_id and a.id=" + requestid; + String sql = "select b.* from e10_core_business.dbo." + tablename + " a,e10_core_business.dbo." + detailTablename3 + " b where a.form_data_id=b.form_data_id and a.id=" + requestid; logger_a5e612ac.error("sql-->" + sql); String poolname = CONN_TYPE.workflow.getType(); // TODO E10执行sql方法第二参数必须指定源,默认使用流程源,单体客户无需修改,微服务/组合客户需根据查询表所属服务切换源,或使用外部数据源 @@ -238,7 +242,7 @@ public class OaSrmVendorReapplyAction extends BaseBean implements Action, EsbSer // 当前明细表的所有数据,按行存储 Row[] sq = dtq.getRow(); int dtcount = 0; - String sql = "select distinct wlh from e10_core_business.dbo." + tablename + " a,e10_core_business.dbo." + tablename + "_dt2 b where a.form_data_id=b.form_data_id and a.id=" + requestid; + String sql = "select distinct wlh from e10_core_business.dbo." + tablename + " a,e10_core_business.dbo." + detailTablename2 + " b where a.form_data_id=b.form_data_id and a.id=" + requestid; logger_a5e612ac.error("sql-->" + sql); String poolname_uh = CONN_TYPE.workflow.getType(); // TODO E10执行sql方法第二参数必须指定源,默认使用流程源,单体客户无需修改,微服务/组合客户需根据查询表所属服务切换源,或使用外部数据源 diff --git a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/OaSrmVendorSyncAction.java b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/OaSrmVendorSyncAction.java index 83fa51e..73abe51 100644 --- a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/OaSrmVendorSyncAction.java +++ b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/OaSrmVendorSyncAction.java @@ -4,6 +4,7 @@ import java.text.SimpleDateFormat; import java.util.*; import com.weaver.seconddev.interfaces.htjt.util.TransUtil; import com.weaver.seconddev.interfaces.prop.ConfigProp; +import com.weaver.seconddev.interfaces.workflow.util.CommonDevUtil; import org.apache.commons.lang.StringEscapeUtils; import com.weaver.seconddev.interfaces.srmoa.CallSrmServices; import com.weaver.seconddev.interfaces.srmoa.OaSrmVenMatExtService; @@ -45,7 +46,8 @@ public class OaSrmVendorSyncAction extends BaseBean implements Action, EsbServer private OaSrmVenMatExtService service; @Autowired private ConfigProp configProp; - + @Autowired + private CommonDevUtil commonDevUtil; @Autowired private CallSrmServices srm; private static final Logger logger_41a64316 = LoggerFactory.getLogger(OaSrmVendorSyncAction.class); @@ -156,7 +158,8 @@ public class OaSrmVendorSyncAction extends BaseBean implements Action, EsbServer oainputvendor.setSyncErp(Integer.valueOf(sftserp)); } int dtcount = 0; - String sql = "select b.* from e10_core_business.dbo." + tablename + " a,e10_core_business.dbo." + tablename + "_dt3 b where a.form_data_id=b.form_data_id and a.id=" + requestid; + String detailTablename3 = commonDevUtil.getDetailTableName(tablename,"3"); + String sql = "select b.* from e10_core_business.dbo." + tablename + " a,e10_core_business.dbo." + detailTablename3 + " b where a.form_data_id=b.form_data_id and a.id=" + requestid; logger_41a64316.error(String.valueOf("sql-->" + sql)); String poolname = CONN_TYPE.workflow.getType(); // TODO E10执行sql方法第二参数必须指定源,默认使用流程源,单体客户无需修改,微服务/组合客户需根据查询表所属服务切换源,或使用外部数据源 @@ -238,7 +241,8 @@ public class OaSrmVendorSyncAction extends BaseBean implements Action, EsbServer Row[] sq = null; if(dtq != null){sq = dtq.getRow();} int dtcount = 0; - String sql = "select distinct wlh from e10_core_business.dbo." + tablename + " a,e10_core_business.dbo." + tablename + "_dt2 b where a.form_data_id=b.form_data_id and a.id =" + requestid; + String detailTablename = commonDevUtil.getDetailTableName(tablename,"2"); + String sql = "select distinct wlh from e10_core_business.dbo." + tablename + " a,e10_core_business.dbo." + detailTablename + " b where a.form_data_id=b.form_data_id and a.id =" + requestid; logger_41a64316.error("sql-->" + sql); String poolname_wk = CONN_TYPE.workflow.getType(); // TODO E10执行sql方法第二参数必须指定源,默认使用流程源,单体客户无需修改,微服务/组合客户需根据查询表所属服务切换源,或使用外部数据源 diff --git a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/TransferBillToK3Action.java b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/TransferBillToK3Action.java index 7dfe805..1f32939 100644 --- a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/TransferBillToK3Action.java +++ b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/TransferBillToK3Action.java @@ -8,6 +8,7 @@ import com.weaver.seconddev.interfaces.swfa.BillFieldUtil; import java.text.SimpleDateFormat; import java.util.*; import com.weaver.common.i18n.tool.util.I18nContextUtil; +import com.weaver.seconddev.interfaces.workflow.util.CommonDevUtil; import com.weaver.verupgrade.conn.CONN_TYPE; import java.lang.*; import com.weaver.verupgrade.workflow.request.RequestManager; @@ -42,6 +43,8 @@ public class TransferBillToK3Action extends BaseBean implements Action, EsbServe @Autowired private TransferBillService service ; + @Autowired + private CommonDevUtil commonDevUtil; private static final Logger logger_1a36f94a = LoggerFactory.getLogger(TransferBillToK3Action.class); @Override @@ -143,13 +146,15 @@ public class TransferBillToK3Action extends BaseBean implements Action, EsbServe String[] str = service.call(req); logger_1a36f94a.error(String.valueOf("TransferBillToK3Action--info-" + requestid + " [" + str[0] + "," + str[1] + "]")); message = str[1]; + + String detailTablename = commonDevUtil.getDetailTableName(tablename,"1"); if ("0".equals(str[0])) { requestinfo.getRequestManager().setMessageid("ERROR"); requestinfo.getRequestManager().setMessagecontent("K3系统返回错误信息:" + str[1]); return WeaResult.fail(500, "TransferBillToK3Action str[1]"+ str[1], getResultMapForAction(weaverResultMap, "result", str[1], requestinfo.getRequestManager())); } if (str[3].length() > 0) { - sql = "update e10_core_business.dbo." + tablename + "_dt1 set tbzt=1 where ckbm in (" + str[3].substring(0, str[3].length() - 1) + ") and form_data_id =(select form_data_id from e10_core_business.dbo." + tablename + " where id=" + requestid + ")"; + sql = "update e10_core_business.dbo." + detailTablename + " set tbzt=1 where ckbm in (" + str[3].substring(0, str[3].length() - 1) + ") and form_data_id =(select form_data_id from e10_core_business.dbo." + tablename + " where id=" + requestid + ")"; logger_1a36f94a.error("sql--"+sql); String poolname = CONN_TYPE.workflow.getType(); // TODO E10执行sql方法第二参数必须指定源,默认使用流程源,单体客户无需修改,微服务/组合客户需根据查询表所属服务切换源,或使用外部数据源 @@ -158,7 +163,7 @@ public class TransferBillToK3Action extends BaseBean implements Action, EsbServe logger_1a36f94a.error(String.valueOf(requestid + "调拨单成功的:" + sql)); } if (str[2].length() > 0) { - sql = "update e10_core_business.dbo." + tablename + "_dt1 set tbzt=0 where ckbm in (" + str[2].substring(0, str[2].length() - 1) + ") and form_data_id =(select form_data_id from e10_core_business.dbo." + tablename + " where id=" + requestid + ")"; + sql = "update e10_core_business.dbo." + detailTablename + " set tbzt=0 where ckbm in (" + str[2].substring(0, str[2].length() - 1) + ") and form_data_id =(select form_data_id from e10_core_business.dbo." + tablename + " where id=" + requestid + ")"; logger_1a36f94a.error("sql--"+sql); String poolname_ji = CONN_TYPE.workflow.getType(); // TODO E10执行sql方法第二参数必须指定源,默认使用流程源,单体客户无需修改,微服务/组合客户需根据查询表所属服务切换源,或使用外部数据源 @@ -167,7 +172,7 @@ public class TransferBillToK3Action extends BaseBean implements Action, EsbServe logger_1a36f94a.error(String.valueOf(requestid + "调拨单失败的:" + sql)); } if (str[2].length() == 0 && str[3].length() == 0) { - sql = "update e10_core_business.dbo." + tablename + "_dt1 set tbzt=0 where (tbzt is null or tbzt !=1) and form_data_id =(select form_data_id from e10_core_business.dbo." + tablename + " where id=" + requestid + ")"; + sql = "update e10_core_business.dbo." + detailTablename + " set tbzt=0 where (tbzt is null or tbzt !=1) and form_data_id =(select form_data_id from e10_core_business.dbo." + tablename + " where id=" + requestid + ")"; logger_1a36f94a.error("sql--"+sql); String poolname_19 = CONN_TYPE.workflow.getType(); // TODO E10执行sql方法第二参数必须指定源,默认使用流程源,单体客户无需修改,微服务/组合客户需根据查询表所属服务切换源,或使用外部数据源 diff --git a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/UpdateTaskNumber.java b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/UpdateTaskNumber.java index ec5ccaa..e51ad76 100644 --- a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/UpdateTaskNumber.java +++ b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/UpdateTaskNumber.java @@ -6,6 +6,7 @@ import com.weaver.ebuilder.datasource.api.entity.ExecuteSqlEntity; import com.weaver.ebuilder.datasource.api.enums.SourceType; import com.weaver.ebuilder.datasource.api.service.DataSetService; import com.weaver.framework.rpc.context.impl.TenantRpcContext; +import com.weaver.seconddev.interfaces.workflow.util.CommonDevUtil; import com.weaver.teams.api.tenant.Tenant; import com.weaver.verupgrade.conn.CONN_TYPE; import java.lang.*; @@ -35,6 +36,9 @@ public class UpdateTaskNumber implements Action, EsbServerlessRpcRemoteInterface @Autowired private DataSetService dataSetService; + @Autowired + private CommonDevUtil commonDevUtil; + private static final Logger logger_2c12a616 = LoggerFactory.getLogger(UpdateTaskNumber.class); public WeaResult> execute(Map requestInfoMap) { @@ -59,7 +63,10 @@ public class UpdateTaskNumber implements Action, EsbServerlessRpcRemoteInterface RecordSet rs = I18nContextUtil.getBean(RecordSet.class); String requestId = paramRequestInfo.getRequestid(); String tablename = paramRequestInfo.getRequestManager().getBillTableName(); - String sql = "select t.id from e10_core_business.dbo." + tablename + "_dt1 t left join e10_core_business.dbo." + tablename + " a on a.form_data_id = t.form_data_id where a.id = " + requestId + " order by t.id"; + + String detailTablename = commonDevUtil.getDetailTableName(tablename,"1"); + + String sql = "select t.id from e10_core_business.dbo." + detailTablename + " t left join e10_core_business.dbo." + tablename + " a on a.form_data_id = t.form_data_id where a.id = " + requestId + " order by t.id"; logger_2c12a616.error(String.valueOf("sql=" + sql)); String poolname = CONN_TYPE.workflow.getType(); // TODO E10执行sql方法第二参数必须指定源,默认使用流程源,单体客户无需修改,微服务/组合客户需根据查询表所属服务切换源,或使用外部数据源 @@ -75,7 +82,8 @@ public class UpdateTaskNumber implements Action, EsbServerlessRpcRemoteInterface } else { seq = (k + 1) + ""; } - String sql1 = "update e10_core_business.dbo." + tablename + "_dt1 set rwbh='" + rwbh + "_" + seq + "' where id=" + id; + + String sql1 = "update e10_core_business.dbo." + detailTablename + " set rwbh='" + rwbh + "_" + seq + "' where id=" + id; // logger_2c12a616.error(String.valueOf("sql1=" + sql1)); // String poolname_dw = CONN_TYPE.workflow.getType(); // // TODO E10执行sql方法第二参数必须指定源,默认使用流程源,单体客户无需修改,微服务/组合客户需根据查询表所属服务切换源,或使用外部数据源 diff --git a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_MM_PR_RELEASEAction.java b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_MM_PR_RELEASEAction.java index da5a44c..619d2be 100644 --- a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_MM_PR_RELEASEAction.java +++ b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZOA_MM_PR_RELEASEAction.java @@ -9,6 +9,7 @@ import java.util.List; import java.util.Map; import com.weaver.seconddev.interfaces.workflow.entity.GeneralEntity; import com.weaver.common.i18n.tool.util.I18nContextUtil; +import com.weaver.seconddev.interfaces.workflow.util.CommonDevUtil; import com.weaver.verupgrade.conn.CONN_TYPE; import java.lang.*; import java.util.*; @@ -38,6 +39,8 @@ public class ZOA_MM_PR_RELEASEAction extends BaseBean implements Action, EsbServ @Autowired private RequestInfo requestInfoTemp; + @Autowired + private CommonDevUtil commonDevUtil; private static final Logger logger_41a94d2d = LoggerFactory.getLogger(ZOA_MM_PR_RELEASEAction.class); public ZOA_MM_PR_RELEASEAction() { @@ -126,7 +129,10 @@ public class ZOA_MM_PR_RELEASEAction extends BaseBean implements Action, EsbServ obj[1] = msg2; obj[2] = id; obj[3] = cgdh; - String sql = "update e10_core_business.dbo." + tablename + "_dt1 set state = ? , msg = ? where form_data_id = ? and cgdh= ?"; + + String detailTablename = commonDevUtil.getDetailTableName(tablename,"1"); + + String sql = "update e10_core_business.dbo." + detailTablename + " set state = ? , msg = ? where form_data_id = ? and cgdh= ?"; logger_41a94d2d.error(String.valueOf("ZOA_MM_PR_RELEASEAction ----- sql = " + sql)); String poolname_nt = CONN_TYPE.workflow.getType(); // TODO E10执行sql方法第二参数必须指定源,默认使用流程源,单体客户无需修改,微服务/组合客户需根据查询表所属服务切换源,或使用外部数据源 diff --git a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZSR_PUR_INFO_OEM_Action.java b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZSR_PUR_INFO_OEM_Action.java index e402e16..47ab5a8 100644 --- a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZSR_PUR_INFO_OEM_Action.java +++ b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/action/ZSR_PUR_INFO_OEM_Action.java @@ -5,6 +5,7 @@ import com.weaver.seconddev.interfaces.swfa.BillFieldUtil; import java.util.HashMap; import java.util.Map; import com.weaver.common.i18n.tool.util.I18nContextUtil; +import com.weaver.seconddev.interfaces.workflow.util.CommonDevUtil; import com.weaver.verupgrade.conn.CONN_TYPE; import java.lang.*; import java.util.*; @@ -34,7 +35,8 @@ public class ZSR_PUR_INFO_OEM_Action extends BaseBean implements Action, EsbServ // 对应E9的请求信息对象 @Autowired private RequestInfo requestInfoTemp; - + @Autowired + private CommonDevUtil commonDevUtil; private static final Logger logger_adc1e038 = LoggerFactory.getLogger(ZSR_PUR_INFO_OEM_Action.class); @Override @@ -67,7 +69,10 @@ public class ZSR_PUR_INFO_OEM_Action extends BaseBean implements Action, EsbServ StringBuilder sb = new StringBuilder(); String state = ""; int mxcount = 0; - String sql = "select count(b.id) as mxcount from e10_core_business.dbo." + tablename + " a,e10_core_business.dbo." + tablename + "_dt1 b where a.form_data_id = b.form_data_id and a.id =" + requestid + " and isnull(sfbjsc,1)<>0"; + + String detailTablename = commonDevUtil.getDetailTableName(tablename,"1"); + + String sql = "select count(b.id) as mxcount from e10_core_business.dbo." + tablename + " a,e10_core_business.dbo." + detailTablename + " b where a.form_data_id = b.form_data_id and a.id =" + requestid + " and isnull(sfbjsc,1)<>0"; logger_adc1e038.error("sql -----"+ sql); String poolname = CONN_TYPE.workflow.getType(); // TODO E10执行sql方法第二参数必须指定源,默认使用流程源,单体客户无需修改,微服务/组合客户需根据查询表所属服务切换源,或使用外部数据源 diff --git a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/util/CommonDevUtil.java b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/util/CommonDevUtil.java index d68cf95..e3180dc 100644 --- a/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/util/CommonDevUtil.java +++ b/secondev-history-action/src/main/java/com/weaver/seconddev/interfaces/workflow/util/CommonDevUtil.java @@ -1,6 +1,7 @@ package com.weaver.seconddev.interfaces.workflow.util; import com.weaver.common.i18n.tool.util.I18nContextUtil; +import com.weaver.common.i18n.tool.util.Util; import com.weaver.verupgrade.conn.CONN_TYPE; import com.weaver.verupgrade.conn.RecordSet; import io.protostuff.Service; @@ -21,4 +22,18 @@ public class CommonDevUtil { return id; } + + public String getDetailTableName(String maintable,String order) { + RecordSet rs = I18nContextUtil.getBean(RecordSet.class); + String poolname = CONN_TYPE.workflow.getType(); + String tableName = ""; + String sql = "select table_name from e10_core_business.dbo.form_table where form_id in( select id from e10_core_business.dbo.sub_form where form_id in( select form_id from e10_core_business.dbo.form_table where table_name='"+maintable+"') and show_order="+order+")"; + //log.error(sql); + rs.executeSql(sql, poolname); + if (rs.next()) { + tableName = Util.null2String(rs.getString("table_name")); + } + return tableName; + } + }