|
@@ -1,5 +1,6 @@
|
|
package org.jeecg.modules.billet.rollClubThree.controller;
|
|
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.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
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.api.vo.Result;
|
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
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.operateLog.service.IOperateLogService;
|
|
import org.jeecg.modules.billet.rollClubThree.entity.RollClubThree;
|
|
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.rollClubThree.service.IRollClubThreeService;
|
|
import org.jeecg.modules.billet.rollHeight.entity.DestinationStatistics;
|
|
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.jeecg.modules.billet.storageBill.service.IStorageBillService;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -23,6 +26,7 @@ import javax.servlet.http.HttpServletRequest;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.Arrays;
|
|
import java.util.Arrays;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @Description: 轧钢棒三
|
|
* @Description: 轧钢棒三
|
|
@@ -37,8 +41,13 @@ import java.util.List;
|
|
public class RollClubThreeController {
|
|
public class RollClubThreeController {
|
|
@Autowired
|
|
@Autowired
|
|
private IRollClubThreeService rollClubThreeService;
|
|
private IRollClubThreeService rollClubThreeService;
|
|
- @Autowired
|
|
|
|
- private IOperateLogService operateLogService;
|
|
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private IRollClubThreeDetailsService rollClubThreeDetailsService;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private IOperateLogService operateLogService;
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private IStorageBillService storageBillService;
|
|
private IStorageBillService storageBillService;
|
|
|
|
|
|
@@ -66,26 +75,29 @@ public class RollClubThreeController {
|
|
return Result.OK(pageList);
|
|
return Result.OK(pageList);
|
|
}
|
|
}
|
|
|
|
|
|
- List<RollClubThree> rollClubThreeList = new ArrayList<>();
|
|
|
|
|
|
+ List<RollClubThree> newRollClubThreeList = new ArrayList<>();
|
|
pageList.getRecords().forEach(x -> {
|
|
pageList.getRecords().forEach(x -> {
|
|
- if (x != null) { // 判空
|
|
|
|
|
|
+ if (x != null) {
|
|
RollClubThree clubThree = new RollClubThree();
|
|
RollClubThree clubThree = new RollClubThree();
|
|
BeanUtils.copyProperties(x, clubThree);
|
|
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);
|
|
return Result.OK(pageList);
|
|
|
|
|