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

This commit is contained in:
wangzhijiang
2022-12-30 14:08:43 +08:00
15 changed files with 182 additions and 17 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">
<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,6 +92,7 @@
total: 0,
pageSize: 10,
pageNo: 1,
flag:false,
dataSource: [],
formInline: {},
administrators:false,
@@ -161,6 +162,9 @@
}
})
}
getAction('/project/projectUserPermission/hasProcessControlButton', {type: 'LawsOpinionGather',id : this.$route.query.id}).then((res) => {
this.flag = res
})
},
methods: {
...mapGetters(['userInfo']),
@@ -8,7 +8,7 @@
<!-- </span>-->
{{$route.query.serialNumber +' '+$t('regulatoryTechnicalEvaluationResults')}}
</div>
<div class="doc-detail-right">
<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,6 +96,7 @@
return {
queryParam: {},
dataSource: [],
flag:false,
userInfoQuery: {},
administrators: false,
url: {
@@ -180,6 +181,9 @@
}
})
}
getAction('/project/projectUserPermission/hasProcessControlButton', {type: 'LawsTechnologyEvaluation',id : this.$route.query.id}).then((res) => {
this.flag = res
})
},
methods: {
...mapGetters(['userInfo']),
@@ -328,6 +328,8 @@ export default {
uploadMenuId: '',
selectedKeys: [],
deleteNode: false,
moveDownFlag: false,
moveUpFlag: false,
fullWidth: '',
parameter: {},
widthBrown: '',
@@ -495,6 +497,8 @@ export default {
rightClick({ event, node }) {
this.deleteNode = node._props.dataRef.pid ? true : false
this.moveDownFlag = node._props.dataRef.moveDownFlag == true ? true : false
this.moveUpFlag = node._props.dataRef.moveUpFlag == true ? true : false
// console.log('eee',event,node)
// this.NodeTreeItemVisible=true
const x =
@@ -189,6 +189,7 @@
data() {
return {
queryForm: {},
cut:'',
administrators:false,
activeKey: this.$t('CurrentStatusOfTheProject'),
url: {
@@ -220,7 +221,13 @@
getForm() {
getAction(this.url.queryById, { id: this.$route.query.id }).then((res) => {
if (res.success) {
this.cut = res.cut
this.queryForm = res.result[0] || {}
if(this.cut == 'en'){
this.queryForm.brandText = this.queryForm.brandTextEn
}else{
this.queryForm.brandText = this.queryForm.brandText
}
} else {
this.queryForm = {}
}
@@ -290,6 +290,7 @@
queryParam: {},
orderBy: '1',
orderByField: '',
cut: '',
administrators: false
}
},
@@ -442,8 +443,17 @@
this.getList()
return
}
this.dataSource = res.result.records || []
this.total = res.result.total
this.cut = res.cut
this.dataSource = res.result.records || []
this.dataSource.forEach((item) => {
if(this.cut == 'en'){
item.brandText = item.brandTextEn
}else{
item.brandText = item.brandText
}
})
this.loading = false
} else {
this.loading = false
@@ -298,10 +298,11 @@ export default {
},
//虚拟清单名称事件
entryNameClick(item) {
this.$router.push({
path: '/ParameterTemplateList',
let newUrl = this.$router.resolve({
path: '/docManage/library/detail',
query: item
})
window.open(newUrl.href, '_blank')
},
searchQuery() {
this.pageNo = 1
@@ -145,13 +145,13 @@ import { ACCESS_TOKEN } from '@/store/mutation-types'
ellipsis: true,
scopedSlots: { customRender: 'msgTitile' }
},
{
title: this.$t('Sponsor'),
align: 'left',
ellipsis: true,
dataIndex: 'initiator',
width: 200
},
// {
// title: this.$t('Sponsor'),
// align: 'left',
// ellipsis: true,
// dataIndex: 'initiator',
// width: 200
// },
{
title: this.$t('MessageType'),
align: 'left',
@@ -419,7 +419,6 @@
})
},
selectChange(value){
console.log(value,"value",this.roleList)
value.map((item,index) => {
this.roleList.map((val,index) => {
if(val.roleCode == 'Viewer' && item == val.id){
@@ -429,8 +428,8 @@
})
return
} else if(val.roleCode == 'BrandAdministrator' && item == val.id) {
this.brands = []
this.$nextTick(() => {
this.brands = []
this.viewshowbrand = true
})
return