优化
This commit is contained in:
parent
8b3345c251
commit
c0e9bfb57c
@ -256,9 +256,14 @@ public class ProjectQuantityController {
|
|||||||
params.setNeedSave(true);
|
params.setNeedSave(true);
|
||||||
try {
|
try {
|
||||||
List<ProjectQuantity> listProjectQuantitys = ExcelImportUtil.importExcel(file.getInputStream(), ProjectQuantity.class, params);
|
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) {
|
for (ProjectQuantity projectQuantityExcel : listProjectQuantitys) {
|
||||||
projectQuantityExcel.setEngineeringSn(request.getParameter("engineeringSn"));
|
projectQuantityExcel.setEngineeringSn(engineeringSn);
|
||||||
projectQuantityExcel.setProjectSn(engineeringService.getOne(Wrappers.<Engineering>lambdaQuery().eq(Engineering::getEngineeringSn, projectQuantityExcel.getEngineeringSn())).getProjectSn());
|
projectQuantityExcel.setProjectSn(projectSn);
|
||||||
projectQuantityExcel.setCreateTime(new Date());
|
projectQuantityExcel.setCreateTime(new Date());
|
||||||
projectQuantityService.save(projectQuantityExcel);
|
projectQuantityService.save(projectQuantityExcel);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -48,10 +48,10 @@ public class InvestmentPaymentServiceImpl extends ServiceImpl<InvestmentPaymentM
|
|||||||
Page<InvestmentPaymentDto> investmentPaymentVoPage = PageUtil.copyProperties(baseMapper.selectPage(page, wrapper), InvestmentPaymentDto.class);
|
Page<InvestmentPaymentDto> investmentPaymentVoPage = PageUtil.copyProperties(baseMapper.selectPage(page, wrapper), InvestmentPaymentDto.class);
|
||||||
List<Long> investmentIds = investmentPaymentVoPage.getRecords().stream().map(i -> i.getId()).collect(Collectors.toList());
|
List<Long> investmentIds = investmentPaymentVoPage.getRecords().stream().map(i -> i.getId()).collect(Collectors.toList());
|
||||||
if (investmentIds.size() > 0) {
|
if (investmentIds.size() > 0) {
|
||||||
List<Long> investmentApplyList = investmentApplyService.list(Wrappers.<InvestmentApply>lambdaQuery().in(InvestmentApply::getInvestmentPaymentId, investmentIds))
|
List<InvestmentApply> investmentApplyList = investmentApplyService.list(Wrappers.<InvestmentApply>lambdaQuery().in(InvestmentApply::getInvestmentPaymentId, investmentIds));
|
||||||
.stream().map(InvestmentApply::getInvestmentPaymentId).collect(Collectors.toList());
|
|
||||||
for (InvestmentPaymentDto investmentApply : investmentPaymentVoPage.getRecords()) {
|
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;
|
return investmentPaymentVoPage;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user