Explorar o código

新增sop计划时间查询

wangliang hai 1 ano
pai
achega
0f087ebcfd

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 3
sop-api/src/main/java/com/qmth/sop/server/api/TBSopInfoController.java


+ 92 - 0
sop-business/src/main/java/com/qmth/sop/business/bean/result/SopPlanTimeResult.java

@@ -0,0 +1,92 @@
+package com.qmth.sop.business.bean.result;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.qmth.sop.common.enums.TFCustomTypeEnum;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+/**
+ * @Description: sop执行时间 result
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2023/2/17
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class SopPlanTimeResult implements Serializable {
+
+    @ApiModelProperty(value = "sop类型")
+    TFCustomTypeEnum type;
+
+    @ApiModelProperty(value = "扫描开始时间")
+    Long scanStartTime;
+
+    @ApiModelProperty(value = "扫描结束时间")
+    Long scanEndTime;
+
+    @ApiModelProperty(value = "阅卷开始时间")
+    Long markStartTime;
+
+    @ApiModelProperty(value = "阅卷结束时间")
+    Long markEndTime;
+
+    public SopPlanTimeResult() {
+
+    }
+
+    public SopPlanTimeResult(TFCustomTypeEnum type, Long scanStartTime, Long scanEndTime, Long markStartTime,
+            Long markEndTime) {
+        this.type = type;
+        this.scanStartTime = scanStartTime;
+        this.scanEndTime = scanEndTime;
+        this.markStartTime = markStartTime;
+        this.markEndTime = markEndTime;
+    }
+
+    public SopPlanTimeResult(TFCustomTypeEnum type, Long markStartTime, Long markEndTime) {
+        this.type = type;
+        this.markStartTime = markStartTime;
+        this.markEndTime = markEndTime;
+    }
+
+    public TFCustomTypeEnum getType() {
+        return type;
+    }
+
+    public void setType(TFCustomTypeEnum type) {
+        this.type = type;
+    }
+
+    public Long getScanStartTime() {
+        return scanStartTime;
+    }
+
+    public void setScanStartTime(Long scanStartTime) {
+        this.scanStartTime = scanStartTime;
+    }
+
+    public Long getScanEndTime() {
+        return scanEndTime;
+    }
+
+    public void setScanEndTime(Long scanEndTime) {
+        this.scanEndTime = scanEndTime;
+    }
+
+    public Long getMarkStartTime() {
+        return markStartTime;
+    }
+
+    public void setMarkStartTime(Long markStartTime) {
+        this.markStartTime = markStartTime;
+    }
+
+    public Long getMarkEndTime() {
+        return markEndTime;
+    }
+
+    public void setMarkEndTime(Long markEndTime) {
+        this.markEndTime = markEndTime;
+    }
+}

+ 9 - 4
sop-business/src/main/java/com/qmth/sop/business/service/TBSopInfoService.java

@@ -3,10 +3,7 @@ package com.qmth.sop.business.service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.qmth.sop.business.bean.params.*;
-import com.qmth.sop.business.bean.result.CrmProjectResult;
-import com.qmth.sop.business.bean.result.FlowResult;
-import com.qmth.sop.business.bean.result.FlowTaskResult;
-import com.qmth.sop.business.bean.result.SopInfoResult;
+import com.qmth.sop.business.bean.result.*;
 import com.qmth.sop.business.entity.TBSopInfo;
 import com.qmth.sop.business.entity.TFCustomFlow;
 import com.qmth.sop.business.entity.TFCustomFlowEntity;
@@ -197,4 +194,12 @@ public interface TBSopInfoService extends IService<TBSopInfo> {
      * @return
      */
     ServiceScopeEnum findServiceScope(TFCustomTypeEnum type, FlowTaskResult flowTaskResult);
+
+    /**
+     * 根据sop单号查询sop计划时间
+     *
+     * @param sopNo
+     * @return
+     */
+    SopPlanTimeResult querySopPlanTime(String sopNo);
 }

+ 44 - 0
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBSopInfoServiceImpl.java

@@ -1282,4 +1282,48 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
         }
         return scopeEnum;
     }
+
+    /**
+     * 根据sop单号查询sop计划时间
+     *
+     * @param sopNo
+     * @return
+     */
+    @Override
+    public SopPlanTimeResult querySopPlanTime(String sopNo) {
+        TFCustomFlowEntity tfCustomFlowEntity = tfCustomFlowEntityService.getOne(
+                new QueryWrapper<TFCustomFlowEntity>().lambda().eq(TFCustomFlowEntity::getCode, sopNo));
+        Optional.ofNullable(tfCustomFlowEntity).orElseThrow(() -> ExceptionResultEnum.FLOW_ENTITY_NO_DATA.exception());
+
+        TFCustomFlow tfCustomFlow = tfCustomFlowService.getById(tfCustomFlowEntity.gettFCustomFlowId());
+        Optional.ofNullable(tfCustomFlow).orElseThrow(() -> ExceptionResultEnum.FLOW_CUSTOM_NO_DATA.exception());
+
+        Long scanStartTime = null, scanEndTime = null, markStartTime = null, markEndTime = null;
+        FlowTaskResult flowTaskResult = tbSopInfoService.getFormProperties(tfCustomFlowEntity, 1);
+        List<FlowFormWidgetResult> flowFormWidgetResultList = flowTaskResult.getFormProperty();
+        for (FlowFormWidgetResult f : flowFormWidgetResultList) {
+            if (f.getFormId().contains(ProcessLimitedEnum.SCAN_START_TIME.getKey()) && Objects.nonNull(f.getValue())
+                    && !Objects.equals(f.getValue(), "{\"value\":null}")) {
+                JSONObject jsonObject = JSONObject.parseObject(f.getValue());
+                String value = jsonObject.getString(SystemConstant.VALUE);
+                scanStartTime = Long.parseLong(value);
+            } else if (f.getFormId().contains(ProcessLimitedEnum.SCAN_END_TIME.getKey()) && Objects.nonNull(
+                    f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
+                JSONObject jsonObject = JSONObject.parseObject(f.getValue());
+                String value = jsonObject.getString(SystemConstant.VALUE);
+                scanEndTime = Long.parseLong(value);
+            } else if (f.getFormId().contains(ProcessLimitedEnum.MARK_START_TIME.getKey()) && Objects.nonNull(
+                    f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
+                JSONObject jsonObject = JSONObject.parseObject(f.getValue());
+                String value = jsonObject.getString(SystemConstant.VALUE);
+                markStartTime = Long.parseLong(value);
+            } else if (f.getFormId().contains(ProcessLimitedEnum.MARK_END_TIME.getKey()) && Objects.nonNull(
+                    f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
+                JSONObject jsonObject = JSONObject.parseObject(f.getValue());
+                String value = jsonObject.getString(SystemConstant.VALUE);
+                markEndTime = Long.parseLong(value);
+            }
+        }
+        return new SopPlanTimeResult(tfCustomFlow.getType(), scanStartTime, scanEndTime, markStartTime, markEndTime);
+    }
 }

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio