Merge remote-tracking branch 'origin/fix_2nd_period' into fix_2nd_period

This commit is contained in:
zyx.net
2022-12-30 14:07:28 +08:00
9 changed files with 143 additions and 13 deletions
@@ -198,7 +198,7 @@ public class ParamsReportEOController extends JeroController<ParamsReportEO, IPa
if(dictModelList.size() != 0){
StringBuilder sb = new StringBuilder();
for (DictModel dictModel : dictModelList) {
if(CutEnum.CN.getValue().equals(paramsReportEO)){
if(CutEnum.CN.getValue().equals(paramsReportEO.getCut())){
sb.append(dictModel.getText()+",");
}else{
sb.append(dictModel.getTextEn()+",");
@@ -52,4 +52,16 @@ public class ProjectUserPermissionController extends JeroController<ProjectUserP
}
/**
* 判断当前用户是否拥有法规技术评估/法规意见收集中结束流程或发起补充流程的操作按钮
* @param type
* @param id
* @return
*/
@GetMapping(value = "/hasProcessControlButton")
public boolean hasProcessControlButton(@RequestParam(name="type",required=true)String type,
@RequestParam(name="id",required=true)String id){
return projectUserPermissionService.hasProcessControlButton(type,id);
}
}
@@ -140,6 +140,8 @@ public class ProjectLibraryBase implements Comparable<ProjectLibraryBase> {
@TableField(exist = false)
private String brandText;
@TableField(exist = false)
private String brandTextEn;
@Override
public int compareTo(ProjectLibraryBase o) {
@@ -0,0 +1,34 @@
package com.jero.modules.project.enums;
public enum ProcessControlButtonTypeEnum {
LawsOpinionGather("法规意见收集","LawsOpinionGather"),
LawsTechnologyEvaluation("法规技术评估","LawsTechnologyEvaluation");
String label;
String value;
ProcessControlButtonTypeEnum() {
}
ProcessControlButtonTypeEnum(String label, String value) {
this.label = label;
this.value = value;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
@@ -52,7 +52,8 @@
plb.sort,
plb.flag,
plb.brand,
sdi.item_text brandText
sdi.item_text brandText,
sdi.en_name brandTextEn
from project_library_base as plb
left join project_name_info as pni on plb.project_name_id=pni.id
left join sys_user as studiouser on plb.studio_engineer=studiouser.id
@@ -227,6 +228,11 @@
and plb.project_status like concat('%',#{projectLibraryBase.projectStatus},'%')
</if>
<!--搜索条件:品牌-->
<if test="projectLibraryBase.brand != null and projectLibraryBase.brand != '' ">
and plb.brand = #{projectLibraryBase.brand}
</if>
<if test="projectLibraryBase.studioEngineer != null and projectLibraryBase.studioEngineer != ''">
<!--搜索条件:studio工程师,包含%,单独搜索-->
<choose>
@@ -73,4 +73,11 @@ public interface IProjectUserPermissionService extends IService<ProjectUserPermi
*/
void sync();
/**
* 判断当前用户是否拥有法规技术评估/法规意见收集中结束流程或发起补充流程的操作按钮
* @param type
* @param id
* @return
*/
boolean hasProcessControlButton(String type, String id);
}
@@ -3,10 +3,18 @@ package com.jero.modules.project.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jero.common.api.vo.Result;
import com.jero.common.system.vo.LoginUser;
import com.jero.modules.cert.collect.entity.ParamsCollectManifestEO;
import com.jero.modules.cert.collect.mapper.ParamsCollectManifestEOMapper;
import com.jero.modules.lawsOpinionGather.entity.LawsOpinionGatherEO;
import com.jero.modules.lawsOpinionGather.service.ILawsOpinionGatherEOService;
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationEO;
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationFlowDetailEO;
import com.jero.modules.lawsTechnologyEvaluation.service.ILawsTechnologyEvaluationEOService;
import com.jero.modules.lawsTechnologyEvaluation.service.ILawsTechnologyEvaluationFlowDetailEOService;
import com.jero.modules.project.entity.*;
import com.jero.modules.project.enums.PermissionDescriptionEnum;
import com.jero.modules.project.enums.ProcessControlButtonTypeEnum;
import com.jero.modules.project.enums.ProjectUserLocationEnum;
import com.jero.modules.project.mapper.ProjectUserPermissionMapper;
import com.jero.modules.project.service.*;
@@ -16,6 +24,7 @@ import com.jero.modules.wkflow.enums.DesignComplianceNodeEnum;
import com.jero.modules.wkflow.enums.FlowTypeEnum;
import com.jero.modules.wkflow.feginClient.WorkFlowFeignClient;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -49,7 +58,12 @@ public class ProjectUserPermissionServiceImpl extends ServiceImpl<ProjectUserPer
private IProjectTaskInventoryDetailEOService projectTaskInventoryDetailEOService;
@Autowired
private WorkFlowFeignClient workFlowFeignClient;
@Autowired
private ILawsOpinionGatherEOService lawsOpinionGatherEOService;
@Autowired
private ILawsTechnologyEvaluationEOService lawsTechnologyEvaluationEOService;
@Autowired
private ILawsTechnologyEvaluationFlowDetailEOService lawsTechnologyEvaluationFlowDetailEOService;
/**
* 保存
@@ -309,4 +323,65 @@ public class ProjectUserPermissionServiceImpl extends ServiceImpl<ProjectUserPer
permissionList.add(permission);
}
/**
* 判断当前用户是否拥有法规技术评估/法规意见收集中结束流程或发起补充流程的操作按钮
* @param type
* @param id
* @return
*/
@Override
public boolean hasProcessControlButton(String type, String id) {
boolean hasProcessControlButton = true;
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
//是否是管理员
boolean administrator = sysUserService.isAdministrator();
//是否是viewer
boolean viewer = sysUserService.isViewer(currentUser.getId());
if (administrator || !viewer) {
return true;
}
if (ProcessControlButtonTypeEnum.LawsOpinionGather.getValue().equals(type)) {
//法规意见收集
LawsOpinionGatherEO lawsOpinionGatherEO = lawsOpinionGatherEOService.queryById(id);
if (ObjectUtils.isEmpty(lawsOpinionGatherEO)) {
return false;
}
boolean eva = true;
if (ObjectUtils.isEmpty(lawsOpinionGatherEO.getEvaluatorIds()) || (ObjectUtils.isNotEmpty(lawsOpinionGatherEO.getEvaluatorIds()) && !lawsOpinionGatherEO.getEvaluatorIds().contains(currentUser.getId()))) {
eva = false;
}
if (!lawsOpinionGatherEO.getCreateBy().equals(currentUser.getUsername())
&& !eva
&& viewer) {
hasProcessControlButton = false;
}
} else if (ProcessControlButtonTypeEnum.LawsTechnologyEvaluation.getValue().equals(type)) {
//法规技术评估
LawsTechnologyEvaluationEO lawsTechnologyEvaluationEO = lawsTechnologyEvaluationEOService.queryById(id);
if (ObjectUtils.isEmpty(lawsTechnologyEvaluationEO)) {
return false;
}
QueryWrapper<LawsTechnologyEvaluationFlowDetailEO> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("laws_technology_evaluation_id", id);
List<LawsTechnologyEvaluationFlowDetailEO> flowDetailEOS = lawsTechnologyEvaluationFlowDetailEOService.list(queryWrapper);
if (ObjectUtils.isEmpty(flowDetailEOS)) {
return false;
}
boolean eva = true;
if (ObjectUtils.isEmpty(flowDetailEOS.get(0).getEvaluatorId()) || (ObjectUtils.isNotEmpty(flowDetailEOS.get(0).getEvaluatorId()) && !flowDetailEOS.get(0).getEvaluatorId().contains(currentUser.getId()))) {
eva = false;
}
if (!lawsTechnologyEvaluationEO.getCreateBy().equals(currentUser.getUsername())
&& !eva
&& viewer) {
hasProcessControlButton = false;
}
} else {
hasProcessControlButton = false;
}
return hasProcessControlButton;
}
}
@@ -8,7 +8,7 @@
<!-- </span>-->
{{$route.query.serialNumber +' '+$t('evaluationResults')}}
</div>
<div class="doc-detail-right" v-if='!this.flag'>
<div class="doc-detail-right" v-if='flag'>
<div @click="endProcessClick"
v-if="(formInline.createBy == this.userInfoQuery.username || administrators) && formInline.gatherResult == 'Underway'"
class="operator-text-text" :title="$t('endProcess')">
@@ -92,7 +92,7 @@
total: 0,
pageSize: 10,
pageNo: 1,
flag:'',
flag:false,
dataSource: [],
formInline: {},
administrators:false,
@@ -163,10 +163,7 @@
})
}
getAction('/project/projectUserPermission/hasProcessControlButton', {type: 'LawsOpinionGather',id : this.$route.query.id}).then((res) => {
if (res.success) {
this.flag = res
} else {
}
})
},
methods: {
@@ -8,7 +8,7 @@
<!-- </span>-->
{{$route.query.serialNumber +' '+$t('regulatoryTechnicalEvaluationResults')}}
</div>
<div class="doc-detail-right" v-if='!this.flag'>
<div class="doc-detail-right" v-if='flag'>
<div @click="CurrentStandard" class="operator-text-text" :title="$t('initiateSupplementaryProcess')">
<a-icon type="profile"/>
{{$t('initiateSupplementaryProcess')}}
@@ -96,7 +96,7 @@
return {
queryParam: {},
dataSource: [],
flag:'',
flag:false,
userInfoQuery: {},
administrators: false,
url: {
@@ -182,10 +182,7 @@
})
}
getAction('/project/projectUserPermission/hasProcessControlButton', {type: 'LawsTechnologyEvaluation',id : this.$route.query.id}).then((res) => {
if (res.success) {
this.flag = res
} else {
}
})
},
methods: {