修改切換角色

This commit is contained in:
qq787203167
2022-06-06 11:32:51 +08:00
parent 98e101241f
commit 3d90a84b97
3 changed files with 74 additions and 7 deletions
@@ -1105,7 +1105,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
result = "拒绝";
}
List<String> idList = Arrays.asList(ids.split(","));
/*List<String> idList = Arrays.asList(ids.split(","));
for (String id : idList) {
int isProjectRole = checkUserRole(projectLibraryId, currentUser.getId(), id);
@@ -1143,7 +1143,52 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
}
super.baseMapper.updateById(projectLawsInventoryEO);
}
}*/
List<Map<String,Object>> lawsInventoryList = (List<Map<String, Object>>) params.get("lawsInventoryList");
if(CollectionUtils.isNotEmpty(lawsInventoryList)){
lawsInventoryList.forEach(lawsInventory -> {
int isProjectRole = (int) lawsInventory.get("roleCode");
String id = (String) lawsInventory.get("id");
ProjectLawsInventoryEO projectLawsInventoryEO = getById(id);
if(isProjectRole == Integer.parseInt(ProjectRoleEnum.REGULATI_AND_HOMOLOGATION_ENGINEER.getValue())){
projectLawsInventoryEO.setRegulationOwnerSubmitStatus(operatorResult);
projectLawsInventoryEO.setHomologationEngineerSubmitStatus(operatorResult);
}else if(isProjectRole == Integer.parseInt(ProjectRoleEnum.REGULATI_ENGINEER.getValue())){
projectLawsInventoryEO.setRegulationOwnerSubmitStatus(operatorResult);
}else if(isProjectRole == Integer.parseInt(ProjectRoleEnum.HOMOLOGATION_ENGINEER.getValue())){
projectLawsInventoryEO.setHomologationEngineerSubmitStatus(operatorResult);
}
//如果不是studio
if(isProjectRole != -1 && isProjectRole != Integer.parseInt(ProjectRoleEnum.STUDIO_ENGINEER.getValue())){
String inventoryAffirmStatus = "";
//如果法规工程师与认证工程师都是提交通过 把清单确认状态设置为 接受
if(StringUtils.isNotEmpty(projectLawsInventoryEO.getRegulationOwnerSubmitStatus()) && StringUtils.isNotEmpty(projectLawsInventoryEO.getHomologationEngineerSubmitStatus())){
if(projectLawsInventoryEO.getRegulationOwnerSubmitStatus().equals("0") && projectLawsInventoryEO.getHomologationEngineerSubmitStatus().equals("0")){
inventoryAffirmStatus = InventoryAffirmStatusEnum.ACCEPTED.getValue();
}
//如果法规工程师与认证工程师 其中一个人是拒绝 把清单确认状态设置为 拒绝
if(projectLawsInventoryEO.getRegulationOwnerSubmitStatus().equals("1") || projectLawsInventoryEO.getHomologationEngineerSubmitStatus().equals("1")){
inventoryAffirmStatus = InventoryAffirmStatusEnum.REJECTED.getValue();
}
}
if(StringUtils.isNotEmpty(inventoryAffirmStatus)){
projectLawsInventoryEO.setInventoryAffirmStatus(inventoryAffirmStatus);
}
super.baseMapper.updateById(projectLawsInventoryEO);
}
});
}else {
throw new JeroBootException("请至少勾选一条法规清单进行" + result);
}
}
}catch (Exception ex){
log.error("批量"+result+" 更新状态失败:" + ex.getMessage());