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){ if(dictModelList.size() != 0){
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
for (DictModel dictModel : dictModelList) { for (DictModel dictModel : dictModelList) {
if(CutEnum.CN.getValue().equals(paramsReportEO)){ if(CutEnum.CN.getValue().equals(paramsReportEO.getCut())){
sb.append(dictModel.getText()+","); sb.append(dictModel.getText()+",");
}else{ }else{
sb.append(dictModel.getTextEn()+","); 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) @TableField(exist = false)
private String brandText; private String brandText;
@TableField(exist = false)
private String brandTextEn;
@Override @Override
public int compareTo(ProjectLibraryBase o) { 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.sort,
plb.flag, plb.flag,
plb.brand, plb.brand,
sdi.item_text brandText sdi.item_text brandText,
sdi.en_name brandTextEn
from project_library_base as plb from project_library_base as plb
left join project_name_info as pni on plb.project_name_id=pni.id 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 left join sys_user as studiouser on plb.studio_engineer=studiouser.id
@@ -227,6 +228,11 @@
and plb.project_status like concat('%',#{projectLibraryBase.projectStatus},'%') and plb.project_status like concat('%',#{projectLibraryBase.projectStatus},'%')
</if> </if>
<!--搜索条件:品牌-->
<if test="projectLibraryBase.brand != null and projectLibraryBase.brand != '' ">
and plb.brand = #{projectLibraryBase.brand}
</if>
<if test="projectLibraryBase.studioEngineer != null and projectLibraryBase.studioEngineer != ''"> <if test="projectLibraryBase.studioEngineer != null and projectLibraryBase.studioEngineer != ''">
<!--搜索条件:studio工程师,包含%,单独搜索--> <!--搜索条件:studio工程师,包含%,单独搜索-->
<choose> <choose>
@@ -73,4 +73,11 @@ public interface IProjectUserPermissionService extends IService<ProjectUserPermi
*/ */
void sync(); 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.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jero.common.api.vo.Result; 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.entity.ParamsCollectManifestEO;
import com.jero.modules.cert.collect.mapper.ParamsCollectManifestEOMapper; 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.entity.*;
import com.jero.modules.project.enums.PermissionDescriptionEnum; 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.enums.ProjectUserLocationEnum;
import com.jero.modules.project.mapper.ProjectUserPermissionMapper; import com.jero.modules.project.mapper.ProjectUserPermissionMapper;
import com.jero.modules.project.service.*; 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.enums.FlowTypeEnum;
import com.jero.modules.wkflow.feginClient.WorkFlowFeignClient; import com.jero.modules.wkflow.feginClient.WorkFlowFeignClient;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -49,7 +58,12 @@ public class ProjectUserPermissionServiceImpl extends ServiceImpl<ProjectUserPer
private IProjectTaskInventoryDetailEOService projectTaskInventoryDetailEOService; private IProjectTaskInventoryDetailEOService projectTaskInventoryDetailEOService;
@Autowired @Autowired
private WorkFlowFeignClient workFlowFeignClient; 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); 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>--> <!-- </span>-->
{{$route.query.serialNumber +' '+$t('evaluationResults')}} {{$route.query.serialNumber +' '+$t('evaluationResults')}}
</div> </div>
<div class="doc-detail-right"> <div class="doc-detail-right" v-if='flag'>
<div @click="endProcessClick" <div @click="endProcessClick"
v-if="(formInline.createBy == this.userInfoQuery.username || administrators) && formInline.gatherResult == 'Underway'" v-if="(formInline.createBy == this.userInfoQuery.username || administrators) && formInline.gatherResult == 'Underway'"
class="operator-text-text" :title="$t('endProcess')"> class="operator-text-text" :title="$t('endProcess')">
@@ -92,6 +92,7 @@
total: 0, total: 0,
pageSize: 10, pageSize: 10,
pageNo: 1, pageNo: 1,
flag:false,
dataSource: [], dataSource: [],
formInline: {}, formInline: {},
administrators:false, administrators:false,
@@ -161,6 +162,9 @@
} }
}) })
} }
getAction('/project/projectUserPermission/hasProcessControlButton', {type: 'LawsOpinionGather',id : this.$route.query.id}).then((res) => {
this.flag = res
})
}, },
methods: { methods: {
...mapGetters(['userInfo']), ...mapGetters(['userInfo']),
@@ -8,7 +8,7 @@
<!-- </span>--> <!-- </span>-->
{{$route.query.serialNumber +' '+$t('regulatoryTechnicalEvaluationResults')}} {{$route.query.serialNumber +' '+$t('regulatoryTechnicalEvaluationResults')}}
</div> </div>
<div class="doc-detail-right"> <div class="doc-detail-right" v-if='flag'>
<div @click="CurrentStandard" class="operator-text-text" :title="$t('initiateSupplementaryProcess')"> <div @click="CurrentStandard" class="operator-text-text" :title="$t('initiateSupplementaryProcess')">
<a-icon type="profile"/> <a-icon type="profile"/>
{{$t('initiateSupplementaryProcess')}} {{$t('initiateSupplementaryProcess')}}
@@ -96,6 +96,7 @@
return { return {
queryParam: {}, queryParam: {},
dataSource: [], dataSource: [],
flag:false,
userInfoQuery: {}, userInfoQuery: {},
administrators: false, administrators: false,
url: { url: {
@@ -180,6 +181,9 @@
} }
}) })
} }
getAction('/project/projectUserPermission/hasProcessControlButton', {type: 'LawsTechnologyEvaluation',id : this.$route.query.id}).then((res) => {
this.flag = res
})
}, },
methods: { methods: {
...mapGetters(['userInfo']), ...mapGetters(['userInfo']),
@@ -328,6 +328,8 @@ export default {
uploadMenuId: '', uploadMenuId: '',
selectedKeys: [], selectedKeys: [],
deleteNode: false, deleteNode: false,
moveDownFlag: false,
moveUpFlag: false,
fullWidth: '', fullWidth: '',
parameter: {}, parameter: {},
widthBrown: '', widthBrown: '',
@@ -495,6 +497,8 @@ export default {
rightClick({ event, node }) { rightClick({ event, node }) {
this.deleteNode = node._props.dataRef.pid ? true : false 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) // console.log('eee',event,node)
// this.NodeTreeItemVisible=true // this.NodeTreeItemVisible=true
const x = const x =
@@ -189,6 +189,7 @@
data() { data() {
return { return {
queryForm: {}, queryForm: {},
cut:'',
administrators:false, administrators:false,
activeKey: this.$t('CurrentStatusOfTheProject'), activeKey: this.$t('CurrentStatusOfTheProject'),
url: { url: {
@@ -220,7 +221,13 @@
getForm() { getForm() {
getAction(this.url.queryById, { id: this.$route.query.id }).then((res) => { getAction(this.url.queryById, { id: this.$route.query.id }).then((res) => {
if (res.success) { if (res.success) {
this.cut = res.cut
this.queryForm = res.result[0] || {} this.queryForm = res.result[0] || {}
if(this.cut == 'en'){
this.queryForm.brandText = this.queryForm.brandTextEn
}else{
this.queryForm.brandText = this.queryForm.brandText
}
} else { } else {
this.queryForm = {} this.queryForm = {}
} }
@@ -290,6 +290,7 @@
queryParam: {}, queryParam: {},
orderBy: '1', orderBy: '1',
orderByField: '', orderByField: '',
cut: '',
administrators: false administrators: false
} }
}, },
@@ -442,8 +443,17 @@
this.getList() this.getList()
return return
} }
this.dataSource = res.result.records || []
this.total = res.result.total 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 this.loading = false
} else { } else {
this.loading = false this.loading = false
@@ -298,10 +298,11 @@ export default {
}, },
//虚拟清单名称事件 //虚拟清单名称事件
entryNameClick(item) { entryNameClick(item) {
this.$router.push({ let newUrl = this.$router.resolve({
path: '/ParameterTemplateList', path: '/docManage/library/detail',
query: item query: item
}) })
window.open(newUrl.href, '_blank')
}, },
searchQuery() { searchQuery() {
this.pageNo = 1 this.pageNo = 1
@@ -145,13 +145,13 @@ import { ACCESS_TOKEN } from '@/store/mutation-types'
ellipsis: true, ellipsis: true,
scopedSlots: { customRender: 'msgTitile' } scopedSlots: { customRender: 'msgTitile' }
}, },
{ // {
title: this.$t('Sponsor'), // title: this.$t('Sponsor'),
align: 'left', // align: 'left',
ellipsis: true, // ellipsis: true,
dataIndex: 'initiator', // dataIndex: 'initiator',
width: 200 // width: 200
}, // },
{ {
title: this.$t('MessageType'), title: this.$t('MessageType'),
align: 'left', align: 'left',
@@ -419,7 +419,6 @@
}) })
}, },
selectChange(value){ selectChange(value){
console.log(value,"value",this.roleList)
value.map((item,index) => { value.map((item,index) => {
this.roleList.map((val,index) => { this.roleList.map((val,index) => {
if(val.roleCode == 'Viewer' && item == val.id){ if(val.roleCode == 'Viewer' && item == val.id){
@@ -429,8 +428,8 @@
}) })
return return
} else if(val.roleCode == 'BrandAdministrator' && item == val.id) { } else if(val.roleCode == 'BrandAdministrator' && item == val.id) {
this.brands = []
this.$nextTick(() => { this.$nextTick(() => {
this.brands = []
this.viewshowbrand = true this.viewshowbrand = true
}) })
return return