From d6488768f8a5e09b9521aa157c552cbbf5775fb7 Mon Sep 17 00:00:00 2001 From: wangzhijiang <12345678> Date: Mon, 6 Mar 2023 18:01:10 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A4=E8=AF=81=E6=B8=85=E5=8D=95-=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E6=8E=A5=E5=8F=A3=E5=BC=80=E5=8F=91=E3=80=81=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5=E3=80=82=E6=9B=B4=E6=96=B0SQL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jero-boot/db/蔚来标准sql/dev_2nd_period.sql | 7 + ...ectCertificationInventoryEOController.java | 7 + .../entity/ProjectLibraryRoleRelEO.java | 4 + .../enums/CertificationFlowNodeEnum.java | 65 +++++++++ .../project/enums/RoleRelModelTypeEnum.java | 33 +++++ ...rojectCertificationInventoryEOService.java | 17 +++ ...ctCertificationInventoryEOServiceImpl.java | 127 +++++++++++++++++- .../modules/wkflow/enums/FlowTypeEnum.java | 1 + .../components/certificationList/index.vue | 92 ++++++++++++- 9 files changed, 349 insertions(+), 4 deletions(-) create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/CertificationFlowNodeEnum.java create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/RoleRelModelTypeEnum.java diff --git a/jero-boot/db/蔚来标准sql/dev_2nd_period.sql b/jero-boot/db/蔚来标准sql/dev_2nd_period.sql index dd954cf85..de2244b1d 100644 --- a/jero-boot/db/蔚来标准sql/dev_2nd_period.sql +++ b/jero-boot/db/蔚来标准sql/dev_2nd_period.sql @@ -287,3 +287,10 @@ INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `descri -- 项目库-认证清单表-增加项目库id 2023-03-06 未同步生产环境 ALTER TABLE `project_certification_inventory` ADD COLUMN `project_library_id` varchar(64) NULL COMMENT '项目库id' AFTER `certification_progress`; + +-- 项目库-项目与角色关系表-增加模块类型(标识)字段 2023-03-06 未同步生产环境 +ALTER TABLE `project_library_role_rel` + ADD COLUMN `model_type` varchar(64) NULL COMMENT '模块类型,对应系统中枚举类 RoleRelModelTypeEnum ' AFTER `role_code`; + +-- 初始化历史数据 +update project_library_role_rel set model_type = 'Laws inventory' diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectCertificationInventoryEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectCertificationInventoryEOController.java index 08e3207cc..756ef25d4 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectCertificationInventoryEOController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectCertificationInventoryEOController.java @@ -185,4 +185,11 @@ public class ProjectCertificationInventoryEOController extends JeroController setBatch(@RequestBody ProjectCertificationInventoryEO projectCertificationInventoryEO) { return this.projectCertificationInventoryEOService.setBatch(projectCertificationInventoryEO); } + + @AutoLog(value = "认证虚拟清单详情表-studio发布") + @ApiOperation(value="认证虚拟清单详情表-studio发布", notes="认证虚拟清单详情表-studio发布") + @PostMapping(value = "/issue") + public Result issue(@RequestBody JSONObject json) { + return this.projectCertificationInventoryEOService.issue(json); + } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectLibraryRoleRelEO.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectLibraryRoleRelEO.java index aab4a09b6..820fef884 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectLibraryRoleRelEO.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectLibraryRoleRelEO.java @@ -76,4 +76,8 @@ public class ProjectLibraryRoleRelEO implements Serializable { @ApiModelProperty(value = "角色编码") private java.lang.String roleCode; + /**模块类型,值对应枚举类 RoleRelModelTypeEnum */ + @Excel(name = "模块类型", width = 15) + @ApiModelProperty(value = "模块类型") + private String modelType; } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/CertificationFlowNodeEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/CertificationFlowNodeEnum.java new file mode 100644 index 000000000..22257da14 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/CertificationFlowNodeEnum.java @@ -0,0 +1,65 @@ +package com.jero.modules.project.enums; + +import com.alibaba.druid.util.StringUtils; +import com.jero.common.constant.enums.CutEnum; + +/** + * 认证流程 节点枚举类 + */ +public enum CertificationFlowNodeEnum { + + STUDIOFQ("studiofq","R&H Studio发起","R&H Studio initiate"), + RZGCSJSRW ("rzgcsjsrw","认证工程师接受任务","Certified engineers accept tasks"), + ZRRJSRW ("zrrjsrw","责任人接受任务","The responsible person accepts the task"), + ZRRTJRW ("zrrtjrw","责任人提交任务","The responsible person submits the task"), + RZGCSSC ("rzgcssc","认证工程师审查","Certified engineer review"), + ; + + String key; + String cnName; + String enName; + + private CertificationFlowNodeEnum(String key, String cnName, String enName) { + this.key = key; + this.cnName = cnName; + this.enName = enName; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getCnName() { + return cnName; + } + + public void setCnName(String cnName) { + this.cnName = cnName; + } + + public String getEnName() { + return enName; + } + + public void setEnName(String enName) { + this.enName = enName; + } + + public static String getTextByValue(String key,String cut) { + CertificationFlowNodeEnum[] values = values(); + for (CertificationFlowNodeEnum inventoryAffirmNodeEnum : values) { + if (inventoryAffirmNodeEnum.key.equals(key)) { + if(StringUtils.equals(cut, CutEnum.CN.getValue())){ + return inventoryAffirmNodeEnum.cnName; + }else if(StringUtils.equals(cut,CutEnum.EN.getValue())){ + return inventoryAffirmNodeEnum.enName; + } + } + } + return null; + } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/RoleRelModelTypeEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/RoleRelModelTypeEnum.java new file mode 100644 index 000000000..c6d56fa6b --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/RoleRelModelTypeEnum.java @@ -0,0 +1,33 @@ +package com.jero.modules.project.enums; + +/** + * 模块类型枚举类 + */ +public enum RoleRelModelTypeEnum { + LAWS_INVENTORY("法规清单","Laws inventory"), + CERTIFICATION_INVENTORY("认证清单","Certification inventory"), + ; + String name; + String value; + + RoleRelModelTypeEnum(String name, String value) { + this.name = name; + this.value = value; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java index ec9b7d550..9e555d330 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java @@ -4,6 +4,10 @@ import com.alibaba.fastjson.JSONObject; import com.jero.common.api.vo.Result; import com.jero.modules.project.entity.ProjectCertificationInventoryEO; import com.baomidou.mybatisplus.extension.service.IService; +import com.jero.modules.system.entity.SysCategory; +import com.jero.modules.todoCenter.entity.ProcessInfoDetailEO; +import com.jero.modules.todoCenter.entity.ProcessInfoEO; + import java.util.List; /** @@ -81,4 +85,17 @@ public interface IProjectCertificationInventoryEOService extends IService datas, String cut); + + String getTreeName(String cut, List categoryList, List technologyTerritoryList); + + /** + * studio发布 + * @param json + * @return + */ + Result issue(JSONObject json); + + void addProcessInfoEO(ProcessInfoEO processInfoEO, String projectLibraryId); + + void addProcessInfoDetailEO(List processInfoDetailEOList, ProcessInfoEO processInfoEO); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java index 47984a8a4..4dd19ac32 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java @@ -2,14 +2,17 @@ package com.jero.modules.project.service.impl; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.jero.common.api.vo.Result; import com.jero.common.constant.enums.CutEnum; import com.jero.common.exception.JeroBootException; +import com.jero.common.util.DateUtils; import com.jero.modules.project.entity.ProjectCertificationInventoryEO; -import com.jero.modules.project.enums.CertificationInventoryFlowStatusEnum; -import com.jero.modules.project.enums.ProjectInventoryFieldEnum; +import com.jero.modules.project.entity.ProjectLibraryBase; +import com.jero.modules.project.enums.*; import com.jero.modules.project.mapper.ProjectCertificationInventoryEOMapper; import com.jero.modules.project.service.IProjectCertificationInventoryEOService; +import com.jero.modules.project.service.IProjectLibraryBaseService; import com.jero.modules.system.entity.SysCategory; import com.jero.modules.system.entity.SysDictItem; import com.jero.modules.system.entity.SysUser; @@ -17,6 +20,12 @@ import com.jero.modules.system.service.ISysCategoryService; import com.jero.modules.system.service.ISysDictItemService; import com.jero.modules.system.service.ISysUserService; import com.jero.modules.system.service.impl.SysDictItemServiceImpl; +import com.jero.modules.todoCenter.entity.ProcessInfoDetailEO; +import com.jero.modules.todoCenter.entity.ProcessInfoEO; +import com.jero.modules.todoCenter.enums.TodoCenterStatusEnum; +import com.jero.modules.todoCenter.service.IProcessInfoDetailEOService; +import com.jero.modules.todoCenter.service.IProcessInfoEOService; +import com.jero.modules.wkflow.enums.FlowTypeEnum; import org.springframework.beans.BeanUtils; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -32,6 +41,7 @@ import java.util.stream.Collectors; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.ObjectUtils; /** * @Description: 项目库-认证清单表 @@ -51,6 +61,12 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl categoryList, List technologyTerritoryList) { + @Override + public String getTreeName(String cut, List categoryList, List technologyTerritoryList) { StringBuilder sb = new StringBuilder(); for (String technologyTerritory : technologyTerritoryList) { List collect = categoryList.stream().filter(e -> technologyTerritory.equals(e.getId())).collect(Collectors.toList()); @@ -244,4 +261,108 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl issue(JSONObject json) { + String ids = json.getString("ids"); + if(StringUtils.isEmpty(ids)){ + throw new JeroBootException("至少选择一条数据进行发布!"); + } + String endTime = json.getString("endTime"); + + List idList = Arrays.asList(ids.split(",")); + + // 根据页面选择的认证清单数据id,查询出状态为’清单待发布‘的数据,进行发布处理 + QueryWrapper certificationQueryWrap = new QueryWrapper<>(); + certificationQueryWrap.lambda().in(ProjectCertificationInventoryEO::getId,idList); + certificationQueryWrap.lambda().in(ProjectCertificationInventoryEO::getFlowStatus,CertificationInventoryFlowStatusEnum.LIST_TO_BE_RELEASED.getValue()); + List projectCertificationInventoryEOList = this.list(certificationQueryWrap); + + if(CollectionUtils.isEmpty(projectCertificationInventoryEOList)){ + throw new JeroBootException("无法获取要发布的数据,请重新选择!"); + } + List processInfoDetailEOList = new ArrayList<>(); + + for (ProjectCertificationInventoryEO projectCertificationInventoryEO : projectCertificationInventoryEOList) { + // 将数据的状态更新为:清单待校核,更新截止时间。等待认证工程师进行操作。 + projectCertificationInventoryEO.setFlowStatus(CertificationInventoryFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()); + projectCertificationInventoryEO.setEndTime(DateUtils.str2Date(endTime,DateUtils.date_sdf.get())); + } + + String projectLibraryId = json.getString("projectLibraryId"); + // 获取项目信息,获取认证工程师,给认证工程师分配待办任务 + ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.getBaseMapper().selectById(projectLibraryId); + if(ObjectUtils.isEmpty(projectLibraryBase)){ + throw new JeroBootException("无法获取项目信息,请稍后重试!"); + } + String certificationEngineer = projectLibraryBase.getCertificationEngineer(); + if(StringUtils.isEmpty(certificationEngineer)){ + throw new JeroBootException("该项目中认证工程师为空,请先维护认证工程师!"); + } + + List certificationEngineerList = Arrays.asList(certificationEngineer.split(",")); + // 给认证工程师分配任务 + for (String userId : certificationEngineerList) { + ProcessInfoDetailEO processInfoDetailEO = new ProcessInfoDetailEO(); + processInfoDetailEO.setUserId(userId); + processInfoDetailEO.setTaskDefinitionKey(CertificationFlowNodeEnum.RZGCSJSRW.getKey()); + processInfoDetailEO.setEndTime(DateUtils.str2Date(endTime,DateUtils.date_sdf.get())); + processInfoDetailEO.setCreateTime(new Date()); + processInfoDetailEO.setStatus(TaskStatusEnum.NOT_DONE.getValue()); + processInfoDetailEO.setProcessInfoId(projectLibraryId); + processInfoDetailEO.setActiProcInstId(projectLibraryId); + processInfoDetailEOList.add(processInfoDetailEO); + } + + ProcessInfoEO processInfoEO = new ProcessInfoEO(); + this.addProcessInfoEO(processInfoEO,projectLibraryId); + this.addProcessInfoDetailEO(processInfoDetailEOList,processInfoEO); + this.updateBatchById(projectCertificationInventoryEOList); + return Result.OK("发布成功!"); + } + + + /** + * 添加流程信息 + * @param processInfoEO + * @param projectLibraryId + */ + @Override + public void addProcessInfoEO(ProcessInfoEO processInfoEO,String projectLibraryId){ + processInfoEO.setId(projectLibraryId); + processInfoEO.setProjectLibraryId(projectLibraryId); + processInfoEO.setActiProcInstId(projectLibraryId); + processInfoEO.setFlowType(FlowTypeEnum.CERTIFICATION_LC.getValue()); + processInfoEO.setStatus(TodoCenterStatusEnum.LIST_TO_CONFIRM.getValue()); + + QueryWrapper deleteWrap = new QueryWrapper<>(); + deleteWrap.lambda().eq(ProcessInfoEO::getId,projectLibraryId); + this.processInfoEOService.remove(deleteWrap); + this.processInfoEOService.add(processInfoEO); + } + + /** + * 添加流程信息,用户的待办信息。 + * @param processInfoDetailEOList + * @param processInfoEO + */ + @Override + public void addProcessInfoDetailEO(List processInfoDetailEOList,ProcessInfoEO processInfoEO){ + processInfoDetailEOList.forEach(detail -> { + detail.setFlowType(FlowTypeEnum.CERTIFICATION_LC.getValue()); + }); + + // 删除该项目数据的待办任务,key为 认证工程师接受任务的数据 + QueryWrapper deleteDetailWrap = new QueryWrapper<>(); + deleteDetailWrap.lambda().eq(ProcessInfoDetailEO::getProcessInfoId,processInfoEO.getId()); + deleteDetailWrap.lambda().eq(ProcessInfoDetailEO::getTaskDefinitionKey,CertificationFlowNodeEnum.RZGCSJSRW.getKey()); + this.processInfoDetailEOService.remove(deleteDetailWrap); + this.processInfoDetailEOService.saveBatch(processInfoDetailEOList); + } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/enums/FlowTypeEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/enums/FlowTypeEnum.java index 5b4de5678..8a0c19dfc 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/enums/FlowTypeEnum.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/enums/FlowTypeEnum.java @@ -16,6 +16,7 @@ public enum FlowTypeEnum { FGYJSJLC("5","法规意见收集流程","FGYJSJLC","法规意见收集流程","fgyjsjlc","法规意见收集","Collection of Legislative Comments"), FGJSPG("6","法规技术评估流程","FGJSPG","法规技术评估流程","fgjspglc","法规技术评估","Regulatory and technical assessment"), QDQR("10","清单确认","QDQR","清单确认流程","qdqr","法规清单确认","Regulation list confirmation"), + CERTIFICATION_LC("21","认证流程","CERTIFICATION_LC","认证流程","certification_lc","Pre-Homo流程","Pre-Homo flow"), ; private String value; diff --git a/jero-web/src/views/projectManagement/components/certificationList/index.vue b/jero-web/src/views/projectManagement/components/certificationList/index.vue index 8c589c148..6c26e7792 100644 --- a/jero-web/src/views/projectManagement/components/certificationList/index.vue +++ b/jero-web/src/views/projectManagement/components/certificationList/index.vue @@ -160,6 +160,41 @@ + + + + + +
+
+ * + {{ $t('TaskCutOffTime') }} +
+ + + +
+
+
+
+
+
@@ -171,6 +206,7 @@ import addModel from './components/addModel' import batSetting from './components/batSetting' import { getAction, postAction, downloadFile, deleteAction } from '@/api/manage' + import moment from "moment"; export default { name: 'index', @@ -187,7 +223,20 @@ queryParam: {}, fieldList: [], queryParamQuery: {}, + formInline:{}, toggleSearchStatus: false, + confirmLoading:false, + listTitle:'', + visible:false, + rules: { + endTime: [ + { + required: true, + message: this.$t('TaskCutOffTime') + this.$t('cannotEmpty'), + trigger: 'change' + } + ], + }, url: { list: '/project/projectCertificationInventoryEO/page', exportTemplate: '', @@ -461,8 +510,49 @@ handleAdd() { this.$refs.addModelRef.addModel() }, + dateChange(item) { + this.formInline[item.db_field_name] = this.formInline[item.db_field_name] ? moment(this.formInline[item.db_field_name]).format('YYYY-MM-DD') : '' + }, releaseClick() { - + this.listTitle = this.$t('Deadline') + if(this.selectedRowKeysList.length < 1){ + this.$message.warning(this.$t('selectLeastOne')) + }else{ + this.visible = true + } + }, + handleOk() { + this.$refs.ruleForm.validate(valid => { + if (valid) { + let selectedRowKeys = [] + this.selectedRowKeysList.forEach(res => { + selectedRowKeys.push(res.id) + }) + let query = { + ids: selectedRowKeys.join(','), + projectLibraryId: this.$route.query.id, + ...this.formInline + } + this.confirmLoading = true + postAction('/project/projectCertificationInventoryEO/issue', query).then((res) => { + if (res.success) { + this.$message.success(this.$t('OperationSuccessful')) + this.visible = false + this.selectedRowKeys = [] + this.confirmLoading = false + this.getList() + } else { + this.$message.warning(this.$t('operationFailed')) + this.confirmLoading = false + } + this.detailedSuccessList = [] + }) + } + }) + }, + handleCancel() { + this.formInline = {} + this.visible = false }, withdrawClick() {