|
@@ -4,6 +4,7 @@ import com.ruoyi.common.core.controller.BaseController;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
import com.ruoyi.common.core.domain.entity.SysDictData;
|
|
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
+import com.ruoyi.common.utils.StringUtils;
|
|
|
import com.ruoyi.system.domain.KaoqinConfig;
|
|
|
import com.ruoyi.system.domain.KaoqinRecord;
|
|
|
import com.ruoyi.system.domain.PlatPunch;
|
|
@@ -11,10 +12,7 @@ import com.ruoyi.system.service.IKaoqinConfigService;
|
|
|
import com.ruoyi.system.service.IKaoqinRecordService;
|
|
|
import com.ruoyi.system.service.ISysDictDataService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -93,13 +91,11 @@ public class KaoQinController extends BaseController {
|
|
|
List<SysDictData> sysDictData = dictDataService.selectDictDataList(dictData);
|
|
|
Map<String, Long> map = new HashMap();
|
|
|
for (SysDictData sysDictDatum : sysDictData) {
|
|
|
- //获取异常名称
|
|
|
- String dictLabel = sysDictDatum.getDictLabel();
|
|
|
//获取异常的值
|
|
|
String dictValue = sysDictDatum.getDictValue();
|
|
|
if (!"1".equals(dictValue)) {
|
|
|
Long aLong = 0L;
|
|
|
- map.put(dictLabel, aLong);
|
|
|
+ map.put(dictValue, aLong);
|
|
|
}
|
|
|
}
|
|
|
for (KaoqinRecord kaoQinRecord : kaoQinRecords) {
|
|
@@ -107,19 +103,19 @@ public class KaoQinController extends BaseController {
|
|
|
String kaTypeAmOut = kaoQinRecord.getKaTypeAmOut();
|
|
|
String kaTypePmIn = kaoQinRecord.getKaTypePmIn();
|
|
|
String kaTypePmOut = kaoQinRecord.getKaTypePmOut();
|
|
|
- if (!"1".equals(kaTypeAmIn)) {
|
|
|
+ if (!"1".equals(kaTypeAmIn) && StringUtils.isNotBlank(kaTypeAmIn)) {
|
|
|
Long aLong = map.get(kaTypeAmIn);
|
|
|
map.put(kaTypeAmIn, aLong + 1);
|
|
|
count = count + 1;
|
|
|
- } if (!"1".equals(kaTypeAmOut)) {
|
|
|
+ } if (!"1".equals(kaTypeAmOut) && StringUtils.isNotBlank(kaTypeAmOut)) {
|
|
|
Long aLong = map.get(kaTypeAmOut);
|
|
|
map.put(kaTypeAmOut, aLong + 1);
|
|
|
count = count + 1;
|
|
|
- } if (!"1".equals(kaTypePmIn)) {
|
|
|
+ } if (!"1".equals(kaTypePmIn) && StringUtils.isNotBlank(kaTypePmIn)) {
|
|
|
Long aLong = map.get(kaTypePmIn);
|
|
|
map.put(kaTypePmIn, aLong + 1);
|
|
|
count = count + 1;
|
|
|
- } if (!"1".equals(kaTypePmOut)) {
|
|
|
+ } if (!"1".equals(kaTypePmOut) && StringUtils.isNotBlank(kaTypePmOut)) {
|
|
|
Long aLong = map.get(kaTypePmOut);
|
|
|
map.put(kaTypePmOut, aLong + 1);
|
|
|
count = count + 1;
|
|
@@ -151,19 +147,19 @@ public class KaoQinController extends BaseController {
|
|
|
String kaTypeAmOut = record.getKaTypeAmOut();
|
|
|
String kaTypePmIn = record.getKaTypePmIn();
|
|
|
String kaTypePmOut = record.getKaTypePmOut();
|
|
|
- if (!"1".equals(kaTypeAmIn)) {
|
|
|
+ if (!"1".equals(kaTypeAmIn) && StringUtils.isNotBlank(kaTypeAmIn)) {
|
|
|
abnormal = kaTypeAmIn + ",";
|
|
|
flag = false;
|
|
|
}
|
|
|
- if (!"1".equals(kaTypeAmOut)) {
|
|
|
+ if (!"1".equals(kaTypeAmOut) && StringUtils.isNotBlank(kaTypeAmOut)) {
|
|
|
abnormal = kaTypeAmOut + ",";
|
|
|
flag = false;
|
|
|
}
|
|
|
- if (!"1".equals(kaTypePmIn)) {
|
|
|
+ if (!"1".equals(kaTypePmIn) && StringUtils.isNotBlank(kaTypePmIn)) {
|
|
|
abnormal = kaTypePmIn + ",";
|
|
|
flag = false;
|
|
|
}
|
|
|
- if (!"1".equals(kaTypePmOut)) {
|
|
|
+ if (!"1".equals(kaTypePmOut) && StringUtils.isNotBlank(kaTypePmOut)) {
|
|
|
abnormal = kaTypePmOut + ",";
|
|
|
flag = false;
|
|
|
}
|
|
@@ -193,10 +189,10 @@ public class KaoQinController extends BaseController {
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("/clockRecord")
|
|
|
- public AjaxResult clockRecord(KaoqinRecord kaoqinRecord) {
|
|
|
+ public AjaxResult clockRecord(@RequestBody KaoqinRecord kaoqinRecord) {
|
|
|
//定义返回值
|
|
|
List list = new ArrayList();
|
|
|
- //根据部门祖籍列表查询考勤数据
|
|
|
+ //根据部门id查询考勤数据
|
|
|
List<KaoqinRecord> kaoqinRecords = kaoqinRecordService.selectKaoqinRecordList(kaoqinRecord);
|
|
|
if (kaoqinRecords != null) {
|
|
|
//根据userId进行分组
|
|
@@ -234,22 +230,22 @@ public class KaoQinController extends BaseController {
|
|
|
String kaTypeAmOut = kaoQinRecord.getKaTypeAmOut();
|
|
|
String kaTypePmIn = kaoQinRecord.getKaTypePmIn();
|
|
|
String kaTypePmOut = kaoQinRecord.getKaTypePmOut();
|
|
|
- if (!"1".equals(kaTypeAmIn)) {
|
|
|
+ if (!"1".equals(kaTypeAmIn) && StringUtils.isNotBlank(kaTypeAmIn)) {
|
|
|
//获取异常的名称
|
|
|
String dictLabel = map.get(kaTypeAmIn);
|
|
|
Integer num = (Integer) userMap.get(dictLabel);
|
|
|
userMap.put(dictLabel, num + 1);
|
|
|
- } if (!"1".equals(kaTypeAmOut)) {
|
|
|
+ } if (!"1".equals(kaTypeAmOut) && StringUtils.isNotBlank(kaTypeAmOut)) {
|
|
|
String dictLabel = map.get(kaTypeAmOut);
|
|
|
//获取异常的名称
|
|
|
Integer num = (Integer) userMap.get(dictLabel);
|
|
|
userMap.put(dictLabel, num + 1);
|
|
|
- } if (!"1".equals(kaTypePmIn)) {
|
|
|
+ } if (!"1".equals(kaTypePmIn) && StringUtils.isNotBlank(kaTypePmIn)) {
|
|
|
String dictLabel = map.get(kaTypePmIn);
|
|
|
//获取异常的名称
|
|
|
Integer num = (Integer) userMap.get(dictLabel);
|
|
|
userMap.put(dictLabel, num + 1);
|
|
|
- } if (!"1".equals(kaTypePmOut)) {
|
|
|
+ } if (!"1".equals(kaTypePmOut) && StringUtils.isNotBlank(kaTypePmOut)) {
|
|
|
String dictLabel = map.get(kaTypePmOut);
|
|
|
//获取异常的名称
|
|
|
Integer num = (Integer) userMap.get(dictLabel);
|