瀏覽代碼

Merge remote-tracking branch 'origin/dev_v1.0.1' into dev_v1.0.1

caozixuan 1 年之前
父節點
當前提交
1ade13ff97

+ 11 - 10
sop-api/install/mysql/init/init.sql

@@ -1104,6 +1104,7 @@ CREATE TABLE `t_b_sop_info_detail` (
                                        `region_user_id` bigint(20) DEFAULT NULL COMMENT '区域负责人id',
                                        `engineer_user_id` bigint(20) DEFAULT NULL COMMENT '实施工程师id',
                                        `assistant_engineer_user_ids` varchar(500) DEFAULT NULL COMMENT '助理实施工程师id数组',
+                                       `after_region_to_enginess` tinyint DEFAULT '0' COMMENT '之后是否由区域协调人替换实施工程师,true:是,false:不是',
                                        PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='sop明细表';
 
@@ -3358,16 +3359,16 @@ INSERT INTO `t_d_form_widget` VALUES (74, 'CHECKBOX', 'FORM', 'absent_exam_stude
 INSERT INTO `t_d_form_widget` VALUES (75, 'TEXT', 'FORM', 'absent_count', 'absent_count', '缺考科次数量', 'INT', 1, 0, 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, 6, NULL, NULL, 'OFFICE_SOP_FLOW', 7, 0, NULL, NULL, 1, 1);
 INSERT INTO `t_d_form_widget` VALUES (76, 'FORM_GROUP_TITLE', 'FORM', 'manual_code_title', 'manual_code_title', '手工输入条码确认', 'STRING', 0, 1, 0, 1, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, 'OFFICE_SOP_FLOW', 7, 0, NULL, NULL, 1, 1);
 INSERT INTO `t_d_form_widget` VALUES (77, 'CHECKBOX', 'FORM', 'manual_code_cb', 'manual_code_cb', '手工输入条码确认', 'STRING', 1, 0, 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, '[{\"value\":\"true\",\"label\":\"“数据检查“\' -“人工确认“,“确认完成“\"}]', 'OFFICE_SOP_FLOW', 7, 0, NULL, NULL, 1, 1);
-INSERT INTO `t_d_form_widget` VALUES (78, 'FORM_GROUP_TITLE', 'FORM', 'mark_model_title', 'mark_model_title', '评卷模式确认', 'STRING', 0, 1, 0, 1, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, 'OFFICE_SOP_FLOW', 8, 0, NULL, NULL, 1, 1);
-INSERT INTO `t_d_form_widget` VALUES (79, 'RADIO', 'FORM', 'mark_model_radio', 'mark_model_radio', '评卷模式', 'STRING', 1, 0, 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, '[{\"value\":\"TRAIL\",\"label\":\"轨迹模式\"},{\"value\":\"NORMAL\",\"label\":\"普通模式\"}]', 'OFFICE_SOP_FLOW', 8, 0, NULL, NULL, 1, 1);
-INSERT INTO `t_d_form_widget` VALUES (80, 'FORM_GROUP_TITLE', 'FORM', 'mark_params_title', 'mark_params_title', '评卷参数核对', 'STRING', 0, 1, 0, 1, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, 'OFFICE_SOP_FLOW', 8, 0, NULL, NULL, 1, 1);
-INSERT INTO `t_d_form_widget` VALUES (81, 'CHECKBOX', 'FORM', 'mark_params_cb', 'mark_params_cb', '评卷参数核对', 'STRING', 1, 0, 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, '[{\"value\":\"1\",\"label\":\"1、核查每个科目的满分是否正确(大部分科目都是100分)\"},{\"value\":\"2\",\"label\":\"2、核对客观题标答以及分数是否录入正确、多选题判分规则(漏选是否得分、任选得分)\"},{\"value\":\"3\",\"label\":\"检查所有科目结构和分组是否全部导入。(评卷管理>评卷进度查看分组状态)\"}]', 'OFFICE_SOP_FLOW', 8, 0, NULL, NULL, 1, 1);
-INSERT INTO `t_d_form_widget` VALUES (82, 'FORM_GROUP_TITLE', 'FORM', 'mark_submit_title', 'mark_submit_title', '成绩提交核查', 'STRING', 0, 1, 0, 1, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, 'OFFICE_SOP_FLOW', 9, 0, NULL, NULL, 1, 1);
-INSERT INTO `t_d_form_widget` VALUES (83, 'CHECKBOX', 'FORM', 'mark_submit_cb', 'mark_submit_cb', '成绩提交核查', 'STRING', 1, 0, 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, '[{\"value\":\"1\",\"label\":\"1、是否已核对不缺考、客观题为0分的情况\"},{\"value\":\"2\",\"label\":\"2、是否已核对主观题为0、客观题有分的情况\"},{\"value\":\"3\",\"label\":\"3、是否检查客观题小题得分率低于20%的情况\"},{\"value\":\"4\",\"label\":\"4、核对导出成绩表数据条数是否与考生表数量一致,不能带有“未导出全量数据”字样;请填写导出成绩数量以及完成时间\"},{\"value\":\"5\",\"label\":\"5、核对导出图片工具是否正常运行\"}]', 'OFFICE_SOP_FLOW', 9, 0, NULL, NULL, 1, 1);
-INSERT INTO `t_d_form_widget` VALUES (84, 'FILE', 'FORM', 'upload_success_photos', 'upload_success_photos', '上传验收报告(纸质)拍照', 'ARRAY', 0, 0, 1, 1, NULL, 5, NULL, NULL, NULL, NULL, 12, NULL, NULL, 'OFFICE_SOP_FLOW', 9, 0, NULL, NULL, 1, 1);
-INSERT INTO `t_d_form_widget` VALUES (85, 'ONLY_TITLE', 'FORM', 'device_in_out_label', 'device_in_out_label', '设备入库', 'STRING', 0, 1, 0, 1, NULL, NULL, NULL, NULL, NULL, NULL, 6, NULL, NULL, 'OFFICE_SOP_FLOW', 10, 0, NULL, NULL, 1, 1);
-INSERT INTO `t_d_form_widget` VALUES (86, 'DATE', 'FORM', 'device_in_time', 'device_in_time', '设备入库时间', 'STRING', 1, 0, 1, 1, NULL, NULL, NULL, NULL, NULL, 'yyyy-MM-dd', 6, NULL, NULL, 'OFFICE_SOP_FLOW', 10, 0, NULL, NULL, 1, 1);
-INSERT INTO `t_d_form_widget` VALUES (87, 'DEVICE_IN_TABLE', 'FORM', 'device_in_table', 'device_in_table', '设备入库表格', 'STRING', 1, 0, 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, 'OFFICE_SOP_FLOW', 10, 0, NULL, NULL, 1, 1);
+INSERT INTO `t_d_form_widget` VALUES (78, 'FORM_GROUP_TITLE', 'FORM', 'mark_model_title', 'mark_model_title', '评卷模式确认', 'STRING', 0, 1, 0, 1, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, 'OFFICE_SOP_FLOW', 9, 0, NULL, NULL, 1, 1);
+INSERT INTO `t_d_form_widget` VALUES (79, 'RADIO', 'FORM', 'mark_model_radio', 'mark_model_radio', '评卷模式', 'STRING', 1, 0, 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, '[{\"value\":\"TRAIL\",\"label\":\"轨迹模式\"},{\"value\":\"NORMAL\",\"label\":\"普通模式\"}]', 'OFFICE_SOP_FLOW', 9, 0, NULL, NULL, 1, 1);
+INSERT INTO `t_d_form_widget` VALUES (80, 'FORM_GROUP_TITLE', 'FORM', 'mark_params_title', 'mark_params_title', '评卷参数核对', 'STRING', 0, 1, 0, 1, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, 'OFFICE_SOP_FLOW', 9, 0, NULL, NULL, 1, 1);
+INSERT INTO `t_d_form_widget` VALUES (81, 'CHECKBOX', 'FORM', 'mark_params_cb', 'mark_params_cb', '评卷参数核对', 'STRING', 1, 0, 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, '[{\"value\":\"1\",\"label\":\"1、核查每个科目的满分是否正确(大部分科目都是100分)\"},{\"value\":\"2\",\"label\":\"2、核对客观题标答以及分数是否录入正确、多选题判分规则(漏选是否得分、任选得分)\"},{\"value\":\"3\",\"label\":\"检查所有科目结构和分组是否全部导入。(评卷管理>评卷进度查看分组状态)\"}]', 'OFFICE_SOP_FLOW', 9, 0, NULL, NULL, 1, 1);
+INSERT INTO `t_d_form_widget` VALUES (82, 'FORM_GROUP_TITLE', 'FORM', 'mark_submit_title', 'mark_submit_title', '成绩提交核查', 'STRING', 0, 1, 0, 1, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, 'OFFICE_SOP_FLOW', 10, 0, NULL, NULL, 1, 1);
+INSERT INTO `t_d_form_widget` VALUES (83, 'CHECKBOX', 'FORM', 'mark_submit_cb', 'mark_submit_cb', '成绩提交核查', 'STRING', 1, 0, 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, '[{\"value\":\"1\",\"label\":\"1、是否已核对不缺考、客观题为0分的情况\"},{\"value\":\"2\",\"label\":\"2、是否已核对主观题为0、客观题有分的情况\"},{\"value\":\"3\",\"label\":\"3、是否检查客观题小题得分率低于20%的情况\"},{\"value\":\"4\",\"label\":\"4、核对导出成绩表数据条数是否与考生表数量一致,不能带有“未导出全量数据”字样;请填写导出成绩数量以及完成时间\"},{\"value\":\"5\",\"label\":\"5、核对导出图片工具是否正常运行\"}]', 'OFFICE_SOP_FLOW', 10, 0, NULL, NULL, 1, 1);
+INSERT INTO `t_d_form_widget` VALUES (84, 'FILE', 'FORM', 'upload_success_photos', 'upload_success_photos', '上传验收报告(纸质)拍照', 'ARRAY', 0, 0, 1, 1, NULL, 5, NULL, NULL, NULL, NULL, 12, NULL, NULL, 'OFFICE_SOP_FLOW', 10, 0, NULL, NULL, 1, 1);
+INSERT INTO `t_d_form_widget` VALUES (85, 'ONLY_TITLE', 'FORM', 'device_in_out_label', 'device_in_out_label', '设备入库', 'STRING', 0, 1, 0, 1, NULL, NULL, NULL, NULL, NULL, NULL, 6, NULL, NULL, 'OFFICE_SOP_FLOW', 8, 0, NULL, NULL, 1, 1);
+INSERT INTO `t_d_form_widget` VALUES (86, 'DATE', 'FORM', 'device_in_time', 'device_in_time', '设备入库时间', 'STRING', 1, 0, 1, 1, NULL, NULL, NULL, NULL, NULL, 'yyyy-MM-dd', 6, NULL, NULL, 'OFFICE_SOP_FLOW', 8, 0, NULL, NULL, 1, 1);
+INSERT INTO `t_d_form_widget` VALUES (87, 'DEVICE_IN_TABLE', 'FORM', 'device_in_table', 'device_in_table', '设备入库表格', 'STRING', 1, 0, 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, 'OFFICE_SOP_FLOW', 8, 0, NULL, NULL, 1, 1);
 INSERT INTO `t_d_form_widget` VALUES (88, 'FORM_GROUP_TITLE', 'FORM', 'inside_title_engineer', 'inside_title_engineer', '工程师项目内审(请于24小时内完成内审)', 'STRING', 0, 1, 0, 1, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, 'OFFICE_SOP_FLOW', 3, 0, 2, 'EFFECT_ENGINEER', 1, 1);
 INSERT INTO `t_d_form_widget` VALUES (89, 'RADIO', 'FORM', 'approve_radio_engineer', 'approve_radio_engineer', '我对以上项目关键信息已审核,确认内容无误:', 'STRING', 1, 0, 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, '[{\"value\":\"1\",\"label\":\"同意\"},{\"value\":\"0\",\"label\":\"不同意\"}]', 'OFFICE_SOP_FLOW', 3, 0, 2, 'EFFECT_ENGINEER', 1, 1);
 INSERT INTO `t_d_form_widget` VALUES (90, 'SIGN', 'FORM', 'sign_engineer', 'sign_engineer', '添加签名', 'STRING', 1, 0, 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, 6, NULL, NULL, 'OFFICE_SOP_FLOW', 3, 0, 2, 'EFFECT_ENGINEER', 1, 1);

二進制
sop-api/src/main/resources/officeSopFlow.zip


+ 11 - 0
sop-business/src/main/java/com/qmth/sop/business/entity/TBSopInfoDetail.java

@@ -44,6 +44,9 @@ public class TBSopInfoDetail implements Serializable {
     @ApiModelProperty(value = "助理实施工程师id数组")
     private String assistantEngineerUserIds;
 
+    @ApiModelProperty(value = "之后是否由区域协调人替换实施工程师,true:是,false:不是")
+    private Boolean afterRegionToEnginess = false;
+
     public TBSopInfoDetail() {
 
     }
@@ -68,6 +71,14 @@ public class TBSopInfoDetail implements Serializable {
         this.assistantEngineerUserIds = assistantEngineerUserIds;
     }
 
+    public Boolean getAfterRegionToEnginess() {
+        return afterRegionToEnginess;
+    }
+
+    public void setAfterRegionToEnginess(Boolean afterRegionToEnginess) {
+        this.afterRegionToEnginess = afterRegionToEnginess;
+    }
+
     public Long getLeadId() {
         return leadId;
     }

+ 57 - 7
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBSopInfoServiceImpl.java

@@ -100,6 +100,9 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
     @Resource
     TBDeviceDeliveryService tbDeviceDeliveryService;
 
+    @Resource
+    TBUserArchivesService tbUserArchivesService;
+
     /**
      * 查询动态sop表名是否存在
      *
@@ -336,6 +339,7 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
         if (flowApproveParam.getApprove() != FlowApprovePassEnum.DRAFT) {
             map.put(SystemConstant.CRM_INFO, crmProjectResult);
             map.put(SystemConstant.SOP_ID, tbSopInfo.getId());
+            map.put(SystemConstant.SOURCE, "sopApprove");
             tbSopInfoService.saveJobRemind(map);
         }
         TFFlowApprove tfFlowApprove = (TFFlowApprove) map.get(SystemConstant.FLOW_APPROVE);
@@ -637,7 +641,11 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
                     approveUserIds = Arrays.asList(String.valueOf(tbSopInfoDetail.getLeadId()), String.valueOf(tbSopInfoDetail.getEngineerUserId()));
                 }
             } else {
-                approveUserIds = Arrays.asList(String.valueOf(tbSopInfoDetail.getEngineerUserId()));
+                if (flowTaskResult.getSetup().intValue() >= 8 && tbSopInfoDetail.getAfterRegionToEnginess()) {
+                    approveUserIds = Arrays.asList(String.valueOf(tbSopInfoDetail.getRegionUserId()));
+                } else {
+                    approveUserIds = Arrays.asList(String.valueOf(tbSopInfoDetail.getEngineerUserId()));
+                }
             }
         } else if (type == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW) {//研究生sop流程待审核人
             if (flowTaskResult.getSetup().intValue() == 1) {
@@ -762,6 +770,7 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
         if (approve != FlowApprovePassEnum.DRAFT) {
             map.put(SystemConstant.CRM_INFO, crmProjectResult);
             map.put(SystemConstant.SOP_ID, null);
+            map.put(SystemConstant.SOURCE, "sopApplyOrPublish");
             tbSopInfoService.saveJobRemind(map);
         }
 
@@ -831,18 +840,58 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
                     FlowTaskResult flowTaskResult = this.getFormProperties(tfCustomFlowEntity, 2);
                     processLimitedTime = this.getProcessLimitedTime(flowTaskResult, ProcessLimitedEnum.SCAN_END_TIME.getKey());
                     execField = ProcessLimitedEnum.SCAN_END_TIME.getKey();
-                } else if (tfFlowApprove.getSetup().intValue() == 8) {//评卷准备
+                } else if (tfFlowApprove.getSetup().intValue() == 8) {//设备入库登记
+                    FlowTaskResult flowTaskResult = this.getFormProperties(tfCustomFlowEntity, 1);
+                    String source = (String) map.get(SystemConstant.SOURCE);
+                    //审批过程中,如果外包服务范围为"仅扫描",则释放实施工程师资源,后续有区域协调人兼任
+                    if (Objects.nonNull(source) && Objects.equals(source, "sopApprove")) {
+                        List<FlowFormWidgetResult> formProperty = flowTaskResult.getFormProperty();
+                        Long engineerUserId = null;
+                        for (FlowFormWidgetResult f : formProperty) {
+                            if (f.getFormId().contains(SystemConstant.THIRD_SERVICE_REGION_CB) && Objects.nonNull(f.getValue()) && !f.getValue().contains("null")) {
+                                JSONObject jsonObject = JSONObject.parseObject(f.getValue());
+                                String value = jsonObject.getString(SystemConstant.VALUE);
+                                if (Objects.nonNull(value) && Objects.nonNull(sopId) && value.equals("SCAN")) {
+                                    TBSopInfoDetail tbSopInfoDetail = tbSopInfoDetailService.getOne(new QueryWrapper<TBSopInfoDetail>().lambda().eq(TBSopInfoDetail::getSopInfoId, sopId));
+                                    engineerUserId = tbSopInfoDetail.getEngineerUserId();
+                                    tbSopInfoDetail.setAfterRegionToEnginess(true);
+                                    tbSopInfoDetailService.updateById(tbSopInfoDetail);
+                                    break;
+                                }
+                            }
+                        }
+                        if (Objects.nonNull(engineerUserId)) {
+                            List<Map<String, Object>> sopPassageMap = this.findSopPassage(null);
+                            if (!CollectionUtils.isEmpty(sopPassageMap)) {
+                                for (Map m : sopPassageMap) {
+                                    String engineerUserStr = Objects.nonNull(m) && Objects.nonNull(m.get("engineerUserIds")) ? m.get("engineerUserIds").toString() : null;
+                                    if (Objects.nonNull(engineerUserStr)) {
+                                        String[] strs = engineerUserStr.split(",");
+                                        Set<String> set = new HashSet<>(Arrays.asList(strs));
+                                        if (!set.contains(engineerUserId)) {
+                                            TBUserArchives tbUserArchives = tbUserArchivesService.findByUserId(engineerUserId);
+                                            if (Objects.nonNull(tbUserArchives)) {
+                                                tbUserArchives.setStatus(UserArchivesStatusEnum.FREE);
+                                                tbUserArchives.updateInfo(sysUser.getId());
+                                                tbUserArchivesService.updateById(tbUserArchives);
+                                            }
+                                        }
+                                        break;
+                                    }
+                                }
+                            }
+                        }
+                    }
+                    processLimitedTime = this.getProcessLimitedTime(flowTaskResult, ProcessLimitedEnum.SERVICE_FINISH_PLAN_DATE.getKey());
+                    execField = ProcessLimitedEnum.SERVICE_FINISH_PLAN_DATE.getKey();
+                } else if (tfFlowApprove.getSetup().intValue() == 9) {//评卷准备
                     FlowTaskResult flowTaskResult = this.getFormProperties(tfCustomFlowEntity, 2);
                     processLimitedTime = this.getProcessLimitedTime(flowTaskResult, ProcessLimitedEnum.MARK_START_TIME.getKey());
                     execField = ProcessLimitedEnum.MARK_START_TIME.getKey();
-                } else if (tfFlowApprove.getSetup().intValue() == 9) {//评卷收尾
+                } else if (tfFlowApprove.getSetup().intValue() == 10) {//评卷收尾
                     FlowTaskResult flowTaskResult = this.getFormProperties(tfCustomFlowEntity, 2);
                     processLimitedTime = this.getProcessLimitedTime(flowTaskResult, ProcessLimitedEnum.MARK_END_TIME.getKey());
                     execField = ProcessLimitedEnum.MARK_END_TIME.getKey();
-                } else if (tfFlowApprove.getSetup().intValue() == 10) {//设备入库登记
-                    FlowTaskResult flowTaskResult = this.getFormProperties(tfCustomFlowEntity, 1);
-                    processLimitedTime = this.getProcessLimitedTime(flowTaskResult, ProcessLimitedEnum.SERVICE_FINISH_PLAN_DATE.getKey());
-                    execField = ProcessLimitedEnum.SERVICE_FINISH_PLAN_DATE.getKey();
                 }
             } else if (tfCustomFlow.getType() == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW) {//研究生sop
                 if (tfFlowApprove.getSetup().intValue() == 2) {//项目关键信息
@@ -1054,6 +1103,7 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
             map.put(SystemConstant.FLOW_APPROVE_LOG, tfFlowLog);
             map.put(SystemConstant.CRM_INFO, crmProjectResult);
             map.put(SystemConstant.SOP_ID, tbSopInfo.getId());
+            map.put(SystemConstant.SOURCE, "save");
             tbSopInfoService.saveJobRemind(map);
 
             FlowTaskResult flowTaskResult = this.getFormProperties(tfCustomFlowEntity, 1);

+ 35 - 45
sop-business/src/main/resources/db/log/wangliang_update_log.sql

@@ -2190,50 +2190,6 @@ ALTER TABLE t_b_project_exchange ADD CONSTRAINT t_b_project_exchange_un_exchange
 ALTER TABLE t_b_violation ADD CONSTRAINT t_b_violation_un_code UNIQUE KEY (code);
 ALTER TABLE t_b_crm ADD CONSTRAINT t_b_crm_un_crm_no UNIQUE KEY (crm_no);
 
---2023.11.30update
-DELETE FROM t_b_product WHERE id=1;
-
-INSERT INTO t_d_form_widget
-(id, code, `type`, form_id, form_name, title, input_type, required, readable, writable, visable, `scale`, `length`, binding, data_grid, tips, format, span, sub_title, `options`, flow_type, form_setup, handle, form_group, role_type, create_id, create_time)
-VALUES(191, 'RADIO', 'FORM', 'third_service_region_cb', 'third_service_region_cb', '外包服务范围', 'STRING', 1, 0, 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, '[{"value":"SCAN","label":"仅扫描"},{"value":"SCAN_MARK","label":"扫描+评卷"}]', 'OFFICE_SOP_FLOW', 1, 0, NULL, NULL, 1, 15);
-
-UPDATE t_d_form_widget
-SET code='ONLY_TITLE', `type`='FORM', form_id='project_rish_title', form_name='project_rish_title', title='项目风险预估(仅供参考)', input_type='STRING', required=0, readable=1, writable=0, visable=1, `scale`=NULL, `length`=NULL, binding=NULL, data_grid=NULL, tips=NULL, format=NULL, span=12, sub_title=NULL, `options`=NULL, flow_type='OFFICE_SOP_FLOW', form_setup=1, handle=0, form_group=NULL, role_type=NULL, create_id=1, create_time=16
-WHERE id=31;
-UPDATE t_d_form_widget
-SET code='RADIO', `type`='FORM', form_id='delay_rish_cb', form_name='delay_rish_cb', title='延期风险', input_type='STRING', required=1, readable=0, writable=1, visable=1, `scale`=NULL, `length`=NULL, binding=NULL, data_grid=NULL, tips=NULL, format=NULL, span=12, sub_title=NULL, `options`='[{"value":"LOW","label":"低"},{"value":"MIDDLE","label":"中"},{"value":"HIGH","label":"高"}]', flow_type='OFFICE_SOP_FLOW', form_setup=1, handle=0, form_group=NULL, role_type=NULL, create_id=1, create_time=17
-WHERE id=32;
-UPDATE t_d_form_widget
-SET code='RADIO', `type`='FORM', form_id='engineer_rish_cb', form_name='engineer_rish_cb', title='实施难度', input_type='STRING', required=1, readable=0, writable=1, visable=1, `scale`=NULL, `length`=NULL, binding=NULL, data_grid=NULL, tips=NULL, format=NULL, span=12, sub_title=NULL, `options`='[{"value":"LOW","label":"低"},{"value":"MIDDLE","label":"中"},{"value":"HIGH","label":"高"}]', flow_type='OFFICE_SOP_FLOW', form_setup=1, handle=0, form_group=NULL, role_type=NULL, create_id=1, create_time=18
-WHERE id=33;
-UPDATE t_d_form_widget
-SET code='TEXTAREA', `type`='FORM', form_id='other_remark', form_name='other_remark', title='其它备注(建议关注的其它方面)', input_type='STRING', required=0, readable=0, writable=1, visable=1, `scale`=NULL, `length`=NULL, binding=NULL, data_grid=NULL, tips=NULL, format=NULL, span=12, sub_title=NULL, `options`=NULL, flow_type='OFFICE_SOP_FLOW', form_setup=1, handle=0, form_group=NULL, role_type=NULL, create_id=1, create_time=19
-WHERE id=34;
-UPDATE t_d_form_widget
-SET code='FORM_GROUP_TITLE', `type`='FORM', form_id='project_contacts_title', form_name='project_contacts_title', title='项目联系人', input_type='STRING', required=0, readable=1, writable=0, visable=1, `scale`=NULL, `length`=NULL, binding=NULL, data_grid=NULL, tips=NULL, format=NULL, span=12, sub_title=NULL, `options`=NULL, flow_type='OFFICE_SOP_FLOW', form_setup=1, handle=0, form_group=NULL, role_type=NULL, create_id=1, create_time=20
-WHERE id=35;
-UPDATE t_d_form_widget
-SET code='TABLE', `type`='FORM', form_id='project_contacts_table', form_name='project_contacts_table', title='项目联系人表格', input_type='STRING', required=1, readable=0, writable=1, visable=1, `scale`=NULL, `length`=NULL, binding=NULL, data_grid=NULL, tips=NULL, format=NULL, span=12, sub_title=NULL, `options`=NULL, flow_type='OFFICE_SOP_FLOW', form_setup=1, handle=0, form_group=NULL, role_type=NULL, create_id=1, create_time=21
-WHERE id=36;
-UPDATE t_d_form_widget
-SET code='TEXT', `type`='TABLE', form_id='school_college', form_name='school_college', title='项目联系人表格_机构输入框', input_type='STRING', required=1, readable=0, writable=1, visable=1, `scale`=NULL, `length`=NULL, binding=NULL, data_grid=NULL, tips=NULL, format=NULL, span=3, sub_title=NULL, `options`=NULL, flow_type='OFFICE_SOP_FLOW', form_setup=1, handle=0, form_group=NULL, role_type=NULL, create_id=1, create_time=22
-WHERE id=37;
-UPDATE t_d_form_widget
-SET code='TEXT', `type`='TABLE', form_id='school_name', form_name='school_name', title='项目联系人表格_姓名输入框', input_type='STRING', required=1, readable=0, writable=1, visable=1, `scale`=NULL, `length`=NULL, binding=NULL, data_grid=NULL, tips=NULL, format=NULL, span=3, sub_title=NULL, `options`=NULL, flow_type='OFFICE_SOP_FLOW', form_setup=1, handle=0, form_group=NULL, role_type=NULL, create_id=1, create_time=23
-WHERE id=38;
-UPDATE t_d_form_widget
-SET code='TEXT', `type`='TABLE', form_id='school_job', form_name='school_job', title='项目联系人表格_职务输入框', input_type='STRING', required=1, readable=0, writable=1, visable=1, `scale`=NULL, `length`=NULL, binding=NULL, data_grid=NULL, tips=NULL, format=NULL, span=3, sub_title=NULL, `options`=NULL, flow_type='OFFICE_SOP_FLOW', form_setup=1, handle=0, form_group=NULL, role_type=NULL, create_id=1, create_time=24
-WHERE id=39;
-UPDATE t_d_form_widget
-SET code='TEXT', `type`='TABLE', form_id='school_tel', form_name='school_tel', title='项目联系人表格_电话输入框', input_type='STRING', required=1, readable=0, writable=1, visable=1, `scale`=NULL, `length`=NULL, binding=NULL, data_grid=NULL, tips=NULL, format=NULL, span=3, sub_title=NULL, `options`=NULL, flow_type='OFFICE_SOP_FLOW', form_setup=1, handle=0, form_group=NULL, role_type=NULL, create_id=1, create_time=25
-WHERE id=40;
-
-update t_b_sop_info t set t.product_id = 2
-where t.product_id = 1;
-
-update t_b_crm t set t.product_id = 2
-where t.product_id = 1;
-
 --2023.11.28update
 DROP TABLE IF EXISTS `t_b_device_delivery`;
 CREATE TABLE `t_b_device_delivery` (
@@ -2397,4 +2353,38 @@ update t_b_sop_info t set t.product_id = 2
 where t.product_id = 1;
 
 update t_b_crm t set t.product_id = 2
-where t.product_id = 1;
+where t.product_id = 1;
+
+--2023.12.01update
+ALTER TABLE t_b_sop_info_detail ADD after_region_to_enginess TINYINT DEFAULT 0 NULL COMMENT '之后是否由区域协调人替换实施工程师,true:是,false:不是';
+
+UPDATE t_d_form_widget
+SET code='FORM_GROUP_TITLE', `type`='FORM', form_id='mark_model_title', form_name='mark_model_title', title='评卷模式确认', input_type='STRING', required=0, readable=1, writable=0, visable=1, `scale`=NULL, `length`=NULL, binding=NULL, data_grid=NULL, tips=NULL, format=NULL, span=12, sub_title=NULL, `options`=NULL, flow_type='OFFICE_SOP_FLOW', form_setup=9, handle=0, form_group=NULL, role_type=NULL, create_id=1, create_time=1
+WHERE id=78;
+UPDATE t_d_form_widget
+SET code='RADIO', `type`='FORM', form_id='mark_model_radio', form_name='mark_model_radio', title='评卷模式', input_type='STRING', required=1, readable=0, writable=1, visable=1, `scale`=NULL, `length`=NULL, binding=NULL, data_grid=NULL, tips=NULL, format=NULL, span=12, sub_title=NULL, `options`='[{"value":"TRAIL","label":"轨迹模式"},{"value":"NORMAL","label":"普通模式"}]', flow_type='OFFICE_SOP_FLOW', form_setup=9, handle=0, form_group=NULL, role_type=NULL, create_id=1, create_time=1
+WHERE id=79;
+UPDATE t_d_form_widget
+SET code='FORM_GROUP_TITLE', `type`='FORM', form_id='mark_params_title', form_name='mark_params_title', title='评卷参数核对', input_type='STRING', required=0, readable=1, writable=0, visable=1, `scale`=NULL, `length`=NULL, binding=NULL, data_grid=NULL, tips=NULL, format=NULL, span=12, sub_title=NULL, `options`=NULL, flow_type='OFFICE_SOP_FLOW', form_setup=9, handle=0, form_group=NULL, role_type=NULL, create_id=1, create_time=1
+WHERE id=80;
+UPDATE t_d_form_widget
+SET code='CHECKBOX', `type`='FORM', form_id='mark_params_cb', form_name='mark_params_cb', title='评卷参数核对', input_type='STRING', required=1, readable=0, writable=1, visable=1, `scale`=NULL, `length`=NULL, binding=NULL, data_grid=NULL, tips=NULL, format=NULL, span=12, sub_title=NULL, `options`='[{"value":"1","label":"1、核查每个科目的满分是否正确(大部分科目都是100分)"},{"value":"2","label":"2、核对客观题标答以及分数是否录入正确、多选题判分规则(漏选是否得分、任选得分)"},{"value":"3","label":"检查所有科目结构和分组是否全部导入。(评卷管理>评卷进度查看分组状态)"}]', flow_type='OFFICE_SOP_FLOW', form_setup=9, handle=0, form_group=NULL, role_type=NULL, create_id=1, create_time=1
+WHERE id=81;
+UPDATE t_d_form_widget
+SET code='FORM_GROUP_TITLE', `type`='FORM', form_id='mark_submit_title', form_name='mark_submit_title', title='成绩提交核查', input_type='STRING', required=0, readable=1, writable=0, visable=1, `scale`=NULL, `length`=NULL, binding=NULL, data_grid=NULL, tips=NULL, format=NULL, span=12, sub_title=NULL, `options`=NULL, flow_type='OFFICE_SOP_FLOW', form_setup=10, handle=0, form_group=NULL, role_type=NULL, create_id=1, create_time=1
+WHERE id=82;
+UPDATE t_d_form_widget
+SET code='CHECKBOX', `type`='FORM', form_id='mark_submit_cb', form_name='mark_submit_cb', title='成绩提交核查', input_type='STRING', required=1, readable=0, writable=1, visable=1, `scale`=NULL, `length`=NULL, binding=NULL, data_grid=NULL, tips=NULL, format=NULL, span=12, sub_title=NULL, `options`='[{"value":"1","label":"1、是否已核对不缺考、客观题为0分的情况"},{"value":"2","label":"2、是否已核对主观题为0、客观题有分的情况"},{"value":"3","label":"3、是否检查客观题小题得分率低于20%的情况"},{"value":"4","label":"4、核对导出成绩表数据条数是否与考生表数量一致,不能带有“未导出全量数据”字样;请填写导出成绩数量以及完成时间"},{"value":"5","label":"5、核对导出图片工具是否正常运行"}]', flow_type='OFFICE_SOP_FLOW', form_setup=10, handle=0, form_group=NULL, role_type=NULL, create_id=1, create_time=1
+WHERE id=83;
+UPDATE t_d_form_widget
+SET code='FILE', `type`='FORM', form_id='upload_success_photos', form_name='upload_success_photos', title='上传验收报告(纸质)拍照', input_type='ARRAY', required=0, readable=0, writable=1, visable=1, `scale`=NULL, `length`=5, binding=NULL, data_grid=NULL, tips=NULL, format=NULL, span=12, sub_title=NULL, `options`=NULL, flow_type='OFFICE_SOP_FLOW', form_setup=10, handle=0, form_group=NULL, role_type=NULL, create_id=1, create_time=1
+WHERE id=84;
+UPDATE t_d_form_widget
+SET code='ONLY_TITLE', `type`='FORM', form_id='device_in_out_label', form_name='device_in_out_label', title='设备入库', input_type='STRING', required=0, readable=1, writable=0, visable=1, `scale`=NULL, `length`=NULL, binding=NULL, data_grid=NULL, tips=NULL, format=NULL, span=6, sub_title=NULL, `options`=NULL, flow_type='OFFICE_SOP_FLOW', form_setup=8, handle=0, form_group=NULL, role_type=NULL, create_id=1, create_time=1
+WHERE id=85;
+UPDATE t_d_form_widget
+SET code='DATE', `type`='FORM', form_id='device_in_time', form_name='device_in_time', title='设备入库时间', input_type='STRING', required=1, readable=0, writable=1, visable=1, `scale`=NULL, `length`=NULL, binding=NULL, data_grid=NULL, tips=NULL, format='yyyy-MM-dd', span=6, sub_title=NULL, `options`=NULL, flow_type='OFFICE_SOP_FLOW', form_setup=8, handle=0, form_group=NULL, role_type=NULL, create_id=1, create_time=1
+WHERE id=86;
+UPDATE t_d_form_widget
+SET code='DEVICE_IN_TABLE', `type`='FORM', form_id='device_in_table', form_name='device_in_table', title='设备入库表格', input_type='STRING', required=1, readable=0, writable=1, visable=1, `scale`=NULL, `length`=NULL, binding=NULL, data_grid=NULL, tips=NULL, format=NULL, span=12, sub_title=NULL, `options`=NULL, flow_type='OFFICE_SOP_FLOW', form_setup=8, handle=0, form_group=NULL, role_type=NULL, create_id=1, create_time=1
+WHERE id=87;

+ 2 - 2
sop-business/src/main/resources/mapper/TBDeviceInOutMapper.xml

@@ -244,10 +244,10 @@
             </if>
             <choose>
                 <when test="sopNo != null and sopNo != ''">
-                    AND EXISTS(SELECT 1 FROM t_b_device_in_out tbdio WHERE tbdio.serial_no = sd.device_code AND tbdio.sop_no = #{sopNo})
+                    AND EXISTS(SELECT 1 FROM t_b_device_in_out tbdio WHERE tbdio.device_no = sd.device_code AND tbdio.sop_no = #{sopNo})
                 </when>
                 <otherwise>
-                    AND EXISTS(SELECT 1 FROM t_b_device_in_out tbdio WHERE tbdio.serial_no = sd.device_code AND tbdio.service_id IS NULL)
+                    AND EXISTS(SELECT 1 FROM t_b_device_in_out tbdio WHERE tbdio.device_no = sd.device_code AND tbdio.service_id IS NULL)
                 </otherwise>
             </choose>
         </where>

+ 41 - 21
sop-business/src/main/resources/mapper/TBSopInfoMapper.xml

@@ -185,7 +185,7 @@
             <if test="userId != null and userId != ''">
                 <choose>
                     <when test="roleType != null and roleType != '' and roleType == 'EFFECT_ENGINEER'">
-                        and (tbsid.engineer_user_id is not null and tbsid.engineer_user_id = #{userId})
+                        and (tbsid.engineer_user_id is not null and tbsid.engineer_user_id = #{userId} and tbsid.after_region_to_enginess = 0)
                     </when>
                     <otherwise>
                         and (tbsid.assistant_engineer_user_ids is not null and FIND_IN_SET(#{userId},tbsid.assistant_engineer_user_ids))
@@ -220,7 +220,7 @@
             <if test="userId != null and userId != ''">
                 <choose>
                     <when test="roleType != null and roleType != '' and roleType == 'EFFECT_ENGINEER'">
-                        and (tbsid.engineer_user_id is not null and tbsid.engineer_user_id = #{userId})
+                        and (tbsid.engineer_user_id is not null and tbsid.engineer_user_id = #{userId} and tbsid.after_region_to_enginess = 0)
                     </when>
                     <otherwise>
                         and (tbsid.assistant_engineer_user_ids is not null and FIND_IN_SET(#{userId},tbsid.assistant_engineer_user_ids))
@@ -247,28 +247,48 @@
 
     <select id="findSopPassage" resultType="java.util.Map">
         select
+        group_concat(distinct t.regionUserIds) as regionUserIds,
+        group_concat(distinct t.engineerUserIds) as engineerUserIds,
+        group_concat(distinct t.assistantEngineerUserIds) as assistantEngineerUserIds
+        from
+        (select
             group_concat(distinct tbsid.region_user_id) as regionUserIds,
             group_concat(distinct tbsid.engineer_user_id) as engineerUserIds,
             group_concat(distinct tbsid.assistant_engineer_user_ids) as assistantEngineerUserIds
-        from
-            t_b_sop_info_detail tbsid
+        from t_b_sop_info_detail tbsid
+        where
+        exists(
+        select tbsi.id from t_b_sop_info tbsi
+        left join t_f_custom_flow_entity tfcfe on tfcfe.code = tbsi.sop_no
+        left join t_f_flow_approve tffa on tffa.flow_id = tfcfe.flow_id
+        <where> 1 = 1
+        <if test="serviceId != null and serviceId != ''">
+            and tbsi.service_id = #{serviceId}
+        </if>
+            and tbsi.status = 'START'
+            and tffa.status not in('FINISH', 'END')
+            and tbsid.sop_info_id = tbsi.id
+            and tbsid.after_region_to_enginess = 0
+        </where>)
+        union all
+        select
+            group_concat(distinct tbsid.region_user_id) as regionUserIds,
+            null as engineerUserIds,
+            group_concat(distinct tbsid.assistant_engineer_user_ids) as assistantEngineerUserIds
+        from t_b_sop_info_detail tbsid
         where
-            exists(
-                    select
-                        tbsi.id
-                    from
-                        t_b_sop_info tbsi
-                            left join t_f_custom_flow_entity tfcfe on
-                            tfcfe.code = tbsi.sop_no
-                            left join t_f_flow_approve tffa on
-                            tffa.flow_id = tfcfe.flow_id
-                    <where>
-                        <if test="serviceId != null and serviceId != ''">
-                            and tbsi.service_id = #{serviceId}
-                        </if>
-                      and tbsi.status = 'START'
-                      and tffa.status not in('FINISH', 'END')
-                      and tbsid.sop_info_id = tbsi.id)
-                    </where>
+        exists(
+        select tbsi.id from t_b_sop_info tbsi
+        left join t_f_custom_flow_entity tfcfe on tfcfe.code = tbsi.sop_no
+        left join t_f_flow_approve tffa on tffa.flow_id = tfcfe.flow_id
+        <where> 1 = 1
+        <if test="serviceId != null and serviceId != ''">
+            and tbsi.service_id = #{serviceId}
+        </if>
+            and tbsi.status = 'START'
+            and tffa.status not in('FINISH', 'END')
+            and tbsid.sop_info_id = tbsi.id
+            and tbsid.after_region_to_enginess = 1
+        </where>)) t
     </select>
 </mapper>

+ 2 - 0
sop-common/src/main/java/com/qmth/sop/common/contant/SystemConstant.java

@@ -139,6 +139,7 @@ public class SystemConstant {
     public static final String APPROVE_RADIO_REGION = "approve_radio_region";
     public static final String APPROVE_REMARK_REGION = "approve_remark_region";
     public static final String SIGN_REGION = "sign_region";
+    public static final String THIRD_SERVICE_REGION_CB = "third_service_region_cb";
 
     public static final String DEVICE_OUT_TIME = "device_out_time";//设备出库时间
     public static final String DEVICE_OUT_TABLE = "device_out_table";//设备出库
@@ -333,6 +334,7 @@ public class SystemConstant {
     public static final String FLOW_SYS_USER = "sysUser";
     public static final String CRM_INFO = "crmInfo";
     public static final String SOP_ID = "sopId";
+    public static final String SOURCE = "source";
 
     /**
      * 锁