|
@@ -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);
|
|
|
}
|