Jelajahi Sumber

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

wangliang 1 tahun lalu
induk
melakukan
5fb6ebb5a5

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

@@ -24,7 +24,7 @@ public class DingApplyDoneResult extends WorkTaskResult implements Serializable
     String dingExceptionTypeStr;
 
     @ApiModelProperty(value = "异常日期")
-    Long exceptionTime;
+    String exceptionTime;
 
     @ApiModelProperty(value = "补卡时间")
     Long applyTime;
@@ -72,11 +72,11 @@ public class DingApplyDoneResult extends WorkTaskResult implements Serializable
         this.dingExceptionTypeStr = dingExceptionTypeStr;
     }
 
-    public Long getExceptionTime() {
+    public String getExceptionTime() {
         return exceptionTime;
     }
 
-    public void setExceptionTime(Long exceptionTime) {
+    public void setExceptionTime(String exceptionTime) {
         this.exceptionTime = exceptionTime;
     }
 

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

@@ -24,7 +24,7 @@ public class DingApplyUnDoneResult extends WorkTaskResult implements Serializabl
     String dingExceptionTypeStr;
 
     @ApiModelProperty(value = "异常日期")
-    Long exceptionTime;
+    String exceptionTime;
 
     @ApiModelProperty(value = "补卡时间")
     Long applyTime;
@@ -61,11 +61,11 @@ public class DingApplyUnDoneResult extends WorkTaskResult implements Serializabl
         this.dingExceptionTypeStr = dingExceptionTypeStr;
     }
 
-    public Long getExceptionTime() {
+    public String getExceptionTime() {
         return exceptionTime;
     }
 
-    public void setExceptionTime(Long exceptionTime) {
+    public void setExceptionTime(String exceptionTime) {
         this.exceptionTime = exceptionTime;
     }
 

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

@@ -42,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, String startTime, String 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) throws Exception;
 
     /**
      * 异常已审核接口
@@ -59,5 +59,5 @@ public interface TBDingApplyService extends IService<TBDingApply> {
      * @param applyEndTime
      * @return
      */
-    IPage<DingApplyDoneResult> flowTaskDoneList(IPage<Map> iPage, Long serviceId, String name, Long supplierId, DingExceptionApproveEnum dingExceptionApprove, String customName, String startTime, String 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) throws Exception;
 }

+ 37 - 8
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBDingApplyServiceImpl.java

@@ -11,6 +11,7 @@ import com.qmth.sop.business.entity.TBDing;
 import com.qmth.sop.business.entity.TBDingApply;
 import com.qmth.sop.business.entity.TFCustomFlowEntity;
 import com.qmth.sop.business.mapper.TBDingApplyMapper;
+import com.qmth.sop.business.service.BasicAttachmentService;
 import com.qmth.sop.business.service.TBDingApplyService;
 import com.qmth.sop.business.service.TBDingService;
 import com.qmth.sop.business.service.TFCustomFlowEntityService;
@@ -24,10 +25,7 @@ import org.springframework.transaction.annotation.Transactional;
 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;
+import java.util.*;
 
 /**
  * <p>
@@ -49,6 +47,9 @@ public class TBDingApplyServiceImpl extends ServiceImpl<TBDingApplyMapper, TBDin
     @Resource
     TBDingService tbDingService;
 
+    @Resource
+    BasicAttachmentService basicAttachmentService;
+
     /**
      * 新增考勤异常补卡申请
      *
@@ -86,9 +87,23 @@ public class TBDingApplyServiceImpl extends ServiceImpl<TBDingApplyMapper, TBDin
      * @return
      */
     @Override
-    public IPage<DingApplyUnDoneResult> flowTaskUnDoneList(IPage<Map> iPage, Long serviceId, String name, Long supplierId, String customName, String startTime, String 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) throws Exception {
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
-        return this.baseMapper.flowTaskUnDoneList(iPage, Arrays.asList(sysUser.getId().toString()), serviceId, name, supplierId, customName, startTime, endTime, applyStartTime, applyEndTime);
+        IPage<DingApplyUnDoneResult> dingApplyUnDoneResultIPage = this.baseMapper.flowTaskUnDoneList(iPage, Arrays.asList(sysUser.getId().toString()), serviceId, name, supplierId, customName, startTime, endTime, applyStartTime, applyEndTime);
+        if (Objects.nonNull(dingApplyUnDoneResultIPage) && !CollectionUtils.isEmpty(dingApplyUnDoneResultIPage.getRecords())) {
+            for (DingApplyUnDoneResult d : dingApplyUnDoneResultIPage.getRecords()) {
+                if (Objects.nonNull(d.getAttachmentPaths())) {
+                    String[] strs = d.getAttachmentPaths().split(";");
+                    StringJoiner stringJoiner = new StringJoiner(";");
+                    for (int i = 0; i < strs.length; i++) {
+                        String path = basicAttachmentService.filePreview(strs[i]);
+                        stringJoiner.add(path);
+                    }
+                    d.setAttachmentPaths(stringJoiner.toString());
+                }
+            }
+        }
+        return dingApplyUnDoneResultIPage;
     }
 
     /**
@@ -107,8 +122,22 @@ public class TBDingApplyServiceImpl extends ServiceImpl<TBDingApplyMapper, TBDin
      * @return
      */
     @Override
-    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) {
+    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) throws Exception {
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
-        return this.baseMapper.flowTaskDoneList(iPage, Arrays.asList(sysUser.getId().toString()), serviceId, name, supplierId, Objects.nonNull(dingExceptionApprove) ? dingExceptionApprove.getTitle() : null, customName, startTime, endTime, applyStartTime, applyEndTime);
+        IPage<DingApplyDoneResult> dingApplyDoneResultIPage = this.baseMapper.flowTaskDoneList(iPage, Arrays.asList(sysUser.getId().toString()), serviceId, name, supplierId, Objects.nonNull(dingExceptionApprove) ? dingExceptionApprove.getTitle() : null, customName, startTime, endTime, applyStartTime, applyEndTime);
+        if (Objects.nonNull(dingApplyDoneResultIPage) && !CollectionUtils.isEmpty(dingApplyDoneResultIPage.getRecords())) {
+            for (DingApplyDoneResult d : dingApplyDoneResultIPage.getRecords()) {
+                if (Objects.nonNull(d.getAttachmentPaths())) {
+                    String[] strs = d.getAttachmentPaths().split(";");
+                    StringJoiner stringJoiner = new StringJoiner(";");
+                    for (int i = 0; i < strs.length; i++) {
+                        String path = basicAttachmentService.filePreview(strs[i]);
+                        stringJoiner.add(path);
+                    }
+                    d.setAttachmentPaths(stringJoiner.toString());
+                }
+            }
+        }
+        return dingApplyDoneResultIPage;
     }
 }

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

@@ -30,7 +30,7 @@
             tfcf.flow_deployment_id as flowDeploymentId,
             tfcfe.id as customFlowEntityid,
             tbda.`type` as dingExceptionType,
-            IF(tbda.`type` = 'IN',tbd.sign_in_time,tbd.sign_out_time) as exceptionTime,
+            tbd.sign_date as exceptionTime,
             tbda.apply_time as applyTime,
             tbda.reason,
             (select group_concat(ba.`path` SEPARATOR ';') from basic_attachment ba where find_in_set(ba.id, tbda.attachment_ids)) as attachmentPaths,
@@ -123,7 +123,7 @@
             tfcf.flow_deployment_id as flowDeploymentId,
             tfcfe.id as customFlowEntityid,
             tbda.`type` as dingExceptionType,
-            IF(tbda.`type` = 'IN',tbd.sign_in_time,tbd.sign_out_time) as exceptionTime,
+            tbd.sign_date as exceptionTime,
             tbda.apply_time as applyTime,
             tbda.reason,
             (select group_concat(ba.`path` SEPARATOR ';') from basic_attachment ba where find_in_set(ba.id, tbda.attachment_ids)) as attachmentPaths,

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

@@ -33,7 +33,9 @@ public enum EnumList {
 
     EDUCATION_ENUM(EducationEnum.class),
 
-    SEQUENCE_ENUM(SequenceEnum.class);
+    SEQUENCE_ENUM(SequenceEnum.class),
+
+    DING_EXCEPTION_APPROVE_ENUM(DingExceptionApproveEnum.class);
 
     private Object obj;
 

+ 7 - 1
sop-server/src/main/java/com/qmth/sop/server/api/SysController.java

@@ -460,12 +460,18 @@ public class SysController {
                     map.put(educationEnum, educationEnum.getTitle());
                 }
                 break;
-            case SEQUENCE_ENUM://消息类型枚举
+            case SEQUENCE_ENUM://用户档案编号枚举
                 SequenceEnum[] sequenceEnums = SequenceEnum.values();
                 for (SequenceEnum sequenceEnum : sequenceEnums) {
                     map.put(sequenceEnum, sequenceEnum.getTitle());
                 }
                 break;
+            case DING_EXCEPTION_APPROVE_ENUM://考勤异常审核枚举
+                DingExceptionApproveEnum[] dingExceptionApproveEnums = DingExceptionApproveEnum.values();
+                for (DingExceptionApproveEnum dingExceptionApproveEnum : dingExceptionApproveEnums) {
+                    map.put(dingExceptionApproveEnum, dingExceptionApproveEnum.getTitle());
+                }
+                break;
             default:
                 break;
         }

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

@@ -59,7 +59,7 @@ public class TBDingApplyController {
                                      @ApiParam(value = "申请开始时间") @RequestParam(required = false) Long applyStartTime,
                                      @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) {
+                                     @ApiParam(value = "页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) throws Exception {
         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));
     }
 
@@ -76,7 +76,7 @@ public class TBDingApplyController {
                                    @ApiParam(value = "申请开始时间") @RequestParam(required = false) Long applyStartTime,
                                    @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) {
+                                   @ApiParam(value = "页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) throws Exception {
         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));
     }
 }