From cc8efc81d2d35bed40e47d0a5b0920a4b6f8095f Mon Sep 17 00:00:00 2001
From: guoyujie <guoyujie@ng.com>
Date: 星期四, 23 十月 2025 11:04:05 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override
---
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportService.java | 520 ++++++++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 469 insertions(+), 51 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
index 0f6674b..38731d4 100644
--- 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
@@ -4,31 +4,34 @@
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.dynamic.datasource.annotation.DS;
+import com.example.erp.tools.AreaComputed.*;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.erp.dto.pp.*;
+import com.example.erp.entity.pp.DamageDetails;
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.pp.*;
import com.example.erp.mapper.sd.*;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.sql.Date;
+import java.sql.SQLOutput;
import java.time.LocalDate;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
import static cn.hutool.core.convert.Convert.toDouble;
+import static com.example.erp.tools.AreaComputed.computeArea;
@Service
@DS("pp")
@@ -42,6 +45,7 @@
private final BasicDataMapper basicDataMapper;
private final ProductDetailMapper productDetailMapper;
private final OrderDetailMapper orderDetailMapper;
+ private final DamageDetailsMapper damageDetailsMapper;
FlowCardMapper flowCardMapper;
private ReportingWorkMapper reportingWorkMapper;
@@ -72,7 +76,7 @@
.eq("glass_sort",dto1.getTechnologyNumber())
);
dto1.setGlassName(productDetail.getDetail());
-
+ //basicData.getNickname().equals("stepC")
}else if(basicData.getNickname().equals("stepC")){
OrderGlassDetail orderGlassDetailGroup = orderGlassDetailMapper
.selectOne(new QueryWrapper<OrderGlassDetail>()
@@ -122,7 +126,7 @@
ProductionSchedulingMapper productionSchedulingMapper, FlowCardMapper flowCardMapper,
OrderGlassDetailMapper orderGlassDetailMapper, BasicDataMapper basicDataMapper,
ProductDetailMapper productDetailMapper, OrderDetailMapper orderDetailMapper,
- ReportingWorkMapper reportingWorkMapper) {
+ ReportingWorkMapper reportingWorkMapper, DamageDetailsMapper damageDetailsMapper) {
this.reportMapper = reportMapper;
this.orderProcessDetailMapper = orderProcessDetailMapper;
this.productionSchedulingMapper = productionSchedulingMapper;
@@ -132,10 +136,11 @@
this.productDetailMapper = productDetailMapper;
this.orderDetailMapper = orderDetailMapper;
this.reportingWorkMapper = reportingWorkMapper;
+ this.damageDetailsMapper = damageDetailsMapper;
}
//娴佺▼鍗¤繘搴︽柟娉�
- public Map<String, Object> processCardProgressSv(String orderId, List<Integer> columns) {
+ public Map<String, Object> processCardProgressSv(String orderId, List<String> columns) {
Map<String, Object> map = new HashMap<>();
//鑾峰彇琛ㄦ牸鍐呭鏁版嵁
List<Map<String, String>> dataList = reportMapper.processCardProgressMp(orderId);
@@ -146,6 +151,7 @@
map.put("title", uniqueList);
Map<String,Integer> clos = new HashMap<>();
+ HashMap<String,HashMap<String,Map<String, Integer>>> rowCount = new HashMap<String,HashMap<String,Map<String, Integer>>>();
for (int i=0;i<uniqueList.size();i++){
//鏍规嵁娴佺▼鏌ヨ鍩虹鏁版嵁
BasicData basicData = basicDataMapper.selectOne(
@@ -154,36 +160,102 @@
.eq("basic_name",uniqueList.get(i).get("process"))
.last("limit 1")
);
- //鍒ゆ柇纾ㄨ竟鍜岀(杈瑰悗宸ュ簭
+
+ //鍒ゆ柇澶硅兌鍜屽す鑳跺悗宸ュ簭
+ //Objects.equals(basicData.getNickname(), "stepA") || Objects.equals(basicData.getNickname(), "stepC")
if(Objects.equals(basicData.getNickname(), "stepA") || Objects.equals(basicData.getNickname(), "stepC")){
- clos.put(uniqueList.get(i).get("process"), 15+i);
+ clos.put(uniqueList.get(i).get("process"), 14+i);
}
//鍒ゆ柇涓┖鍜屼腑绌哄悗宸ュ簭
+ //Objects.equals(basicData.getNickname(), "stepB") || Objects.equals(basicData.getNickname(), "stepD")
if(Objects.equals(basicData.getNickname(), "stepB") || Objects.equals(basicData.getNickname(), "stepD")){
- columns.add(15+i);
+ columns.add("reportWorkQuantity."+uniqueList.get(i).get("process"));
}
}
- 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);
- });
+ List<Map<String, Object>> getRowCount = orderProcessDetailMapper.getGlassLRow(orderId);
+ HashMap<Integer,Map<String, Object>> getRowCountMap = new HashMap<>();
+ getRowCount.forEach(col -> {
+ Integer getRowCountOrderNumber = ((Number) col.get("order_number")).intValue();
+ getRowCountMap.put(getRowCountOrderNumber, col);
});
- if(!clos.isEmpty()){
- //寰幆缁撴灉
- for (int i=0;i<dataList.size();i++ ) {
- Map<String, String> data = JSON.parseObject(dataList.get(i).get("reportWorkQuantity"),
- new TypeReference<Map<String, String>>() {
- });
+
+ //寰幆缁撴灉
+ for (int i=0;i<dataList.size();i++ ) {
+ Integer orderNumber = Integer.parseInt(String.valueOf(dataList.get(i).get("order_number")));
+ Integer technologyNumber = Integer.parseInt(String.valueOf(dataList.get(i).get("technology_number")));
+ int finalI1 = i;
+ columns.forEach(col -> {
+ if(rowCount.get(col) == null){
+ rowCount.put(col, new HashMap<String,Map<String,Integer>>());
+ }
+
+ if(getRowCountMap.get(orderNumber) != null){
+ Map<String,Object> row = getRowCountMap.get(orderNumber);
+ Map<String, Integer> getRow = new HashMap<>();
+ //鍒ゆ柇褰撳墠姝ゆ 鏄惁涓虹涓�琛� 骞朵笖鐩稿悓搴忓彿
+ if(technologyNumber==1){
+ getRow.put("rowspan", ((Number) row.get("rowCount")).intValue());
+ getRow.put("colspan", 1);
+ }else{
+ getRow.put("rowspan", 0);
+ getRow.put("colspan", 0);
+ }
+ rowCount.get(col).put(finalI1+"_"+col, getRow);
+ }
+
+
+ });
+
+
+ Map<String, String> data = JSON.parseObject(dataList.get(i).get("reportWorkQuantity"),
+ new TypeReference<Map<String, String>>() {
+ });
+ Map<String, String> dataShow = JSON.parseObject(dataList.get(i).get("reportWorkQuantityShow"),
+ new TypeReference<Map<String, String>>() {
+ });
+ //鍒ゆ柇鍚庡伐搴忔娴佺▼鍗″彿鏄惁鏈夋鐮�
+ List<DamageDetails> hasBreak = damageDetailsMapper
+ .getNotReview(dataList.get(i).get("processId"),
+ String.valueOf(dataList.get(i).get("order_number")),
+ String.valueOf(dataList.get(i).get("technology_number"))
+ );
+
+
+
+
+
+ if(!hasBreak.isEmpty()){
+ int finalI = i;
+ data.forEach((thisProcess, index)->{
+ String behindProcess = orderProcessDetailMapper.getBehindProcess(
+ dataList.get(finalI).get("processId"),
+ String.valueOf(dataList.get(finalI).get("order_number")),
+ String.valueOf(dataList.get(finalI).get("technology_number")),
+ thisProcess,
+ orderId
+ );
+
+ if(behindProcess!=null &&!behindProcess.isEmpty()){
+ Integer behindDamageSum = damageDetailsMapper.getBehindDamageSum(
+ dataList.get(finalI).get("processId"),
+ String.valueOf(dataList.get(finalI).get("order_number")),
+ String.valueOf(dataList.get(finalI).get("technology_number")),
+ behindProcess,1
+ );
+ if(behindDamageSum>0){
+ data.put(thisProcess, String.valueOf(Integer.parseInt(data.get(thisProcess) )- behindDamageSum));
+ dataShow.put(thisProcess, String.valueOf(Integer.parseInt(dataShow.get(thisProcess) )- behindDamageSum));
+ }
+
+ }
+ });
+
+ }
+ //澶硅兌宸ュ簭鍒ゆ柇鍚堝苟琛屾暟
+ if(!clos.isEmpty()){
+
Integer max = orderGlassDetailMapper
.getMaxTechnologyNumberByGroup(dataList.get(i).get("order_id"),
String.valueOf(dataList.get(i).get("order_number")),
@@ -194,27 +266,34 @@
String.valueOf(dataList.get(i).get("order_number")),
String.valueOf(dataList.get(i).get("group"))
);
+
for (String key : clos.keySet()) {
if(data.get(key) != null){
-
+ if (rowCount.get("reportWorkQuantity."+key)==null){
+ rowCount.put("reportWorkQuantity."+key, new HashMap<String,Map<String,Integer>>());
+ }
+ Map<String, Integer> getRow = new HashMap<>();
if(min == Integer.parseInt(String.valueOf(dataList.get(i).get("technology_number"))) ){
- Map<String, Integer> getRow = new HashMap<>();
- // { row: 0, col: 1, rowspan: 3, colspan: 0},
- getRow.put("row", i );
- getRow.put("col", clos.get(key));
- getRow.put("rowspan", max-min+1);
- getRow.put("colspan", 0);
- rowCount.add(getRow);
+
+ // { row: 0, col: 1, rowspan: 3, colspan: 0},
+ //getRow.put("row", i );
+ getRow.put("rowspan", max-min+1);
+ getRow.put("colspan", 1);
+
}else{
+ getRow.put("rowspan", 0);
+ getRow.put("colspan", 0);
data.put(key,"0");
}
-
+ rowCount.get("reportWorkQuantity."+key).put(i+"_reportWorkQuantity."+key, getRow);
}
}
- dataList.get(i).put("reportWorkQuantity",JSON.toJSONString(data));
-
}
+ dataList.get(i).put("reportWorkQuantity",JSON.toJSONString(data));
+ dataList.get(i).put("reportWorkQuantityShow",JSON.toJSONString(dataShow));
+
}
+
@@ -257,7 +336,7 @@
if ("null".equals(optionVal)) {
optionVal = ("");
}
- if (selectProcesses.equals("鍏ㄩ儴")){
+ if (selectProcesses.equals("all")){
selectProcesses="";
}
String laminating = reportMapper.getLaminating(selectProcesses);
@@ -333,7 +412,7 @@
return map;
}
- public Map<String, Object> yieldSv(Date selectTime1, Date selectTime2, String selectProcesses, Report report) {
+ public Map<String, Object> yieldSv(String selectTime1, String 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());
@@ -389,15 +468,15 @@
map.put("title", uniqueList);
- List<Map<String, Integer>> getRowCount = orderProcessDetailMapper.getGlassLRow(orderId);
+ List<Map<String, Object>> 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("row", ((Number) row.get("RowNum")).intValue());
getRow.put("col", col);
- getRow.put("rowspan", row.get("rowCount"));
+ getRow.put("rowspan", ((Number) row.get("rowCount")).intValue());
getRow.put("colspan", 0);
rowCount.add(getRow);
});
@@ -539,7 +618,7 @@
public List exportWorkInProgressSv(Map<String, Object> dates) {
String process= (String) dates.get("processes");
- if (process.equals("鍏ㄩ儴")){
+ if (process.equals("all")){
process="";
}
String inputVal= (String) dates.get("inputVal");
@@ -576,12 +655,13 @@
}
public Map<String, Object> teamOutputSv(Integer pageNum, Integer pageSize, String selectTime1, String selectTime2, String selectProcesses, TeamOutputDTO teamOutputDTO) {
- if (selectProcesses.equals("鍏ㄩ儴")){
+ if (selectProcesses.equals("all")){
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));
@@ -607,7 +687,7 @@
public List exportTeamOutputSv(Map<String, Object> dates) {
List<LocalDate> date= (List<LocalDate>) dates.get("date");
String process= (String) dates.get("processes");
- if (process.equals("鍏ㄩ儴")){
+ if (process.equals("all")){
process="";
}
String laminating = reportMapper.getLaminating(process);
@@ -648,7 +728,7 @@
if ("null".equals(optionVal)) {
optionVal = "";
}
- if ("鍏ㄩ儴".equals(selectProcesses)) {
+ if ("all".equals(selectProcesses)) {
selectProcesses = "";
}
@@ -726,7 +806,7 @@
public List exportWorkInProgressCombinationSv(Map<String, Object> dates) {
String process= (String) dates.get("processes");
- if (process.equals("鍏ㄩ儴")){
+ if (process.equals("all")){
process="";
}
String inputVal= (String) dates.get("inputVal");
@@ -771,14 +851,352 @@
return resultList;
}
- public Object processCardProgressCollectSv(String orderId, List<Integer> columns) {
+ public Object processCardProgressCollectSv(String orderId, List<String> columns) {
Map<String, Object> map = new HashMap<>();
//鑾峰彇琛ㄦ牸鍐呭鏁版嵁
List<Map<String, String>> dataList = reportMapper.processCardProgressCollectMp(orderId);
//鑾峰彇琛ㄥご宸ュ簭绛涢�夋暟鎹�
List<Map<String, String>> uniqueList = orderProcessDetailMapper.filterOrderProcess(orderId);
+ map.put("title", uniqueList);
+ Map<String,Map<String,Object>> clos = new HashMap<>();
+ for (int i=0;i<uniqueList.size();i++){
+ //鏍规嵁娴佺▼鏌ヨ鍩虹鏁版嵁
+ BasicData basicData = basicDataMapper.selectOne(
+ new QueryWrapper<BasicData>()
+ .eq("basic_category","process")
+ .eq("basic_name",uniqueList.get(i).get("process"))
+ .last("limit 1")
+ );
+ Map<String,Object> getCol = new HashMap<>();
+ //鍒ゆ柇澶硅兌鍜屽す鑳跺悗宸ュ簭
+ //Objects.equals(basicData.getNickname(), "stepA") || Objects.equals(basicData.getNickname(), "stepC")
+ if(Objects.equals(basicData.getNickname(), "stepA") || Objects.equals(basicData.getNickname(), "stepC")){
+ getCol.put("col", 11+i);
+ getCol.put("step","stepA");
+ clos.put(uniqueList.get(i).get("process"), getCol);
+ }
+ //鍒ゆ柇涓┖鍜屼腑绌哄悗宸ュ簭
+ //Objects.equals(basicData.getNickname(), "stepB") || Objects.equals(basicData.getNickname(), "stepD")
+ if(Objects.equals(basicData.getNickname(), "stepB") || Objects.equals(basicData.getNickname(), "stepD")){
+ columns.add("reportWorkQuantity."+uniqueList.get(i).get("process"));
+ getCol.put("col", 11+i);
+ getCol.put("step","stepB");
+ clos.put(uniqueList.get(i).get("process"), getCol);
+ }
+ }
+ List<Map<String, Object>> getRowCount = orderProcessDetailMapper.getGlassLRow(orderId);
+ HashMap<String,Map<String, Object>> getRowCountMap = new HashMap<>();
+ getRowCount.forEach(col -> {
+ String getRowCountProcessId = String.valueOf(col.get("process_id"));
+ getRowCountMap.put(getRowCountProcessId, col);
+ });
+ HashMap<String,HashMap<String,Map<String, Integer>>> rowCount = new HashMap<String,HashMap<String,Map<String, Integer>>>();
+ //寰幆缁撴灉
+ for (int i=0;i<dataList.size();i++ ) {
+ String processId = String.valueOf(dataList.get(i).get("process_id"));
+ Integer technologyNumber = Integer.parseInt(String.valueOf(dataList.get(i).get("technology_number")));
+ int finalI1 = i;
+ columns.forEach(col -> {
+ if(rowCount.get(col) == null){
+ rowCount.put(col, new HashMap<String,Map<String,Integer>>());
+ }
+
+ if(getRowCountMap.get(processId) != null){
+ Map<String,Object> row = getRowCountMap.get(processId);
+ Map<String, Integer> getRow = new HashMap<>();
+ //鍒ゆ柇褰撳墠姝ゆ 鏄惁涓虹涓�琛� 骞朵笖鐩稿悓搴忓彿
+ if(technologyNumber==1){
+ getRow.put("rowspan", ((Number) row.get("rowCount")).intValue());
+ getRow.put("colspan", 1);
+ }else{
+ getRow.put("rowspan", 0);
+ getRow.put("colspan", 0);
+ }
+ rowCount.get(col).put(finalI1+"_"+col, getRow);
+ }
+
+
+ });
+
+
+ dataList.get(i).put("reportWorkQuantityShow",dataList.get(i).get("reportWorkQuantity"));
+ Map<String, String> data = JSON.parseObject(dataList.get(i).get("reportWorkQuantity"),
+ new TypeReference<Map<String, String>>() {
+ });
+ Map<String, String> dataShow = JSON.parseObject(dataList.get(i).get("reportWorkQuantityShow"),
+ new TypeReference<Map<String, String>>() {
+ });
+ //鍒ゆ柇鍚庡伐搴忔娴佺▼鍗″彿鏄惁鏈夋鐮�
+ List<DamageDetails> hasBreak = damageDetailsMapper
+ .getNotReview(dataList.get(i).get("process_id"),
+ null,
+ String.valueOf(dataList.get(i).get("technology_number"))
+ );
+
+ if(!hasBreak.isEmpty()){
+ int finalI = i;
+ data.forEach((thisProcess, index)->{
+ String behindProcess = orderProcessDetailMapper.getBehindProcess(
+ dataList.get(finalI).get("process_id"),
+ String.valueOf(dataList.get(finalI).get("order_number")),
+ String.valueOf(dataList.get(finalI).get("technology_number")),
+ thisProcess,
+ orderId
+ );
+
+ if(behindProcess!=null &&!behindProcess.isEmpty()){
+ Integer behindDamageSum = damageDetailsMapper.getBehindDamageSum(
+ dataList.get(finalI).get("process_id"),
+ String.valueOf(dataList.get(finalI).get("order_number")),
+ String.valueOf(dataList.get(finalI).get("technology_number")),
+ behindProcess,
+ null
+ );
+ if(behindDamageSum>0){
+ data.put(thisProcess, String.valueOf(Integer.parseInt(data.get(thisProcess) )- behindDamageSum));
+ dataShow.put(thisProcess, String.valueOf(Integer.parseInt(dataShow.get(thisProcess) )- behindDamageSum));
+ }
+
+ }
+ });
+
+ }
+
+ if(!clos.isEmpty()){
+ Integer max = orderGlassDetailMapper
+ .getMaxTechnologyNumberByGroup(dataList.get(i).get("order_id"),
+ String.valueOf(dataList.get(i).get("order_number")),
+ String.valueOf(dataList.get(i).get("group"))
+ );
+ Integer min = orderGlassDetailMapper
+ .getMinTechnologyNumberByGroup(dataList.get(i).get("order_id"),
+ String.valueOf(dataList.get(i).get("order_number")),
+ String.valueOf(dataList.get(i).get("group"))
+ );
+
+ for (String key : clos.keySet()) {
+ if(data.get(key) != null){
+ //鍒ゆ柇鏄す鑳跺伐搴�
+ if( clos.get(key).get("step")=="stepA"){
+ if (rowCount.get("reportWorkQuantity."+key)==null){
+ rowCount.put("reportWorkQuantity."+key, new HashMap<String,Map<String,Integer>>());
+ }
+ Map<String, Integer> getRow = new HashMap<>();
+ if(min == Integer.parseInt(String.valueOf(dataList.get(i).get("technology_number"))) ){
+ getRow.put("rowspan", max-min+1);
+ getRow.put("colspan", 1);
+ }else{
+ getRow.put("rowspan", 0);
+ getRow.put("colspan", 0);
+ data.put(key,"0");
+ }
+ rowCount.get("reportWorkQuantity."+key).put(i+"_reportWorkQuantity."+key, getRow);
+ }else{//涓┖锛屼腑绌哄悗宸ュ簭
+ //灏忕墖搴忓彿涓嶆槸1 鐨勬椂鍊欒祴鍊�0
+ if(Integer.parseInt(String.valueOf(dataList.get(i).get("technology_number"))) !=1){
+ data.put(key,"0");
+ }
+ }
+
+ }
+
+ }
+ }
+ dataList.get(i).put("reportWorkQuantity",JSON.toJSONString(data));
+ dataList.get(i).put("reportWorkQuantityShow",JSON.toJSONString(dataShow));
+
+ }
+
+ map.put("mergeCells", rowCount);
+
+ map.put("data",dataList);
+
+
+ return map;
+ }
+
+ public Map<String, Object> processCardProgressReportSv(String orderId, List<String> columns) {
+ Map<String, Object> map = new HashMap<>();
+ //鑾峰彇琛ㄦ牸鍐呭鏁版嵁
+ List<Map<String, String>> dataList = reportMapper.processCardProgressReportMp(orderId);
+
+ //鑾峰彇琛ㄥご宸ュ簭绛涢�夋暟鎹�
+ List<Map<String, String>> uniqueList = orderProcessDetailMapper.filterOrderProcess(orderId);
map.put("title", uniqueList);
- return null;
+ Map<String,Integer> clos = new HashMap<>();
+ HashMap<String,HashMap<String,Map<String, Integer>>> rowCount = new HashMap<String,HashMap<String,Map<String, Integer>>>();
+ for (int i=0;i<uniqueList.size();i++){
+ //鏍规嵁娴佺▼鏌ヨ鍩虹鏁版嵁
+ BasicData basicData = basicDataMapper.selectOne(
+ new QueryWrapper<BasicData>()
+ .eq("basic_category","process")
+ .eq("basic_name",uniqueList.get(i).get("process"))
+ .last("limit 1")
+ );
+
+ //鍒ゆ柇澶硅兌鍜屽す鑳跺悗宸ュ簭
+ //Objects.equals(basicData.getNickname(), "stepA") || Objects.equals(basicData.getNickname(), "stepC")
+ if(Objects.equals(basicData.getNickname(), "stepA") || Objects.equals(basicData.getNickname(), "stepC")){
+ clos.put(uniqueList.get(i).get("process"), 14+i);
+ }
+ //鍒ゆ柇涓┖鍜屼腑绌哄悗宸ュ簭
+ //Objects.equals(basicData.getNickname(), "stepB") || Objects.equals(basicData.getNickname(), "stepD")
+ if(Objects.equals(basicData.getNickname(), "stepB") || Objects.equals(basicData.getNickname(), "stepD")){
+ columns.add("reportWorkQuantity."+uniqueList.get(i).get("process"));
+ }
+ }
+
+
+ List<Map<String, Object>> getRowCount = orderProcessDetailMapper.getGlassLRow(orderId);
+ HashMap<Integer,Map<String, Object>> getRowCountMap = new HashMap<>();
+ getRowCount.forEach(col -> {
+ Integer getRowCountOrderNumber = ((Number) col.get("order_number")).intValue();
+ getRowCountMap.put(getRowCountOrderNumber, col);
+ });
+
+ //寰幆缁撴灉
+ for (int i=0;i<dataList.size();i++ ) {
+ Integer orderNumber = Integer.parseInt(String.valueOf(dataList.get(i).get("order_number")));
+ Integer technologyNumber = Integer.parseInt(String.valueOf(dataList.get(i).get("technology_number")));
+ int finalI1 = i;
+ columns.forEach(col -> {
+ if(rowCount.get(col) == null){
+ rowCount.put(col, new HashMap<String,Map<String,Integer>>());
+ }
+
+ if(getRowCountMap.get(orderNumber) != null){
+ Map<String,Object> row = getRowCountMap.get(orderNumber);
+ Map<String, Integer> getRow = new HashMap<>();
+ //鍒ゆ柇褰撳墠姝ゆ 鏄惁涓虹涓�琛� 骞朵笖鐩稿悓搴忓彿
+ if(technologyNumber==1){
+ getRow.put("rowspan", ((Number) row.get("rowCount")).intValue());
+ getRow.put("colspan", 1);
+ }else{
+ getRow.put("rowspan", 0);
+ getRow.put("colspan", 0);
+ }
+ rowCount.get(col).put(finalI1+"_"+col, getRow);
+ }
+
+
+ });
+
+
+ Map<String, String> data = JSON.parseObject(dataList.get(i).get("reportWorkQuantity"),
+ new TypeReference<Map<String, String>>() {
+ });
+ Map<String, String> dataShow = JSON.parseObject(dataList.get(i).get("reportWorkQuantityShow"),
+ new TypeReference<Map<String, String>>() {
+ });
+ //鍒ゆ柇鍚庡伐搴忔娴佺▼鍗″彿鏄惁鏈夋鐮�
+ List<DamageDetails> hasBreak = damageDetailsMapper
+ .getNotReview(dataList.get(i).get("processId"),
+ String.valueOf(dataList.get(i).get("order_number")),
+ String.valueOf(dataList.get(i).get("technology_number"))
+ );
+
+
+
+
+
+ if(!hasBreak.isEmpty()){
+ int finalI = i;
+ data.forEach((thisProcess, index)->{
+ String behindProcess = orderProcessDetailMapper.getBehindProcess(
+ dataList.get(finalI).get("processId"),
+ String.valueOf(dataList.get(finalI).get("order_number")),
+ String.valueOf(dataList.get(finalI).get("technology_number")),
+ thisProcess,
+ orderId
+ );
+
+ if(behindProcess!=null &&!behindProcess.isEmpty()){
+ Integer behindDamageSum = damageDetailsMapper.getBehindDamageSum(
+ dataList.get(finalI).get("processId"),
+ String.valueOf(dataList.get(finalI).get("order_number")),
+ String.valueOf(dataList.get(finalI).get("technology_number")),
+ behindProcess,1
+ );
+ if(behindDamageSum>0){
+ data.put(thisProcess, String.valueOf(Integer.parseInt(data.get(thisProcess) )- behindDamageSum));
+ dataShow.put(thisProcess, String.valueOf(Integer.parseInt(dataShow.get(thisProcess) )- behindDamageSum));
+ }
+
+ }
+ });
+
+ }
+ //澶硅兌宸ュ簭鍒ゆ柇鍚堝苟琛屾暟
+ if(!clos.isEmpty()){
+
+ Integer max = orderGlassDetailMapper
+ .getMaxTechnologyNumberByGroup(dataList.get(i).get("order_id"),
+ String.valueOf(dataList.get(i).get("order_number")),
+ String.valueOf(dataList.get(i).get("group"))
+ );
+ Integer min = orderGlassDetailMapper
+ .getMinTechnologyNumberByGroup(dataList.get(i).get("order_id"),
+ String.valueOf(dataList.get(i).get("order_number")),
+ String.valueOf(dataList.get(i).get("group"))
+ );
+
+ for (String key : clos.keySet()) {
+ if(data.get(key) != null){
+ if (rowCount.get("reportWorkQuantity."+key)==null){
+ rowCount.put("reportWorkQuantity."+key, new HashMap<String,Map<String,Integer>>());
+ }
+ Map<String, Integer> getRow = new HashMap<>();
+ if(min == Integer.parseInt(String.valueOf(dataList.get(i).get("technology_number"))) ){
+
+ // { row: 0, col: 1, rowspan: 3, colspan: 0},
+ //getRow.put("row", i );
+ getRow.put("rowspan", max-min+1);
+ getRow.put("colspan", 1);
+
+ }else{
+ getRow.put("rowspan", 0);
+ getRow.put("colspan", 0);
+ data.put(key,"0");
+ }
+ rowCount.get("reportWorkQuantity."+key).put(i+"_reportWorkQuantity."+key, getRow);
+ }
+ }
+ }
+ dataList.get(i).put("reportWorkQuantity",JSON.toJSONString(data));
+ dataList.get(i).put("reportWorkQuantityShow",JSON.toJSONString(dataShow));
+
+ }
+
+
+
+
+ map.put("data",dataList );
+ map.put("mergeCells", rowCount);
+
+ return map;
+ }
+
+ public Map<String, Object> yieldProcessSv(String selectTime1, String selectTime2, Report report) {
+ Map<String, Object> map = new HashMap<>();
+ map.put("data", reportMapper.yieldProcessMp(selectTime1, selectTime2, report));
+ map.put("process", productionSchedulingMapper.selectProcess());
+ return map;
+ }
+
+ public Map<String, Object> selectProcessCompletedSv(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<>();
+ String laminating = reportMapper.getLaminating(selectProcesses);
+ map.put("data", reportMapper.selectProcessCompletedMp(selectTime1, selectTime2, orderId, inputProject, selectProcesses,laminating, report));
+ map.put("process", productionSchedulingMapper.selectProcess());
+ map.put("footSum" ,reportMapper.processToBeCompletedFootSum(selectTime1, selectTime2, orderId, inputProject, selectProcesses, report));
+
+ return map;
}
}
--
Gitblit v1.8.0