From 8b43954926db6b4df6a61ab6e04d6cb11189069d Mon Sep 17 00:00:00 2001 From: 吴健 <14790700720@163.com> Date: 星期二, 15 四月 2025 08:54:08 +0800 Subject: [PATCH] add-415 --- jcdm-main/src/main/java/com/jcdm/main/bs/orderScheduling/controller/BsOrderSchedulingController.java | 69 ++++++++++++++++++++-------------- 1 files changed, 41 insertions(+), 28 deletions(-) diff --git a/jcdm-main/src/main/java/com/jcdm/main/bs/orderScheduling/controller/BsOrderSchedulingController.java b/jcdm-main/src/main/java/com/jcdm/main/bs/orderScheduling/controller/BsOrderSchedulingController.java index be19a73..1c686c0 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/bs/orderScheduling/controller/BsOrderSchedulingController.java +++ b/jcdm-main/src/main/java/com/jcdm/main/bs/orderScheduling/controller/BsOrderSchedulingController.java @@ -18,14 +18,12 @@ import com.jcdm.common.exception.ServiceException; import com.jcdm.common.utils.StringUtils; import com.jcdm.common.utils.poi.ExcelUtil; +import com.jcdm.main.bs.orderScheduling.Query.EngineQuery; import com.jcdm.main.bs.orderScheduling.Query.SAPQuery; import com.jcdm.main.bs.orderScheduling.common.Constants; import com.jcdm.main.bs.orderScheduling.domain.BsOrderScheduling; import com.jcdm.main.bs.orderScheduling.service.IBsOrderSchedulingService; -import com.jcdm.main.bs.orderScheduling.vo.FollowReportVO; -import com.jcdm.main.bs.orderScheduling.vo.LineChartVO; -import com.jcdm.main.bs.orderScheduling.vo.ReportVO; -import com.jcdm.main.bs.orderScheduling.vo.SumDataVO; +import com.jcdm.main.bs.orderScheduling.vo.*; import com.jcdm.main.da.paramCollection.domain.DaParamCollection; import com.jcdm.main.da.paramCollection.mapper.DaParamCollectionMapper; import com.jcdm.main.da.passingStationCollection.domain.DaPassingStationCollection; @@ -46,6 +44,7 @@ import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.RequestBody; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; @@ -345,7 +344,7 @@ if (StringUtils.isEmpty(engineNo)){ return R.fail(500,"绠变綋鐮佷笉鑳戒负绌猴紝璇烽噸璇�"); } - if (!engineNo.contains(",")){ + if (!engineNo.contains(",") && !engineNo.contains("/") ){ return R.fail(500,"绠变綋鐮佹牸寮忔湁璇紝璇烽噸璇�"); } ProductNewPassStation checkStation = new ProductNewPassStation(); @@ -429,7 +428,7 @@ if (StrUtil.isNotBlank(OrderScheduling.getEngineNo())){ String snCode = OrderScheduling.getEngineNo(); - if (snCode.startsWith("280") || snCode.startsWith("380")){ + if (snCode.startsWith("280") || snCode.startsWith("380") || snCode.startsWith("196") || snCode.startsWith("296")){ ProductNewPassStation productNewPassStation = new ProductNewPassStation(); UUID uuid = UUID.randomUUID(); productNewPassStation.setId(uuid.getMostSignificantBits()); @@ -439,8 +438,12 @@ productNewPassStation.setBoxCode(engineNo); if (snCode.startsWith("280")){ productNewPassStation.setProductType("280"); - } else { + } else if (snCode.startsWith("380")){ productNewPassStation.setProductType("380"); + } else if (snCode.startsWith("196")){ + productNewPassStation.setProductType("196"); + } else if (snCode.startsWith("296")){ + productNewPassStation.setProductType("296"); } productNewPassStationService.insertPassStation(productNewPassStation); } @@ -505,33 +508,43 @@ @PostMapping("/engine-report") - public R getReportDetail(SAPQuery sapQuery){ + public ReportVO getReportDetail(@RequestBody SAPQuery sapQuery){ ReportVO reportVO = new ReportVO(); - if (StrUtil.isBlank(sapQuery.getIV_ZFDJM())){ - reportVO.setEV_STATUS("E"); - reportVO.setEV_MESSAGE("鍙戝姩鏈哄彿涓嶈兘涓虹┖"); + List<ResultDataVO> EV_DATA = new ArrayList<>(); + List<EngineQuery> engineQueryList = sapQuery.getIV_ZFDJM(); + if (CollUtil.isEmpty(engineQueryList)){ + reportVO.setEV_DATA(EV_DATA); + return reportVO; } BsOrderScheduling query = new BsOrderScheduling(); - query.setEngineNo(sapQuery.getIV_ZFDJM()); + List<String> engineNoList = engineQueryList.stream().map(EngineQuery::getZFDJM).collect(Collectors.toList()); + query.setEngineNoList(engineNoList); List<BsOrderScheduling> bsOrderSchedulingList = bsOrderSchedulingService.selectBsOrderSchedulingList(query); - if (CollUtil.isNotEmpty(bsOrderSchedulingList)){ - BsOrderScheduling bsOrderScheduling = bsOrderSchedulingList.get(0); - if (StrUtil.isBlank(bsOrderScheduling.getReport20())){ - reportVO.setEV_STATUS("0"); - reportVO.setEV_MESSAGE("鏈姤宸�"); - } else { - if ("1".equals(bsOrderScheduling.getReport20())){ - reportVO.setEV_STATUS("1"); - reportVO.setEV_MESSAGE("宸叉姤宸�"); - } else if ("3".equals(bsOrderScheduling.getReport20())){ - reportVO.setEV_STATUS("E"); - reportVO.setEV_MESSAGE(bsOrderScheduling.getRemarks()); + for (String s : engineNoList) { + ResultDataVO resultDataVO = new ResultDataVO(); + resultDataVO.setZFDJM(s); + List<BsOrderScheduling> collect = bsOrderSchedulingList.stream().filter(x -> x.getEngineNo().equals(s)).collect(Collectors.toList()); + if (CollUtil.isNotEmpty(collect)){ + BsOrderScheduling bsOrderScheduling = collect.get(0); + if (StrUtil.isBlank(bsOrderScheduling.getReport20())){ + resultDataVO.setSTATU("0"); + resultDataVO.setEV_MESSAGE("鏈姤宸�"); + } else { + if ("1".equals(bsOrderScheduling.getReport20())){ + resultDataVO.setSTATU("1"); + resultDataVO.setEV_MESSAGE("宸叉姤宸�"); + } else if ("3".equals(bsOrderScheduling.getReport20())){ + resultDataVO.setSTATU("2"); + resultDataVO.setEV_MESSAGE(bsOrderScheduling.getRemarks()); + } } + } else { + resultDataVO.setSTATU("2"); + resultDataVO.setEV_MESSAGE("鏈煡璇㈠埌姝ゅ彂鍔ㄦ満淇℃伅"); } - } else { - reportVO.setEV_STATUS("E"); - reportVO.setEV_MESSAGE("鏈煡璇㈠埌姝ゅ彂鍔ㄦ満淇℃伅"); + EV_DATA.add(resultDataVO); } - return R.ok(reportVO); + reportVO.setEV_DATA(EV_DATA); + return reportVO; } } -- Gitblit v1.9.3