From ea3c33c8561df39d4f123d1424fda99dd0f0c51d Mon Sep 17 00:00:00 2001 From: wujian <14790700720@163.com> Date: 星期四, 14 十一月 2024 08:15:41 +0800 Subject: [PATCH] add - panel --- jcdm-main/src/main/java/com/jcdm/main/bs/orderScheduling/controller/BsOrderSchedulingController.java | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 51 insertions(+), 7 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 611d3af..3723ce2 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 @@ -1,6 +1,7 @@ package com.jcdm.main.bs.orderScheduling.controller; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import com.alibaba.excel.EasyExcel; import com.alibaba.excel.ExcelWriter; @@ -17,12 +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.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; @@ -43,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; @@ -156,9 +158,9 @@ WriteSheet sheet1 = EasyExcel.writerSheet(1, "鎷х揣鏁版嵁") .head(DaParamCollection.class).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) .build(); - WriteSheet sheet2 = EasyExcel.writerSheet(2, "鐩告満妫�娴�") - .head(DaParamCollection.class).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) - .build(); +// WriteSheet sheet2 = EasyExcel.writerSheet(2, "鐩告満妫�娴�") +// .head(DaParamCollection.class).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) +// .build(); WriteSheet sheet3 = EasyExcel.writerSheet(3, "澶栨紡妫�娴�") .head(DaParamCollection.class).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) .build(); @@ -170,7 +172,7 @@ .build(); excelWriter.write(followReportList.getMainList(),mainSheet); excelWriter.write(followReportList.getList1(),sheet1); - excelWriter.write(followReportList.getList2(),sheet2); +// excelWriter.write(followReportList.getList2(),sheet2); excelWriter.write(followReportList.getList3(),sheet3); excelWriter.write(followReportList.getList4(),sheet4); excelWriter.write(followReportList.getList5(),sheet5); @@ -499,4 +501,46 @@ return R.fail("鏈煡鎵惧埌璇ュ彂鍔ㄦ満鍙峰搴旂殑绠变綋"); } } + + + @PostMapping("/engine-report") + public ReportVO getReportDetail(@RequestBody SAPQuery sapQuery){ + ReportVO reportVO = new ReportVO(); + 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(); + List<String> engineNoList = engineQueryList.stream().map(EngineQuery::getZFDJM).collect(Collectors.toList()); + query.setEngineNoList(engineNoList); + List<BsOrderScheduling> bsOrderSchedulingList = bsOrderSchedulingService.selectBsOrderSchedulingList(query); + 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("鏈煡璇㈠埌姝ゅ彂鍔ㄦ満淇℃伅"); + } + EV_DATA.add(resultDataVO); + } + reportVO.setEV_DATA(EV_DATA); + return reportVO; + } } -- Gitblit v1.9.3