From 8696c025af6d7ea55641783c0d4e8a409b5b2110 Mon Sep 17 00:00:00 2001 From: dxfeng Date: Mon, 4 Sep 2023 10:06:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=9B=E8=81=98=E9=9C=80=E6=B1=82=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E6=98=8E=E7=BB=86=E8=A1=A8=E6=95=B0=E6=8D=AE=E8=BD=AC?= =?UTF-8?q?=E5=BB=BA=E6=A8=A1=E5=8F=B0=E8=B4=A6Action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../action/RecruitFlowToModeAction.java | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/weaver/interfaces/recruit/action/RecruitFlowToModeAction.java b/src/weaver/interfaces/recruit/action/RecruitFlowToModeAction.java index 3878e84..cd54680 100644 --- a/src/weaver/interfaces/recruit/action/RecruitFlowToModeAction.java +++ b/src/weaver/interfaces/recruit/action/RecruitFlowToModeAction.java @@ -1,6 +1,7 @@ package weaver.interfaces.recruit.action; import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import weaver.conn.RecordSetTrans; import weaver.general.BaseBean; import weaver.interfaces.workflow.action.Action; @@ -19,14 +20,7 @@ import java.util.Map; * @version: 1.0 */ public class RecruitFlowToModeAction implements Action { - /** - * 流程主表表名(uf_zpxqjh) - */ - private static final String MAIN_TABLE_NAME = "uf_zpxqjh"; - /** - * 流程明细表表名(uf_zpxqjh_dt1) - */ - private static final String DETAIL_TABLE_NAME = "uf_zpxqjh_dt1"; + /** * 建模台账表表名(uf_zpxq) */ @@ -34,16 +28,11 @@ public class RecruitFlowToModeAction implements Action { @Override public String execute(RequestInfo requestInfo) { - String billTableName = requestInfo.getRequestManager().getBillTableName(); MainTableInfo mainTableInfo = requestInfo.getMainTableInfo(); DetailTableInfo detailTableInfo = requestInfo.getDetailTableInfo(); DetailTable detailTable = detailTableInfo.getDetailTable(0); - String detailTableName = detailTable.getTableDBName(); - if (!MAIN_TABLE_NAME.equals(billTableName) || !DETAIL_TABLE_NAME.equals(detailTableName)) { - requestInfo.getRequestManager().setMessagecontent("接口动作【RecruitFlowToModeAction】未适配当前流程,请检查流程配置"); - return FAILURE_AND_CONTINUE; - } + Map mainMap = new HashMap<>(16); // 需求审批流程ID mainMap.put("xqsplc", requestInfo.getRequestid()); @@ -59,7 +48,7 @@ public class RecruitFlowToModeAction implements Action { detailMap.putAll(mainMap); Cell[] cells = row.getCell(); for (Cell cell : cells) { - detailMap.put(cell.getName(), cell.getValue()); + detailMap.put(cell.getName(), parseBlankToNull(cell.getValue())); } insertList.add(detailMap); } @@ -148,4 +137,14 @@ public class RecruitFlowToModeAction implements Action { paramList.add(param); } } + + /** + * 将空字符串转化为NULL + * + * @param str + * @return + */ + private Object parseBlankToNull(String str) { + return StringUtils.isBlank(str) ? null : str; + } }