Răsfoiți Sursa

新增我的工作台

wangliang 1 an în urmă
părinte
comite
ab79b05c5a

+ 44 - 0
sop-business/src/main/java/com/qmth/sop/business/bean/result/DingApplyDoneResult.java

@@ -44,6 +44,50 @@ public class DingApplyDoneResult extends WorkTaskResult implements Serializable
     @ApiModelProperty(value = "审核人")
     String approveUsersName;
 
+    @ApiModelProperty(value = "审核信息")
+    String approveInfo;
+
+    @ApiModelProperty(value = "审核时间")
+    Long approveTime;
+
+    @ApiModelProperty(value = "供应商名称")
+    String supplierName;
+
+    @ApiModelProperty(value = "供应商编码")
+    String supplierCode;
+
+    public Long getApproveTime() {
+        return approveTime;
+    }
+
+    public void setApproveTime(Long approveTime) {
+        this.approveTime = approveTime;
+    }
+
+    public String getSupplierName() {
+        return supplierName;
+    }
+
+    public void setSupplierName(String supplierName) {
+        this.supplierName = supplierName;
+    }
+
+    public String getSupplierCode() {
+        return supplierCode;
+    }
+
+    public void setSupplierCode(String supplierCode) {
+        this.supplierCode = supplierCode;
+    }
+
+    public String getApproveInfo() {
+        return approveInfo;
+    }
+
+    public void setApproveInfo(String approveInfo) {
+        this.approveInfo = approveInfo;
+    }
+
     public Long getCreateTime() {
         return createTime;
     }

+ 22 - 0
sop-business/src/main/java/com/qmth/sop/business/bean/result/DingApplyUnDoneResult.java

@@ -41,6 +41,28 @@ public class DingApplyUnDoneResult extends WorkTaskResult implements Serializabl
     @ApiModelProperty(value = "申请时间")
     Long createTime;
 
+    @ApiModelProperty(value = "供应商名称")
+    String supplierName;
+
+    @ApiModelProperty(value = "供应商编码")
+    String supplierCode;
+
+    public String getSupplierName() {
+        return supplierName;
+    }
+
+    public void setSupplierName(String supplierName) {
+        this.supplierName = supplierName;
+    }
+
+    public String getSupplierCode() {
+        return supplierCode;
+    }
+
+    public void setSupplierCode(String supplierCode) {
+        this.supplierCode = supplierCode;
+    }
+
     public InOutTypeEnum getDingExceptionType() {
         return dingExceptionType;
     }

+ 221 - 0
sop-business/src/main/java/com/qmth/sop/business/bean/result/WorkWarnResult.java

@@ -0,0 +1,221 @@
+package com.qmth.sop.business.bean.result;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.qmth.sop.common.enums.ProductTypeEnum;
+import com.qmth.sop.common.enums.WarnTypeEnum;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.util.Objects;
+
+/**
+ * @Description: 工作台预警待办result
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2023/8/10
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class WorkWarnResult implements Serializable {
+
+    @ApiModelProperty(value = "主键")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long id;
+
+    @ApiModelProperty(value = "流程编号")
+    private String code;
+
+    @ApiModelProperty(value = "sop单号")
+    private String sopNo;
+
+    @ApiModelProperty(value = "crm单号")
+    private String crmNo;
+
+    @ApiModelProperty(value = "crm名称")
+    private String crmName;
+
+    @ApiModelProperty(value = "服务单元id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long serviceId;
+
+    @ApiModelProperty(value = "服务单元名称")
+    private String serviceName;
+
+    @ApiModelProperty(value = "服务单元类型,OFFICE:教务处,CLOUD_MARK:云阅卷")
+    private ProductTypeEnum serviceType;
+
+    @ApiModelProperty(value = "服务单元类型str")
+    private String serviceTypeStr;
+
+    @ApiModelProperty(value = "客户id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long customId;
+
+    @ApiModelProperty(value = "客户名称")
+    private String customName;
+
+    @ApiModelProperty(value = "发起人id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long createId;
+
+    @ApiModelProperty(value = "发起人真实姓名")
+    private String createRealName;
+
+    @ApiModelProperty(value = "客户类型")
+    private ProductTypeEnum customType;
+
+    @ApiModelProperty(value = "客户类型str")
+    private String customTypeStr;
+
+    @ApiModelProperty(value = "创建时间")
+    private Long createTime;
+
+    @ApiModelProperty(value = "预警类型")
+    private WarnTypeEnum warnType;
+
+    public WarnTypeEnum getWarnType() {
+        return warnType;
+    }
+
+    public void setWarnType(WarnTypeEnum warnType) {
+        this.warnType = warnType;
+    }
+
+    public ProductTypeEnum getCustomType() {
+        return customType;
+    }
+
+    public void setCustomType(ProductTypeEnum customType) {
+        this.customType = customType;
+    }
+
+    public String getCustomTypeStr() {
+        if (Objects.nonNull(customType)) {
+            return customType.getTitle();
+        } else {
+            return customTypeStr;
+        }
+    }
+
+    public void setCustomTypeStr(String customTypeStr) {
+        this.customTypeStr = customTypeStr;
+    }
+
+    public String getCrmNo() {
+        return crmNo;
+    }
+
+    public void setCrmNo(String crmNo) {
+        this.crmNo = crmNo;
+    }
+
+    public String getCrmName() {
+        return crmName;
+    }
+
+    public void setCrmName(String crmName) {
+        this.crmName = crmName;
+    }
+
+    public Long getServiceId() {
+        return serviceId;
+    }
+
+    public void setServiceId(Long serviceId) {
+        this.serviceId = serviceId;
+    }
+
+    public String getServiceName() {
+        return serviceName;
+    }
+
+    public void setServiceName(String serviceName) {
+        this.serviceName = serviceName;
+    }
+
+    public ProductTypeEnum getServiceType() {
+        return serviceType;
+    }
+
+    public void setServiceType(ProductTypeEnum serviceType) {
+        this.serviceType = serviceType;
+    }
+
+    public String getServiceTypeStr() {
+        if (Objects.nonNull(serviceType)) {
+            return serviceType.getTitle();
+        } else {
+            return serviceTypeStr;
+        }
+    }
+
+    public void setServiceTypeStr(String serviceTypeStr) {
+        this.serviceTypeStr = serviceTypeStr;
+    }
+
+    public Long getCustomId() {
+        return customId;
+    }
+
+    public void setCustomId(Long customId) {
+        this.customId = customId;
+    }
+
+    public String getCustomName() {
+        return customName;
+    }
+
+    public void setCustomName(String customName) {
+        this.customName = customName;
+    }
+
+    public Long getCreateId() {
+        return createId;
+    }
+
+    public void setCreateId(Long createId) {
+        this.createId = createId;
+    }
+
+    public String getCreateRealName() {
+        return createRealName;
+    }
+
+    public void setCreateRealName(String createRealName) {
+        this.createRealName = createRealName;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getSopNo() {
+        return sopNo;
+    }
+
+    public void setSopNo(String sopNo) {
+        this.sopNo = sopNo;
+    }
+
+    public Long getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Long createTime) {
+        this.createTime = createTime;
+    }
+}

+ 21 - 10
sop-business/src/main/java/com/qmth/sop/business/mapper/TBDelayWarnMapper.java

@@ -3,16 +3,15 @@ package com.qmth.sop.business.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.qmth.sop.business.bean.result.TBDelayWarnResult;
+import com.qmth.sop.business.bean.result.WorkWarnResult;
 import com.qmth.sop.business.entity.TBDelayWarn;
-import com.qmth.sop.common.enums.DelayWarnStatusEnum;
-import com.qmth.sop.common.enums.DelayWarnTypeEnum;
-import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
+
 import java.util.Map;
 
 /**
  * 延期预警跟进表 Mapper 接口.
- * 
+ *
  * @author: shudonghui
  * @date: 2023-08-08 16:02:21
  * @version: 1.0
@@ -21,11 +20,23 @@ import java.util.Map;
  */
 public interface TBDelayWarnMapper extends BaseMapper<TBDelayWarn> {
 
-	/**
-	 * 查询列表
-	 * @param iPage
-	 * @return
-	 */
-    IPage<TBDelayWarnResult> query(IPage<Map> iPage, @Param("type") String type, @Param("status") String status, @Param("serviceId")  Long serviceId, @Param("custom")  String custom, @Param("fieldObj")  String fieldObj, @Param("sopNo")  String sopNo, @Param("startTime")  Long startTime, @Param("endTime")  Long endTime,@Param("id") Long id);
+    /**
+     * 查询列表
+     *
+     * @param iPage
+     * @return
+     */
+    IPage<TBDelayWarnResult> query(IPage<Map> iPage, @Param("type") String type, @Param("status") String status, @Param("serviceId") Long serviceId, @Param("custom") String custom, @Param("fieldObj") String fieldObj, @Param("sopNo") String sopNo, @Param("startTime") Long startTime, @Param("endTime") Long endTime, @Param("id") Long id);
 
+    /**
+     * 获取预警待办
+     *
+     * @param iPage
+     * @param userId
+     * @param type
+     * @param serviceId
+     * @param customName
+     * @return
+     */
+    IPage<WorkWarnResult> getWarnTaskList(IPage<Map> iPage, @Param("userId") Long userId, @Param("type") String type, @Param("serviceId") Long serviceId, @Param("customName") String customName);
 }

+ 27 - 16
sop-business/src/main/java/com/qmth/sop/business/service/TBDelayWarnService.java

@@ -1,12 +1,13 @@
 package com.qmth.sop.business.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.qmth.sop.business.bean.result.TBDelayWarnResult;
+import com.qmth.sop.business.bean.result.WorkWarnResult;
 import com.qmth.sop.business.entity.TBDelayWarn;
 import com.qmth.sop.common.enums.DelayWarnStatusEnum;
 import com.qmth.sop.common.enums.DelayWarnTypeEnum;
+import com.qmth.sop.common.enums.WarnTypeEnum;
 
 import java.util.Map;
 
@@ -19,31 +20,41 @@ import java.util.Map;
  * @email: shudonghui@qmth.com.cn
  * @Company: www.qmth.com.cn
  */
-public interface TBDelayWarnService extends IService<TBDelayWarn>{
+public interface TBDelayWarnService extends IService<TBDelayWarn> {
 
     /**
-    * 查询列表
-    *
-    * @param iPage
-    * @return
-    */
+     * 查询列表
+     *
+     * @param iPage
+     * @return
+     */
     IPage<TBDelayWarnResult> query(IPage<Map> iPage, DelayWarnTypeEnum type, DelayWarnStatusEnum status, Long serviceId, String custom, String fieldObj, String sopNo, Long startTime, Long endTime, Long id);
 
     /**
-    * 新增修改延期预警跟进表
-    *
-    * @param tBDelayWarn
-    */
+     * 新增修改延期预警跟进表
+     *
+     * @param tBDelayWarn
+     */
     Boolean saveTBDelayWarn(TBDelayWarn tBDelayWarn);
 
 
     /**
-    * 删除延期预警跟进表
-    *
-    * @param id
-    */
+     * 删除延期预警跟进表
+     *
+     * @param id
+     */
     Boolean delete(Long id);
 
-
+    /**
+     * 获取预警待办
+     *
+     * @param iPage
+     * @param userId
+     * @param type
+     * @param serviceId
+     * @param customName
+     * @return
+     */
+    public IPage<WorkWarnResult> getWarnTaskList(IPage<Map> iPage, Long userId, WarnTypeEnum type, Long serviceId, String customName);
     TBDelayWarnResult get(long id);
 }

+ 18 - 5
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBDelayWarnServiceImpl.java

@@ -5,16 +5,14 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.qmth.boot.api.exception.ApiException;
 import com.qmth.sop.business.bean.result.TBDelayWarnResult;
+import com.qmth.sop.business.bean.result.WorkWarnResult;
 import com.qmth.sop.business.entity.SysUser;
 import com.qmth.sop.business.entity.TBDelayWarn;
 import com.qmth.sop.business.entity.TBDelayWarnDetail;
 import com.qmth.sop.business.mapper.TBDelayWarnMapper;
 import com.qmth.sop.business.service.TBDelayWarnDetailService;
 import com.qmth.sop.business.service.TBDelayWarnService;
-import com.qmth.sop.common.enums.DelayWarnStatusEnum;
-import com.qmth.sop.common.enums.DelayWarnTypeEnum;
-import com.qmth.sop.common.enums.ExceptionResultEnum;
-import com.qmth.sop.common.enums.FieldUniqueEnum;
+import com.qmth.sop.common.enums.*;
 import com.qmth.sop.common.util.ResultUtil;
 import com.qmth.sop.common.util.ServletUtil;
 import org.springframework.dao.DuplicateKeyException;
@@ -105,5 +103,20 @@ public class TBDelayWarnServiceImpl extends ServiceImpl<TBDelayWarnMapper, TBDel
 
     }
 
-
+    /**
+     * 获取预警待办
+     *
+     * @param iPage
+     * @param userId
+     * @param type
+     * @param serviceId
+     * @param customName
+     * @return
+     */
+    @Override
+    public IPage<WorkWarnResult> getWarnTaskList(IPage<Map> iPage, Long userId, WarnTypeEnum type, Long serviceId, String customName) {
+        SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
+        userId = Objects.nonNull(sysUser) ? sysUser.getId() : userId;
+        return this.baseMapper.getWarnTaskList(iPage, userId, Objects.nonNull(type) ? type.name() : null, serviceId, customName);
+    }
 }

+ 6 - 0
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBDingApplyServiceImpl.java

@@ -144,6 +144,12 @@ public class TBDingApplyServiceImpl extends ServiceImpl<TBDingApplyMapper, TBDin
                     }
                     d.setAttachmentPaths(stringJoiner.toString());
                 }
+                if (Objects.nonNull(d.getApproveInfo())) {
+                    String[] strs = d.getApproveInfo().split(";");
+                    d.setDingExceptionApprove(strs[0]);
+                    d.setApproveTime(Long.parseLong(strs[1]));
+                    d.setApproveInfo(null);
+                }
             }
         }
         return dingApplyDoneResultIPage;

+ 46 - 0
sop-business/src/main/resources/mapper/TBDelayWarnMapper.xml

@@ -52,4 +52,50 @@
 
         ORDER BY a.create_time DESC
     </select>
+
+    <select id="getWarnTaskList" resultType="com.qmth.sop.business.bean.result.WorkWarnResult">
+        select t.* from(select
+                          tbdw.id,
+                          tbdw.code,
+                          tbdw.sop_no as sopNo,
+                          tbdw.crm_no as crmNo,
+                          tbc.name as crmName,
+                          tbs.id as serviceId,
+                          tbs.name as serviceName,
+                          tbs.type as serviceType,
+                          sc.id as customId,
+                          sc.name as customName,
+                          sc.type as customType,
+                          tbdw.create_id as createId,
+                          su.real_name as createRealName,
+                          tbdw.create_time as createTime,
+                          'DELAY_WARN' as warnType
+                      from t_b_delay_warn tbdw
+                               left join t_b_crm tbc on tbc.crm_no = tbdw.crm_no
+                               left join t_b_service tbs on tbs.id = tbc.service_id
+                               left join sys_custom sc on sc.id = tbc.custom_id
+                               left join sys_user su ON tbdw.create_id = su.id
+                      UNION ALL
+                      select
+                          tbv.id,
+                          tbv.code,
+                          tbv.sop_no as sopNo,
+                          tbv.crm_no as crmNo,
+                          tbc.name as crmName,
+                          tbs.id as serviceId,
+                          tbs.name as serviceName,
+                          tbs.type as serviceType,
+                          sc.id as customId,
+                          sc.name as customName,
+                          sc.type as customType,
+                          tbv.create_id as createId,
+                          su.real_name as createRealName,
+                          tbv.create_time as createTime,
+                          'VIOLATION_WARN' as warnType
+                      from t_b_violation tbv
+                               left join t_b_crm tbc on tbc.crm_no = tbv.crm_no
+                               left join t_b_service tbs on tbs.id = tbc.service_id
+                               left join sys_custom sc on sc.id = tbc.custom_id
+                               left join sys_user su ON tbv.create_id = su.id) t
+    </select>
 </mapper>

+ 10 - 6
sop-business/src/main/resources/mapper/TBDingApplyMapper.xml

@@ -35,7 +35,9 @@
             tbda.reason,
             (select group_concat(ba.`path` SEPARATOR ';') from basic_attachment ba where find_in_set(ba.id, tbda.attachment_ids)) as attachmentPaths,
             tbda.create_time as createTime,
-            su1.real_name as approveUserName
+            su1.real_name as approveUserName,
+            ss.name as supplierName,
+            ss.code as supplierCode
             from ACT_RU_TASK art
                  left join t_f_flow_approve tffa on art.PROC_INST_ID_ = tffa.flow_id
                  left join t_f_custom_flow_entity tfcfe on tfcfe.flow_id = tffa.flow_id
@@ -53,7 +55,7 @@
                  left join act_ru_identitylink ari on ari.TASK_ID_ = art.ID_
         <where>
             EXISTS(
-                    select * from(select cast(art.PROC_INST_ID_ as Decimal(24)) as flowId
+                    select t.* from(select cast(art.PROC_INST_ID_ as Decimal(24)) as flowId
                                   from
                                       ACT_RU_TASK art
                                   where 1 = 1
@@ -101,7 +103,7 @@
     </select>
 
     <select id="flowTaskDoneList" resultType="com.qmth.sop.business.bean.result.DingApplyDoneResult">
-        select * from(select
+        select t.* from(select
             tfcf.type,
             tfcfe.code,
             tffa.status,
@@ -128,11 +130,13 @@
             tbda.reason,
             (select group_concat(ba.`path` SEPARATOR ';') from basic_attachment ba where find_in_set(ba.id, tbda.attachment_ids)) as attachmentPaths,
             tbda.create_time as createTime,
-            (select tffl.approve_remark from t_f_flow_log tffl where tffl.flow_id = tfcfe.flow_id order by tffl.create_time desc limit 1) as dingExceptionApprove,
-		(select group_concat(us1.real_name SEPARATOR ';') from sys_user us1
+            (select CONCAT(tffl.approve_remark, ';' ,tffl.create_time) from t_f_flow_log tffl where tffl.flow_id = tfcfe.flow_id order by tffl.create_time desc limit 1) as approveInfo,
+            (select group_concat(us1.real_name SEPARATOR ';') from sys_user us1
 		where find_in_set(us1.id, (select group_concat(tffl.approve_id) from t_f_flow_log tffl where tffl.flow_id = tfcfe.flow_id))) as approveUsersName,
             ss.id as supplierId,
-            tbd.id as dingId
+            tbd.id as dingId,
+            ss.name as supplierName,
+            ss.code as supplierCode
         from t_b_ding_apply tbda
             left join t_f_custom_flow_entity tfcfe on tbda.ding_exception_no = tfcfe.code
             left join t_f_flow_approve tffa on tfcfe.flow_id = tffa.flow_id

+ 1 - 1
sop-common/src/main/java/com/qmth/sop/common/enums/WarnTypeEnum.java

@@ -11,7 +11,7 @@ public enum WarnTypeEnum {
 
     DELAY_WARN("延期预警"),
 
-    VIOLATION_WARN("云阅卷SOP");
+    VIOLATION_WARN("违规预警");
 
     private String title;
 

+ 1 - 0
sop-server/src/main/java/com/qmth/sop/server/api/MyWorkBenchController.java

@@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.annotation.Resource;
 import javax.validation.constraints.Max;
 import javax.validation.constraints.Min;