From a55c3b2796054d2976ab8726f1d320bf47bf011f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E7=8E=89=E7=90=A6?= <7507756+jiang_yuqi@user.noreply.gitee.com> Date: Sat, 27 Apr 2024 23:03:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/FlowDefinitionServiceImpl.java | 24 ++ .../mapper/flowable/FlowBusinessKeyMapper.xml | 1 + .../src/views/flow/flowLabourInfo/index.vue | 5 + .../task/myProcess/detail/detailDrawer.vue | 50 +++- .../task/myProcess/editLeaveTaskDrawer.vue | 2 +- .../task/myProcess/editTaskDrawer.vue | 132 ++++++++- .../views/flowable/task/myProcess/index.vue | 6 +- .../task/myProcess/initLeaveTaskDrawer.vue | 2 +- .../task/myProcess/initSpaceTaskDrawer.vue | 250 ------------------ .../task/myProcess/initTaskDrawer.vue | 133 +++++++++- .../task/todo/detail/approveDrawer.vue | 46 +++- .../mapper/project/ProjectViewMapper.xml | 2 +- 12 files changed, 386 insertions(+), 267 deletions(-) delete mode 100644 ruoyi-ui/src/views/flowable/task/myProcess/initSpaceTaskDrawer.vue diff --git a/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/FlowDefinitionServiceImpl.java b/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/FlowDefinitionServiceImpl.java index 744a108b..004dae3d 100644 --- a/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/FlowDefinitionServiceImpl.java +++ b/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/FlowDefinitionServiceImpl.java @@ -4,15 +4,20 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.ruoyi.common.core.text.Convert; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StringUtils; import com.ruoyi.flowable.common.constant.ProcessConstants; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.flowable.common.enums.FlowComment; import com.ruoyi.flowable.domain.vo.ProcKeyRole; +import com.ruoyi.flowable.service.IFlowBusinessKeyService; import com.ruoyi.system.domain.FlowProcDefDto; import com.ruoyi.flowable.factory.FlowServiceFactory; import com.ruoyi.flowable.service.IFlowDefinitionService; import com.ruoyi.flowable.service.ISysDeployFormService; +import com.ruoyi.system.domain.FlowTaskEntity; import com.ruoyi.system.domain.SysForm; +import com.ruoyi.system.mapper.FlowBusinessKeyMapper; import com.ruoyi.system.mapper.FlowDeployMapper; import com.ruoyi.system.service.ISysDeptService; import com.ruoyi.system.service.ISysPostService; @@ -28,6 +33,7 @@ import org.flowable.engine.repository.ProcessDefinitionQuery; import org.flowable.engine.runtime.ProcessInstance; import org.flowable.image.impl.DefaultProcessDiagramGenerator; import org.flowable.task.api.Task; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -62,6 +68,9 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl @Resource private FlowDeployMapper flowDeployMapper; + @Autowired + private FlowBusinessKeyMapper flowBusinessKeyMapper; + private static final String BPMN_FILE_SUFFIX = ".bpmn"; @Override @@ -238,6 +247,21 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl if (Objects.nonNull(processDefinition) && processDefinition.isSuspended()) { return AjaxResult.error("流程已被挂起,请联系管理员先激活流程"); } + /*try { + //分包单位资质审批需要验证是否已经提交过相关审批 + if(Objects.equals("9",processDefinition.getCategory())){ + FlowTaskEntity flowTaskEntity = new FlowTaskEntity(); + flowTaskEntity.setBusinessKey(Convert.toStr(variables.get("businessKey"))); + flowTaskEntity.setProcDefKey(processDefinition.getKey()); + flowTaskEntity.setStartDeptName(SecurityUtils.getLoginUser().getUser().getDept().getDeptName()); + List list = flowBusinessKeyMapper.selectAllFlowTaskByParams(flowTaskEntity); + if(StringUtils.isNotEmpty(list)){ + return AjaxResult.error("当前单位已提交过分包单位资质审批,请勿重复提交"); + } + } + }catch (Exception e){ + e.printStackTrace(); + }*/ // 设置流程发起人Id到流程中 identityService.setAuthenticatedUserId(userId); variables.put(ProcessConstants.PROCESS_INITIATOR, userId); diff --git a/ruoyi-system/src/main/resources/mapper/flowable/FlowBusinessKeyMapper.xml b/ruoyi-system/src/main/resources/mapper/flowable/FlowBusinessKeyMapper.xml index a19a4b75..6bd351e1 100644 --- a/ruoyi-system/src/main/resources/mapper/flowable/FlowBusinessKeyMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/flowable/FlowBusinessKeyMapper.xml @@ -30,6 +30,7 @@ and fa.taskName like concat('%', #{taskName}, '%') and fa.procDefName like concat('%', #{procDefName}, '%') + and fa.procDefKey = #{procDefKey} and fa.businessKey = #{businessKey} and fa.startDeptName like concat('%', #{startDeptName}, '%') and fa.startUserName like concat('%', #{startUserName}, '%') diff --git a/ruoyi-ui/src/views/flow/flowLabourInfo/index.vue b/ruoyi-ui/src/views/flow/flowLabourInfo/index.vue index 7fcc8f7d..13b12ebc 100644 --- a/ruoyi-ui/src/views/flow/flowLabourInfo/index.vue +++ b/ruoyi-ui/src/views/flow/flowLabourInfo/index.vue @@ -171,6 +171,11 @@ + + + {{ title }} + + + + + + + + {{ initData.subDeptName }} + + + {{ initData.subDeptAptitude }} + + + {{ initData.subDeptChairman }} + + + {{ initData.subDeptSafetyCertificate }} + + + {{ initData.subDeptCustodian }} + + + {{ initData.subDeptCustodianCardId }} + + + {{ initData.subDeptApproachDate }} + -
+ - + {{ initData.remark }}
@@ -142,6 +176,7 @@ import { export default { components: {}, props: {}, + dicts: ["flow_sub_dept_type", "flow_sub_dept_scope"], data() { return { // 抽屉层 @@ -162,7 +197,7 @@ export default { //label样式 labelStyle: { width: "180px" }, initData: {}, - fileTypes:['pdf','png','jpg','jpeg'], + fileTypes: ["pdf", "png", "jpg", "jpeg"], }; }, computed: {}, @@ -423,7 +458,9 @@ export default { }, handledownload(url) { let fileType = url.split("."); - if (this.fileTypes.indexOf(fileType[fileType.length-1].toLocaleLowerCase())>-1) { + if ( + this.fileTypes.indexOf(fileType[fileType.length - 1].toLocaleLowerCase()) > -1 + ) { window.open(process.env.VUE_APP_BASE_API + url); } else { this.$download.resource(url); @@ -475,8 +512,9 @@ export default { float: left; padding-left: 20px; - .el-link .el-link--inner{ - word-break: break-all !important; + .el-link_div { + width: 100%; + overflow: hidden; } } } diff --git a/ruoyi-ui/src/views/flowable/task/myProcess/editLeaveTaskDrawer.vue b/ruoyi-ui/src/views/flowable/task/myProcess/editLeaveTaskDrawer.vue index 5c075df2..1698af82 100644 --- a/ruoyi-ui/src/views/flowable/task/myProcess/editLeaveTaskDrawer.vue +++ b/ruoyi-ui/src/views/flowable/task/myProcess/editLeaveTaskDrawer.vue @@ -112,7 +112,7 @@ /> -
+
提交申请 取 消
diff --git a/ruoyi-ui/src/views/flowable/task/myProcess/editTaskDrawer.vue b/ruoyi-ui/src/views/flowable/task/myProcess/editTaskDrawer.vue index 113f3998..9ac6fe6e 100644 --- a/ruoyi-ui/src/views/flowable/task/myProcess/editTaskDrawer.vue +++ b/ruoyi-ui/src/views/flowable/task/myProcess/editTaskDrawer.vue @@ -50,6 +50,77 @@ {{ title }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -
+
提交流程 取 消
@@ -89,6 +160,7 @@ export default { type: Function, }, }, + dicts: ["flow_sub_dept_type", "flow_sub_dept_scope"], data() { return { // 抽屉层 @@ -107,6 +179,59 @@ export default { // 表单校验 rules: { businessKey: [{ required: true, message: "请选择所属项目", trigger: "blur" }], + subDeptType: [{ required: true, message: "请选择分包类型", trigger: "blur" }], + subDeptScope: [{ required: true, message: "请选择分包范围", trigger: "blur" }], + subDeptName: [ + { required: true, message: "请输入分包单位名称", trigger: "blur" }, + { + max: 50, + message: "分包单位名称最多50字", + trigger: "blur", + }, + ], + subDeptAptitude: [ + { required: true, message: "请选择分包单位资质", trigger: "blur" }, + { + max: 50, + message: "分包单位资质最多50字", + trigger: "blur", + }, + ], + subDeptChairman: [ + { required: true, message: "请输入分包单位法人代表", trigger: "blur" }, + { + max: 20, + message: "分包单位法人代表最多20字", + trigger: "blur", + }, + ], + subDeptSafetyCertificate: [ + { required: true, message: "请输入分包单位安全生产许可证", trigger: "blur" }, + { + max: 50, + message: "分包单位安全生产许可证最多50字", + trigger: "blur", + }, + ], + subDeptCustodian: [ + { required: true, message: "请输入分包单位项目负责人", trigger: "blur" }, + { + max: 20, + message: "分包单位项目负责人最多20字", + trigger: "blur", + }, + ], + subDeptCustodianCardId: [ + { required: true, message: "请输入分包单位负责人身份证号", trigger: "blur" }, + { + pattern: /^[1-9]\d{5}(18|19|20|21|22)?\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}(\d|[Xx])$/, + message: "请输入正确的身份证号", + trigger: "blur", + }, + ], + subDeptApproachDate: [ + { required: true, message: "请选择分包单位进场时间", trigger: "blur" }, + ], files: [{ required: true, message: "请上传申请内容", trigger: "blur" }], remark: [ { required: false, message: "请输入申请说明", trigger: "blur" }, @@ -126,6 +251,7 @@ export default { taskTitle: null, taskOpen: false, daterangeMarksTime: [], + fbAptitude: false, }; }, computed: {}, @@ -152,6 +278,10 @@ export default { this.options = options; this.onOpen = true; this.title = options.procDefName; + //初始化流程类型 + if (options.category == "9") { + this.fbAptitude = true; + } this.initFormDate(options.procInsId); flowXmlAndNode({ procInsId: options.procInsId, deployId: options.deployId }).then( (res) => { diff --git a/ruoyi-ui/src/views/flowable/task/myProcess/index.vue b/ruoyi-ui/src/views/flowable/task/myProcess/index.vue index c05d1a57..c3946582 100644 --- a/ruoyi-ui/src/views/flowable/task/myProcess/index.vue +++ b/ruoyi-ui/src/views/flowable/task/myProcess/index.vue @@ -134,7 +134,7 @@ 处理 详情 终止 - 删除 + 删除 @@ -344,9 +344,13 @@ export default { activeName:"await", showPro:false, projectOptions: null, + superAdmin:false, }; }, created() { + if(this.$store.getters.userId==1){ + this.superAdmin=true; + } this.queryParams.activeName = this.activeName; this.getList(); this.initMyProject(); diff --git a/ruoyi-ui/src/views/flowable/task/myProcess/initLeaveTaskDrawer.vue b/ruoyi-ui/src/views/flowable/task/myProcess/initLeaveTaskDrawer.vue index 319d4bdb..65c69b1c 100644 --- a/ruoyi-ui/src/views/flowable/task/myProcess/initLeaveTaskDrawer.vue +++ b/ruoyi-ui/src/views/flowable/task/myProcess/initLeaveTaskDrawer.vue @@ -112,7 +112,7 @@ /> -
+
提交申请 取 消
diff --git a/ruoyi-ui/src/views/flowable/task/myProcess/initSpaceTaskDrawer.vue b/ruoyi-ui/src/views/flowable/task/myProcess/initSpaceTaskDrawer.vue deleted file mode 100644 index 7b9b633f..00000000 --- a/ruoyi-ui/src/views/flowable/task/myProcess/initSpaceTaskDrawer.vue +++ /dev/null @@ -1,250 +0,0 @@ - - - - diff --git a/ruoyi-ui/src/views/flowable/task/myProcess/initTaskDrawer.vue b/ruoyi-ui/src/views/flowable/task/myProcess/initTaskDrawer.vue index c134bafc..eeb230ee 100644 --- a/ruoyi-ui/src/views/flowable/task/myProcess/initTaskDrawer.vue +++ b/ruoyi-ui/src/views/flowable/task/myProcess/initTaskDrawer.vue @@ -50,6 +50,77 @@ {{ title }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -
+
提交流程 取 消
@@ -87,6 +158,7 @@ export default { type: Function, }, }, + dicts: ["flow_sub_dept_type", "flow_sub_dept_scope"], data() { return { // 抽屉层 @@ -105,6 +177,59 @@ export default { // 表单校验 rules: { businessKey: [{ required: true, message: "请选择所属项目", trigger: "blur" }], + subDeptType: [{ required: true, message: "请选择分包类型", trigger: "blur" }], + subDeptScope: [{ required: true, message: "请选择分包范围", trigger: "blur" }], + subDeptName: [ + { required: true, message: "请输入分包单位名称", trigger: "blur" }, + { + max: 50, + message: "分包单位名称最多50字", + trigger: "blur", + }, + ], + subDeptAptitude: [ + { required: true, message: "请选择分包单位资质", trigger: "blur" }, + { + max: 50, + message: "分包单位资质最多50字", + trigger: "blur", + }, + ], + subDeptChairman: [ + { required: true, message: "请输入分包单位法人代表", trigger: "blur" }, + { + max: 20, + message: "分包单位法人代表最多20字", + trigger: "blur", + }, + ], + subDeptSafetyCertificate: [ + { required: true, message: "请输入分包单位安全生产许可证", trigger: "blur" }, + { + max: 50, + message: "分包单位安全生产许可证最多50字", + trigger: "blur", + }, + ], + subDeptCustodian: [ + { required: true, message: "请输入分包单位项目负责人", trigger: "blur" }, + { + max: 20, + message: "分包单位项目负责人最多20字", + trigger: "blur", + }, + ], + subDeptCustodianCardId: [ + { required: true, message: "请输入分包单位负责人身份证号", trigger: "blur" }, + { + pattern: /^[1-9]\d{5}(18|19|20|21|22)?\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}(\d|[Xx])$/, + message: "请输入正确的身份证号", + trigger: "blur", + }, + ], + subDeptApproachDate: [ + { required: true, message: "请选择分包单位进场时间", trigger: "blur" }, + ], files: [{ required: true, message: "请上传申请内容", trigger: "blur" }], remark: [ { required: false, message: "请输入申请说明", trigger: "blur" }, @@ -124,6 +249,8 @@ export default { taskTitle: null, taskOpen: false, daterangeMarksTime: [], + //分包资质审批 + fbAptitude: false, }; }, computed: {}, @@ -166,6 +293,10 @@ export default { this.title = options.name; this.deptName = store.getters.dept.deptName; this.nickName = store.getters.name; + //初始化流程类型 + if (options.category == "9") { + this.fbAptitude = true; + } const self = this; this.onOpen = true; flowXmlAndNode({ deployId: options.deploymentId }).then((res) => { diff --git a/ruoyi-ui/src/views/flowable/task/todo/detail/approveDrawer.vue b/ruoyi-ui/src/views/flowable/task/todo/detail/approveDrawer.vue index c1b6cd5d..380738cb 100644 --- a/ruoyi-ui/src/views/flowable/task/todo/detail/approveDrawer.vue +++ b/ruoyi-ui/src/views/flowable/task/todo/detail/approveDrawer.vue @@ -114,8 +114,42 @@ {{ title }} + + + + + + + + {{ initData.subDeptName }} + + + {{ initData.subDeptAptitude }} + + + {{ initData.subDeptChairman }} + + + {{ initData.subDeptSafetyCertificate }} + + + {{ initData.subDeptCustodian }} + + + {{ initData.subDeptCustodianCardId }} + + + {{ initData.subDeptApproachDate }} + -
+ - + {{ initData.remark }} @@ -218,6 +252,7 @@ export default { type: Function, }, }, + dicts: ["flow_sub_dept_type", "flow_sub_dept_scope"], data() { return { // 抽屉层 @@ -672,9 +707,10 @@ export default { height: 100%; float: left; padding-left: 20px; - - .el-link .el-link--inner{ - word-break: break-all !important; + + .el-link_div { + width: 100%; + overflow: hidden; } } } diff --git a/yanzhu-jh/src/main/resources/mapper/project/ProjectViewMapper.xml b/yanzhu-jh/src/main/resources/mapper/project/ProjectViewMapper.xml index 5a9ab655..43499b3f 100644 --- a/yanzhu-jh/src/main/resources/mapper/project/ProjectViewMapper.xml +++ b/yanzhu-jh/src/main/resources/mapper/project/ProjectViewMapper.xml @@ -43,7 +43,7 @@ (select count(1) from vw_flow_all a where a.businessKey = sp.id and a.startDeptName = pui.unitName and a.finishTime is not null)as gcsp, (select count(1) from sur_project_standard a where a.project_id = sp.id and a.dept_id = pui.unitId and a.is_del=0)as bzh, (select count(1) from sur_project_photography a where a.project_id = sp.id and a.is_del=0)as yssys, - (select count(1) from flow_labour_info a where a.project_id = sp.id and a.deptId=pui.unitId and a.is_del=0) as lzyjs, + (select count(1) from flow_labour_info a where a.project_id = sp.id and a.dept_id=pui.unitId and a.is_del=0) as lzyjs, '0' as hjyjs, (select count(1) from smz_ssp_problemmodify a where a.projectId=sp.id and a.infoType=1 and a.isDel=0 and a.checkState!=4 and date(NOW()) ]]> date(a.nickedTime)) as zlyjs, (select count(1) from smz_ssp_problemmodify a where a.projectId=sp.id and a.infoType=0 and a.isDel=0 and a.checkState!=4 and date(NOW()) ]]> date(a.nickedTime)) as aqyjs,