显式空指针问题修复

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
@@ -72,7 +72,7 @@ public class ChenfengMybatisAutoConfiguration {
} }
} }
// 找不到合适的 IKeyGenerator 实现类 // 找不到合适的 IKeyGenerator 实现类
throw new IllegalArgumentException(CharSequenceUtil.format("DbType{} 找不到合适的 IKeyGenerator 实现类", dbType)); throw new IllegalArgumentException("DbType为空");
} }
} }
@@ -1,5 +1,6 @@
package com.cf.imes.module.executor.controller.admin.order; package com.cf.imes.module.executor.controller.admin.order;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator; import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
import com.cf.imes.framework.common.exception.ServiceException; import com.cf.imes.framework.common.exception.ServiceException;
@@ -48,7 +49,6 @@ import javax.validation.constraints.NotEmpty;
import java.io.File; import java.io.File;
import java.util.*; import java.util.*;
import java.util.concurrent.ExecutionException; 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.exception.util.ServiceExceptionUtil.exception;
import static com.cf.imes.framework.common.pojo.CommonResult.error; import static com.cf.imes.framework.common.pojo.CommonResult.error;
@@ -382,10 +382,10 @@ public class OrderController {
} }
// 进行判断,为空,写入时出现了错误,数据库数据回滚,此时删除 ES 里的数据 // 进行判断,为空,写入时出现了错误,数据库数据回滚,此时删除 ES 里的数据
OrderDO order = orderMapper.selectById(orderDO.getId()); if (ObjectUtil.isNotNull(orderDO) && ObjectUtil.isNotNull(orderMapper.selectById(orderDO.getId()))) {
if (order == null) { Long deleteOrderId = orderDO.getId();
orderInputProcessor.deleteByOrderId(orderDO.getId(), ORDER_PLATE_MODEL); orderInputProcessor.deleteByOrderId(deleteOrderId, ORDER_PLATE_MODEL);
orderInputProcessor.deleteByOrderId(orderDO.getId(), ORDER_PLATE_MODEL_COMPRESS); orderInputProcessor.deleteByOrderId(deleteOrderId, ORDER_PLATE_MODEL_COMPRESS);
} }
} finally { } finally {
@@ -1,5 +1,7 @@
package com.cf.imes.module.executor.util.fileConversion.admin.files.xml; 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.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.alibaba.nacos.common.utils.StringUtils; import com.alibaba.nacos.common.utils.StringUtils;
@@ -793,12 +795,7 @@ public class XmlTypeRealize {
Map<String, OrderGroupDO> groupInfos, Map<String, OrderGroupDO> groupInfos,
Map<String, Map<String, BasePosition>> boxBasePositionMap, Map<String, Map<String, BasePosition>> boxBasePositionMap,
Map<String, BasePosition> roomBasePositions) { Map<String, BasePosition> roomBasePositions) {
if (ObjectUtil.isNotNull(blockXmlVOS) && CollUtil.isNotEmpty(blockXmlVOS.getBlockXmlVOList())) {
if (blockXmlVOS != null && blockXmlVOS.getBlockXmlVOList() == null || blockXmlVOS.getBlockXmlVOList().isEmpty()) {
}
if (blockXmlVOS != null && blockXmlVOS.getBlockXmlVOList() != null && !blockXmlVOS.getBlockXmlVOList().isEmpty()) {
for (BlockXmlVO blockXmlVO : blockXmlVOS.getBlockXmlVOList()) { for (BlockXmlVO blockXmlVO : blockXmlVOS.getBlockXmlVOList()) {
long plateNo = idWorker.nextId(); long plateNo = idWorker.nextId();