Ver código fonte

新增考勤打卡,打卡配置

Administrator 2 anos atrás
pai
commit
6ce85f4b11

+ 177 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/kaoqin/KaoQinController.java

@@ -0,0 +1,177 @@
+package com.ruoyi.web.controller.kaoqin;
+
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysDictData;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.system.domain.KaoqinConfig;
+import com.ruoyi.system.domain.KaoqinRecord;
+import com.ruoyi.system.domain.PlatPunch;
+import com.ruoyi.system.service.IKaoqinConfigService;
+import com.ruoyi.system.service.IKaoqinRecordService;
+import com.ruoyi.system.service.ISysDictDataService;
+import org.gavaghan.geodesy.Ellipsoid;
+import org.gavaghan.geodesy.GlobalCoordinates;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.Size;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import static com.ruoyi.common.PunchUtils.getDistanceMeter;
+
+/**
+ * 实现考勤打卡
+ *
+ * @Author: tjf
+ * @Date: 2023/2/1 14:46
+ * @Describe:
+ */
+@RestController
+@RequestMapping("/kaoQin")
+public class KaoQinController extends BaseController {
+
+    @Autowired
+    private IKaoqinConfigService kaoqinConfigService;
+
+    @Autowired
+    private IKaoqinRecordService kaoqinRecordService;
+
+
+    @Autowired
+    private ISysDictDataService dictDataService;
+
+    /**
+     * 定位打卡提供计算参数
+     *
+     * @param platPunch
+     * @return
+     */
+    @GetMapping(value = "/daKa")
+    public AjaxResult daKa(PlatPunch platPunch) {
+        //根据部门id,查询该部门考勤范围 ,经纬度
+        KaoqinConfig kaoqinConfig = new KaoqinConfig();
+        kaoqinConfig.setDeptId(platPunch.getDeptId());
+        List<KaoqinConfig> kaoqinConfigs = kaoqinConfigService.selectKaoqinConfigList(kaoqinConfig);
+        return AjaxResult.success(kaoqinConfigs);
+    }
+
+
+    /**
+     * 查询考勤记录列表
+     */
+    @GetMapping("/list")
+    public TableDataInfo list(KaoqinRecord kaoqinRecord) {
+        List<KaoqinRecord> list = kaoqinRecordService.selectKaoqinRecordList(kaoqinRecord);
+        return getDataTable(list);
+    }
+
+    /**
+     * 查询考勤异常数据信息
+     * 包括所有异常的数量
+     * 本月考勤记录的异常分类数量
+     */
+    @GetMapping("/abnormal")
+    public AjaxResult abnormal(KaoqinRecord kaoqinRecord) {
+        //设置查询异常的考勤
+        kaoqinRecord.setKaStatus("2");
+        List<KaoqinRecord> kaoqinRecords = kaoqinRecordService.selectKaoqinRecordList(kaoqinRecord);
+        //对异常进行分组统计数量
+        Map<String, Long> collect = kaoqinRecords.stream().collect(Collectors.groupingBy(KaoqinRecord::getKaType, Collectors.counting()));
+        SysDictData dictData = new SysDictData();
+        dictData.setDictType("kaoqin_abnormal");
+        List<SysDictData> sysDictData = dictDataService.selectDictDataList(dictData);
+        Map map = new HashMap();
+        for (SysDictData sysDictDatum : sysDictData) {
+            //获取异常名称
+             String dictLabel = sysDictDatum.getDictLabel();
+             //获取异常的值
+            String dictValue = sysDictDatum.getDictValue();
+            Long aLong = collect.get(dictValue);
+            map.put(dictLabel,aLong);
+        }
+        map.put("count",kaoqinRecords.size());
+        return AjaxResult.success(map);
+    }
+
+
+    /**
+     * 查询考勤异常数据信息
+     * 包括所有异常的数量
+     * 本月考勤记录的异常分类数量
+     */
+    @GetMapping("/calendar")
+    public AjaxResult calendar(KaoqinRecord kaoqinRecord) {
+        //根据打卡人id和月份去找对应的打卡记录
+
+        List<KaoqinRecord> kaoqinRecords = kaoqinRecordService.selectKaoqinRecordList(kaoqinRecord);
+        Map<String, List<KaoqinRecord>> collect = kaoqinRecords.stream().collect(Collectors.groupingBy(KaoqinRecord::getKaTime));
+        List list = new ArrayList();
+        Map<String,Object> map = new HashMap();
+        for (String date : collect.keySet()) {
+            List<KaoqinRecord> kaoqinRecords1 = collect.get(date);
+            //定义标签显示状态
+            String abnormal = "";
+            int num = 0;
+            for (KaoqinRecord record : kaoqinRecords1) {
+                String kaType = record.getKaType();
+                if (!"1".equals(kaType)){
+                    abnormal = kaType + ",";
+                    num = num+1;
+                }
+            }
+            if (num==0){
+                abnormal = "1";
+            }
+            //日期
+            map.put("data",date);
+            //标签显示状态
+            map.put("info",abnormal);
+            //打卡记录列表
+            map.put("list",kaoqinRecords1);
+            list.add(map);
+        }
+        return AjaxResult.success(list);
+    }
+
+
+    /**
+     * 计算是否在范围内
+     *
+     * @param platPunch
+     * @return
+     */
+    public Boolean getPunch(PlatPunch platPunch) {
+        //1、设置目的地经度
+        String longitudeS = "117.21";
+        //设置目的纬度
+        String latitudeS = "31.84";
+        // 2、由前端传过来的用户所在位置 经纬度
+        String longitudeT = platPunch.getLongitude();
+        String latitudeT = platPunch.getLatitude();
+        // 3、对比
+        GlobalCoordinates source = new GlobalCoordinates(Double.parseDouble(latitudeS), Double.parseDouble(longitudeS));
+        GlobalCoordinates target = new GlobalCoordinates(Double.parseDouble(latitudeT), Double.parseDouble(longitudeT));
+        //这是两种坐标系计算方法,这是第一种坐标系计算方法(我们用的这种)
+        double geoCurve = getDistanceMeter(source, target, Ellipsoid.Sphere);
+        //这是两种坐标系计算方法,这是第二种坐标系计算方法
+        double geoCurve2 = getDistanceMeter(source, target, Ellipsoid.WGS84);
+        System.out.println(geoCurve + "----------" + geoCurve2);
+        //如果用户和目的地位置想吃2千米,在不能打卡;
+        if (geoCurve > 2000) {
+            System.out.println("不能打卡!!!");
+            //反之,可以打卡
+        } else {
+            System.out.println("能打卡");
+        }
+        return true;
+    }
+}

+ 103 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/kaoqin/KaoqinConfigController.java

@@ -0,0 +1,103 @@
+package com.ruoyi.web.controller.kaoqin;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.domain.KaoqinConfig;
+import com.ruoyi.system.service.IKaoqinConfigService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 考勤规则配置Controller
+ * 
+ * @author boman
+ * @date 2023-02-02
+ */
+@RestController
+@RequestMapping("/kaoqin/config")
+public class KaoqinConfigController extends BaseController
+{
+    @Autowired
+    private IKaoqinConfigService kaoqinConfigService;
+
+    /**
+     * 查询考勤规则配置列表
+     */
+    @PreAuthorize("@ss.hasPermi('kaoqin:config:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(KaoqinConfig kaoqinConfig)
+    {
+        startPage();
+        List<KaoqinConfig> list = kaoqinConfigService.selectKaoqinConfigList(kaoqinConfig);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出考勤规则配置列表
+     */
+    @PreAuthorize("@ss.hasPermi('kaoqin:config:export')")
+    @Log(title = "考勤规则配置", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, KaoqinConfig kaoqinConfig)
+    {
+        List<KaoqinConfig> list = kaoqinConfigService.selectKaoqinConfigList(kaoqinConfig);
+        ExcelUtil<KaoqinConfig> util = new ExcelUtil<KaoqinConfig>(KaoqinConfig.class);
+        util.exportExcel(response, list, "考勤规则配置数据");
+    }
+
+    /**
+     * 获取考勤规则配置详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('kaoqin:config:query')")
+    @GetMapping(value = "/{kaoqinId}")
+    public AjaxResult getInfo(@PathVariable("kaoqinId") Long kaoqinId)
+    {
+        return AjaxResult.success(kaoqinConfigService.selectKaoqinConfigByKaoqinId(kaoqinId));
+    }
+
+    /**
+     * 新增考勤规则配置
+     */
+    @PreAuthorize("@ss.hasPermi('kaoqin:config:add')")
+    @Log(title = "考勤规则配置", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody KaoqinConfig kaoqinConfig)
+    {
+        return toAjax(kaoqinConfigService.insertKaoqinConfig(kaoqinConfig));
+    }
+
+    /**
+     * 修改考勤规则配置
+     */
+    @PreAuthorize("@ss.hasPermi('kaoqin:config:edit')")
+    @Log(title = "考勤规则配置", businessType = BusinessType.UPDATE)
+    @PostMapping("/put")
+    public AjaxResult edit(@RequestBody KaoqinConfig kaoqinConfig)
+    {
+        return toAjax(kaoqinConfigService.updateKaoqinConfig(kaoqinConfig));
+    }
+
+    /**
+     * 删除考勤规则配置
+     */
+    @PreAuthorize("@ss.hasPermi('kaoqin:config:remove')")
+    @Log(title = "考勤规则配置", businessType = BusinessType.DELETE)
+    @GetMapping(value = "/delete/{kaoqinIds}")
+    public AjaxResult remove(@PathVariable Long[] kaoqinIds)
+    {
+        return toAjax(kaoqinConfigService.deleteKaoqinConfigByKaoqinIds(kaoqinIds));
+    }
+}

+ 104 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/kaoqin/KaoqinRecordController.java

@@ -0,0 +1,104 @@
+package com.ruoyi.web.controller.kaoqin;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.system.domain.KaoqinRecord;
+import com.ruoyi.system.service.IKaoqinRecordService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 考勤记录Controller
+ * 
+ * @author ruoyi
+ * @date 2023-02-02
+ */
+@RestController
+@RequestMapping("/record")
+public class KaoqinRecordController extends BaseController
+{
+    @Autowired
+    private IKaoqinRecordService kaoqinRecordService;
+
+    /**
+     * 查询考勤记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:record:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(KaoqinRecord kaoqinRecord)
+    {
+        startPage();
+        List<KaoqinRecord> list = kaoqinRecordService.selectKaoqinRecordList(kaoqinRecord);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出考勤记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:record:export')")
+    @Log(title = "考勤记录", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, KaoqinRecord kaoqinRecord)
+    {
+        List<KaoqinRecord> list = kaoqinRecordService.selectKaoqinRecordList(kaoqinRecord);
+        ExcelUtil<KaoqinRecord> util = new ExcelUtil<KaoqinRecord>(KaoqinRecord.class);
+        util.exportExcel(response, list, "考勤记录数据");
+    }
+
+    /**
+     * 获取考勤记录详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:record:query')")
+    @GetMapping(value = "/{recordId}")
+    public AjaxResult getInfo(@PathVariable("recordId") Long recordId)
+    {
+        return AjaxResult.success(kaoqinRecordService.selectKaoqinRecordByRecordId(recordId));
+    }
+
+    /**
+     * 新增考勤记录
+     */
+    @PreAuthorize("@ss.hasPermi('system:record:add')")
+    @Log(title = "考勤记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody KaoqinRecord kaoqinRecord)
+    {
+        return toAjax(kaoqinRecordService.insertKaoqinRecord(kaoqinRecord));
+    }
+
+    /**
+     * 修改考勤记录
+     */
+    @PreAuthorize("@ss.hasPermi('system:record:edit')")
+    @Log(title = "考勤记录", businessType = BusinessType.UPDATE)
+    @PostMapping("put")
+    public AjaxResult edit(@RequestBody KaoqinRecord kaoqinRecord)
+    {
+        return toAjax(kaoqinRecordService.updateKaoqinRecord(kaoqinRecord));
+    }
+
+    /**
+     * 删除考勤记录
+     */
+    @PreAuthorize("@ss.hasPermi('system:record:remove')")
+    @Log(title = "考勤记录", businessType = BusinessType.DELETE)
+    @GetMapping(value = "/delete/{recordIds}")
+    public AjaxResult remove(@PathVariable Long[] recordIds)
+    {
+        return toAjax(kaoqinRecordService.deleteKaoqinRecordByRecordIds(recordIds));
+    }
+}

+ 21 - 0
ruoyi-common/src/main/java/com/ruoyi/common/PunchUtils.java

@@ -0,0 +1,21 @@
+package com.ruoyi.common;
+
+import org.gavaghan.geodesy.Ellipsoid;
+import org.gavaghan.geodesy.GeodeticCalculator;
+import org.gavaghan.geodesy.GeodeticCurve;
+import org.gavaghan.geodesy.GlobalCoordinates;
+
+/**
+ * @Author: tjf
+ * @Date: 2023/2/1 14:42
+ * @Describe:
+ */
+public class PunchUtils {
+    /* 经纬度计算工具类*/
+    public static double getDistanceMeter(GlobalCoordinates gpsFrom, GlobalCoordinates gpsTo, Ellipsoid ellipsoid)
+    {
+        //创建GeodeticCalculator,调用计算方法,传入坐标系、经纬度用于计算距离
+        GeodeticCurve geoCurve = new GeodeticCalculator().calculateGeodeticCurve(ellipsoid, gpsFrom, gpsTo);
+        return geoCurve.getEllipsoidalDistance();
+    }
+}

+ 202 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/KaoqinConfig.java

@@ -0,0 +1,202 @@
+package com.ruoyi.system.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 考勤规则配置对象 kaoqin_config
+ * 
+ * @author boman
+ * @date 2023-02-02
+ */
+public class KaoqinConfig extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 配置id */
+    private Long kaoqinId;
+
+    /** 部门id */
+    @Excel(name = "部门id")
+    private String deptId;
+
+    /** 打卡地点名称 */
+    @Excel(name = "打卡地点名称")
+    private String kaAddress;
+
+    /** 打卡地点经度 */
+    @Excel(name = "打卡地点经度")
+    private String kaLog;
+
+    /** 打卡地点维度 */
+    @Excel(name = "打卡地点维度")
+    private String kaLat;
+
+    /** 打卡次数(一天几次打卡) */
+    @Excel(name = "打卡次数(一天几次打卡)")
+    private String kaNum;
+
+    /** 打卡距离(半径) */
+    @Excel(name = "打卡距离(半径)")
+    private String kaRadius;
+
+    /** 打卡分类 1:上午上班 2:上午下班 3:下午上班 4:下午下班 */
+    @Excel(name = "打卡分类 1:上午上班 2:上午下班 3:下午上班 4:下午下班")
+    private String kaSort;
+
+    /** 打卡时间 -上午上班 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "打卡时间 -上午上班", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date kaTimeAmIn;
+
+    /** 打卡时间 -上午下班 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "打卡时间 -上午下班", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date kaTimeAmOut;
+
+    /** 打卡时间 -下午上班 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "打卡时间 -下午上班", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date kaTimePmIn;
+
+    /** 打卡时间 -下午下班 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "打卡时间 -下午下班", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date kaTimePmOut;
+
+    public void setKaoqinId(Long kaoqinId) 
+    {
+        this.kaoqinId = kaoqinId;
+    }
+
+    public Long getKaoqinId() 
+    {
+        return kaoqinId;
+    }
+    public void setDeptId(String deptId)
+    {
+        this.deptId = deptId;
+    }
+
+    public String getDeptId()
+    {
+        return deptId;
+    }
+    public void setKaAddress(String kaAddress) 
+    {
+        this.kaAddress = kaAddress;
+    }
+
+    public String getKaAddress() 
+    {
+        return kaAddress;
+    }
+    public void setKaLog(String kaLog) 
+    {
+        this.kaLog = kaLog;
+    }
+
+    public String getKaLog() 
+    {
+        return kaLog;
+    }
+    public void setKaLat(String kaLat) 
+    {
+        this.kaLat = kaLat;
+    }
+
+    public String getKaLat() 
+    {
+        return kaLat;
+    }
+    public void setKaNum(String kaNum) 
+    {
+        this.kaNum = kaNum;
+    }
+
+    public String getKaNum() 
+    {
+        return kaNum;
+    }
+    public void setKaRadius(String kaRadius) 
+    {
+        this.kaRadius = kaRadius;
+    }
+
+    public String getKaRadius() 
+    {
+        return kaRadius;
+    }
+    public void setKaSort(String kaSort) 
+    {
+        this.kaSort = kaSort;
+    }
+
+    public String getKaSort() 
+    {
+        return kaSort;
+    }
+    public void setKaTimeAmIn(Date kaTimeAmIn) 
+    {
+        this.kaTimeAmIn = kaTimeAmIn;
+    }
+
+    public Date getKaTimeAmIn() 
+    {
+        return kaTimeAmIn;
+    }
+    public void setKaTimeAmOut(Date kaTimeAmOut) 
+    {
+        this.kaTimeAmOut = kaTimeAmOut;
+    }
+
+    public Date getKaTimeAmOut() 
+    {
+        return kaTimeAmOut;
+    }
+    public void setKaTimePmIn(Date kaTimePmIn) 
+    {
+        this.kaTimePmIn = kaTimePmIn;
+    }
+
+    public Date getKaTimePmIn() 
+    {
+        return kaTimePmIn;
+    }
+    public void setKaTimePmOut(Date kaTimePmOut) 
+    {
+        this.kaTimePmOut = kaTimePmOut;
+    }
+
+    public Date getKaTimePmOut() 
+    {
+        return kaTimePmOut;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("kaoqinId", getKaoqinId())
+            .append("deptId", getDeptId())
+            .append("kaAddress", getKaAddress())
+            .append("kaLog", getKaLog())
+            .append("kaLat", getKaLat())
+            .append("kaNum", getKaNum())
+            .append("kaRadius", getKaRadius())
+            .append("kaSort", getKaSort())
+            .append("kaTimeAmIn", getKaTimeAmIn())
+            .append("kaTimeAmOut", getKaTimeAmOut())
+            .append("kaTimePmIn", getKaTimePmIn())
+            .append("kaTimePmOut", getKaTimePmOut())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 283 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/KaoqinRecord.java

@@ -0,0 +1,283 @@
+package com.ruoyi.system.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 考勤记录对象 kaoqin_record
+ * 
+ * @author ruoyi
+ * @date 2023-02-02
+ */
+public class KaoqinRecord extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 考勤记录表id */
+    private Long recordId;
+
+    /** 打卡人id */
+    @Excel(name = "打卡人id")
+    private Long userId;
+
+    /** 部门id */
+    @Excel(name = "部门id")
+    private Long deptId;
+
+    /** 打卡时间 年 */
+    @Excel(name = "打卡时间 年")
+    private String kaYear;
+
+    /** 打卡时间 月 */
+    @Excel(name = "打卡时间 月")
+    private String kaMonth;
+
+    /** 打卡时间 日 */
+    @Excel(name = "打卡时间 日")
+    private String kaDay;
+
+    /** 打卡时间 星期 */
+    @Excel(name = "打卡时间 星期")
+    private String kaWeek;
+
+    /** 打卡时间年-月-日 */
+    @Excel(name = "打卡时间年-月-日")
+    private String kaTime;
+
+    /** 打卡地点名称 */
+    @Excel(name = "打卡地点名称")
+    private String kaAddress;
+
+    /** 打卡地点经度 */
+    @Excel(name = "打卡地点经度")
+    private String kaLog;
+
+    /** 打卡地点维度 */
+    @Excel(name = "打卡地点维度")
+    private String kaLat;
+
+    /** 打卡分类 1:上午上班 2:上午下班 3:下午上班 4:下午下班 */
+    @Excel(name = "打卡分类 1:上午上班 2:上午下班 3:下午上班 4:下午下班")
+    private String kaSort;
+
+    /** 打卡时间 -上午上班 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "打卡时间 -上午上班", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date kaTimeAmIn;
+
+    /** 打卡时间 -上午下班 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "打卡时间 -上午下班", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date kaTimeAmOut;
+
+    /** 打卡时间 -下午上班 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "打卡时间 -下午上班", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date kaTimePmIn;
+
+    /** 打卡时间 -下午下班 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "打卡时间 -下午下班", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date kaTimePmOut;
+
+    /** 打卡状态 1正常 2:迟到 3:外勤 4:早退 */
+    @Excel(name = "打卡类别 1正常 2:迟到 3:外勤 4:早退")
+    private String kaType;
+
+    @Excel(name = "打卡状态 1正常 2:异常")
+    private String kaStatus;
+
+    public String getKaStatus() {
+        return kaStatus;
+    }
+
+    public void setKaStatus(String kaStatus) {
+        this.kaStatus = kaStatus;
+    }
+
+    public void setRecordId(Long recordId)
+    {
+        this.recordId = recordId;
+    }
+
+    public Long getRecordId() 
+    {
+        return recordId;
+    }
+    public void setUserId(Long userId) 
+    {
+        this.userId = userId;
+    }
+
+    public Long getUserId() 
+    {
+        return userId;
+    }
+    public void setDeptId(Long deptId) 
+    {
+        this.deptId = deptId;
+    }
+
+    public Long getDeptId() 
+    {
+        return deptId;
+    }
+    public void setKaYear(String kaYear) 
+    {
+        this.kaYear = kaYear;
+    }
+
+    public String getKaYear() 
+    {
+        return kaYear;
+    }
+    public void setKaMonth(String kaMonth) 
+    {
+        this.kaMonth = kaMonth;
+    }
+
+    public String getKaMonth() 
+    {
+        return kaMonth;
+    }
+    public void setKaDay(String kaDay) 
+    {
+        this.kaDay = kaDay;
+    }
+
+    public String getKaDay() 
+    {
+        return kaDay;
+    }
+    public void setKaWeek(String kaWeek) 
+    {
+        this.kaWeek = kaWeek;
+    }
+
+    public String getKaWeek() 
+    {
+        return kaWeek;
+    }
+    public void setKaTime(String kaTime) 
+    {
+        this.kaTime = kaTime;
+    }
+
+    public String getKaTime() 
+    {
+        return kaTime;
+    }
+    public void setKaAddress(String kaAddress) 
+    {
+        this.kaAddress = kaAddress;
+    }
+
+    public String getKaAddress() 
+    {
+        return kaAddress;
+    }
+    public void setKaLog(String kaLog) 
+    {
+        this.kaLog = kaLog;
+    }
+
+    public String getKaLog() 
+    {
+        return kaLog;
+    }
+    public void setKaLat(String kaLat) 
+    {
+        this.kaLat = kaLat;
+    }
+
+    public String getKaLat() 
+    {
+        return kaLat;
+    }
+    public void setKaSort(String kaSort) 
+    {
+        this.kaSort = kaSort;
+    }
+
+    public String getKaSort() 
+    {
+        return kaSort;
+    }
+    public void setKaTimeAmIn(Date kaTimeAmIn) 
+    {
+        this.kaTimeAmIn = kaTimeAmIn;
+    }
+
+    public Date getKaTimeAmIn() 
+    {
+        return kaTimeAmIn;
+    }
+    public void setKaTimeAmOut(Date kaTimeAmOut) 
+    {
+        this.kaTimeAmOut = kaTimeAmOut;
+    }
+
+    public Date getKaTimeAmOut() 
+    {
+        return kaTimeAmOut;
+    }
+    public void setKaTimePmIn(Date kaTimePmIn) 
+    {
+        this.kaTimePmIn = kaTimePmIn;
+    }
+
+    public Date getKaTimePmIn() 
+    {
+        return kaTimePmIn;
+    }
+    public void setKaTimePmOut(Date kaTimePmOut) 
+    {
+        this.kaTimePmOut = kaTimePmOut;
+    }
+
+    public Date getKaTimePmOut() 
+    {
+        return kaTimePmOut;
+    }
+    public void setKaType(String kaType) 
+    {
+        this.kaType = kaType;
+    }
+
+    public String getKaType() 
+    {
+        return kaType;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("recordId", getRecordId())
+            .append("userId", getUserId())
+            .append("deptId", getDeptId())
+            .append("kaYear", getKaYear())
+            .append("kaMonth", getKaMonth())
+            .append("kaDay", getKaDay())
+            .append("kaWeek", getKaWeek())
+            .append("kaTime", getKaTime())
+            .append("kaAddress", getKaAddress())
+            .append("kaLog", getKaLog())
+            .append("kaLat", getKaLat())
+            .append("kaSort", getKaSort())
+            .append("kaTimeAmIn", getKaTimeAmIn())
+            .append("kaTimeAmOut", getKaTimeAmOut())
+            .append("kaTimePmIn", getKaTimePmIn())
+            .append("kaTimePmOut", getKaTimePmOut())
+            .append("kaType", getKaType())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 41 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/PlatPunch.java

@@ -0,0 +1,41 @@
+package com.ruoyi.system.domain;
+
+/**经纬度
+ * @Author: tjf
+ * @Date: 2023/2/1 14:47
+ * @Describe:
+ */
+public class PlatPunch {
+    /*经度*/
+    private String longitude;
+    /*纬度*/
+    private String latitude;
+    /**
+     * 部门id
+     */
+    private String deptId;
+
+    public String getDeptId() {
+        return deptId;
+    }
+
+    public void setDeptId(String deptId) {
+        this.deptId = deptId;
+    }
+
+    public String getLongitude() {
+        return longitude;
+    }
+
+    public void setLongitude(String longitude) {
+        this.longitude = longitude;
+    }
+
+    public String getLatitude() {
+        return latitude;
+    }
+
+    public void setLatitude(String latitude) {
+        this.latitude = latitude;
+    }
+}

+ 63 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/KaoqinConfigMapper.java

@@ -0,0 +1,63 @@
+package com.ruoyi.system.mapper;
+
+
+import com.ruoyi.system.domain.KaoqinConfig;
+
+import java.util.List;
+
+/**
+ * 考勤规则配置Mapper接口
+ * 
+ * @author boman
+ * @date 2023-02-02
+ */
+public interface KaoqinConfigMapper 
+{
+    /**
+     * 查询考勤规则配置
+     * 
+     * @param kaoqinId 考勤规则配置主键
+     * @return 考勤规则配置
+     */
+    public KaoqinConfig selectKaoqinConfigByKaoqinId(Long kaoqinId);
+
+    /**
+     * 查询考勤规则配置列表
+     * 
+     * @param kaoqinConfig 考勤规则配置
+     * @return 考勤规则配置集合
+     */
+    public List<KaoqinConfig> selectKaoqinConfigList(KaoqinConfig kaoqinConfig);
+
+    /**
+     * 新增考勤规则配置
+     * 
+     * @param kaoqinConfig 考勤规则配置
+     * @return 结果
+     */
+    public int insertKaoqinConfig(KaoqinConfig kaoqinConfig);
+
+    /**
+     * 修改考勤规则配置
+     * 
+     * @param kaoqinConfig 考勤规则配置
+     * @return 结果
+     */
+    public int updateKaoqinConfig(KaoqinConfig kaoqinConfig);
+
+    /**
+     * 删除考勤规则配置
+     * 
+     * @param kaoqinId 考勤规则配置主键
+     * @return 结果
+     */
+    public int deleteKaoqinConfigByKaoqinId(Long kaoqinId);
+
+    /**
+     * 批量删除考勤规则配置
+     * 
+     * @param kaoqinIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteKaoqinConfigByKaoqinIds(Long[] kaoqinIds);
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/KaoqinRecordMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.system.mapper;
+
+import java.util.List;
+import com.ruoyi.system.domain.KaoqinRecord;
+
+/**
+ * 考勤记录Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2023-02-02
+ */
+public interface KaoqinRecordMapper 
+{
+    /**
+     * 查询考勤记录
+     * 
+     * @param recordId 考勤记录主键
+     * @return 考勤记录
+     */
+    public KaoqinRecord selectKaoqinRecordByRecordId(Long recordId);
+
+    /**
+     * 查询考勤记录列表
+     * 
+     * @param kaoqinRecord 考勤记录
+     * @return 考勤记录集合
+     */
+    public List<KaoqinRecord> selectKaoqinRecordList(KaoqinRecord kaoqinRecord);
+
+    /**
+     * 新增考勤记录
+     * 
+     * @param kaoqinRecord 考勤记录
+     * @return 结果
+     */
+    public int insertKaoqinRecord(KaoqinRecord kaoqinRecord);
+
+    /**
+     * 修改考勤记录
+     * 
+     * @param kaoqinRecord 考勤记录
+     * @return 结果
+     */
+    public int updateKaoqinRecord(KaoqinRecord kaoqinRecord);
+
+    /**
+     * 删除考勤记录
+     * 
+     * @param recordId 考勤记录主键
+     * @return 结果
+     */
+    public int deleteKaoqinRecordByRecordId(Long recordId);
+
+    /**
+     * 批量删除考勤记录
+     * 
+     * @param recordIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteKaoqinRecordByRecordIds(Long[] recordIds);
+}

+ 63 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IKaoqinConfigService.java

@@ -0,0 +1,63 @@
+package com.ruoyi.system.service;
+
+
+import com.ruoyi.system.domain.KaoqinConfig;
+
+import java.util.List;
+
+/**
+ * 考勤规则配置Service接口
+ * 
+ * @author boman
+ * @date 2023-02-02
+ */
+public interface IKaoqinConfigService 
+{
+    /**
+     * 查询考勤规则配置
+     * 
+     * @param kaoqinId 考勤规则配置主键
+     * @return 考勤规则配置
+     */
+    public KaoqinConfig selectKaoqinConfigByKaoqinId(Long kaoqinId);
+
+    /**
+     * 查询考勤规则配置列表
+     * 
+     * @param kaoqinConfig 考勤规则配置
+     * @return 考勤规则配置集合
+     */
+    public List<KaoqinConfig> selectKaoqinConfigList(KaoqinConfig kaoqinConfig);
+
+    /**
+     * 新增考勤规则配置
+     * 
+     * @param kaoqinConfig 考勤规则配置
+     * @return 结果
+     */
+    public int insertKaoqinConfig(KaoqinConfig kaoqinConfig);
+
+    /**
+     * 修改考勤规则配置
+     * 
+     * @param kaoqinConfig 考勤规则配置
+     * @return 结果
+     */
+    public int updateKaoqinConfig(KaoqinConfig kaoqinConfig);
+
+    /**
+     * 批量删除考勤规则配置
+     * 
+     * @param kaoqinIds 需要删除的考勤规则配置主键集合
+     * @return 结果
+     */
+    public int deleteKaoqinConfigByKaoqinIds(Long[] kaoqinIds);
+
+    /**
+     * 删除考勤规则配置信息
+     * 
+     * @param kaoqinId 考勤规则配置主键
+     * @return 结果
+     */
+    public int deleteKaoqinConfigByKaoqinId(Long kaoqinId);
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IKaoqinRecordService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.system.service;
+
+import java.util.List;
+import com.ruoyi.system.domain.KaoqinRecord;
+
+/**
+ * 考勤记录Service接口
+ * 
+ * @author ruoyi
+ * @date 2023-02-02
+ */
+public interface IKaoqinRecordService 
+{
+    /**
+     * 查询考勤记录
+     * 
+     * @param recordId 考勤记录主键
+     * @return 考勤记录
+     */
+    public KaoqinRecord selectKaoqinRecordByRecordId(Long recordId);
+
+    /**
+     * 查询考勤记录列表
+     * 
+     * @param kaoqinRecord 考勤记录
+     * @return 考勤记录集合
+     */
+    public List<KaoqinRecord> selectKaoqinRecordList(KaoqinRecord kaoqinRecord);
+
+    /**
+     * 新增考勤记录
+     * 
+     * @param kaoqinRecord 考勤记录
+     * @return 结果
+     */
+    public int insertKaoqinRecord(KaoqinRecord kaoqinRecord);
+
+    /**
+     * 修改考勤记录
+     * 
+     * @param kaoqinRecord 考勤记录
+     * @return 结果
+     */
+    public int updateKaoqinRecord(KaoqinRecord kaoqinRecord);
+
+    /**
+     * 批量删除考勤记录
+     * 
+     * @param recordIds 需要删除的考勤记录主键集合
+     * @return 结果
+     */
+    public int deleteKaoqinRecordByRecordIds(Long[] recordIds);
+
+    /**
+     * 删除考勤记录信息
+     * 
+     * @param recordId 考勤记录主键
+     * @return 结果
+     */
+    public int deleteKaoqinRecordByRecordId(Long recordId);
+}

+ 99 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/KaoqinConfigServiceImpl.java

@@ -0,0 +1,99 @@
+package com.ruoyi.system.service.impl;
+
+
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.system.domain.KaoqinConfig;
+import com.ruoyi.system.mapper.KaoqinConfigMapper;
+import com.ruoyi.system.service.IKaoqinConfigService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+/**
+ * 考勤规则配置Service业务层处理
+ * 
+ * @author boman
+ * @date 2023-02-02
+ */
+@Service
+public class KaoqinConfigServiceImpl implements IKaoqinConfigService
+{
+    @Autowired
+    private KaoqinConfigMapper kaoqinConfigMapper;
+
+    /**
+     * 查询考勤规则配置
+     * 
+     * @param kaoqinId 考勤规则配置主键
+     * @return 考勤规则配置
+     */
+    @Override
+    public KaoqinConfig selectKaoqinConfigByKaoqinId(Long kaoqinId)
+    {
+        return kaoqinConfigMapper.selectKaoqinConfigByKaoqinId(kaoqinId);
+    }
+
+    /**
+     * 查询考勤规则配置列表
+     * 
+     * @param kaoqinConfig 考勤规则配置
+     * @return 考勤规则配置
+     */
+    @Override
+    public List<KaoqinConfig> selectKaoqinConfigList(KaoqinConfig kaoqinConfig)
+    {
+        return kaoqinConfigMapper.selectKaoqinConfigList(kaoqinConfig);
+    }
+
+    /**
+     * 新增考勤规则配置
+     * 
+     * @param kaoqinConfig 考勤规则配置
+     * @return 结果
+     */
+    @Override
+    public int insertKaoqinConfig(KaoqinConfig kaoqinConfig)
+    {
+        kaoqinConfig.setCreateTime(DateUtils.getNowDate());
+        return kaoqinConfigMapper.insertKaoqinConfig(kaoqinConfig);
+    }
+
+    /**
+     * 修改考勤规则配置
+     * 
+     * @param kaoqinConfig 考勤规则配置
+     * @return 结果
+     */
+    @Override
+    public int updateKaoqinConfig(KaoqinConfig kaoqinConfig)
+    {
+        kaoqinConfig.setUpdateTime(DateUtils.getNowDate());
+        return kaoqinConfigMapper.updateKaoqinConfig(kaoqinConfig);
+    }
+
+    /**
+     * 批量删除考勤规则配置
+     * 
+     * @param kaoqinIds 需要删除的考勤规则配置主键
+     * @return 结果
+     */
+    @Override
+    public int deleteKaoqinConfigByKaoqinIds(Long[] kaoqinIds)
+    {
+        return kaoqinConfigMapper.deleteKaoqinConfigByKaoqinIds(kaoqinIds);
+    }
+
+    /**
+     * 删除考勤规则配置信息
+     * 
+     * @param kaoqinId 考勤规则配置主键
+     * @return 结果
+     */
+    @Override
+    public int deleteKaoqinConfigByKaoqinId(Long kaoqinId)
+    {
+        return kaoqinConfigMapper.deleteKaoqinConfigByKaoqinId(kaoqinId);
+    }
+}

+ 96 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/KaoqinRecordServiceImpl.java

@@ -0,0 +1,96 @@
+package com.ruoyi.system.service.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.system.mapper.KaoqinRecordMapper;
+import com.ruoyi.system.domain.KaoqinRecord;
+import com.ruoyi.system.service.IKaoqinRecordService;
+
+/**
+ * 考勤记录Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2023-02-02
+ */
+@Service
+public class KaoqinRecordServiceImpl implements IKaoqinRecordService 
+{
+    @Autowired
+    private KaoqinRecordMapper kaoqinRecordMapper;
+
+    /**
+     * 查询考勤记录
+     * 
+     * @param recordId 考勤记录主键
+     * @return 考勤记录
+     */
+    @Override
+    public KaoqinRecord selectKaoqinRecordByRecordId(Long recordId)
+    {
+        return kaoqinRecordMapper.selectKaoqinRecordByRecordId(recordId);
+    }
+
+    /**
+     * 查询考勤记录列表
+     * 
+     * @param kaoqinRecord 考勤记录
+     * @return 考勤记录
+     */
+    @Override
+    public List<KaoqinRecord> selectKaoqinRecordList(KaoqinRecord kaoqinRecord)
+    {
+        return kaoqinRecordMapper.selectKaoqinRecordList(kaoqinRecord);
+    }
+
+    /**
+     * 新增考勤记录
+     * 
+     * @param kaoqinRecord 考勤记录
+     * @return 结果
+     */
+    @Override
+    public int insertKaoqinRecord(KaoqinRecord kaoqinRecord)
+    {
+        kaoqinRecord.setCreateTime(DateUtils.getNowDate());
+        return kaoqinRecordMapper.insertKaoqinRecord(kaoqinRecord);
+    }
+
+    /**
+     * 修改考勤记录
+     * 
+     * @param kaoqinRecord 考勤记录
+     * @return 结果
+     */
+    @Override
+    public int updateKaoqinRecord(KaoqinRecord kaoqinRecord)
+    {
+        kaoqinRecord.setUpdateTime(DateUtils.getNowDate());
+        return kaoqinRecordMapper.updateKaoqinRecord(kaoqinRecord);
+    }
+
+    /**
+     * 批量删除考勤记录
+     * 
+     * @param recordIds 需要删除的考勤记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteKaoqinRecordByRecordIds(Long[] recordIds)
+    {
+        return kaoqinRecordMapper.deleteKaoqinRecordByRecordIds(recordIds);
+    }
+
+    /**
+     * 删除考勤记录信息
+     * 
+     * @param recordId 考勤记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteKaoqinRecordByRecordId(Long recordId)
+    {
+        return kaoqinRecordMapper.deleteKaoqinRecordByRecordId(recordId);
+    }
+}

+ 126 - 0
ruoyi-system/src/main/resources/mapper/system/KaoqinConfigMapper.xml

@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.system.mapper.KaoqinConfigMapper">
+    
+    <resultMap type="KaoqinConfig" id="KaoqinConfigResult">
+        <result property="kaoqinId"    column="kaoqin_id"    />
+        <result property="deptId"    column="dept_id"    />
+        <result property="kaAddress"    column="ka_address"    />
+        <result property="kaLog"    column="ka_log"    />
+        <result property="kaLat"    column="ka_lat"    />
+        <result property="kaNum"    column="ka_num"    />
+        <result property="kaRadius"    column="ka_radius"    />
+        <result property="kaSort"    column="ka_sort"    />
+        <result property="kaTimeAmIn"    column="ka_time_am_in"    />
+        <result property="kaTimeAmOut"    column="ka_time_am_out"    />
+        <result property="kaTimePmIn"    column="ka_time_pm_in"    />
+        <result property="kaTimePmOut"    column="ka_time_pm_out"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+
+    <sql id="selectKaoqinConfigVo">
+        select kaoqin_id, dept_id, ka_address, ka_log, ka_lat, ka_num, ka_radius, ka_sort, ka_time_am_in, ka_time_am_out, ka_time_pm_in, ka_time_pm_out, create_by, create_time, update_by, update_time, remark from kaoqin_config
+    </sql>
+
+    <select id="selectKaoqinConfigList" parameterType="KaoqinConfig" resultMap="KaoqinConfigResult">
+        <include refid="selectKaoqinConfigVo"/>
+        <where>  
+            <if test="deptId != null "> and dept_id = #{deptId}</if>
+            <if test="kaAddress != null  and kaAddress != ''"> and ka_address = #{kaAddress}</if>
+            <if test="kaLog != null  and kaLog != ''"> and ka_log = #{kaLog}</if>
+            <if test="kaLat != null  and kaLat != ''"> and ka_lat = #{kaLat}</if>
+            <if test="kaNum != null  and kaNum != ''"> and ka_num = #{kaNum}</if>
+            <if test="kaRadius != null  and kaRadius != ''"> and ka_radius = #{kaRadius}</if>
+            <if test="kaSort != null  and kaSort != ''"> and ka_sort = #{kaSort}</if>
+            <if test="kaTimeAmIn != null "> and ka_time_am_in = #{kaTimeAmIn}</if>
+            <if test="kaTimeAmOut != null "> and ka_time_am_out = #{kaTimeAmOut}</if>
+            <if test="kaTimePmIn != null "> and ka_time_pm_in = #{kaTimePmIn}</if>
+            <if test="kaTimePmOut != null "> and ka_time_pm_out = #{kaTimePmOut}</if>
+        </where>
+    </select>
+    
+    <select id="selectKaoqinConfigByKaoqinId" parameterType="Long" resultMap="KaoqinConfigResult">
+        <include refid="selectKaoqinConfigVo"/>
+        where kaoqin_id = #{kaoqinId}
+    </select>
+        
+    <insert id="insertKaoqinConfig" parameterType="KaoqinConfig" useGeneratedKeys="true" keyProperty="kaoqinId">
+        insert into kaoqin_config
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="deptId != null">dept_id,</if>
+            <if test="kaAddress != null and kaAddress != ''">ka_address,</if>
+            <if test="kaLog != null and kaLog != ''">ka_log,</if>
+            <if test="kaLat != null and kaLat != ''">ka_lat,</if>
+            <if test="kaNum != null and kaNum != ''">ka_num,</if>
+            <if test="kaRadius != null and kaRadius != ''">ka_radius,</if>
+            <if test="kaSort != null and kaSort != ''">ka_sort,</if>
+            <if test="kaTimeAmIn != null">ka_time_am_in,</if>
+            <if test="kaTimeAmOut != null">ka_time_am_out,</if>
+            <if test="kaTimePmIn != null">ka_time_pm_in,</if>
+            <if test="kaTimePmOut != null">ka_time_pm_out,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="deptId != null">#{deptId},</if>
+            <if test="kaAddress != null and kaAddress != ''">#{kaAddress},</if>
+            <if test="kaLog != null and kaLog != ''">#{kaLog},</if>
+            <if test="kaLat != null and kaLat != ''">#{kaLat},</if>
+            <if test="kaNum != null and kaNum != ''">#{kaNum},</if>
+            <if test="kaRadius != null and kaRadius != ''">#{kaRadius},</if>
+            <if test="kaSort != null and kaSort != ''">#{kaSort},</if>
+            <if test="kaTimeAmIn != null">#{kaTimeAmIn},</if>
+            <if test="kaTimeAmOut != null">#{kaTimeAmOut},</if>
+            <if test="kaTimePmIn != null">#{kaTimePmIn},</if>
+            <if test="kaTimePmOut != null">#{kaTimePmOut},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+         </trim>
+    </insert>
+
+    <update id="updateKaoqinConfig" parameterType="KaoqinConfig">
+        update kaoqin_config
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="deptId != null">dept_id = #{deptId},</if>
+            <if test="kaAddress != null and kaAddress != ''">ka_address = #{kaAddress},</if>
+            <if test="kaLog != null and kaLog != ''">ka_log = #{kaLog},</if>
+            <if test="kaLat != null and kaLat != ''">ka_lat = #{kaLat},</if>
+            <if test="kaNum != null and kaNum != ''">ka_num = #{kaNum},</if>
+            <if test="kaRadius != null and kaRadius != ''">ka_radius = #{kaRadius},</if>
+            <if test="kaSort != null and kaSort != ''">ka_sort = #{kaSort},</if>
+            <if test="kaTimeAmIn != null">ka_time_am_in = #{kaTimeAmIn},</if>
+            <if test="kaTimeAmOut != null">ka_time_am_out = #{kaTimeAmOut},</if>
+            <if test="kaTimePmIn != null">ka_time_pm_in = #{kaTimePmIn},</if>
+            <if test="kaTimePmOut != null">ka_time_pm_out = #{kaTimePmOut},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where kaoqin_id = #{kaoqinId}
+    </update>
+
+    <delete id="deleteKaoqinConfigByKaoqinId" parameterType="Long">
+        delete from kaoqin_config where kaoqin_id = #{kaoqinId}
+    </delete>
+
+    <delete id="deleteKaoqinConfigByKaoqinIds" parameterType="String">
+        delete from kaoqin_config where kaoqin_id in 
+        <foreach item="kaoqinId" collection="array" open="(" separator="," close=")">
+            #{kaoqinId}
+        </foreach>
+    </delete>
+</mapper>

+ 156 - 0
ruoyi-system/src/main/resources/mapper/system/KaoqinRecordMapper.xml

@@ -0,0 +1,156 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.system.mapper.KaoqinRecordMapper">
+    
+    <resultMap type="KaoqinRecord" id="KaoqinRecordResult">
+        <result property="recordId"    column="record_id"    />
+        <result property="userId"    column="user_id"    />
+        <result property="deptId"    column="dept_id"    />
+        <result property="kaYear"    column="ka_year"    />
+        <result property="kaMonth"    column="ka_month"    />
+        <result property="kaDay"    column="ka_day"    />
+        <result property="kaWeek"    column="ka_week"    />
+        <result property="kaTime"    column="ka_time"    />
+        <result property="kaAddress"    column="ka_address"    />
+        <result property="kaLog"    column="ka_log"    />
+        <result property="kaLat"    column="ka_lat"    />
+        <result property="kaSort"    column="ka_sort"    />
+        <result property="kaTimeAmIn"    column="ka_time_am_in"    />
+        <result property="kaTimeAmOut"    column="ka_time_am_out"    />
+        <result property="kaTimePmIn"    column="ka_time_pm_in"    />
+        <result property="kaTimePmOut"    column="ka_time_pm_out"    />
+        <result property="kaType"    column="ka_type"    />
+        <result property="kaStatus"    column="ka_status"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+
+    <sql id="selectKaoqinRecordVo">
+        select record_id, user_id, dept_id, ka_year, ka_month, ka_day, ka_week, ka_time, ka_address, ka_log, ka_lat, ka_sort, ka_time_am_in, ka_time_am_out, ka_time_pm_in, ka_time_pm_out, ka_type,ka_status, create_by, create_time, update_by, update_time, remark from kaoqin_record
+    </sql>
+
+    <select id="selectKaoqinRecordList" parameterType="KaoqinRecord" resultMap="KaoqinRecordResult">
+        <include refid="selectKaoqinRecordVo"/>
+        <where>  
+            <if test="userId != null "> and user_id = #{userId}</if>
+            <if test="deptId != null "> and dept_id = #{deptId}</if>
+            <if test="kaYear != null  and kaYear != ''"> and ka_year = #{kaYear}</if>
+            <if test="kaMonth != null  and kaMonth != ''"> and ka_month = #{kaMonth}</if>
+            <if test="kaDay != null  and kaDay != ''"> and ka_day = #{kaDay}</if>
+            <if test="kaWeek != null  and kaWeek != ''"> and ka_week = #{kaWeek}</if>
+            <if test="kaTime != null  and kaTime != ''"> and ka_time = #{kaTime}</if>
+            <if test="kaAddress != null  and kaAddress != ''"> and ka_address = #{kaAddress}</if>
+            <if test="kaLog != null  and kaLog != ''"> and ka_log = #{kaLog}</if>
+            <if test="kaLat != null  and kaLat != ''"> and ka_lat = #{kaLat}</if>
+            <if test="kaSort != null  and kaSort != ''"> and ka_sort = #{kaSort}</if>
+            <if test="kaTimeAmIn != null "> and ka_time_am_in = #{kaTimeAmIn}</if>
+            <if test="kaTimeAmOut != null "> and ka_time_am_out = #{kaTimeAmOut}</if>
+            <if test="kaTimePmIn != null "> and ka_time_pm_in = #{kaTimePmIn}</if>
+            <if test="kaTimePmOut != null "> and ka_time_pm_out = #{kaTimePmOut}</if>
+            <if test="kaType != null  and kaType != ''"> and ka_type = #{kaType}</if>
+            <if test="kaStatus != null  and kaStatus != ''"> and ka_status = #{kaStatus}</if>
+        </where>
+    </select>
+    
+    <select id="selectKaoqinRecordByRecordId" parameterType="Long" resultMap="KaoqinRecordResult">
+        <include refid="selectKaoqinRecordVo"/>
+        where record_id = #{recordId}
+    </select>
+        
+    <insert id="insertKaoqinRecord" parameterType="KaoqinRecord" useGeneratedKeys="true" keyProperty="recordId">
+        insert into kaoqin_record
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="userId != null">user_id,</if>
+            <if test="deptId != null">dept_id,</if>
+            <if test="kaYear != null and kaYear != ''">ka_year,</if>
+            <if test="kaMonth != null and kaMonth != ''">ka_month,</if>
+            <if test="kaDay != null and kaDay != ''">ka_day,</if>
+            <if test="kaWeek != null and kaWeek != ''">ka_week,</if>
+            <if test="kaTime != null and kaTime != ''">ka_time,</if>
+            <if test="kaAddress != null and kaAddress != ''">ka_address,</if>
+            <if test="kaLog != null and kaLog != ''">ka_log,</if>
+            <if test="kaLat != null and kaLat != ''">ka_lat,</if>
+            <if test="kaSort != null and kaSort != ''">ka_sort,</if>
+            <if test="kaTimeAmIn != null">ka_time_am_in,</if>
+            <if test="kaTimeAmOut != null">ka_time_am_out,</if>
+            <if test="kaTimePmIn != null">ka_time_pm_in,</if>
+            <if test="kaTimePmOut != null">ka_time_pm_out,</if>
+            <if test="kaType != null">ka_type,</if>
+            <if test="kaStatus != null">ka_status,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="userId != null">#{userId},</if>
+            <if test="deptId != null">#{deptId},</if>
+            <if test="kaYear != null and kaYear != ''">#{kaYear},</if>
+            <if test="kaMonth != null and kaMonth != ''">#{kaMonth},</if>
+            <if test="kaDay != null and kaDay != ''">#{kaDay},</if>
+            <if test="kaWeek != null and kaWeek != ''">#{kaWeek},</if>
+            <if test="kaTime != null and kaTime != ''">#{kaTime},</if>
+            <if test="kaAddress != null and kaAddress != ''">#{kaAddress},</if>
+            <if test="kaLog != null and kaLog != ''">#{kaLog},</if>
+            <if test="kaLat != null and kaLat != ''">#{kaLat},</if>
+            <if test="kaSort != null and kaSort != ''">#{kaSort},</if>
+            <if test="kaTimeAmIn != null">#{kaTimeAmIn},</if>
+            <if test="kaTimeAmOut != null">#{kaTimeAmOut},</if>
+            <if test="kaTimePmIn != null">#{kaTimePmIn},</if>
+            <if test="kaTimePmOut != null">#{kaTimePmOut},</if>
+            <if test="kaType != null">#{kaType},</if>
+            <if test="kaStatus != null">#{kaStatus},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+         </trim>
+    </insert>
+
+    <update id="updateKaoqinRecord" parameterType="KaoqinRecord">
+        update kaoqin_record
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="deptId != null">dept_id = #{deptId},</if>
+            <if test="kaYear != null and kaYear != ''">ka_year = #{kaYear},</if>
+            <if test="kaMonth != null and kaMonth != ''">ka_month = #{kaMonth},</if>
+            <if test="kaDay != null and kaDay != ''">ka_day = #{kaDay},</if>
+            <if test="kaWeek != null and kaWeek != ''">ka_week = #{kaWeek},</if>
+            <if test="kaTime != null and kaTime != ''">ka_time = #{kaTime},</if>
+            <if test="kaAddress != null and kaAddress != ''">ka_address = #{kaAddress},</if>
+            <if test="kaLog != null and kaLog != ''">ka_log = #{kaLog},</if>
+            <if test="kaLat != null and kaLat != ''">ka_lat = #{kaLat},</if>
+            <if test="kaSort != null and kaSort != ''">ka_sort = #{kaSort},</if>
+            <if test="kaTimeAmIn != null">ka_time_am_in = #{kaTimeAmIn},</if>
+            <if test="kaTimeAmOut != null">ka_time_am_out = #{kaTimeAmOut},</if>
+            <if test="kaTimePmIn != null">ka_time_pm_in = #{kaTimePmIn},</if>
+            <if test="kaTimePmOut != null">ka_time_pm_out = #{kaTimePmOut},</if>
+            <if test="kaType != null">ka_type = #{kaType},</if>
+            <if test="kaStatus != null">ka_status = #{kaStatus},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where record_id = #{recordId}
+    </update>
+
+    <delete id="deleteKaoqinRecordByRecordId" parameterType="Long">
+        delete from kaoqin_record where record_id = #{recordId}
+    </delete>
+
+    <delete id="deleteKaoqinRecordByRecordIds" parameterType="String">
+        delete from kaoqin_record where record_id in 
+        <foreach item="recordId" collection="array" open="(" separator="," close=")">
+            #{recordId}
+        </foreach>
+    </delete>
+</mapper>