认证清单-发布接口开发、对接。更新SQL
This commit is contained in:
@@ -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'
|
||||
|
||||
+7
@@ -185,4 +185,11 @@ public class ProjectCertificationInventoryEOController extends JeroController<Pr
|
||||
public Result<?> 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);
|
||||
}
|
||||
}
|
||||
|
||||
+4
@@ -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;
|
||||
}
|
||||
|
||||
+65
@@ -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;
|
||||
}
|
||||
}
|
||||
+33
@@ -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;
|
||||
}
|
||||
}
|
||||
+17
@@ -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<Projec
|
||||
* @param cut
|
||||
*/
|
||||
void disposeData(List<ProjectCertificationInventoryEO> datas, String cut);
|
||||
|
||||
String getTreeName(String cut, List<SysCategory> categoryList, List<String> technologyTerritoryList);
|
||||
|
||||
/**
|
||||
* studio发布
|
||||
* @param json
|
||||
* @return
|
||||
*/
|
||||
Result<?> issue(JSONObject json);
|
||||
|
||||
void addProcessInfoEO(ProcessInfoEO processInfoEO, String projectLibraryId);
|
||||
|
||||
void addProcessInfoDetailEO(List<ProcessInfoDetailEO> processInfoDetailEOList, ProcessInfoEO processInfoEO);
|
||||
}
|
||||
|
||||
+124
-3
@@ -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<Proj
|
||||
private ISysDictItemService sysDictItemService;
|
||||
@Autowired
|
||||
private SysDictItemServiceImpl sysDictItemServiceImpl;
|
||||
@Autowired
|
||||
private IProjectLibraryBaseService projectLibraryBaseService;
|
||||
@Autowired
|
||||
private IProcessInfoEOService processInfoEOService;
|
||||
@Autowired
|
||||
private IProcessInfoDetailEOService processInfoDetailEOService;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
@@ -226,7 +242,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
|
||||
}
|
||||
}
|
||||
|
||||
private String getTreeName(String cut, List<SysCategory> categoryList, List<String> technologyTerritoryList) {
|
||||
@Override
|
||||
public String getTreeName(String cut, List<SysCategory> categoryList, List<String> technologyTerritoryList) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (String technologyTerritory : technologyTerritoryList) {
|
||||
List<SysCategory> collect = categoryList.stream().filter(e -> technologyTerritory.equals(e.getId())).collect(Collectors.toList());
|
||||
@@ -244,4 +261,108 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
|
||||
}
|
||||
return technologyTerritoryName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 发布
|
||||
* @param json
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Result<?> issue(JSONObject json) {
|
||||
String ids = json.getString("ids");
|
||||
if(StringUtils.isEmpty(ids)){
|
||||
throw new JeroBootException("至少选择一条数据进行发布!");
|
||||
}
|
||||
String endTime = json.getString("endTime");
|
||||
|
||||
List<String> idList = Arrays.asList(ids.split(","));
|
||||
|
||||
// 根据页面选择的认证清单数据id,查询出状态为’清单待发布‘的数据,进行发布处理
|
||||
QueryWrapper<ProjectCertificationInventoryEO> certificationQueryWrap = new QueryWrapper<>();
|
||||
certificationQueryWrap.lambda().in(ProjectCertificationInventoryEO::getId,idList);
|
||||
certificationQueryWrap.lambda().in(ProjectCertificationInventoryEO::getFlowStatus,CertificationInventoryFlowStatusEnum.LIST_TO_BE_RELEASED.getValue());
|
||||
List<ProjectCertificationInventoryEO> projectCertificationInventoryEOList = this.list(certificationQueryWrap);
|
||||
|
||||
if(CollectionUtils.isEmpty(projectCertificationInventoryEOList)){
|
||||
throw new JeroBootException("无法获取要发布的数据,请重新选择!");
|
||||
}
|
||||
List<ProcessInfoDetailEO> 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<String> 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<ProcessInfoEO> 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<ProcessInfoDetailEO> processInfoDetailEOList,ProcessInfoEO processInfoEO){
|
||||
processInfoDetailEOList.forEach(detail -> {
|
||||
detail.setFlowType(FlowTypeEnum.CERTIFICATION_LC.getValue());
|
||||
});
|
||||
|
||||
// 删除该项目数据的待办任务,key为 认证工程师接受任务的数据
|
||||
QueryWrapper<ProcessInfoDetailEO> 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);
|
||||
}
|
||||
}
|
||||
|
||||
+1
@@ -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;
|
||||
|
||||
@@ -160,6 +160,41 @@
|
||||
<certificationDirectory :isDisplayNum="isDisplayNum" :url="url" ref="certificationDirectoryRef"/>
|
||||
<batSetting :url="url" ref="batSettingRef" @batSettingForm="batSettingForm"/>
|
||||
<addModel ref="addModelRef" @addModelForm="addModelForm"/>
|
||||
<a-modal
|
||||
:title="listTitle"
|
||||
:width="500"
|
||||
:visible="visible"
|
||||
:confirm-loading="confirmLoading"
|
||||
:maskClosable="false"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm">
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="24">
|
||||
<div class="box-title-text-index">
|
||||
<div class="title-text-index">
|
||||
<span class="Required">*</span>
|
||||
<span class="title-text-text"
|
||||
:title="$t('TaskCutOffTime')">{{ $t('TaskCutOffTime') }}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" prop="endTime">
|
||||
<a-date-picker class="box-input"
|
||||
:placeholder="$t('PleaseSelect')+$t('TaskCutOffTime')"
|
||||
@change="dateChange({db_field_name:'endTime'})"
|
||||
format="YYYY-MM-DD"
|
||||
:disabledDate="disabledDate"
|
||||
:getCalendarContainer="(trigger) => trigger.parentNode"
|
||||
v-model="formInline.endTime"
|
||||
style="width: 100%" />
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form-model>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
@@ -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() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user