zxz 3 роки тому
батько
коміт
42610e0db3

+ 5 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/constant/StatusEnum.java

@@ -153,6 +153,11 @@ public enum StatusEnum {
     COST_PAID("4", "已付款", "cost_paid"),
     COST_ADOPTED("6", "已通过", "cost_adopted"),
 
+    //补卡状态
+    SUPP_REVIEWED("1", "审核中", "supp_reviewed"),
+    SUPP_SUCCESS("3", "补卡成功", "supp_success"),
+    SUPP_FAIL("5", "补卡失败", "supp_fail"),
+
 
     ;
     @Getter

+ 9 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/ClockInfoController.java

@@ -50,5 +50,14 @@ public class ClockInfoController {
     public String suppClock(@RequestBody ClockInfo clockInfo){
         return clockInfoService.suppClock(clockInfo);
     }
+    /**
+     * 补卡信息审核
+     * @param clockInfo
+     * @return
+     */
+    @PostMapping("/api/examineClock")
+    public String examineClock(@RequestBody ClockInfo clockInfo){
+        return clockInfoService.examineClock(clockInfo);
+    }
 }
 

+ 5 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/ClockInfo.java

@@ -132,7 +132,11 @@ public class ClockInfo extends BaseModel<ClockInfo> {
     @JsonFormat(pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern = "yyyy-MM-dd")
     private Date theClockDate;
-
+    /**
+     * 通过1驳回2
+     */
+    @TableField(exist = false)
+    private Integer examineFlag;
 
     @Override
     protected Serializable pkVal() {

+ 5 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IClockInfoService.java

@@ -31,4 +31,9 @@ public interface IClockInfoService extends IService<ClockInfo> {
      * @param  clockInfo
      */
     String suppClock(ClockInfo clockInfo);
+    /**
+     * 补卡信息审核
+     * @param  clockInfo
+     */
+    String examineClock(ClockInfo clockInfo);
 }

+ 35 - 14
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/ClockInfoServiceImpl.java

@@ -3,9 +3,8 @@ package com.yh.saas.plugin.yiliangyiyun.service.impl;
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.baomidou.mybatisplus.plugins.Page;
 import com.google.common.collect.Lists;
-import com.winsea.svc.base.security.util.AuthSecurityUtils;
 import com.yh.saas.common.support.util.IdGenerator;
-import com.yh.saas.common.support.util.StringUtils;
+import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.ClockInfo;
 import com.yh.saas.plugin.yiliangyiyun.mapper.ClockInfoMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IClockInfoService;
@@ -13,8 +12,6 @@ import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
 import java.text.SimpleDateFormat;
-import java.time.LocalDate;
-import java.time.format.DateTimeFormatter;
 import java.util.*;
 
 /**
@@ -65,6 +62,7 @@ public class ClockInfoServiceImpl extends ServiceImpl<ClockInfoMapper, ClockInfo
         ClockInfo clockInfo1 = this.selectOne(new EntityWrapper<ClockInfo>()
                 .eq("comp_id", clockInfo.getCompId())
                 .eq("common_id", clockInfo.getCommonId())
+                .eq("delete_flag", "0")
                 .gt("create_date", timeOfDay));
         //信息不为空,下班打卡
         if (clockInfo1 != null) {
@@ -136,22 +134,45 @@ public class ClockInfoServiceImpl extends ServiceImpl<ClockInfoMapper, ClockInfo
      */
     @Override
     public String suppClock(ClockInfo clockInfo) {
-        //当天零点
-        SimpleDateFormat zero = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
-        Calendar d = Calendar.getInstance();
-        d.setTime(new Date());
-        d.add(Calendar.YEAR, 0);
-        Date n = d.getTime();
-        String zeroOfDay = zero.format(n);
         //查询打卡信息
-        ClockInfo clockInfo1 = this.selectOne(new EntityWrapper<ClockInfo>()
-                .eq("common_id", clockInfo.getCommonId())
-                .gt("create_date",zeroOfDay));
+        ClockInfo clockInfo1 = this.selectById(clockInfo.getId());
         if (clockInfo1 != null) {
             clockInfo1.setSupplementClockType(clockInfo.getSupplementClockType());
             clockInfo1.setReasonForApplication(clockInfo.getReasonForApplication());
+            //补卡状态改为审核中
+            clockInfo1.setStatus(StatusEnum.SUPP_REVIEWED.getName());
+            clockInfo1.setStatusFlag(StatusEnum.SUPP_REVIEWED.getFlag());
             this.updateById(clockInfo1);
         }
         return "OK";
     }
+
+    /**
+     * 补卡信息审核
+     *
+     * @param clockInfo
+     * @return
+     */
+    @Override
+    public String examineClock(ClockInfo clockInfo) {
+        //查询打卡信息
+        ClockInfo clockInfo1 = this.selectById(clockInfo.getId());
+        if (clockInfo1 != null && "1".equals(clockInfo1.getStatusFlag())) {
+            //通过
+            if (clockInfo.getExamineFlag() == 1) {
+                //补卡状态改为补卡成功
+                clockInfo1.setStatus(StatusEnum.SUPP_SUCCESS.getName());
+                clockInfo1.setStatusFlag(StatusEnum.SUPP_SUCCESS.getFlag());
+            }
+            //驳回
+            else {
+                //补卡状态改为补卡失败
+                clockInfo1.setStatus(StatusEnum.SUPP_FAIL.getName());
+                clockInfo1.setStatusFlag(StatusEnum.SUPP_FAIL.getFlag());
+            }
+            //更新数据
+            this.updateById(clockInfo1);
+        }
+        return null;
+    }
 }

+ 1 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/ClockInfoMapper.xml

@@ -23,6 +23,7 @@
         phone,
         emp_name as empName,
         clock_type as clockType,
+        reason_for_application as reasonForApplication,
         to_clock_date as toClockDate,
         off_clock_date as offClockDate,
         leave_type as leaveType,