wangliang 1 år sedan
förälder
incheckning
e9317c5df1

+ 1 - 2
sop-api/install/mysql/init/init.sql

@@ -2028,7 +2028,6 @@ INSERT INTO `sys_privilege` VALUES (3050, '获取所有用户(动态表单用
 INSERT INTO `sys_privilege` VALUES (3051, '小程序签名预览', '/api/admin/common/file/preview/app', 'URL', 64, 6, 'SYS', NULL, 1, 1, 0);
 INSERT INTO `sys_privilege` VALUES (3052, '考勤异常详情接口', '/api/admin/ding/exception/apply/view', 'URL', 27, 6, 'SYS', NULL, 1, 1, 0);
 INSERT INTO `sys_privilege` VALUES (1099, '二期接口', '/api/admin/tb/crm/analyse/project/count', 'URL', 64, 32, 'SYS', NULL, 1, 1, 0);
-INSERT INTO `sys_privilege` VALUES (3053, 'sop客户查询', '/api/sys/custom/sop/get', 'URL', 3, 4, 'SYS', NULL, 1, 1, 0);
 
 INSERT INTO `sys_role` VALUES (1, NULL, '系统管理员', 1, 'ADMIN', NULL, NULL, NULL, NULL, 1, '系统角色');
 INSERT INTO `sys_role` VALUES (2, NULL, '总负责人', 1, 'PMO', NULL, NULL, 443437441441857536, 1697425600601, 1, '系统角色');
@@ -3310,7 +3309,7 @@ INSERT INTO `t_d_form_widget` VALUES (96, 'RADIO_WITH_INPUT', 'FORM', 'bar_code_
 INSERT INTO `t_d_form_widget` VALUES (97, 'RADIO', 'FORM', 'has_objective_card', 'has_objective_card', '有无客观题卡', 'STRING', 1, 0, 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, 6, NULL, '[{\"value\":\"HAVA\",\"label\":\"有\"},{\"value\":\"NOT_HAVA\",\"label\":\"无\"}]', 'CLOUD_MARK_SOP_FLOW', 1, 0, NULL, NULL, 1, 1);
 INSERT INTO `t_d_form_widget` VALUES (98, 'NUMBER', 'FORM', 'scan_count', 'scan_count', '扫描仪数量(台)', 'INT', 1, 0, 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, 3, NULL, NULL, 'CLOUD_MARK_SOP_FLOW', 1, 0, NULL, NULL, 1, 1);
 INSERT INTO `t_d_form_widget` VALUES (99, 'DATE', 'FORM', 'exam_student_Internal_date', 'exam_student_Internal_date', '考生数据内部交接时间', 'LONG', 1, 0, 1, 1, NULL, NULL, NULL, NULL, NULL, 'yyyy-MM-dd', 6, NULL, NULL, 'CLOUD_MARK_SOP_FLOW', 1, 0, NULL, NULL, 1, 1);
-INSERT INTO `t_d_form_widget` VALUES (100, 'NUMBER', 'FORM', 'week_people_day', 'week_people_day', '现场标准服务周期(人天)', 'INT', 1, 0, 1, 1, NULL, NULL, NULL, '/api/sys/custom/sop/get?id=#{customId}', NULL, NULL, 3, NULL, NULL, 'CLOUD_MARK_SOP_FLOW', 1, 0, NULL, NULL, 1, 1);
+INSERT INTO `t_d_form_widget` VALUES (100, 'NUMBER', 'FORM', 'week_people_day', 'week_people_day', '现场标准服务周期(人天)', 'INT', 1, 0, 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, 3, NULL, NULL, 'CLOUD_MARK_SOP_FLOW', 1, 0, NULL, NULL, 1, 1);
 INSERT INTO `t_d_form_widget` VALUES (101, 'DATE', 'FORM', 'project_key_info_date', 'project_key_info_date', '项目关键信息提交截止时间', 'LONG', 1, 0, 1, 1, NULL, NULL, NULL, NULL, NULL, 'yyyy-MM-dd', 6, NULL, NULL, 'CLOUD_MARK_SOP_FLOW', 1, 1, NULL, NULL, 1, 1);
 INSERT INTO `t_d_form_widget` VALUES (102, 'DATE', 'FORM', 'service_finish_plan_date', 'service_finish_plan_date', '现场服务完成撤场计划时间', 'LONG', 1, 0, 1, 1, NULL, NULL, NULL, NULL, NULL, 'yyyy-MM-dd', 6, NULL, NULL, 'CLOUD_MARK_SOP_FLOW', 1, 1, NULL, NULL, 1, 1);
 INSERT INTO `t_d_form_widget` VALUES (103, 'FORM_GROUP_TITLE', 'FORM', 'project_people_plan_title', 'project_people_plan_title', '项目人员安排及风险预估', 'STRING', 0, 1, 0, 1, NULL, NULL, NULL, NULL, NULL, NULL, 12, NULL, NULL, 'CLOUD_MARK_SOP_FLOW', 1, 0, NULL, NULL, 1, 1);

+ 0 - 13
sop-api/src/main/java/com/qmth/sop/server/api/SysCustomController.java

@@ -126,19 +126,6 @@ public class SysCustomController {
         return ResultUtil.ok(sysCustomResult);
     }
 
-    /**
-     * 获取单个客户
-     *
-     * @param id
-     * @return
-     */
-    @ApiOperation(value = "获取单个客户")
-    @RequestMapping(value = "/sop/get", method = RequestMethod.POST)
-    @ApiResponses({@ApiResponse(code = 200, message = "获取单个客户", response = SysCustomResult.class)})
-    public Result sopGetDetail(@ApiParam(value = "客户id", required = true) @RequestParam Long id) {
-        return ResultUtil.ok(sysCustomService.getById(id));
-    }
-
     @ApiOperation(value = "客户表导入")
     @RequestMapping(value = "/import", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = Object.class)})

+ 2 - 3
sop-api/src/main/java/com/qmth/sop/server/api/TBSopInfoController.java

@@ -54,9 +54,8 @@ public class TBSopInfoController {
     @ApiOperation(value = "sop元数据查询")
     @RequestMapping(value = "/metadata/list", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = FormWidgetMetadataResult.class)})
-    public Result metadataList(@ApiParam(value = "sop流程类型", required = true) @RequestParam TFCustomTypeEnum type,
-                               @ApiParam(value = "sop流程版本") @RequestParam(required = false) Integer version) {
-        return ResultUtil.ok(tdFormWidgetMetadataService.selectAll(type, version));
+    public Result metadataList(@ApiParam(value = "sop流程类型", required = true) @RequestParam TFCustomTypeEnum type) {
+        return ResultUtil.ok(tdFormWidgetMetadataService.selectAll(type));
     }
 
     @ApiOperation(value = "sop元数据修改")

+ 0 - 15
sop-business/src/main/java/com/qmth/sop/business/activiti/service/impl/ActivitiServiceImpl.java

@@ -122,9 +122,6 @@ public class ActivitiServiceImpl implements ActivitiService {
     @Resource
     TSJobRemindService tsJobRemindService;
 
-    @Resource
-    SysCustomService sysCustomService;
-
     /**
      * 根据deploymentId查找processDefinitionId
      *
@@ -933,18 +930,6 @@ public class ActivitiServiceImpl implements ActivitiService {
         if (Objects.nonNull(tfCustomFlowEntity.getCrmNo())) {
             crmProjectResult = tbCrmService.findCrmProjectBySopNoOrCrmNo(tfCustomFlowEntity.getCode(), tfCustomFlowEntity.getCrmNo());
         }
-        if (tfCustomFlow.getType() == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW && tfFlowApprove.getSetup().intValue() == 1) {
-            List<FlowFormWidgetResult> flowFormWidgetResultList = currFlowTaskResult.getFormProperty();
-            for (FlowFormWidgetResult f : flowFormWidgetResultList) {
-                if (f.getFormId().contains("week_people_day") && Objects.isNull(f.getValue())) {
-                    SysCustom sysCustom = sysCustomService.getById(crmProjectResult.getCustomId());
-                    JSONObject jsonObject = new JSONObject();
-                    jsonObject.put("value", sysCustom.getPeoperDay());
-                    f.setValue(jsonObject.toString());
-                    break;
-                }
-            }
-        }
         return new FlowViewResult(flowId, tfFlowApprove.getStatus(), tfCustomFlowEntity.getCode(), taskIdList, flowTaskHistoryList, currFlowTaskResult, flowApproveHistoryList, crmProjectResult);
     }
 

+ 11 - 0
sop-business/src/main/java/com/qmth/sop/business/bean/result/CrmProjectResult.java

@@ -81,6 +81,17 @@ public class CrmProjectResult {
     @ApiModelProperty("助理工程师集合")
     private List<UserArchivesDto> assistantEngineerList;
 
+    @ApiModelProperty(value = "标准人天")
+    private Integer peoperDay;
+
+    public Integer getPeoperDay() {
+        return peoperDay;
+    }
+
+    public void setPeoperDay(Integer peoperDay) {
+        this.peoperDay = peoperDay;
+    }
+
     public String getCrmNo() {
         return crmNo;
     }

+ 1 - 2
sop-business/src/main/java/com/qmth/sop/business/service/TDFormWidgetMetadataService.java

@@ -32,10 +32,9 @@ public interface TDFormWidgetMetadataService extends IService<TDFormWidgetMetada
      * 查询所有sop元数据
      *
      * @param type
-     * @param version
      * @return
      */
-    List<FormWidgetMetadataResult> selectAll(TFCustomTypeEnum type, Integer version);
+    List<FormWidgetMetadataResult> selectAll(TFCustomTypeEnum type);
 
     /**
      * 保存sop元数据

+ 6 - 7
sop-business/src/main/java/com/qmth/sop/business/service/impl/SopScheduleServiceImpl.java

@@ -47,16 +47,16 @@ public class SopScheduleServiceImpl extends ServiceImpl<SopScheduleMapper, TBSop
         List<Map<String, Object>> list = this.baseMapper.progress(serviceId);
         Map<String, Map<String, Object>> result = new HashMap<>();
         if (group.equals(SopAnalyseGroupEnum.POPULATION)) {
-            result.put("POPULATION", processData(list,group));
+            result.put("POPULATION", processData(list, group));
         } else if (group.equals(SopAnalyseGroupEnum.REGION)) {
-            list.stream().filter(map->map.get("region_name")!=null).collect(Collectors.groupingBy(map -> map.get("region_name"))).forEach((k, v) -> result.put(k.toString(), processData(v,group)));
+            list.stream().filter(map -> map.get("region_name") != null).collect(Collectors.groupingBy(map -> map.get("region_name"))).forEach((k, v) -> result.put(k.toString(), processData(v, group)));
         } else if (group.equals(SopAnalyseGroupEnum.SUPPLIER)) {
-            list.stream().filter(map->map.get("name")!=null).collect(Collectors.groupingBy(map -> map.get("name"))).forEach((k, v) -> result.put(k.toString(), processData(v,group)));
+            list.stream().filter(map -> map.get("name") != null).collect(Collectors.groupingBy(map -> map.get("name"))).forEach((k, v) -> result.put(k.toString(), processData(v, group)));
         }
         return result;
     }
 
-    private Map<String, Object> processData(List<Map<String, Object>> list,SopAnalyseGroupEnum group) {
+    private Map<String, Object> processData(List<Map<String, Object>> list, SopAnalyseGroupEnum group) {
         Map<String, Object> map = new HashMap<>();
         if (group.equals(SopAnalyseGroupEnum.REGION)) {
             map.put("region_id", list.get(0).get("region_id"));
@@ -82,7 +82,7 @@ public class SopScheduleServiceImpl extends ServiceImpl<SopScheduleMapper, TBSop
         TFCustomTypeEnum[] types = {TFCustomTypeEnum.OFFICE_SOP_FLOW, TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW};
         List<Map<String, Object>> tempList = new ArrayList<>();
         for (TFCustomTypeEnum type : types) {
-            List<FormWidgetMetadataResult> formWidgetMetadataResults = tdFormWidgetMetadataService.selectAll(type, 1);
+            List<FormWidgetMetadataResult> formWidgetMetadataResults = tdFormWidgetMetadataService.selectAll(type);
             String fieldId = formWidgetMetadataResults.stream().filter(e -> e.getFieldTitle().equals("现场标准服务周期(人天)")).findFirst().get().getFieldId();
             SopInfoListParam sopInfoListParam = getSopInfoListParam(serviceId, type, fieldId);
             String tableName = sopInfoListParam.getType().getTableName() + "_" + sopInfoListParam.getVersion();
@@ -113,12 +113,11 @@ public class SopScheduleServiceImpl extends ServiceImpl<SopScheduleMapper, TBSop
         tempList.stream().collect(Collectors.groupingBy(map -> map.get("datetime"))).forEach((k, v) -> {
             Map<String, Object> map = new HashMap<>();
             map.put("datetime", k);
-            map.put("count", v.stream().filter(map1->map1.get("count")!=null).mapToInt(m -> Integer.parseInt(m.get("count").toString())).sum());
+            map.put("count", v.stream().filter(map1 -> map1.get("count") != null).mapToInt(m -> Integer.parseInt(m.get("count").toString())).sum());
             plan.add(map);
         });
 
 
-
         result.put("plan", plan);
         result.put("actual", this.baseMapper.actualProgress(serviceId));
         return result;

+ 3 - 4
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBSopInfoServiceImpl.java

@@ -352,10 +352,9 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
         if (sopInfoListParam.getType() != TFCustomTypeEnum.OFFICE_SOP_FLOW && sopInfoListParam.getType() != TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW) {
             throw ExceptionResultEnum.ERROR.exception("流程类型只能为教务处或研究生");
         }
-        if (Objects.isNull(sopInfoListParam.getVersion())) {
-            TFCustomFlow maxTfCustomFlow = tfCustomFlowService.findMaxVersion(null, null, sopInfoListParam.getType());
-            sopInfoListParam.setVersion(maxTfCustomFlow.getVersion());
-        }
+        TFCustomFlow maxTfCustomFlow = tfCustomFlowService.findMaxVersion(null, null, sopInfoListParam.getType());
+        Optional.ofNullable(maxTfCustomFlow).orElseThrow(() -> ExceptionResultEnum.FLOW_CUSTOM_NO_DATA.exception());
+        sopInfoListParam.setVersion(maxTfCustomFlow.getVersion());
         String tableName = sopInfoListParam.getType().getTableName() + "_" + sopInfoListParam.getVersion();
         String fieldName = null, fieldValue = null, fieldOrder = null;
         StringJoiner stringJoinerView = new StringJoiner(",");

+ 5 - 8
sop-business/src/main/java/com/qmth/sop/business/service/impl/TDFormWidgetMetadataServiceImpl.java

@@ -21,7 +21,7 @@ import org.springframework.util.CollectionUtils;
 
 import javax.annotation.Resource;
 import java.util.List;
-import java.util.Objects;
+import java.util.Optional;
 import java.util.Set;
 
 /**
@@ -77,19 +77,16 @@ public class TDFormWidgetMetadataServiceImpl extends ServiceImpl<TDFormWidgetMet
      * 查询所有sop元数据
      *
      * @param type
-     * @param version
      * @return
      */
     @Override
-    public List<FormWidgetMetadataResult> selectAll(TFCustomTypeEnum type, Integer version) {
+    public List<FormWidgetMetadataResult> selectAll(TFCustomTypeEnum type) {
         if (type != TFCustomTypeEnum.OFFICE_SOP_FLOW && type != TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW) {
             throw ExceptionResultEnum.ERROR.exception("流程类型只能为教务处或研究生");
         }
-        if (Objects.isNull(version)) {
-            TFCustomFlow maxTfCustomFlow = tfCustomFlowService.findMaxVersion(null, null, type);
-            version = maxTfCustomFlow.getVersion();
-        }
-        return this.baseMapper.getFormWidgetMetadataResult(type.name(), version);
+        TFCustomFlow maxTfCustomFlow = tfCustomFlowService.findMaxVersion(null, null, type);
+        Optional.ofNullable(maxTfCustomFlow).orElseThrow(() -> ExceptionResultEnum.FLOW_CUSTOM_NO_DATA.exception());
+        return this.baseMapper.getFormWidgetMetadataResult(type.name(), maxTfCustomFlow.getVersion());
     }
 
     /**

+ 1 - 10
sop-business/src/main/resources/db/log/wangliang_update_log.sql

@@ -1989,13 +1989,4 @@ SET code='DATE', `type`='FORM', form_id='device_out_time', form_name='device_out
 WHERE id=145;
 UPDATE t_d_form_widget
 SET code='DEVICE_OUT_TABLE', `type`='FORM', form_id='device_out_table', form_name='device_out_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='CLOUD_MARK_SOP_FLOW', form_setup=4, handle=0, form_group=NULL, role_type=NULL, create_id=1, create_time=1
-WHERE id=146;
-
---2023.11.15update
-INSERT INTO sys_privilege
-(id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
-VALUES(3053, 'sop客户查询', '/api/sys/custom/sop/get', 'URL', 3, 4, 'SYS', NULL, 1, 1, 0);
-
-UPDATE t_d_form_widget
-SET code='NUMBER', `type`='FORM', form_id='week_people_day', form_name='week_people_day', title='现场标准服务周期(人天)', input_type='INT', required=1, readable=0, writable=1, visable=1, `scale`=NULL, `length`=NULL, binding=NULL, data_grid='/api/sys/custom/sop/get?id=#{customId}', tips=NULL, format=NULL, span=3, sub_title=NULL, `options`=NULL, flow_type='CLOUD_MARK_SOP_FLOW', form_setup=1, handle=0, form_group=NULL, role_type=NULL, create_id=1, create_time=1
-WHERE id=100;
+WHERE id=146;

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

@@ -266,7 +266,8 @@
             regionManager.id AS regionManagerId,
             regionManager.real_name AS regionManagerName,
             regionCoordinator.id AS regionCoordinatorId,
-            regionCoordinator.real_name AS regionCoordinatorName
+            regionCoordinator.real_name AS regionCoordinatorName,
+            sc.peoper_day as peoperDay
         FROM
             t_f_custom_flow_entity tfcfe
                 LEFT JOIN
@@ -309,7 +310,8 @@
             regionManager.id AS regionManagerId,
             regionManager.real_name AS regionManagerName,
             regionCoordinator.id AS regionCoordinatorId,
-            regionCoordinator.real_name AS regionCoordinatorName
+            regionCoordinator.real_name AS regionCoordinatorName,
+            sc.peoper_day as peoperDay
         FROM
             t_b_crm tbc
                 LEFT JOIN