修改认证清单添加和导入数据时 接口人和责任人的项目权限
This commit is contained in:
+1
@@ -4,6 +4,7 @@ public enum PermissionDescriptionEnum {
|
|||||||
|
|
||||||
PROJECT_RELATED_PERSONNEL("相关人员名单","projectRelatedPersonnelId:"),
|
PROJECT_RELATED_PERSONNEL("相关人员名单","projectRelatedPersonnelId:"),
|
||||||
PROJECT_LAWS_INVENTORY("法规清单","projectLawsInventoryId:"),
|
PROJECT_LAWS_INVENTORY("法规清单","projectLawsInventoryId:"),
|
||||||
|
PROJECT_CERTIFICATION_INVENTORY("认证清单","projectCertificationInventoryId:"),
|
||||||
PARAMS_COLLECT_MANIFEST("参数项","paramsCollectManifestId:");
|
PARAMS_COLLECT_MANIFEST("参数项","paramsCollectManifestId:");
|
||||||
|
|
||||||
String label;
|
String label;
|
||||||
|
|||||||
+5
@@ -29,10 +29,15 @@ public enum ProjectUserLocationEnum {
|
|||||||
PROJECT_LAWS_PREHOMO_DISTRIBUTION("PROJECT_LAWS_PREHOMO_DISTRIBUTION","prehomo确认分发工程师"),
|
PROJECT_LAWS_PREHOMO_DISTRIBUTION("PROJECT_LAWS_PREHOMO_DISTRIBUTION","prehomo确认分发工程师"),
|
||||||
PROJECT_LAWS_VERIFY_DISTRIBUTION("PROJECT_LAWS_VERIFY_DISTRIBUTION","验证符合性确认分发工程师"),
|
PROJECT_LAWS_VERIFY_DISTRIBUTION("PROJECT_LAWS_VERIFY_DISTRIBUTION","验证符合性确认分发工程师"),
|
||||||
|
|
||||||
|
PROJECT_CERTIFICATION_INVENTORY_SDT("PROJECT_CERTIFICATION_INVENTORY_SDT","认证清单中接口人"),
|
||||||
|
PROJECT_CERTIFICATION_INVENTORY_DP("PROJECT_CERTIFICATION_INVENTORY_DP","认证清单中责任人"),
|
||||||
|
|
||||||
PROJECT_PARAMS_COLLECT_MANIFEST_DRE("PROJECT_PARAMS_COLLECT_MANIFEST_DRE","认证参数收集中填写人"),
|
PROJECT_PARAMS_COLLECT_MANIFEST_DRE("PROJECT_PARAMS_COLLECT_MANIFEST_DRE","认证参数收集中填写人"),
|
||||||
PROJECT_PARAMS_COLLECT_MANIFEST_SDT("PROJECT_PARAMS_COLLECT_MANIFEST_SDT","认证参数收集中工程接口人");
|
PROJECT_PARAMS_COLLECT_MANIFEST_SDT("PROJECT_PARAMS_COLLECT_MANIFEST_SDT","认证参数收集中工程接口人");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String value;
|
String value;
|
||||||
String label;
|
String label;
|
||||||
|
|
||||||
|
|||||||
+87
-5
@@ -31,13 +31,10 @@ import com.jero.modules.project.entity.ProjectCertificationInventoryLogEO;
|
|||||||
import com.jero.modules.project.entity.ProjectLibraryBase;
|
import com.jero.modules.project.entity.ProjectLibraryBase;
|
||||||
import com.jero.modules.project.entity.ProjectRelatedPersonnel;
|
import com.jero.modules.project.entity.ProjectRelatedPersonnel;
|
||||||
import com.jero.modules.project.enums.*;
|
import com.jero.modules.project.enums.*;
|
||||||
import com.jero.modules.project.service.IProjectCertificationInventoryLogEOService;
|
import com.jero.modules.project.service.*;
|
||||||
import com.jero.modules.project.service.IProjectRelatedPersonnelService;
|
|
||||||
import com.jero.modules.split.common.FileUnZip;
|
import com.jero.modules.split.common.FileUnZip;
|
||||||
import com.jero.modules.system.enums.ProjectRoleEnum;
|
import com.jero.modules.system.enums.ProjectRoleEnum;
|
||||||
import com.jero.modules.project.mapper.ProjectCertificationInventoryEOMapper;
|
import com.jero.modules.project.mapper.ProjectCertificationInventoryEOMapper;
|
||||||
import com.jero.modules.project.service.IProjectCertificationInventoryEOService;
|
|
||||||
import com.jero.modules.project.service.IProjectLibraryBaseService;
|
|
||||||
import com.jero.modules.system.entity.SysCategory;
|
import com.jero.modules.system.entity.SysCategory;
|
||||||
import com.jero.modules.system.entity.SysDictItem;
|
import com.jero.modules.system.entity.SysDictItem;
|
||||||
import com.jero.modules.system.entity.SysRole;
|
import com.jero.modules.system.entity.SysRole;
|
||||||
@@ -82,7 +79,7 @@ import java.util.stream.Collectors;
|
|||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.transaction.annotation.Propagation;
|
import org.springframework.transaction.annotation.Propagation;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
@@ -129,6 +126,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private BussDocumentLibraryEOMapper bussDocumentLibraryEOMapper;
|
private BussDocumentLibraryEOMapper bussDocumentLibraryEOMapper;
|
||||||
|
@Autowired
|
||||||
|
private IProjectUserPermissionService projectUserPermissionService;
|
||||||
|
|
||||||
|
|
||||||
@Value(value = "${jero.backUrl}")
|
@Value(value = "${jero.backUrl}")
|
||||||
@@ -223,6 +222,17 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
|
|||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
projectCertificationInventoryEO.setUpdateTime(now);
|
projectCertificationInventoryEO.setUpdateTime(now);
|
||||||
saveOrUpdate(projectCertificationInventoryEO);
|
saveOrUpdate(projectCertificationInventoryEO);
|
||||||
|
//设置权限 先删后加
|
||||||
|
List<ProjectUserPermission> adds = new ArrayList<>();
|
||||||
|
if (ObjectUtils.isNotEmpty(projectCertificationInventoryEO.getSdt())) {
|
||||||
|
setProjectCertificationInventoryPermission(projectCertificationInventoryEO.getSdt(), projectCertificationInventoryEO.getProjectLibraryId(), projectCertificationInventoryEO.getId(), now, adds, ProjectUserLocationEnum.PROJECT_CERTIFICATION_INVENTORY_SDT.getValue());
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNotEmpty(projectCertificationInventoryEO.getDutyPerson())) {
|
||||||
|
setProjectCertificationInventoryPermission(projectCertificationInventoryEO.getDutyPerson(), projectCertificationInventoryEO.getProjectLibraryId(), projectCertificationInventoryEO.getId(), now, adds, ProjectUserLocationEnum.PROJECT_CERTIFICATION_INVENTORY_DP.getValue());
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNotEmpty(adds)) {
|
||||||
|
projectUserPermissionService.saveBatch(adds);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -386,6 +396,21 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
|
|||||||
if(CollectionUtils.isNotEmpty(updateList)){
|
if(CollectionUtils.isNotEmpty(updateList)){
|
||||||
this.updateBatchById(updateList);
|
this.updateBatchById(updateList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Date now = new Date();
|
||||||
|
//设置权限 先删后加
|
||||||
|
List<ProjectUserPermission> adds = new ArrayList<>();
|
||||||
|
for (ProjectCertificationInventoryEO pci: updateList) {
|
||||||
|
if (ObjectUtils.isNotEmpty(pci.getSdt())) {
|
||||||
|
setProjectCertificationInventoryPermission(pci.getSdt(), pci.getProjectLibraryId(), pci.getId(), now, adds, ProjectUserLocationEnum.PROJECT_CERTIFICATION_INVENTORY_SDT.getValue());
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNotEmpty(pci.getDutyPerson())) {
|
||||||
|
setProjectCertificationInventoryPermission(pci.getDutyPerson(), pci.getProjectLibraryId(), pci.getId(), now, adds, ProjectUserLocationEnum.PROJECT_CERTIFICATION_INVENTORY_DP.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNotEmpty(adds)) {
|
||||||
|
projectUserPermissionService.saveBatch(adds);
|
||||||
|
}
|
||||||
}catch (Exception ex){
|
}catch (Exception ex){
|
||||||
throw new JeroBootException("批量设置失败!");
|
throw new JeroBootException("批量设置失败!");
|
||||||
}
|
}
|
||||||
@@ -529,6 +554,20 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
|
|||||||
if (list!=null&&list.size()>0) {
|
if (list!=null&&list.size()>0) {
|
||||||
projectCertificationInventoryEOService.saveBatch(list);
|
projectCertificationInventoryEOService.saveBatch(list);
|
||||||
}
|
}
|
||||||
|
Date now = new Date();
|
||||||
|
//设置权限 先删后加
|
||||||
|
List<ProjectUserPermission> adds = new ArrayList<>();
|
||||||
|
for (ProjectCertificationInventoryEO pci: list) {
|
||||||
|
if (ObjectUtils.isNotEmpty(pci.getSdt())) {
|
||||||
|
setProjectCertificationInventoryPermission(pci.getSdt(), pci.getProjectLibraryId(), pci.getId(), now, adds, ProjectUserLocationEnum.PROJECT_CERTIFICATION_INVENTORY_SDT.getValue());
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNotEmpty(pci.getDutyPerson())) {
|
||||||
|
setProjectCertificationInventoryPermission(pci.getDutyPerson(), pci.getProjectLibraryId(), pci.getId(), now, adds, ProjectUserLocationEnum.PROJECT_CERTIFICATION_INVENTORY_DP.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNotEmpty(adds)) {
|
||||||
|
projectUserPermissionService.saveBatch(adds);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1950,15 +1989,27 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result<?> saveBatch(JSONObject json) {
|
public Result<?> saveBatch(JSONObject json) {
|
||||||
|
Date now = new Date();
|
||||||
if (!json.containsKey("dataList")) {
|
if (!json.containsKey("dataList")) {
|
||||||
throw new JeroBootException("无法获取需要保存的数据,请检查!");
|
throw new JeroBootException("无法获取需要保存的数据,请检查!");
|
||||||
}
|
}
|
||||||
JSONArray dataList = json.getJSONArray("dataList");
|
JSONArray dataList = json.getJSONArray("dataList");
|
||||||
List<ProjectCertificationInventoryEO> projectCertificationInventoryEOList = new ArrayList<>();
|
List<ProjectCertificationInventoryEO> projectCertificationInventoryEOList = new ArrayList<>();
|
||||||
ProjectCertificationInventoryEO projectCertificationInventoryEO = null;
|
ProjectCertificationInventoryEO projectCertificationInventoryEO = null;
|
||||||
|
//设置权限 先删后加
|
||||||
|
List<ProjectUserPermission> adds = new ArrayList<>();
|
||||||
for (Object data : dataList) {
|
for (Object data : dataList) {
|
||||||
projectCertificationInventoryEO = JSONObject.parseObject(JSONObject.toJSONString(data),ProjectCertificationInventoryEO.class);
|
projectCertificationInventoryEO = JSONObject.parseObject(JSONObject.toJSONString(data),ProjectCertificationInventoryEO.class);
|
||||||
projectCertificationInventoryEOList.add(projectCertificationInventoryEO);
|
projectCertificationInventoryEOList.add(projectCertificationInventoryEO);
|
||||||
|
if(ObjectUtils.isNotEmpty(projectCertificationInventoryEO.getSdt())){
|
||||||
|
setProjectCertificationInventoryPermission(projectCertificationInventoryEO.getSdt(), projectCertificationInventoryEO.getProjectLibraryId(), projectCertificationInventoryEO.getId(), now, adds, ProjectUserLocationEnum.PROJECT_CERTIFICATION_INVENTORY_SDT.getValue());
|
||||||
|
}
|
||||||
|
if(ObjectUtils.isNotEmpty(projectCertificationInventoryEO.getDutyPerson())){
|
||||||
|
setProjectCertificationInventoryPermission(projectCertificationInventoryEO.getDutyPerson(), projectCertificationInventoryEO.getProjectLibraryId(), projectCertificationInventoryEO.getId(), now, adds, ProjectUserLocationEnum.PROJECT_CERTIFICATION_INVENTORY_DP.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNotEmpty(adds)) {
|
||||||
|
projectUserPermissionService.saveBatch(adds);
|
||||||
}
|
}
|
||||||
if(CollectionUtils.isEmpty(projectCertificationInventoryEOList)){
|
if(CollectionUtils.isEmpty(projectCertificationInventoryEOList)){
|
||||||
throw new JeroBootException("无法获取需要保存的数据,请检查!");
|
throw new JeroBootException("无法获取需要保存的数据,请检查!");
|
||||||
@@ -2537,6 +2588,20 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
|
|||||||
projectCertificationInventoryEOList.add(projectCertificationInventoryEOTemp);
|
projectCertificationInventoryEOList.add(projectCertificationInventoryEOTemp);
|
||||||
}
|
}
|
||||||
this.saveBatch(projectCertificationInventoryEOList);
|
this.saveBatch(projectCertificationInventoryEOList);
|
||||||
|
Date now = new Date();
|
||||||
|
//设置权限 先删后加
|
||||||
|
List<ProjectUserPermission> adds = new ArrayList<>();
|
||||||
|
for (ProjectCertificationInventoryEO pci: projectCertificationInventoryEOList) {
|
||||||
|
if (ObjectUtils.isNotEmpty(pci.getSdt())) {
|
||||||
|
setProjectCertificationInventoryPermission(pci.getSdt(), pci.getProjectLibraryId(), pci.getId(), now, adds, ProjectUserLocationEnum.PROJECT_CERTIFICATION_INVENTORY_SDT.getValue());
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNotEmpty(pci.getDutyPerson())) {
|
||||||
|
setProjectCertificationInventoryPermission(pci.getDutyPerson(), pci.getProjectLibraryId(), pci.getId(), now, adds, ProjectUserLocationEnum.PROJECT_CERTIFICATION_INVENTORY_DP.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNotEmpty(adds)) {
|
||||||
|
projectUserPermissionService.saveBatch(adds);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return Result.OK("调取成功!");
|
return Result.OK("调取成功!");
|
||||||
@@ -3103,4 +3168,21 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
|
|||||||
|
|
||||||
return Result.OK("引用交付物成功!");
|
return Result.OK("引用交付物成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setProjectCertificationInventoryPermission(String userId, String projectId,String certificationInventoryId,Date now, List<ProjectUserPermission> adds, String belong) {
|
||||||
|
QueryWrapper<ProjectUserPermission> del = new QueryWrapper<>();
|
||||||
|
del.eq("project_id", projectId)
|
||||||
|
.eq("belong", belong)
|
||||||
|
.eq("description", PermissionDescriptionEnum.PROJECT_CERTIFICATION_INVENTORY.getValue() + certificationInventoryId);
|
||||||
|
projectUserPermissionService.remove(del);
|
||||||
|
|
||||||
|
ProjectUserPermission permission = new ProjectUserPermission();
|
||||||
|
permission.setProjectId(projectId);
|
||||||
|
permission.setUserId(userId);
|
||||||
|
permission.setBelong(belong);
|
||||||
|
permission.setDescription(PermissionDescriptionEnum.PROJECT_CERTIFICATION_INVENTORY.getValue() + certificationInventoryId);
|
||||||
|
permission.setCreateTime(now);
|
||||||
|
permission.setUpdateTime(now);
|
||||||
|
adds.add(permission);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user