This commit is contained in:
pengjie 2023-12-13 10:43:03 +08:00
parent 8b3345c251
commit c0e9bfb57c
2 changed files with 10 additions and 5 deletions

View File

@ -256,9 +256,14 @@ public class ProjectQuantityController {
params.setNeedSave(true);
try {
List<ProjectQuantity> listProjectQuantitys = ExcelImportUtil.importExcel(file.getInputStream(), ProjectQuantity.class, params);
String engineeringSn = request.getParameter("engineeringSn");
String projectSn = engineeringService.getOne(Wrappers.<Engineering>lambdaQuery().eq(Engineering::getEngineeringSn, engineeringSn)).getProjectSn();
projectQuantityService.remove(Wrappers.<ProjectQuantity>lambdaQuery()
.eq(ProjectQuantity::getProjectSn, projectSn)
.eq(ProjectQuantity::getEngineeringSn, engineeringSn));
for (ProjectQuantity projectQuantityExcel : listProjectQuantitys) {
projectQuantityExcel.setEngineeringSn(request.getParameter("engineeringSn"));
projectQuantityExcel.setProjectSn(engineeringService.getOne(Wrappers.<Engineering>lambdaQuery().eq(Engineering::getEngineeringSn, projectQuantityExcel.getEngineeringSn())).getProjectSn());
projectQuantityExcel.setEngineeringSn(engineeringSn);
projectQuantityExcel.setProjectSn(projectSn);
projectQuantityExcel.setCreateTime(new Date());
projectQuantityService.save(projectQuantityExcel);
}

View File

@ -48,10 +48,10 @@ public class InvestmentPaymentServiceImpl extends ServiceImpl<InvestmentPaymentM
Page<InvestmentPaymentDto> investmentPaymentVoPage = PageUtil.copyProperties(baseMapper.selectPage(page, wrapper), InvestmentPaymentDto.class);
List<Long> investmentIds = investmentPaymentVoPage.getRecords().stream().map(i -> i.getId()).collect(Collectors.toList());
if (investmentIds.size() > 0) {
List<Long> investmentApplyList = investmentApplyService.list(Wrappers.<InvestmentApply>lambdaQuery().in(InvestmentApply::getInvestmentPaymentId, investmentIds))
.stream().map(InvestmentApply::getInvestmentPaymentId).collect(Collectors.toList());
List<InvestmentApply> investmentApplyList = investmentApplyService.list(Wrappers.<InvestmentApply>lambdaQuery().in(InvestmentApply::getInvestmentPaymentId, investmentIds));
for (InvestmentPaymentDto investmentApply : investmentPaymentVoPage.getRecords()) {
investmentApply.setApplyIdList(investmentApplyList.stream().filter(i -> i.equals(investmentApply.getId())).collect(Collectors.toList()));
investmentApply.setApplyIdList(investmentApplyList.stream().filter(i -> i.getInvestmentPaymentId().equals(investmentApply.getId()))
.map(i -> i.getId()).collect(Collectors.toList()));
}
}
return investmentPaymentVoPage;