瀏覽代碼

update轧钢工序

qiangxuan 2 月之前
父節點
當前提交
ff8e6a9974

+ 29 - 17
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollClubThree/controller/RollClubThreeController.java

@@ -1,5 +1,6 @@
 package org.jeecg.modules.billet.rollClubThree.controller;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -9,11 +10,13 @@ import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.billet.operateLog.service.IOperateLogService;
 import org.jeecg.modules.billet.rollClubThree.entity.RollClubThree;
+import org.jeecg.modules.billet.rollClubThree.entity.RollClubThreeDetails;
+import org.jeecg.modules.billet.rollClubThree.service.IRollClubThreeDetailsService;
 import org.jeecg.modules.billet.rollClubThree.service.IRollClubThreeService;
 import org.jeecg.modules.billet.rollHeight.entity.DestinationStatistics;
-import org.jeecg.modules.billet.storageBill.entity.StorageBill;
 import org.jeecg.modules.billet.storageBill.service.IStorageBillService;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -23,6 +26,7 @@ import javax.servlet.http.HttpServletRequest;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * @Description: 轧钢棒三
@@ -37,8 +41,13 @@ import java.util.List;
 public class RollClubThreeController {
 	@Autowired
 	private IRollClubThreeService rollClubThreeService;
-	 @Autowired
-	 private IOperateLogService operateLogService;
+
+	@Autowired
+	private IRollClubThreeDetailsService rollClubThreeDetailsService;
+
+	@Autowired
+	private IOperateLogService operateLogService;
+
 	@Autowired
 	private IStorageBillService storageBillService;
 
@@ -66,26 +75,29 @@ public class RollClubThreeController {
 			return Result.OK(pageList);
 		}
 
-		List<RollClubThree> rollClubThreeList = new ArrayList<>();
+		List<RollClubThree> newRollClubThreeList = new ArrayList<>();
 		pageList.getRecords().forEach(x -> {
-			if (x != null) { // 判空
+			if (x != null) {
 				RollClubThree clubThree = new RollClubThree();
 				BeanUtils.copyProperties(x, clubThree);
-
-				// 判空处理:如果 StorageBillId 不为空才查询关联数据
-				if (x.getStorageBillId() != null) {
-					StorageBill storageBill = storageBillService.getById(x.getStorageBillId());
-					if (storageBill != null) { // 判空
-						clubThree.setAssemblyNumber(storageBill.getAssemblyNumber());
-					}
+				LambdaQueryWrapper<RollClubThreeDetails> queryWrapper1 = new LambdaQueryWrapper<>();
+				queryWrapper1.eq(RollClubThreeDetails::getCcmNo, x.getCcmNo());
+				queryWrapper1.eq(RollClubThreeDetails::getHeatNo, x.getHeatNo());
+				queryWrapper1.eq(RollClubThreeDetails::getStorageBillId, x.getStorageBillId());
+				List<RollClubThreeDetails> rollClubThreeDetailsLists = rollClubThreeDetailsService.list(queryWrapper1);
+				if (oConvertUtils.listIsNotEmpty(rollClubThreeDetailsLists)) {
+					String distinctAssemblyNumber = rollClubThreeDetailsLists.stream()
+							.map(RollClubThreeDetails::getAssemblyNumber)
+							.filter(assemblyNumber -> assemblyNumber != null && !assemblyNumber.trim().isEmpty())
+							.distinct()
+							.collect(Collectors.joining(","));
+					clubThree.setAssemblyNumber(distinctAssemblyNumber);
 				}
-
-				rollClubThreeList.add(clubThree);
+				newRollClubThreeList.add(clubThree);
 			}
 		});
-
-		// 更新分页数据
-		pageList.setRecords(rollClubThreeList);
+// 如果需要更新 pageList 的记录
+		pageList.setRecords(newRollClubThreeList);
 
 		return Result.OK(pageList);
 

+ 23 - 13
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollClubTwo/controller/RollClubTwoController.java

@@ -1,5 +1,6 @@
 package org.jeecg.modules.billet.rollClubTwo.controller;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -9,11 +10,13 @@ import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.billet.operateLog.service.IOperateLogService;
 import org.jeecg.modules.billet.rollClubTwo.entity.RollClubTwo;
+import org.jeecg.modules.billet.rollClubTwo.entity.RollClubTwoDetails;
+import org.jeecg.modules.billet.rollClubTwo.service.IRollClubTwoDetailsService;
 import org.jeecg.modules.billet.rollClubTwo.service.IRollClubTwoService;
 import org.jeecg.modules.billet.rollHeight.entity.DestinationStatistics;
-import org.jeecg.modules.billet.storageBill.entity.StorageBill;
 import org.jeecg.modules.billet.storageBill.service.IStorageBillService;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -23,6 +26,7 @@ import javax.servlet.http.HttpServletRequest;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * @Description: 轧钢棒二
@@ -37,6 +41,8 @@ import java.util.List;
 public class RollClubTwoController {
 	@Autowired
 	private IRollClubTwoService rollClubTwoService;
+	@Autowired
+	private IRollClubTwoDetailsService rollClubTwoDetailsService;
 	 @Autowired
 	 private IOperateLogService operateLogService;
 	@Autowired
@@ -63,26 +69,30 @@ public class RollClubTwoController {
 			return Result.OK(pageList);
 		}
 
-		List<RollClubTwo> rollClubTwoList = new ArrayList<>();
+		List<RollClubTwo> newRollClubTwoList = new ArrayList<>();
 		pageList.getRecords().forEach(x -> {
-			if (x != null) { // 判空
+			if (x != null) {
 				RollClubTwo clubTwo = new RollClubTwo();
 				BeanUtils.copyProperties(x, clubTwo);
-
-				// 判空处理:如果 StorageBillId 不为空才查询关联数据
-				if (x.getStorageBillId() != null) {
-					StorageBill storageBill = storageBillService.getById(x.getStorageBillId());
-					if (storageBill != null) { // 判空
-						clubTwo.setAssemblyNumber(storageBill.getAssemblyNumber());
-					}
+				LambdaQueryWrapper<RollClubTwoDetails> queryWrapper1 = new LambdaQueryWrapper<>();
+				queryWrapper1.eq(RollClubTwoDetails::getCcmNo, x.getCcmNo());
+				queryWrapper1.eq(RollClubTwoDetails::getHeatNo, x.getHeatNo());
+				queryWrapper1.eq(RollClubTwoDetails::getStorageBillId, x.getStorageBillId());
+				List<RollClubTwoDetails> rollClubTwoDetailsLists = rollClubTwoDetailsService.list(queryWrapper1);
+				if (oConvertUtils.listIsNotEmpty(rollClubTwoDetailsLists)) {
+					String distinctAssemblyNumber = rollClubTwoDetailsLists.stream()
+							.map(RollClubTwoDetails::getAssemblyNumber)
+							.filter(assemblyNumber -> assemblyNumber != null && !assemblyNumber.trim().isEmpty())
+							.distinct()
+							.collect(Collectors.joining(","));
+					clubTwo.setAssemblyNumber(distinctAssemblyNumber);
 				}
-
-				rollClubTwoList.add(clubTwo);
+				newRollClubTwoList.add(clubTwo);
 			}
 		});
 
 		// 更新分页数据
-		pageList.setRecords(rollClubTwoList);
+		pageList.setRecords(newRollClubTwoList);
 
 		return Result.OK(pageList);
 	}

+ 25 - 15
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/rollOutShipp/controller/RollOutShippController.java

@@ -1,5 +1,6 @@
 package org.jeecg.modules.billet.rollOutShipp.controller;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -9,11 +10,13 @@ import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.billet.operateLog.service.IOperateLogService;
 import org.jeecg.modules.billet.rollHeight.entity.DestinationStatistics;
 import org.jeecg.modules.billet.rollOutShipp.entity.RollOutShipp;
+import org.jeecg.modules.billet.rollOutShipp.entity.RollOutShippDetails;
+import org.jeecg.modules.billet.rollOutShipp.service.IRollOutShippDetailsService;
 import org.jeecg.modules.billet.rollOutShipp.service.IRollOutShippService;
-import org.jeecg.modules.billet.storageBill.entity.StorageBill;
 import org.jeecg.modules.billet.storageBill.service.IStorageBillService;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -23,6 +26,7 @@ import javax.servlet.http.HttpServletRequest;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * @Description: 上若
@@ -38,6 +42,8 @@ public class RollOutShippController {
 	@Autowired
 	private IRollOutShippService rollOutShippService;
 	@Autowired
+	private IRollOutShippDetailsService rollOutShippDetailsService;
+	@Autowired
 	private IOperateLogService operateLogService;
 	@Autowired
 	private IStorageBillService storageBillService;
@@ -67,26 +73,30 @@ public class RollOutShippController {
 			return Result.OK(pageList);
 		}
 
-		List<RollOutShipp> rollOutShippList = new ArrayList<>();
+		List<RollOutShipp> newRollOutShippList = new ArrayList<>();
 		pageList.getRecords().forEach(x -> {
-			if (x != null) { // 判空
-				RollOutShipp outShipp = new RollOutShipp();
-				BeanUtils.copyProperties(x, outShipp);
-
-				// 判空处理:如果 StorageBillId 不为空才查询关联数据
-				if (x.getStorageBillId() != null) {
-					StorageBill storageBill = storageBillService.getById(x.getStorageBillId());
-					if (storageBill != null) { // 判空
-						outShipp.setAssemblyNumber(storageBill.getAssemblyNumber());
-					}
+			if (x != null) {
+				RollOutShipp rollOutShipp1 = new RollOutShipp();
+				BeanUtils.copyProperties(x, rollOutShipp1);
+				LambdaQueryWrapper<RollOutShippDetails> queryWrapper1 = new LambdaQueryWrapper<>();
+				queryWrapper1.eq(RollOutShippDetails::getCcmNo, x.getCcmNo());
+				queryWrapper1.eq(RollOutShippDetails::getHeatNo, x.getHeatNo());
+				queryWrapper1.eq(RollOutShippDetails::getStorageBillId, x.getStorageBillId());
+				List<RollOutShippDetails> rollClubThreeDetailsLists = rollOutShippDetailsService.list(queryWrapper1);
+				if (oConvertUtils.listIsNotEmpty(rollClubThreeDetailsLists)) {
+					String distinctAssemblyNumber = rollClubThreeDetailsLists.stream()
+							.map(RollOutShippDetails::getAssemblyNumber)
+							.filter(assemblyNumber -> assemblyNumber != null && !assemblyNumber.trim().isEmpty())
+							.distinct()
+							.collect(Collectors.joining(","));
+					rollOutShipp1.setAssemblyNumber(distinctAssemblyNumber);
 				}
-
-				rollOutShippList.add(outShipp);
+				newRollOutShippList.add(rollOutShipp1);
 			}
 		});
 
 		// 更新分页数据
-		pageList.setRecords(rollOutShippList);
+		pageList.setRecords(newRollOutShippList);
 
 		return Result.OK(pageList);
 	}