修改物资设备清单导入修改

This commit is contained in:
2025-09-23 19:52:09 +08:00
parent a8744cc4cc
commit 278004788b
3 changed files with 48 additions and 16 deletions

View File

@ -20,6 +20,7 @@ public class DetailsMaterialAndEquipmentApprovalRes implements Serializable {
* 版本号
*/
private String versions;
private String versionsName;
/**

View File

@ -226,12 +226,17 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl<BusBillo
List<BusBillofquantities> busBillofquantities = busBillofquantitiesService.getBaseMapper().selectList(new LambdaQueryWrapper<BusBillofquantities>().eq(BusBillofquantities::getProjectId, bo.getProjectId()));
Set<String> names = busBillofquantities.stream()
.filter(Objects::nonNull)
.map(BusBillofquantities::getName)
.filter(Objects::nonNull)
.map(obj->{
String name = Optional.ofNullable (obj.getName ()).orElse ("");
String specification = Optional.ofNullable (obj.getSpecification ()).orElse ("");
String remark = Optional.ofNullable (obj.getRemark ()).orElse ("");
return name+"+"+specification+"+"+remark;
})
.collect(Collectors.toSet());
for (BusBillofquantities allMaterial : allMaterials) {
if (names.contains(allMaterial.getName())) {
throw new ServiceException("名称“"+allMaterial.getName()+"”已存在,请修改后重新上传!");
String biaoqian = allMaterial.getName()+"+"+allMaterial.getSpecification()+"+"+allMaterial.getRemark();
if (names.contains(biaoqian)) {
throw new ServiceException("名称:“"+allMaterial.getName()+"+”规格:”"+allMaterial.getSpecification()+"“+”备注:“"+allMaterial.getRemark()+"已存在,请修改后重新上传!");
}
allMaterial.setProjectId(bo.getProjectId());
}
@ -303,6 +308,7 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl<BusBillo
throw new ServiceException("版本不存在");
}
detailsMaterialAndEquipmentApprovalRes.setVersions(busBillofquantitiesVersions.getVersions());
detailsMaterialAndEquipmentApprovalRes.setVersionsName(StringUtils.isNotBlank(busBillofquantitiesVersions.getVersionsName())?busBillofquantitiesVersions.getVersionsName(): null);
detailsMaterialAndEquipmentApprovalRes.setStatus(busBillofquantitiesVersions.getStatus());
detailsMaterialAndEquipmentApprovalRes.setAuditData(busBillofquantities);
return detailsMaterialAndEquipmentApprovalRes;