From 280beb808a50c347d54f091945c5eff38a70a54b Mon Sep 17 00:00:00 2001 From: lym <1994302445@qq.com> Date: Tue, 25 Jun 2024 09:12:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=87=E6=B3=A8=E4=BF=A1=E6=81=AF=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/order/OrderController.java | 4 ++-- .../mysql/orderParts/OrderPartsMapper.java | 23 +------------------ .../service/order/OrderServiceImpl.java | 17 ++++++-------- .../admin/api/webcad/ApiTypeRealize.java | 14 ++++++----- .../mapper/orderParts/OrderPartsMapper.xml | 1 + .../resources/mapper/plate/PlateMapper.xml | 1 + .../service/plate/PlateServiceImpl.java | 2 +- 7 files changed, 21 insertions(+), 41 deletions(-) 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 f8197359c..6806ceed4 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 @@ -248,7 +248,7 @@ public class OrderController { // 读取文件 excelReadUtil.setErr(0); Map map = excelReadUtil.read(file); - System.out.println(" map " + map); +// System.out.println(" map " + map); System.err.println(excelReadUtil.isErr()); // 判断是否读取有误 if (excelReadUtil.isErr() == -1) { // 文件为空 @@ -256,7 +256,7 @@ public class OrderController { return; }else if (excelReadUtil.isErr() > 0) { // 返回文件 - System.out.println("(Map) " + (Map) map.get("order")+ " , (List)" +(List) map.get("plate")); +// System.out.println("(Map) " + (Map) map.get("order")+ " , (List)" +(List) map.get("plate")); ExcelWriterUtil.write(response, (Map) map.get("order"), (List) map.get("plate"), orderService.getSavePath() + File.separator + "生产单Excel导入错误导出模板.xlsx"); return; } else { diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/orderParts/OrderPartsMapper.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/orderParts/OrderPartsMapper.java index e35d47934..53d0baa94 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/orderParts/OrderPartsMapper.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/orderParts/OrderPartsMapper.java @@ -4,20 +4,15 @@ import java.util.*; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.cf.imes.framework.common.exception.ServiceException; import com.cf.imes.framework.common.pojo.PageResult; -import com.cf.imes.framework.common.util.object.BeanUtils; import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX; import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX; import com.cf.imes.module.executor.controller.admin.plan.saveOptimize.PrintOrderPartsRespVO; -import com.cf.imes.module.executor.controller.admin.plate.vo.PlateGoodsRespVO; -import com.cf.imes.module.executor.controller.admin.plate.vo.PlateRespVO; -import com.cf.imes.module.executor.dal.dataobject.goods.GoodsDO; import com.cf.imes.module.executor.dal.dataobject.orderParts.OrderPartsDO; import org.apache.ibatis.annotations.Mapper; import com.cf.imes.module.executor.controller.admin.orderParts.vo.*; import org.apache.ibatis.annotations.Param; -import org.apache.poi.ss.formula.functions.T; + import static com.cf.imes.framework.security.core.util.SecurityFrameworkUtils.getUserOrganId; @@ -49,22 +44,6 @@ public interface OrderPartsMapper extends BaseMapperX { .orderByDesc(OrderPartsDO::getId)); } - default OrderPartsImportRespVO importOrderPartsList(List importOrderParts) { - OrderPartsImportRespVO respVO = OrderPartsImportRespVO.builder().createOrderParts(new ArrayList()) - .updateOrderParts(new ArrayList<>()).failureOrderParts(new LinkedHashMap<>()).build(); - importOrderParts.forEach(orderParts -> { - try{ - OrderPartsDO orderPartsDO = BeanUtils.toBean(orderParts, OrderPartsDO.class); - insert(orderPartsDO); - orderParts.setId(orderPartsDO.getId()); - respVO.getCreateOrderParts().add(orderParts); - }catch (ServiceException ex){ - respVO.getFailureOrderParts().put(orderParts.getName(), ex.getMessage()); - } - }); - System.err.println("OrderPartsImportRespVO " + respVO); - return respVO; - } IPage selectProductList(@Param("page") IPage page , @Param("orderId")Long orderId, @Param("roomId")Long roomId , @Param("bodyId")Long bodyId,@Param("organId")Long organId); diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/OrderServiceImpl.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/OrderServiceImpl.java index add0d330c..a97900695 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/OrderServiceImpl.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/OrderServiceImpl.java @@ -213,7 +213,7 @@ public class OrderServiceImpl implements OrderService { rawGoodsMapper.updateOrderDeleted(orderId, OrderDeletedEnum.NOT_DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId()); orderProcessMapper.updateOrderDeleted(orderId, OrderDeletedEnum.NOT_DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId()); processStepMapper.updateOrderDeleted(orderId, OrderDeletedEnum.NOT_DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId()); - ; + } private void validateOrderExists(Long id, Long organId) { @@ -229,7 +229,7 @@ public class OrderServiceImpl implements OrderService { @Override public PageResult getOrderPage(OrderPageReqVO pageReqVO) { - System.out.println("pageReqVO " + pageReqVO); + return orderMapper.selectPage(pageReqVO.setOrganId(SecurityFrameworkUtils.getLoginUser().getOrganId())); } @@ -250,7 +250,7 @@ public class OrderServiceImpl implements OrderService { index = OrderDeletedEnum.NOT_DELETED.getStatus(); else index = OrderDeletedEnum.DELETED.getStatus(); - System.out.println(" deleted " + deleted); + return index; } @Override @@ -322,7 +322,7 @@ public class OrderServiceImpl implements OrderService { // 校验存在 validateOrderBodyExists(orderId, bodyId, SecurityFrameworkUtils.getLoginUser().getOrganId()); // 删除 - // orderBodyMapper.deleteAllByOrderId(orderId, bodyId); + // orderBodyMapper.deleteAllByOrderId(orderId, bodyId); 物理删除 orderBodyMapper.updateDeletedById(bodyId, OrderDeletedEnum.DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId()); orderGroupMapper.updateDeletedById(bodyId, OrderDeletedEnum.DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId()); @@ -428,7 +428,7 @@ public class OrderServiceImpl implements OrderService { } map.put("goodsDO", goodsLists); map.put("plateGoodDOLists", plateGoodLists); - System.err.println(" map " + map); +// System.err.println(" map " + map); return map; } @@ -452,7 +452,7 @@ public class OrderServiceImpl implements OrderService { return futureDate; } catch (DateTimeParseException e) { // 在实际应用中应该有更详细的错误处理逻辑 - System.err.println("Error parsing future date: " + e.getMessage()); +// System.err.println("Error parsing future date: " + e.getMessage()); } } return date; @@ -512,9 +512,7 @@ public class OrderServiceImpl implements OrderService { Matcher matcher = pattern.matcher(phoneNumber); // 判断手机号是否匹配正则表达式 - if (matcher.matches()) { - System.out.println("手机号合法"); - } else { + if (!matcher.matches()) { throw exception(PHONE_NOT_LAWFUL); } } @@ -532,7 +530,6 @@ public class OrderServiceImpl implements OrderService { @Override public void importExcelData(OrderDO orderDO, List list) { orderDO.setId((Long) snowFlakeGenerator.nextId(null)); - System.out.println(excelTypeRealize.changeDate(list, orderDO.getId())); Map> listMap = excelTypeRealize.changeDate(list, orderDO.getId()); List rawGoodsDO = (List) listMap.get("rawGoodsDOS"); diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/api/webcad/ApiTypeRealize.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/api/webcad/ApiTypeRealize.java index 1356a7245..bca433831 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/api/webcad/ApiTypeRealize.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/api/webcad/ApiTypeRealize.java @@ -192,15 +192,13 @@ public class ApiTypeRealize { List orderGroupDOList = orderGroupDO.values().stream().collect(Collectors.toList()); Map orderGroupDOMap = orderGroupDOList.stream().collect(Collectors.toMap(OrderGroupDO::getId, v -> v)); - System.out.println("groupPlate " + groupPlate + " plateDOMap " + plateDOMap + " orderGroupDOMap " + orderGroupDOMap); - groupPlate.forEach((k, v) -> { // k 加工组id v.forEach(item -> { if (plateDOMap.get(item.getPlateId()) != null) { if (plateDOMap.get(item.getPlateId()).getIsSpecialShaped()) { // 异形相加 specialShapedNum++; - System.out.println(k + " 对应 " + specialShapedNum); +// System.out.println(k + " 对应 " + specialShapedNum); } } }); @@ -535,6 +533,10 @@ public class ApiTypeRealize { plate.getString("BoardType")) .getData().getValue()); Long plateId = (Long) identifierGenerator.nextId(null); + + String remarkJson = plate.getString("RemarkJson").replace("[", "").replace("]", ""); + String remark = remarkJson != null && !remarkJson.trim().isEmpty() ? remarkJson : ""; + PlateDO plateInfo = PlateDO.builder() .id(plateId) .orderId(orderId) @@ -577,7 +579,7 @@ public class ApiTypeRealize { .isSculpt(plate.getBoolean("IsModel")) .isSpecialShaped(plate.getBoolean("UnRegular")) .isCancel(false) - .remark(plate.getString("RemarkJson")) + .remark(remark) .build(); // item 明细 @@ -747,7 +749,7 @@ public class ApiTypeRealize { } } else { - System.out.println("JSON 数据中没有订单信息(Orders 数组为空)。"); +// System.out.println("JSON 数据中没有订单信息(Orders 数组为空)。"); } return plateDetails; @@ -822,7 +824,7 @@ public class ApiTypeRealize { .depth(Double.valueOf(hole.getString("Depth"))) .build()); } catch (Exception e) { - System.out.println("HoleDetail " + hole); +// System.out.println("HoleDetail " + hole); } } diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/orderParts/OrderPartsMapper.xml b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/orderParts/OrderPartsMapper.xml index 0a468f346..3f7241f3a 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/orderParts/OrderPartsMapper.xml +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/orderParts/OrderPartsMapper.xml @@ -46,6 +46,7 @@ select distinct + op.id, op.name, op.open_door_type, op.height, diff --git a/cf-module-prod-manage/cf-module-prod-manage-biz/src/main/java/com/cf/imes/module/manage/service/plate/PlateServiceImpl.java b/cf-module-prod-manage/cf-module-prod-manage-biz/src/main/java/com/cf/imes/module/manage/service/plate/PlateServiceImpl.java index de2db15e1..1ae4987de 100644 --- a/cf-module-prod-manage/cf-module-prod-manage-biz/src/main/java/com/cf/imes/module/manage/service/plate/PlateServiceImpl.java +++ b/cf-module-prod-manage/cf-module-prod-manage-biz/src/main/java/com/cf/imes/module/manage/service/plate/PlateServiceImpl.java @@ -52,7 +52,7 @@ public class PlateServiceImpl implements PlateService { } // 判断板材是否存在 PlateDO existPlate = plateMapper.selectByGoodID(createReqVO.getGoodsId(), OrganContextHolder.getOrganId()); - System.out.println(" existPlate " + existPlate); +// System.out.println(" existPlate " + existPlate); if (existPlate != null){ throw exception(ErrorCodeConstants.PLATE_EXISTS); }