领料通过代码优化

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();
if (CollUtil.isNotEmpty(leaseApplyInfoList)) {
Integer companyId1 = leaseApplyInfoList.get(0).getCompanyId();
List<LeaseApplyInfo> applyInfoList = new ArrayList<>();
if (companyId1 != null && companyId1 == 101) {
applyInfoList = leaseApplyInfoList.stream().filter(t -> t.getCompanyId().equals(101)).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) {
taskId = leaseApplyInfo.getTaskId();
if (leaseApplyInfo != null) {
for (LeaseApplyInfo leaseApplyInfo : leaseApplyInfoList) {
Integer companyId1 = leaseApplyInfo.getCompanyId();
List<LeaseApplyInfo> applyInfoList = new ArrayList<>();
if (companyId1 != null && companyId1 == 101) {
applyInfoList = leaseApplyInfoList.stream().filter(t -> t.getCompanyId().equals(101)).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 applyInfo : applyInfoList) {
taskId = applyInfo.getTaskId();
//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();
if (CollUtil.isNotEmpty(leaseApplyInfoList)) {
Integer companyId1 = leaseApplyInfoList.get(0).getCompanyId();
List<LeaseApplyInfo> applyInfoList = new ArrayList<>();
if (companyId1 != null && companyId1 == 101) {
applyInfoList = leaseApplyInfoList.stream().filter(t -> t.getCompanyId().equals(101)).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) {
taskId = leaseApplyInfo.getTaskId();
if (leaseApplyInfo != null) {
for (LeaseApplyInfo leaseApplyInfo : leaseApplyInfoList) {
Integer companyId1 = leaseApplyInfo.getCompanyId();
List<LeaseApplyInfo> applyInfoList = new ArrayList<>();
if (companyId1 != null && companyId1 == 101) {
applyInfoList = leaseApplyInfoList.stream().filter(t -> t.getCompanyId().equals(101)).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 applyInfo : applyInfoList) {
taskId = applyInfo.getTaskId();
//leaseApplyInfo.setExamineStatusId(record.getExamineStatusId());
result += tmTaskMapper.updateLeaseApplyInfoAuditInfo(leaseApplyInfo);
result += tmTaskMapper.updateLeaseApplyInfoAuditInfo(applyInfo);
}
}
}