From 5ba3b46d7d93175d901df4b9eb65602286fa43f1 Mon Sep 17 00:00:00 2001 From: wangxuanran <3055088966@qq.com> Date: Mon, 10 Jul 2023 16:14:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=B2=E7=AA=81=E6=8F=90=E4=BA=A4=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../action/ChildWorkFlowSplitAction.java | 12 ++++++------ src/test/java/builderpackage/AutoPackageJar.java | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/weaver/xuanran/wang/ajx/work_flow_split/action/ChildWorkFlowSplitAction.java b/src/main/java/weaver/xuanran/wang/ajx/work_flow_split/action/ChildWorkFlowSplitAction.java index 28cc18b..f8588b6 100644 --- a/src/main/java/weaver/xuanran/wang/ajx/work_flow_split/action/ChildWorkFlowSplitAction.java +++ b/src/main/java/weaver/xuanran/wang/ajx/work_flow_split/action/ChildWorkFlowSplitAction.java @@ -68,7 +68,7 @@ public class ChildWorkFlowSplitAction extends SafeCusBaseAction { log.error("detail " + selectDetailNo + " table info is empty!"); return; } - Set accountNumber = detailInfo.stream().map(item -> item.get(selectAccountNumberField)).collect(Collectors.toSet()); + Set accountNumber = detailInfo.stream().map(item -> Util.null2DefaultStr(item.get(selectAccountNumberField),"")).filter(StringUtils::isNotBlank).collect(Collectors.toSet()); if(CollectionUtils.isEmpty(accountNumber) || accountNumber.size() == 1){ log.error("明细数据根据帐套号分组后为空, 或不存在多个帐套!"); log.info("accountNumber : [ " + JSONObject.toJSONString(accountNumber) + " ]"); @@ -81,6 +81,10 @@ public class ChildWorkFlowSplitAction extends SafeCusBaseAction { if (!mapper.updateMainTable(billTable, hasMoreAccountField, hasMoreAccountFieldValue, requestId)) { throw new CustomerException("更新主表是否包含多账套字段失败!"); } + // 如果插入表的帐套号字段名配置为空 那么与插入表的字段名保持一致 + if(StringUtils.isBlank(this.insertAccountNumberField)){ + this.insertAccountNumberField = selectAccountNumberField; + } List> insertList = accountNumber.stream() .map(item -> { Map map = new HashMap<>(); @@ -88,11 +92,7 @@ public class ChildWorkFlowSplitAction extends SafeCusBaseAction { map.put("insertAccountNumber", item); return map; }).collect(Collectors.toList()); - // 如果插入表的帐套号字段名配置为空 那么与插入表的字段名保持一致 - if(StringUtils.isBlank(this.insertAccountNumberField)){ - this.insertAccountNumberField = selectAccountNumberField; - } - boolean delete = mapper.selectAccountNumber(mainMap.get("id"), billTable + "_dt" + insertDetailNo); + boolean delete = mapper.selectAccountNumber(id, billTable + "_dt" + insertDetailNo); if(!delete){ throw new CustomerException("删除明细表数据失败!"); } diff --git a/src/test/java/builderpackage/AutoPackageJar.java b/src/test/java/builderpackage/AutoPackageJar.java index be6d848..d8c91b4 100644 --- a/src/test/java/builderpackage/AutoPackageJar.java +++ b/src/test/java/builderpackage/AutoPackageJar.java @@ -25,7 +25,7 @@ public class AutoPackageJar { public static void createJar(String targetPath) { String path = AutoPackageJar.class.getResource("").getPath(); - String finalPath = path.split(File.separator + targetPath)[0] + File.separator + targetPath + File.separator + FileTreeBuilder.classPath; + String finalPath = path.split(File.separator + targetPath)[0] + File.separator + targetPath + FileTreeBuilder.classPath; createJar(finalPath + "aiyh", finalPath + "aiyh_utils.jar"); createJar(finalPath + "ebu7common", finalPath + "ebu7common.jar"); }