法规清单->关联平台件数据
This commit is contained in:
+4
@@ -15,6 +15,7 @@ import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
@@ -539,4 +540,7 @@ public class ProjectLawsInventoryEO implements Serializable {
|
||||
|
||||
@TableField(exist = false)
|
||||
private String projectName;//项目名称
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<ProjectLawsInventoryEO> projectLawsInventoryEOS;
|
||||
}
|
||||
|
||||
+128
@@ -289,6 +289,10 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
private BussDocumentLibraryEOServiceImpl documentLibraryEOService;
|
||||
@Autowired
|
||||
private ProcessHistoryEOServiceImpl processHistoryEOServiceImpl;
|
||||
@Autowired
|
||||
private ProjectLawsInventoryEOMapper projectLawsInventoryEOMapper;
|
||||
@Autowired
|
||||
private LawsInventoryPlatformEOServiceImpl lawsInventoryPlatformEOService;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
@@ -11717,6 +11721,9 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
IPage<ProjectLawsInventoryEO> pageList = this.page(page, queryWrapper);
|
||||
List<ProjectLawsInventoryEO> result = pageList.getRecords();
|
||||
|
||||
//关联平台件数据
|
||||
platformDispose(projectLawsInventoryEO, result);
|
||||
|
||||
this.dataDispose(result,currentUser,isProjectRole,projectLawsInventoryEO.getCut());
|
||||
this.dataDictDispose(result,projectLawsInventoryEO.getCut());
|
||||
//表头排序
|
||||
@@ -11724,6 +11731,127 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
return pageList;
|
||||
}
|
||||
|
||||
private void platformDispose(ProjectLawsInventoryEO projectLawsInventoryEO, List<ProjectLawsInventoryEO> result) {
|
||||
List<LawsInventoryPlatformEO> lawsInventoryPlatformEOList = new ArrayList<>();
|
||||
List<ProjectLawsInventoryEO> projectLawsInventoryEOS = new ArrayList<>();
|
||||
|
||||
List<String> lawsInventoryIdList = new ArrayList<>();
|
||||
List<String> inventoryIdList = new ArrayList<>();
|
||||
List<String> userIdList = new ArrayList<>();
|
||||
if(!result.isEmpty()){
|
||||
lawsInventoryIdList = result.stream().map(ProjectLawsInventoryEO::getId).collect(Collectors.toList());
|
||||
LambdaQueryWrapper<LawsInventoryPlatformEO> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.in(LawsInventoryPlatformEO::getLawsInventoryId,lawsInventoryIdList);
|
||||
lawsInventoryPlatformEOList = lawsInventoryPlatformEOService.list(wrapper);
|
||||
if(!lawsInventoryPlatformEOList.isEmpty()){
|
||||
List<String> collect = lawsInventoryPlatformEOList.stream().map(LawsInventoryPlatformEO::getPlatformLawsInventoryId).distinct().collect(Collectors.toList());
|
||||
LambdaQueryWrapper<ProjectLawsInventoryEO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.in(ProjectLawsInventoryEO::getId,collect);
|
||||
projectLawsInventoryEOS = this.list(lambdaQueryWrapper);
|
||||
if(!projectLawsInventoryEOS.isEmpty()){
|
||||
inventoryIdList = projectLawsInventoryEOS.stream().map(ProjectLawsInventoryEO::getId).collect(Collectors.toList());
|
||||
List<String> collect1 = projectLawsInventoryEOS.stream().map(ProjectLawsInventoryEO::getDesignDutyId).distinct().collect(Collectors.toList());
|
||||
List<String> collect2 = projectLawsInventoryEOS.stream().map(ProjectLawsInventoryEO::getVerifyDutyId).distinct().collect(Collectors.toList());
|
||||
if(!collect1.isEmpty()){
|
||||
userIdList.addAll(collect1);
|
||||
}
|
||||
if(!collect2.isEmpty()){
|
||||
userIdList.addAll(collect2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//树形结构数据字典(技术领域)
|
||||
List<SysCategory> categoryList = sysCategoryService.list();
|
||||
//文件
|
||||
List<OSSFile> fileInfos = new ArrayList<>();
|
||||
if (inventoryIdList.size() != 0) {
|
||||
fileInfos = iOSSFileService.getFileInfos(StringUtils.join(inventoryIdList, ","));
|
||||
}
|
||||
List<SysUser> sysUsers = new ArrayList<>();
|
||||
if (CollectionUtils.isNotEmpty(userIdList)) {
|
||||
userIdList = userIdList.stream().distinct().collect(Collectors.toList());
|
||||
QueryWrapper<SysUser> sysUserQueryWrapper = new QueryWrapper<>();
|
||||
sysUserQueryWrapper.lambda().in(SysUser::getId, userIdList);
|
||||
sysUsers = sysUserMapper.selectList(sysUserQueryWrapper);
|
||||
}
|
||||
String cut = projectLawsInventoryEO.getCut();
|
||||
for (ProjectLawsInventoryEO lawsInventoryEO : result) {
|
||||
if(!lawsInventoryPlatformEOList.isEmpty()){
|
||||
List<LawsInventoryPlatformEO> inventoryPlatformEOList = lawsInventoryPlatformEOList.stream()
|
||||
.filter(e -> lawsInventoryEO.getId().equals(e.getLawsInventoryId())).collect(Collectors.toList());
|
||||
if(!inventoryPlatformEOList.isEmpty()){
|
||||
List<String> idList = inventoryPlatformEOList.stream()
|
||||
.map(LawsInventoryPlatformEO::getPlatformLawsInventoryId).collect(Collectors.toList());
|
||||
List<ProjectLawsInventoryEO> lawsInventoryEOS = projectLawsInventoryEOS.stream()
|
||||
.filter(e -> idList.contains(e.getId())).collect(Collectors.toList());
|
||||
lawsInventoryEO.setProjectLawsInventoryEOS(lawsInventoryEOS);
|
||||
//如果关联平台件数据不为空,编辑时将设计符合性和验证符合性的数据覆盖
|
||||
if(!lawsInventoryEOS.isEmpty()){
|
||||
ProjectLawsInventoryEO inventoryEO = lawsInventoryEOS.get(0);
|
||||
//设计
|
||||
String designDeliverableType = inventoryEO.getDesignDeliverableType();//交付物类型
|
||||
String designDutyId = inventoryEO.getDesignDutyId();//责任人
|
||||
String designDeliverableTemplate = inventoryEO.getDesignDeliverableTemplate();//交付物模板
|
||||
//验证
|
||||
String verifyDeliverableType = inventoryEO.getVerifyDeliverableType();//交付物类型
|
||||
String verifyDutyId = inventoryEO.getVerifyDutyId();//责任人
|
||||
String verifyDeliverableTemplate = inventoryEO.getVerifyDeliverableTemplate();//交付物模板
|
||||
//设计交付物类型
|
||||
if (StringUtils.isNotBlank(designDeliverableType)) {
|
||||
lawsInventoryEO.setDesignDeliverableType(designDeliverableType);
|
||||
List<String> designDeliverableTypeList = Arrays.asList(designDeliverableType.split(","));
|
||||
String name = getTreeName(cut, categoryList, designDeliverableTypeList);
|
||||
lawsInventoryEO.setDesignDeliverableTypeName(name);
|
||||
}
|
||||
//验证交付物类型
|
||||
if (StringUtils.isNotBlank(verifyDeliverableType)) {
|
||||
lawsInventoryEO.setVerifyDeliverableType(verifyDeliverableType);
|
||||
List<String> verifyDeliverableTypeList = Arrays.asList(verifyDeliverableType.split(","));
|
||||
String name = getTreeName(cut, categoryList, verifyDeliverableTypeList);
|
||||
lawsInventoryEO.setVerifyDeliverableTypeName(name);
|
||||
}
|
||||
//交付物类型模板
|
||||
if (fileInfos.size() != 0) {
|
||||
if (StringUtils.isNotBlank(designDeliverableTemplate)) {
|
||||
lawsInventoryEO.setDesignDeliverableTemplate(designDeliverableTemplate);
|
||||
String fileName = this.editService.getFileName(null, fileInfos, designDeliverableTemplate);
|
||||
if (StringUtils.isNotBlank(fileName)) {
|
||||
lawsInventoryEO.setDesignDeliverableTemplateName(fileName);
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(verifyDeliverableTemplate)) {
|
||||
lawsInventoryEO.setVerifyDeliverableTemplate(verifyDeliverableTemplate);
|
||||
String fileName = this.editService.getFileName(null, fileInfos, verifyDeliverableTemplate);
|
||||
if (StringUtils.isNotBlank(fileName)) {
|
||||
lawsInventoryEO.setVerifyDeliverableTemplateName(fileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
//设计责任人
|
||||
if (StringUtils.isNotEmpty(designDutyId)) {
|
||||
lawsInventoryEO.setVerifyDutyId(designDutyId);
|
||||
String designDutyName = sysUsers.stream().filter(e -> designDutyId.equals(e.getId())).
|
||||
map(SysUser::getUsername).collect(Collectors.joining(","));
|
||||
lawsInventoryEO.setDesignDutyIdName(designDutyName);
|
||||
} else {
|
||||
lawsInventoryEO.setDesignDutyIdName("");
|
||||
}
|
||||
//验证责任人
|
||||
if (StringUtils.isNotEmpty(verifyDutyId)) {
|
||||
lawsInventoryEO.setVerifyDutyId(verifyDutyId);
|
||||
String verifyDutyName = sysUsers.stream().filter(e -> verifyDutyId.equals(e.getId())).
|
||||
map(SysUser::getUsername).collect(Collectors.joining(","));
|
||||
lawsInventoryEO.setVerifyDutyIdName(verifyDutyName);
|
||||
} else {
|
||||
lawsInventoryEO.setVerifyDutyIdName("");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<?> finalizationVerify(Map<String, Object> params) {
|
||||
boolean result = false; // 返回true,可以定版,返回false 不能定版
|
||||
|
||||
Reference in New Issue
Block a user