领料通过代码优化

This commit is contained in:
liang.chao 2024-05-15 10:29:51 +08:00
parent 244c850889
commit 47628f51c1
1 changed files with 25 additions and 24 deletions

View File

@ -92,19 +92,20 @@ public class TmTaskServiceImpl implements TmTaskService {
// 再审核领料任务信息表 // 再审核领料任务信息表
List<LeaseApplyInfo> leaseApplyInfoList = record.getLeaseApplyInfoList(); List<LeaseApplyInfo> leaseApplyInfoList = record.getLeaseApplyInfoList();
if (CollUtil.isNotEmpty(leaseApplyInfoList)) { if (CollUtil.isNotEmpty(leaseApplyInfoList)) {
Integer companyId1 = leaseApplyInfoList.get(0).getCompanyId(); for (LeaseApplyInfo leaseApplyInfo : leaseApplyInfoList) {
List<LeaseApplyInfo> applyInfoList = new ArrayList<>(); Integer companyId1 = leaseApplyInfo.getCompanyId();
if (companyId1 != null && companyId1 == 101) { List<LeaseApplyInfo> applyInfoList = new ArrayList<>();
applyInfoList = leaseApplyInfoList.stream().filter(t -> t.getCompanyId().equals(101)).collect(Collectors.toList()); if (companyId1 != null && companyId1 == 101) {
} else if (companyId1 != null && companyId1 == 102) { applyInfoList = leaseApplyInfoList.stream().filter(t -> t.getCompanyId().equals(101)).collect(Collectors.toList());
applyInfoList = leaseApplyInfoList.stream().filter(t -> t.getCompanyId().equals(102)).collect(Collectors.toList()); } else if (companyId1 != null && companyId1 == 102) {
} applyInfoList = leaseApplyInfoList.stream().filter(t -> t.getCompanyId().equals(102)).collect(Collectors.toList());
if (CollUtil.isNotEmpty(applyInfoList)) { }
for (LeaseApplyInfo leaseApplyInfo : applyInfoList) { if (CollUtil.isNotEmpty(applyInfoList)) {
taskId = leaseApplyInfo.getTaskId(); for (LeaseApplyInfo applyInfo : applyInfoList) {
if (leaseApplyInfo != null) { taskId = applyInfo.getTaskId();
//leaseApplyInfo.setExamineStatusId(record.getExamineStatusId()); //leaseApplyInfo.setExamineStatusId(record.getExamineStatusId());
result += tmTaskMapper.updateLeaseApplyInfoAuditInfo(leaseApplyInfo); result += tmTaskMapper.updateLeaseApplyInfoAuditInfo(applyInfo);
} }
} }
} }
@ -138,19 +139,19 @@ public class TmTaskServiceImpl implements TmTaskService {
// 再审核领料任务信息表 // 再审核领料任务信息表
List<LeaseApplyInfo> leaseApplyInfoList = record.getLeaseApplyInfoList(); List<LeaseApplyInfo> leaseApplyInfoList = record.getLeaseApplyInfoList();
if (CollUtil.isNotEmpty(leaseApplyInfoList)) { if (CollUtil.isNotEmpty(leaseApplyInfoList)) {
Integer companyId1 = leaseApplyInfoList.get(0).getCompanyId(); for (LeaseApplyInfo leaseApplyInfo : leaseApplyInfoList) {
List<LeaseApplyInfo> applyInfoList = new ArrayList<>(); Integer companyId1 = leaseApplyInfo.getCompanyId();
if (companyId1 != null && companyId1 == 101) { List<LeaseApplyInfo> applyInfoList = new ArrayList<>();
applyInfoList = leaseApplyInfoList.stream().filter(t -> t.getCompanyId().equals(101)).collect(Collectors.toList()); if (companyId1 != null && companyId1 == 101) {
} else if (companyId1 != null && companyId1 == 102) { applyInfoList = leaseApplyInfoList.stream().filter(t -> t.getCompanyId().equals(101)).collect(Collectors.toList());
applyInfoList = leaseApplyInfoList.stream().filter(t -> t.getCompanyId().equals(102)).collect(Collectors.toList()); } else if (companyId1 != null && companyId1 == 102) {
} applyInfoList = leaseApplyInfoList.stream().filter(t -> t.getCompanyId().equals(102)).collect(Collectors.toList());
if (CollUtil.isNotEmpty(applyInfoList)) { }
for (LeaseApplyInfo leaseApplyInfo : applyInfoList) { if (CollUtil.isNotEmpty(applyInfoList)) {
taskId = leaseApplyInfo.getTaskId(); for (LeaseApplyInfo applyInfo : applyInfoList) {
if (leaseApplyInfo != null) { taskId = applyInfo.getTaskId();
//leaseApplyInfo.setExamineStatusId(record.getExamineStatusId()); //leaseApplyInfo.setExamineStatusId(record.getExamineStatusId());
result += tmTaskMapper.updateLeaseApplyInfoAuditInfo(leaseApplyInfo); result += tmTaskMapper.updateLeaseApplyInfoAuditInfo(applyInfo);
} }
} }
} }