61712:法规符合性看板-增加数据权限:如果当前登录用户,是工程师、工程接口人角色,只能查看到跟自己相关的数据。其余角色保留之前的查询结果。
This commit is contained in:
+2
@@ -4,6 +4,8 @@ public enum RoleEnum {
|
|||||||
ADMIN_ID("R&H Manager","R&H Manager","manager","1534020391015444481",2),
|
ADMIN_ID("R&H Manager","R&H Manager","manager","1534020391015444481",2),
|
||||||
MANAGER_ID("系统管理员","Administrator","admin","f6817f48af4fb3af11b9e8bf182f618b",3),
|
MANAGER_ID("系统管理员","Administrator","admin","f6817f48af4fb3af11b9e8bf182f618b",3),
|
||||||
COUNTRU_CARD_MANAGE("countryCard管理员","countryCardManage","countryCardManage","1564916346120916993",4),
|
COUNTRU_CARD_MANAGE("countryCard管理员","countryCardManage","countryCardManage","1564916346120916993",4),
|
||||||
|
ENGINEERING_INTERFACE_PERSON("工程接口人","engineeringInterfacePerson","engineeringInterfacePerson","1534020084667674626",5),
|
||||||
|
ENGINEER("工程师","engineer","engineer","1534020318437208065",6),
|
||||||
;
|
;
|
||||||
|
|
||||||
String name;
|
String name;
|
||||||
|
|||||||
+13
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.jero.common.api.vo.Result;
|
import com.jero.common.api.vo.Result;
|
||||||
|
import com.jero.common.system.vo.LoginUser;
|
||||||
import com.jero.common.system.vo.SysUserCacheInfo;
|
import com.jero.common.system.vo.SysUserCacheInfo;
|
||||||
import com.jero.modules.system.entity.PPEmployee;
|
import com.jero.modules.system.entity.PPEmployee;
|
||||||
import com.jero.modules.system.entity.SysRole;
|
import com.jero.modules.system.entity.SysRole;
|
||||||
@@ -276,4 +277,16 @@ public interface ISysUserService extends IService<SysUser> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
boolean isAdministrator();
|
boolean isAdministrator();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 验证当前登录用户是否是工程接口人角色
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
boolean isEngineeringInterfacePerson(LoginUser currentUser);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 验证当前登录用户是否是工程师角色
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
boolean isEngineer(LoginUser currentUser);
|
||||||
}
|
}
|
||||||
|
|||||||
+42
@@ -614,4 +614,46 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isEngineeringInterfacePerson(LoginUser currentUser) {
|
||||||
|
boolean result = false;
|
||||||
|
RoleEnum engineeringInterfacePerson = RoleEnum.ENGINEERING_INTERFACE_PERSON;
|
||||||
|
List<SysUserRole> userRoleList = this.sysUserRoleMapper.selectList(new QueryWrapper<SysUserRole>().lambda().eq(SysUserRole::getUserId, currentUser.getId()));
|
||||||
|
if(CollectionUtils.isNotEmpty(userRoleList)){
|
||||||
|
List<SysUserRole> userRoles = userRoleList.stream().filter(userRole -> {
|
||||||
|
boolean flag = false;
|
||||||
|
if(StringUtils.equals(userRole.getRoleId(),engineeringInterfacePerson.getId())){
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
|
if(CollectionUtils.isNotEmpty(userRoles)){
|
||||||
|
result = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isEngineer(LoginUser currentUser) {
|
||||||
|
boolean result = false;
|
||||||
|
RoleEnum engineer = RoleEnum.ENGINEER;
|
||||||
|
List<SysUserRole> userRoleList = this.sysUserRoleMapper.selectList(new QueryWrapper<SysUserRole>().lambda().eq(SysUserRole::getUserId, currentUser.getId()));
|
||||||
|
if(CollectionUtils.isNotEmpty(userRoleList)){
|
||||||
|
List<SysUserRole> userRoles = userRoleList.stream().filter(userRole -> {
|
||||||
|
boolean flag = false;
|
||||||
|
if(StringUtils.equals(userRole.getRoleId(),engineer.getId())){
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
|
if(CollectionUtils.isNotEmpty(userRoles)){
|
||||||
|
result = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+113
-15
@@ -15,13 +15,54 @@
|
|||||||
LEFT JOIN project_laws_inventory pli ON ( pli.stand_id = bdl.id )
|
LEFT JOIN project_laws_inventory pli ON ( pli.stand_id = bdl.id )
|
||||||
LEFT JOIN project_task_inventory pti ON ( pli.id = pti.project_laws_inventory_id )
|
LEFT JOIN project_task_inventory pti ON ( pli.id = pti.project_laws_inventory_id )
|
||||||
WHERE
|
WHERE
|
||||||
(
|
<if test="params.isEngineerOrEngineeringInterfacePerson != true">
|
||||||
bdl.id IN ( SELECT DISTINCT stand_id FROM laws_opinion_gather where gather_result = #{params.gatherResult})
|
(
|
||||||
OR bdl.id IN ( SELECT DISTINCT stand_id FROM laws_technology_evaluation where flow_status = #{params.flowStatus})
|
bdl.id IN (
|
||||||
or pti.design_p_id IS NOT NULL
|
SELECT
|
||||||
OR pti.prehomo_p_id IS NOT NULL
|
DISTINCT stand_id
|
||||||
OR pti.verify_p_id IS NOT NULL
|
FROM laws_opinion_gather
|
||||||
)
|
where gather_result = #{params.gatherResult}
|
||||||
|
)
|
||||||
|
OR bdl.id IN (
|
||||||
|
SELECT
|
||||||
|
DISTINCT stand_id
|
||||||
|
FROM laws_technology_evaluation
|
||||||
|
where flow_status = #{params.flowStatus}
|
||||||
|
)
|
||||||
|
OR pti.design_p_id IS NOT NULL
|
||||||
|
OR pti.prehomo_p_id IS NOT NULL
|
||||||
|
OR pti.verify_p_id IS NOT NULL
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
<!--2022-11-01 增加数据权限:如果当前登录用户,是工程师、工程接口人角色,只能查看到跟自己相关的数据。其余角色保留之前的查询结果。-->
|
||||||
|
<if test="params.isEngineerOrEngineeringInterfacePerson == true">
|
||||||
|
(
|
||||||
|
bdl.id IN (
|
||||||
|
SELECT
|
||||||
|
DISTINCT stand_id
|
||||||
|
FROM
|
||||||
|
laws_opinion_gather
|
||||||
|
where gather_result = #{params.gatherResult} and evaluator_ids like CONCAT(CONCAT('%',#{params.currentUserId}),'%')
|
||||||
|
)
|
||||||
|
OR bdl.id IN (
|
||||||
|
SELECT
|
||||||
|
DISTINCT stand_id
|
||||||
|
FROM
|
||||||
|
laws_technology_evaluation
|
||||||
|
where flow_status = #{params.flowStatus}
|
||||||
|
and id in (
|
||||||
|
select
|
||||||
|
laws_technology_evaluation_id
|
||||||
|
from
|
||||||
|
laws_technology_evaluation_flow_detail
|
||||||
|
where evaluator_id = #{params.currentUserId}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
OR (pti.design_p_id IS NOT NULL and (pli.design_initiator_id = #{params.currentUserId} or pli.design_duty_id = #{params.currentUserId}))
|
||||||
|
OR (pti.prehomo_p_id IS NOT NULL and (pli.prehomo_initiator_id = #{params.currentUserId} or pli.prehomo_duty_id = #{params.currentUserId}))
|
||||||
|
OR (pti.verify_p_id IS NOT NULL and (pli.verify_initiator_id = #{params.currentUserId} or pli.verify_duty_id = #{params.currentUserId}))
|
||||||
|
)
|
||||||
|
</if>
|
||||||
${params.condition}
|
${params.condition}
|
||||||
GROUP BY bdl.id
|
GROUP BY bdl.id
|
||||||
order by bdl.create_time desc
|
order by bdl.create_time desc
|
||||||
@@ -34,6 +75,12 @@
|
|||||||
pli.serial_number as "serialNumber",
|
pli.serial_number as "serialNumber",
|
||||||
pli.title as "title",
|
pli.title as "title",
|
||||||
pli.project_library_id as "projectLibraryId",
|
pli.project_library_id as "projectLibraryId",
|
||||||
|
pli.design_initiator_id as "designInitiatorId",
|
||||||
|
pli.design_duty_id as "designDutyId",
|
||||||
|
pli.prehomo_initiator_id as "prehomoInitiatorId",
|
||||||
|
pli.prehomo_duty_id as "prehomoDutyId",
|
||||||
|
pli.verify_initiator_id as "verifyInitiatorId",
|
||||||
|
pli.verify_duty_id as "verifyDutyId",
|
||||||
pni.project_name as "projectName",
|
pni.project_name as "projectName",
|
||||||
pni.id as "projectNameId",
|
pni.id as "projectNameId",
|
||||||
pyni.year_name as "yearName",
|
pyni.year_name as "yearName",
|
||||||
@@ -80,6 +127,16 @@
|
|||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
|
<if test="params.isEngineerOrEngineeringInterfacePerson == true">
|
||||||
|
and(
|
||||||
|
pli.design_initiator_id = #{params.currentUserId}
|
||||||
|
or pli.design_duty_id = #{params.currentUserId}
|
||||||
|
or pli.prehomo_initiator_id = #{params.currentUserId}
|
||||||
|
or pli.prehomo_duty_id = #{params.currentUserId}
|
||||||
|
or pli.verify_initiator_id = #{params.currentUserId}
|
||||||
|
or pli.verify_duty_id = #{params.currentUserId}
|
||||||
|
)
|
||||||
|
</if>
|
||||||
order by pli.create_time desc
|
order by pli.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@@ -96,16 +153,57 @@
|
|||||||
LEFT JOIN project_laws_inventory pli ON ( pli.stand_id = bdl.id )
|
LEFT JOIN project_laws_inventory pli ON ( pli.stand_id = bdl.id )
|
||||||
LEFT JOIN project_task_inventory pti ON ( pli.id = pti.project_laws_inventory_id )
|
LEFT JOIN project_task_inventory pti ON ( pli.id = pti.project_laws_inventory_id )
|
||||||
WHERE
|
WHERE
|
||||||
|
<if test="params.isEngineerOrEngineeringInterfacePerson != true">
|
||||||
(
|
(
|
||||||
bdl.id IN ( SELECT DISTINCT stand_id FROM laws_opinion_gather)
|
bdl.id IN (
|
||||||
OR bdl.id IN ( SELECT DISTINCT stand_id FROM laws_technology_evaluation)
|
SELECT
|
||||||
or pti.design_p_id IS NOT NULL
|
DISTINCT stand_id
|
||||||
OR pti.prehomo_p_id IS NOT NULL
|
FROM laws_opinion_gather
|
||||||
OR pti.verify_p_id IS NOT NULL
|
where gather_result = #{params.gatherResult}
|
||||||
)
|
)
|
||||||
<if test="params.condition != '' ">
|
OR bdl.id IN (
|
||||||
${params.condition}
|
SELECT
|
||||||
</if>
|
DISTINCT stand_id
|
||||||
|
FROM laws_technology_evaluation
|
||||||
|
where flow_status = #{params.flowStatus}
|
||||||
|
)
|
||||||
|
OR pti.design_p_id IS NOT NULL
|
||||||
|
OR pti.prehomo_p_id IS NOT NULL
|
||||||
|
OR pti.verify_p_id IS NOT NULL
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
<!--2022-11-01 增加数据权限:如果当前登录用户,是工程师、工程接口人角色,只能查看到跟自己相关的数据。其余角色保留之前的查询结果。-->
|
||||||
|
<if test="params.isEngineerOrEngineeringInterfacePerson == true">
|
||||||
|
(
|
||||||
|
bdl.id IN (
|
||||||
|
SELECT
|
||||||
|
DISTINCT stand_id
|
||||||
|
FROM
|
||||||
|
laws_opinion_gather
|
||||||
|
where gather_result = #{params.gatherResult} and evaluator_ids like CONCAT(CONCAT('%',#{params.currentUserId}),'%')
|
||||||
|
)
|
||||||
|
OR bdl.id IN (
|
||||||
|
SELECT
|
||||||
|
DISTINCT stand_id
|
||||||
|
FROM
|
||||||
|
laws_technology_evaluation
|
||||||
|
where flow_status = #{params.flowStatus}
|
||||||
|
and id in (
|
||||||
|
select
|
||||||
|
laws_technology_evaluation_id
|
||||||
|
from
|
||||||
|
laws_technology_evaluation_flow_detail
|
||||||
|
where evaluator_id = #{params.currentUserId}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
OR (pti.design_p_id IS NOT NULL and (pli.design_initiator_id = #{params.currentUserId} or pli.design_duty_id = #{params.currentUserId}))
|
||||||
|
OR (pti.prehomo_p_id IS NOT NULL and (pli.prehomo_initiator_id = #{params.currentUserId} or pli.prehomo_duty_id = #{params.currentUserId}))
|
||||||
|
OR (pti.verify_p_id IS NOT NULL and (pli.verify_initiator_id = #{params.currentUserId} or pli.verify_duty_id = #{params.currentUserId}))
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
<if test="params.condition != '' ">
|
||||||
|
${params.condition}
|
||||||
|
</if>
|
||||||
GROUP BY bdl.id
|
GROUP BY bdl.id
|
||||||
order by bdl.create_time desc
|
order by bdl.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
+178
-42
@@ -25,6 +25,7 @@ import com.jero.modules.project.service.ILawsComplianceBoardService;
|
|||||||
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.service.ISysDictItemService;
|
import com.jero.modules.system.service.ISysDictItemService;
|
||||||
|
import com.jero.modules.system.service.ISysUserService;
|
||||||
import com.jero.modules.system.service.impl.SysCategoryServiceImpl;
|
import com.jero.modules.system.service.impl.SysCategoryServiceImpl;
|
||||||
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
|
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
|
||||||
import com.jero.modules.system.util.StringUtils;
|
import com.jero.modules.system.util.StringUtils;
|
||||||
@@ -68,6 +69,8 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi
|
|||||||
private ISysDictItemService sysDictItemService;
|
private ISysDictItemService sysDictItemService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ProjectTaskInventoryDetailEOMapper projectTaskInventoryDetailEOMapper;
|
private ProjectTaskInventoryDetailEOMapper projectTaskInventoryDetailEOMapper;
|
||||||
|
@Autowired
|
||||||
|
private ISysUserService sysUserService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage queryPageList(Map<String, Object> params) {
|
public IPage queryPageList(Map<String, Object> params) {
|
||||||
@@ -81,6 +84,18 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi
|
|||||||
//只查询 法规技术评估流程状态、法规意见收集 收集结果 为已完成的数据
|
//只查询 法规技术评估流程状态、法规意见收集 收集结果 为已完成的数据
|
||||||
params.put("flowStatus", GatherResultEnum.COMPLETED.getValue());
|
params.put("flowStatus", GatherResultEnum.COMPLETED.getValue());
|
||||||
params.put("gatherResult", GatherResultEnum.COMPLETED.getValue());
|
params.put("gatherResult", GatherResultEnum.COMPLETED.getValue());
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 2022-11-01 增加数据权限:如果当前登录用户,是工程师、工程接口人角色,只能查看到跟自己相关的数据。其余角色保留之前的查询结果。
|
||||||
|
*/
|
||||||
|
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
boolean isEngineer = this.sysUserService.isEngineer(currentUser);
|
||||||
|
boolean isEngineeringInterfacePerson = this.sysUserService.isEngineeringInterfacePerson(currentUser);
|
||||||
|
if(isEngineer || isEngineeringInterfacePerson){
|
||||||
|
params.put("currentUserId",currentUser.getId());
|
||||||
|
params.put("isEngineerOrEngineeringInterfacePerson",true);
|
||||||
|
}
|
||||||
|
|
||||||
IPage page = new Page(pageNo, pageSize);
|
IPage page = new Page(pageNo, pageSize);
|
||||||
IPage infoPage = this.lawsComplianceBoardMapper.queryPageList(page, params);
|
IPage infoPage = this.lawsComplianceBoardMapper.queryPageList(page, params);
|
||||||
List records = infoPage.getRecords();
|
List records = infoPage.getRecords();
|
||||||
@@ -142,18 +157,28 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JSONObject queryComplianceResultList(Map<String, Object> params) {
|
public JSONObject queryComplianceResultList(Map<String, Object> params) {
|
||||||
|
/**
|
||||||
|
* 2022-11-01 增加数据权限:如果当前登录用户,是工程师、工程接口人角色,只能查看到跟自己相关的数据。其余角色保留之前的查询结果。
|
||||||
|
*/
|
||||||
|
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
boolean isEngineer = this.sysUserService.isEngineer(currentUser);
|
||||||
|
boolean isEngineeringInterfacePerson = this.sysUserService.isEngineeringInterfacePerson(currentUser);
|
||||||
|
if(isEngineer || isEngineeringInterfacePerson){
|
||||||
|
params.put("currentUserId",currentUser.getId());
|
||||||
|
params.put("isEngineerOrEngineeringInterfacePerson",true);
|
||||||
|
}
|
||||||
|
|
||||||
JSONObject result = new JSONObject();
|
JSONObject result = new JSONObject();
|
||||||
String id = (String) params.get("id");
|
String id = (String) params.get("id");
|
||||||
String cut = (String) params.get("cut");
|
String cut = (String) params.get("cut");
|
||||||
List<Map<String,Object>> complianceResultList = this.lawsComplianceBoardMapper.queryComplianceResultList(params);
|
List<Map<String,Object>> complianceResultList = this.lawsComplianceBoardMapper.queryComplianceResultList(params);
|
||||||
if(CollectionUtils.isNotEmpty(complianceResultList)){
|
if(CollectionUtils.isNotEmpty(complianceResultList)){
|
||||||
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
||||||
List<String> projectLawsInventoryIdList = complianceResultList.stream().map(map-> (String) map.get("id")).collect(Collectors.toList());
|
List<String> projectLawsInventoryIdList = complianceResultList.stream().map(map-> (String) map.get("id")).collect(Collectors.toList());
|
||||||
QueryWrapper<ProjectTaskInventoryDetailEO> taskDetailQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<ProjectTaskInventoryDetailEO> taskDetailQueryWrapper = new QueryWrapper<>();
|
||||||
taskDetailQueryWrapper.lambda().in(ProjectTaskInventoryDetailEO::getProjectTaskInventoryId,projectLawsInventoryIdList);
|
taskDetailQueryWrapper.lambda().in(ProjectTaskInventoryDetailEO::getProjectTaskInventoryId,projectLawsInventoryIdList);
|
||||||
List<ProjectTaskInventoryDetailEO> projectTaskInventoryDetailEOList = this.projectTaskInventoryDetailEOMapper.selectList(taskDetailQueryWrapper);
|
List<ProjectTaskInventoryDetailEO> projectTaskInventoryDetailEOList = this.projectTaskInventoryDetailEOMapper.selectList(taskDetailQueryWrapper);
|
||||||
this.createTaskInventoryEOList(complianceResultList,projectTaskInventoryDetailEOList,currentUser);
|
this.createTaskInventoryEOList(complianceResultList,projectTaskInventoryDetailEOList,currentUser,isEngineer,isEngineeringInterfacePerson);
|
||||||
this.disposeComplianceResult(complianceResultList,cut);
|
this.disposeComplianceResult(complianceResultList,cut,isEngineer,isEngineeringInterfacePerson);
|
||||||
}
|
}
|
||||||
result.put("complianceResultList",complianceResultList);
|
result.put("complianceResultList",complianceResultList);
|
||||||
|
|
||||||
@@ -161,6 +186,10 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi
|
|||||||
QueryWrapper<LawsOpinionGatherEO> opinionGatherEOQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<LawsOpinionGatherEO> opinionGatherEOQueryWrapper = new QueryWrapper<>();
|
||||||
opinionGatherEOQueryWrapper.lambda().eq(LawsOpinionGatherEO::getStandId,id);
|
opinionGatherEOQueryWrapper.lambda().eq(LawsOpinionGatherEO::getStandId,id);
|
||||||
opinionGatherEOQueryWrapper.lambda().eq(LawsOpinionGatherEO::getGatherResult,GatherResultEnum.COMPLETED.getValue());
|
opinionGatherEOQueryWrapper.lambda().eq(LawsOpinionGatherEO::getGatherResult,GatherResultEnum.COMPLETED.getValue());
|
||||||
|
//如果当前登录用户是工程师或工程接口人,只查询自己为评估人的法规意见收集数据。
|
||||||
|
if(isEngineer || isEngineeringInterfacePerson){
|
||||||
|
opinionGatherEOQueryWrapper.lambda().like(LawsOpinionGatherEO::getEvaluatorIds,currentUser.getId());
|
||||||
|
}
|
||||||
int opinionGatherCount = this.lawsOpinionGatherEOService.count(opinionGatherEOQueryWrapper);
|
int opinionGatherCount = this.lawsOpinionGatherEOService.count(opinionGatherEOQueryWrapper);
|
||||||
result.put("opinionGather",opinionGatherCount);
|
result.put("opinionGather",opinionGatherCount);
|
||||||
|
|
||||||
@@ -168,6 +197,10 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi
|
|||||||
QueryWrapper<LawsTechnologyEvaluationEO> evaluationEOQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<LawsTechnologyEvaluationEO> evaluationEOQueryWrapper = new QueryWrapper<>();
|
||||||
evaluationEOQueryWrapper.lambda().eq(LawsTechnologyEvaluationEO::getStandId,id);
|
evaluationEOQueryWrapper.lambda().eq(LawsTechnologyEvaluationEO::getStandId,id);
|
||||||
evaluationEOQueryWrapper.lambda().eq(LawsTechnologyEvaluationEO::getFlowStatus,GatherResultEnum.COMPLETED.getValue());
|
evaluationEOQueryWrapper.lambda().eq(LawsTechnologyEvaluationEO::getFlowStatus,GatherResultEnum.COMPLETED.getValue());
|
||||||
|
//如果当前登录用户是工程师或工程接口人,只查询自己为评估人的法规技术评估数据。
|
||||||
|
if(isEngineer || isEngineeringInterfacePerson){
|
||||||
|
this.lawsTechnologyEvaluationEOService.createQueryPermission(evaluationEOQueryWrapper,null,false);
|
||||||
|
}
|
||||||
int evaluationCount = this.lawsTechnologyEvaluationEOService.count(evaluationEOQueryWrapper);
|
int evaluationCount = this.lawsTechnologyEvaluationEOService.count(evaluationEOQueryWrapper);
|
||||||
result.put("technologyEvaluation",evaluationCount);
|
result.put("technologyEvaluation",evaluationCount);
|
||||||
return result;
|
return result;
|
||||||
@@ -178,8 +211,14 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi
|
|||||||
* @param complianceResultList
|
* @param complianceResultList
|
||||||
* @param projectTaskInventoryDetailEOList
|
* @param projectTaskInventoryDetailEOList
|
||||||
* @param currentUser
|
* @param currentUser
|
||||||
|
* @param isEngineer 是否是工程师角色
|
||||||
|
* @param isEngineeringInterfacePerson 是否是工程接口人角色
|
||||||
*/
|
*/
|
||||||
private void createTaskInventoryEOList(List<Map<String, Object>> complianceResultList, List<ProjectTaskInventoryDetailEO> projectTaskInventoryDetailEOList, LoginUser currentUser) {
|
private void createTaskInventoryEOList(List<Map<String, Object>> complianceResultList,
|
||||||
|
List<ProjectTaskInventoryDetailEO> projectTaskInventoryDetailEOList,
|
||||||
|
LoginUser currentUser,
|
||||||
|
boolean isEngineer,
|
||||||
|
boolean isEngineeringInterfacePerson) {
|
||||||
if(CollectionUtils.isNotEmpty(complianceResultList) && CollectionUtils.isNotEmpty(projectTaskInventoryDetailEOList)){
|
if(CollectionUtils.isNotEmpty(complianceResultList) && CollectionUtils.isNotEmpty(projectTaskInventoryDetailEOList)){
|
||||||
for (Map<String, Object> complianceResult : complianceResultList) {
|
for (Map<String, Object> complianceResult : complianceResultList) {
|
||||||
String designPid = "";
|
String designPid = "";
|
||||||
@@ -199,44 +238,97 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi
|
|||||||
String verifyTaskStatus = "";
|
String verifyTaskStatus = "";
|
||||||
String verifyTaskDefinitionKey = "";
|
String verifyTaskDefinitionKey = "";
|
||||||
String verifyTaskDetailId = "";
|
String verifyTaskDetailId = "";
|
||||||
|
//2022-11-01 增加数据权限:如果当前登录用户,是工程师、工程接口人角色,只能查看到跟自己相关的数据。其余角色保留之前的查询结果。
|
||||||
for (ProjectTaskInventoryDetailEO projectTaskInventoryDetail : projectTaskInventoryDetailEOList) {
|
if((isEngineer || isEngineeringInterfacePerson)){
|
||||||
if(StringUtils.equals(complianceResult.get("id").toString(),projectTaskInventoryDetail.getProjectTaskInventoryId())){
|
for (ProjectTaskInventoryDetailEO projectTaskInventoryDetail : projectTaskInventoryDetailEOList) {
|
||||||
/**
|
if(StringUtils.equals(complianceResult.get("id").toString(),projectTaskInventoryDetail.getProjectTaskInventoryId())){
|
||||||
* 查询数据权限,所有用户都是,自己的待办,可以跳转到处理任务详情页进行处理。
|
/**
|
||||||
* 不是自己的待办,只能跳转到处理任务的详情页。
|
* 查询数据权限,所有用户都是,自己的待办,可以跳转到处理任务详情页进行处理。
|
||||||
*/
|
* 不是自己的待办,只能跳转到处理任务的详情页。
|
||||||
if(StringUtils.equals(projectTaskInventoryDetail.getFlowType(), FlowTypeEnum.SJFHXSHLC.getValue())){
|
*/
|
||||||
designPid = projectTaskInventoryDetail.getActiProcInstId();
|
if(StringUtils.equals(complianceResult.get("designInitiatorId").toString(),currentUser.getId())
|
||||||
designTaskId = projectTaskInventoryDetail.getTaskId();
|
|| StringUtils.equals(complianceResult.get("designDutyId").toString(),currentUser.getId())){
|
||||||
designTaskDefinitionKey = projectTaskInventoryDetail.getTaskDefinitionKey();
|
if(StringUtils.equals(projectTaskInventoryDetail.getFlowType(), FlowTypeEnum.SJFHXSHLC.getValue())){
|
||||||
designTaskDetailId = projectTaskInventoryDetail.getId();
|
designPid = projectTaskInventoryDetail.getActiProcInstId();
|
||||||
if(StringUtils.equals(currentUser.getId(),projectTaskInventoryDetail.getUserId())){
|
designTaskId = projectTaskInventoryDetail.getTaskId();
|
||||||
designTaskStatus = projectTaskInventoryDetail.getStatus();
|
designTaskDefinitionKey = projectTaskInventoryDetail.getTaskDefinitionKey();
|
||||||
}else {
|
designTaskDetailId = projectTaskInventoryDetail.getId();
|
||||||
designTaskStatus = TaskStatusEnum.SHOW_FLAG.getValue();
|
if(StringUtils.equals(currentUser.getId(),projectTaskInventoryDetail.getUserId())){
|
||||||
|
designTaskStatus = projectTaskInventoryDetail.getStatus();
|
||||||
|
}else {
|
||||||
|
designTaskStatus = TaskStatusEnum.SHOW_FLAG.getValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(StringUtils.equals(complianceResult.get("prehomoInitiatorId").toString(),currentUser.getId())
|
||||||
|
|| StringUtils.equals(complianceResult.get("prehomoDutyId").toString(),currentUser.getId())){
|
||||||
|
if(StringUtils.equals(projectTaskInventoryDetail.getFlowType(),FlowTypeEnum.PREHOMOQRLC.getValue())){
|
||||||
|
prehomoPid = projectTaskInventoryDetail.getActiProcInstId();
|
||||||
|
prehomoTaskId = projectTaskInventoryDetail.getTaskId();
|
||||||
|
prehomoTaskDefinitionKey = projectTaskInventoryDetail.getTaskDefinitionKey();
|
||||||
|
prehomoTaskDetailId = projectTaskInventoryDetail.getId();
|
||||||
|
if(StringUtils.equals(currentUser.getId(),projectTaskInventoryDetail.getUserId())){
|
||||||
|
prehomoTaskStatus = projectTaskInventoryDetail.getStatus();
|
||||||
|
}else {
|
||||||
|
prehomoTaskStatus = TaskStatusEnum.SHOW_FLAG.getValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(StringUtils.equals(complianceResult.get("verifyInitiatorId").toString(),currentUser.getId())
|
||||||
|
|| StringUtils.equals(complianceResult.get("verifyDutyId").toString(),currentUser.getId())){
|
||||||
|
if(StringUtils.equals(projectTaskInventoryDetail.getFlowType(),FlowTypeEnum.YZFHXSCLC.getValue())){
|
||||||
|
verifyPid = projectTaskInventoryDetail.getActiProcInstId();
|
||||||
|
verifyTaskId = projectTaskInventoryDetail.getTaskId();
|
||||||
|
verifyTaskDefinitionKey = projectTaskInventoryDetail.getTaskDefinitionKey();
|
||||||
|
verifyTaskDetailId = projectTaskInventoryDetail.getId();
|
||||||
|
if(StringUtils.equals(currentUser.getId(),projectTaskInventoryDetail.getUserId())){
|
||||||
|
verifyTaskStatus = projectTaskInventoryDetail.getStatus();
|
||||||
|
}else {
|
||||||
|
verifyTaskStatus = TaskStatusEnum.SHOW_FLAG.getValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(StringUtils.equals(projectTaskInventoryDetail.getFlowType(),FlowTypeEnum.PREHOMOQRLC.getValue())){
|
}
|
||||||
prehomoPid = projectTaskInventoryDetail.getActiProcInstId();
|
}else {
|
||||||
prehomoTaskId = projectTaskInventoryDetail.getTaskId();
|
for (ProjectTaskInventoryDetailEO projectTaskInventoryDetail : projectTaskInventoryDetailEOList) {
|
||||||
prehomoTaskDefinitionKey = projectTaskInventoryDetail.getTaskDefinitionKey();
|
if(StringUtils.equals(complianceResult.get("id").toString(),projectTaskInventoryDetail.getProjectTaskInventoryId())){
|
||||||
prehomoTaskDetailId = projectTaskInventoryDetail.getId();
|
/**
|
||||||
if(StringUtils.equals(currentUser.getId(),projectTaskInventoryDetail.getUserId())){
|
* 查询数据权限,所有用户都是,自己的待办,可以跳转到处理任务详情页进行处理。
|
||||||
prehomoTaskStatus = projectTaskInventoryDetail.getStatus();
|
* 不是自己的待办,只能跳转到处理任务的详情页。
|
||||||
}else {
|
*/
|
||||||
prehomoTaskStatus = TaskStatusEnum.SHOW_FLAG.getValue();
|
if(StringUtils.equals(projectTaskInventoryDetail.getFlowType(), FlowTypeEnum.SJFHXSHLC.getValue())){
|
||||||
|
designPid = projectTaskInventoryDetail.getActiProcInstId();
|
||||||
|
designTaskId = projectTaskInventoryDetail.getTaskId();
|
||||||
|
designTaskDefinitionKey = projectTaskInventoryDetail.getTaskDefinitionKey();
|
||||||
|
designTaskDetailId = projectTaskInventoryDetail.getId();
|
||||||
|
if(StringUtils.equals(currentUser.getId(),projectTaskInventoryDetail.getUserId())){
|
||||||
|
designTaskStatus = projectTaskInventoryDetail.getStatus();
|
||||||
|
}else {
|
||||||
|
designTaskStatus = TaskStatusEnum.SHOW_FLAG.getValue();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
if(StringUtils.equals(projectTaskInventoryDetail.getFlowType(),FlowTypeEnum.PREHOMOQRLC.getValue())){
|
||||||
if(StringUtils.equals(projectTaskInventoryDetail.getFlowType(),FlowTypeEnum.YZFHXSCLC.getValue())){
|
prehomoPid = projectTaskInventoryDetail.getActiProcInstId();
|
||||||
verifyPid = projectTaskInventoryDetail.getActiProcInstId();
|
prehomoTaskId = projectTaskInventoryDetail.getTaskId();
|
||||||
verifyTaskId = projectTaskInventoryDetail.getTaskId();
|
prehomoTaskDefinitionKey = projectTaskInventoryDetail.getTaskDefinitionKey();
|
||||||
verifyTaskDefinitionKey = projectTaskInventoryDetail.getTaskDefinitionKey();
|
prehomoTaskDetailId = projectTaskInventoryDetail.getId();
|
||||||
verifyTaskDetailId = projectTaskInventoryDetail.getId();
|
if(StringUtils.equals(currentUser.getId(),projectTaskInventoryDetail.getUserId())){
|
||||||
if(StringUtils.equals(currentUser.getId(),projectTaskInventoryDetail.getUserId())){
|
prehomoTaskStatus = projectTaskInventoryDetail.getStatus();
|
||||||
verifyTaskStatus = projectTaskInventoryDetail.getStatus();
|
}else {
|
||||||
}else {
|
prehomoTaskStatus = TaskStatusEnum.SHOW_FLAG.getValue();
|
||||||
verifyTaskStatus = TaskStatusEnum.SHOW_FLAG.getValue();
|
}
|
||||||
|
}
|
||||||
|
if(StringUtils.equals(projectTaskInventoryDetail.getFlowType(),FlowTypeEnum.YZFHXSCLC.getValue())){
|
||||||
|
verifyPid = projectTaskInventoryDetail.getActiProcInstId();
|
||||||
|
verifyTaskId = projectTaskInventoryDetail.getTaskId();
|
||||||
|
verifyTaskDefinitionKey = projectTaskInventoryDetail.getTaskDefinitionKey();
|
||||||
|
verifyTaskDetailId = projectTaskInventoryDetail.getId();
|
||||||
|
if(StringUtils.equals(currentUser.getId(),projectTaskInventoryDetail.getUserId())){
|
||||||
|
verifyTaskStatus = projectTaskInventoryDetail.getStatus();
|
||||||
|
}else {
|
||||||
|
verifyTaskStatus = TaskStatusEnum.SHOW_FLAG.getValue();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -267,10 +359,35 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void disposeComplianceResult(List<Map<String,Object>> complianceResultList,String cut){
|
public void disposeComplianceResult(List<Map<String,Object>> complianceResultList,String cut,boolean isEngineer,boolean isEngineeringInterfacePerson){
|
||||||
if(CollectionUtils.isNotEmpty(complianceResultList)){
|
if(CollectionUtils.isNotEmpty(complianceResultList)){
|
||||||
|
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
List<SysDictItem> dutyTerritoryDictItemList = sysDictItemService.selectItemsByDictCode("duty_territory");
|
List<SysDictItem> dutyTerritoryDictItemList = sysDictItemService.selectItemsByDictCode("duty_territory");
|
||||||
for (Map<String, Object> complianceResult : complianceResultList) {
|
for (Map<String, Object> complianceResult : complianceResultList) {
|
||||||
|
if(isEngineer || isEngineeringInterfacePerson){
|
||||||
|
if(!StringUtils.equals(complianceResult.get("designInitiatorId").toString(),currentUser.getId())
|
||||||
|
|| !StringUtils.equals(complianceResult.get("designDutyId").toString(),currentUser.getId())){
|
||||||
|
complianceResult.put("designStatus","");
|
||||||
|
complianceResult.put("designFlowTaskStatus","");
|
||||||
|
complianceResult.put("designPId","");
|
||||||
|
complianceResult.put("designPersonChargeFeedback","");
|
||||||
|
}
|
||||||
|
if(!StringUtils.equals(complianceResult.get("prehomoInitiatorId").toString(),currentUser.getId())
|
||||||
|
&& !StringUtils.equals(complianceResult.get("prehomoDutyId").toString(),currentUser.getId())){
|
||||||
|
complianceResult.put("prehomoStatus","");
|
||||||
|
complianceResult.put("prehomoFlowTaskStatus","");
|
||||||
|
complianceResult.put("prehomoPId","");
|
||||||
|
complianceResult.put("prehomoPersonChargeFeedback","");
|
||||||
|
}
|
||||||
|
if(!StringUtils.equals(complianceResult.get("verifyInitiatorId").toString(),currentUser.getId())
|
||||||
|
&& !StringUtils.equals(complianceResult.get("verifyDutyId").toString(),currentUser.getId())){
|
||||||
|
complianceResult.put("verifyStatus","");
|
||||||
|
complianceResult.put("verifyFlowTaskStatus","");
|
||||||
|
complianceResult.put("verifyPId","");
|
||||||
|
complianceResult.put("verifyPersonChargeFeedback","");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (complianceResult.get("designStatus") != null) {
|
if (complianceResult.get("designStatus") != null) {
|
||||||
String textByValue = DesignComplianceStatusEnum.getTextByValue(complianceResult.get("designStatus").toString(), cut);
|
String textByValue = DesignComplianceStatusEnum.getTextByValue(complianceResult.get("designStatus").toString(), cut);
|
||||||
complianceResult.put("designStatus_dicText",textByValue);
|
complianceResult.put("designStatus_dicText",textByValue);
|
||||||
@@ -342,6 +459,15 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi
|
|||||||
String condition = this.getConditionStr(params);
|
String condition = this.getConditionStr(params);
|
||||||
params.put("condition",StringUtils.isNotEmpty(condition) ? condition : "");
|
params.put("condition",StringUtils.isNotEmpty(condition) ? condition : "");
|
||||||
List<Map<String,Object>> exportData = new ArrayList<>();
|
List<Map<String,Object>> exportData = new ArrayList<>();
|
||||||
|
|
||||||
|
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
boolean isEngineer = this.sysUserService.isEngineer(currentUser);
|
||||||
|
boolean isEngineeringInterfacePerson = this.sysUserService.isEngineeringInterfacePerson(currentUser);
|
||||||
|
if(isEngineer || isEngineeringInterfacePerson){
|
||||||
|
params.put("currentUserId",currentUser.getId());
|
||||||
|
params.put("isEngineerOrEngineeringInterfacePerson",true);
|
||||||
|
}
|
||||||
|
|
||||||
if(StringUtils.equals(exportAll,"no")){
|
if(StringUtils.equals(exportAll,"no")){
|
||||||
IPage page = this.queryPageList(params);
|
IPage page = this.queryPageList(params);
|
||||||
exportData = page.getRecords();
|
exportData = page.getRecords();
|
||||||
@@ -358,7 +484,7 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi
|
|||||||
List<Map<String,Object>> complianceResultList = new ArrayList<>();
|
List<Map<String,Object>> complianceResultList = new ArrayList<>();
|
||||||
if(CollectionUtils.isNotEmpty(idList)){
|
if(CollectionUtils.isNotEmpty(idList)){
|
||||||
complianceResultList = this.lawsComplianceBoardMapper.queryComplianceResultList(params);
|
complianceResultList = this.lawsComplianceBoardMapper.queryComplianceResultList(params);
|
||||||
this.disposeComplianceResult(complianceResultList,cut);
|
this.disposeComplianceResult(complianceResultList,cut,isEngineer,isEngineeringInterfacePerson);
|
||||||
}
|
}
|
||||||
|
|
||||||
String title = "";
|
String title = "";
|
||||||
@@ -468,8 +594,18 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi
|
|||||||
@Override
|
@Override
|
||||||
public void exportComplianceResultDetail(HttpServletResponse response, HttpServletRequest request, Map<String, Object> params) {
|
public void exportComplianceResultDetail(HttpServletResponse response, HttpServletRequest request, Map<String, Object> params) {
|
||||||
String cut = (String) params.get("cut");
|
String cut = (String) params.get("cut");
|
||||||
|
/**
|
||||||
|
* 2022-11-01 增加数据权限:如果当前登录用户,是工程师、工程接口人角色,只能查看到跟自己相关的数据。其余角色保留之前的查询结果。
|
||||||
|
*/
|
||||||
|
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
boolean isEngineer = this.sysUserService.isEngineer(currentUser);
|
||||||
|
boolean isEngineeringInterfacePerson = this.sysUserService.isEngineeringInterfacePerson(currentUser);
|
||||||
|
if(isEngineer || isEngineeringInterfacePerson){
|
||||||
|
params.put("currentUserId",currentUser.getId());
|
||||||
|
params.put("isEngineerOrEngineeringInterfacePerson",true);
|
||||||
|
}
|
||||||
List<Map<String,Object>> exportData = this.lawsComplianceBoardMapper.queryComplianceResultList(params);
|
List<Map<String,Object>> exportData = this.lawsComplianceBoardMapper.queryComplianceResultList(params);
|
||||||
this.disposeComplianceResult(exportData,cut);
|
this.disposeComplianceResult(exportData,cut,isEngineer,isEngineeringInterfacePerson);
|
||||||
String title = "";
|
String title = "";
|
||||||
String fileName = "";
|
String fileName = "";
|
||||||
if(StringUtils.equals(cut, CutEnum.CN.getValue())){
|
if(StringUtils.equals(cut, CutEnum.CN.getValue())){
|
||||||
|
|||||||
Reference in New Issue
Block a user