Просмотр исходного кода

考勤异常审核未审核已审核列表修改

wangliang 1 год назад
Родитель
Сommit
e56be70f28

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

@@ -827,7 +827,7 @@ public class ActivitiServiceImpl implements ActivitiService {
         if (Objects.nonNull(approveRemark)) {
             tfFlowLog.setApproveRemark(approveRemark);
         } else {
-            tfFlowLog.setApproveRemark(tfFlowLog.getApproveOperation().getTitle());
+            tfFlowLog.setApproveRemark(DingExceptionApproveEnum.PASS.getTitle());
         }
     }
 
@@ -860,7 +860,7 @@ public class ActivitiServiceImpl implements ActivitiService {
         if (Objects.nonNull(approveRemark)) {
             tfFlowLog.setApproveRemark(approveRemark);
         } else {
-            tfFlowLog.setApproveRemark(tfFlowLog.getApproveOperation().getTitle());
+            tfFlowLog.setApproveRemark(DingExceptionApproveEnum.REFUSE.getTitle());
         }
     }
 }

+ 5 - 21
sop-business/src/main/java/com/qmth/sop/business/bean/result/DingApplyDoneResult.java

@@ -1,7 +1,6 @@
 package com.qmth.sop.business.bean.result;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
-import com.qmth.sop.common.enums.FlowApproveOperationEnum;
 import com.qmth.sop.common.enums.InOutTypeEnum;
 import io.swagger.annotations.ApiModelProperty;
 
@@ -40,10 +39,7 @@ public class DingApplyDoneResult extends WorkTaskResult implements Serializable
     Long createTime;
 
     @ApiModelProperty(value = "审核结果")
-    FlowApproveOperationEnum approveOperation;
-
-    @ApiModelProperty(value = "审核结果Str")
-    String approveOperationStr;
+    String dingExceptionApprove;
 
     @ApiModelProperty(value = "审核人")
     String approveUsersName;
@@ -108,24 +104,12 @@ public class DingApplyDoneResult extends WorkTaskResult implements Serializable
         this.attachmentPaths = attachmentPaths;
     }
 
-    public FlowApproveOperationEnum getApproveOperation() {
-        return approveOperation;
-    }
-
-    public void setApproveOperation(FlowApproveOperationEnum approveOperation) {
-        this.approveOperation = approveOperation;
-    }
-
-    public String getApproveOperationStr() {
-        if (Objects.nonNull(approveOperation)) {
-            return approveOperation.getTitle();
-        } else {
-            return approveOperationStr;
-        }
+    public String getDingExceptionApprove() {
+        return dingExceptionApprove;
     }
 
-    public void setApproveOperationStr(String approveOperationStr) {
-        this.approveOperationStr = approveOperationStr;
+    public void setDingExceptionApprove(String dingExceptionApprove) {
+        this.dingExceptionApprove = dingExceptionApprove;
     }
 
     public String getApproveUsersName() {

+ 3 - 2
sop-business/src/main/java/com/qmth/sop/business/mapper/TBDingApplyMapper.java

@@ -35,7 +35,7 @@ public interface TBDingApplyMapper extends BaseMapper<TBDingApply> {
      * @param applyEndTime
      * @return
      */
-    IPage<DingApplyUnDoneResult> flowTaskUnDoneList(IPage<Map> iPage, @Param("userIdList") List<String> userIdList, @Param("serviceId") Long serviceId, @Param("name") String name, @Param("supplierId") Long supplierId, @Param("customName") String customName, @Param("startTime") Long startTime, @Param("endTime") Long endTime, @Param("applyStartTime") Long applyStartTime, @Param("applyEndTime") Long applyEndTime);
+    IPage<DingApplyUnDoneResult> flowTaskUnDoneList(IPage<Map> iPage, @Param("userIdList") List<String> userIdList, @Param("serviceId") Long serviceId, @Param("name") String name, @Param("supplierId") Long supplierId, @Param("customName") String customName, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("applyStartTime") Long applyStartTime, @Param("applyEndTime") Long applyEndTime);
 
     /**
      * 异常已审核接口
@@ -45,6 +45,7 @@ public interface TBDingApplyMapper extends BaseMapper<TBDingApply> {
      * @param serviceId
      * @param name
      * @param supplierId
+     * @param dingExceptionApprove
      * @param customName
      * @param startTime
      * @param endTime
@@ -52,5 +53,5 @@ public interface TBDingApplyMapper extends BaseMapper<TBDingApply> {
      * @param applyEndTime
      * @return
      */
-    IPage<DingApplyDoneResult> flowTaskDoneList(IPage<Map> iPage, @Param("userIdList") List<String> userIdList, @Param("serviceId") Long serviceId, @Param("name") String name, @Param("supplierId") Long supplierId, @Param("customName") String customName, @Param("startTime") Long startTime, @Param("endTime") Long endTime, @Param("applyStartTime") Long applyStartTime, @Param("applyEndTime") Long applyEndTime);
+    IPage<DingApplyDoneResult> flowTaskDoneList(IPage<Map> iPage, @Param("userIdList") List<String> userIdList, @Param("serviceId") Long serviceId, @Param("name") String name, @Param("supplierId") Long supplierId, @Param("dingExceptionApprove") String dingExceptionApprove, @Param("customName") String customName, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("applyStartTime") Long applyStartTime, @Param("applyEndTime") Long applyEndTime);
 }

+ 4 - 2
sop-business/src/main/java/com/qmth/sop/business/service/TBDingApplyService.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.qmth.sop.business.bean.result.DingApplyDoneResult;
 import com.qmth.sop.business.bean.result.DingApplyUnDoneResult;
 import com.qmth.sop.business.entity.TBDingApply;
+import com.qmth.sop.common.enums.DingExceptionApproveEnum;
 
 import java.util.Map;
 
@@ -41,7 +42,7 @@ public interface TBDingApplyService extends IService<TBDingApply> {
      * @param applyEndTime
      * @return
      */
-    IPage<DingApplyUnDoneResult> flowTaskUnDoneList(IPage<Map> iPage, Long serviceId, String name, Long supplierId, String customName, Long startTime, Long endTime, Long applyStartTime, Long applyEndTime);
+    IPage<DingApplyUnDoneResult> flowTaskUnDoneList(IPage<Map> iPage, Long serviceId, String name, Long supplierId, String customName, String startTime, String endTime, Long applyStartTime, Long applyEndTime);
 
     /**
      * 异常已审核接口
@@ -50,6 +51,7 @@ public interface TBDingApplyService extends IService<TBDingApply> {
      * @param serviceId
      * @param name
      * @param supplierId
+     * @param dingExceptionApprove
      * @param customName
      * @param startTime
      * @param endTime
@@ -57,5 +59,5 @@ public interface TBDingApplyService extends IService<TBDingApply> {
      * @param applyEndTime
      * @return
      */
-    IPage<DingApplyDoneResult> flowTaskDoneList(IPage<Map> iPage, Long serviceId, String name, Long supplierId, String customName, Long startTime, Long endTime, Long applyStartTime, Long applyEndTime);
+    IPage<DingApplyDoneResult> flowTaskDoneList(IPage<Map> iPage, Long serviceId, String name, Long supplierId, DingExceptionApproveEnum dingExceptionApprove, String customName, String startTime, String endTime, Long applyStartTime, Long applyEndTime);
 }

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

@@ -15,6 +15,7 @@ import com.qmth.sop.business.service.TBDingApplyService;
 import com.qmth.sop.business.service.TBDingService;
 import com.qmth.sop.business.service.TFCustomFlowEntityService;
 import com.qmth.sop.common.contant.SystemConstant;
+import com.qmth.sop.common.enums.DingExceptionApproveEnum;
 import com.qmth.sop.common.enums.ExceptionResultEnum;
 import com.qmth.sop.common.enums.FlowApprovePassEnum;
 import com.qmth.sop.common.util.ServletUtil;
@@ -25,6 +26,7 @@ import org.springframework.util.CollectionUtils;
 import javax.annotation.Resource;
 import java.util.Arrays;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Optional;
 
 /**
@@ -84,7 +86,7 @@ public class TBDingApplyServiceImpl extends ServiceImpl<TBDingApplyMapper, TBDin
      * @return
      */
     @Override
-    public IPage<DingApplyUnDoneResult> flowTaskUnDoneList(IPage<Map> iPage, Long serviceId, String name, Long supplierId, String customName, Long startTime, Long endTime, Long applyStartTime, Long applyEndTime) {
+    public IPage<DingApplyUnDoneResult> flowTaskUnDoneList(IPage<Map> iPage, Long serviceId, String name, Long supplierId, String customName, String startTime, String endTime, Long applyStartTime, Long applyEndTime) {
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         return this.baseMapper.flowTaskUnDoneList(iPage, Arrays.asList(sysUser.getId().toString()), serviceId, name, supplierId, customName, startTime, endTime, applyStartTime, applyEndTime);
     }
@@ -96,6 +98,7 @@ public class TBDingApplyServiceImpl extends ServiceImpl<TBDingApplyMapper, TBDin
      * @param serviceId
      * @param name
      * @param supplierId
+     * @param dingExceptionApprove
      * @param customName
      * @param startTime
      * @param endTime
@@ -104,8 +107,8 @@ public class TBDingApplyServiceImpl extends ServiceImpl<TBDingApplyMapper, TBDin
      * @return
      */
     @Override
-    public IPage<DingApplyDoneResult> flowTaskDoneList(IPage<Map> iPage, Long serviceId, String name, Long supplierId, String customName, Long startTime, Long endTime, Long applyStartTime, Long applyEndTime) {
+    public IPage<DingApplyDoneResult> flowTaskDoneList(IPage<Map> iPage, Long serviceId, String name, Long supplierId, DingExceptionApproveEnum dingExceptionApprove, String customName, String startTime, String endTime, Long applyStartTime, Long applyEndTime) {
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
-        return this.baseMapper.flowTaskDoneList(iPage, Arrays.asList(sysUser.getId().toString()), serviceId, name, supplierId, customName, startTime, endTime, applyStartTime, applyEndTime);
+        return this.baseMapper.flowTaskDoneList(iPage, Arrays.asList(sysUser.getId().toString()), serviceId, name, supplierId, Objects.nonNull(dingExceptionApprove) ? dingExceptionApprove.getTitle() : null, customName, startTime, endTime, applyStartTime, applyEndTime);
     }
 }

+ 48 - 4
sop-business/src/main/resources/mapper/TBDingApplyMapper.xml

@@ -79,11 +79,29 @@
                                         </foreach>
                                     </if>
                                     and ari.TYPE_ = 'candidate') t where t.flowId = art.PROC_INST_ID_)
+            <if test="serviceId != null and serviceId != ''">
+                and tbs.id = #{serviceId}
+            </if>
+            <if test="name != null and name != ''">
+                and su.real_name like concat('%', #{name}, '%')
+            </if>
+            <if test="supplierId != null and supplierId != ''">
+                and ss.id = #{supplierId}
+            </if>
+            <if test="customName != null and customName != ''">
+                and sc.name like concat('%', #{customName}, '%')
+            </if>
+            <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
+                and ((tbd.sign_date <![CDATA[ >= ]]> #{startTime} or tbd.sign_date <![CDATA[ <= ]]> #{endTime}) and (tbd.sign_in_time is null or tbd.sign_out_time is null))
+            </if>
+            <if test="applyStartTime != null and applyStartTime != '' and applyEndTime != null and applyEndTime != ''">
+                and (tbda.apply_time <![CDATA[ >= ]]> 1 or tbda.apply_time <![CDATA[ <= ]]> 1)
+            </if>
         </where>
     </select>
 
     <select id="flowTaskDoneList" resultType="com.qmth.sop.business.bean.result.DingApplyDoneResult">
-        select
+        select * from(select
             tfcf.type,
             tfcfe.code,
             tffa.status,
@@ -110,9 +128,11 @@
             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_operation from t_f_flow_log tffl where tffl.flow_id = tfcfe.flow_id order by tffl.create_time desc limit 1) as approveOperation,
+            (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
-		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
+		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
         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
@@ -167,6 +187,30 @@
                 </foreach>
             </if>) temp
             join ACT_HI_TASKINST t on
-            t.ID_ = temp.TASK_ID_) temp where temp.PROC_INST_ID_ = tfcfe.flow_id)
+            t.ID_ = temp.TASK_ID_) temp where temp.PROC_INST_ID_ = tfcfe.flow_id)) t
+            join t_b_ding tbd on tbd.id = t.dingId
+        <where>
+            <if test="serviceId != null and serviceId != ''">
+                and t.serviceId = #{serviceId}
+            </if>
+            <if test="name != null and name != ''">
+                and t.createRealName like concat('%', #{name}, '%')
+            </if>
+            <if test="supplierId != null and supplierId != ''">
+                and t.supplierId = #{supplierId}
+            </if>
+            <if test="dingExceptionApprove != null and dingExceptionApprove != ''">
+                and t.dingExceptionApprove = #{dingExceptionApprove}
+            </if>
+            <if test="customName != null and customName != ''">
+                and t.customName like concat('%', #{customName}, '%')
+            </if>
+            <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
+                and ((tbd.sign_date <![CDATA[ >= ]]> #{startTime} or tbd.sign_date <![CDATA[ <= ]]> #{endTime}) and (tbd.sign_in_time is null or tbd.sign_out_time is null))
+            </if>
+            <if test="applyStartTime != null and applyStartTime != '' and applyEndTime != null and applyEndTime != ''">
+                and (t.applyTime <![CDATA[ >= ]]> 1 or t.applyTime <![CDATA[ <= ]]> 1)
+            </if>
+        </where>
     </select>
 </mapper>

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

@@ -76,6 +76,7 @@ public class SystemConstant {
     public static final String UPLOAD_TYPE = "uploadType";
     public static final String TEMP = "temp";
     public static final String DEFAULT_DATE_PATTERN = "yyyy-MM-dd HH:mm:ss";
+    public static final String DEFAULT_DATE_YMD_PATTERN = "yyyy-MM-dd";
     public static final String TXT_PREFIX = ".txt";
     public static final String XLSX_PREFIX = ".xlsx";
     public static final String XLS_PREFIX = "xls";

+ 30 - 0
sop-common/src/main/java/com/qmth/sop/common/enums/DingExceptionApproveEnum.java

@@ -0,0 +1,30 @@
+package com.qmth.sop.common.enums;
+
+/**
+ * @Description: 考勤异常审核操作enum
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2022/1/24
+ */
+public enum DingExceptionApproveEnum {
+
+    PASS("通过"),
+
+    REFUSE("拒绝");
+
+    private String title;
+
+    private DingExceptionApproveEnum(String title) {
+        this.title = title;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    @Override
+    public String toString() {
+        return title;
+    }
+}

+ 7 - 2
sop-server/src/main/java/com/qmth/sop/server/api/TBDingApplyController.java

@@ -1,11 +1,13 @@
 package com.qmth.sop.server.api;
 
 
+import cn.hutool.core.date.DateUtil;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.qmth.boot.api.constant.ApiConstant;
 import com.qmth.sop.business.entity.TBDingApply;
 import com.qmth.sop.business.service.TBDingApplyService;
 import com.qmth.sop.common.contant.SystemConstant;
+import com.qmth.sop.common.enums.DingExceptionApproveEnum;
 import com.qmth.sop.common.util.Result;
 import com.qmth.sop.common.util.ResultUtil;
 import io.swagger.annotations.*;
@@ -16,6 +18,8 @@ import javax.annotation.Resource;
 import javax.validation.Valid;
 import javax.validation.constraints.Max;
 import javax.validation.constraints.Min;
+import java.util.Date;
+import java.util.Objects;
 
 /**
  * <p>
@@ -56,7 +60,7 @@ public class TBDingApplyController {
                                      @ApiParam(value = "申请结束时间") @RequestParam(required = false) Long applyEndTime,
                                      @ApiParam(value = "页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
                                      @ApiParam(value = "页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
-        return ResultUtil.ok(tbDingApplyService.flowTaskUnDoneList(new Page<>(pageNumber, pageSize), serviceId, name, supplierId, customName, startTime, endTime, applyStartTime, applyEndTime));
+        return ResultUtil.ok(tbDingApplyService.flowTaskUnDoneList(new Page<>(pageNumber, pageSize), serviceId, name, supplierId, customName, Objects.nonNull(startTime) ? DateUtil.format(new Date(startTime), SystemConstant.DEFAULT_DATE_YMD_PATTERN) : null, Objects.nonNull(endTime) ? DateUtil.format(new Date(endTime), SystemConstant.DEFAULT_DATE_YMD_PATTERN) : null, applyStartTime, applyEndTime));
     }
 
     @ApiOperation(value = "考勤异常已审核接口")
@@ -65,6 +69,7 @@ public class TBDingApplyController {
     public Result flowTaskDoneList(@ApiParam(value = "服务单元id") @RequestParam(required = false) Long serviceId,
                                    @ApiParam(value = "姓名") @RequestParam(required = false) String name,
                                    @ApiParam(value = "供应商id") @RequestParam(required = false) Long supplierId,
+                                   @ApiParam(value = "审核结果") @RequestParam(required = false) DingExceptionApproveEnum dingExceptionApprove,
                                    @ApiParam(value = "客户名称") @RequestParam(required = false) String customName,
                                    @ApiParam(value = "异常开始时间") @RequestParam(required = false) Long startTime,
                                    @ApiParam(value = "异常结束时间") @RequestParam(required = false) Long endTime,
@@ -72,6 +77,6 @@ public class TBDingApplyController {
                                    @ApiParam(value = "申请结束时间") @RequestParam(required = false) Long applyEndTime,
                                    @ApiParam(value = "页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
                                    @ApiParam(value = "页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
-        return ResultUtil.ok(tbDingApplyService.flowTaskDoneList(new Page<>(pageNumber, pageSize), serviceId, name, supplierId, customName, startTime, endTime, applyStartTime, applyEndTime));
+        return ResultUtil.ok(tbDingApplyService.flowTaskDoneList(new Page<>(pageNumber, pageSize), serviceId, name, supplierId, dingExceptionApprove, customName, Objects.nonNull(startTime) ? DateUtil.format(new Date(startTime), SystemConstant.DEFAULT_DATE_YMD_PATTERN) : null, Objects.nonNull(endTime) ? DateUtil.format(new Date(endTime), SystemConstant.DEFAULT_DATE_YMD_PATTERN) : null, applyStartTime, applyEndTime));
     }
 }