任务清单-查询逻辑修改。对应禅道59183。

项目库-详情统计项目当前状态修改
59223 - 法规技术评估,导入
This commit is contained in:
wangzhijiang
2022-09-05 18:05:36 +08:00
parent 14ab36a5ed
commit a2d3122bb4
6 changed files with 61 additions and 11 deletions
@@ -446,6 +446,9 @@ public class LawsTechnologyEvaluationEOServiceImpl extends ServiceImpl<LawsTechn
/*String itemNum = row.getCell(0, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).toString();
String itemName = row.getCell(1, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).toString();
String itemContents = row.getCell(2, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).toString();*/
if(StringUtils.isEmpty(itemNum) && StringUtils.isEmpty(itemName) && StringUtils.isEmpty(itemContents)){
continue;
}
Map<String,Object> itemInfoMap = new HashMap<>();
String itemId = UUID.randomUUID().toString().replace("-", "");
@@ -806,7 +806,7 @@ public class ProblemKnowledgeBaseEOServiceImpl extends ServiceImpl<ProblemKnowle
//XXX向您推送了XXXXXXXXXX,请注意查看。
String msgContentEN = currentUser.getUsername()+" pushed " + problemKnowledgeBaseTitle + " to you.Please be reminded to check it out.";
String msgTitle = problemKnowledgeBaseTitle + " has been shared with you, please check.";
String msgTitle = "A problem knowledge base has been shared with you, please check";
//飞书跳转链接
String hrefFeishu = backUrl + JumpLinkEnum.PROBLEM_KNOWLEDGE_BASE_DETAIL.getLink() + "?id=" + problemKnowledgeBaseId;
@@ -391,6 +391,9 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
if(CollectionUtils.isNotEmpty(projectTaskInventoryEOList)){
//项目任务清单数据初始化
this.projectTaskInventoryEOService.saveBatch(projectTaskInventoryEOList);
projectTaskInventoryEOList.forEach(taskInventory -> {
this.initConditionAssessmentEO(taskInventory.getProjectLawsInventoryId());
});
}
}
@@ -593,6 +596,10 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
removeById(id);
this.projectTaskInventoryEOService.deleteByProjectLawsInventoryIds(Arrays.asList(id.split(",")));
QueryWrapper<ConditionAssessmentEO> removeWrapper = new QueryWrapper<>();
removeWrapper.lambda().eq(ConditionAssessmentEO::getProjectLawsInventoryId,id);
this.conditionAssessmentEOService.remove(removeWrapper);
}
/**
@@ -627,6 +634,10 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
removeByIds(ids);
this.projectTaskInventoryEOService.deleteByProjectLawsInventoryIds(ids);
QueryWrapper<ConditionAssessmentEO> removeWrapper = new QueryWrapper<>();
removeWrapper.lambda().in(ConditionAssessmentEO::getProjectLawsInventoryId,ids);
this.conditionAssessmentEOService.remove(removeWrapper);
}
/**
@@ -2620,6 +2631,9 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
// projectLawsInventoryLogEOService.updateLog(contentLog, projectLibraryId,CutEnum.CN.getValue());
// projectLawsInventoryLogEOService.updateLog(enContentLog, projectLibraryId,CutEnum.EN.getValue());
this.projectTaskInventoryEOService.saveBatch(projectTaskInventoryEOList);
projectTaskInventoryEOList.forEach(taskInventory -> {
this.initConditionAssessmentEO(taskInventory.getProjectLawsInventoryId());
});
}
}
@@ -4472,6 +4486,11 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
this.projectTaskInventoryEOService.deleteByProjectLawsInventoryIds(idList);
this.projectTaskInventoryEOService.saveBatch(projectTaskInventoryEOList);
//初始化项目状态评估
projectTaskInventoryEOList.forEach(taskInventory -> {
this.initConditionAssessmentEO(taskInventory.getProjectLawsInventoryId());
});
//删除该法规的任务明细数据
QueryWrapper<ProjectTaskInventoryDetailEO> deleteTaskInventoryDetailWrapper = new QueryWrapper<>();
deleteTaskInventoryDetailWrapper.lambda().in(ProjectTaskInventoryDetailEO::getProjectTaskInventoryId,idList);
@@ -4834,6 +4853,10 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
projectTaskInventoryEOList.add(projectTaskInventoryEO);
}
this.projectTaskInventoryEOService.saveBatch(projectTaskInventoryEOList);
//初始化项目状态评估
projectTaskInventoryEOList.forEach(taskInventory -> {
this.initConditionAssessmentEO(taskInventory.getProjectLawsInventoryId());
});
//更新log
String serialNumber = dataList.stream().map(e->e.getSerialNumber()).collect(Collectors.joining(","));
@@ -7314,4 +7337,21 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
}
return resultUserId;
}
/**
* 初始化 法规清单对应的 项目状态评估表
* @param projectLawsInventoryId
*/
public void initConditionAssessmentEO(String projectLawsInventoryId){
QueryWrapper<ConditionAssessmentEO> removeWrapper = new QueryWrapper<>();
removeWrapper.lambda().eq(ConditionAssessmentEO::getProjectLawsInventoryId,projectLawsInventoryId);
this.conditionAssessmentEOService.remove(removeWrapper);
ConditionAssessmentEO conditionAssessmentEO = new ConditionAssessmentEO();
conditionAssessmentEO.setRoleCode(ProjectRoleEnum.REGULATI_AND_HOMOLOGATION_ENGINEER.getValue());
conditionAssessmentEO.setProjectLawsInventoryId(projectLawsInventoryId);
conditionAssessmentEO.setConditionAssessment(CurrentProjectStatusEnum.BLUE.getValue());
this.conditionAssessmentEOService.addOrUpdate(conditionAssessmentEO);
}
}
@@ -449,8 +449,8 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
QueryWrapper<ProjectLawsInventoryEO> lawsInventoryEOQueryWrapper = new QueryWrapper<>();
lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getProjectLibraryId,id);
lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getInventoryAffirmStatus, InventoryAffirmStatusEnum.ACCEPTED.getValue());
lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getTaskAffirmStatus, TaskAffirmStatusEnum.ACCEPTED.getValue());
//lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getInventoryAffirmStatus, InventoryAffirmStatusEnum.ACCEPTED.getValue());
//lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getTaskAffirmStatus, TaskAffirmStatusEnum.ACCEPTED.getValue());
List<ProjectLawsInventoryEO> projectLawsInventoryEOList = projectLawsInventoryEOMapper.selectList(lawsInventoryEOQueryWrapper);
if(CollectionUtils.isNotEmpty(projectLawsInventoryEOList)){
List<String> projectLawsInventoryIdList = projectLawsInventoryEOList.stream().distinct().map(ProjectLawsInventoryEO::getId).collect(Collectors.toList());
@@ -179,8 +179,8 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
QueryWrapper<ProjectLawsInventoryEO> lawsInventoryEOQueryWrapper = QueryGenerator.initQueryWrapper(projectLawsInventoryEO,req.getParameterMap());
//QueryWrapper<ProjectLawsInventoryEO> lawsInventoryEOQueryWrapper = new QueryWrapper<>();
lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getProjectLibraryId,projectLibraryId);
lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getInventoryAffirmStatus, InventoryAffirmStatusEnum.ACCEPTED.getValue());
lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getTaskAffirmStatus, TaskAffirmStatusEnum.ACCEPTED.getValue());
//lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getInventoryAffirmStatus, InventoryAffirmStatusEnum.ACCEPTED.getValue());
//lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getTaskAffirmStatus, TaskAffirmStatusEnum.ACCEPTED.getValue());
String dutyTerritoryStr = "";
if (StringUtils.isNotEmpty(projectTaskInventoryEO.getDutyTerritory())) {
@@ -224,7 +224,8 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
taskDetailQueryWrapper.lambda().in(ProjectTaskInventoryDetailEO::getProjectTaskInventoryId,projectLawsInventoryIdList);
List<ProjectTaskInventoryDetailEO> projectTaskInventoryDetailEOList = this.projectTaskInventoryDetailEOMapper.selectList(taskDetailQueryWrapper);
if(CollectionUtils.isNotEmpty(projectTaskInventoryEOList) && CollectionUtils.isNotEmpty(projectTaskInventoryDetailEOList)){
//if(CollectionUtils.isNotEmpty(projectTaskInventoryEOList) && CollectionUtils.isNotEmpty(projectTaskInventoryDetailEOList)){
if(CollectionUtils.isNotEmpty(projectTaskInventoryEOList)){
projectLawsInventoryEOList.forEach(projectLawsInventory -> {
projectTaskInventoryEOList.forEach(projectTaskInventory -> {
if(StringUtils.equals(projectLawsInventory.getId(),projectTaskInventory.getProjectLawsInventoryId())){
@@ -575,7 +576,13 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
//2022-08-24 判断当前登录用户是否是系统管理员 或 R&H Manager角色,如果是的话,看到的数据与studio一致。
List<SysUserRole> userRoleList = this.sysUserRoleService.list(new QueryWrapper<SysUserRole>().lambda().eq(SysUserRole::getUserId, currentUser.getId())); // 查询用户所有角色
if(CollectionUtils.isNotEmpty(userRoleList)){
List<String> roleIdList = CollectManifestRoleIdEnum.getIdList();
List<String> roleIdList = new ArrayList<>();
String adminRoleId = CollectManifestRoleIdEnum.ADMIN_ID.getId();
String managerRoleId = CollectManifestRoleIdEnum.MANAGER_ID.getId();
roleIdList.add(adminRoleId);
roleIdList.add(managerRoleId);
List<SysUserRole> userRoles = userRoleList.stream().filter(userRole -> {
boolean flag = false;
for (String roleId : roleIdList) {
@@ -803,7 +810,7 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
}
/*if(StringUtils.isNotEmpty(actiProcInstId) && (isRegulationOwner || isHomologationEngineer || isStudio)){*/
if(StringUtils.isNotEmpty(actiProcInstId) && (isStudio || (showVerify || showDesign || showPrehomo))){
if(((isRegulationOwner || isHomologationEngineer || isStudio) || (showVerify || showDesign || showPrehomo))){
projectTaskInventoryEO.setShowFlag(TaskStatusEnum.SHOW_FLAG.getValue());
}
@@ -60,15 +60,15 @@ public class workFlowController {
return this.startTaskToConfirmProcess(jsonObject);
}else if(StringUtils.equals(type,FlowTypeEnum.SJFHXSHLC.getValue())){
jsonObject.put("id", FlowTypeEnum.SJFHXSHLC.getProcessDefinitionKey());
initConditionAssessmentEO(jsonObject);
//initConditionAssessmentEO(jsonObject);
return this.activiti_define_start(jsonObject);
}else if(StringUtils.equals(type,FlowTypeEnum.PREHOMOQRLC.getValue())){
jsonObject.put("id", FlowTypeEnum.PREHOMOQRLC.getProcessDefinitionKey());
initConditionAssessmentEO(jsonObject);
//initConditionAssessmentEO(jsonObject);
return this.activiti_define_start(jsonObject);
}else if(StringUtils.equals(type,FlowTypeEnum.YZFHXSCLC.getValue())){
jsonObject.put("id", FlowTypeEnum.YZFHXSCLC.getProcessDefinitionKey());
initConditionAssessmentEO(jsonObject);
//initConditionAssessmentEO(jsonObject);
return this.activiti_define_start(jsonObject);
}else if(StringUtils.equals(type,FlowTypeEnum.FGYJSJLC.getValue())){
jsonObject.put("id", FlowTypeEnum.FGYJSJLC.getProcessDefinitionKey());