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 881179291..c668f8b75 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 @@ -2,6 +2,7 @@ package com.cf.imes.module.executor.controller.admin.order; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator; +import com.cf.imes.framework.common.exception.ServiceException; import com.cf.imes.framework.common.pojo.CommonResult; import com.cf.imes.framework.common.pojo.PageParam; import com.cf.imes.framework.common.pojo.PageResult; @@ -233,7 +234,10 @@ public class OrderController { } log.error(errKey, e); - return error(500 , e.getMessage()); + assert e instanceof ServiceException; + ServiceException cause = (ServiceException) e; + + return error(cause.getCode(),cause.getMessage()); } finally { redisLockUtil.unlock(lockKey); @@ -293,7 +297,7 @@ public class OrderController { String customOrderNo = mapOrder.get(ProduceExcelConstants.ORDER_CUSTOM_ORDER_NO); if (index == 0 && customOrderNo != null && !orderService.customOrderNoIsExists(customOrderNo)) { - mapOrder.put(ProduceExcelConstants.ORDER_CUSTOM_ORDER_NO, customOrderNo + "重复"); + mapOrder.put(ProduceExcelConstants.ORDER_CUSTOM_ORDER_NO, customOrderNo + "---< 自定义单号重复 >---"); flag = false; } diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/files/excel/ExcelCheckListUtil.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/files/excel/ExcelCheckListUtil.java index 8c7db2d66..a15c13cef 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/files/excel/ExcelCheckListUtil.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/files/excel/ExcelCheckListUtil.java @@ -89,11 +89,11 @@ public class ExcelCheckListUtil { .organId(OrganContextHolder.getOrganId()) .dataType(DataTypeEnum.FILE_IMPORT.getStatus()) .orderDate(LocalDateTime.now()) - .customer(ProduceExcelConstants.ORDER_CUSTOMER) + .customer(orderMap.get(ProduceExcelConstants.ORDER_CUSTOMER)) .customOrderNo(orderMap.get(ProduceExcelConstants.ORDER_CUSTOM_ORDER_NO)) .dealer(orderMap.get(ProduceExcelConstants.ORDER_DEALER)) .dealerPhoneNumber(orderMap.get(ProduceExcelConstants.ORDER_DEALER_PHONE_NUMBER)) - .address(orderMap.get(ProduceExcelConstants.ORDER_CUSTOMER)) + .address(orderMap.get(ProduceExcelConstants.ORDER_ADDRESS)) .phoneNumber(orderMap.get(ProduceExcelConstants.ORDER_PHONE_NUMBER)) .salesman(orderMap.get(ProduceExcelConstants.ORDER_SALESMAN)) .splitter(orderMap.get(ProduceExcelConstants.ORDER_SPLITTER)) diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/files/excel/ExcelTypeRealize.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/files/excel/ExcelTypeRealize.java index d08d23ea0..9c98f23b6 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/files/excel/ExcelTypeRealize.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/files/excel/ExcelTypeRealize.java @@ -54,7 +54,7 @@ public class ExcelTypeRealize { final String NOT_ASSIGNED = "未命名"; final String PLATE = "plate"; final String PARTS = "parts"; - + final String NO_CODE = "no_code_1132589&"; // 数据转换 + 错误验证 public Map changeDate(List excelVOS, Long orderId) { @@ -81,11 +81,11 @@ public class ExcelTypeRealize { Map> goodsIdMap = checkMap.get(PLATE).stream().collect( Collectors.groupingBy( - excelVO -> excelVO.getGoodsId() != null ? excelVO.getGoodsId() : " ", + excelVO -> excelVO.getGoodsId() != null && !StringUtils.isEmpty(excelVO.getGoodsId())? excelVO.getGoodsId() : NO_CODE, Collectors.toList() )); goodsIdMap.forEach((key, value) -> { - if (key.equals(" ")) { // 没有商品编号的 value.get(0).getGoodsId() == null + if (NO_CODE.equals(key)) { // 没有商品编号的 value.get(0).getGoodsId() == null // 将相同条件的元素归为一个集合 Map, List> goodsMap = value.stream() .collect(Collectors.groupingBy( @@ -138,11 +138,11 @@ public class ExcelTypeRealize { // 配件信息合集,添加生产单id,添加生产单配件设计端商品编码,配件信息写入order_parts Map> partsIdMap = checkMap.get(PARTS).stream().collect( Collectors.groupingBy( - excelVO -> excelVO.getGoodsId() != null ? excelVO.getGoodsId() : "", + excelVO -> excelVO.getGoodsId() != null && !StringUtils.isEmpty(excelVO.getGoodsId())? excelVO.getGoodsId() : " ", Collectors.toList() )); partsIdMap.forEach((key, value) -> { - if (key.equals("")) { // 没有商品编号的 value.get(0).getGoodsId() == null + if (key.equals(" ")) { // 没有商品编号的 value.get(0).getGoodsId() == null // 将相同条件的元素归为一个集合 Map, List> partsMap = value.stream() .collect(Collectors.groupingBy( @@ -225,7 +225,7 @@ public class ExcelTypeRealize { // 房间名称为条件进行分组 Map> roomCollect = excelVOS.stream().collect( Collectors.groupingBy( - excelVO -> excelVO.getRoomsName() != null ? excelVO.getRoomsName() : NOT_ASSIGNED, + excelVO -> excelVO.getRoomsName() != null && !StringUtils.isEmpty(excelVO.getRoomsName())? excelVO.getRoomsName() : NOT_ASSIGNED, Collectors.toList() )); @@ -234,7 +234,7 @@ public class ExcelTypeRealize { // 柜体名称为条件进行分组 Map> bodyCollect = listRoom.stream() .collect(Collectors.groupingBy( - excelVO -> excelVO.getCabinetsName() != null ? excelVO.getCabinetsName() : NOT_ASSIGNED, + excelVO -> excelVO.getCabinetsName() != null && !StringUtils.isEmpty(excelVO.getCabinetsName())? excelVO.getCabinetsName() : NOT_ASSIGNED, Collectors.toList() )); @@ -249,7 +249,7 @@ public class ExcelTypeRealize { // 加工组类型为条件进行分组 Map> synthesisCollect = listBody.stream() .collect(Collectors.groupingBy( - excelVO -> excelVO.getSynthesisTypeName() != null ? excelVO.getSynthesisTypeName() : " ", + excelVO -> excelVO.getSynthesisTypeName() != null && !StringUtils.isEmpty(excelVO.getSynthesisTypeName()) ? excelVO.getSynthesisTypeName() : " ", Collectors.toList() )); @@ -258,7 +258,7 @@ public class ExcelTypeRealize { // 加工组名称为条件进行分组 Map> combinationNameCollect = listSynthesis.stream() .collect(Collectors.groupingBy( - excelVO -> excelVO.getCombinationName() != null ? excelVO.getCombinationName() : " ", + excelVO -> excelVO.getCombinationName() != null && !StringUtils.isEmpty(excelVO.getCombinationName())? excelVO.getCombinationName() : " ", Collectors.toList() )); combinationNameCollect.forEach((combinationName, listCombinationName) -> {