Jelajahi Sumber

first commit

slowslo 3 tahun lalu
melakukan
7c348787bd
100 mengubah file dengan 7277 tambahan dan 0 penghapusan
  1. 33 0
      .gitignore
  2. 33 0
      LICENSE
  3. 130 0
      README.md
  4. 432 0
      doc/sql/mysql/ycwgdb.sql
  5. 294 0
      pom.xml
  6. 46 0
      src/main/java/org/springblade/ApplicationWeb.java
  7. 28 0
      src/main/java/org/springblade/MyApplicationRunner.java
  8. 59 0
      src/main/java/org/springblade/alarm/alarmgroup/controller/AAAController.java
  9. 163 0
      src/main/java/org/springblade/alarm/alarmgroup/controller/AlarmGroupController.java
  10. 34 0
      src/main/java/org/springblade/alarm/alarmgroup/dto/AlarmGroupDTO.java
  11. 68 0
      src/main/java/org/springblade/alarm/alarmgroup/entity/AlarmGroup.java
  12. 42 0
      src/main/java/org/springblade/alarm/alarmgroup/mapper/AlarmGroupMapper.java
  13. 29 0
      src/main/java/org/springblade/alarm/alarmgroup/mapper/AlarmGroupMapper.xml
  14. 44 0
      src/main/java/org/springblade/alarm/alarmgroup/service/IAlarmGroupService.java
  15. 61 0
      src/main/java/org/springblade/alarm/alarmgroup/service/impl/AlarmGroupServiceImpl.java
  16. 36 0
      src/main/java/org/springblade/alarm/alarmgroup/vo/AlarmGroupVO.java
  17. 126 0
      src/main/java/org/springblade/alarm/alarmgroupuser/controller/AlarmGroupUserController.java
  18. 34 0
      src/main/java/org/springblade/alarm/alarmgroupuser/dto/AlarmGroupUserDTO.java
  19. 69 0
      src/main/java/org/springblade/alarm/alarmgroupuser/entity/AlarmGroupUser.java
  20. 43 0
      src/main/java/org/springblade/alarm/alarmgroupuser/mapper/AlarmGroupUserMapper.java
  21. 37 0
      src/main/java/org/springblade/alarm/alarmgroupuser/mapper/AlarmGroupUserMapper.xml
  22. 44 0
      src/main/java/org/springblade/alarm/alarmgroupuser/service/IAlarmGroupUserService.java
  23. 48 0
      src/main/java/org/springblade/alarm/alarmgroupuser/service/impl/AlarmGroupUserServiceImpl.java
  24. 36 0
      src/main/java/org/springblade/alarm/alarmgroupuser/vo/AlarmGroupUserVO.java
  25. 161 0
      src/main/java/org/springblade/attence/location/controller/LocationController.java
  26. 34 0
      src/main/java/org/springblade/attence/location/dto/LocationDTO.java
  27. 68 0
      src/main/java/org/springblade/attence/location/entity/Location.java
  28. 42 0
      src/main/java/org/springblade/attence/location/mapper/LocationMapper.java
  29. 28 0
      src/main/java/org/springblade/attence/location/mapper/LocationMapper.xml
  30. 41 0
      src/main/java/org/springblade/attence/location/service/ILocationService.java
  31. 41 0
      src/main/java/org/springblade/attence/location/service/impl/LocationServiceImpl.java
  32. 36 0
      src/main/java/org/springblade/attence/location/vo/LocationVO.java
  33. 49 0
      src/main/java/org/springblade/attence/location/wrapper/LocationWrapper.java
  34. 314 0
      src/main/java/org/springblade/attence/record/controller/RecordController.java
  35. 29 0
      src/main/java/org/springblade/attence/record/dto/QueryMarkDaysDTO.java
  36. 34 0
      src/main/java/org/springblade/attence/record/dto/RecordDTO.java
  37. 149 0
      src/main/java/org/springblade/attence/record/entity/Record.java
  38. 42 0
      src/main/java/org/springblade/attence/record/mapper/RecordMapper.java
  39. 41 0
      src/main/java/org/springblade/attence/record/mapper/RecordMapper.xml
  40. 56 0
      src/main/java/org/springblade/attence/record/service/IRecordService.java
  41. 437 0
      src/main/java/org/springblade/attence/record/service/impl/RecordServiceImpl.java
  42. 46 0
      src/main/java/org/springblade/attence/record/vo/MarkDayVo.java
  43. 40 0
      src/main/java/org/springblade/attence/record/vo/MyStatisticalVo.java
  44. 54 0
      src/main/java/org/springblade/attence/record/vo/RecordAppVO.java
  45. 46 0
      src/main/java/org/springblade/attence/record/vo/RecordVO.java
  46. 49 0
      src/main/java/org/springblade/attence/record/wrapper/RecordWrapper.java
  47. 279 0
      src/main/java/org/springblade/attence/rule/controller/RuleController.java
  48. 39 0
      src/main/java/org/springblade/attence/rule/dto/QueryDataDTO.java
  49. 34 0
      src/main/java/org/springblade/attence/rule/dto/RuleDTO.java
  50. 97 0
      src/main/java/org/springblade/attence/rule/entity/Rule.java
  51. 42 0
      src/main/java/org/springblade/attence/rule/mapper/RuleMapper.java
  52. 33 0
      src/main/java/org/springblade/attence/rule/mapper/RuleMapper.xml
  53. 51 0
      src/main/java/org/springblade/attence/rule/service/IRuleService.java
  54. 309 0
      src/main/java/org/springblade/attence/rule/service/impl/RuleServiceImpl.java
  55. 41 0
      src/main/java/org/springblade/attence/rule/vo/AttenceRuleVo.java
  56. 36 0
      src/main/java/org/springblade/attence/rule/vo/RuleVO.java
  57. 91 0
      src/main/java/org/springblade/attence/rule/vo/WxAppDataVo.java
  58. 49 0
      src/main/java/org/springblade/attence/rule/wrapper/RuleWrapper.java
  59. 129 0
      src/main/java/org/springblade/attence/ruleout/controller/RuleOutController.java
  60. 34 0
      src/main/java/org/springblade/attence/ruleout/dto/RuleOutDTO.java
  61. 73 0
      src/main/java/org/springblade/attence/ruleout/entity/RuleOut.java
  62. 42 0
      src/main/java/org/springblade/attence/ruleout/mapper/RuleOutMapper.java
  63. 28 0
      src/main/java/org/springblade/attence/ruleout/mapper/RuleOutMapper.xml
  64. 41 0
      src/main/java/org/springblade/attence/ruleout/service/IRuleOutService.java
  65. 41 0
      src/main/java/org/springblade/attence/ruleout/service/impl/RuleOutServiceImpl.java
  66. 36 0
      src/main/java/org/springblade/attence/ruleout/vo/RuleOutVO.java
  67. 49 0
      src/main/java/org/springblade/attence/ruleout/wrapper/RuleOutWrapper.java
  68. 180 0
      src/main/java/org/springblade/attence/ruleperson/controller/RulePersonController.java
  69. 34 0
      src/main/java/org/springblade/attence/ruleperson/dto/RulePersonDTO.java
  70. 67 0
      src/main/java/org/springblade/attence/ruleperson/entity/RulePerson.java
  71. 42 0
      src/main/java/org/springblade/attence/ruleperson/mapper/RulePersonMapper.java
  72. 27 0
      src/main/java/org/springblade/attence/ruleperson/mapper/RulePersonMapper.xml
  73. 44 0
      src/main/java/org/springblade/attence/ruleperson/service/IRulePersonService.java
  74. 58 0
      src/main/java/org/springblade/attence/ruleperson/service/impl/RulePersonServiceImpl.java
  75. 36 0
      src/main/java/org/springblade/attence/ruleperson/vo/RulePersonVO.java
  76. 49 0
      src/main/java/org/springblade/attence/ruleperson/wrapper/RulePersonWrapper.java
  77. 143 0
      src/main/java/org/springblade/attence/rulespectime/controller/RuleSpecTimeController.java
  78. 34 0
      src/main/java/org/springblade/attence/rulespectime/dto/RuleSpecTimeDTO.java
  79. 81 0
      src/main/java/org/springblade/attence/rulespectime/entity/RuleSpecTime.java
  80. 42 0
      src/main/java/org/springblade/attence/rulespectime/mapper/RuleSpecTimeMapper.java
  81. 28 0
      src/main/java/org/springblade/attence/rulespectime/mapper/RuleSpecTimeMapper.xml
  82. 41 0
      src/main/java/org/springblade/attence/rulespectime/service/IRuleSpecTimeService.java
  83. 41 0
      src/main/java/org/springblade/attence/rulespectime/service/impl/RuleSpecTimeServiceImpl.java
  84. 36 0
      src/main/java/org/springblade/attence/rulespectime/vo/RuleSpecTimeVO.java
  85. 49 0
      src/main/java/org/springblade/attence/rulespectime/wrapper/RuleSpecTimeWrapper.java
  86. 143 0
      src/main/java/org/springblade/attence/ruletime/controller/RuleTimeController.java
  87. 34 0
      src/main/java/org/springblade/attence/ruletime/dto/RuleTimeDTO.java
  88. 112 0
      src/main/java/org/springblade/attence/ruletime/entity/RuleTime.java
  89. 42 0
      src/main/java/org/springblade/attence/ruletime/mapper/RuleTimeMapper.java
  90. 34 0
      src/main/java/org/springblade/attence/ruletime/mapper/RuleTimeMapper.xml
  91. 41 0
      src/main/java/org/springblade/attence/ruletime/service/IRuleTimeService.java
  92. 41 0
      src/main/java/org/springblade/attence/ruletime/service/impl/RuleTimeServiceImpl.java
  93. 36 0
      src/main/java/org/springblade/attence/ruletime/vo/RuleTimeVO.java
  94. 49 0
      src/main/java/org/springblade/attence/ruletime/wrapper/RuleTimeWrapper.java
  95. 140 0
      src/main/java/org/springblade/attence/ruletype/controller/RuleTypeController.java
  96. 34 0
      src/main/java/org/springblade/attence/ruletype/dto/RuleTypeDTO.java
  97. 52 0
      src/main/java/org/springblade/attence/ruletype/entity/RuleType.java
  98. 42 0
      src/main/java/org/springblade/attence/ruletype/mapper/RuleTypeMapper.java
  99. 24 0
      src/main/java/org/springblade/attence/ruletype/mapper/RuleTypeMapper.xml
  100. 41 0
      src/main/java/org/springblade/attence/ruletype/service/IRuleTypeService.java

+ 33 - 0
.gitignore

@@ -0,0 +1,33 @@
+# maven #
+target
+
+logs
+
+# windows #
+Thumbs.db
+
+# Mac #
+.DS_Store
+
+# eclipse #
+.settings
+.project
+.classpath
+.log
+*.class
+
+# idea #
+.editorconfig
+.idea
+*.iml
+
+# Package Files #
+*.jar
+*.war
+*.ear
+/target
+application.xml
+*.yml
+!/src/main/resources/application-dev.yml
+settings-blade.xml
+Dockerfile

+ 33 - 0
LICENSE

@@ -0,0 +1,33 @@
+BladeX商业授权许可协议
+
+一、 知识产权:
+BladeX系列产品知识产权归BladeX团队独立所有
+
+二、 许可:
+1. 在您完全接受并遵守本协议的基础上,本协议授予您使用BladeX的某些权利和非独占性许可。
+2. 本协议中,将本产品使用用途分为“专业版用途”和“企业版用途”。
+3. “专业版用途”定义:指个人在非团体机构中出于任何目的使用本产品(任何目的包括商业目的或非盈利目的)。
+4. “企业版用途”定义:指团体机构(例如公司企业、政府、学校、军队、医院、社会团体等各类组织)出于任何目的使用本产品(任何目的包括商业目的或非盈利目的)。
+
+三、 约束和限制:
+1. 本产品只能由您为本协议许可的目的而使用,您不得透露给任何第三方;
+2. 从本产品取得的任何信息、软件、产品或服务,您不得对其进行修改、改编或基于以上内容创建同种类别的衍生产品并售卖。
+3. 您不得对本产品以及与之关联的商业授权进行发布、出租、销售、分销、抵押、转让、许可或发放子许可证。
+4. 本产品商业授权版可能包含一些独立功能或特性,这些功能只有在您购买商业授权后才可以使用。在未取得商业授权的情况下,您不得使用、尝试使用或复制这些授权版独立功能。
+5. 若您的客户要求以源码方式交付软件,需缴纳企业版授权费用,否则本产品部分不得提供源码。
+
+四、 不得用于非法或禁止的用途:
+您在使用本产品或服务时,不得将本产品产品或服务用于任何非法用途或本协议条款、条件和声明禁止的用途。
+
+五、 免责说明:
+1. 本产品按“现状”授予许可,您须自行承担使用本产品的风险。BladeX团队不对此提供任何明示、暗示或任何其它形式的担保和表示。在任何情况下,对于因使用或无法使用本软件而导致的任何损失(包括但不仅限于商业利润损失、业务中断或业务信息丢失),BladeX团队无需向您或任何第三方负责,即使BladeX团队已被告知可能会造成此类损失。在任何情况下, BladeX团队均不就任何直接的、间接的、附带的、后果性的、特别的、惩戒性的和处罚性的损害赔偿承担任何责任,无论该主张是基于保证、合同、侵权(包括疏忽)或是基于其他原因作出。
+2. 本产品可能内置有第三方服务,您应自行评估使用这些第三方服务的风险,由使用此类第三方服务而产生的纠纷,全部责任由您自行承担。
+3. BladeX团队不对使用本产品构建的网站中任何信息内容以及导致的任何版权纠纷、法律争议和后果承担任何责任,全部责任由您自行承担。
+4. BladeX团队可能会经常提供产品更新或升级,但BladeX团队没有为根据本协议许可的产品提供维护或更新的责任。
+
+六、 权利和所有权的保留:
+BladeX团队保留所有未在本协议中明确授予您的所有权利。BladeX团队保留随时更新本协议的权利,并只需公示于对应产品项目的LICENSE文件,无需征得您的事先同意且无需另行通知,更新后的内容应于公示即时生效。您可以随时访问产品地址并查阅最新版许可条款,在更新生效后您继续使用本产品则被视作您已接受了新的条款。
+
+七、 协议终止
+1. 您一旦开始复制、下载、安装或者使用本产品,即被视为完全理解并接受本协议的各项条款,在享有上述条款授予的许可权力同时,也受到相关的约束和限制,本协议许可范围以外的行为,将直接违反本协议并构成侵权。
+2. 一旦您违反本协议的条款,BladeX团队随时可能终止本协议、收回许可和授权,并要求您承担相应法律和经济责任。

+ 130 - 0
README.md

@@ -0,0 +1,130 @@
+## BladeX是什么
+* BladeX 是一个基于 Spring Boot 2 & Spring Cloud Greenwich & Mybatis 等核心技术,用于快速构建中大型系统的基础框架
+* 已稳定生产近一年,经历了从Camden->Greenwich的技术架构,也经历了从FatJar->Docker->K8S+Jenkins的部署架构
+* 采用前后端分离的模式,前端开发两个框架:Sword(基于React、Ant Design)、Saber(基于Vue、ElementUI)
+* 后端采用SpringCloud系列,对其基础组件做了高度的封装,单独出一个后端核心框架:BladeX-Tool
+* BladeX-Tool已推送至Maven私有库,直接引入减少工程的模块与依赖,可更注重于业务开发
+* 集成Sentinel从流量控制、熔断降级、系统负载保护等多个维度保护服务的稳定性
+* 注册中心、配置中心选型Nacos,为工程瘦身的同时加强各模块之间的联动
+* 使用Traefik进行反向代理,监听后台变化自动化应用新的配置文件
+* 集成Oauth2协议,完美支持了多终端的接入与认证授权
+* 集成工作流Flowable,复杂流程需求不再难办
+* 创建多租户模式,发布简单,数据隔离轻松
+* 项目分包明确,规范微服务的开发模式
+
+## 商业授权
+* 您一旦开始复制、下载、安装或者使用本产品,即被视为完全理解并接受本协议的各项条款
+* 更多详情请看:[BladeX商业授权许可协议](https://gitee.ltd/blade/BladeX-Boot/src/master/LICENSE)
+
+## 官网
+* 官网地址:[https://bladex.vip](https://bladex.vip)
+
+## 在线演示
+* Sword演示地址:[https://sword.bladex.vip](https://sword.bladex.vip)
+* Saber演示地址:[https://saber.avue.top](https://saber.avue.top)
+
+## 后端项目地址
+* [BladeX](https://gitee.ltd/blade/BladeX)
+
+## 单工程SpringBoot版
+* [BladeX-Boot](https://gitee.ltd/blade/BladeX-Boot)
+
+## 前端项目地址
+* [Sword--基于React](https://gitee.ltd/blade/Sword)
+* [Saber--基于Vue](https://gitee.ltd/blade/Saber)
+
+## 会员计划及交流群
+* [会员计划及交流群](https://gitee.com/smallc/SpringBlade/wikis/SpringBlade会员计划)
+
+## 技术文档
+* [Blade开发手册](https://www.kancloud.cn/smallchill/blade)
+
+## 工程结构
+``` 
+BladeX
+├── blade-auth -- 授权服务提供
+├── blade-common -- 常用工具封装包
+├── blade-gateway -- Spring Cloud 网关
+├── blade-ops -- 运维中心
+├    ├── blade-admin -- spring-cloud后台管理
+├    ├── blade-develop -- 代码生成
+├── blade-service -- 业务模块
+├    ├── blade-desk -- 工作台模块 
+├    ├── blade-log -- 日志模块 
+├    ├── blade-system -- 系统模块 
+├    └── blade-user -- 用户模块 
+├── blade-service-api -- 业务模块api封装
+├    ├── blade-desk-api -- 工作台api 
+├    ├── blade-dict-api -- 字典api 
+├    ├── blade-system-api -- 系统api 
+└──  └── blade-user-api -- 用户api 
+```
+
+# 界面
+## 监控界面一览
+<table>
+    <tr>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/springblade-k8s1.png"/></td>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/springblade-k8s2.png"/></td>
+    </tr>
+    <tr>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/springblade-grafana.png"/></td>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/springblade-harbor.png"/></td>
+    </tr>
+    <tr>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/springblade-traefik.png"/></td>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/springblade-traefik-health.png"/></td>
+    </tr>
+    <tr>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/springblade-nacos.png"/></td>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/springblade-sentinel.png"/></td>
+    </tr>
+    <tr>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/springblade-admin1.png"/></td>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/springblade-admin2.png"/></td>
+    </tr>
+    <tr>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/springblade-swagger1.png"/></td>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/springblade-swagger2.png"/></td>
+    </tr>
+</table>
+
+## Sword界面一览
+<table>
+    <tr>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/sword-main.png"/></td>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/sword-menu.png"/></td>
+    </tr>
+    <tr>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/sword-menu-edit.png"/></td>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/sword-menu-icon.png"/></td>
+    </tr>
+    <tr>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/sword-role.png"/></td>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/sword-user.png"/></td>
+    </tr>
+    <tr>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/sword-dict.png "/></td>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/sword-log.png"/></td>
+    </tr>
+    <tr>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/sword-locale-cn.png"/></td>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/sword-locale-us.png"/></td>
+    </tr>
+</table>
+
+## Saber界面一览
+<table>
+    <tr>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/saber-user.png"/></td>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/saber-role.png"/></td>
+    </tr>
+    <tr>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/saber-dict.png"/></td>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/saber-dict-select.png"/></td>
+    </tr>
+    <tr>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/saber-log.png"/></td>
+        <td><img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/saber-code.png"/></td>
+    </tr>
+</table>

File diff ditekan karena terlalu besar
+ 432 - 0
doc/sql/mysql/ycwgdb.sql


+ 294 - 0
pom.xml

@@ -0,0 +1,294 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.springblade</groupId>
+    <artifactId>szsq-boot</artifactId>
+    <packaging>jar</packaging>
+    <version>1.0.1.RELEASE</version>
+    <properties>
+        <bladex.version>2.5.0.RELEASE</bladex.version>
+        <java.version>1.8</java.version>
+        <lombok.version>1.18.8</lombok.version>
+        <maven.plugin.version>3.8.1</maven.plugin.version>
+        <spring.boot.version>2.2.4.RELEASE</spring.boot.version>
+        <spring.platform.version>Cairo-SR8</spring.platform.version>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+        <maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
+    </properties>
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-dependencies</artifactId>
+                <version>${spring.boot.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+            <dependency>
+                <groupId>io.spring.platform</groupId>
+                <artifactId>platform-bom</artifactId>
+                <version>${spring.platform.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+    <dependencies>
+        <dependency>
+            <groupId>org.jsoup</groupId>
+            <artifactId>jsoup</artifactId>
+            <version>1.13.1</version>
+        </dependency>
+        <!--依赖-->
+        <dependency>
+            <groupId>org.springblade</groupId>
+            <artifactId>bladex-sms</artifactId>
+            <version>2.5.0.RELEASE</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springblade</groupId>
+            <artifactId>bladex-admin</artifactId>
+            <version>${bladex.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springblade</groupId>
+                    <artifactId>blade-starter-redis</artifactId>
+                </exclusion>
+<!--                <exclusion>-->
+<!--                    <groupId>com.github.xiaoymin</groupId>-->
+<!--                    <artifactId>knife4j-spring-ui</artifactId>-->
+<!--                </exclusion>-->
+<!--                <exclusion>-->
+<!--                    <artifactId>blade-starter-excel</artifactId>-->
+<!--                    <groupId>org.springblade</groupId>-->
+<!--                </exclusion>-->
+            </exclusions>
+        </dependency>
+        <!--这里由于我的springboot版本是2.2.10.RELEASE,所以 springboot admin 也要用2.2.x版-->
+        <dependency>
+            <groupId>de.codecentric</groupId>
+            <artifactId>spring-boot-admin-starter-client</artifactId>
+            <version>2.2.4</version>
+        </dependency>
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger2</artifactId>
+            <version>2.9.2</version>
+        </dependency>
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger-ui</artifactId>
+            <version>2.9.2</version>
+        </dependency>
+        <dependency>
+            <groupId>io.github.swagger2markup</groupId>
+            <artifactId>swagger2markup</artifactId>
+            <version>1.3.3</version>
+        </dependency>
+        <!--spring security-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-security</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springblade</groupId>
+            <artifactId>blade-core-test</artifactId>
+            <version>${bladex.version}</version>
+            <!-- <scope>test</scope> -->
+        </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
+        <!--rabbitmq-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-amqp</artifactId>
+            <version>${spring.boot.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.googlecode.cqengine</groupId>
+            <artifactId>cqengine</artifactId>
+            <version>3.5.0</version>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>1.2.68</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi</artifactId>
+            <version>3.17</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi-ooxml</artifactId>
+            <version>3.17</version>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>easyexcel</artifactId>
+            <version>1.1.2-beta5</version>
+        </dependency>
+
+        <!--依赖-->
+        <dependency>
+            <groupId>net.sf.json-lib</groupId>
+            <artifactId>json-lib</artifactId>
+            <version>0.9</version>
+        </dependency>
+        <!--依赖-->
+        <dependency>
+            <groupId>org.springblade</groupId>
+            <artifactId>blade-starter-excel</artifactId>
+            <version>2.5.0.RELEASE</version>
+        </dependency>
+
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>5.6.5</version>
+        </dependency>
+
+
+        <dependency>
+            <groupId>com.ctg.ag</groupId>
+            <artifactId>ag-sdk-biz-48734.tar.gz</artifactId>
+            <version>20210528.182447-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.eclipse.paho</groupId>
+            <artifactId>org.eclipse.paho.client.mqttv3</artifactId>
+            <version>1.2.1</version>
+        </dependency>
+        <dependency>
+            <groupId>me.zhyd.oauth</groupId>
+            <artifactId>JustAuth</artifactId>
+            <version>1.16.5</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-configuration-processor</artifactId>
+        </dependency>
+
+
+    </dependencies>
+    <build>
+    <finalName>szsq-boot</finalName>
+    <resources>
+        <resource>
+            <directory>src/main/resources</directory>
+        </resource>
+        <resource>
+            <directory>src/main/java</directory>
+            <includes>
+                <include>**/*.xml</include>
+            </includes>
+        </resource>
+    </resources>
+    <pluginManagement>
+        <plugins>
+            <plugin>
+                <groupId>org.asciidoctor</groupId>
+                <artifactId>asciidoctor-maven-plugin</artifactId>
+                <version>1.5.6</version>
+                <configuration>
+                    <sourceDirectory>src/docs/asciidoc/generated</sourceDirectory>
+                    <outputDirectory>src/docs/asciidoc/html</outputDirectory>
+                    <backend>html</backend>
+                    <sourceHighlighter>coderay</sourceHighlighter>
+                    <attributes>
+                        <toc>left</toc>
+                    </attributes>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <version>${spring.boot.version}</version>
+                <configuration>
+                    <finalName>${project.build.finalName}</finalName>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>com.spotify</groupId>
+                <artifactId>docker-maven-plugin</artifactId>
+                <version>${docker.plugin.version}</version>
+                <configuration>
+                    <imageName>${docker.registry.url}/blade/${project.artifactId}:${project.version}</imageName>
+                    <dockerDirectory>${project.basedir}</dockerDirectory>
+                    <dockerHost>${docker.registry.host}</dockerHost>
+                    <resources>
+                        <resource>
+                            <targetPath>/</targetPath>
+                            <directory>${project.build.directory}</directory>
+                            <include>${project.build.finalName}.jar</include>
+                        </resource>
+                    </resources>
+                    <registryUrl>${docker.registry.url}</registryUrl>
+                    <serverId>${docker.registry.url}</serverId>
+                    <pushImage>true</pushImage>
+                </configuration>
+            </plugin>
+        </plugins>
+    </pluginManagement>
+    <plugins>
+        <plugin>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-maven-plugin</artifactId>
+        </plugin>
+        <plugin>
+            <artifactId>maven-compiler-plugin</artifactId>
+            <version>${maven.plugin.version}</version>
+            <configuration>
+                <source>${java.version}</source>
+                <target>${java.version}</target>
+                <encoding>UTF-8</encoding>
+                <compilerArgs>
+                    <arg>-parameters</arg>
+                </compilerArgs>
+            </configuration>
+        </plugin>
+    </plugins>
+</build>
+    <repositories>
+        <repository>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>
+            <id>jcenter-releases</id>
+            <name>jcenter</name>
+            <url>http://jcenter.bintray.com</url>
+        </repository>
+        <repository>
+            <id>local</id>
+            <name>local Repository</name>
+            <url>http://800pharm.7766.org:9081/repository/maven-public/</url>
+            <layout>default</layout>
+        </repository>
+    </repositories>
+    <distributionManagement>
+        <repository>
+            <id>nexus-releases</id>
+            <name>ReleasesProxy</name>
+            <url>http://800pharm.7766.org:9081/repository/maven-releases/</url>
+        </repository>
+        <snapshotRepository>
+            <id>nexus-snapshots</id>
+            <url>http://800pharm.7766.org:9081/repository/maven-snapshots/</url>
+        </snapshotRepository>
+    </distributionManagement>
+</project>

+ 46 - 0
src/main/java/org/springblade/ApplicationWeb.java

@@ -0,0 +1,46 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade;
+
+import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
+import org.springblade.common.constant.CommonConstant;
+import org.springblade.core.launch.BladeApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.scheduling.annotation.EnableScheduling;
+
+import com.alicp.jetcache.anno.config.EnableCreateCacheAnnotation;
+import com.alicp.jetcache.anno.config.EnableMethodCache;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
+
+
+/**
+ * 启动器
+ *
+ * @author Chill
+ */
+@EnableScheduling
+@SpringBootApplication
+@EnableMethodCache(basePackages="org.springblade.modules.service")
+@EnableCreateCacheAnnotation
+@EnableSwagger2
+@EnableKnife4j
+public class ApplicationWeb {
+	public static void main(String[] args) throws IllegalAccessException {
+		BladeApplication.run(CommonConstant.APPLICATION_NAME, ApplicationWeb.class, args);
+	}
+}
+

+ 28 - 0
src/main/java/org/springblade/MyApplicationRunner.java

@@ -0,0 +1,28 @@
+package org.springblade;
+
+import org.springblade.mqtt.MqttRecieveCallback;
+import org.springblade.mqtt.MyMqttClient;
+import org.springblade.mqtt.TendaConfig;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.ApplicationArguments;
+import org.springframework.boot.ApplicationRunner;
+import org.springframework.core.annotation.Order;
+import org.springframework.stereotype.Component;
+
+@Component
+@Order(value = 1)
+public class MyApplicationRunner implements ApplicationRunner {
+
+	@Autowired
+	private MyMqttClient myMqttClient;
+	@Autowired
+	private MqttRecieveCallback mqttReceriveCallback;
+	@Autowired
+	private TendaConfig tendaConfig;
+
+	@Override
+	public void run(ApplicationArguments args) throws Exception {
+		myMqttClient.init(tendaConfig, mqttReceriveCallback);
+		myMqttClient.subTopic(tendaConfig.getTopic());
+	}
+}

+ 59 - 0
src/main/java/org/springblade/alarm/alarmgroup/controller/AAAController.java

@@ -0,0 +1,59 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.alarm.alarmgroup.controller;
+
+import cn.hutool.core.lang.Assert;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.AllArgsConstructor;
+import org.springblade.alarm.alarmgroup.entity.AlarmGroup;
+import org.springblade.alarm.alarmgroup.service.IAlarmGroupService;
+import org.springblade.alarm.alarmgroup.vo.AlarmGroupVO;
+import org.springblade.community.residential.entity.Residential;
+import org.springblade.community.residential.service.IResidentialService;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.secure.BladeUser;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.system.orgposition.service.IOrgPositionService;
+import org.springblade.utils.QueryWrapperUtil;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * 告警处理组 控制器
+ *
+ * @author BladeX
+ * @since 2020-11-29
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("v2/api-docs")
+@Api(value = "告警处理组", tags = "告警处理组接口")
+public class AAAController extends BladeController {
+
+
+}

+ 163 - 0
src/main/java/org/springblade/alarm/alarmgroup/controller/AlarmGroupController.java

@@ -0,0 +1,163 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.alarm.alarmgroup.controller;
+
+import cn.hutool.core.lang.Assert;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.AllArgsConstructor;
+import org.springblade.alarm.alarmgroup.entity.AlarmGroup;
+import org.springblade.alarm.alarmgroup.service.IAlarmGroupService;
+import org.springblade.alarm.alarmgroup.vo.AlarmGroupVO;
+import org.springblade.community.residential.entity.Residential;
+import org.springblade.community.residential.service.IResidentialService;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.secure.BladeUser;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.homecare.alarmlist.entity.Alarm;
+import org.springblade.system.orgposition.service.IOrgPositionService;
+import org.springblade.utils.QueryWrapperUtil;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * 告警处理组 控制器
+ *
+ * @author BladeX
+ * @since 2020-11-29
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("alarm/alarmgroup")
+@Api(value = "告警处理组", tags = "告警处理组接口")
+public class AlarmGroupController extends BladeController {
+
+	private IAlarmGroupService alarmGroupService;
+	private IResidentialService residentialService;
+	private IOrgPositionService orgPositionService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入alarmGroup")
+	public R<AlarmGroup> detail(AlarmGroup alarmGroup) {
+		AlarmGroup detail = alarmGroupService.getOne(Condition.getQueryWrapper(alarmGroup));
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页 告警处理组
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入alarmGroup")
+	public R<IPage<AlarmGroup>> list(AlarmGroup alarmGroup, Query query, BladeUser bladeUser) {
+		LambdaQueryWrapper<AlarmGroup> wrapper = new QueryWrapperUtil<AlarmGroup>().getBasicQueryWrapper(AlarmGroup::getOrgPosition, alarmGroup, bladeUser, orgPositionService);
+		IPage<AlarmGroup> pages = alarmGroupService.page(Condition.getPage(query), wrapper);
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页 告警处理组
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入alarmGroup")
+	public R<IPage<AlarmGroupVO>> page(AlarmGroupVO alarmGroup, Query query) {
+		IPage<AlarmGroupVO> pages = alarmGroupService.selectAlarmGroupPage(Condition.getPage(query), alarmGroup);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 告警处理组
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入alarmGroup")
+	public R save(@Valid @RequestBody AlarmGroup alarmGroup) {
+
+		return R.status(alarmGroupService.save(alarmGroup));
+	}
+
+	/**
+	 * 修改 告警处理组
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入alarmGroup")
+	public R update(@Valid @RequestBody AlarmGroup alarmGroup) {
+		return R.status(alarmGroupService.updateById(alarmGroup));
+	}
+
+	/**
+	 * 新增或修改 告警处理组
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入alarmGroup")
+	public R submit(@Valid @RequestBody AlarmGroup alarmGroup) {
+		Residential residential = residentialService.getById(alarmGroup.getResidentialId());
+		Assert.notNull(residential, "选择的归属不存在!");
+		alarmGroup.setResidentialName(residential.getName());
+		if (alarmGroup.getId() == null){
+			alarmGroupService.saveOrUpdate(alarmGroup);
+		}
+		alarmGroup.setOrgPosition(residential.getOrgPosition() +"/"+alarmGroup.getId());
+		return R.status(alarmGroupService.saveOrUpdate(alarmGroup));
+	}
+
+
+	/**
+	 * 删除 告警处理组
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "逻辑删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+//		return R.status(alarmGroupService.deleteLogic(Func.toLongList(ids)));
+		return R.status(alarmGroupService.removeGroup(Func.toLongList(ids)));
+	}
+
+
+	/**
+	 * setOrgPosition
+	 */
+	@PostMapping("/setOrgPosition")
+	public R setOrgPosition() {
+		List<AlarmGroup> alarmGroups = alarmGroupService.getBaseMapper().selectList(new QueryWrapper<>(new AlarmGroup()));
+		for (int i=0;i<alarmGroups.size();i++){
+			AlarmGroup alarmGroup = alarmGroups.get(i);
+			Residential residential = residentialService.getById(alarmGroup.getResidentialId());
+			alarmGroup.setOrgPosition(residential.getOrgPosition()+"/"+alarmGroup.getId());
+			alarmGroupService.updateById(alarmGroup);
+		}
+
+		return R.success("success");
+	}
+}

+ 34 - 0
src/main/java/org/springblade/alarm/alarmgroup/dto/AlarmGroupDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.alarm.alarmgroup.dto;
+
+import org.springblade.alarm.alarmgroup.entity.AlarmGroup;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 告警处理组数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2020-11-29
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class AlarmGroupDTO extends AlarmGroup {
+	private static final long serialVersionUID = 1L;
+
+}

+ 68 - 0
src/main/java/org/springblade/alarm/alarmgroup/entity/AlarmGroup.java

@@ -0,0 +1,68 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.alarm.alarmgroup.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.tenant.mp.TenantEntity;
+
+/**
+ * 告警处理组实体类
+ *
+ * @author BladeX
+ * @since 2020-11-29
+ */
+@Data
+@TableName("yc_alarm_group")
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "AlarmGroup对象", description = "告警处理组")
+public class AlarmGroup extends TenantEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	* 组名
+	*/
+		@ApiModelProperty(value = "组名")
+		private String name;
+	/**
+	* 小区
+	*/
+		@ApiModelProperty(value = "小区")
+		private Long residentialId;
+	/**
+	* 小区
+	*/
+		@ApiModelProperty(value = "小区")
+		private String residentialName;
+	/**
+	* 标识
+	*/
+		@ApiModelProperty(value = "标识")
+		private Integer tag;
+
+	/**
+	* 机构路径
+	*/
+		@ApiModelProperty(value = "机构路径")
+		private String orgPosition;
+
+
+}

+ 42 - 0
src/main/java/org/springblade/alarm/alarmgroup/mapper/AlarmGroupMapper.java

@@ -0,0 +1,42 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.alarm.alarmgroup.mapper;
+
+import org.springblade.alarm.alarmgroup.entity.AlarmGroup;
+import org.springblade.alarm.alarmgroup.vo.AlarmGroupVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * 告警处理组 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2020-11-29
+ */
+public interface AlarmGroupMapper extends BaseMapper<AlarmGroup> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param alarmGroup
+	 * @return
+	 */
+	List<AlarmGroupVO> selectAlarmGroupPage(IPage page, AlarmGroupVO alarmGroup);
+
+}

+ 29 - 0
src/main/java/org/springblade/alarm/alarmgroup/mapper/AlarmGroupMapper.xml

@@ -0,0 +1,29 @@
+<?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="org.springblade.alarm.alarmgroup.mapper.AlarmGroupMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="alarmGroupResultMap" type="org.springblade.alarm.alarmgroup.entity.AlarmGroup">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="name" property="name"/>
+        <result column="name" property="name"/>
+        <result column="tag" property="tag"/>
+        <result column="residential_id" property="residentialId"/>
+        <result column="residential_name" property="residentialName"/>
+        <result column="org_position" property="orgPosition"/>
+        <result column="tenant_id" property="tenantId"/>
+    </resultMap>
+
+
+    <select id="selectAlarmGroupPage" resultMap="alarmGroupResultMap">
+        select * from yc_alarm_group where is_deleted = 0
+    </select>
+
+</mapper>

+ 44 - 0
src/main/java/org/springblade/alarm/alarmgroup/service/IAlarmGroupService.java

@@ -0,0 +1,44 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.alarm.alarmgroup.service;
+
+import org.springblade.alarm.alarmgroup.entity.AlarmGroup;
+import org.springblade.alarm.alarmgroup.vo.AlarmGroupVO;
+import org.springblade.core.mp.base.BaseService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.util.List;
+
+/**
+ * 告警处理组 服务类
+ *
+ * @author BladeX
+ * @since 2020-11-29
+ */
+public interface IAlarmGroupService extends BaseService<AlarmGroup> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param alarmGroup
+	 * @return
+	 */
+	IPage<AlarmGroupVO> selectAlarmGroupPage(IPage<AlarmGroupVO> page, AlarmGroupVO alarmGroup);
+
+    boolean removeGroup(List<Long> ids);
+}

+ 61 - 0
src/main/java/org/springblade/alarm/alarmgroup/service/impl/AlarmGroupServiceImpl.java

@@ -0,0 +1,61 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.alarm.alarmgroup.service.impl;
+
+import lombok.AllArgsConstructor;
+import org.springblade.alarm.alarmgroup.entity.AlarmGroup;
+import org.springblade.alarm.alarmgroup.vo.AlarmGroupVO;
+import org.springblade.alarm.alarmgroup.mapper.AlarmGroupMapper;
+import org.springblade.alarm.alarmgroup.service.IAlarmGroupService;
+import org.springblade.alarm.alarmgroupuser.entity.AlarmGroupUser;
+import org.springblade.alarm.alarmgroupuser.service.IAlarmGroupUserService;
+import org.springblade.core.log.exception.ServiceException;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.util.List;
+
+/**
+ * 告警处理组 服务实现类
+ *
+ * @author BladeX
+ * @since 2020-11-29
+ */
+@Service
+@AllArgsConstructor
+public class AlarmGroupServiceImpl extends BaseServiceImpl<AlarmGroupMapper, AlarmGroup> implements IAlarmGroupService {
+
+	private IAlarmGroupUserService alarmGroupUserService;
+
+	@Override
+	public IPage<AlarmGroupVO> selectAlarmGroupPage(IPage<AlarmGroupVO> page, AlarmGroupVO alarmGroup) {
+		return page.setRecords(baseMapper.selectAlarmGroupPage(page, alarmGroup));
+	}
+
+	@Override
+	public boolean removeGroup(List<Long> ids) {
+		List<AlarmGroupUser> list = alarmGroupUserService.getByGroupIds(ids);
+		if (list.size() > 0){
+			throw new ServiceException("请先删除子节点!");
+		}else{
+			return this.deleteLogic(ids);
+		}
+	}
+
+}

+ 36 - 0
src/main/java/org/springblade/alarm/alarmgroup/vo/AlarmGroupVO.java

@@ -0,0 +1,36 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.alarm.alarmgroup.vo;
+
+import org.springblade.alarm.alarmgroup.entity.AlarmGroup;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 告警处理组视图实体类
+ *
+ * @author BladeX
+ * @since 2020-11-29
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "AlarmGroupVO对象", description = "告警处理组")
+public class AlarmGroupVO extends AlarmGroup {
+	private static final long serialVersionUID = 1L;
+
+}

+ 126 - 0
src/main/java/org/springblade/alarm/alarmgroupuser/controller/AlarmGroupUserController.java

@@ -0,0 +1,126 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.alarm.alarmgroupuser.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.AllArgsConstructor;
+import org.springblade.alarm.alarmgroupuser.entity.AlarmGroupUser;
+import org.springblade.alarm.alarmgroupuser.service.IAlarmGroupUserService;
+import org.springblade.alarm.alarmgroupuser.vo.AlarmGroupUserVO;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+
+/**
+ * 告警分组和用户关联表 控制器
+ *
+ * @author BladeX
+ * @since 2020-11-29
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("alarm/alarmgroupuser")
+@Api(value = "告警分组和用户关联表", tags = "告警分组和用户关联表接口")
+public class AlarmGroupUserController extends BladeController {
+
+	private IAlarmGroupUserService alarmGroupUserService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入alarmGroupUser")
+	public R<AlarmGroupUser> detail(AlarmGroupUser alarmGroupUser) {
+		AlarmGroupUser detail = alarmGroupUserService.getOne(Condition.getQueryWrapper(alarmGroupUser));
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页 告警分组和用户关联表
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入alarmGroupUser")
+	public R<IPage<AlarmGroupUser>> list(AlarmGroupUser alarmGroupUser, Query query) {
+		IPage<AlarmGroupUser> pages = alarmGroupUserService.page(Condition.getPage(query), Condition.getQueryWrapper(alarmGroupUser));
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页 告警分组和用户关联表
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入alarmGroupUser")
+	public R<IPage<AlarmGroupUserVO>> page(AlarmGroupUserVO alarmGroupUser, Query query) {
+		IPage<AlarmGroupUserVO> pages = alarmGroupUserService.selectAlarmGroupUserPage(Condition.getPage(query), alarmGroupUser);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 告警分组和用户关联表
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入alarmGroupUser")
+	public R save(@Valid @RequestBody AlarmGroupUser alarmGroupUser) {
+		return R.status(alarmGroupUserService.save(alarmGroupUser));
+	}
+
+	/**
+	 * 修改 告警分组和用户关联表
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入alarmGroupUser")
+	public R update(@Valid @RequestBody AlarmGroupUser alarmGroupUser) {
+		return R.status(alarmGroupUserService.updateById(alarmGroupUser));
+	}
+
+	/**
+	 * 新增或修改 告警分组和用户关联表
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入alarmGroupUser")
+	public R submit(@Valid @RequestBody AlarmGroupUser alarmGroupUser) {
+		return R.status(alarmGroupUserService.saveOrUpdate(alarmGroupUser));
+	}
+
+
+	/**
+	 * 删除 告警分组和用户关联表
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "逻辑删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(alarmGroupUserService.deleteLogic(Func.toLongList(ids)));
+	}
+
+
+}

+ 34 - 0
src/main/java/org/springblade/alarm/alarmgroupuser/dto/AlarmGroupUserDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.alarm.alarmgroupuser.dto;
+
+import org.springblade.alarm.alarmgroupuser.entity.AlarmGroupUser;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 告警分组和用户关联表数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2020-11-29
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class AlarmGroupUserDTO extends AlarmGroupUser {
+	private static final long serialVersionUID = 1L;
+
+}

+ 69 - 0
src/main/java/org/springblade/alarm/alarmgroupuser/entity/AlarmGroupUser.java

@@ -0,0 +1,69 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.alarm.alarmgroupuser.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import org.springblade.core.mp.base.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 告警分组和用户关联表实体类
+ *
+ * @author BladeX
+ * @since 2020-11-29
+ */
+@Data
+@TableName("yc_alarm_group_user")
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "AlarmGroupUser对象", description = "告警分组和用户关联表")
+public class AlarmGroupUser extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	* 组id
+	*/
+		@ApiModelProperty(value = "组id")
+		private Long groupId;
+	/**
+	* 责任人
+	*/
+		@ApiModelProperty(value = "责任人")
+		private String person;
+	/**
+	* 责任人手机号
+	*/
+		@ApiModelProperty(value = "责任人手机号")
+		private String phone;
+
+	/**
+	* 是否为处理人
+	*/
+		@ApiModelProperty(value = "是否为处理人")
+		private Integer isHandler;
+
+	/**
+	 * 租户id
+	 */
+	@ApiModelProperty(value = "租户id")
+	private String tenantId;
+
+
+}

+ 43 - 0
src/main/java/org/springblade/alarm/alarmgroupuser/mapper/AlarmGroupUserMapper.java

@@ -0,0 +1,43 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.alarm.alarmgroupuser.mapper;
+
+import org.springblade.alarm.alarmgroupuser.entity.AlarmGroupUser;
+import org.springblade.alarm.alarmgroupuser.vo.AlarmGroupUserVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * 告警分组和用户关联表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2020-11-29
+ */
+public interface AlarmGroupUserMapper extends BaseMapper<AlarmGroupUser> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param alarmGroupUser
+	 * @return
+	 */
+	List<AlarmGroupUserVO> selectAlarmGroupUserPage(IPage page, AlarmGroupUserVO alarmGroupUser);
+
+    List<AlarmGroupUser> getByGroupIds(List<Long> ids);
+}

+ 37 - 0
src/main/java/org/springblade/alarm/alarmgroupuser/mapper/AlarmGroupUserMapper.xml

@@ -0,0 +1,37 @@
+<?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="org.springblade.alarm.alarmgroupuser.mapper.AlarmGroupUserMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="alarmGroupUserResultMap" type="org.springblade.alarm.alarmgroupuser.entity.AlarmGroupUser">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="group_id" property="groupId"/>
+        <result column="person" property="person"/>
+        <result column="phone" property="phone"/>
+        <result column="is_handler" property="isHandler"/>
+        <result column="tenant_id" property="tenantId"/>
+    </resultMap>
+
+
+    <select id="selectAlarmGroupUserPage" resultMap="alarmGroupUserResultMap">
+        select * from yc_alarm_group_user where is_deleted = 0
+    </select>
+
+    <select id="getByGroupIds" resultMap="alarmGroupUserResultMap" parameterType="list">
+        select * from yc_alarm_group_user where is_deleted = 0
+        <if test="list != null">
+            and group_id in
+            <foreach item="id" collection="list" separator="," open="(" close=")" index="">
+                #{id}
+            </foreach>
+        </if>
+    </select>
+
+</mapper>

+ 44 - 0
src/main/java/org/springblade/alarm/alarmgroupuser/service/IAlarmGroupUserService.java

@@ -0,0 +1,44 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.alarm.alarmgroupuser.service;
+
+import org.springblade.alarm.alarmgroupuser.entity.AlarmGroupUser;
+import org.springblade.alarm.alarmgroupuser.vo.AlarmGroupUserVO;
+import org.springblade.core.mp.base.BaseService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.util.List;
+
+/**
+ * 告警分组和用户关联表 服务类
+ *
+ * @author BladeX
+ * @since 2020-11-29
+ */
+public interface IAlarmGroupUserService extends BaseService<AlarmGroupUser> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param alarmGroupUser
+	 * @return
+	 */
+	IPage<AlarmGroupUserVO> selectAlarmGroupUserPage(IPage<AlarmGroupUserVO> page, AlarmGroupUserVO alarmGroupUser);
+
+    List<AlarmGroupUser> getByGroupIds(List<Long> list);
+}

+ 48 - 0
src/main/java/org/springblade/alarm/alarmgroupuser/service/impl/AlarmGroupUserServiceImpl.java

@@ -0,0 +1,48 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.alarm.alarmgroupuser.service.impl;
+
+import org.springblade.alarm.alarmgroupuser.entity.AlarmGroupUser;
+import org.springblade.alarm.alarmgroupuser.vo.AlarmGroupUserVO;
+import org.springblade.alarm.alarmgroupuser.mapper.AlarmGroupUserMapper;
+import org.springblade.alarm.alarmgroupuser.service.IAlarmGroupUserService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.util.List;
+
+/**
+ * 告警分组和用户关联表 服务实现类
+ *
+ * @author BladeX
+ * @since 2020-11-29
+ */
+@Service
+public class AlarmGroupUserServiceImpl extends BaseServiceImpl<AlarmGroupUserMapper, AlarmGroupUser> implements IAlarmGroupUserService {
+
+	@Override
+	public IPage<AlarmGroupUserVO> selectAlarmGroupUserPage(IPage<AlarmGroupUserVO> page, AlarmGroupUserVO alarmGroupUser) {
+		return page.setRecords(baseMapper.selectAlarmGroupUserPage(page, alarmGroupUser));
+	}
+
+	@Override
+	public List<AlarmGroupUser> getByGroupIds(List<Long> list) {
+		return baseMapper.getByGroupIds(list);
+	}
+
+}

+ 36 - 0
src/main/java/org/springblade/alarm/alarmgroupuser/vo/AlarmGroupUserVO.java

@@ -0,0 +1,36 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.alarm.alarmgroupuser.vo;
+
+import org.springblade.alarm.alarmgroupuser.entity.AlarmGroupUser;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 告警分组和用户关联表视图实体类
+ *
+ * @author BladeX
+ * @since 2020-11-29
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "AlarmGroupUserVO对象", description = "告警分组和用户关联表")
+public class AlarmGroupUserVO extends AlarmGroupUser {
+	private static final long serialVersionUID = 1L;
+
+}

+ 161 - 0
src/main/java/org/springblade/attence/location/controller/LocationController.java

@@ -0,0 +1,161 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.location.controller;
+
+import cn.hutool.http.HttpUtil;
+import cn.hutool.json.JSONObject;
+import cn.hutool.json.JSONUtil;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.attence.rule.dto.QueryDataDTO;
+import org.springblade.attence.ruleperson.entity.RulePerson;
+import org.springblade.attence.ruleperson.vo.RulePersonVO;
+import org.springblade.attence.ruleperson.wrapper.RulePersonWrapper;
+import org.springblade.common.Constants;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.RequestParam;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.attence.location.entity.Location;
+import org.springblade.attence.location.vo.LocationVO;
+import org.springblade.attence.location.wrapper.LocationWrapper;
+import org.springblade.attence.location.service.ILocationService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+import java.util.List;
+
+/**
+ *  控制器
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("attence/location")
+@Api(value = "打卡地点接口", tags = "打卡地点接口")
+public class LocationController extends BladeController {
+
+	private ILocationService locationService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入location")
+	public R<LocationVO> detail(Location location) {
+		Location detail = locationService.getOne(Condition.getQueryWrapper(location));
+		return R.data(LocationWrapper.build().entityVO(detail));
+	}
+
+	/**
+	 * 分页
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入location")
+	public R<IPage<LocationVO>> list(Location location, Query query) {
+		IPage<Location> pages = locationService.page(Condition.getPage(query), Condition.getQueryWrapper(location));
+		return R.data(LocationWrapper.build().pageVO(pages));
+	}
+
+
+	/**
+	 * 自定义分页
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入location")
+	public R<IPage<LocationVO>> page(LocationVO location, Query query) {
+		IPage<LocationVO> pages = locationService.selectLocationPage(Condition.getPage(query), location);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入location")
+	public R save(@Valid @RequestBody Location location) {
+		return R.status(locationService.save(location));
+	}
+
+	/**
+	 * 修改
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入location")
+	public R update(@Valid @RequestBody Location location) {
+		return R.status(locationService.updateById(location));
+	}
+
+	/**
+	 * 新增或修改
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入location")
+	public R submit(@Valid @RequestBody Location location) {
+		return R.status(locationService.saveOrUpdate(location));
+	}
+
+
+	/**
+	 * 删除
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "逻辑删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(locationService.deleteLogic(Func.toLongList(ids)));
+	}
+
+	/**
+	 * 查询全部
+	 */
+	@GetMapping("/listAll")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "查询全部", notes = "传入location")
+	public R<List<LocationVO>> list(Location location) {
+		List<Location> list = locationService.list(Condition.getQueryWrapper(location));
+		return R.data(LocationWrapper.build().listVO(list));
+	}
+
+	/**
+	 *
+	 */
+	@GetMapping("/getLocation")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "", notes = "传入rule")
+	public R getLocationData(QueryDataDTO queryDataDTO) {
+		String request_url = Constants.MAP_URL +queryDataDTO.getLatitude()+","+queryDataDTO.getLongitude() + "&key=" + Constants.MAP_KEY;
+		String s = HttpUtil.get(request_url);
+		JSONObject jsonObject = JSONUtil.parseObj(s);
+		return R.data(jsonObject);
+	}
+}

+ 34 - 0
src/main/java/org/springblade/attence/location/dto/LocationDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.location.dto;
+
+import org.springblade.attence.location.entity.Location;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class LocationDTO extends Location {
+	private static final long serialVersionUID = 1L;
+
+}

+ 68 - 0
src/main/java/org/springblade/attence/location/entity/Location.java

@@ -0,0 +1,68 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.location.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import org.springblade.core.mp.base.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 实体类
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+@Data
+@TableName("attence_location")
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "Location对象", description = "Location对象")
+public class Location extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	* 地点名称
+	*/
+		@ApiModelProperty(value = "地点名称")
+		private String name;
+	/**
+	* 地图标记点
+	*/
+		@ApiModelProperty(value = "地图标记点")
+		private String address;
+	/**
+	* 打卡范围
+	*/
+		@ApiModelProperty(value = "打卡范围")
+		private Integer area;
+	/**
+	* 纬度
+	*/
+		@ApiModelProperty(value = "纬度")
+		private String latitude;
+	/**
+	* 经度
+	*/
+		@ApiModelProperty(value = "经度")
+		private String longitude;
+
+		@ApiModelProperty(value = "规则id")
+		private Long ruleId;
+}

+ 42 - 0
src/main/java/org/springblade/attence/location/mapper/LocationMapper.java

@@ -0,0 +1,42 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.location.mapper;
+
+import org.springblade.attence.location.entity.Location;
+import org.springblade.attence.location.vo.LocationVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ *  Mapper 接口
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+public interface LocationMapper extends BaseMapper<Location> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param location
+	 * @return
+	 */
+	List<LocationVO> selectLocationPage(IPage page, LocationVO location);
+
+}

+ 28 - 0
src/main/java/org/springblade/attence/location/mapper/LocationMapper.xml

@@ -0,0 +1,28 @@
+<?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="org.springblade.attence.location.mapper.LocationMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="locationResultMap" type="org.springblade.attence.location.entity.Location">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="name" property="name"/>
+        <result column="latitude" property="latitude"/>
+        <result column="longitude" property="longitude"/>
+        <result column="area" property="area"/>
+        <result column="address" property="address"/>
+        <result column="rule_id" property="ruleId"/>
+    </resultMap>
+
+
+    <select id="selectLocationPage" resultMap="locationResultMap">
+        select * from attence_location where is_deleted = 0
+    </select>
+
+</mapper>

+ 41 - 0
src/main/java/org/springblade/attence/location/service/ILocationService.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.location.service;
+
+import org.springblade.attence.location.entity.Location;
+import org.springblade.attence.location.vo.LocationVO;
+import org.springblade.core.mp.base.BaseService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ *  服务类
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+public interface ILocationService extends BaseService<Location> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param location
+	 * @return
+	 */
+	IPage<LocationVO> selectLocationPage(IPage<LocationVO> page, LocationVO location);
+
+}

+ 41 - 0
src/main/java/org/springblade/attence/location/service/impl/LocationServiceImpl.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.location.service.impl;
+
+import org.springblade.attence.location.entity.Location;
+import org.springblade.attence.location.vo.LocationVO;
+import org.springblade.attence.location.mapper.LocationMapper;
+import org.springblade.attence.location.service.ILocationService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ *  服务实现类
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+@Service
+public class LocationServiceImpl extends BaseServiceImpl<LocationMapper, Location> implements ILocationService {
+
+	@Override
+	public IPage<LocationVO> selectLocationPage(IPage<LocationVO> page, LocationVO location) {
+		return page.setRecords(baseMapper.selectLocationPage(page, location));
+	}
+
+}

+ 36 - 0
src/main/java/org/springblade/attence/location/vo/LocationVO.java

@@ -0,0 +1,36 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.location.vo;
+
+import org.springblade.attence.location.entity.Location;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 视图实体类
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "LocationVO对象", description = "LocationVO对象")
+public class LocationVO extends Location {
+	private static final long serialVersionUID = 1L;
+
+}

+ 49 - 0
src/main/java/org/springblade/attence/location/wrapper/LocationWrapper.java

@@ -0,0 +1,49 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.location.wrapper;
+
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.attence.location.entity.Location;
+import org.springblade.attence.location.vo.LocationVO;
+import java.util.Objects;
+
+/**
+ * 包装类,返回视图层所需的字段
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+public class LocationWrapper extends BaseEntityWrapper<Location, LocationVO>  {
+
+	public static LocationWrapper build() {
+		return new LocationWrapper();
+ 	}
+
+	@Override
+	public LocationVO entityVO(Location location) {
+		LocationVO locationVO = Objects.requireNonNull(BeanUtil.copy(location, LocationVO.class));
+
+		//User createUser = UserCache.getUser(location.getCreateUser());
+		//User updateUser = UserCache.getUser(location.getUpdateUser());
+		//locationVO.setCreateUserName(createUser.getName());
+		//locationVO.setUpdateUserName(updateUser.getName());
+
+		return locationVO;
+	}
+
+}

+ 314 - 0
src/main/java/org/springblade/attence/record/controller/RecordController.java

@@ -0,0 +1,314 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.record.controller;
+
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.StrUtil;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.AllArgsConstructor;
+
+import javax.validation.Valid;
+
+import org.checkerframework.checker.units.qual.A;
+import org.springblade.attence.record.dto.QueryMarkDaysDTO;
+import org.springblade.attence.record.vo.MarkDayVo;
+import org.springblade.attence.record.vo.MyStatisticalVo;
+import org.springblade.attence.record.vo.RecordAppVO;
+import org.springblade.attence.rule.entity.Rule;
+import org.springblade.attence.rule.service.IRuleService;
+import org.springblade.attence.ruleperson.entity.RulePerson;
+import org.springblade.attence.ruleperson.service.IRulePersonService;
+import org.springblade.attence.rulespectime.entity.RuleSpecTime;
+import org.springblade.attence.rulespectime.service.IRuleSpecTimeService;
+import org.springblade.attence.ruletime.entity.RuleTime;
+import org.springblade.attence.ruletime.service.IRuleTimeService;
+import org.springblade.community.accessrecord.entity.AccessRecord;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.util.Assert;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.RequestParam;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.attence.record.entity.Record;
+import org.springblade.attence.record.vo.RecordVO;
+import org.springblade.attence.record.wrapper.RecordWrapper;
+import org.springblade.attence.record.service.IRecordService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.ZoneId;
+import java.time.format.DateTimeFormatter;
+import java.time.temporal.ChronoUnit;
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * 控制器
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("attence/record")
+@Api(value = "打卡记录接口", tags = "打卡记录接口")
+public class RecordController extends BladeController {
+
+	private IRecordService recordService;
+	private IRuleService ruleService;
+	private IRulePersonService rulePersonService;
+	private IRuleTimeService ruleTimeService;
+	private IRuleSpecTimeService ruleSpecTimeService;
+
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入record")
+	public R<RecordVO> detail(Record record) {
+		Record detail = recordService.getOne(Condition.getQueryWrapper(record));
+		return R.data(RecordWrapper.build().entityVO(detail));
+	}
+
+	/**
+	 * 分页
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入record")
+	public R<IPage<RecordVO>> list(Record record, Query query) {
+		IPage<Record> pages = recordService.page(Condition.getPage(query), Condition.getQueryWrapper(record));
+		return R.data(RecordWrapper.build().pageVO(pages));
+	}
+
+
+	/**
+	 * 自定义分页
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入record")
+	public R<IPage<RecordVO>> page(RecordVO record, Query query) {
+		IPage<RecordVO> pages = recordService.selectRecordPage(Condition.getPage(query), record);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入record")
+	public R save(@Valid @RequestBody Record record) {
+		record.setCheckinDate(record.getCheckinTime().toLocalDate());
+		return R.status(recordService.save(record));
+	}
+
+	/**
+	 * 修改
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入record")
+	public R update(@Valid @RequestBody Record record) {
+		return R.status(recordService.updateById(record));
+	}
+
+	/**
+	 * 新增或修改
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入record")
+	public R submit(@Valid @RequestBody Record record) {
+		record.setCheckinDate(record.getCheckinTime().toLocalDate());
+		return R.status(recordService.saveOrUpdate(record));
+	}
+
+
+	/**
+	 * 删除
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "逻辑删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(recordService.deleteLogic(Func.toLongList(ids)));
+	}
+	/**
+	 * 根据日期获取某人的打卡记录
+	 */
+	@GetMapping("/getRecordsByDate")
+	@ApiOperationSupport(order = 10)
+	@ApiOperation(value = "根据日期获取某人的打卡记录", notes = "传入record")
+	public R getRecordsByDate(Record record) {
+		Assert.notNull(record.getPersonId(), "personId不能为空");
+		Assert.notNull(record.getPersonType(), "打卡人员类型不能为空");
+
+		Date date = new Date();
+		if (record.getCheckinTime()!=null) {
+			date = Date.from(record.getCheckinTime().atZone(ZoneId.systemDefault()).toInstant());
+		}
+		List<Record> recordList = recordService.list(Condition.getQueryWrapper(new Record()).lambda()
+			.eq(Record::getPersonId,record.getPersonId())
+			.eq(Record::getPersonType,record.getPersonType())
+			.ge(Record::getCheckinTime, DateUtil.beginOfDay(date))
+			.le(Record::getCheckinTime,DateUtil.endOfDay(date))
+		);
+		return R.data(recordList);
+	}
+
+
+
+	/**
+	 * 获取某月的打卡标记
+	 */
+	@GetMapping("/getMarkByDate")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "获取某月的打卡标记", notes = "获取某月的打卡标记")
+	public R getMarkByDate(RulePerson rulePerson, LocalDate date) {
+		List<MarkDayVo> markDayVoList = recordService.getMarkByDate(rulePerson, date);
+		return R.data(markDayVoList);
+	}
+
+	/**
+	 * 获取员工的打卡统计
+	 * 出勤天数
+	 * 正常记录
+	 * 迟到记录
+	 * 早退记录
+	 * 范围外打卡异常
+	 * 旷工异常记录
+	 * 缺卡记录
+	 */
+	@GetMapping("/getPersonStatistical")
+	@ApiOperationSupport(order = 9)
+	@ApiOperation(value = "员工打卡统计", notes = "员工打卡统计")
+	public  R getPersonStatistical(RulePerson rulePerson,LocalDate date){
+		Assert.notNull(rulePerson.getPersonId(), "personId不能为空");
+		Assert.notNull(rulePerson.getPersonType(), "personType不能为空");
+		Assert.notNull(date, "查询的日期不能为空");
+
+		MyStatisticalVo personStatistical = recordService.getPersonStatistical(rulePerson, date);
+		return R.data(personStatistical);
+	}
+
+
+
+	/**
+	 * 根据月获取打卡记录
+	 */
+	@GetMapping("/getRecordByMonth")
+	@ApiOperationSupport(order = 11)
+	@ApiOperation(value = "根据月获取打卡记录", notes = "传入recordVO")
+	public R<List<RecordAppVO>> getRecordByMonth(RecordVO recordVO) throws ParseException {
+		Assert.notNull(recordVO.getPersonId(), "personId为空");
+		Assert.notNull(recordVO.getSearchDate(),"searchDate为空");
+		//时间转化
+		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM");
+		Date month = dateFormat.parse(recordVO.getSearchDate());
+		//获取月的天数
+		Calendar calendar = Calendar.getInstance();
+		calendar.setTime(month);
+		//根据人员的id和时间获取月的打卡记录
+		List<Record> records = this.recordService.list(Condition.getQueryWrapper(new Record()).lambda()
+			.eq(Record::getPersonId,recordVO.getPersonId())
+			.ge(Record::getCheckinTime, DateUtil.beginOfMonth(month))
+			.le(Record::getCheckinTime, DateUtil.endOfMonth(month))
+			.orderByAsc(Record::getCheckinDate));
+		//获取和人员绑定的打卡规则
+		RulePerson rulePerson = this.rulePersonService.getOne(Condition.getQueryWrapper(new RulePerson()).lambda()
+			.eq(RulePerson::getPersonId, recordVO.getPersonId())
+			.eq(RulePerson::getType,0));
+		//获取打卡规则
+		Rule rule = this.ruleService.getById(rulePerson.getRuleId());
+		//获取打卡时间
+		List<RuleTime> ruleTimes = this.ruleTimeService.list(Condition.getQueryWrapper(new RuleTime()).lambda()
+			.eq(RuleTime::getRuleId, rule.getId()));
+
+		String[] workDays = ruleTimes.stream().map(RuleTime::getWorkDays).collect(Collectors.joining(",")).split(",");
+		Arrays.sort(workDays);
+		//获取特殊打卡时间
+		List<RuleSpecTime> specTimes = this.ruleSpecTimeService.list(Condition.getQueryWrapper(new RuleSpecTime()).lambda()
+			.eq(RuleSpecTime::getRuleId, rule.getId()));
+		List<String> mustDates = specTimes.stream().filter(item-> item.getIsMust() == 1).map(item-> item.getDate().toString()).collect(Collectors.toList());
+		List<String> notMustDates = specTimes.stream().filter(item-> item.getIsMust() == 0).map(item-> item.getDate().toString()).collect(Collectors.toList());
+		//获取月的天数
+		Calendar instance = Calendar.getInstance();
+		int days = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
+		List<RecordAppVO> recordAppVOS = new ArrayList<>();
+		for (int i= 1; i<= days; i++){
+			RecordAppVO recordAppVO = new RecordAppVO();
+			String date = null;
+			if (i < 10){
+				date = recordVO.getSearchDate() + '-' + '0' + i;
+			}else {
+				date = recordVO.getSearchDate() + '-' + i;
+			}
+			recordAppVO.setDate(date);
+			instance.setTime(new SimpleDateFormat("yyyy-MM-dd").parse(date));
+			int dayOfWeek = instance.get(Calendar.DAY_OF_WEEK)-1;
+			if (!notMustDates.contains(date) && Arrays.binarySearch(workDays,String.valueOf(dayOfWeek)) >= 0){
+				this.setRecordAppVo(records, recordAppVO, date);
+			}else if (mustDates.contains(date)){
+				this.setRecordAppVo(records, recordAppVO, date);
+			}else {
+				recordAppVO.setNormal(true);
+			}
+			recordAppVOS.add(recordAppVO);
+		}
+
+		return R.data(recordAppVOS);
+	}
+
+	public void setRecordAppVo(List<Record> records, RecordAppVO recordAppVO, String date) {
+		for (Record record : records){
+			if (recordAppVO.getWorkRecord() != null && recordAppVO.getOffWorkRecord() != null){
+				recordAppVO.setNormal(true);
+				LocalDateTime work = recordAppVO.getWorkRecord().getCheckinTime();
+				LocalDateTime offWork = recordAppVO.getOffWorkRecord().getCheckinTime();
+				long hours = ChronoUnit.HOURS.between(work,offWork);
+				long minutes = ChronoUnit.MINUTES.between(work,offWork);
+				recordAppVO.setWorkTime(hours + "时" + minutes + "分");
+				break;
+			}else {
+				recordAppVO.setNormal(false);
+			}
+			String checkinDate = record.getCheckinDate().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
+			if (checkinDate.equals(date)){
+				if (record.getCheckinType().equals(0)){
+					recordAppVO.setWorkRecord(record);
+					records.remove(record);
+				}else if (record.getCheckinType().equals(1)){
+					recordAppVO.setOffWorkRecord(record);
+					records.remove(record);
+				}
+			}
+		}
+	}
+}

+ 29 - 0
src/main/java/org/springblade/attence/record/dto/QueryMarkDaysDTO.java

@@ -0,0 +1,29 @@
+package org.springblade.attence.record.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+@Data
+public class QueryMarkDaysDTO {
+
+	@ApiModelProperty(value = "打卡人id")
+	private Long personId;
+	/**
+	 * 打卡人类型 : 0-企业员工
+	 */
+	@ApiModelProperty(value = "打卡人类型 : 0-企业员工")
+	private Integer personType;
+
+	@ApiModelProperty(value = "查询的年份")
+	private String year;
+
+	@ApiModelProperty(value = "查询的月份")
+	private String month;
+}

+ 34 - 0
src/main/java/org/springblade/attence/record/dto/RecordDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.record.dto;
+
+import org.springblade.attence.record.entity.Record;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class RecordDTO extends Record {
+	private static final long serialVersionUID = 1L;
+
+}

+ 149 - 0
src/main/java/org/springblade/attence/record/entity/Record.java

@@ -0,0 +1,149 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.record.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springblade.core.mp.base.BaseEntity;
+
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 实体类
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+@Data
+@TableName("attence_record")
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "Record对象", description = "Record对象")
+public class Record extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 所有者id
+	 */
+	@ApiModelProperty(value = "所有者id")
+	private Long ownerId;
+	/**
+	 * 打卡人id
+	 */
+	@ApiModelProperty(value = "打卡人id")
+	private Long personId;
+	/**
+	 * 打卡人类型 : 0-企业员工
+	 */
+	@ApiModelProperty(value = "打卡人类型 : 0-企业员工")
+	private Integer personType;
+
+	/**
+	 * 打卡人员名称
+	 */
+	private String personName;
+	/**
+	 * 打卡设备id
+	 */
+	@ApiModelProperty(value = "打卡设备id")
+	private String deviceId;
+	/**
+	 * 打卡的MAC地址/bssid
+	 */
+	@ApiModelProperty(value = "	打卡的MAC地址/bssid")
+	private String wifiMac;
+	/**
+	 * 经度
+	 */
+	@ApiModelProperty(value = "经度")
+	private String longitude;
+	/**
+	 * 纬度
+	 */
+	@ApiModelProperty(value = "纬度")
+	private String latitude;
+	/**
+	 * 打卡地点名称
+	 */
+	@ApiModelProperty(value = "打卡地点名称")
+	private String locationName;
+	/**
+	 * 打卡时间
+	 */
+	@ApiModelProperty(value = "打卡时间")
+	private LocalDateTime checkinTime;
+	/**
+	 * 打卡时间
+	 */
+	@ApiModelProperty(value = "打卡时间")
+	private LocalDate checkinDate;
+	/**
+	 * 打卡wifi名称
+	 */
+	@ApiModelProperty(value = "打卡wifi名称")
+	private String wifeName;
+	/**
+	 * 打卡类型。目前有:0-上班打卡,1--下班打卡,2-外出打卡
+	 */
+	@ApiModelProperty(value = "打卡类型。目前有:0-上班打卡,1--下班打卡,2-外出打卡")
+	private Integer checkinType;
+	/**
+	 * 打卡备注
+	 */
+	@ApiModelProperty(value = "打卡备注")
+	private String note;
+	/**
+	 * 人脸照片
+	 */
+	@ApiModelProperty(value = "人脸照片")
+	private String faceImg;
+	/**
+	 * 标准打卡时间,指此次打卡时间对应的标准上班时间或标准下班时间
+	 */
+	@ApiModelProperty(value = "标准打卡时间,指此次打卡时间对应的标准上班时间或标准下班时间")
+	@JsonFormat(pattern = "HH:mm")
+	private LocalTime schCheckinTime;
+	/**
+	 * 常类型,字符串,包括:时间异常,地点异常,未打卡,wifi异常,非常用设备。如果有多个异常,以分号间隔
+	 */
+	@ApiModelProperty(value = "异常类型,字符串,包括:时间异常,地点异常,未打卡,wifi异常,非常用设备。如果有多个异常,以分号间隔")
+	private String exceptionMessage;
+	/**
+	 * 打卡规则id
+	 */
+	@ApiModelProperty(value = "打卡规则id")
+	private Long ruleId;
+	/**
+	 * 打卡时间id
+	 */
+	@ApiModelProperty(value = "打卡时间id")
+	private Long ruleTimeId;
+	/**
+	 * 打卡时间id
+	 */
+	@ApiModelProperty(value = "打卡时间规则类型")
+	private Integer ruleTimeType;
+
+
+}

+ 42 - 0
src/main/java/org/springblade/attence/record/mapper/RecordMapper.java

@@ -0,0 +1,42 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.record.mapper;
+
+import org.springblade.attence.record.dto.QueryMarkDaysDTO;
+import org.springblade.attence.record.entity.Record;
+import org.springblade.attence.record.vo.RecordVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ *  Mapper 接口
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+public interface RecordMapper extends BaseMapper<Record> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param record
+	 * @return
+	 */
+	List<RecordVO> selectRecordPage(IPage page, RecordVO record);
+}

+ 41 - 0
src/main/java/org/springblade/attence/record/mapper/RecordMapper.xml

@@ -0,0 +1,41 @@
+<?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="org.springblade.attence.record.mapper.RecordMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="recordResultMap" type="org.springblade.attence.record.entity.Record">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="owner_id" property="ownerId"/>
+        <result column="person_id" property="personId"/>
+        <result column="person_name" property="personName"/>
+        <result column="person_type" property="personType"/>
+        <result column="device_id" property="deviceId"/>
+        <result column="wifi_mac" property="wifiMac"/>
+        <result column="longitude" property="longitude"/>
+        <result column="latitude" property="latitude"/>
+        <result column="location_name" property="locationName"/>
+        <result column="checkin_time" property="checkinTime"/>
+        <result column="checkin_date" property="checkinDate"/>
+        <result column="wife_name" property="wifeName"/>
+        <result column="checkin_type" property="checkinType"/>
+        <result column="note" property="note"/>
+        <result column="sch_checkin_time" property="schCheckinTime"/>
+        <result column="exception_message" property="exceptionMessage"/>
+        <result column="rule_id" property="ruleId"/>
+        <result column="rule_time_id" property="ruleTimeId"/>
+        <result column="rule_time_type" property="ruleTimeType"/>
+    </resultMap>
+
+
+    <select id="selectRecordPage" resultMap="recordResultMap">
+        select * from attence_record where is_deleted = 0
+    </select>
+
+</mapper>

+ 56 - 0
src/main/java/org/springblade/attence/record/service/IRecordService.java

@@ -0,0 +1,56 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.record.service;
+
+import org.springblade.attence.record.dto.QueryMarkDaysDTO;
+import org.springblade.attence.record.entity.Record;
+import org.springblade.attence.record.vo.MarkDayVo;
+import org.springblade.attence.record.vo.MyStatisticalVo;
+import org.springblade.attence.record.vo.RecordVO;
+import org.springblade.attence.ruleperson.entity.RulePerson;
+import org.springblade.core.mp.base.BaseService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.time.LocalDate;
+import java.util.List;
+
+/**
+ *  服务类
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+public interface IRecordService extends BaseService<Record> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param record
+	 * @return
+	 */
+	IPage<RecordVO> selectRecordPage(IPage<RecordVO> page, RecordVO record);
+
+	/**
+	 * 根据年月获取当月得打卡标记
+	 */
+	List<MarkDayVo> getMarkByDate(RulePerson rulePerson, LocalDate date);
+
+
+	MyStatisticalVo getPersonStatistical(RulePerson rulePerson, LocalDate localDate);
+
+}

+ 437 - 0
src/main/java/org/springblade/attence/record/service/impl/RecordServiceImpl.java

@@ -0,0 +1,437 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.record.service.impl;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.date.BetweenFormatter;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.date.LocalDateTimeUtil;
+import cn.hutool.core.date.TimeInterval;
+import cn.hutool.core.util.StrUtil;
+import org.springblade.attence.record.dto.QueryMarkDaysDTO;
+import org.springblade.attence.record.entity.Record;
+import org.springblade.attence.record.vo.MarkDayVo;
+import org.springblade.attence.record.vo.MyStatisticalVo;
+import org.springblade.attence.record.vo.RecordVO;
+import org.springblade.attence.record.mapper.RecordMapper;
+import org.springblade.attence.record.service.IRecordService;
+import org.springblade.attence.ruleperson.entity.RulePerson;
+import org.springblade.attence.ruleperson.service.IRulePersonService;
+import org.springblade.attence.rulespectime.entity.RuleSpecTime;
+import org.springblade.attence.rulespectime.service.IRuleSpecTimeService;
+import org.springblade.attence.ruletime.entity.RuleTime;
+import org.springblade.attence.ruletime.service.IRuleTimeService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.mp.support.Condition;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import javax.annotation.Resource;
+import java.time.Duration;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.time.temporal.TemporalAdjusters;
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ *  服务实现类
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+@Service
+public class RecordServiceImpl extends BaseServiceImpl<RecordMapper, Record> implements IRecordService {
+
+	@Resource
+	private  IRulePersonService rulePersonService;
+	@Resource
+	private IRuleSpecTimeService ruleSpecTimeService;
+	@Resource
+	private IRuleTimeService ruleTimeService;
+
+	@Override
+	public IPage<RecordVO> selectRecordPage(IPage<RecordVO> page, RecordVO record) {
+		return page.setRecords(baseMapper.selectRecordPage(page, record));
+	}
+
+	@Override
+	public List<MarkDayVo> getMarkByDate(RulePerson rulePerson, LocalDate localDate) {
+		TimeInterval timer = DateUtil.timer();
+
+		List<MarkDayVo> markDayVoList = new ArrayList<>();
+
+		//获取ruleId
+		RulePerson person = rulePersonService.getOne(Condition.getQueryWrapper(rulePerson));
+		Long ruleId = person.getRuleId();
+
+
+		//根据人员的id和时间获取月的打卡记录
+		List<Record> records = baseMapper.selectList(Condition.getQueryWrapper(new Record()).lambda()
+			.eq(Record::getPersonId, rulePerson.getPersonId())
+			.eq(Record::getPersonType, rulePerson.getPersonType())
+			.ge(Record::getCheckinDate, localDate.with(TemporalAdjusters.firstDayOfMonth()))
+			.le(Record::getCheckinDate, localDate.with(TemporalAdjusters.lastDayOfMonth()))
+			.orderByAsc(Record::getCheckinDate));
+
+		//获取特殊日期
+		List<RuleSpecTime> specTimes = ruleSpecTimeService.list(Condition.getQueryWrapper(new RuleSpecTime()).lambda()
+			.eq(RuleSpecTime::getRuleId, ruleId)
+		);
+		//获取必须打卡的特殊日期
+		List<LocalDate> needPunchDates = specTimes.stream().filter(item -> item.getIsMust() == 1).map(RuleSpecTime::getDate).collect(Collectors.toList());
+		//获取不需要打卡的特殊日期
+		List<LocalDate> dontNeedPunchDates = specTimes.stream().filter(item -> item.getIsMust() == 0).map(RuleSpecTime::getDate).collect(Collectors.toList());
+		//正常日期
+		List<RuleTime> ruleTimeList = ruleTimeService.list(Condition.getQueryWrapper(new RuleTime()).lambda().eq(RuleTime::getRuleId, ruleId));
+
+		//获取该月的最后一天
+		LocalDate lastDay = localDate.with(TemporalAdjusters.lastDayOfMonth());
+		//获取绑定该人员打卡规则的日期
+		LocalDate bindDate = person.getCreateTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
+		//获取当天的日期
+		LocalDate now = LocalDate.now();
+
+		//循环第一天到最后一天
+		for (int i = 1; i <= lastDay.getDayOfMonth(); i++) {
+			LocalDate date = LocalDate.of(localDate.getYear(), localDate.getMonth().getValue(), i);
+			//如果当前日期在绑定人员规则前,不再判断
+			if (date.isBefore(bindDate) || date.isEqual(bindDate)) {
+				continue;
+			}
+			//如果在当前日之后,不再判断
+			if (now.isBefore(date)) {
+				break;
+			}
+			MarkDayVo markDayVo = this.getRuleByDate(specTimes, needPunchDates, dontNeedPunchDates, ruleTimeList, date);
+			if (markDayVo.getIsInWork()) {
+				//在工作日内,判断当天打卡的异常情况
+				this.handelException(markDayVo, date, records, ruleTimeList);
+			} else {
+				//不在工作日内
+				markDayVo.setLocalDate(date);
+				markDayVo.setStatus(2);
+				markDayVo.setTotalWorkTime("0");
+			}
+			markDayVoList.add(markDayVo);
+		}
+
+		System.out.println("花费毫秒数==>" + timer.interval());
+		;
+		timer.intervalRestart();//返回花费时间,并重置开始时间
+		System.out.println("花费分钟数==>" + timer.intervalMinute());
+
+		return markDayVoList;
+	}
+
+	/**
+	 * 获取员工的打卡统计
+	 * 出勤天数
+	 * 正常记录
+	 * 迟到记录
+	 * 早退记录
+	 * 范围外打卡异常
+	 * 旷工异常记录
+	 * 缺卡记录
+	 */
+	@Override
+	public MyStatisticalVo getPersonStatistical(RulePerson rulePerson, LocalDate localDate) {
+
+		MyStatisticalVo myStatisticalVo = new MyStatisticalVo();
+
+		//根据人员的id和时间获取该月的打卡记录
+		List<Record> records = baseMapper.selectList(Condition.getQueryWrapper(new Record()).lambda()
+			.eq(Record::getPersonId, rulePerson.getPersonId())
+			.eq(Record::getPersonType, rulePerson.getPersonType())
+			.ge(Record::getCheckinDate, localDate.with(TemporalAdjusters.firstDayOfMonth()))
+			.le(Record::getCheckinDate, localDate.with(TemporalAdjusters.lastDayOfMonth()))
+			.orderByDesc(Record::getCheckinDate));
+
+		//获取出勤天数
+		long count = records.stream().map(Record::getCheckinDate).distinct().count();
+		myStatisticalVo.setAttendanceDays(count);
+
+		//获取正常记录
+		List<Record> normalRecord = records.stream().filter(item -> StrUtil.isBlank(item.getExceptionMessage()) && item.getCheckinType() != 2)
+			.collect(Collectors.toList());
+		myStatisticalVo.setNormalRecord(normalRecord);
+
+		//获取正常分组
+		Map<LocalDate, List<Record>> normalRecordGroupingBy = records.stream().filter(item -> StrUtil.isBlank(item.getExceptionMessage()) && item.getCheckinType() != 2)
+			.collect(Collectors.groupingBy(Record::getCheckinDate));
+		myStatisticalVo.setNormalRecordGroupingBy(normalRecordGroupingBy);
+
+
+		//获取迟到记录
+		List<Record> lateRecord = records.stream().filter(item -> StrUtil.isNotBlank(item.getExceptionMessage()) && item.getExceptionMessage().contains("迟到"))
+			.collect(Collectors.toList());
+		myStatisticalVo.setLateRecord(lateRecord);
+
+		//获取早退记录
+		List<Record> earlyRecord = records.stream().filter(item -> StrUtil.isNotBlank(item.getExceptionMessage()) && item.getExceptionMessage().contains("早退"))
+			.collect(Collectors.toList());
+		myStatisticalVo.setEarlyRecord(earlyRecord);
+
+		//获取出差记录
+		List<Record> outWorkRecord = records.stream().filter(item -> item.getCheckinType() == 2).collect(Collectors.toList());
+		Map<LocalDate, List<Record>> outWorkRecordGroupingBy = records.stream().filter(item -> item.getCheckinType() == 2).collect(Collectors.groupingBy(Record::getCheckinDate));
+		myStatisticalVo.setOutWorkRecord(outWorkRecord);
+		myStatisticalVo.setOutWorkRecordGroupingBy(outWorkRecordGroupingBy);
+
+		//获取缺卡记录 begin
+		//获取上下班记录并按日期分组
+		Map<LocalDate, List<Record>> lackRecordGroupingBy = records.stream().filter(item -> item.getCheckinType() == 0 || item.getCheckinType() == 1)
+			//不计算当天记录
+			.filter(item -> !item.getCheckinDate().isEqual(LocalDate.now()))
+			.collect(Collectors.groupingBy(Record::getCheckinDate));
+		//移除有两条记录的值,剩下的就是缺卡的记录。 因为一天内上下班记录完整是两条,上班一条,下班一条
+		lackRecordGroupingBy.entrySet().removeIf(item -> item.getValue().size() == 2);
+
+		myStatisticalVo.setLackRecordGroupingBy(lackRecordGroupingBy);
+		//获取缺卡记录 end
+
+
+		return myStatisticalVo;
+
+	}
+
+	/**
+	 * 处理异常情况
+	 *
+	 * @return
+	 */
+	private void handelException(MarkDayVo markDayVo, LocalDate date, List<Record> records, List<RuleTime> ruleTimeList) {
+
+		LocalDate now = LocalDate.now();
+		//在工作日内
+		markDayVo.setLocalDate(date);
+		//上班时间
+		LocalDateTime workTime = LocalDateTime.of(now, markDayVo.getWorkTime());
+		//查询当天是否有记录
+		List<Record> recordList = records.stream().filter(item -> item.getCheckinDate().equals(date)).collect(Collectors.toList());
+
+		//判断是否异常
+		//异常的情况有
+		//1:旷工异常【打卡记录为空】
+		//2:迟到,早退,范围外异常【记录不为空】
+		//3: 缺卡异常 【记录不完整,只有上班打卡,或者只有下班打卡】
+		//4:缺卡异常不用考虑今天的记录
+		//记录完整才可以计算工时
+		//不完整一律0工时计算
+
+		//获取上班打卡记录
+		List<Record> workRecord = recordList.stream().filter(item -> item.getCheckinType() == 0).collect(Collectors.toList());
+		//获取下班打卡记录
+		List<Record> offWorkRecord = recordList.stream().filter(item -> item.getCheckinType() == 1).collect(Collectors.toList());
+
+		if (CollUtil.isEmpty(recordList)) {
+			//记录为空,旷工异常
+			markDayVo.setStatus(1);
+			//工作时长为0
+			markDayVo.setTotalWorkTime("0");
+
+			//如果是当天的记录,要做特殊处理
+			if (now.isEqual(date)) {
+				MarkDayVo todayRecord = this.handelTodayRecord(workTime, workRecord, offWorkRecord);
+				markDayVo.setStatus(todayRecord.getStatus());
+			}
+
+		} else {
+			//记录不为空
+
+			//获取异常记录
+			List<Record> abnormalList = recordList.stream().filter(item -> StrUtil.isNotBlank(item.getExceptionMessage())).collect(Collectors.toList());
+			//外出打卡记录
+			List<Record> outWorkRecord = recordList.stream().filter(item -> item.getCheckinType() == 2).collect(Collectors.toList());
+
+			//赋值
+			if (CollUtil.isNotEmpty(workRecord)) {
+				markDayVo.setWorkRecord(workRecord.get(0));
+			}
+			if (CollUtil.isNotEmpty(offWorkRecord)) {
+				markDayVo.setOffWorkRecord(offWorkRecord.get(0));
+			}
+			if (CollUtil.isNotEmpty(outWorkRecord)) {
+				markDayVo.setOutWorkRecord(outWorkRecord);
+			}
+
+			//记录是否完整,判断是否缺卡异常
+			if (CollUtil.isEmpty(workRecord) || CollUtil.isEmpty(offWorkRecord)) {
+
+				//缺卡异常
+				markDayVo.setStatus(1);
+				//工时为0
+				markDayVo.setTotalWorkTime("0");
+
+				//如果是当天的记录,要做特殊处理
+				if (now.isEqual(date)) {
+					//上班时间
+					MarkDayVo todayRecord = this.handelTodayRecord(workTime, workRecord, offWorkRecord);
+					markDayVo.setStatus(todayRecord.getStatus());
+				}
+
+			} else {
+				//记录完整,考虑是否迟到打卡,早退打卡,范围外打卡
+
+				//上班打卡时间
+				LocalDateTime begin = workRecord.get(0).getCheckinTime();
+				//下班打卡时间
+				LocalDateTime end = offWorkRecord.get(0).getCheckinTime();
+
+				//计算工时,计算工时要考虑休息时间,不要把休息时间算进去
+				if (ruleTimeList.get(0).getAllowRest() == 1) {
+					//允许休息
+					//休息开始时间
+					LocalDateTime restBeginTime = LocalDateTime.of(date, ruleTimeList.get(0).getRestBeginTime());
+					//休息结束时间
+					LocalDateTime restEndTime = LocalDateTime.of(date, ruleTimeList.get(0).getRestEndTime());
+
+					Duration duration1 = LocalDateTimeUtil.between(begin, end);
+					Duration duration2 = LocalDateTimeUtil.between(restBeginTime, restEndTime);
+
+					long totalMillis = duration1.toMillis() - duration2.toMillis();
+
+					String totalWorkTime = DateUtil.formatBetween(totalMillis, BetweenFormatter.Level.MINUTE);
+					markDayVo.setTotalWorkTime(totalWorkTime);
+
+				} else {
+					//不允许休息,计算上班打卡时间和下班打卡时间
+					Duration duration = LocalDateTimeUtil.between(begin, end);
+					String totalWorkTime = DateUtil.formatBetween(duration.toMillis(), BetweenFormatter.Level.MINUTE);
+					markDayVo.setTotalWorkTime(totalWorkTime);
+				}
+
+				//有异常记录
+				if (CollUtil.isNotEmpty(abnormalList)) {
+					//异常
+					markDayVo.setStatus(1);
+				} else {
+					//正常
+					markDayVo.setStatus(0);
+				}
+			}
+		}
+	}
+
+	/**
+	 * 处理今天的记录
+	 *
+	 * @param workRecord    上班记录
+	 * @param offWorkRecord 下班记录
+	 * @return
+	 */
+	private MarkDayVo handelTodayRecord(LocalDateTime workTime, List<Record> workRecord, List<Record> offWorkRecord) {
+
+		/*
+		要特殊处理今天的记录
+		* 因为今天的时间还未走完,不能用普通日期的逻辑来判断
+		* 上班记录为空不能直接记为上班未打卡,有可能是在上班时间之前,还未打卡
+		* 下班记录为空也不能直接记为下班未打卡,有可能是员工忘记打卡,但是当天还未走完,还可以继续打
+		* */
+		MarkDayVo markDayVo = new MarkDayVo();
+		//初始化为异常
+		markDayVo.setStatus(1);
+
+		//当前时间
+		LocalDateTime nowTime = LocalDateTime.now();
+
+		if (CollUtil.isNotEmpty(workRecord)) {
+			//上班记录不为空
+
+			//没异常
+			if (StrUtil.isBlank(workRecord.get(0).getExceptionMessage())) {
+				if (CollUtil.isEmpty(offWorkRecord)) {
+					markDayVo.setStatus(0);
+				}
+				//下班记录不为空,且记录没异常
+				if (CollUtil.isNotEmpty(offWorkRecord)
+					&& StrUtil.isBlank(offWorkRecord.get(0).getExceptionMessage())) {
+					markDayVo.setStatus(0);
+				}
+			}
+
+		} else {
+			//上班记录为空,当前时间在上班时间之前
+			if (nowTime.isBefore(workTime) || nowTime.isEqual(workTime)) {
+				markDayVo.setStatus(0);
+			}
+		}
+		return markDayVo;
+	}
+
+	/**
+	 * 获取工作日的打卡规则
+	 *
+	 * @param specTimesList      特殊打卡日期
+	 * @param needPunchDates     需要打卡的日期
+	 * @param dontNeedPunchDates 不需要打卡的日期
+	 * @param ruleTimeList       正常打卡的日期
+	 * @param localDate          当前日期
+	 * @return
+	 */
+	private MarkDayVo getRuleByDate(List<RuleSpecTime> specTimesList,
+									List<LocalDate> needPunchDates,
+									List<LocalDate> dontNeedPunchDates,
+									List<RuleTime> ruleTimeList,
+									LocalDate localDate) {
+
+		MarkDayVo markDayVo = new MarkDayVo();
+		//设置一个默认的上下班时间
+		markDayVo.setWorkTime(ruleTimeList.get(0).getWorkTime());
+		markDayVo.setOffWorkTime(ruleTimeList.get(0).getOffWorkTime());
+
+		//当前日期是否在特殊日期内
+		if (needPunchDates.contains(localDate)) {
+			//在工作日内
+			List<RuleSpecTime> collect = specTimesList.stream().filter(item -> item.getDate().equals(localDate)).collect(Collectors.toList());
+			markDayVo.setWorkTime(collect.get(0).getBeginTime());
+			markDayVo.setOffWorkTime(collect.get(0).getEndTime());
+			markDayVo.setIsInWork(true);
+			return markDayVo;
+		}
+		if (dontNeedPunchDates.contains(localDate)) {
+			//不在工作日内
+			markDayVo.setIsInWork(false);
+			return markDayVo;
+		}
+		for (RuleTime ruleTime : ruleTimeList) {
+
+			List<String> list = Arrays.asList(ruleTime.getWorkDays().split(","));
+			//获取日期是星期几
+			String i = String.valueOf(localDate.getDayOfWeek().getValue());
+			if (i == "7") {
+				i = "0";
+			}
+			if (list.contains(i)) {
+				//在工作日内
+				markDayVo.setIsInWork(true);
+				markDayVo.setWorkTime(ruleTime.getWorkTime());
+				markDayVo.setOffWorkTime(ruleTime.getOffWorkTime());
+				break;
+			} else {
+				//不在工作日内
+				markDayVo.setIsInWork(false);
+			}
+		}
+		return markDayVo;
+	}
+
+
+
+}

+ 46 - 0
src/main/java/org/springblade/attence/record/vo/MarkDayVo.java

@@ -0,0 +1,46 @@
+package org.springblade.attence.record.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springblade.attence.record.entity.Record;
+
+import java.time.LocalDate;
+import java.time.LocalTime;
+import java.util.List;
+
+@Data
+@ApiModel(value = "打卡标记对象", description = "打卡标记对象")
+public class MarkDayVo {
+
+	@ApiModelProperty("日期")
+	private LocalDate localDate;
+
+	@ApiModelProperty("是否需要打卡")
+	private Boolean isInWork;
+
+	@ApiModelProperty("类型,0:正常打卡日期,1:异常打卡日期,2:不需要打卡的日期,默认为0")
+	private Integer status;
+
+	@ApiModelProperty("当天上班标准时间")
+	@JsonFormat(pattern = "HH:mm")
+	private LocalTime workTime;
+
+	@ApiModelProperty("当天下班标准时间")
+	@JsonFormat(pattern = "HH:mm")
+	private LocalTime offWorkTime;
+
+	@ApiModelProperty("上班打卡记录")
+	private Record workRecord;
+
+	@ApiModelProperty("下班打卡记录")
+	private Record offWorkRecord;
+
+	@ApiModelProperty("外出打卡记录")
+	private List<Record> outWorkRecord;
+
+	@ApiModelProperty("工作时长")
+	private String totalWorkTime;
+
+}

+ 40 - 0
src/main/java/org/springblade/attence/record/vo/MyStatisticalVo.java

@@ -0,0 +1,40 @@
+package org.springblade.attence.record.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springblade.attence.record.entity.Record;
+
+import java.time.LocalDate;
+import java.util.List;
+import java.util.Map;
+
+@Data
+@ApiModel(value = "员工打卡统计", description = "员工打卡统计")
+public class MyStatisticalVo {
+
+	@ApiModelProperty("出勤天数")
+	private long attendanceDays;
+
+	@ApiModelProperty("正常记录")
+	private List<Record> normalRecord;
+
+	@ApiModelProperty("正常记录分组")
+	private Map<LocalDate, List<Record>> normalRecordGroupingBy;
+
+	@ApiModelProperty("迟到记录")
+	private List<Record> LateRecord;
+
+	@ApiModelProperty("早退记录")
+	private List<Record> earlyRecord;
+
+	@ApiModelProperty("缺卡记录分组")
+	private Map<LocalDate, List<Record>> lackRecordGroupingBy;
+
+	@ApiModelProperty("出差记录")
+	private List<Record> outWorkRecord;
+
+	@ApiModelProperty("出差分组记录")
+	private Map<LocalDate, List<Record>> outWorkRecordGroupingBy;
+
+}

+ 54 - 0
src/main/java/org/springblade/attence/record/vo/RecordAppVO.java

@@ -0,0 +1,54 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.record.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.attence.record.entity.Record;
+import org.springblade.core.tool.api.R;
+
+import java.time.LocalDate;
+
+/**
+ * 视图实体类
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "RecordAppVO对象", description = "RecordAppVO对象")
+public class RecordAppVO extends Record {
+	private static final long serialVersionUID = 1L;
+
+	@ApiModelProperty("日期")
+	private String date;
+
+	@ApiModelProperty("上班打卡记录")
+	private Record workRecord;
+
+	@ApiModelProperty("下班打卡记录")
+	private Record offWorkRecord;
+
+	@ApiModelProperty("当天打卡状态")
+	private Boolean normal;
+
+	@ApiModelProperty("当天工作时长")
+	private String workTime;
+}

+ 46 - 0
src/main/java/org/springblade/attence/record/vo/RecordVO.java

@@ -0,0 +1,46 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.record.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import org.springblade.attence.record.entity.Record;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.util.Calendar;
+import java.util.Date;
+
+/**
+ * 视图实体类
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "RecordVO对象", description = "RecordVO对象")
+public class RecordVO extends Record {
+	private static final long serialVersionUID = 1L;
+
+	@ApiModelProperty("")
+	private String searchDate;
+}

+ 49 - 0
src/main/java/org/springblade/attence/record/wrapper/RecordWrapper.java

@@ -0,0 +1,49 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.record.wrapper;
+
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.attence.record.entity.Record;
+import org.springblade.attence.record.vo.RecordVO;
+import java.util.Objects;
+
+/**
+ * 包装类,返回视图层所需的字段
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+public class RecordWrapper extends BaseEntityWrapper<Record, RecordVO>  {
+
+	public static RecordWrapper build() {
+		return new RecordWrapper();
+ 	}
+
+	@Override
+	public RecordVO entityVO(Record record) {
+		RecordVO recordVO = Objects.requireNonNull(BeanUtil.copy(record, RecordVO.class));
+
+		//User createUser = UserCache.getUser(record.getCreateUser());
+		//User updateUser = UserCache.getUser(record.getUpdateUser());
+		//recordVO.setCreateUserName(createUser.getName());
+		//recordVO.setUpdateUserName(updateUser.getName());
+
+		return recordVO;
+	}
+
+}

+ 279 - 0
src/main/java/org/springblade/attence/rule/controller/RuleController.java

@@ -0,0 +1,279 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.rule.controller;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.date.BetweenFormater;
+import cn.hutool.core.date.DateTime;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.http.HttpUtil;
+import cn.hutool.json.JSONObject;
+import cn.hutool.json.JSONUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.AllArgsConstructor;
+
+import javax.validation.Valid;
+
+import org.springblade.attence.location.entity.Location;
+import org.springblade.attence.location.service.ILocationService;
+import org.springblade.attence.rule.dto.QueryDataDTO;
+import org.springblade.attence.rule.vo.AttenceRuleVo;
+import org.springblade.attence.rule.vo.WxAppDataVo;
+import org.springblade.attence.ruleperson.entity.RulePerson;
+import org.springblade.attence.ruleperson.service.IRulePersonService;
+import org.springblade.attence.rulespectime.entity.RuleSpecTime;
+import org.springblade.attence.rulespectime.service.IRuleSpecTimeService;
+import org.springblade.attence.ruletime.entity.RuleTime;
+import org.springblade.attence.ruletime.service.IRuleTimeService;
+import org.springblade.attence.wifi.entity.Wifi;
+import org.springblade.attence.wifi.service.IWifiService;
+import org.springblade.common.Constants;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.Assert;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.RequestParam;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.attence.rule.entity.Rule;
+import org.springblade.attence.rule.vo.RuleVO;
+import org.springblade.attence.rule.wrapper.RuleWrapper;
+import org.springblade.attence.rule.service.IRuleService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.ZoneId;
+import java.util.*;
+
+/**
+ * 控制器
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("attence/rule")
+@Api(value = "打卡规则接口", tags = "打卡规则接口")
+public class RuleController extends BladeController {
+
+	private final IRuleService ruleService;
+	private final IRulePersonService rulePersonService;
+	private final ILocationService locationService;
+	private final IWifiService wifiService;
+	private final IRuleTimeService ruleTimeService;
+	private final IRuleSpecTimeService ruleSpecTimeService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入rule")
+	public R<AttenceRuleVo> detail(Rule rule) {
+		Rule byId = this.ruleService.getById(rule.getId());
+		AttenceRuleVo attenceRuleVo = new AttenceRuleVo();
+		BeanUtil.copyProperties(byId, attenceRuleVo);
+		//打卡人员
+		List<RulePerson> rulePersons = this.rulePersonService.list(Condition.getQueryWrapper(new RulePerson()).lambda().eq(RulePerson::getRuleId, rule.getId()));
+		attenceRuleVo.setRulePersons(rulePersons);
+		//打卡位置
+		List<Location> locations = this.locationService.list(Condition.getQueryWrapper(new Location()).lambda().eq(Location::getRuleId, rule.getId()));
+		attenceRuleVo.setLocations(locations);
+		//打卡wifi
+		List<Wifi> wifiList = this.wifiService.list(Condition.getQueryWrapper(new Wifi()).lambda().eq(Wifi::getRuleId, rule.getId()));
+		attenceRuleVo.setWifiList(wifiList);
+		//打卡时间
+		List<RuleTime> ruleTimes = this.ruleTimeService.list(Condition.getQueryWrapper(new RuleTime()).lambda().eq(RuleTime::getRuleId, rule.getId()));
+		attenceRuleVo.setRuleTimes(ruleTimes);
+		//特殊打卡日期
+		List<RuleSpecTime> ruleSpecTimes = this.ruleSpecTimeService.list(Condition.getQueryWrapper(new RuleSpecTime()).lambda().eq(RuleSpecTime::getRuleId, rule.getId()));
+		attenceRuleVo.setRuleSpecTimes(ruleSpecTimes);
+		return R.data(attenceRuleVo);
+	}
+
+	/**
+	 * 分页
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入rule")
+	public R<List<RuleVO>> list(Rule rule) {
+		List<Rule> list = ruleService.list(Condition.getQueryWrapper(rule));
+		return R.data(RuleWrapper.build().listVO(list));
+	}
+
+
+	/**
+	 * 自定义分页
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入rule")
+	public R<IPage<RuleVO>> page(RuleVO rule, Query query) {
+		IPage<RuleVO> pages = ruleService.selectRulePage(Condition.getPage(query), rule);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入AttenceRuleVo")
+	public R save(@Valid @RequestBody AttenceRuleVo attenceRuleVo) {
+		//保存规则
+		Rule before = new Rule();
+		BeanUtil.copyProperties(attenceRuleVo, before);
+		if (this.ruleService.save(before)) {
+			//保存打卡人员
+			List<RulePerson> rulePersons = attenceRuleVo.getRulePersons();
+			rulePersons.forEach(rulePerson -> {
+				rulePerson.setRuleId(before.getId());
+				rulePerson.setPersonType(attenceRuleVo.getOwnerType());
+			});
+			this.rulePersonService.saveBatch(rulePersons);
+			//保存打卡地点
+			List<Location> locations = attenceRuleVo.getLocations();
+			locations.forEach(location -> {
+				location.setRuleId(before.getId());
+			});
+			this.locationService.saveBatch(locations);
+			//保存wifi
+			List<Wifi> wifiList = attenceRuleVo.getWifiList();
+			wifiList.forEach(wifi -> {
+				wifi.setRuleId(before.getId());
+			});
+			this.wifiService.saveBatch(wifiList);
+			//保存打卡时间
+			List<RuleTime> ruleTimes = attenceRuleVo.getRuleTimes();
+			ruleTimes.forEach(ruleTime -> {
+				ruleTime.setRuleId(before.getId());
+			});
+			this.ruleTimeService.saveBatch(ruleTimes);
+			//保存特殊打卡日期
+			List<RuleSpecTime> ruleSpecTimes = attenceRuleVo.getRuleSpecTimes();
+			ruleSpecTimes.forEach(ruleSpecTime -> {
+				ruleSpecTime.setRuleId(before.getId());
+			});
+			this.ruleSpecTimeService.saveBatch(ruleSpecTimes);
+			return R.data(true);
+		} else {
+			return R.data(false);
+		}
+	}
+
+	/**
+	 * 修改
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入rule")
+	@Transactional
+	public R update(@Valid @RequestBody AttenceRuleVo attenceRuleVo) {
+		Rule rule = new Rule();
+		BeanUtil.copyProperties(attenceRuleVo,rule);
+		if (this.ruleService.updateById(rule)) {
+			//打卡人员,先删除原有数据,再插入新数据
+			this.rulePersonService.getBaseMapper().delete(Condition.getQueryWrapper(new RulePerson()).lambda().eq(RulePerson::getRuleId, rule.getId()));
+			List<RulePerson> rulePersons = attenceRuleVo.getRulePersons();
+			rulePersons.forEach(rulePerson -> {
+				rulePerson.setId(null);
+				rulePerson.setRuleId(rule.getId());
+				rulePerson.setPersonType(attenceRuleVo.getOwnerType());
+			});
+			this.rulePersonService.saveBatch(rulePersons);
+			//打卡位置
+			List<Location> locations = attenceRuleVo.getLocations();
+			locations.removeIf(location -> location.getId() != null);
+			locations.forEach(location -> location.setRuleId(rule.getId()));
+			this.locationService.saveBatch(locations);
+			//打卡wifi
+			List<Wifi> wifiList = attenceRuleVo.getWifiList();
+			wifiList.removeIf(wifi -> wifi.getId() != null);
+			wifiList.forEach(wifi -> wifi.setRuleId(rule.getId()));
+			this.wifiService.saveBatch(wifiList);
+			//打卡时间
+			List<RuleTime> ruleTimes = attenceRuleVo.getRuleTimes();
+			ruleTimes.forEach(ruleTime -> ruleTime.setRuleId(rule.getId()));
+			this.ruleTimeService.saveOrUpdateBatch(ruleTimes);
+			//特殊打卡日期
+			List<RuleSpecTime> ruleSpecTimes = attenceRuleVo.getRuleSpecTimes();
+			ruleSpecTimes.removeIf(ruleSpecTime -> ruleSpecTime.getId() != null);
+			ruleSpecTimes.forEach(ruleSpecTime -> ruleSpecTime.setRuleId(rule.getId()));
+			this.ruleSpecTimeService.saveBatch(ruleSpecTimes);
+			return R.data(true);
+		} else {
+			return R.data(false);
+		}
+	}
+
+	/**
+	 * 新增或修改
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入rule")
+	public R submit(@Valid @RequestBody Rule rule) {
+		return R.status(ruleService.saveOrUpdate(rule));
+	}
+
+
+	/**
+	 * 删除
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "逻辑删除", notes = "传入id")
+	@Transactional
+	public R remove(@ApiParam(value = "id", required = true) @RequestParam Long id) {
+		this.rulePersonService.getBaseMapper().delete(Condition.getQueryWrapper(new RulePerson()).lambda().eq(RulePerson::getRuleId,id));
+		this.locationService.remove(Condition.getQueryWrapper(new Location()).lambda().eq(Location::getRuleId,id));
+		this.wifiService.remove(Condition.getQueryWrapper(new Wifi()).lambda().eq(Wifi::getRuleId,id));
+		this.ruleTimeService.remove(Condition.getQueryWrapper(new RuleTime()).lambda().eq(RuleTime::getRuleId,id));
+		this.ruleSpecTimeService.remove(Condition.getQueryWrapper(new RuleSpecTime()).lambda().eq(RuleSpecTime::getRuleId,id));
+		return R.status(this.ruleService.removeById(id));
+	}
+
+	/**
+	 * 获取必要的数据
+	 */
+	@PostMapping("/getNecessaryData")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "getNecessaryData", notes = "传入rule")
+	public R getNecessaryData(@RequestBody QueryDataDTO queryDataDTO) {
+		Assert.notNull(queryDataDTO.getLongitude(), "经度不能为空");
+		Assert.notNull(queryDataDTO.getLatitude(), "纬度不能为空");
+		Assert.notNull(queryDataDTO.getPersonId(), "员工id不能为空");
+		Assert.notNull(queryDataDTO.getPersonType(), "员工类型不能为空");
+		Assert.notNull(queryDataDTO.getType(), "打卡人员类型不能为空");
+		Assert.notNull(queryDataDTO.getWifiMac(), "wifiMac码不能为空");
+
+		WxAppDataVo necessaryData = ruleService.getNecessaryData(queryDataDTO);
+
+		return R.data(necessaryData);
+	}
+}

+ 39 - 0
src/main/java/org/springblade/attence/rule/dto/QueryDataDTO.java

@@ -0,0 +1,39 @@
+package org.springblade.attence.rule.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+public class QueryDataDTO {
+
+	/**
+	 * 经度
+	 */
+	@ApiModelProperty(value = "当前位置经度")
+	private String longitude;
+	/**
+     * 纬度
+	 */
+	@ApiModelProperty(value = "当前位置纬度")
+	private String latitude;
+	/**
+	 * 打卡人id
+	 */
+	@ApiModelProperty(value = "打卡人id")
+	private Long personId;
+	/**
+	 * 0-企业员工
+	 */
+	@ApiModelProperty(value = "0-企业员工")
+	private Integer personType;
+	/**
+	 * 人员类型:0-打卡人员 1-白名单 2-汇报对象
+	 */
+	@ApiModelProperty(value = "0-打卡人员")
+	private Integer type;
+	/**
+	 * wifi mac码
+	 */
+	@ApiModelProperty(value = "wifiMac码")
+	private String wifiMac;
+}

+ 34 - 0
src/main/java/org/springblade/attence/rule/dto/RuleDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.rule.dto;
+
+import org.springblade.attence.rule.entity.Rule;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class RuleDTO extends Rule {
+	private static final long serialVersionUID = 1L;
+
+}

+ 97 - 0
src/main/java/org/springblade/attence/rule/entity/Rule.java

@@ -0,0 +1,97 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.rule.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import org.springblade.core.mp.base.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 实体类
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+@Data
+@TableName("attence_rule")
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "Rule对象", description = "Rule对象")
+public class Rule extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	* 规则名称
+	*/
+		@ApiModelProperty(value = "规则名称")
+		private String name;
+	/**
+	* 所有者id
+	*/
+		@ApiModelProperty(value = "所有者id")
+		private Long ownerId;
+	/**
+	* 所有者类型: 0-企业
+	*/
+		@ApiModelProperty(value = "所有者类型: 0-企业")
+		private Integer ownerType;
+	/**
+	* 汇报人id
+	*/
+		@ApiModelProperty(value = "汇报人id")
+		private Long reporterId;
+	/**
+	* 汇报人类型: 0-员工
+	*/
+		@ApiModelProperty(value = "汇报人类型: 0-员工")
+		private Integer reporterType;
+	/**
+	* 打卡规则类型id
+	*/
+		@ApiModelProperty(value = "打卡规则类型id")
+		private Long ruleType;
+	/**
+	* 员工打卡时是否必须拍照 0-不必拍照 1-必须拍照
+	*/
+		@ApiModelProperty(value = "员工打卡时是否必须拍照 0-不必拍照 1-必须拍照")
+		private Integer needPhone;
+	/**
+	* 是否备注时允许上传本地图片 0-不允许 1-允许
+	*/
+		@ApiModelProperty(value = "是否备注时允许上传本地图片 0-不允许 1-允许")
+		private Integer noteCanUseLocalPic;
+	/**
+	* 员工打卡时必须进行人脸识别验证 0-不用 1-必须
+	*/
+		@ApiModelProperty(value = "员工打卡时必须进行人脸识别验证 0-不用 1-必须")
+		private Integer useFaceDetect;
+	/**
+	* 范围外打卡处理方式,0-视为范围外异常,默认值;1-视为正常外勤;2:不允许范围外打卡
+	*/
+		@ApiModelProperty(value = "范围外打卡处理方式,0-视为范围外异常,默认值;1-视为正常外勤;2:不允许范围外打卡")
+		private Integer optionOutRange;
+	/**
+	* 每月最多补卡次数,默认-1表示不限制
+	*/
+		@ApiModelProperty(value = "每月最多补卡次数,默认-1表示不限制")
+		private Integer allowApplyBkCnt;
+
+
+}

+ 42 - 0
src/main/java/org/springblade/attence/rule/mapper/RuleMapper.java

@@ -0,0 +1,42 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.rule.mapper;
+
+import org.springblade.attence.rule.entity.Rule;
+import org.springblade.attence.rule.vo.RuleVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ *  Mapper 接口
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+public interface RuleMapper extends BaseMapper<Rule> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param rule
+	 * @return
+	 */
+	List<RuleVO> selectRulePage(IPage page, RuleVO rule);
+
+}

+ 33 - 0
src/main/java/org/springblade/attence/rule/mapper/RuleMapper.xml

@@ -0,0 +1,33 @@
+<?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="org.springblade.attence.rule.mapper.RuleMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="ruleResultMap" type="org.springblade.attence.rule.entity.Rule">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="name" property="name"/>
+        <result column="owner_id" property="ownerId"/>
+        <result column="owner_type" property="ownerType"/>
+        <result column="reporter_id" property="reporterId"/>
+        <result column="reporter_type" property="reporterType"/>
+        <result column="rule_type" property="ruleType"/>
+        <result column="need_phone" property="needPhone"/>
+        <result column="note_can_use_local_pic" property="noteCanUseLocalPic"/>
+        <result column="use_face_detect" property="useFaceDetect"/>
+        <result column="option_out_range" property="optionOutRange"/>
+        <result column="allow_apply_bk_cnt" property="allowApplyBkCnt"/>
+    </resultMap>
+
+
+    <select id="selectRulePage" resultMap="ruleResultMap">
+        select * from attence_rule where is_deleted = 0
+    </select>
+
+</mapper>

+ 51 - 0
src/main/java/org/springblade/attence/rule/service/IRuleService.java

@@ -0,0 +1,51 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.rule.service;
+
+import org.springblade.attence.rule.dto.QueryDataDTO;
+import org.springblade.attence.rule.entity.Rule;
+import org.springblade.attence.rule.vo.AttenceRuleVo;
+import org.springblade.attence.rule.vo.RuleVO;
+import org.springblade.attence.rule.vo.WxAppDataVo;
+import org.springblade.attence.ruleperson.entity.RulePerson;
+import org.springblade.core.mp.base.BaseService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.time.LocalDate;
+import java.util.Map;
+
+/**
+ *  服务类
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+public interface IRuleService extends BaseService<Rule> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param rule
+	 * @return
+	 */
+	IPage<RuleVO> selectRulePage(IPage<RuleVO> page, RuleVO rule);
+
+	AttenceRuleVo getAttenceRuleVo(Rule rule);
+
+	WxAppDataVo getNecessaryData(QueryDataDTO queryDataDTO);
+}

+ 309 - 0
src/main/java/org/springblade/attence/rule/service/impl/RuleServiceImpl.java

@@ -0,0 +1,309 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.rule.service.impl;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.date.*;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import org.springblade.attence.location.entity.Location;
+import org.springblade.attence.location.service.ILocationService;
+import org.springblade.attence.record.entity.Record;
+import org.springblade.attence.record.service.IRecordService;
+import org.springblade.attence.rule.dto.QueryDataDTO;
+import org.springblade.attence.rule.entity.Rule;
+import org.springblade.attence.rule.vo.AttenceRuleVo;
+import org.springblade.attence.rule.vo.RuleVO;
+import org.springblade.attence.rule.mapper.RuleMapper;
+import org.springblade.attence.rule.service.IRuleService;
+import org.springblade.attence.rule.vo.WxAppDataVo;
+import org.springblade.attence.ruleout.entity.RuleOut;
+import org.springblade.attence.ruleout.service.IRuleOutService;
+import org.springblade.attence.ruleperson.entity.RulePerson;
+import org.springblade.attence.ruleperson.service.IRulePersonService;
+import org.springblade.attence.rulespectime.entity.RuleSpecTime;
+import org.springblade.attence.rulespectime.service.IRuleSpecTimeService;
+import org.springblade.attence.ruletime.entity.RuleTime;
+import org.springblade.attence.ruletime.service.IRuleTimeService;
+import org.springblade.attence.wifi.entity.Wifi;
+import org.springblade.attence.wifi.service.IWifiService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.utils.DistanceUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springframework.util.Assert;
+
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.ZoneId;
+import java.time.format.DateTimeFormatter;
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ *  服务实现类
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+@Service
+public class RuleServiceImpl extends BaseServiceImpl<RuleMapper, Rule> implements IRuleService {
+
+	private final ILocationService locationService;
+	private final IWifiService wifiService;
+	private final IRuleTimeService ruleTimeService;
+	private final IRuleSpecTimeService ruleSpecTimeService;
+	private final IRulePersonService rulePersonService;
+	private final IRecordService recordService;
+	private final IRuleOutService ruleOutService;
+
+
+
+	@Autowired
+	public  RuleServiceImpl(ILocationService locationService, IWifiService wifiService, IRuleTimeService ruleTimeService,
+							IRuleSpecTimeService ruleSpecTimeService, IRulePersonService rulePersonService, IRecordService recordService, IRuleOutService ruleOutService){
+		this.locationService = locationService;
+		this.wifiService = wifiService;
+		this.ruleTimeService = ruleTimeService;
+		this.ruleSpecTimeService = ruleSpecTimeService;
+		this.rulePersonService = rulePersonService;
+		this.recordService = recordService;
+		this.ruleOutService = ruleOutService;
+	}
+
+	@Override
+	public IPage<RuleVO> selectRulePage(IPage<RuleVO> page, RuleVO rule) {
+		return page.setRecords(baseMapper.selectRulePage(page, rule));
+	}
+
+	@Override
+	public AttenceRuleVo getAttenceRuleVo(Rule rule) {
+		AttenceRuleVo attenceRuleVo = new AttenceRuleVo();
+		Rule baseRule = this.baseMapper.selectById(rule.getId());
+
+		BeanUtil.copyProperties(baseRule,attenceRuleVo);
+		List<Location> locations = this.locationService.list(Condition.getQueryWrapper(new Location()).lambda().eq(Location::getRuleId, rule.getId()));
+		attenceRuleVo.setLocations(locations);
+		List<Wifi> wifiList = this.wifiService.list(Condition.getQueryWrapper(new Wifi()).lambda().eq(Wifi::getRuleId, rule.getId()));
+		attenceRuleVo.setWifiList(wifiList);
+		List<RuleTime> ruleTimes = this.ruleTimeService.list(Condition.getQueryWrapper(new RuleTime()).lambda().eq(RuleTime::getRuleId, rule.getId()));
+		attenceRuleVo.setRuleTimes(ruleTimes);
+		List<RuleSpecTime> ruleSpecTimes = this.ruleSpecTimeService.list(Condition.getQueryWrapper(new RuleSpecTime()).lambda().eq(RuleSpecTime::getRuleId, rule.getId()));
+		attenceRuleVo.setRuleSpecTimes(ruleSpecTimes);
+		//外出打卡规则
+		RuleOut ruleOut = ruleOutService.getOne(Condition.getQueryWrapper(new RuleOut()).lambda()
+			.eq(RuleOut::getOwnerId, baseRule.getOwnerId())
+			.eq(RuleOut::getOwnerType, baseRule.getOwnerType())
+		);
+		attenceRuleVo.setRuleOut(ruleOut);
+		//当天是否是工作日
+		WxAppDataVo necessaryDateData = this.getNecessaryDateData(rule.getId());
+		attenceRuleVo.setIsWork(necessaryDateData.getIsWork());
+
+		return attenceRuleVo;
+	}
+
+	@Override
+	public WxAppDataVo getNecessaryData(QueryDataDTO queryDataDTO) {
+		//根据person_id和person_type获取到rule_id
+		QueryWrapper<RulePerson> queryWrapper = new QueryWrapper<>();
+		queryWrapper.eq("person_id", queryDataDTO.getPersonId());
+		queryWrapper.eq("person_type", queryDataDTO.getPersonType());
+		queryWrapper.eq("type", queryDataDTO.getPersonType());
+
+		RulePerson rulePerson = rulePersonService.getOne(queryWrapper);
+		Assert.notNull(rulePerson, "该人员未绑定打卡规则");
+
+		long ruleId = rulePerson.getRuleId();
+
+		//判断是否是工作日
+		WxAppDataVo necessaryDateData = this.getNecessaryDateData(ruleId);
+		if (!necessaryDateData.getIsWork()) {
+			//不是工作日直接返回
+			return necessaryDateData;
+		}
+		WxAppDataVo wxAppDataVo = new WxAppDataVo();
+		BeanUtil.copyProperties(necessaryDateData,wxAppDataVo);
+
+		//判断是否在指定区域内
+		WxAppDataVo necessaryLocationData = this.getNecessaryLocationData(queryDataDTO, ruleId);
+		wxAppDataVo.setNeedLocation(necessaryLocationData.getNeedLocation());
+		wxAppDataVo.setIsInPunchLocation(necessaryLocationData.getIsInPunchLocation());
+
+		//判断是否在指定wifi区域内
+		WxAppDataVo necessaryWifiData = this.getNecessaryWifiData(queryDataDTO, ruleId);
+		wxAppDataVo.setNeedWifi(necessaryWifiData.getNeedWifi());
+		wxAppDataVo.setIsInPunchWifi(necessaryWifiData.getIsInPunchWifi());
+
+		//获取当天打卡记录
+		WxAppDataVo necessaryRecordsData =this.getNecessaryRecordsData(queryDataDTO,wxAppDataVo.getOffWorkTime());
+		wxAppDataVo.setWorkPunchRecords(necessaryRecordsData.getWorkPunchRecords());
+		wxAppDataVo.setOffWorkPunchRecords(necessaryRecordsData.getOffWorkPunchRecords());
+		wxAppDataVo.setIsDone(necessaryRecordsData.getIsDone());
+		wxAppDataVo.setWorkStatus(necessaryRecordsData.getWorkStatus());
+
+		return wxAppDataVo;
+	}
+	/**
+	 * 获取当天打卡记录
+	 * @param queryDataDTO
+	 * @return
+	 */
+	private WxAppDataVo getNecessaryRecordsData(QueryDataDTO queryDataDTO, LocalTime offWorkTime) {
+		WxAppDataVo wxAppDataVo = new WxAppDataVo();
+		List<Record> recordList = recordService.list(Condition.getQueryWrapper(new Record()).lambda()
+			.eq(Record::getPersonId, queryDataDTO.getPersonId())
+			.eq(Record::getPersonType, queryDataDTO.getPersonType())
+			.ge(Record::getCheckinTime, DateUtil.beginOfDay(new Date()))
+			.le(Record::getCheckinTime, DateUtil.endOfDay(new Date()))
+		);
+		//筛选上班打卡记录
+		List<Record> workPunchRecords = recordList.stream().filter(record -> record.getCheckinType() == 0).collect(Collectors.toList());
+		//筛选下班打卡记录
+		List<Record> offWorkPunchRecords = recordList.stream().filter(record -> record.getCheckinType() == 1).collect(Collectors.toList());
+
+		if (!CollUtil.isEmpty(offWorkPunchRecords)) {
+			//下班打卡不为空
+			wxAppDataVo.setIsDone(true);
+		}
+
+		wxAppDataVo.setWorkPunchRecords(workPunchRecords);
+		wxAppDataVo.setOffWorkPunchRecords(offWorkPunchRecords);
+
+		//当前时间戳
+		long nowTimeStamp= new Date().getTime();
+		//下班时间戳
+		String s = LocalDate.now().toString()+" "+offWorkTime.toString();
+		long offWorkTimeStamp = DateTime.of(s, DatePattern.NORM_DATETIME_MINUTE_PATTERN).getTime();
+		//如果上班打卡记录为空,且再下班时间之前,都视为上班打卡
+		if (CollUtil.isEmpty(workPunchRecords) && nowTimeStamp<offWorkTimeStamp) {
+			wxAppDataVo.setWorkStatus(0);
+		}else{
+			wxAppDataVo.setWorkStatus(1);
+		}
+		return wxAppDataVo;
+	}
+	/**
+	 * 判断是否在打卡日期内
+	 * @return
+	 */
+	private WxAppDataVo getNecessaryDateData(long ruleId ) {
+		WxAppDataVo wxAppDataVo = new WxAppDataVo();
+		//特殊日期
+		RuleSpecTime  ruleSpecTime= ruleSpecTimeService.getOne(Condition.getQueryWrapper(new RuleSpecTime()).lambda()
+			.eq(RuleSpecTime::getRuleId, ruleId)
+			.eq(RuleSpecTime::getDate, LocalDate.now())
+		);
+		//正常日期
+		List<RuleTime> ruleTimeList = ruleTimeService.list(Condition.getQueryWrapper(new RuleTime()).lambda().eq(RuleTime::getRuleId, ruleId));
+
+		if (ruleSpecTime!=null) {
+			if (ruleSpecTime.getIsMust() == 1) {
+				//当天必须打卡
+				wxAppDataVo.setIsWork(true);
+				wxAppDataVo.setRuleTimeId(ruleSpecTime.getId());
+				wxAppDataVo.setRuleTimeType(0);
+				wxAppDataVo.setWorkTime(ruleSpecTime.getBeginTime());
+				wxAppDataVo.setOffWorkTime(ruleSpecTime.getEndTime());
+			}else{
+				//当天不需要打卡
+				wxAppDataVo.setIsWork(false);
+			}
+			return wxAppDataVo;
+		}
+
+
+		for (RuleTime ruleTime :ruleTimeList) {
+			List<String> list = Arrays.asList(ruleTime.getWorkDays().split(","));
+			//获取今天是星期几
+			//这里的周日是1,但数据库存储的周日是0,所以要减去1
+			DateTime date = DateUtil.date();
+			String i = Integer.toString(DateUtil.dayOfWeek(date)-1);
+			if (list.contains(i)) {
+				wxAppDataVo.setIsWork(true);
+				wxAppDataVo.setRuleTimeId(ruleTime.getId());
+				wxAppDataVo.setRuleTimeType(1);
+				wxAppDataVo.setWorkTime(ruleTime.getWorkTime());
+				wxAppDataVo.setOffWorkTime(ruleTime.getOffWorkTime());
+				wxAppDataVo.setRuleTime(ruleTime);
+				break;
+			} else {
+				wxAppDataVo.setIsWork(false);
+			}
+		}
+		return wxAppDataVo;
+	}
+	/**
+	 * 判断是否在指定区域内
+	 * @param queryDataDTO
+	 * @param ruleId
+	 * @return
+	 */
+	private WxAppDataVo getNecessaryLocationData(QueryDataDTO queryDataDTO,long ruleId) {
+		WxAppDataVo wxAppDataVo = new WxAppDataVo();
+		List<Location> locationList = locationService.list(Condition.getQueryWrapper(new Location()).lambda().eq(Location::getRuleId, ruleId));
+		//如果数组为空,表示该规则不需要位置打卡
+		if (CollUtil.isEmpty(locationList)) {
+			wxAppDataVo.setNeedLocation(false);
+			wxAppDataVo.setIsInPunchLocation(false);
+			return wxAppDataVo;
+		}
+		wxAppDataVo.setNeedLocation(true);
+		for (Location location:locationList) {
+			//计算两点之间的距离
+			double distance = DistanceUtils.getDistance(queryDataDTO.getLongitude(), queryDataDTO.getLatitude(), location.getLongitude(), location.getLatitude());
+			double area = location.getArea();
+			if (area >= distance) {
+				wxAppDataVo.setIsInPunchLocation(true);
+				break;
+			} else {
+				wxAppDataVo.setIsInPunchLocation(false);
+			}
+		}
+		return wxAppDataVo;
+	}
+
+	/**
+	 * 判断是否在指定wifi区域内
+	 * @param queryDataDTO
+	 * @param ruleId
+	 * @return
+	 */
+	private WxAppDataVo getNecessaryWifiData(QueryDataDTO queryDataDTO, long ruleId) {
+		WxAppDataVo wxAppDataVo = new WxAppDataVo();
+		//获取wifi列表
+		List<Wifi> wifiList = wifiService.list(Condition.getQueryWrapper(new Wifi()).lambda().eq(Wifi::getRuleId, ruleId));
+		if (CollUtil.isEmpty(wifiList)) {
+			wxAppDataVo.setNeedWifi(false);
+			wxAppDataVo.setIsInPunchWifi(false);
+			return wxAppDataVo;
+		}
+		wxAppDataVo.setNeedWifi(true);
+		for (Wifi wifi:wifiList) {
+			if (queryDataDTO.getWifiMac().equals(wifi.getMac())) {
+				wxAppDataVo.setIsInPunchWifi(true);
+				break;
+			} else {
+				wxAppDataVo.setIsInPunchWifi(false);
+			}
+		}
+		return wxAppDataVo;
+	}
+}

+ 41 - 0
src/main/java/org/springblade/attence/rule/vo/AttenceRuleVo.java

@@ -0,0 +1,41 @@
+package org.springblade.attence.rule.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.attence.location.entity.Location;
+import org.springblade.attence.ruleout.entity.RuleOut;
+import org.springblade.attence.ruleperson.entity.RulePerson;
+import org.springblade.attence.rulespectime.entity.RuleSpecTime;
+import org.springblade.attence.ruletime.entity.RuleTime;
+import org.springblade.attence.wifi.entity.Wifi;
+
+import java.util.List;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "打卡规则VO对象", description = "打卡规则VO对象")
+public class AttenceRuleVo extends RuleVO {
+
+	@ApiModelProperty("打卡人员")
+	private List<RulePerson> rulePersons;
+
+	@ApiModelProperty("打卡位置")
+	private List<Location> locations;
+
+	@ApiModelProperty("打卡WiFi")
+	private List<Wifi> wifiList;
+
+	@ApiModelProperty("打卡时间")
+	private List<RuleTime> ruleTimes;
+
+	@ApiModelProperty("特殊打卡日期")
+	private List<RuleSpecTime> ruleSpecTimes;
+
+	@ApiModelProperty("外出打卡规则")
+	private RuleOut ruleOut;
+
+	@ApiModelProperty("当天是否是工作日")
+	private Boolean isWork;
+}

+ 36 - 0
src/main/java/org/springblade/attence/rule/vo/RuleVO.java

@@ -0,0 +1,36 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.rule.vo;
+
+import org.springblade.attence.rule.entity.Rule;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 视图实体类
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "RuleVO对象", description = "RuleVO对象")
+public class RuleVO extends Rule {
+	private static final long serialVersionUID = 1L;
+
+}

+ 91 - 0
src/main/java/org/springblade/attence/rule/vo/WxAppDataVo.java

@@ -0,0 +1,91 @@
+package org.springblade.attence.rule.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import org.springblade.attence.record.entity.Record;
+import org.springblade.attence.ruletime.entity.RuleTime;
+
+import java.time.LocalTime;
+import java.util.List;
+
+@Data
+public class WxAppDataVo {
+
+	/**
+	 * 是否完成打卡
+	 */
+	private Boolean isDone;
+	/**
+	 * 是否需要位置打卡
+	 */
+	private Boolean needLocation;
+
+	/**
+	 * 是否在指定位置范围内打卡
+	 */
+	private Boolean isInPunchLocation;
+
+	/**
+	 * 是否需要wifi打卡
+	 */
+	private Boolean needWifi;
+
+	/**
+	 * 是否在指定WiFi考勤区域内
+	 */
+	private Boolean isInPunchWifi;
+
+	/**
+	 * 当天是否是工作日
+	 */
+	private Boolean isWork;
+
+	/**
+	 * 是通过哪个时间规则查询出来的
+	 * 有两种,一个是正常工作日id
+	 * 一个是特殊工作日的id
+	 */
+	private Long ruleTimeId;
+
+	/**
+	 * ruleTimeId是属于哪个时间规则查询出来的
+	 * 是通过正常工作日查询【1】
+	 * 还是通过特殊工作日查询【0】
+	 */
+	private Integer ruleTimeType;
+
+	/**
+	 * 当天的上班时间
+	 */
+	@JsonFormat(pattern = "HH:mm")
+	private LocalTime workTime;
+
+	/**
+	 * 当天的下班时间
+	 */
+	@JsonFormat(pattern = "HH:mm")
+	private LocalTime offWorkTime;
+
+	/**
+	 * 上班打卡记录
+	 */
+	private List<Record> workPunchRecords;
+
+	/**
+	 * 下班打卡记录
+	 */
+	private List<Record> offWorkPunchRecords;
+
+	/**
+	 * 打卡状态
+	 * 0:上班打卡
+	 * 1:下班打卡
+	 */
+	private Integer workStatus;
+
+	/**
+	 * 正常日期的时间规则
+	 */
+	private RuleTime ruleTime;
+
+}

+ 49 - 0
src/main/java/org/springblade/attence/rule/wrapper/RuleWrapper.java

@@ -0,0 +1,49 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.rule.wrapper;
+
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.attence.rule.entity.Rule;
+import org.springblade.attence.rule.vo.RuleVO;
+import java.util.Objects;
+
+/**
+ * 包装类,返回视图层所需的字段
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+public class RuleWrapper extends BaseEntityWrapper<Rule, RuleVO>  {
+
+	public static RuleWrapper build() {
+		return new RuleWrapper();
+ 	}
+
+	@Override
+	public RuleVO entityVO(Rule rule) {
+		RuleVO ruleVO = Objects.requireNonNull(BeanUtil.copy(rule, RuleVO.class));
+
+		//User createUser = UserCache.getUser(rule.getCreateUser());
+		//User updateUser = UserCache.getUser(rule.getUpdateUser());
+		//ruleVO.setCreateUserName(createUser.getName());
+		//ruleVO.setUpdateUserName(updateUser.getName());
+
+		return ruleVO;
+	}
+
+}

+ 129 - 0
src/main/java/org/springblade/attence/ruleout/controller/RuleOutController.java

@@ -0,0 +1,129 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.ruleout.controller;
+
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.RequestParam;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.attence.ruleout.entity.RuleOut;
+import org.springblade.attence.ruleout.vo.RuleOutVO;
+import org.springblade.attence.ruleout.wrapper.RuleOutWrapper;
+import org.springblade.attence.ruleout.service.IRuleOutService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ *  控制器
+ *
+ * @author BladeX
+ * @since 2021-05-08
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("attence/ruleout")
+@Api(value = "", tags = "接口")
+public class RuleOutController extends BladeController {
+
+	private IRuleOutService ruleOutService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入ruleOut")
+	public R<RuleOutVO> detail(RuleOut ruleOut) {
+		RuleOut detail = ruleOutService.getOne(Condition.getQueryWrapper(ruleOut));
+		return R.data(RuleOutWrapper.build().entityVO(detail));
+	}
+
+	/**
+	 * 分页
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入ruleOut")
+	public R<IPage<RuleOutVO>> list(RuleOut ruleOut, Query query) {
+		IPage<RuleOut> pages = ruleOutService.page(Condition.getPage(query), Condition.getQueryWrapper(ruleOut));
+		return R.data(RuleOutWrapper.build().pageVO(pages));
+	}
+
+
+	/**
+	 * 自定义分页
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入ruleOut")
+	public R<IPage<RuleOutVO>> page(RuleOutVO ruleOut, Query query) {
+		IPage<RuleOutVO> pages = ruleOutService.selectRuleOutPage(Condition.getPage(query), ruleOut);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入ruleOut")
+	public R save(@Valid @RequestBody RuleOut ruleOut) {
+		return R.status(ruleOutService.save(ruleOut));
+	}
+
+	/**
+	 * 修改
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入ruleOut")
+	public R update(@Valid @RequestBody RuleOut ruleOut) {
+		return R.status(ruleOutService.updateById(ruleOut));
+	}
+
+	/**
+	 * 新增或修改
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入ruleOut")
+	public R submit(@Valid @RequestBody RuleOut ruleOut) {
+		return R.status(ruleOutService.saveOrUpdate(ruleOut));
+	}
+
+
+	/**
+	 * 删除
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "逻辑删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(ruleOutService.deleteLogic(Func.toLongList(ids)));
+	}
+
+
+}

+ 34 - 0
src/main/java/org/springblade/attence/ruleout/dto/RuleOutDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.ruleout.dto;
+
+import org.springblade.attence.ruleout.entity.RuleOut;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2021-05-08
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class RuleOutDTO extends RuleOut {
+	private static final long serialVersionUID = 1L;
+
+}

+ 73 - 0
src/main/java/org/springblade/attence/ruleout/entity/RuleOut.java

@@ -0,0 +1,73 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.ruleout.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import org.springblade.core.mp.base.BaseEntity;
+import java.time.LocalTime;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 实体类
+ *
+ * @author BladeX
+ * @since 2021-05-08
+ */
+@Data
+@TableName("attence_rule_out")
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "RuleOut对象", description = "RuleOut对象")
+public class RuleOut extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	* 所有者id
+	*/
+		@ApiModelProperty(value = "所有者id")
+		private Long ownerId;
+	/**
+	* 所有者类型: 0-企业
+	*/
+		@ApiModelProperty(value = "所有者类型: 0-企业")
+		private Integer ownerType;
+	/**
+	* 收到前日向自己汇报的人的外出打卡汇总时间
+	*/
+		@ApiModelProperty(value = "收到前日向自己汇报的人的外出打卡汇总时间")
+		private LocalTime reporterTime;
+	/**
+	* 员工打卡时必须拍照 0-不用 1-必须
+	*/
+		@ApiModelProperty(value = "员工打卡时必须拍照 0-不用 1-必须")
+		private Integer needPhone;
+	/**
+	* 员工打卡时必须进行人脸识别验证 0-不用 1-必须
+	*/
+		@ApiModelProperty(value = "员工打卡时必须进行人脸识别验证 0-不用 1-必须")
+		private Integer useFaceDetect;
+	/**
+	* 是否备注时允许上传本地图片 0-不允许 1-允许
+	*/
+		@ApiModelProperty(value = "是否备注时允许上传本地图片 0-不允许 1-允许")
+		private Integer noteCanUseLocalPic;
+
+
+}

+ 42 - 0
src/main/java/org/springblade/attence/ruleout/mapper/RuleOutMapper.java

@@ -0,0 +1,42 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.ruleout.mapper;
+
+import org.springblade.attence.ruleout.entity.RuleOut;
+import org.springblade.attence.ruleout.vo.RuleOutVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ *  Mapper 接口
+ *
+ * @author BladeX
+ * @since 2021-05-08
+ */
+public interface RuleOutMapper extends BaseMapper<RuleOut> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param ruleOut
+	 * @return
+	 */
+	List<RuleOutVO> selectRuleOutPage(IPage page, RuleOutVO ruleOut);
+
+}

+ 28 - 0
src/main/java/org/springblade/attence/ruleout/mapper/RuleOutMapper.xml

@@ -0,0 +1,28 @@
+<?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="org.springblade.attence.ruleout.mapper.RuleOutMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="ruleOutResultMap" type="org.springblade.attence.ruleout.entity.RuleOut">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="owner_id" property="ownerId"/>
+        <result column="owner_type" property="ownerType"/>
+        <result column="reporter_time" property="reporterTime"/>
+        <result column="need_phone" property="needPhone"/>
+        <result column="use_face_detect" property="useFaceDetect"/>
+        <result column="note_can_use_local_pic" property="noteCanUseLocalPic"/>
+    </resultMap>
+
+
+    <select id="selectRuleOutPage" resultMap="ruleOutResultMap">
+        select * from attence_rule_out where is_deleted = 0
+    </select>
+
+</mapper>

+ 41 - 0
src/main/java/org/springblade/attence/ruleout/service/IRuleOutService.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.ruleout.service;
+
+import org.springblade.attence.ruleout.entity.RuleOut;
+import org.springblade.attence.ruleout.vo.RuleOutVO;
+import org.springblade.core.mp.base.BaseService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ *  服务类
+ *
+ * @author BladeX
+ * @since 2021-05-08
+ */
+public interface IRuleOutService extends BaseService<RuleOut> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param ruleOut
+	 * @return
+	 */
+	IPage<RuleOutVO> selectRuleOutPage(IPage<RuleOutVO> page, RuleOutVO ruleOut);
+
+}

+ 41 - 0
src/main/java/org/springblade/attence/ruleout/service/impl/RuleOutServiceImpl.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.ruleout.service.impl;
+
+import org.springblade.attence.ruleout.entity.RuleOut;
+import org.springblade.attence.ruleout.vo.RuleOutVO;
+import org.springblade.attence.ruleout.mapper.RuleOutMapper;
+import org.springblade.attence.ruleout.service.IRuleOutService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ *  服务实现类
+ *
+ * @author BladeX
+ * @since 2021-05-08
+ */
+@Service
+public class RuleOutServiceImpl extends BaseServiceImpl<RuleOutMapper, RuleOut> implements IRuleOutService {
+
+	@Override
+	public IPage<RuleOutVO> selectRuleOutPage(IPage<RuleOutVO> page, RuleOutVO ruleOut) {
+		return page.setRecords(baseMapper.selectRuleOutPage(page, ruleOut));
+	}
+
+}

+ 36 - 0
src/main/java/org/springblade/attence/ruleout/vo/RuleOutVO.java

@@ -0,0 +1,36 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.ruleout.vo;
+
+import org.springblade.attence.ruleout.entity.RuleOut;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 视图实体类
+ *
+ * @author BladeX
+ * @since 2021-05-08
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "RuleOutVO对象", description = "RuleOutVO对象")
+public class RuleOutVO extends RuleOut {
+	private static final long serialVersionUID = 1L;
+
+}

+ 49 - 0
src/main/java/org/springblade/attence/ruleout/wrapper/RuleOutWrapper.java

@@ -0,0 +1,49 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.ruleout.wrapper;
+
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.attence.ruleout.entity.RuleOut;
+import org.springblade.attence.ruleout.vo.RuleOutVO;
+import java.util.Objects;
+
+/**
+ * 包装类,返回视图层所需的字段
+ *
+ * @author BladeX
+ * @since 2021-05-08
+ */
+public class RuleOutWrapper extends BaseEntityWrapper<RuleOut, RuleOutVO>  {
+
+	public static RuleOutWrapper build() {
+		return new RuleOutWrapper();
+ 	}
+
+	@Override
+	public RuleOutVO entityVO(RuleOut ruleOut) {
+		RuleOutVO ruleOutVO = Objects.requireNonNull(BeanUtil.copy(ruleOut, RuleOutVO.class));
+
+		//User createUser = UserCache.getUser(ruleOut.getCreateUser());
+		//User updateUser = UserCache.getUser(ruleOut.getUpdateUser());
+		//ruleOutVO.setCreateUserName(createUser.getName());
+		//ruleOutVO.setUpdateUserName(updateUser.getName());
+
+		return ruleOutVO;
+	}
+
+}

+ 180 - 0
src/main/java/org/springblade/attence/ruleperson/controller/RulePersonController.java

@@ -0,0 +1,180 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.ruleperson.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.attence.rule.controller.RuleController;
+import org.springblade.attence.rule.entity.Rule;
+import org.springblade.attence.rule.service.IRuleService;
+import org.springblade.attence.rule.vo.AttenceRuleVo;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.util.Assert;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.RequestParam;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.attence.ruleperson.entity.RulePerson;
+import org.springblade.attence.ruleperson.vo.RulePersonVO;
+import org.springblade.attence.ruleperson.wrapper.RulePersonWrapper;
+import org.springblade.attence.ruleperson.service.IRulePersonService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ *  控制器
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("attence/ruleperson")
+@Api(value = "打卡规则-打卡人关联", tags = "打卡规则-打卡人关联")
+public class RulePersonController extends BladeController {
+
+	private IRulePersonService rulePersonService;
+	private IRuleService ruleService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入rulePerson")
+	public R<RulePersonVO> detail(RulePerson rulePerson) {
+		RulePerson detail = rulePersonService.getOne(Condition.getQueryWrapper(rulePerson));
+		return R.data(RulePersonWrapper.build().entityVO(detail));
+	}
+
+	/**
+	 * 分页
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入rulePerson")
+	public R<IPage<RulePersonVO>> list(RulePerson rulePerson, Query query) {
+		IPage<RulePerson> pages = rulePersonService.page(Condition.getPage(query), Condition.getQueryWrapper(rulePerson));
+		return R.data(RulePersonWrapper.build().pageVO(pages));
+	}
+
+
+	/**
+	 * 自定义分页
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入rulePerson")
+	public R<IPage<RulePersonVO>> page(RulePersonVO rulePerson, Query query) {
+		IPage<RulePersonVO> pages = rulePersonService.selectRulePersonPage(Condition.getPage(query), rulePerson);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入rulePerson")
+	public R save(@Valid @RequestBody RulePerson rulePerson) {
+		return R.status(rulePersonService.save(rulePerson));
+	}
+
+	/**
+	 * 修改
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入rulePerson")
+	public R update(@Valid @RequestBody RulePerson rulePerson) {
+		return R.status(rulePersonService.updateById(rulePerson));
+	}
+
+	/**
+	 * 新增或修改
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入rulePerson")
+	public R submit(@Valid @RequestBody RulePerson rulePerson) {
+		return R.status(rulePersonService.saveOrUpdate(rulePerson));
+	}
+
+
+	/**
+	 * 删除
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "逻辑删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(rulePersonService.deleteLogic(Func.toLongList(ids)));
+	}
+
+	/**
+	 * 查询全部
+	 */
+	@GetMapping("/listAll")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "查询全部", notes = "传入rulePerson")
+	public R<List<RulePersonVO>> list(RulePerson rulePerson) {
+		List<RulePerson> list = rulePersonService.list(Condition.getQueryWrapper(rulePerson));
+		return R.data(RulePersonWrapper.build().listVO(list));
+	}
+
+	/**
+	 * 查询全部id
+	 */
+	@GetMapping("/listIds")
+	@ApiOperationSupport(order = 9)
+	@ApiOperation(value = "查询全部id", notes = "传入rulePerson")
+	public R<List<Long>> listIds(RulePerson rulePerson) {
+		List<RulePerson> rulePersonList = this.rulePersonService.getBaseMapper().selectList(new QueryWrapper<>(new RulePerson()).lambda()
+			.eq(RulePerson::getRuleId, rulePerson.getRuleId())
+			.eq(RulePerson::getType, rulePerson.getType())
+			.eq(RulePerson::getPersonType, rulePerson.getPersonType()));
+		List<Long> collect = rulePersonList.stream().map(RulePerson::getPersonId).collect(Collectors.toList());
+		return R.data(collect);
+	}
+
+	@GetMapping("/getRule")
+	@ApiOperationSupport(order = 10)
+	@ApiOperation(value = "获取打卡规则", notes = "传入rulePerson")
+	public R<AttenceRuleVo> getRule(RulePerson rulePerson){
+		Assert.isTrue(rulePerson.getPersonId() != null && rulePerson.getPersonType() != null,"personId或personType为空");
+		RulePerson basePerson = this.rulePersonService.getOne(Condition.getQueryWrapper(rulePerson));
+		Assert.notNull(basePerson,"该人员未关联打卡规则");
+		Rule rule = new Rule();
+		rule.setId(basePerson.getRuleId());
+		AttenceRuleVo attenceRuleVo = this.ruleService.getAttenceRuleVo(rule);
+		attenceRuleVo.setRulePersons(Arrays.asList(basePerson));
+		return R.data(attenceRuleVo);
+	}
+}

+ 34 - 0
src/main/java/org/springblade/attence/ruleperson/dto/RulePersonDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.ruleperson.dto;
+
+import org.springblade.attence.ruleperson.entity.RulePerson;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class RulePersonDTO extends RulePerson {
+	private static final long serialVersionUID = 1L;
+
+}

+ 67 - 0
src/main/java/org/springblade/attence/ruleperson/entity/RulePerson.java

@@ -0,0 +1,67 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.ruleperson.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import org.springblade.core.mp.base.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 实体类
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+@Data
+@TableName("attence_rule_person")
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "RulePerson对象", description = "RulePerson对象")
+public class RulePerson extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	* 打卡人id
+	*/
+		@ApiModelProperty(value = "打卡人id")
+		private Long personId;
+	/**
+	* 打卡人id
+	*/
+		@ApiModelProperty(value = "打卡人名称")
+		private String personName;
+	/**
+	* 0-企业员工
+	*/
+		@ApiModelProperty(value = "0-企业员工")
+		private Integer personType;
+	/**
+	* 是否为白名单(即无需参加打卡):0-不是 1-是
+	*/
+		@ApiModelProperty(value = "人员类型:0-打卡人员 1-白名单 2-汇报对象")
+		private Integer type;
+	/**
+	* 关联的打卡规则id
+	*/
+		@ApiModelProperty(value = "关联的打卡规则id")
+		private Long ruleId;
+
+
+}

+ 42 - 0
src/main/java/org/springblade/attence/ruleperson/mapper/RulePersonMapper.java

@@ -0,0 +1,42 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.ruleperson.mapper;
+
+import org.springblade.attence.ruleperson.entity.RulePerson;
+import org.springblade.attence.ruleperson.vo.RulePersonVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ *  Mapper 接口
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+public interface RulePersonMapper extends BaseMapper<RulePerson> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param rulePerson
+	 * @return
+	 */
+	List<RulePersonVO> selectRulePersonPage(IPage page, RulePersonVO rulePerson);
+
+}

+ 27 - 0
src/main/java/org/springblade/attence/ruleperson/mapper/RulePersonMapper.xml

@@ -0,0 +1,27 @@
+<?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="org.springblade.attence.ruleperson.mapper.RulePersonMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="rulePersonResultMap" type="org.springblade.attence.ruleperson.entity.RulePerson">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="person_id" property="personId"/>
+        <result column="person_name" property="personName"/>
+        <result column="person_type" property="personType"/>
+        <result column="is_white" property="isWhite"/>
+        <result column="rule_id" property="ruleId"/>
+    </resultMap>
+
+
+    <select id="selectRulePersonPage" resultMap="rulePersonResultMap">
+        select * from attence_rule_person where is_deleted = 0
+    </select>
+
+</mapper>

+ 44 - 0
src/main/java/org/springblade/attence/ruleperson/service/IRulePersonService.java

@@ -0,0 +1,44 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.ruleperson.service;
+
+import org.springblade.attence.ruleperson.entity.RulePerson;
+import org.springblade.attence.ruleperson.vo.RulePersonVO;
+import org.springblade.core.mp.base.BaseService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.util.List;
+
+/**
+ *  服务类
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+public interface IRulePersonService extends BaseService<RulePerson> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param rulePerson
+	 * @return
+	 */
+	IPage<RulePersonVO> selectRulePersonPage(IPage<RulePersonVO> page, RulePersonVO rulePerson);
+
+	List<Long> listByRuleIds(List<Long> ruleIds);
+}

+ 58 - 0
src/main/java/org/springblade/attence/ruleperson/service/impl/RulePersonServiceImpl.java

@@ -0,0 +1,58 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.ruleperson.service.impl;
+
+import org.springblade.attence.ruleperson.entity.RulePerson;
+import org.springblade.attence.ruleperson.vo.RulePersonVO;
+import org.springblade.attence.ruleperson.mapper.RulePersonMapper;
+import org.springblade.attence.ruleperson.service.IRulePersonService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.mp.support.Condition;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ *  服务实现类
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+@Service
+public class RulePersonServiceImpl extends BaseServiceImpl<RulePersonMapper, RulePerson> implements IRulePersonService {
+
+	@Override
+	public IPage<RulePersonVO> selectRulePersonPage(IPage<RulePersonVO> page, RulePersonVO rulePerson) {
+		return page.setRecords(baseMapper.selectRulePersonPage(page, rulePerson));
+	}
+
+	@Override
+	public List<Long> listByRuleIds(List<Long> ruleIds){
+		if(ruleIds.size() > 0){
+			List<RulePerson> rulePersons = this.list(Condition.getQueryWrapper(new RulePerson()).lambda()
+				.eq(RulePerson::getPersonType,0)
+				.eq(RulePerson::getType,0)
+				.in(RulePerson::getRuleId, ruleIds));
+			return rulePersons.stream().map(RulePerson::getPersonId).collect(Collectors.toList());
+		}else {
+			return new ArrayList<>();
+		}
+	}
+}

+ 36 - 0
src/main/java/org/springblade/attence/ruleperson/vo/RulePersonVO.java

@@ -0,0 +1,36 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.ruleperson.vo;
+
+import org.springblade.attence.ruleperson.entity.RulePerson;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 视图实体类
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "RulePersonVO对象", description = "RulePersonVO对象")
+public class RulePersonVO extends RulePerson {
+	private static final long serialVersionUID = 1L;
+
+}

+ 49 - 0
src/main/java/org/springblade/attence/ruleperson/wrapper/RulePersonWrapper.java

@@ -0,0 +1,49 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.ruleperson.wrapper;
+
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.attence.ruleperson.entity.RulePerson;
+import org.springblade.attence.ruleperson.vo.RulePersonVO;
+import java.util.Objects;
+
+/**
+ * 包装类,返回视图层所需的字段
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+public class RulePersonWrapper extends BaseEntityWrapper<RulePerson, RulePersonVO>  {
+
+	public static RulePersonWrapper build() {
+		return new RulePersonWrapper();
+ 	}
+
+	@Override
+	public RulePersonVO entityVO(RulePerson rulePerson) {
+		RulePersonVO rulePersonVO = Objects.requireNonNull(BeanUtil.copy(rulePerson, RulePersonVO.class));
+
+		//User createUser = UserCache.getUser(rulePerson.getCreateUser());
+		//User updateUser = UserCache.getUser(rulePerson.getUpdateUser());
+		//rulePersonVO.setCreateUserName(createUser.getName());
+		//rulePersonVO.setUpdateUserName(updateUser.getName());
+
+		return rulePersonVO;
+	}
+
+}

+ 143 - 0
src/main/java/org/springblade/attence/rulespectime/controller/RuleSpecTimeController.java

@@ -0,0 +1,143 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.rulespectime.controller;
+
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.attence.ruletime.entity.RuleTime;
+import org.springblade.attence.ruletime.vo.RuleTimeVO;
+import org.springblade.attence.ruletime.wrapper.RuleTimeWrapper;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.RequestParam;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.attence.rulespectime.entity.RuleSpecTime;
+import org.springblade.attence.rulespectime.vo.RuleSpecTimeVO;
+import org.springblade.attence.rulespectime.wrapper.RuleSpecTimeWrapper;
+import org.springblade.attence.rulespectime.service.IRuleSpecTimeService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+import java.util.List;
+
+/**
+ *  控制器
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("attence/rulespectime")
+@Api(value = "打卡规则-特殊时间配置", tags = "打卡规则-特殊时间配置")
+public class RuleSpecTimeController extends BladeController {
+
+	private IRuleSpecTimeService ruleSpecTimeService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入ruleSpecTime")
+	public R<RuleSpecTimeVO> detail(RuleSpecTime ruleSpecTime) {
+		RuleSpecTime detail = ruleSpecTimeService.getOne(Condition.getQueryWrapper(ruleSpecTime));
+		return R.data(RuleSpecTimeWrapper.build().entityVO(detail));
+	}
+
+	/**
+	 * 分页
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入ruleSpecTime")
+	public R<IPage<RuleSpecTimeVO>> list(RuleSpecTime ruleSpecTime, Query query) {
+		IPage<RuleSpecTime> pages = ruleSpecTimeService.page(Condition.getPage(query), Condition.getQueryWrapper(ruleSpecTime));
+		return R.data(RuleSpecTimeWrapper.build().pageVO(pages));
+	}
+
+
+	/**
+	 * 自定义分页
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入ruleSpecTime")
+	public R<IPage<RuleSpecTimeVO>> page(RuleSpecTimeVO ruleSpecTime, Query query) {
+		IPage<RuleSpecTimeVO> pages = ruleSpecTimeService.selectRuleSpecTimePage(Condition.getPage(query), ruleSpecTime);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入ruleSpecTime")
+	public R save(@Valid @RequestBody RuleSpecTime ruleSpecTime) {
+		return R.status(ruleSpecTimeService.save(ruleSpecTime));
+	}
+
+	/**
+	 * 修改
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入ruleSpecTime")
+	public R update(@Valid @RequestBody RuleSpecTime ruleSpecTime) {
+		return R.status(ruleSpecTimeService.updateById(ruleSpecTime));
+	}
+
+	/**
+	 * 新增或修改
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入ruleSpecTime")
+	public R submit(@Valid @RequestBody RuleSpecTime ruleSpecTime) {
+		return R.status(ruleSpecTimeService.saveOrUpdate(ruleSpecTime));
+	}
+
+
+	/**
+	 * 删除
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "逻辑删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(ruleSpecTimeService.deleteLogic(Func.toLongList(ids)));
+	}
+
+	/**
+	 * 查询全部
+	 */
+	@GetMapping("/listAll")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "查询全部", notes = "传入ruleSpecTime")
+	public R<List<RuleSpecTimeVO>> list(RuleSpecTime ruleSpecTime) {
+		List<RuleSpecTime> list = ruleSpecTimeService.list(Condition.getQueryWrapper(ruleSpecTime));
+		return R.data(RuleSpecTimeWrapper.build().listVO(list));
+	}
+}

+ 34 - 0
src/main/java/org/springblade/attence/rulespectime/dto/RuleSpecTimeDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.rulespectime.dto;
+
+import org.springblade.attence.rulespectime.entity.RuleSpecTime;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class RuleSpecTimeDTO extends RuleSpecTime {
+	private static final long serialVersionUID = 1L;
+
+}

+ 81 - 0
src/main/java/org/springblade/attence/rulespectime/entity/RuleSpecTime.java

@@ -0,0 +1,81 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.rulespectime.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springblade.core.mp.base.BaseEntity;
+
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 实体类
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+@Data
+@TableName("attence_rule_spec_time")
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "RuleSpecTime对象", description = "RuleSpecTime对象")
+public class RuleSpecTime extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 特殊日期
+	 */
+	@ApiModelProperty(value = "特殊日期")
+	private LocalDate date;
+	/**
+	 * 是否必须:0-不用打卡  1-必须打卡
+	 */
+	@ApiModelProperty(value = "是否必须:0-不用打卡  1-必须打卡")
+	private Integer isMust;
+	/**
+	 * 事由
+	 */
+	@ApiModelProperty(value = "事由")
+	private String reason;
+	/**
+	 * 必须打卡时的开始打卡时间
+	 */
+	@JsonFormat(pattern = "HH:mm")
+	@ApiModelProperty(value = "必须打卡时的开始打卡时间")
+	private LocalTime beginTime;
+	/**
+	 * 必须打卡时的结束打卡时间
+	 */
+	@JsonFormat(pattern = "HH:mm")
+
+	@ApiModelProperty(value = "必须打卡时的结束打卡时间")
+	private LocalTime endTime;
+	/**
+	 * 关联的打卡规则id
+	 */
+	@ApiModelProperty(value = "关联的打卡规则id")
+	private Long ruleId;
+
+
+}

+ 42 - 0
src/main/java/org/springblade/attence/rulespectime/mapper/RuleSpecTimeMapper.java

@@ -0,0 +1,42 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.rulespectime.mapper;
+
+import org.springblade.attence.rulespectime.entity.RuleSpecTime;
+import org.springblade.attence.rulespectime.vo.RuleSpecTimeVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ *  Mapper 接口
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+public interface RuleSpecTimeMapper extends BaseMapper<RuleSpecTime> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param ruleSpecTime
+	 * @return
+	 */
+	List<RuleSpecTimeVO> selectRuleSpecTimePage(IPage page, RuleSpecTimeVO ruleSpecTime);
+
+}

+ 28 - 0
src/main/java/org/springblade/attence/rulespectime/mapper/RuleSpecTimeMapper.xml

@@ -0,0 +1,28 @@
+<?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="org.springblade.attence.rulespectime.mapper.RuleSpecTimeMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="ruleSpecTimeResultMap" type="org.springblade.attence.rulespectime.entity.RuleSpecTime">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="date" property="date"/>
+        <result column="is_must" property="isMust"/>
+        <result column="reason" property="reason"/>
+        <result column="begin_time" property="beginTime"/>
+        <result column="end_time" property="endTime"/>
+        <result column="rule_id" property="ruleId"/>
+    </resultMap>
+
+
+    <select id="selectRuleSpecTimePage" resultMap="ruleSpecTimeResultMap">
+        select * from attence_rule_spec_time where is_deleted = 0
+    </select>
+
+</mapper>

+ 41 - 0
src/main/java/org/springblade/attence/rulespectime/service/IRuleSpecTimeService.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.rulespectime.service;
+
+import org.springblade.attence.rulespectime.entity.RuleSpecTime;
+import org.springblade.attence.rulespectime.vo.RuleSpecTimeVO;
+import org.springblade.core.mp.base.BaseService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ *  服务类
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+public interface IRuleSpecTimeService extends BaseService<RuleSpecTime> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param ruleSpecTime
+	 * @return
+	 */
+	IPage<RuleSpecTimeVO> selectRuleSpecTimePage(IPage<RuleSpecTimeVO> page, RuleSpecTimeVO ruleSpecTime);
+
+}

+ 41 - 0
src/main/java/org/springblade/attence/rulespectime/service/impl/RuleSpecTimeServiceImpl.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.rulespectime.service.impl;
+
+import org.springblade.attence.rulespectime.entity.RuleSpecTime;
+import org.springblade.attence.rulespectime.vo.RuleSpecTimeVO;
+import org.springblade.attence.rulespectime.mapper.RuleSpecTimeMapper;
+import org.springblade.attence.rulespectime.service.IRuleSpecTimeService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ *  服务实现类
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+@Service
+public class RuleSpecTimeServiceImpl extends BaseServiceImpl<RuleSpecTimeMapper, RuleSpecTime> implements IRuleSpecTimeService {
+
+	@Override
+	public IPage<RuleSpecTimeVO> selectRuleSpecTimePage(IPage<RuleSpecTimeVO> page, RuleSpecTimeVO ruleSpecTime) {
+		return page.setRecords(baseMapper.selectRuleSpecTimePage(page, ruleSpecTime));
+	}
+
+}

+ 36 - 0
src/main/java/org/springblade/attence/rulespectime/vo/RuleSpecTimeVO.java

@@ -0,0 +1,36 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.rulespectime.vo;
+
+import org.springblade.attence.rulespectime.entity.RuleSpecTime;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 视图实体类
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "RuleSpecTimeVO对象", description = "RuleSpecTimeVO对象")
+public class RuleSpecTimeVO extends RuleSpecTime {
+	private static final long serialVersionUID = 1L;
+
+}

+ 49 - 0
src/main/java/org/springblade/attence/rulespectime/wrapper/RuleSpecTimeWrapper.java

@@ -0,0 +1,49 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.rulespectime.wrapper;
+
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.attence.rulespectime.entity.RuleSpecTime;
+import org.springblade.attence.rulespectime.vo.RuleSpecTimeVO;
+import java.util.Objects;
+
+/**
+ * 包装类,返回视图层所需的字段
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+public class RuleSpecTimeWrapper extends BaseEntityWrapper<RuleSpecTime, RuleSpecTimeVO>  {
+
+	public static RuleSpecTimeWrapper build() {
+		return new RuleSpecTimeWrapper();
+ 	}
+
+	@Override
+	public RuleSpecTimeVO entityVO(RuleSpecTime ruleSpecTime) {
+		RuleSpecTimeVO ruleSpecTimeVO = Objects.requireNonNull(BeanUtil.copy(ruleSpecTime, RuleSpecTimeVO.class));
+
+		//User createUser = UserCache.getUser(ruleSpecTime.getCreateUser());
+		//User updateUser = UserCache.getUser(ruleSpecTime.getUpdateUser());
+		//ruleSpecTimeVO.setCreateUserName(createUser.getName());
+		//ruleSpecTimeVO.setUpdateUserName(updateUser.getName());
+
+		return ruleSpecTimeVO;
+	}
+
+}

+ 143 - 0
src/main/java/org/springblade/attence/ruletime/controller/RuleTimeController.java

@@ -0,0 +1,143 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.ruletime.controller;
+
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.attence.wifi.entity.Wifi;
+import org.springblade.attence.wifi.vo.WifiVO;
+import org.springblade.attence.wifi.wrapper.WifiWrapper;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.RequestParam;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.attence.ruletime.entity.RuleTime;
+import org.springblade.attence.ruletime.vo.RuleTimeVO;
+import org.springblade.attence.ruletime.wrapper.RuleTimeWrapper;
+import org.springblade.attence.ruletime.service.IRuleTimeService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+import java.util.List;
+
+/**
+ *  控制器
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("attence/ruletime")
+@Api(value = "打卡规则-打卡时间配置", tags = "打卡规则-打卡时间配置")
+public class RuleTimeController extends BladeController {
+
+	private IRuleTimeService ruleTimeService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入ruleTime")
+	public R<RuleTimeVO> detail(RuleTime ruleTime) {
+		RuleTime detail = ruleTimeService.getOne(Condition.getQueryWrapper(ruleTime));
+		return R.data(RuleTimeWrapper.build().entityVO(detail));
+	}
+
+	/**
+	 * 分页
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入ruleTime")
+	public R<IPage<RuleTimeVO>> list(RuleTime ruleTime, Query query) {
+		IPage<RuleTime> pages = ruleTimeService.page(Condition.getPage(query), Condition.getQueryWrapper(ruleTime));
+		return R.data(RuleTimeWrapper.build().pageVO(pages));
+	}
+
+
+	/**
+	 * 自定义分页
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入ruleTime")
+	public R<IPage<RuleTimeVO>> page(RuleTimeVO ruleTime, Query query) {
+		IPage<RuleTimeVO> pages = ruleTimeService.selectRuleTimePage(Condition.getPage(query), ruleTime);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入ruleTime")
+	public R save(@Valid @RequestBody RuleTime ruleTime) {
+		return R.status(ruleTimeService.save(ruleTime));
+	}
+
+	/**
+	 * 修改
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入ruleTime")
+	public R update(@Valid @RequestBody RuleTime ruleTime) {
+		return R.status(ruleTimeService.updateById(ruleTime));
+	}
+
+	/**
+	 * 新增或修改
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入ruleTime")
+	public R submit(@Valid @RequestBody RuleTime ruleTime) {
+		return R.status(ruleTimeService.saveOrUpdate(ruleTime));
+	}
+
+
+	/**
+	 * 删除
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "逻辑删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(ruleTimeService.deleteLogic(Func.toLongList(ids)));
+	}
+
+	/**
+	 * 查询全部
+	 */
+	@GetMapping("/listAll")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "查询全部", notes = "传入ruleTime")
+	public R<List<RuleTimeVO>> list(RuleTime ruleTime) {
+		List<RuleTime> list = ruleTimeService.list(Condition.getQueryWrapper(ruleTime));
+		return R.data(RuleTimeWrapper.build().listVO(list));
+	}
+}

+ 34 - 0
src/main/java/org/springblade/attence/ruletime/dto/RuleTimeDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.ruletime.dto;
+
+import org.springblade.attence.ruletime.entity.RuleTime;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class RuleTimeDTO extends RuleTime {
+	private static final long serialVersionUID = 1L;
+
+}

+ 112 - 0
src/main/java/org/springblade/attence/ruletime/entity/RuleTime.java

@@ -0,0 +1,112 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.ruletime.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springblade.core.mp.base.BaseEntity;
+
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.springframework.format.annotation.DateTimeFormat;
+
+/**
+ * 实体类
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+@Data
+@TableName("attence_rule_time")
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "RuleTime对象", description = "RuleTime对象")
+public class RuleTime extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 关联的打卡规则id
+	 */
+	@ApiModelProperty(value = "关联的打卡规则id")
+	private Long ruleId;
+	/**
+	 * 工作日。若为固定时间上下班或自由上下班,则1到6分别表示星期一到星期六,0表示星期日
+	 */
+	@ApiModelProperty(value = "工作日。若为固定时间上下班或自由上下班,则1到6分别表示星期一到星期六,0表示星期日")
+	private String workDays;
+	/**
+	 * 上班时间
+	 */
+	@JsonFormat(pattern = "HH:mm")
+	@ApiModelProperty(value = "上班时间")
+	private LocalTime workTime;
+	/**
+	 * 下班时间
+	 */
+	@JsonFormat(pattern = "HH:mm")
+	@ApiModelProperty(value = "下班时间")
+	private LocalTime offWorkTime;
+	/**
+	 * 上班提醒时间
+	 */
+	@ApiModelProperty(value = "上班提醒时间")
+	private Integer remindWorkTime;
+	/**
+	 * 下班提醒时间
+	 */
+	@ApiModelProperty(value = "下班提醒时间")
+	private Integer remindOffWorkTime;
+	/**
+	 * 是否开启休息时间 :0-不开启 1-开启   (休息时间内不计算工作时长)
+	 */
+	@ApiModelProperty(value = "是否开启休息时间 :0-不开启 1-开启   (休息时间内不计算工作时长)")
+	private Integer allowRest;
+	/**
+	 * 休息开始时间
+	 */
+	@JsonFormat(pattern = "HH:mm")
+	@ApiModelProperty(value = "休息开始时间")
+	private LocalTime restBeginTime;
+	/**
+	 * 休息结束时间
+	 */
+	@JsonFormat(pattern = "HH:mm")
+	@ApiModelProperty(value = "休息结束时间")
+	private LocalTime restEndTime;
+	/**
+	 * 是否允许弹性时间  0-否 1-是
+	 */
+	@ApiModelProperty(value = "是否允许弹性时间  0-否 1-是")
+	private Integer allowFlex;
+	/**
+	 * 允许迟到时间
+	 */
+	@ApiModelProperty(value = "允许迟到时间")
+	private Integer flexOnDutyTime;
+	/**
+	 * 允许早退时间
+	 */
+	@ApiModelProperty(value = "允许早退时间")
+	private Integer flexOffDutyTime;
+
+
+}

+ 42 - 0
src/main/java/org/springblade/attence/ruletime/mapper/RuleTimeMapper.java

@@ -0,0 +1,42 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.ruletime.mapper;
+
+import org.springblade.attence.ruletime.entity.RuleTime;
+import org.springblade.attence.ruletime.vo.RuleTimeVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ *  Mapper 接口
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+public interface RuleTimeMapper extends BaseMapper<RuleTime> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param ruleTime
+	 * @return
+	 */
+	List<RuleTimeVO> selectRuleTimePage(IPage page, RuleTimeVO ruleTime);
+
+}

+ 34 - 0
src/main/java/org/springblade/attence/ruletime/mapper/RuleTimeMapper.xml

@@ -0,0 +1,34 @@
+<?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="org.springblade.attence.ruletime.mapper.RuleTimeMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="ruleTimeResultMap" type="org.springblade.attence.ruletime.entity.RuleTime">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="rule_id" property="ruleId"/>
+        <result column="work_days" property="workDays"/>
+        <result column="work_time" property="workTime"/>
+        <result column="off_work_time" property="offWorkTime"/>
+        <result column="remind_work_time" property="remindWorkTime"/>
+        <result column="remind_off_work_time" property="remindOffWorkTime"/>
+        <result column="allow_rest" property="allowRest"/>
+        <result column="rest_begin_time" property="restBeginTime"/>
+        <result column="rest_end_time" property="restEndTime"/>
+        <result column="allow_flex" property="allowFlex"/>
+        <result column="flex_on_duty_time" property="flexOnDutyTime"/>
+        <result column="flex_off_duty_time" property="flexOffDutyTime"/>
+    </resultMap>
+
+
+    <select id="selectRuleTimePage" resultMap="ruleTimeResultMap">
+        select * from attence_rule_time where is_deleted = 0
+    </select>
+
+</mapper>

+ 41 - 0
src/main/java/org/springblade/attence/ruletime/service/IRuleTimeService.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.ruletime.service;
+
+import org.springblade.attence.ruletime.entity.RuleTime;
+import org.springblade.attence.ruletime.vo.RuleTimeVO;
+import org.springblade.core.mp.base.BaseService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ *  服务类
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+public interface IRuleTimeService extends BaseService<RuleTime> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param ruleTime
+	 * @return
+	 */
+	IPage<RuleTimeVO> selectRuleTimePage(IPage<RuleTimeVO> page, RuleTimeVO ruleTime);
+
+}

+ 41 - 0
src/main/java/org/springblade/attence/ruletime/service/impl/RuleTimeServiceImpl.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.ruletime.service.impl;
+
+import org.springblade.attence.ruletime.entity.RuleTime;
+import org.springblade.attence.ruletime.vo.RuleTimeVO;
+import org.springblade.attence.ruletime.mapper.RuleTimeMapper;
+import org.springblade.attence.ruletime.service.IRuleTimeService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ *  服务实现类
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+@Service
+public class RuleTimeServiceImpl extends BaseServiceImpl<RuleTimeMapper, RuleTime> implements IRuleTimeService {
+
+	@Override
+	public IPage<RuleTimeVO> selectRuleTimePage(IPage<RuleTimeVO> page, RuleTimeVO ruleTime) {
+		return page.setRecords(baseMapper.selectRuleTimePage(page, ruleTime));
+	}
+
+}

+ 36 - 0
src/main/java/org/springblade/attence/ruletime/vo/RuleTimeVO.java

@@ -0,0 +1,36 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.ruletime.vo;
+
+import org.springblade.attence.ruletime.entity.RuleTime;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 视图实体类
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "RuleTimeVO对象", description = "RuleTimeVO对象")
+public class RuleTimeVO extends RuleTime {
+	private static final long serialVersionUID = 1L;
+
+}

+ 49 - 0
src/main/java/org/springblade/attence/ruletime/wrapper/RuleTimeWrapper.java

@@ -0,0 +1,49 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.ruletime.wrapper;
+
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.attence.ruletime.entity.RuleTime;
+import org.springblade.attence.ruletime.vo.RuleTimeVO;
+import java.util.Objects;
+
+/**
+ * 包装类,返回视图层所需的字段
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+public class RuleTimeWrapper extends BaseEntityWrapper<RuleTime, RuleTimeVO>  {
+
+	public static RuleTimeWrapper build() {
+		return new RuleTimeWrapper();
+ 	}
+
+	@Override
+	public RuleTimeVO entityVO(RuleTime ruleTime) {
+		RuleTimeVO ruleTimeVO = Objects.requireNonNull(BeanUtil.copy(ruleTime, RuleTimeVO.class));
+
+		//User createUser = UserCache.getUser(ruleTime.getCreateUser());
+		//User updateUser = UserCache.getUser(ruleTime.getUpdateUser());
+		//ruleTimeVO.setCreateUserName(createUser.getName());
+		//ruleTimeVO.setUpdateUserName(updateUser.getName());
+
+		return ruleTimeVO;
+	}
+
+}

+ 140 - 0
src/main/java/org/springblade/attence/ruletype/controller/RuleTypeController.java

@@ -0,0 +1,140 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.ruletype.controller;
+
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.RequestParam;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.attence.ruletype.entity.RuleType;
+import org.springblade.attence.ruletype.vo.RuleTypeVO;
+import org.springblade.attence.ruletype.wrapper.RuleTypeWrapper;
+import org.springblade.attence.ruletype.service.IRuleTypeService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+import java.util.List;
+
+/**
+ *  控制器
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("attence/ruletype")
+@Api(value = "打卡规则类型", tags = "打卡规则类型")
+public class RuleTypeController extends BladeController {
+
+	private IRuleTypeService ruleTypeService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入ruleType")
+	public R<RuleTypeVO> detail(RuleType ruleType) {
+		RuleType detail = ruleTypeService.getOne(Condition.getQueryWrapper(ruleType));
+		return R.data(RuleTypeWrapper.build().entityVO(detail));
+	}
+
+	/**
+	 * 分页
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入ruleType")
+	public R<IPage<RuleTypeVO>> list(RuleType ruleType, Query query) {
+		IPage<RuleType> pages = ruleTypeService.page(Condition.getPage(query), Condition.getQueryWrapper(ruleType));
+		return R.data(RuleTypeWrapper.build().pageVO(pages));
+	}
+
+
+	/**
+	 * 自定义分页
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入ruleType")
+	public R<IPage<RuleTypeVO>> page(RuleTypeVO ruleType, Query query) {
+		IPage<RuleTypeVO> pages = ruleTypeService.selectRuleTypePage(Condition.getPage(query), ruleType);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入ruleType")
+	public R save(@Valid @RequestBody RuleType ruleType) {
+		return R.status(ruleTypeService.save(ruleType));
+	}
+
+	/**
+	 * 修改
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入ruleType")
+	public R update(@Valid @RequestBody RuleType ruleType) {
+		return R.status(ruleTypeService.updateById(ruleType));
+	}
+
+	/**
+	 * 新增或修改
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入ruleType")
+	public R submit(@Valid @RequestBody RuleType ruleType) {
+		return R.status(ruleTypeService.saveOrUpdate(ruleType));
+	}
+
+
+	/**
+	 * 删除
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "逻辑删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(ruleTypeService.deleteLogic(Func.toLongList(ids)));
+	}
+
+	/**
+	 * 查询全部
+	 */
+	@GetMapping("/listAll")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "查询全部", notes = "传入ruleType")
+	public R<List<RuleTypeVO>> listAll(RuleType ruleType) {
+		List<RuleType> list = ruleTypeService.list(Condition.getQueryWrapper(ruleType));
+		return R.data(RuleTypeWrapper.build().listVO(list));
+	}
+}

+ 34 - 0
src/main/java/org/springblade/attence/ruletype/dto/RuleTypeDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.ruletype.dto;
+
+import org.springblade.attence.ruletype.entity.RuleType;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class RuleTypeDTO extends RuleType {
+	private static final long serialVersionUID = 1L;
+
+}

+ 52 - 0
src/main/java/org/springblade/attence/ruletype/entity/RuleType.java

@@ -0,0 +1,52 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.ruletype.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import org.springblade.core.mp.base.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 实体类
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+@Data
+@TableName("attence_rule_type")
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "RuleType对象", description = "RuleType对象")
+public class RuleType extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	* 规则名称
+	*/
+		@ApiModelProperty(value = "规则名称")
+			private String typeName;
+	/**
+	* 规则描述
+	*/
+		@ApiModelProperty(value = "规则描述")
+		private String typeDetail;
+
+
+}

+ 42 - 0
src/main/java/org/springblade/attence/ruletype/mapper/RuleTypeMapper.java

@@ -0,0 +1,42 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.ruletype.mapper;
+
+import org.springblade.attence.ruletype.entity.RuleType;
+import org.springblade.attence.ruletype.vo.RuleTypeVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ *  Mapper 接口
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+public interface RuleTypeMapper extends BaseMapper<RuleType> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param ruleType
+	 * @return
+	 */
+	List<RuleTypeVO> selectRuleTypePage(IPage page, RuleTypeVO ruleType);
+
+}

+ 24 - 0
src/main/java/org/springblade/attence/ruletype/mapper/RuleTypeMapper.xml

@@ -0,0 +1,24 @@
+<?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="org.springblade.attence.ruletype.mapper.RuleTypeMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="ruleTypeResultMap" type="org.springblade.attence.ruletype.entity.RuleType">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="type_name" property="typeName"/>
+        <result column="type_detail" property="typeDetail"/>
+    </resultMap>
+
+
+    <select id="selectRuleTypePage" resultMap="ruleTypeResultMap">
+        select * from attence_rule_type where is_deleted = 0
+    </select>
+
+</mapper>

+ 41 - 0
src/main/java/org/springblade/attence/ruletype/service/IRuleTypeService.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.attence.ruletype.service;
+
+import org.springblade.attence.ruletype.entity.RuleType;
+import org.springblade.attence.ruletype.vo.RuleTypeVO;
+import org.springblade.core.mp.base.BaseService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ *  服务类
+ *
+ * @author BladeX
+ * @since 2021-04-12
+ */
+public interface IRuleTypeService extends BaseService<RuleType> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param ruleType
+	 * @return
+	 */
+	IPage<RuleTypeVO> selectRuleTypePage(IPage<RuleTypeVO> page, RuleTypeVO ruleType);
+
+}

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini