显式空指针问题修复

This commit is contained in:
gaoqr
2025-01-14 11:32:31 +08:00
parent 765b0c3a47
commit 4fb49825b6
3 changed files with 9 additions and 12 deletions
@@ -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 {
@@ -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<String, OrderGroupDO> groupInfos,
Map<String, Map<String, BasePosition>> boxBasePositionMap,
Map<String, BasePosition> 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();