From b9e4e2edbb3767ee347a91d2238544ae736b53c0 Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期二, 22 七月 2025 10:29:27 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10105/r/ERP_override
---
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportService.java | 627 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 627 insertions(+), 0 deletions(-)
diff --git a/north-glass-erp/src/main/java/com/example/erp/service/pp/ReportService.java b/north-glass-erp/src/main/java/com/example/erp/service/pp/ReportService.java
new file mode 100644
index 0000000..4f9901c
--- /dev/null
+++ b/north-glass-erp/src/main/java/com/example/erp/service/pp/ReportService.java
@@ -0,0 +1,627 @@
+
+package com.example.erp.service.pp;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.example.erp.dto.pp.*;
+import com.example.erp.entity.pp.Report;
+import com.example.erp.entity.sd.BasicData;
+import com.example.erp.entity.sd.OrderDetail;
+import com.example.erp.entity.sd.OrderGlassDetail;
+import com.example.erp.entity.sd.ProductDetail;
+import com.example.erp.mapper.pp.FlowCardMapper;
+import com.example.erp.mapper.pp.ProductionSchedulingMapper;
+import com.example.erp.mapper.pp.ReportMapper;
+import com.example.erp.mapper.pp.ReportingWorkMapper;
+import com.example.erp.mapper.sd.*;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+
+import java.sql.Date;
+import java.time.LocalDate;
+import java.util.*;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+@Service
+@DS("pp")
+public class ReportService {
+ private final ReportMapper reportMapper;
+
+ private final OrderProcessDetailMapper orderProcessDetailMapper;
+ private final ProductionSchedulingMapper productionSchedulingMapper;
+
+ private final OrderGlassDetailMapper orderGlassDetailMapper;
+ private final BasicDataMapper basicDataMapper;
+ private final ProductDetailMapper productDetailMapper;
+ private final OrderDetailMapper orderDetailMapper;
+
+ FlowCardMapper flowCardMapper;
+ private ReportingWorkMapper reportingWorkMapper;
+
+
+ //涓婂伐搴忔姤宸ョ彮缁�
+ private void mergeTeamsGroupsName( List<WorkInProgressDTO> dataList1,List<WorkInProgressDTO> dataList2) {
+
+ for (WorkInProgressDTO dto1 : dataList1) {
+ //鏍规嵁褰撳墠宸ュ簭鑾峰彇 鏄惁涓哄崟鐗囥�佸す鑳躲�佹垨鑰呭叏閮�
+ BasicData basicData = basicDataMapper.
+ selectOne(new QueryWrapper<BasicData>()
+ .eq("basic_name", dto1.getThisProcess())
+ .last("limit 1")
+ );
+
+ OrderDetail orderDetail = orderDetailMapper
+ .selectOne(
+ new QueryWrapper<OrderDetail>()
+ .eq("order_id", dto1.getOrderId())
+ .eq("order_number", dto1.getOrderNumber())
+ );
+
+ //濡傛灉涓哄崟鐗囷紝鍒欐牴鎹骇鍝佸悕绉板拰宸ヨ壓缂栧彿鑾峰彇鐜荤拑鍚嶇О
+ if(basicData.getNickname()==null || basicData.getNickname().isEmpty()){
+ ProductDetail productDetail = productDetailMapper.
+ selectOne(new QueryWrapper<ProductDetail>()
+ .eq("prod_id", orderDetail.getProductId())
+ .eq("glass_sort",dto1.getTechnologyNumber())
+ );
+ dto1.setGlassName(productDetail.getDetail());
+
+ }else if(basicData.getNickname().equals("stepC")){
+ OrderGlassDetail orderGlassDetailGroup = orderGlassDetailMapper
+ .selectOne(new QueryWrapper<OrderGlassDetail>()
+ .eq("order_id", dto1.getOrderId())
+ .eq("order_number", dto1.getOrderNumber())
+ .eq("technology_number",dto1.getTechnologyNumber())
+ );
+
+ String glassName = productDetailMapper.getGlassNameByGroup(
+ orderDetail.getProductId(),
+ orderGlassDetailMapper.getMinTechnologyNumberByGroup(dto1.getOrderId(),dto1.getOrderNumber(), String.valueOf(orderGlassDetailGroup.getGroup())),
+ orderGlassDetailMapper.getMaxTechnologyNumberByGroup(dto1.getOrderId(),dto1.getOrderNumber(), String.valueOf(orderGlassDetailGroup.getGroup()))
+ );
+ dto1.setGlassName(glassName);
+
+ }else{
+ dto1.setGlassName(dto1.getProductName());
+ }
+
+ }
+
+ Function<WorkInProgressDTO, String> keyFn = dto ->
+ dto.getProcessId() + "|" +
+ dto.getOrderNumber() + "|" +
+ dto.getTechnologyNumber();
+
+ Map<String, WorkInProgressDTO> map2 = dataList2.stream()
+ .collect(Collectors.toMap(
+ keyFn,
+ Function.identity(),
+ (existing, replacement) -> existing
+ ));
+
+ for (WorkInProgressDTO dto1 : dataList1) {
+ WorkInProgressDTO dto2 = map2.get(keyFn.apply(dto1));
+ if (dto2 != null) {
+ String tgn = dto2.getTeamsGroupsName();
+ if (StringUtils.hasText(tgn)) {
+ dto1.setTeamsGroupsName(tgn);
+ }
+ }
+ }
+ }
+
+
+ public ReportService(ReportMapper reportMapper, OrderProcessDetailMapper orderProcessDetailMapper,
+ ProductionSchedulingMapper productionSchedulingMapper, FlowCardMapper flowCardMapper,
+ OrderGlassDetailMapper orderGlassDetailMapper, BasicDataMapper basicDataMapper,
+ ProductDetailMapper productDetailMapper, OrderDetailMapper orderDetailMapper,
+ ReportingWorkMapper reportingWorkMapper) {
+ this.reportMapper = reportMapper;
+ this.orderProcessDetailMapper = orderProcessDetailMapper;
+ this.productionSchedulingMapper = productionSchedulingMapper;
+ this.flowCardMapper = flowCardMapper;
+ this.orderGlassDetailMapper = orderGlassDetailMapper;
+ this.basicDataMapper = basicDataMapper;
+ this.productDetailMapper = productDetailMapper;
+ this.orderDetailMapper = orderDetailMapper;
+ this.reportingWorkMapper = reportingWorkMapper;
+ }
+
+ //娴佺▼鍗¤繘搴︽柟娉�
+ public Map<String, Object> processCardProgressSv(String orderId, List<Integer> columns) {
+ Map<String, Object> map = new HashMap<>();
+ //鑾峰彇琛ㄦ牸鍐呭鏁版嵁
+ map.put("data", reportMapper.processCardProgressMp(orderId));
+
+ //鑾峰彇琛ㄥご宸ュ簭绛涢�夋暟鎹�
+ List<Map<String, String>> processFilterList = orderProcessDetailMapper.filterOrderProcess(orderId);
+ List<Map<String, String>> processList = processFilterList;
+
+ List<String> filterList = new ArrayList<>();
+ //寰幆閬嶅巻鏁扮粍锛屽垽鏂搴忓彿褰撳墠鐨勫伐搴�
+ for (int i = 1; i < processFilterList.size(); i++) {
+ filterList.add(processFilterList.get(i).get("process"));
+ List<Map<String, String>> lastProcessList =
+ orderProcessDetailMapper.filterLastProcess(
+ orderId,
+ String.valueOf(processFilterList.get(i).get("order_number")),
+ String.valueOf(processFilterList.get(i).get("technology_number")),
+ String.valueOf(processFilterList.get(i).get("id"))
+ );
+ if (!lastProcessList.isEmpty()) {
+ int finalI = i;
+ lastProcessList.forEach(lastProcess -> {
+ if (filterList.contains(lastProcess.get("process"))) {
+ processList.add(lastProcess);
+ }
+ });
+ }
+
+ }
+ // 浣跨敤HashSet鏉ヨ褰曞凡缁忛亣鍒扮殑value鍊�
+ Set<String> seenValues = new HashSet<>();
+ // 鍒涘缓涓�涓柊鐨凩ist鏉ュ瓨鍌ㄧ粨鏋�
+ List<Map<String, String>> uniqueList = new ArrayList<>();
+
+ // 鍙嶅悜閬嶅巻鍘熷List
+ for (int i = processList.size() - 1; i >= 0; i--) {
+ Map<String, String> maps = processList.get(i);
+ String value = maps.values().iterator().next(); // 鍋囪姣忎釜Map鍙湁涓�涓獀alue
+
+ // 濡傛灉value杩樻病鏈夎鐪嬪埌杩囷紝灏辨坊鍔犲埌缁撴灉List鍜孒ashSet涓�
+ if (!seenValues.contains(value)) {
+ uniqueList.add(0, maps); // 娣诲姞鍒扮粨鏋淟ist鐨勫紑澶达紝浠ヤ繚鎸佸師椤哄簭
+ seenValues.add(value);
+ }
+ }
+ map.put("title", uniqueList);
+
+
+ List<Map<String, Integer>> getRowCount = orderProcessDetailMapper.getGlassLRow(orderId);
+ List<Map<String, Integer>> rowCount = new ArrayList<>();
+ columns.forEach(col -> {
+ getRowCount.forEach(row -> {
+ Map<String, Integer> getRow = new HashMap<>();
+ // { row: 0, col: 1, rowspan: 3, colspan: 0},
+ Object rowNumObj = row.get("RowNum");
+ if (rowNumObj instanceof Double) {
+ getRow.put("row", ((Double) rowNumObj).intValue());
+ } else if (rowNumObj instanceof Integer) {
+ getRow.put("row", (Integer) rowNumObj);
+ }
+ getRow.put("col", col);
+ getRow.put("rowspan", row.get("rowCount"));
+ getRow.put("colspan", 0);
+ rowCount.add(getRow);
+ });
+ });
+
+
+ map.put("mergeCells", rowCount);
+
+ return map;
+ }
+
+ public Map<String, Object> crossProcessBreakingSv(Integer pageNum, Integer pageSize, List<String> selectDate, CrossProcessBreakingDTO crossProcessBreakingDTO) {
+ Integer offset = (pageNum - 1) * pageSize;
+ String endDate = LocalDate.now().toString();
+ String startDate = LocalDate.now().minusDays(15).toString();
+ if (selectDate != null && selectDate.size() == 2) {
+ if (!selectDate.get(0).isEmpty()) {
+ startDate = selectDate.get(0);
+ }
+ if (!selectDate.get(1).isEmpty()) {
+ endDate = selectDate.get(1);
+ }
+ }
+ Map<String, Object> map = new HashMap<>();
+ map.put("data", reportMapper.getProcessBreaking(offset, pageSize, startDate, endDate, crossProcessBreakingDTO));
+ map.put("total", reportMapper.getProcessBreakingTotal(offset, pageSize, startDate, endDate, crossProcessBreakingDTO));
+ List<String> list = new ArrayList<>();
+ list.add(startDate);
+ list.add(endDate);
+ map.put("selectDate", list);
+ return map;
+ }
+
+ public Map<String, Object> workInProgressSv(Integer pageNum, Integer pageSize, String orderId, String inputProject, String selectProcesses, String optionVal, WorkInProgressDTO workInProgressDTO) {
+ Integer offset = (pageNum - 1) * pageSize;
+ if ("null".equals(orderId)) {
+ orderId = "";
+ }
+ if ("null".equals(inputProject)) {
+ inputProject = "";
+ }
+ if ("null".equals(optionVal)) {
+ optionVal = ("");
+ }
+ if (selectProcesses.equals("鍏ㄩ儴")){
+ selectProcesses="";
+ }
+ Map<String, Object> map = new HashMap<>();
+ List<WorkInProgressDTO> dataList2 =reportMapper.workInProgressMpdataList2(offset, pageSize, orderId, inputProject, selectProcesses, workInProgressDTO);
+ if (optionVal.equals("1")){
+ System.out.println(1);
+ /* 鏍规嵁閿�鍞崟鍙锋眹鎬�*/
+ //map.put("data", reportMapper.workInProgressOrderMp(offset, pageSize, orderId, inputProject, selectProcesses, workInProgressDTO));
+ List<WorkInProgressDTO> dataList1 =reportMapper.workInProgressOrderMpList1(offset, pageSize, orderId, inputProject, selectProcesses, workInProgressDTO);
+ mergeTeamsGroupsName(dataList1, dataList2);
+ map.put("data",dataList1);
+ // map.put("total", reportMapper.workInProgressOrderTotal(offset, pageSize, orderId, inputProject, selectProcesses, workInProgressDTO));
+ map.put("total" ,reportMapper.workInProgressOrderFootSum(offset, pageSize,orderId, inputProject, selectProcesses, workInProgressDTO));
+ }else if(optionVal.equals("2")){
+ System.out.println(2);
+ /* 鏍规嵁娴佺▼鍗″彿姹囨��*/
+ //map.put("data", reportMapper.workInProgressProcessMp(offset, pageSize, orderId, inputProject, selectProcesses, workInProgressDTO));
+ List<WorkInProgressDTO> dataList1 =reportMapper.workInProgressProcessMpList1(offset, pageSize, orderId, inputProject, selectProcesses, workInProgressDTO);
+ mergeTeamsGroupsName(dataList1, dataList2);
+ map.put("data",dataList1);
+ // map.put("total", reportMapper.workInProgressProcessTotal(offset, pageSize, orderId, inputProject, selectProcesses, workInProgressDTO));
+ map.put("total" ,reportMapper.workInProgressOrderFootSum(offset, pageSize,orderId, inputProject, selectProcesses, workInProgressDTO));
+
+ } else if (optionVal.equals("3")) {
+
+ } else {
+ //娌℃湁閫夋嫨鍒嗙粍
+ //map.put("data", reportMapper.workInProgressMp(offset, pageSize, orderId, inputProject, selectProcesses, workInProgressDTO));
+ List<WorkInProgressDTO> dataList1 =reportMapper.workInProgressMpdataList1(offset, pageSize, orderId, inputProject, selectProcesses, workInProgressDTO);
+ mergeTeamsGroupsName(dataList1, dataList2);
+ map.put("data",dataList1);
+ //map.put("total", reportMapper.workInProgressTotal(offset, pageSize, orderId, inputProject, selectProcesses, workInProgressDTO));
+ map.put("total" ,reportMapper.workInProgressOrderFootSum(offset, pageSize,orderId, inputProject, selectProcesses, workInProgressDTO));
+
+ }
+ map.put("process", productionSchedulingMapper.selectProcess());
+ return map;
+ }
+
+ public Map<String, Object> selectProcessToBeCompletedSv(Date selectTime1, Date selectTime2, String orderId, String inputProject, String selectProcesses, Report report) {
+ if ("null".equals(orderId)) {
+ orderId = "";
+ }
+ if ("null".equals(inputProject)) {
+ inputProject = "";
+ }
+ Map<String, Object> map = new HashMap<>();
+ map.put("data", reportMapper.processToBeCompletedMp(selectTime1, selectTime2, orderId, inputProject, selectProcesses, report));
+ map.put("process", productionSchedulingMapper.selectProcess());
+ map.put("footSum" ,reportMapper.processToBeCompletedFootSum(selectTime1, selectTime2, orderId, inputProject, selectProcesses, report));
+
+ return map;
+ }
+
+ public Map<String, Object> selectDamageReportSv(Integer pageNum, Integer pageSize, String selectTime1, String selectTime2, DamageReportDTO damageReportDTO) {
+ Integer offset = (pageNum - 1) * pageSize;
+ Map<String, Object> map = new HashMap<>();
+ map.put("data", reportMapper.selectDamageReportMp(offset, pageSize, selectTime1, selectTime2, damageReportDTO));
+ map.put("total", reportMapper.getDamageReportPageTotal(offset, pageSize, selectTime1, selectTime2, damageReportDTO));
+ map.put("footSum" ,reportMapper.damageReportFootSum(selectTime1, selectTime2, damageReportDTO));
+ return map;
+ }
+
+ public Map<String, Object> splittingDetailsOutsideSv(String orderId, Report report) {
+ Map<String, Object> map = new HashMap<>();
+ map.put("data", reportMapper.splittingDetailsOutsideMp(orderId, report));
+ map.put("orderOtherMoney", flowCardMapper.selectorderOtherMoney());
+ return map;
+ }
+
+ public Map<String, Object> qualityReportSv(Date selectTime1, Date selectTime2, Report report) {
+ Map<String, Object> map = new HashMap<>();
+ map.put("data", reportMapper.qualityReportMp(selectTime1, selectTime2, report));
+ return map;
+ }
+
+ public Map<String, Object> yieldSv(Date selectTime1, Date selectTime2, String selectProcesses, Report report) {
+ Map<String, Object> map = new HashMap<>();
+ map.put("data", reportMapper.yieldMp(selectTime1, selectTime2, selectProcesses, report));
+ map.put("process", productionSchedulingMapper.selectProcess());
+ return map;
+ }
+
+ public Map<String, Object> productionScheduleSv(String orderId, List<Integer> columns) {
+ Map<String, Object> map = new HashMap<>();
+ //鑾峰彇琛ㄦ牸鍐呭鏁版嵁
+ map.put("data", reportMapper.productionScheduleMp(orderId));
+
+ //鑾峰彇琛ㄥご宸ュ簭绛涢�夋暟鎹�
+ List<Map<String, String>> processFilterList = orderProcessDetailMapper.filterOrderProcess(orderId);
+ List<Map<String, String>> processList = processFilterList;
+
+ List<String> filterList = new ArrayList<>();
+ //寰幆閬嶅巻鏁扮粍锛屽垽鏂搴忓彿褰撳墠鐨勫伐搴�
+ for (int i = 1; i < processFilterList.size(); i++) {
+ filterList.add(processFilterList.get(i).get("process"));
+ List<Map<String, String>> lastProcessList =
+ orderProcessDetailMapper.filterLastProcess(
+ orderId,
+ String.valueOf(processFilterList.get(i).get("order_number")),
+ String.valueOf(processFilterList.get(i).get("technology_number")),
+ String.valueOf(processFilterList.get(i).get("id"))
+ );
+ if (!lastProcessList.isEmpty()) {
+ int finalI = i;
+ lastProcessList.forEach(lastProcess -> {
+ if (filterList.contains(lastProcess.get("process"))) {
+ processList.add(lastProcess);
+ }
+ });
+ }
+
+ }
+ // 浣跨敤HashSet鏉ヨ褰曞凡缁忛亣鍒扮殑value鍊�
+ Set<String> seenValues = new HashSet<>();
+ // 鍒涘缓涓�涓柊鐨凩ist鏉ュ瓨鍌ㄧ粨鏋�
+ List<Map<String, String>> uniqueList = new ArrayList<>();
+
+ // 鍙嶅悜閬嶅巻鍘熷List
+ for (int i = processList.size() - 1; i >= 0; i--) {
+ Map<String, String> maps = processList.get(i);
+ String value = maps.values().iterator().next(); // 鍋囪姣忎釜Map鍙湁涓�涓獀alue
+
+ // 濡傛灉value杩樻病鏈夎鐪嬪埌杩囷紝灏辨坊鍔犲埌缁撴灉List鍜孒ashSet涓�
+ if (!seenValues.contains(value)) {
+ uniqueList.add(0, maps); // 娣诲姞鍒扮粨鏋淟ist鐨勫紑澶达紝浠ヤ繚鎸佸師椤哄簭
+ seenValues.add(value);
+ }
+ }
+ map.put("title", uniqueList);
+
+
+ List<Map<String, Integer>> getRowCount = orderProcessDetailMapper.getGlassLRow(orderId);
+ List<Map<String, Integer>> rowCount = new ArrayList<>();
+ columns.forEach(col -> {
+ getRowCount.forEach(row -> {
+ Map<String, Integer> getRow = new HashMap<>();
+ // { row: 0, col: 1, rowspan: 3, colspan: 0},
+ getRow.put("row", row.get("RowNum"));
+ getRow.put("col", col);
+ getRow.put("rowspan", row.get("rowCount"));
+ getRow.put("colspan", 0);
+ rowCount.add(getRow);
+ });
+ });
+
+
+ map.put("mergeCells", rowCount);
+
+ return map;
+ }
+
+ public Map<String, Object> taskCompletionStatusSv(Date selectTime1, Date selectTime2, List<Integer> columns) {
+ Map<String, Object> map = new HashMap<>();
+ //鑾峰彇琛ㄦ牸鍐呭鏁版嵁
+ map.put("data", reportMapper.taskCompletionStatusMp(selectTime1, selectTime2));
+
+ //鑾峰彇琛ㄥご宸ュ簭绛涢�夋暟鎹�
+ List<Map<String, String>> processFilterList = orderProcessDetailMapper.filterOrderProcessCollect(selectTime1, selectTime2);
+ List<Map<String, String>> processList = processFilterList;
+
+ List<String> filterList = new ArrayList<>();
+ //寰幆閬嶅巻鏁扮粍锛屽垽鏂搴忓彿褰撳墠鐨勫伐搴�
+ for (int i = 1; i < processFilterList.size(); i++) {
+ filterList.add(processFilterList.get(i).get("process"));
+ List<Map<String, String>> lastProcessList =
+ orderProcessDetailMapper.filterLastProcess(
+ String.valueOf(processFilterList.get(i).get("order_id")),
+ String.valueOf(processFilterList.get(i).get("order_number")),
+ String.valueOf(processFilterList.get(i).get("technology_number")),
+ String.valueOf(processFilterList.get(i).get("id"))
+ );
+ if (!lastProcessList.isEmpty()) {
+ int finalI = i;
+ lastProcessList.forEach(lastProcess -> {
+ if (filterList.contains(lastProcess.get("process"))) {
+ processList.add(lastProcess);
+ }
+ });
+ }
+
+ }
+ // 浣跨敤HashSet鏉ヨ褰曞凡缁忛亣鍒扮殑value鍊�
+ Set<String> seenValues = new HashSet<>();
+ // 鍒涘缓涓�涓柊鐨凩ist鏉ュ瓨鍌ㄧ粨鏋�
+ List<Map<String, String>> uniqueList = new ArrayList<>();
+
+ // 鍙嶅悜閬嶅巻鍘熷List
+ for (int i = processList.size() - 1; i >= 0; i--) {
+ Map<String, String> maps = processList.get(i);
+ String value = maps.values().iterator().next(); // 鍋囪姣忎釜Map鍙湁涓�涓獀alue
+
+ // 濡傛灉value杩樻病鏈夎鐪嬪埌杩囷紝灏辨坊鍔犲埌缁撴灉List鍜孒ashSet涓�
+ if (!seenValues.contains(value)) {
+ uniqueList.add(0, maps); // 娣诲姞鍒扮粨鏋淟ist鐨勫紑澶达紝浠ヤ繚鎸佸師椤哄簭
+ seenValues.add(value);
+ }
+ }
+ map.put("title", uniqueList);
+
+
+ List<Map<String, Integer>> getRowCount = orderProcessDetailMapper.getGlassLRowCollect(selectTime1, selectTime2);
+ List<Map<String, Integer>> rowCount = new ArrayList<>();
+ columns.forEach(col -> {
+ getRowCount.forEach(row -> {
+ Map<String, Integer> getRow = new HashMap<>();
+ // { row: 0, col: 1, rowspan: 3, colspan: 0},
+ getRow.put("row", row.get("RowNum"));
+ getRow.put("col", col);
+ getRow.put("rowspan", row.get("rowCount"));
+ getRow.put("colspan", 0);
+ rowCount.add(getRow);
+ });
+ });
+
+
+ map.put("mergeCells", rowCount);
+
+ return map;
+ }
+
+ public Map<String, Object> orderPlanDecompositionSv(Date selectTime1, Date selectTime2, Report report) {
+ Map<String, Object> map = new HashMap<>();
+ map.put("data", reportMapper.orderPlanDecompositionMp(selectTime1, selectTime2, report));
+ return map;
+ }
+
+ public Map<String, Object> orderReportingWorks(Date selectTime1, Date selectTime2, Report report) {
+ Map<String, Object> map = new HashMap<>();
+ map.put("data", reportMapper.orderReportingWorks(selectTime1, selectTime2, report));
+ return map;
+ }
+
+ public Map<String, Object> rawMaterialRequisitionSv(Date selectTime1, Date selectTime2, Report report) {
+ Map<String, Object> map = new HashMap<>();
+ map.put("data", reportMapper.rawMaterialRequisitionMp(selectTime1, selectTime2, report));
+ return map;
+ }
+
+ public List exportCrossProcessBreakingSv(List<LocalDate> dates) {
+ return reportMapper.exportCrossProcessBreakingMp(dates);
+ }
+
+ public List exportDamageReportSv(List<LocalDate> dates) {
+ if (dates != null && dates.size() > 1) {
+ dates.set(1, dates.get(1).plusDays(1)); // 灏嗙浜屼釜鏃ユ湡鍔犱竴澶�
+ }
+ return reportMapper.exportDamageReportMp(dates);
+ }
+
+ public List exportOrderPlanDecompositionSv(List<LocalDate> dates) {
+ return reportMapper.exportOrderPlanDecompositionMp(dates);
+ }
+
+ public List exportProcessToBeCompletedSv(Map<String, Object> dates) {
+ List<LocalDate> date= (List<LocalDate>) dates.get("date");
+ String process= (String) dates.get("processes");
+ String inputVal= (String) dates.get("inputVal");
+ String project= (String) dates.get("project");
+ if ("null".equals(inputVal)) {
+ inputVal = "";
+ }
+ if ("null".equals(project)) {
+ project = "";
+ }
+ return reportMapper.exportProcessToBeCompletedMp(date,process,inputVal,project);
+ }
+
+ public List exportWorkInProgressSv(Map<String, Object> dates) {
+ String process= (String) dates.get("processes");
+ if (process.equals("鍏ㄩ儴")){
+ process="";
+ }
+ String inputVal= (String) dates.get("inputVal");
+ String project= (String) dates.get("project");
+ if ("null".equals(inputVal)) {
+ inputVal = "";
+ }
+ if ("null".equals(project)) {
+ project = "";
+ }
+ List<WorkInProgressDTO> dataList1 =reportMapper.exportWorkInProgressMp(process,inputVal,project);
+ List<WorkInProgressDTO> dataList2 =reportMapper.exportWorkInProgressMpdataList2(process);
+
+ mergeTeamsGroupsName(dataList1, dataList2);
+ return dataList1;
+ }
+
+ public List exportTaskCompletionStatusSv(Map<String, Object> dates) {
+ return reportMapper.exportTaskCompletionStatusMp(dates);
+ }
+
+ public List exportRawMaterialRequisitionSv(List<LocalDate> dates) {
+ return reportMapper.exportRawMaterialRequisitionMp(dates);
+ }
+
+ public List exportQualityReportSv(List<LocalDate> dates) {
+ return reportMapper.exportQualityReportSv(dates);
+ }
+
+ public List exportYieldSv(Map<String, Object> dates) {
+ List<LocalDate> date= (List<LocalDate>) dates.get("date");
+ String process= (String) dates.get("processes");
+ return reportMapper.exportYieldMp(date,process);
+ }
+
+ public Map<String, Object> teamOutputSv(Integer pageNum, Integer pageSize, String selectTime1, String selectTime2, String selectProcesses, TeamOutputDTO teamOutputDTO) {
+ if (selectProcesses.equals("鍏ㄩ儴")){
+ selectProcesses="";
+ }
+ Integer offset = (pageNum - 1) * pageSize;
+ Map<String, Object> map = new HashMap<>();
+ String laminating = reportMapper.getLaminating(selectProcesses);
+ map.put("data", reportMapper.teamOutputMp(offset, pageSize, selectTime1, selectTime2,selectProcesses,laminating, teamOutputDTO));
+ map.put("process", productionSchedulingMapper.selectProcess());
+ map.put("total", reportMapper.teamOutputPageTotal(offset, pageSize, selectTime1, selectTime2,selectProcesses,laminating, teamOutputDTO));
+ map.put("footSum" ,reportMapper.teamOutputFootSum(selectTime1, selectTime2,selectProcesses,laminating, teamOutputDTO));
+ return map;
+ }
+
+ public Map<String, Object> scheduleProductionScheduleSv(Integer pageNum, Integer pageSize, Date selectTime1, Date selectTime2, String processes, ScheduleProductionScheduleDTO scheduleProductionScheduleDTO) {
+ Integer offset = (pageNum - 1) * pageSize;
+ Map<String, Object> map = new HashMap<>();
+ map.put("data", reportMapper.scheduleProductionScheduleMp(offset, pageSize, selectTime1, selectTime2,processes, scheduleProductionScheduleDTO));
+ map.put("total", reportMapper.getScheduleProductionScheduleTotal(offset, pageSize, selectTime1, selectTime2,processes, scheduleProductionScheduleDTO));
+ map.put("process", productionSchedulingMapper.selectProcess());
+ return map;
+ }
+
+ public List exportScheduleReportSv(Map<String, Object> dates) {
+ List<LocalDate> date= (List<LocalDate>) dates.get("date1");
+ String process= (String) dates.get("processes");
+ return reportMapper.exportScheduleReportMp(date,process);
+ }
+
+ public List exportTeamOutputSv(Map<String, Object> dates) {
+ List<LocalDate> date= (List<LocalDate>) dates.get("date");
+ String process= (String) dates.get("processes");
+ if (process.equals("鍏ㄩ儴")){
+ process="";
+ }
+ String laminating = reportMapper.getLaminating(process);
+ return reportMapper.exportTeamOutputMp(date,process,laminating);
+ }
+
+ public Map<String, Object> workInProgressCombinationSv(Integer pageNum, Integer pageSize,String orderId, String inputProject, String selectProcesses, String optionVal, WorkInProgressDTO workInProgressDTO) {
+ Integer offset = (pageNum - 1) * pageSize;
+ if ("null".equals(orderId)) {
+ orderId = "";
+ }
+ if ("null".equals(inputProject)) {
+ inputProject = "";
+ }
+ if ("null".equals(optionVal)) {
+ optionVal = ("");
+ }
+ if (selectProcesses.equals("鍏ㄩ儴")){
+ selectProcesses="";
+ }
+ String laminating = "";
+ Map<String, Object> map = new HashMap<>();
+ // 鑾峰彇鎵�鏈夊伐搴�
+ List<String> processList = reportMapper.selectProcess();
+ // 閬嶅巻姣忎釜宸ュ簭骞惰皟鐢ㄦ柊鏂规硶
+ List<Map<String, Object>> resultList = new ArrayList<>();
+ if (selectProcesses!=""){
+ laminating = reportingWorkMapper.getProcessLaminating(selectProcesses);
+ List<Map<String, Object>> singleResult = reportMapper.getWorkInProgressCombination(selectProcesses,laminating,optionVal);
+
+ resultList.addAll(singleResult);
+ }else {
+ for (String process : processList) {
+ //鑾峰彇鎶ュ伐宸ュ簭鏄惁涓哄鍚堝伐绋�
+ laminating = reportingWorkMapper.getProcessLaminating(process);
+ List<Map<String, Object>> singleResult = reportMapper.getWorkInProgressCombination(process,laminating,optionVal);
+
+ if (singleResult != null && !singleResult.isEmpty()) {
+ resultList.addAll(singleResult);
+ }
+ }
+ }
+
+ map.put("data",resultList);
+ map.put("process", productionSchedulingMapper.selectProcess());
+ return map;
+ }
+}
--
Gitblit v1.8.0