From 562926922386bb24070ea27eb5a27193c41e996b Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期四, 18 四月 2024 14:46:50 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java | 52 ++++++++++++++++++++++++++++++----------------------
1 files changed, 30 insertions(+), 22 deletions(-)
diff --git a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java
index 08ed607..12d2730 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java
@@ -154,31 +154,39 @@
result = new InsProductResult();
}
result.setInsProductId(Integer.parseInt(k));
- JSONArray jsonArray = JSON.parseArray(JSON.toJSONString(jo.get("insValue")));
- List<Map<String, Object>> iv = new ArrayList<>();
- for (Object o : jsonArray) {
- JSONObject insValue = JSON.parseObject(JSON.toJSONString(o));
- Map<String, Object> map = new HashMap<>();
- map.put("v", JSON.parseObject(JSON.toJSONString(insValue.get("v"))).get("v"));
- if ((insValue.get("u") == null || insValue.get("u").equals("")) && StrUtil.isNotEmpty(JSON.parseObject(JSON.toJSONString(insValue.get("v"))).get("v").toString())) {
- map.put("u", userId);
- } else {
- map.put("u", insValue.get("u"));
+ if(jo.get("insValue") != null){
+ JSONArray jsonArray = JSON.parseArray(JSON.toJSONString(jo.get("insValue")));
+ List<Map<String, Object>> iv = new ArrayList<>();
+ for (Object o : jsonArray) {
+ JSONObject insValue = JSON.parseObject(JSON.toJSONString(o));
+ Map<String, Object> map = new HashMap<>();
+ map.put("v", JSON.parseObject(JSON.toJSONString(insValue.get("v"))).get("v"));
+ try {
+ if ((insValue.get("u") == null || insValue.get("u").equals("")) && StrUtil.isNotEmpty(JSON.parseObject(JSON.toJSONString(insValue.get("v"))).get("v").toString())) {
+ map.put("u", userId);
+ } else {
+ map.put("u", insValue.get("u"));
+ }
+ iv.add(map);
+ }catch (Exception e){}
}
- iv.add(map);
+ result.setInsValue(JSON.toJSONString(iv));
}
- result.setInsValue(JSON.toJSONString(iv));
- JSONArray jsonArray2 = JSON.parseArray(JSON.toJSONString(jo.get("comValue")));
- List<Map<String, Object>> cv = new ArrayList<>();
- for (Object o : jsonArray2) {
- JSONObject comValue = JSON.parseObject(JSON.toJSONString(o));
- Map<String, Object> map = new HashMap<>();
- map.put("v", JSON.parseObject(JSON.toJSONString(comValue.get("v"))).get("v"));
- cv.add(map);
+ if(jo.get("comValue") != null){
+ JSONArray jsonArray2 = JSON.parseArray(JSON.toJSONString(jo.get("comValue")));
+ List<Map<String, Object>> cv = new ArrayList<>();
+ for (Object o : jsonArray2) {
+ JSONObject comValue = JSON.parseObject(JSON.toJSONString(o));
+ Map<String, Object> map = new HashMap<>();
+ map.put("v", JSON.parseObject(JSON.toJSONString(comValue.get("v"))).get("v"));
+ cv.add(map);
+ }
+ result.setComValue(JSON.toJSONString(cv));
}
- result.setComValue(JSON.toJSONString(cv));
JSONObject resValue = JSON.parseObject(JSON.toJSONString(jo.get("resValue")));
- insProduct.setLastValue(JSON.parseObject(JSON.toJSONString(resValue.get("v"))).get("v") + "");
+ if(resValue.get("v")!=null){
+ insProduct.setLastValue(JSON.parseObject(JSON.toJSONString(resValue.get("v"))).get("v") + "");
+ }
JSONObject equipValue = JSON.parseObject(JSON.toJSONString(jo.get("equipValue")));
try {
result.setEquipValue(JSON.parseObject(JSON.toJSONString(equipValue.get("v"))).get("v") + "");
@@ -483,7 +491,7 @@
Map<String, Object> style = new HashMap<>();
style.put("rowlen", config.get("rowlen"));
style.put("columnlen", config.get("columnlen"));
- int r = -1;
+// int r = -1;
/*if (BeanUtil.isNotEmpty(cellData)) {
for (JSONObject o : cellData) {
JSONObject v = JSON.parseObject(JSON.toJSONString(o.get("v")));
--
Gitblit v1.9.3