From 0d05424b5df05f2e6ef478934cdaad9c71e5d91d Mon Sep 17 00:00:00 2001
From: Fancy <Fancy.fx@outlook.com>
Date: 星期三, 18 九月 2024 09:34:56 +0800
Subject: [PATCH] product name and type
---
pms-parent/pms-web-other/src/main/java/com/dy/pmsOther/screen/ScreenReportSv.java | 40 ++++++++++++++++++++++++++++++++++++++++
1 files changed, 40 insertions(+), 0 deletions(-)
diff --git a/pms-parent/pms-web-other/src/main/java/com/dy/pmsOther/screen/ScreenReportSv.java b/pms-parent/pms-web-other/src/main/java/com/dy/pmsOther/screen/ScreenReportSv.java
index 7d13209..1150855 100644
--- a/pms-parent/pms-web-other/src/main/java/com/dy/pmsOther/screen/ScreenReportSv.java
+++ b/pms-parent/pms-web-other/src/main/java/com/dy/pmsOther/screen/ScreenReportSv.java
@@ -1,7 +1,10 @@
package com.dy.pmsOther.screen;
+import cn.hutool.json.JSONArray;
+import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.dy.pmsGlobal.daoPr.PrAssemblyPlanMapper;
import com.dy.pmsGlobal.daoSta.*;
import com.dy.pmsGlobal.pojoSta.*;
import lombok.extern.slf4j.Slf4j;
@@ -18,6 +21,8 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.stream.Collectors;
@Slf4j
@Service
@@ -27,6 +32,7 @@
private StaWipSnExMapper wipSnExDao;
private StaDeviceProductionLogMapper deviceProductionLogDao;
private StaRepairInfoMapper repairInfoDao;
+ private PrAssemblyPlanMapper assemblyPlanDao;
@Autowired
public void setDeviceLastDao(StaDeviceLastMapper deviceLastDao) {
this.deviceLastDao = deviceLastDao;
@@ -45,6 +51,11 @@
@Autowired
public void setDeviceProductionLogDao(StaDeviceProductionLogMapper deviceProductionLogDao) {
this.deviceProductionLogDao = deviceProductionLogDao;
+ }
+
+ @Autowired
+ public void setAssemblyPlanDao(PrAssemblyPlanMapper assemblyPlanDao) {
+ this.assemblyPlanDao = assemblyPlanDao;
}
@Autowired
@@ -98,4 +109,33 @@
Date date = Date.from(dt.atZone(ZoneId.systemDefault()).toInstant());
return date;
}
+
+ public List<JSONObject> queryPlanList() {
+ List<JSONObject> list = assemblyPlanDao.queryPlanList();
+ Map<String, JSONObject> map = new ConcurrentHashMap<>(); // 浣跨敤骞跺彂瀹夊叏鐨凪ap
+ for(JSONObject item:list){
+ String planId = String.valueOf(item.getObj("planId"));
+ JSONObject innerObject = new JSONObject()
+ .set("nodeId", String.valueOf(item.getObj("nodeId")))
+ .set("content", item.getObj("content"));
+ if(map.containsKey(planId)){
+ JSONArray array = (JSONArray)map.get(planId).get("nodes");
+ array.add(innerObject);
+ }else{
+ JSONArray array = new JSONArray();
+ array.add(innerObject);
+ JSONObject outObject= new JSONObject()
+ .set("planId", planId)
+ .set("planName", item.getObj("planName"))
+ .set("nodes", array);
+ map.put(planId,outObject);
+ }
+ }
+ return map.values().stream().collect(Collectors.toList());
+ }
+
+
+
+
+
}
--
Gitblit v1.8.0