Merge remote-tracking branch 'origin/dev_20230912_Platform' into dev_20230912_Platform
This commit is contained in:
+2
-2
@@ -4556,8 +4556,8 @@ public class PlatformProjectLawsInventoryEOServiceImpl extends ServiceImpl<Platf
|
||||
projectLawsInventoryEOTemp.setProjectLibraryId(projectLawsInventoryEO.getProjectLibraryId());
|
||||
projectLawsInventoryEOTemp.setTaskAffirmStatus(TaskAffirmStatusEnum.NOT_STARTED.getValue());
|
||||
projectLawsInventoryEOTemp.setInventoryAffirmStatus(InventoryAffirmStatusEnum.NOT_STARTED.getValue());
|
||||
projectLawsInventoryEOTemp.setDesignFlowStatus(ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue());
|
||||
projectLawsInventoryEOTemp.setVerifyFlowStatus(ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue());
|
||||
projectLawsInventoryEOTemp.setDesignFlowStatus(ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue());
|
||||
projectLawsInventoryEOTemp.setVerifyFlowStatus(ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue());
|
||||
datas.add(projectLawsInventoryEOTemp);
|
||||
}
|
||||
}
|
||||
|
||||
+22
-3
@@ -59,7 +59,7 @@ public class ProjectCertificationDirectoryEOServiceImpl extends ServiceImpl<Proj
|
||||
*/
|
||||
@Override
|
||||
public void add(ProjectCertificationDirectoryEO projectCertificationDirectoryEO) {
|
||||
checkData(projectCertificationDirectoryEO.getProjectLibraryId(),null,projectCertificationDirectoryEO.getCut());
|
||||
checkDataLaws(projectCertificationDirectoryEO.getProjectLibraryId(),null,projectCertificationDirectoryEO.getCut());
|
||||
Date now = new Date();
|
||||
projectCertificationDirectoryEO.setCreateTime(now);
|
||||
projectCertificationDirectoryEO.setUpdateTime(now);
|
||||
@@ -75,7 +75,7 @@ public class ProjectCertificationDirectoryEOServiceImpl extends ServiceImpl<Proj
|
||||
*/
|
||||
@Override
|
||||
public void editById(ProjectCertificationDirectoryEO projectCertificationDirectoryEO) {
|
||||
checkData(projectCertificationDirectoryEO.getProjectLibraryId(),projectCertificationDirectoryEO.getId(),projectCertificationDirectoryEO.getCut());
|
||||
checkDataLaws(projectCertificationDirectoryEO.getProjectLibraryId(),projectCertificationDirectoryEO.getId(),projectCertificationDirectoryEO.getCut());
|
||||
Date now = new Date();
|
||||
projectCertificationDirectoryEO.setUpdateTime(now);
|
||||
saveOrUpdate(projectCertificationDirectoryEO);
|
||||
@@ -90,7 +90,7 @@ public class ProjectCertificationDirectoryEOServiceImpl extends ServiceImpl<Proj
|
||||
@Override
|
||||
public void deleteById(String id,String cut) {
|
||||
ProjectCertificationDirectoryEO projectCertificationDirectoryEO = queryById(id);
|
||||
checkData(projectCertificationDirectoryEO.getProjectLibraryId(),id,cut);
|
||||
checkDataLaws(projectCertificationDirectoryEO.getProjectLibraryId(),id,cut);
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
@@ -257,4 +257,23 @@ public class ProjectCertificationDirectoryEOServiceImpl extends ServiceImpl<Proj
|
||||
// }
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* 验证数据权限,只有法规工程师,并且创建人是当前登陆人,才能进行增、删、改操作。
|
||||
* @return
|
||||
*/
|
||||
public boolean checkDataLaws(String projectLibraryId,String id,String cut){
|
||||
int roleCode = checkUserRole(projectLibraryId);
|
||||
if(roleCode != Integer.parseInt(ProjectRoleEnum.REGULATI_ENGINEER.getValue())
|
||||
&& roleCode != Integer.parseInt(ProjectRoleEnum.STUDIO_ENGINEER.getValue())
|
||||
&& roleCode != Integer.parseInt(ProjectRoleEnum.HOMOLOGATION_ENGINEER.getValue())){
|
||||
String message = "";
|
||||
if(StringUtils.equals(cut, CutEnum.CN.getValue())){
|
||||
message = "没有权限操作,只有法规工程师才可以操作。";
|
||||
}else if(StringUtils.equals(cut, CutEnum.EN.getValue())){
|
||||
message = "Only regulatory engineer can perform this operation.";
|
||||
}
|
||||
throw new JeroBootException(message);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user