|
@@ -152,33 +152,36 @@ public class TrialMaterialMobilizationServiceImpl extends BaseServiceImpl<TrialM
|
|
|
|
|
|
IPage<TrialMaterialMobilizationVO> trialMaterialMobilizationVOIPage = TrialMaterialMobilizationWarpper.build().pageVO(pages);
|
|
IPage<TrialMaterialMobilizationVO> trialMaterialMobilizationVOIPage = TrialMaterialMobilizationWarpper.build().pageVO(pages);
|
|
List<TrialMaterialMobilizationVO> records = trialMaterialMobilizationVOIPage.getRecords();
|
|
List<TrialMaterialMobilizationVO> records = trialMaterialMobilizationVOIPage.getRecords();
|
|
- Map<String, String> fileMaps = jdbcTemplate.query("select link,original_name from blade_attach", new BeanPropertyRowMapper<>(Attach.class)).stream().collect(Collectors.toMap(Attach::getLink, Attach::getOriginalName, (key1, key2) -> key2));
|
|
|
|
- for (TrialMaterialMobilizationVO record : records) {
|
|
|
|
- for (User user : userList) {
|
|
|
|
- if (user.getId().equals(record.getUserId())) {
|
|
|
|
- record.setUserName(user.getName());
|
|
|
|
- break;
|
|
|
|
|
|
+ if(!records.isEmpty()){
|
|
|
|
+ Map<String, String> fileMaps = jdbcTemplate.query("select link,original_name from blade_attach", new BeanPropertyRowMapper<>(Attach.class)).stream().collect(Collectors.toMap(Attach::getLink, Attach::getOriginalName, (key1, key2) -> key2));
|
|
|
|
+ for (TrialMaterialMobilizationVO record : records) {
|
|
|
|
+ for (User user : userList) {
|
|
|
|
+ if (user.getId().equals(record.getUserId())) {
|
|
|
|
+ record.setUserName(user.getName());
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }
|
|
|
|
- if (StringUtils.isNotEmpty(record.getOtherAccessories())) {
|
|
|
|
- String attach = fileMaps.get(record.getOtherAccessories());
|
|
|
|
- if (attach != null) {
|
|
|
|
- record.setOtherAccessoriesName(attach);
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(record.getOtherAccessories())) {
|
|
|
|
+ String attach = fileMaps.get(record.getOtherAccessories());
|
|
|
|
+ if (attach != null) {
|
|
|
|
+ record.setOtherAccessoriesName(attach);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }
|
|
|
|
- if (StringUtils.isNotEmpty(record.getProductionCertificate())) {
|
|
|
|
- String attach = fileMaps.get(record.getProductionCertificate());
|
|
|
|
- if (attach != null) {
|
|
|
|
- record.setProductionCertificateName(attach);
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(record.getProductionCertificate())) {
|
|
|
|
+ String attach = fileMaps.get(record.getProductionCertificate());
|
|
|
|
+ if (attach != null) {
|
|
|
|
+ record.setProductionCertificateName(attach);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }
|
|
|
|
- if (StringUtils.isNotEmpty(record.getQualityInspectionReport())) {
|
|
|
|
- String attach = fileMaps.get(record.getQualityInspectionReport());
|
|
|
|
- if (attach != null) {
|
|
|
|
- record.setQualityInspectionReportName(attach);
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(record.getQualityInspectionReport())) {
|
|
|
|
+ String attach = fileMaps.get(record.getQualityInspectionReport());
|
|
|
|
+ if (attach != null) {
|
|
|
|
+ record.setQualityInspectionReportName(attach);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
return trialMaterialMobilizationVOIPage.setRecords(records);
|
|
return trialMaterialMobilizationVOIPage.setRecords(records);
|
|
}
|
|
}
|
|
|
|
|