From 08f5bd1e47f1673a804dce3d757a6e82328945a4 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期三, 19 十月 2022 10:32:43 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/controller/OrderController.java | 11 +++++++++++
src/main/resources/mapper/WrkDetlMapper.xml | 19 +++++++++++--------
src/main/java/com/zy/common/web/BaseController.java | 8 ++++++--
3 files changed, 28 insertions(+), 10 deletions(-)
diff --git a/src/main/java/com/zy/asrs/controller/OrderController.java b/src/main/java/com/zy/asrs/controller/OrderController.java
index 1ebddbd..8d6635a 100644
--- a/src/main/java/com/zy/asrs/controller/OrderController.java
+++ b/src/main/java/com/zy/asrs/controller/OrderController.java
@@ -1,5 +1,6 @@
package com.zy.asrs.controller;
+import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
@@ -12,6 +13,7 @@
import com.zy.asrs.entity.result.WrkTraceVo;
import com.zy.asrs.service.*;
import com.zy.common.model.DetlDto;
+import com.zy.common.model.OrderDto;
import com.zy.common.web.BaseController;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
@@ -269,6 +271,15 @@
List<WrkTraceVo> wrkTraceVos = new ArrayList<>();
List<WrkDetl> wrkDetls = wrkDetlService.selectAndLogByOrderNoGroupByMatnrOfSum(order.getOrderNo());
for (WrkDetl wrkDetl : wrkDetls) {
+ if (isJSON(wrkDetl.getOrderNo())) {
+ List<OrderDto> orderDtoList = JSON.parseArray(wrkDetl.getOrderNo(), OrderDto.class);
+ for (OrderDto one : orderDtoList) {
+ if (one.getOrderNo().equals(order.getOrderNo())) {
+ wrkDetl.setAnfme(one.getAnfme());
+ break;
+ }
+ }
+ }
WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", wrkDetl.getWrkNo()).eq("io_time", wrkDetl.getIoTime()));
if (wrkMast == null) {
WrkMastLog wrkMastLog = wrkMastLogService.selectOne(new EntityWrapper<WrkMastLog>().eq("wrk_no", wrkDetl.getWrkNo()).eq("io_time", wrkDetl.getIoTime()));
diff --git a/src/main/java/com/zy/common/web/BaseController.java b/src/main/java/com/zy/common/web/BaseController.java
index c0455b4..b4678bf 100644
--- a/src/main/java/com/zy/common/web/BaseController.java
+++ b/src/main/java/com/zy/common/web/BaseController.java
@@ -145,12 +145,16 @@
public static boolean isJSON(String str) {
if (Cools.isEmpty(str)) {
- return true;
+ return false;
} else {
str = str.trim();
if (str.startsWith("{") && str.endsWith("}")) {
+ return true;
+ } else if (str.startsWith("[") && str.endsWith("]")) {
+ return true;
+ } else {
return false;
- } else return !str.startsWith("[") || !str.endsWith("]");
+ }
}
}
}
diff --git a/src/main/resources/mapper/WrkDetlMapper.xml b/src/main/resources/mapper/WrkDetlMapper.xml
index fbdfeef..388b37f 100644
--- a/src/main/resources/mapper/WrkDetlMapper.xml
+++ b/src/main/resources/mapper/WrkDetlMapper.xml
@@ -95,18 +95,21 @@
</select>
<select id="selectAndLogByOrderNoGroupByMatnrOfSum" resultMap="BaseResultMap">
- select awd.wrk_no, awd.io_time, awd.matnr, sum(awd.anfme) as anfme
+ select awd.wrk_no, awd.io_time, awd.matnr, awd.order_no, sum(awd.anfme) as anfme
from asr_wrk_detl awd
left join asr_wrk_mast awm on awd.wrk_no = awm.wrk_no and awd.io_time = awm.io_time
where order_no like '%' + #{orderNo} + '%'
- group by awd.wrk_no, awd.io_time, awd.matnr
+ group by awd.wrk_no, awd.io_time, awd.matnr, awd.order_no
union
- select distinct awdl.wrk_no, awdl.io_time, awdl.matnr, sum(awdl.anfme) as anfme
- from asr_wrk_detl_log awdl
- left join asr_wrk_mast_log awml on awdl.wrk_no = awml.wrk_no and awdl.io_time = awml.io_time
- where awdl.order_no like '%' + #{orderNo} + '%'
- and (awml.manu_type is null or awml.manu_type != '鎵嬪姩鍙栨秷')
- group by awdl.wrk_no, awdl.io_time, awdl.matnr
+ select awdl.wrk_no, awdl.io_time, awdl.matnr, awdl.order_no, sum(awdl.anfme) as anfme from
+ (
+ select distinct awdl.*
+ from asr_wrk_detl_log awdl
+ left join asr_wrk_mast_log awml on awdl.wrk_no = awml.wrk_no and awdl.io_time = awml.io_time
+ where awdl.order_no like '%' + #{orderNo} + '%'
+ and (awml.manu_type is null or awml.manu_type != '鎵嬪姩鍙栨秷')
+ ) as awdl
+ group by awdl.wrk_no, awdl.io_time, awdl.matnr, awdl.order_no
</select>
<update id="updateInspect">
--
Gitblit v1.9.1