From 4fb49825b6148351b9ccf3b66c86a8ffeb18af22 Mon Sep 17 00:00:00 2001 From: gaoqr <13665037151@163.com> Date: Tue, 14 Jan 2025 11:32:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=BE=E5=BC=8F=E7=A9=BA=E6=8C=87=E9=92=88?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/ChenfengMybatisAutoConfiguration.java | 2 +- .../controller/admin/order/OrderController.java | 10 +++++----- .../fileConversion/admin/files/xml/XmlTypeRealize.java | 9 +++------ 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/cf-framework/cf-spring-boot-starter-mybatis/src/main/java/com/cf/imes/framework/mybatis/config/ChenfengMybatisAutoConfiguration.java b/cf-framework/cf-spring-boot-starter-mybatis/src/main/java/com/cf/imes/framework/mybatis/config/ChenfengMybatisAutoConfiguration.java index f69420a5a..1cca14d3b 100644 --- a/cf-framework/cf-spring-boot-starter-mybatis/src/main/java/com/cf/imes/framework/mybatis/config/ChenfengMybatisAutoConfiguration.java +++ b/cf-framework/cf-spring-boot-starter-mybatis/src/main/java/com/cf/imes/framework/mybatis/config/ChenfengMybatisAutoConfiguration.java @@ -72,7 +72,7 @@ public class ChenfengMybatisAutoConfiguration { } } // 找不到合适的 IKeyGenerator 实现类 - throw new IllegalArgumentException(CharSequenceUtil.format("DbType{} 找不到合适的 IKeyGenerator 实现类", dbType)); + throw new IllegalArgumentException("DbType为空"); } } diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/OrderController.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/OrderController.java index c668f8b75..e4732d000 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/OrderController.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/OrderController.java @@ -1,5 +1,6 @@ package com.cf.imes.module.executor.controller.admin.order; +import cn.hutool.core.util.ObjectUtil; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator; import com.cf.imes.framework.common.exception.ServiceException; @@ -48,7 +49,6 @@ import javax.validation.constraints.NotEmpty; import java.io.File; import java.util.*; import java.util.concurrent.ExecutionException; -import java.util.concurrent.atomic.AtomicBoolean; import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception; import static com.cf.imes.framework.common.pojo.CommonResult.error; @@ -382,10 +382,10 @@ public class OrderController { } // 进行判断,为空,写入时出现了错误,数据库数据回滚,此时删除 ES 里的数据 - OrderDO order = orderMapper.selectById(orderDO.getId()); - if (order == null) { - orderInputProcessor.deleteByOrderId(orderDO.getId(), ORDER_PLATE_MODEL); - orderInputProcessor.deleteByOrderId(orderDO.getId(), ORDER_PLATE_MODEL_COMPRESS); + if (ObjectUtil.isNotNull(orderDO) && ObjectUtil.isNotNull(orderMapper.selectById(orderDO.getId()))) { + Long deleteOrderId = orderDO.getId(); + orderInputProcessor.deleteByOrderId(deleteOrderId, ORDER_PLATE_MODEL); + orderInputProcessor.deleteByOrderId(deleteOrderId, ORDER_PLATE_MODEL_COMPRESS); } } finally { diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/files/xml/XmlTypeRealize.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/files/xml/XmlTypeRealize.java index f7b2b3028..f089b3718 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/files/xml/XmlTypeRealize.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/files/xml/XmlTypeRealize.java @@ -1,5 +1,7 @@ package com.cf.imes.module.executor.util.fileConversion.admin.files.xml; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.alibaba.nacos.common.utils.StringUtils; @@ -793,12 +795,7 @@ public class XmlTypeRealize { Map groupInfos, Map> boxBasePositionMap, Map roomBasePositions) { - - if (blockXmlVOS != null && blockXmlVOS.getBlockXmlVOList() == null || blockXmlVOS.getBlockXmlVOList().isEmpty()) { - - } - - if (blockXmlVOS != null && blockXmlVOS.getBlockXmlVOList() != null && !blockXmlVOS.getBlockXmlVOList().isEmpty()) { + if (ObjectUtil.isNotNull(blockXmlVOS) && CollUtil.isNotEmpty(blockXmlVOS.getBlockXmlVOList())) { for (BlockXmlVO blockXmlVO : blockXmlVOS.getBlockXmlVOList()) { long plateNo = idWorker.nextId();