合并分支 'dev_third_stage' 到 'dev_2nd_period_test'

Dev third stage

查看合并请求 laws-nio/laws-weilai!226
This commit is contained in:
高嵩
2022-11-02 09:07:54 +08:00
37 changed files with 664 additions and 242 deletions
@@ -158,11 +158,11 @@ public class CommonController {
// bizPath = "";
// }
}
if(file.getOriginalFilename().length()>70){
if(file.getOriginalFilename().length()>100){
if(StringUtils.equals(cut,CutEnum.CN.getValue())){
throw new JeroBootException("文件名长度不能超过70位,请检查!");
throw new JeroBootException("文件名长度不能超过100位,请检查!");
}else if(StringUtils.equals(cut,CutEnum.EN.getValue())){
throw new JeroBootException("File name length cannot exceed 70 characters, please check!");
throw new JeroBootException("File name length cannot exceed 100 characters, please check!");
}
}
// OSSFile oSSFile = ossFileService.uploadLocal(file, bizPath,state,cut);
@@ -4,6 +4,8 @@ public enum RoleEnum {
ADMIN_ID("R&H Manager","R&H Manager","manager","1534020391015444481",2),
MANAGER_ID("系统管理员","Administrator","admin","f6817f48af4fb3af11b9e8bf182f618b",3),
COUNTRU_CARD_MANAGE("countryCard管理员","countryCardManage","countryCardManage","1564916346120916993",4),
ENGINEERING_INTERFACE_PERSON("工程接口人","engineeringInterfacePerson","engineeringInterfacePerson","1534020084667674626",5),
ENGINEER("工程师","engineer","engineer","1534020318437208065",6),
;
String name;
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jero.common.api.vo.Result;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.system.vo.SysUserCacheInfo;
import com.jero.modules.system.entity.PPEmployee;
import com.jero.modules.system.entity.SysRole;
@@ -276,4 +277,16 @@ public interface ISysUserService extends IService<SysUser> {
* @return
*/
boolean isAdministrator();
/**
* 验证当前登录用户是否是工程接口人角色
* @return
*/
boolean isEngineeringInterfacePerson(LoginUser currentUser);
/**
* 验证当前登录用户是否是工程师角色
* @return
*/
boolean isEngineer(LoginUser currentUser);
}
@@ -614,4 +614,46 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
}
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;
}
}
@@ -252,10 +252,14 @@ public class DummyInventoryBaseEOServiceImpl extends ServiceImpl<DummyInventoryB
@Override
public IPage<DummyInventoryBaseEO> getPageInfo(Page<DummyInventoryBaseEO> page, QueryWrapper<DummyInventoryBaseEO> queryWrapper) {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
queryWrapper.and(query->{
query.in("create_by",sysUser.getUsername()).in("state",InventoryStateEnum.DRAFT.getValue())
.or().in("state",InventoryStateEnum.ISSUE.getValue());
});
//系统管理
boolean administrator = sysUserService.isAdministrator();
if(!administrator){
queryWrapper.and(query->{
query.in("create_by",sysUser.getUsername()).in("state",InventoryStateEnum.DRAFT.getValue())
.or().in("state",InventoryStateEnum.ISSUE.getValue());
});
}
// queryWrapper.or(query->{
// query.in("state",InventoryStateEnum.ISSUE.getValue());
// });
@@ -321,19 +325,19 @@ public class DummyInventoryBaseEOServiceImpl extends ServiceImpl<DummyInventoryB
DummyInventoryBaseEO baseEO = queryById(dummyInventoryBaseEO.getId());
List<String> createByNameList =new ArrayList<>();
if (StringUtils.isNotBlank(baseEO.getCreateBy())) {
createByNameList = Arrays.asList(baseEO.getCreateBy().split(","));
if (CollectionUtils.isNotEmpty(createByNameList)){
if (!createByNameList.contains(loginUserName)) {
if (CutEnum.CN.getValue().equals(dummyInventoryBaseEO.getCut())) {
throw new JeroBootException("当前用户非创建者,无法发布");
} else {
throw new JeroBootException("The current user is not the creator and cannot be issued.");
}
}
}
}
// if (StringUtils.isNotBlank(baseEO.getCreateBy())) {
// createByNameList = Arrays.asList(baseEO.getCreateBy().split(","));
//
// if (CollectionUtils.isNotEmpty(createByNameList)){
// if (!createByNameList.contains(loginUserName)) {
// if (CutEnum.CN.getValue().equals(dummyInventoryBaseEO.getCut())) {
// throw new JeroBootException("当前用户非创建者,无法发布");
// } else {
// throw new JeroBootException("The current user is not the creator and cannot be issued.");
// }
// }
// }
// }
Date now = new Date();
UpdateWrapper<DummyInventoryBaseEO> baseWrapper=new UpdateWrapper<>();
baseWrapper.set("state",dummyInventoryBaseEO.getState());
@@ -108,4 +108,6 @@ public class ProjectTaskInventoryFeedbackEO implements Serializable {
@ApiModelProperty(value = "序号")
private String serialNumber;
@TableField(exist = false)
private String userId;
}
@@ -15,13 +15,54 @@
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 )
WHERE
(
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})
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 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}
)
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}
GROUP BY bdl.id
order by bdl.create_time desc
@@ -34,6 +75,12 @@
pli.serial_number as "serialNumber",
pli.title as "title",
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.id as "projectNameId",
pyni.year_name as "yearName",
@@ -80,6 +127,16 @@
#{item}
</foreach>
</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
</select>
@@ -96,16 +153,57 @@
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 )
WHERE
<if test="params.isEngineerOrEngineeringInterfacePerson != true">
(
bdl.id IN ( SELECT DISTINCT stand_id FROM laws_opinion_gather)
OR bdl.id IN ( SELECT DISTINCT stand_id FROM laws_technology_evaluation)
or pti.design_p_id IS NOT NULL
OR pti.prehomo_p_id IS NOT NULL
OR pti.verify_p_id IS NOT NULL
bdl.id IN (
SELECT
DISTINCT stand_id
FROM laws_opinion_gather
where gather_result = #{params.gatherResult}
)
<if test="params.condition != '' ">
${params.condition}
</if>
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>
<if test="params.condition != '' ">
${params.condition}
</if>
GROUP BY bdl.id
order by bdl.create_time desc
</select>
@@ -80,12 +80,15 @@
or prehomo_flow_task_status =#{ncrTrackVO.inconformity} or prehomo_flow_task_status =#{ncrTrackVO.track}
or verify_flow_task_status =#{ncrTrackVO.inconformity} or verify_flow_task_status =#{ncrTrackVO.track}
)
<if test="ncrTrackVO.userId != null and ncrTrackVO.userId != ''">
and (pli.regulation_owner_id =#{ncrTrackVO.userId}
or pli.homologation_engineer_id =#{ncrTrackVO.userId}
or pli.engineering_interface_person =#{ncrTrackVO.userId}
or ptid.user_id =#{ncrTrackVO.userId}
)
<!--如果当前操作人不是系统管理员角色,查询跟自己相关的数据,如果是系统管理员,查询所有的-->
<if test="ncrTrackVO.administrator == 'false'">
<if test="ncrTrackVO.userId != null and ncrTrackVO.userId != ''">
and (pli.regulation_owner_id =#{ncrTrackVO.userId}
or pli.homologation_engineer_id =#{ncrTrackVO.userId}
or pli.engineering_interface_person =#{ncrTrackVO.userId}
or ptid.user_id =#{ncrTrackVO.userId}
)
</if>
</if>
order by pli.create_time desc
@@ -25,6 +25,7 @@ import com.jero.modules.project.service.ILawsComplianceBoardService;
import com.jero.modules.system.entity.SysCategory;
import com.jero.modules.system.entity.SysDictItem;
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.SysDictItemServiceImpl;
import com.jero.modules.system.util.StringUtils;
@@ -68,6 +69,8 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi
private ISysDictItemService sysDictItemService;
@Autowired
private ProjectTaskInventoryDetailEOMapper projectTaskInventoryDetailEOMapper;
@Autowired
private ISysUserService sysUserService;
@Override
public IPage queryPageList(Map<String, Object> params) {
@@ -81,6 +84,18 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi
//只查询 法规技术评估流程状态、法规意见收集 收集结果 为已完成的数据
params.put("flowStatus", 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 infoPage = this.lawsComplianceBoardMapper.queryPageList(page, params);
List records = infoPage.getRecords();
@@ -142,18 +157,28 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi
@Override
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();
String id = (String) params.get("id");
String cut = (String) params.get("cut");
List<Map<String,Object>> complianceResultList = this.lawsComplianceBoardMapper.queryComplianceResultList(params);
if(CollectionUtils.isNotEmpty(complianceResultList)){
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
List<String> projectLawsInventoryIdList = complianceResultList.stream().map(map-> (String) map.get("id")).collect(Collectors.toList());
QueryWrapper<ProjectTaskInventoryDetailEO> taskDetailQueryWrapper = new QueryWrapper<>();
taskDetailQueryWrapper.lambda().in(ProjectTaskInventoryDetailEO::getProjectTaskInventoryId,projectLawsInventoryIdList);
List<ProjectTaskInventoryDetailEO> projectTaskInventoryDetailEOList = this.projectTaskInventoryDetailEOMapper.selectList(taskDetailQueryWrapper);
this.createTaskInventoryEOList(complianceResultList,projectTaskInventoryDetailEOList,currentUser);
this.disposeComplianceResult(complianceResultList,cut);
this.createTaskInventoryEOList(complianceResultList,projectTaskInventoryDetailEOList,currentUser,isEngineer,isEngineeringInterfacePerson);
this.disposeComplianceResult(complianceResultList,cut,isEngineer,isEngineeringInterfacePerson);
}
result.put("complianceResultList",complianceResultList);
@@ -161,6 +186,10 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi
QueryWrapper<LawsOpinionGatherEO> opinionGatherEOQueryWrapper = new QueryWrapper<>();
opinionGatherEOQueryWrapper.lambda().eq(LawsOpinionGatherEO::getStandId,id);
opinionGatherEOQueryWrapper.lambda().eq(LawsOpinionGatherEO::getGatherResult,GatherResultEnum.COMPLETED.getValue());
//如果当前登录用户是工程师或工程接口人,只查询自己为评估人的法规意见收集数据。
if(isEngineer || isEngineeringInterfacePerson){
opinionGatherEOQueryWrapper.lambda().like(LawsOpinionGatherEO::getEvaluatorIds,currentUser.getId());
}
int opinionGatherCount = this.lawsOpinionGatherEOService.count(opinionGatherEOQueryWrapper);
result.put("opinionGather",opinionGatherCount);
@@ -168,6 +197,10 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi
QueryWrapper<LawsTechnologyEvaluationEO> evaluationEOQueryWrapper = new QueryWrapper<>();
evaluationEOQueryWrapper.lambda().eq(LawsTechnologyEvaluationEO::getStandId,id);
evaluationEOQueryWrapper.lambda().eq(LawsTechnologyEvaluationEO::getFlowStatus,GatherResultEnum.COMPLETED.getValue());
//如果当前登录用户是工程师或工程接口人,只查询自己为评估人的法规技术评估数据。
if(isEngineer || isEngineeringInterfacePerson){
this.lawsTechnologyEvaluationEOService.createQueryPermission(evaluationEOQueryWrapper,null,false);
}
int evaluationCount = this.lawsTechnologyEvaluationEOService.count(evaluationEOQueryWrapper);
result.put("technologyEvaluation",evaluationCount);
return result;
@@ -178,8 +211,14 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi
* @param complianceResultList
* @param projectTaskInventoryDetailEOList
* @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)){
for (Map<String, Object> complianceResult : complianceResultList) {
String designPid = "";
@@ -199,44 +238,97 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi
String verifyTaskStatus = "";
String verifyTaskDefinitionKey = "";
String verifyTaskDetailId = "";
for (ProjectTaskInventoryDetailEO projectTaskInventoryDetail : projectTaskInventoryDetailEOList) {
if(StringUtils.equals(complianceResult.get("id").toString(),projectTaskInventoryDetail.getProjectTaskInventoryId())){
/**
* 查询数据权限,所有用户都是,自己的待办,可以跳转到处理任务详情页进行处理。
* 不是自己的待办,只能跳转到处理任务详情页。
*/
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();
//2022-11-01 增加数据权限:如果当前登录用户,是工程师、工程接口人角色,只能查看到跟自己相关的数据。其余角色保留之前的查询结果。
if((isEngineer || isEngineeringInterfacePerson)){
for (ProjectTaskInventoryDetailEO projectTaskInventoryDetail : projectTaskInventoryDetailEOList) {
if(StringUtils.equals(complianceResult.get("id").toString(),projectTaskInventoryDetail.getProjectTaskInventoryId())){
/**
* 查询数据权限,所有用户都是,自己的待办,可以跳转到处理任务详情页进行处理
* 不是自己的待办,只能跳转到处理任务的详情页。
*/
if(StringUtils.equals(complianceResult.get("designInitiatorId").toString(),currentUser.getId())
|| StringUtils.equals(complianceResult.get("designDutyId").toString(),currentUser.getId())){
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(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();
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();
}
}else {
for (ProjectTaskInventoryDetailEO projectTaskInventoryDetail : projectTaskInventoryDetailEOList) {
if(StringUtils.equals(complianceResult.get("id").toString(),projectTaskInventoryDetail.getProjectTaskInventoryId())){
/**
* 查询数据权限,所有用户都是,自己的待办,可以跳转到处理任务详情页进行处理。
* 不是自己的待办,只能跳转到处理任务的详情页。
*/
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.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();
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(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)){
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
List<SysDictItem> dutyTerritoryDictItemList = sysDictItemService.selectItemsByDictCode("duty_territory");
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) {
String textByValue = DesignComplianceStatusEnum.getTextByValue(complianceResult.get("designStatus").toString(), cut);
complianceResult.put("designStatus_dicText",textByValue);
@@ -342,6 +459,15 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi
String condition = this.getConditionStr(params);
params.put("condition",StringUtils.isNotEmpty(condition) ? condition : "");
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")){
IPage page = this.queryPageList(params);
exportData = page.getRecords();
@@ -358,7 +484,7 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi
List<Map<String,Object>> complianceResultList = new ArrayList<>();
if(CollectionUtils.isNotEmpty(idList)){
complianceResultList = this.lawsComplianceBoardMapper.queryComplianceResultList(params);
this.disposeComplianceResult(complianceResultList,cut);
this.disposeComplianceResult(complianceResultList,cut,isEngineer,isEngineeringInterfacePerson);
}
String title = "";
@@ -468,8 +594,18 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi
@Override
public void exportComplianceResultDetail(HttpServletResponse response, HttpServletRequest request, Map<String, Object> params) {
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);
this.disposeComplianceResult(exportData,cut);
this.disposeComplianceResult(exportData,cut,isEngineer,isEngineeringInterfacePerson);
String title = "";
String fileName = "";
if(StringUtils.equals(cut, CutEnum.CN.getValue())){
@@ -80,6 +80,11 @@ public class NcrTrackServiceImpl extends ServiceImpl<NcrTrackMapper, NcrTrackVO>
ncrTrackVO.setInconformity(ReviewResultEnum.INCONFORMITY.getValue());
ncrTrackVO.setTrack(ReviewResultEnum.TO_TRACK.getValue());
//如果当前登录用户是系统管理员角色,可以查看所有的数据
boolean administrator = this.sysUserService.isAdministrator();
ncrTrackVO.setAdministrator(administrator ? "true":"false");
List<NcrTrackVO> infoList = ncrTrackMapper.getInfoList(ncrTrackVO);
infoList = infoList.stream().distinct().collect(Collectors.toList());
List<NcrTrackVO> trackVOList = new ArrayList<>();
@@ -370,6 +370,9 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl<Proje
List<ProjectTaskInventoryFeedbackEO> projectTaskInventoryFeedbackEOS = this.baseMapper.selectList(queryWrapper);
if(CollectionUtils.isNotEmpty(projectTaskInventoryFeedbackEOS)){
List<String> idList = projectTaskInventoryFeedbackEOS.stream().distinct().map(ProjectTaskInventoryFeedbackEO::getProjectTaskInventoryId).collect(Collectors.toList());
List<String> userNameList = projectTaskInventoryFeedbackEOS.stream().distinct().map(ProjectTaskInventoryFeedbackEO::getCreateBy).collect(Collectors.toList());
List<SysUser> userList = this.sysUserService.queryUserIdListByNameList(userNameList);
QueryWrapper<ProjectTaskInventoryDetailEO> inventoryDetailEOQueryWrapper = new QueryWrapper<>();
inventoryDetailEOQueryWrapper.lambda().in(ProjectTaskInventoryDetailEO::getId,idList);
List<ProjectTaskInventoryDetailEO> projectTaskInventoryDetailEOList = projectTaskInventoryDetailEOMapper.selectList(inventoryDetailEOQueryWrapper);
@@ -386,6 +389,18 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl<Proje
if(CollectionUtils.isNotEmpty(projectTaskInventoryDetailList)){
projectTaskInventoryFeedbackEO.setStatus(projectTaskInventoryDetailList.get(0).getStatus());
}
if(CollectionUtils.isNotEmpty(userList)){
List<SysUser> userListTemp = userList.stream().filter(user -> {
boolean flag = false;
if(StringUtils.equals(projectTaskInventoryFeedbackEO.getCreateBy(),user.getUsername())){
flag = true;
}
return flag;
}).collect(Collectors.toList());
if(CollectionUtils.isNotEmpty(userListTemp)){
projectTaskInventoryFeedbackEO.setUserId(userListTemp.get(0).getId());
}
}
}
}
return projectTaskInventoryFeedbackEOS;
@@ -137,8 +137,8 @@ public class NcrTrackVO implements Serializable {
private String projectTaskInventoryDetailId;
//任务节点定义key
private String taskDefinitionKey;
//是否是系统管理员角色
private String administrator;
@@ -35,6 +35,7 @@ public class BusMes {
private String handlingTime; // 待办流程-批量办理专用
private String projectLawsInventoryIds; // 待办流程-批量办理专用
private String taskDefinitionKey; // 待办流程-批量办理专用
private String cut;//中英文切换标识
public String getUserId() {
@@ -193,4 +194,12 @@ public class BusMes {
public void setTaskDefinitionKey(String taskDefinitionKey) {
this.taskDefinitionKey = taskDefinitionKey;
}
public String getCut() {
return cut;
}
public void setCut(String cut) {
this.cut = cut;
}
}
+12 -3
View File
@@ -21,11 +21,11 @@
<!-- <span v-if="ol.text==$t('check')">-->
<!-- {{record.resultContent=='转换成功'&&record.syncState=='未同步'?ol.text:''}}-->
<!-- </span>-->
<span v-if="ol.text==$t('download') && record.createBy == userData.username"
<span v-if="ol.text==$t('download') && (record.createBy == userData.username || administrators)"
v-has="'ocr:ocrRestful:downFile'">
{{record.resultContent=='转换成功'?ol.text:''}}
</span>
<span v-if="ol.text==$t('delete') && record.createBy == userData.username" v-has="'ocr:ocrRecord:delete'">
<span v-if="ol.text==$t('delete') && (record.createBy == userData.username || administrators)" v-has="'ocr:ocrRecord:delete'">
{{ol.text}}
</span>
</a>
@@ -105,7 +105,8 @@
searchParmes: {},
loading: false,
orderBy: '1',
orderByField: ''
orderByField: '',
administrators:false
}
},
mounted() {
@@ -131,6 +132,14 @@
this.getData()
this.getTableList()
this.userData = this.userInfo()
this.administrators = false
if (this.userInfo().userRoleList && this.userInfo().userRoleList.length > 0) {
this.userInfo().userRoleList.forEach(res => {
if (res.roleCode == 'admin') {
this.administrators = true
}
})
}
},
beforeDestroy(){
eventBUs.$off('searchQuery')
+12 -3
View File
@@ -18,7 +18,7 @@
<!-- <span class="text">-->
<!-- {{ol.text}}-->
<!-- </span>-->
<span v-if="ol.text==$t('backDocument')&&record.flag==0 && record.createBy == userData.username"
<span v-if="ol.text==$t('backDocument') && record.flag==0 && (record.createBy == userData.username || administrators)"
class="text"
v-has="'split:sarFileSplitInfo:bind'">
{{ol.text}}
@@ -27,7 +27,7 @@
v-has="'split:sarFileSplitItems:page'">
{{ol.text}}
</span>
<span v-if="ol.text==$t('delete') && record.createBy == userData.username"
<span v-if="ol.text==$t('delete') && (record.createBy == userData.username || administrators)"
v-has="'split:sarFileSplitInfo:delete'">
{{ol.text}}
</span>
@@ -109,7 +109,8 @@
loading: false,
orderBy: '1',
userData: {},
orderByField: ''
orderByField: '',
administrators:false,
}
},
mounted() {
@@ -141,6 +142,14 @@
this.getData()
this.getTableList()
this.userData = this.userInfo()
this.administrators = false
if (this.userInfo().userRoleList && this.userInfo().userRoleList.length > 0) {
this.userInfo().userRoleList.forEach(res => {
if (res.roleCode == 'admin') {
this.administrators = true
}
})
}
},
beforeDestroy() {
eventBUs.$off('searchQuery')
@@ -125,14 +125,16 @@
</span>
</a-select-option>
</a-select>
<a-button class="box-button-index"
:title="$t('addStandardInformation')"
type="primary" @click="bringInDocumentInformationClick">
{{$t('addStandardInformation')}}
</a-button>
</a-form-model-item>
</div>
</a-col>
<a-col :span="8">
<a-button class="box-button-index"
:title="$t('addStandardInformation')"
type="primary" @click="bringInDocumentInformationClick">
{{$t('addStandardInformation')}}
</a-button>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="24" style="height: 380px">
@@ -799,8 +801,9 @@
width: 120px;
overflow: hidden;
padding: 0 0;
float: right;
/*float: right;*/
text-align: center;
margin-top: 2px;
}
::v-deep .box-button-index span {
@@ -843,8 +846,9 @@
}
.box-input-index {
width: calc(100% - 130px);
/*width: calc(100% - 130px);*/
display: inline-block;
width: 100%;
height: 48px;
margin-right: 10px;
}
@@ -65,16 +65,16 @@
<span slot="operation" slot-scope="text,record">
<a class="text-operation" @click="edit(record)"
v-has="'dummyInventoryBase:deleteBatch'"
v-if="record.createBy == userData.username"
v-if="record.createBy == userData.username || administrators"
:disabled="record.state == 1?true:false">{{$t('edit')}}</a>
<a class="text-operation"
v-if="record.createBy == userData.username"
v-if="record.createBy == userData.username || administrators"
v-has="'dummyInventoryBase:issue'"
@click="withdraw(record)">
{{record.state == 2 ? $t('release') : $t('withdraw')}}
</a>
<a class="text-operation" :disabled="record.state == 1?true:false"
v-if="record.createBy == userData.username"
v-if="record.createBy == userData.username || administrators"
v-has="'dummyInventoryBase:deleteBatch'"
@click="maintenanceList(record)">{{$t('maintenanceList')}}</a>
<a class="text-operation"
@@ -84,7 +84,7 @@
</a>
<a class="text-operation" :disabled="record.state == 1?true:false"
v-has="'dummyInventoryBase:deleteBatch'"
v-if="record.createBy == userData.username"
v-if="record.createBy == userData.username || administrators"
@click="deleteLib(record)">{{$t('deleteLib')}}</a>
</span>
</a-table>
@@ -244,13 +244,21 @@
scopedSlots: { customRender: 'operation' }
}
],
queryParam: {}
queryParam: {},
administrators:false,
}
},
mounted() {
this.getList()
this.userData = this.userInfo()
this.administrators = false
if (this.userInfo().userRoleList && this.userInfo().userRoleList.length > 0) {
this.userInfo().userRoleList.forEach(res => {
if (res.roleCode == 'admin') {
this.administrators = true
}
})
}
},
methods: {
...mapGetters(['userInfo']),
@@ -107,7 +107,7 @@
line-height: 40px;
.header-text {
font-size: 16px;
font-size: 18px;
font-weight: 400;
color: #000F16;
}
@@ -8,24 +8,24 @@
</div>
</div>
<div class="header-content">
<div class="operator-text"
v-if="$route.query.TaskKey == 'zrrclrw' && this.$route.query.isDisplay"
@click="distributionEngineerClick($t('distributionEngineer'),1)">
<a-icon type="audit"/>
{{ $t('distributionEngineer') }}
</div>
<div class="operator-text"
v-if="$route.query.TaskKey == 'zrrclrw' && this.$route.query.isDisplay"
@click="reminderHandling()">
<a-icon type="sound"/>
{{ $t('reminderHandling') }}
</div>
<div class="operator-text"
v-if="$route.query.TaskKey == 'zrrclrw' && this.$route.query.isDisplay"
@click="distributionEngineerClick($t('addFeedback'),2)">
<a-icon type="plus-circle"/>
{{ $t('addFeedback') }}
</div>
<a-button class="header-btn submit"
v-if="$route.query.TaskKey == 'zrrclrw' && this.$route.query.isDisplay"
@click="distributionEngineerClick($t('distributionEngineer'),1)"
type="primary">
{{$t('distributionEngineer')}}
</a-button>
<a-button class="header-btn submit"
v-if="$route.query.TaskKey == 'zrrclrw' && this.$route.query.isDisplay"
@click="distributionEngineerClick($t('addFeedback'),2)"
type="primary">
{{$t('addFeedback')}}
</a-button>
<!-- <div class="operator-text"-->
<!-- v-if="$route.query.TaskKey == 'zrrclrw' && this.$route.query.isDisplay"-->
<!-- @click="reminderHandling()">-->
<!-- <a-icon type="sound"/>-->
<!-- {{ $t('reminderHandling') }}-->
<!-- </div>-->
</div>
<a-table
ref="table"
@@ -74,6 +74,11 @@
@click="deleted(result)">
{{$t('deleteLib')}}
</a>
<a class="text"
@click="reminderClick(result)"
v-if="$route.query.TaskKey == 'zrrclrw' && !result.createUser">
{{ $t('reminderHandling') }}
</a>
</span>
</a-table>
<a-modal
@@ -279,31 +284,31 @@
</div>
<JLoading :loading="pageLoading">{{$t('dataLoading')}}</JLoading>
</a-modal>
<a-modal
:title="$t('reminderHandling')"
:width="800"
:visible="visibleTable"
:maskClosable="false"
@cancel="visibleTable = false"
>
<template slot="footer">
<a-button key="back" @click="visibleTable = false">
{{$t('cancel')}}
</a-button>
</template>
<a-table
ref="table"
:loading="loadingTable"
:pagination="false"
:scroll="{x: true,y:400}"
:data-source="dataSourceTable"
:columns="columnsTable"
>
<span slot="operationTable" slot-scope="result">
<a @click="reminderClick(result)">{{$t('reminder')}}</a>
</span>
</a-table>
</a-modal>
<!-- <a-modal-->
<!-- :title="$t('reminderHandling')"-->
<!-- :width="800"-->
<!-- :visible="visibleTable"-->
<!-- :maskClosable="false"-->
<!-- @cancel="visibleTable = false"-->
<!-- >-->
<!-- <template slot="footer">-->
<!-- <a-button key="back" @click="visibleTable = false">-->
<!-- {{$t('cancel')}}-->
<!-- </a-button>-->
<!-- </template>-->
<!-- <a-table-->
<!-- ref="table"-->
<!-- :loading="loadingTable"-->
<!-- :pagination="false"-->
<!-- :scroll="{x: true,y:400}"-->
<!-- :data-source="dataSourceTable"-->
<!-- :columns="columnsTable"-->
<!-- >-->
<!-- <span slot="operationTable" slot-scope="result">-->
<!-- <a @click="reminderClick(result)">{{$t('reminder')}}</a>-->
<!-- </span>-->
<!-- </a-table>-->
<!-- </a-modal>-->
<uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"/>
<viewFileModel ref="viewFileModelRef"/>
</div>
@@ -436,7 +441,7 @@
{
title: this.$t('operation'),
align: 'left',
width: 160,
width: 190,
scopedSlots: { customRender: 'operation' }
}
],
@@ -722,7 +727,7 @@
_this.formInline.userId.splice(num, 1)
_this.formInline.userId = _this.formInline.userId.join(',')
_this.formInline = { ..._this.formInline }
if (id){
if (id) {
deleteAction('/project/projectTaskInventoryDetailEO/delete', { id: id }).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
@@ -829,7 +834,7 @@
line-height: 80px;
.header-text {
font-size: 16px;
font-size: 18px;
font-weight: 400;
color: #000F16;
}
@@ -960,4 +965,9 @@
line-height: 200px;
text-align: center;
}
.header-btn {
height: 38px;
margin-left: 16px;
}
</style>
@@ -384,7 +384,7 @@
line-height: 40px;
.header-text {
font-size: 16px;
font-size: 18px;
font-weight: 400;
color: #000F16;
}
@@ -478,7 +478,7 @@
line-height: 40px;
.header-text {
font-size: 16px;
font-size: 18px;
font-weight: 400;
color: #000F16;
}
@@ -223,7 +223,7 @@
line-height: 40px;
.header-text {
font-size: 16px;
font-size: 18px;
font-weight: 400;
color: #000F16;
}
@@ -238,7 +238,7 @@
line-height: 40px;
.header-text {
font-size: 16px;
font-size: 18px;
font-weight: 400;
color: #000F16;
}
@@ -111,7 +111,7 @@
line-height: 80px;
.header-text {
font-size: 16px;
font-size: 18px;
font-weight: 400;
color: #000F16;
}
@@ -127,7 +127,7 @@
line-height: 40px;
.header-text {
font-size: 16px;
font-size: 18px;
font-weight: 400;
color: #000F16;
}
@@ -325,7 +325,7 @@
line-height: 40px;
.header-text {
font-size: 16px;
font-size: 18px;
font-weight: 400;
color: #000F16;
}
@@ -116,7 +116,7 @@
line-height: 40px;
.header-text {
font-size: 16px;
font-size: 18px;
font-weight: 400;
color: #000F16;
}
@@ -110,7 +110,7 @@
line-height: 40px;
.header-text {
font-size: 16px;
font-size: 18px;
font-weight: 400;
color: #000F16;
}
@@ -339,7 +339,7 @@
})
} else {
this.loading = false
this.$message.warning(this.$t('operationFailed'))
this.$message.warning(res.message)
}
})
}
@@ -268,7 +268,7 @@
}
} else {
this.loading = false
this.$message.warning(this.$t('operationFailed'))
this.$message.warning(res.message)
}
})
},
@@ -209,7 +209,7 @@
})
} else {
this.loading = false
this.$message.warning(this.$t('operationFailed'))
this.$message.warning(res.message)
}
})
}
@@ -367,7 +367,7 @@
this.edit()
} else {
this.loading = false
this.$message.warning(this.$t('operationFailed'))
this.$message.warning(res.message)
}
})
},
@@ -5,7 +5,7 @@
{{$t('basicInformationOfParameters')}}
</div>
<div class="header-tight">
<a-button v-if="this.$route.query.studioEngineer == this.userInfo().id" class="box-button"
<a-button v-if="this.$route.query.studioEngineer == this.userInfo().id || administrators" class="box-button"
style="line-height: 32px" @click="edit">
{{$t('edit')}}
</a-button>
@@ -115,7 +115,8 @@
{{$t('regulatoryCertificationTaskPlan')}}
</div>
<div class="header-tight">
<a-button class="box-button" v-if="this.$route.query.studioEngineer == this.userInfo().id"
<a-button class="box-button"
v-if="this.$route.query.studioEngineer == this.userInfo().id || administrators"
style="line-height: 32px"
@click="settingClick">{{$t('setting')}}
</a-button>
@@ -183,6 +184,7 @@
data() {
return {
queryForm: {},
administrators:false,
activeKey: this.$t('CurrentStatusOfTheProject'),
url: {
queryById: 'project/projectLibraryBase/queryById',
@@ -199,6 +201,14 @@
mounted() {
this.getForm()
this.getSetting()
this.administrators = false
if (this.userInfo().userRoleList && this.userInfo().userRoleList.length > 0) {
this.userInfo().userRoleList.forEach(res => {
if (res.roleCode == 'admin') {
this.administrators = true
}
})
}
},
methods: {
...mapGetters(['userInfo']),
@@ -173,7 +173,8 @@
</div>
</div>
<div v-if="!isDisplay" style="float: right;margin-top: 1px;margin-bottom: 0px">
<div @click="handleExport" v-has="'projectLawsInventory:exportData'" v-if="isRoleSwitching"
<div @click="handleExport" v-has="'projectLawsInventory:exportData'"
v-if="isRoleSwitching || formInlineRoleSwitching.roleSwitchingCode == '12'"
class="operator-text">
<a-icon type="export" :rotate="-90"/>
{{ $t('export') }}
@@ -83,14 +83,14 @@
</div>
<div class="operator-text"
v-has="'projectRelatedPersonnel:importExcel'"
v-if="this.$route.query.studioEngineer == this.userInfo().id">
v-if="this.$route.query.studioEngineer == this.userInfo().id || administrators">
<ImportFile :url="url" :projectId="$route.query.id" :isTrue="true" :accept="'.xls'"
@getList="getPersonnelList"/>
</div>
<div class="operator-text"
@click="batSettingClick"
v-has="'projectRelatedPersonnel:setting'"
v-if="this.$route.query.studioEngineer == this.userInfo().id">
v-if="this.$route.query.studioEngineer == this.userInfo().id || administrators">
<a-icon type="setting"/>
{{$t('batSetting')}}
</div>
@@ -388,13 +388,15 @@
queryCertificationEngineer: '/project/projectRelatedPersonnel/queryCertificationEngineer'
},
selectedRowKeys: [],
dictOptionsValue: []
dictOptionsValue: [],
administrators: false
}
},
computed: {
columns() {
let columnResult = JSON.parse(JSON.stringify(this.columnsAll))
if (this.$route.query.studioEngineer != this.userInfo().id) {
if (this.$route.query.studioEngineer == this.userInfo().id || this.administrators) {
} else {
for (var i = 0; i < columnResult.length; i++) {
if (columnResult[i].title === this.$t('operation')) {
columnResult.splice(i, 1)
@@ -441,6 +443,14 @@
getData() {
this.visible = true
this.queryParam = {}
this.administrators = false
if (this.userInfo().userRoleList && this.userInfo().userRoleList.length > 0) {
this.userInfo().userRoleList.forEach(res => {
if (res.roleCode == 'admin') {
this.administrators = true
}
})
}
this.getList()
this.queryCertificationEngineer()
},
@@ -139,7 +139,7 @@
</a>
<a class="text-operation"
v-has="'projectLibraryBase:delete'"
v-if="record.createBy == userInfoQuery.username"
v-if="record.createBy == userInfoQuery.username || administrators"
@click="deleteLib(record)">{{$t('deleteLib')}}</a>
<!-- <a class="text-operation" @click="entryNameClick(record)">{{$t('see')}}</a>-->
</span>
@@ -264,12 +264,21 @@
}
],
userInfoQuery: {},
queryParam: {}
queryParam: {},
administrators: false
}
},
mounted() {
this.getList()
this.userInfoQuery = this.userInfo()
this.administrators = false
if (this.userInfo().userRoleList && this.userInfo().userRoleList.length > 0) {
this.userInfo().userRoleList.forEach(res => {
if (res.roleCode == 'admin') {
this.administrators = true
}
})
}
},
methods: {
...mapGetters(['userInfo']),
+92 -69
View File
@@ -21,29 +21,32 @@
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<!-- v-if="!disabled"-->
<!-- v-if="!disabled"-->
<a-form-item :label="$t('userAccount')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('enterUserAccount')" v-decorator.trim="[ 'username', validatorRules.username]" :disabled='isdisabled'
<a-input :placeholder="$t('enterUserAccount')" v-decorator.trim="[ 'username', validatorRules.username]"
:disabled='isdisabled'
:readOnly="!!model.id"/>
</a-form-item>
<!-- v-if="!model.id && !disabled"-->
<!-- v-if="!model.id && !disabled"-->
<template>
<!-- <a-form-item :label="$t('LoginPassword')" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
<!-- <a-input type="password" :placeholder="$t('enterLoginPassword')" autocomplete='new-password'-->
<!-- v-decorator="[ 'password',validatorRules.password]"/>-->
<!-- </a-form-item>-->
<!-- v-if="!disabled"-->
<!-- <a-form-item :label="$t('ConfirmPassword')" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
<!-- <a-input type="password" @blur="handleConfirmBlur" :placeholder="$t('reenterLoginPassword')"-->
<!-- v-decorator="[ 'confirmpassword', validatorRules.confirmpassword]"/>-->
<!-- </a-form-item>-->
<!-- <a-form-item :label="$t('LoginPassword')" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
<!-- <a-input type="password" :placeholder="$t('enterLoginPassword')" autocomplete='new-password'-->
<!-- v-decorator="[ 'password',validatorRules.password]"/>-->
<!-- </a-form-item>-->
<!-- v-if="!disabled"-->
<!-- <a-form-item :label="$t('ConfirmPassword')" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
<!-- <a-input type="password" @blur="handleConfirmBlur" :placeholder="$t('reenterLoginPassword')"-->
<!-- v-decorator="[ 'confirmpassword', validatorRules.confirmpassword]"/>-->
<!-- </a-form-item>-->
</template>
<!-- v-if="!disabled"-->
<!-- v-if="!disabled"-->
<a-form-item :label="$t('userName')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('enterUserName')" :disabled='isdisabled' v-decorator.trim="[ 'realname', validatorRules.realname]"/>
<a-input :placeholder="$t('enterUserName')" :disabled='isdisabled'
v-decorator.trim="[ 'realname', validatorRules.realname]"/>
</a-form-item>
<a-form-item :label="$t('position')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input type="textarea" style='height: 100px' :placeholder="$t('pleaseEnter')+$t('position')" :disabled='isdisabled' v-decorator.trim="[ 'jobTitle', validatorRules.jobTitle]"/>
<a-input type="textarea" style='height: 100px' :placeholder="$t('pleaseEnter')+$t('position')"
:disabled='isdisabled' v-decorator.trim="[ 'jobTitle', validatorRules.jobTitle]"/>
</a-form-item>
<!--<a-form-item label="工号" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
@@ -53,9 +56,9 @@
<!--<a-form-item label="职务" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
<!--<j-select-position placeholder="请选择职务" :multiple="false" v-decorator="['post', {}]"/>-->
<!--</a-form-item>-->
<!-- v-show="!roleDisabled"-->
<!-- v-show="!roleDisabled"-->
<a-form-item :label="$t('RoleAssignment')" :labelCol="labelCol" :wrapperCol="wrapperCol"
>
>
<a-select
mode="multiple"
style="width: 100%"
@@ -63,7 +66,7 @@
:placeholder="$t('selectUserRole')"
optionFilterProp="children"
v-model="selectedRole"
:disabled='isdisabled'
:disabled='false'
:getPopupContainer="(target) => target.parentNode">
<a-select-option v-for="(role,roleindex) in roleList" :key="roleindex.toString()" :value="role.id">
{{ role.roleName }}
@@ -72,9 +75,9 @@
</a-form-item>
<!--部门分配-->
<!-- v-show="!departDisabled && !disabled"-->
<!-- v-show="!departDisabled && !disabled"-->
<a-form-item :label="$t('DepartmentAllocation')" :labelCol="labelCol" :wrapperCol="wrapperCol"
>
>
<a-input-search
:placeholder="$t('ClickSelectDepartment')"
v-model="checkedDepartNameString"
@@ -101,34 +104,34 @@
<!--</a-form-item>-->
<!-- update--begin--autor:wangshuai-----date:20200108------for:新增身份和负责部门------ -->
<!-- v-if="!disabled"-->
<!-- <a-form-item :label="$t('identity')" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
<!-- <a-radio-group-->
<!-- v-model="identity"-->
<!-- @change="identityChange">-->
<!-- <a-radio value="1">{{$t('OrdinaryUsers')}}</a-radio>-->
<!-- <a-radio value="2">{{$t('superior')}}</a-radio>-->
<!-- </a-radio-group>-->
<!-- </a-form-item>-->
<!-- v-if="departIdShow==true && !disabled"-->
<!-- <a-form-item :label="$t('ResponsibleDepartment')" :labelCol="labelCol" :wrapperCol="wrapperCol"-->
<!-- >-->
<!-- <a-select-->
<!-- :disabled="disabled"-->
<!-- mode="multiple"-->
<!-- style="width: 100%"-->
<!-- :placeholder="$t('selectResponsibleDepartment')"-->
<!-- v-model="departIds"-->
<!-- optionFilterProp="children"-->
<!-- :getPopupContainer="(target) => target.parentNode"-->
<!-- :dropdownStyle="{maxHeight:'200px',overflow:'auto'}"-->
<!-- >-->
<!-- <a-select-option v-for="item in resultDepartOptions" :key="item.key" :value="item.key"-->
<!-- >{{item.title}}-->
<!-- </a-select-option-->
<!-- >-->
<!-- </a-select>-->
<!-- </a-form-item>-->
<!-- v-if="!disabled"-->
<!-- <a-form-item :label="$t('identity')" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
<!-- <a-radio-group-->
<!-- v-model="identity"-->
<!-- @change="identityChange">-->
<!-- <a-radio value="1">{{$t('OrdinaryUsers')}}</a-radio>-->
<!-- <a-radio value="2">{{$t('superior')}}</a-radio>-->
<!-- </a-radio-group>-->
<!-- </a-form-item>-->
<!-- v-if="departIdShow==true && !disabled"-->
<!-- <a-form-item :label="$t('ResponsibleDepartment')" :labelCol="labelCol" :wrapperCol="wrapperCol"-->
<!-- >-->
<!-- <a-select-->
<!-- :disabled="disabled"-->
<!-- mode="multiple"-->
<!-- style="width: 100%"-->
<!-- :placeholder="$t('selectResponsibleDepartment')"-->
<!-- v-model="departIds"-->
<!-- optionFilterProp="children"-->
<!-- :getPopupContainer="(target) => target.parentNode"-->
<!-- :dropdownStyle="{maxHeight:'200px',overflow:'auto'}"-->
<!-- >-->
<!-- <a-select-option v-for="item in resultDepartOptions" :key="item.key" :value="item.key"-->
<!-- >{{item.title}}-->
<!-- </a-select-option-->
<!-- >-->
<!-- </a-select>-->
<!-- </a-form-item>-->
<!-- update--end--autor:wangshuai-----date:20200108------for:新增身份和负责部门------ -->
<!-- <a-form-item label="头像" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
<!-- <j-image-upload class="avatar-uploader" text="上传" v-model="fileList" ></j-image-upload>-->
@@ -141,20 +144,21 @@
<!--v-decorator="['birthday', {initialValue:!model.birthday?null:moment(model.birthday,dateFormat)}]"-->
<!--:getCalendarContainer="node => node.parentNode"/>-->
<!--</a-form-item>-->
<!-- v-if="!disabled"-->
<!-- <a-form-item :label="$t('Gender')" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
<!-- <a-select v-decorator="[ 'sex', {}]" :placeholder="$t('selectGender')"-->
<!-- :getPopupContainer="(target) => target.parentNode">-->
<!-- <a-select-option :value="1">{{$t('male')}}</a-select-option>-->
<!-- <a-select-option :value="2">{{$t('female')}}</a-select-option>-->
<!-- </a-select>-->
<!-- </a-form-item>-->
<!-- v-if="!disabled"-->
<!-- v-if="!disabled"-->
<!-- <a-form-item :label="$t('Gender')" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
<!-- <a-select v-decorator="[ 'sex', {}]" :placeholder="$t('selectGender')"-->
<!-- :getPopupContainer="(target) => target.parentNode">-->
<!-- <a-select-option :value="1">{{$t('male')}}</a-select-option>-->
<!-- <a-select-option :value="2">{{$t('female')}}</a-select-option>-->
<!-- </a-select>-->
<!-- </a-form-item>-->
<!-- v-if="!disabled"-->
<a-form-item :label="$t('mailbox')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('enterEmailAddress')" v-decorator="[ 'email', validatorRules.email]" :disabled='isdisabled'/>
<a-input :placeholder="$t('enterEmailAddress')" v-decorator="[ 'email', validatorRules.email]"
:disabled='isdisabled'/>
</a-form-item>
<!-- v-if="!disabled"-->
<!-- :disabled="isDisabledAuth('user:form:phone')"-->
<!-- v-if="!disabled"-->
<!-- :disabled="isDisabledAuth('user:form:phone')"-->
<a-form-item :label="$t('phoneNumber')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('enterMobileNumber')" :disabled='isdisabled'
v-decorator="[ 'telephone', validatorRules.telephone]"/>
@@ -173,11 +177,11 @@
<depart-window ref="departWindow" @ok="modalFormOk"></depart-window>
<div class="drawer-bootom-button" v-show="!disableSubmit">
<!-- <a-popconfirm :title="$t('AreYouWantDiscardEditing')" @confirm="handleCancel" :okText="$t('determine')"-->
<!-- :cancelText="$t('cancel')">-->
<a-button style="margin-right: .8rem" @click="handleSubmit">{{$t('cancel')}}</a-button>
<!-- </a-popconfirm>-->
<!-- <a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>-->
<!-- <a-popconfirm :title="$t('AreYouWantDiscardEditing')" @confirm="handleCancel" :okText="$t('determine')"-->
<!-- :cancelText="$t('cancel')">-->
<a-button style="margin-right: .8rem" @click="handleSubmit">{{$t('cancel')}}</a-button>
<!-- </a-popconfirm>-->
<a-button @click="handleSubmitOk" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>
</div>
</a-drawer>
</template>
@@ -189,7 +193,7 @@
// 引入搜索部门弹出框的组件
import departWindow from './DepartWindow'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import { getAction } from '@/api/manage'
import { getAction, postAction } from '@/api/manage'
import { addUser, editUser, queryUserRole, queryall } from '@/api/api'
import { disabledAuthFilter } from '@/utils/authFilter'
import { duplicateCheck } from '@/api/api'
@@ -347,6 +351,25 @@
}
})
},
handleSubmitOk() {
this.confirmLoading = true
let selectedRole = JSON.parse(JSON.stringify(this.selectedRole))
let param = {
ids: this.userId,
selectedroles: selectedRole.join(',')
}
postAction('/sys/user/setRole', param).then((res) => {
if (res.success) {
this.$emit('ok')
this.confirmLoading = false
this.visible = false
this.$message.success(res.message)
} else {
this.confirmLoading = false
this.$message.warning(res.message)
}
})
},
refresh() {
this.selectedDepartKeys = []
this.checkedDepartKeys = []
@@ -383,7 +406,7 @@
that.visible = true
that.model = Object.assign({}, record)
that.$nextTick(() => {
that.form.setFieldsValue(pick(this.model, 'username', 'sex', 'realname', 'jobTitle','email', 'phone', 'activitiSync', 'workNo', 'telephone', 'post'))
that.form.setFieldsValue(pick(this.model, 'username', 'sex', 'realname', 'jobTitle', 'email', 'phone', 'activitiSync', 'workNo', 'telephone', 'post'))
})
//身份为上级显示负责部门,否则不显示
if (this.model.userIdentity == '2') {
@@ -728,7 +751,7 @@
.drawer-bootom-button {
position: absolute;
bottom: -8px;
z-index:100;
z-index: 100;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
@@ -740,6 +763,6 @@
</style>
<style>
.selectUserRole .ant-select-selection--multiple {
height: 100px!important;
height: 100px !important;
}
</style>