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; + } }