|
@@ -16,17 +16,19 @@ import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageInfo;
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
+import com.xxl.job.core.enums.NoEn;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.jeecg.common.util.DateUtils;
|
|
import org.jeecg.common.util.DateUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
-import java.util.Date;
|
|
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
+import static org.jeecg.common.constant.GeneralConstant.*;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 审批信息
|
|
* 审批信息
|
|
*
|
|
*
|
|
@@ -157,7 +159,7 @@ public class WechatNoListServiceImpl extends ServiceImpl<WechatNoListMapper, Wec
|
|
if (!Check.isNull(parameterMap.get("newEnd"))) {
|
|
if (!Check.isNull(parameterMap.get("newEnd"))) {
|
|
noEntity.setNewEnd(DateUtils.stampToTime(Long.valueOf(parameterMap.get("newEnd"))));
|
|
noEntity.setNewEnd(DateUtils.stampToTime(Long.valueOf(parameterMap.get("newEnd"))));
|
|
}
|
|
}
|
|
- noEntity.setType(parameterMap.get("type"));
|
|
|
|
|
|
+ noEntity.setType(parameterMap.get(TYPE));
|
|
noEntity.setNewDuration(parameterMap.get("newDuration"));
|
|
noEntity.setNewDuration(parameterMap.get("newDuration"));
|
|
wechatNoListMapper.insert(noEntity);
|
|
wechatNoListMapper.insert(noEntity);
|
|
}
|
|
}
|
|
@@ -167,7 +169,7 @@ public class WechatNoListServiceImpl extends ServiceImpl<WechatNoListMapper, Wec
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
returnMap.put("code", -1);
|
|
returnMap.put("code", -1);
|
|
returnMap.put("message", "系统错误");
|
|
returnMap.put("message", "系统错误");
|
|
- log.error("审批", e);
|
|
|
|
|
|
+ log.error("审批异常", e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -192,18 +194,18 @@ public class WechatNoListServiceImpl extends ServiceImpl<WechatNoListMapper, Wec
|
|
control = contentEntity.getString("control");
|
|
control = contentEntity.getString("control");
|
|
//如果补卡组件为PunchCorrection,直接判断为补卡
|
|
//如果补卡组件为PunchCorrection,直接判断为补卡
|
|
if (SpNoEnum.control3.getCode().equals(control)) {
|
|
if (SpNoEnum.control3.getCode().equals(control)) {
|
|
- JSONObject value = contentEntity.getJSONObject("value");
|
|
|
|
|
|
+ JSONObject value = contentEntity.getJSONObject(VALUE);
|
|
if (!Check.isNull(value)) {
|
|
if (!Check.isNull(value)) {
|
|
JSONObject punch = value.getJSONObject("punch_correction");
|
|
JSONObject punch = value.getJSONObject("punch_correction");
|
|
if (!Check.isNull(punch)) {
|
|
if (!Check.isNull(punch)) {
|
|
- parameterMap.put("type", SpNoEnum.type2.getName());
|
|
|
|
|
|
+ parameterMap.put(TYPE, SpNoEnum.type2.getName());
|
|
parameterMap.put("newBegin", punch.getString("time"));
|
|
parameterMap.put("newBegin", punch.getString("time"));
|
|
parameterMap.put("newEnd", punch.getString("time"));
|
|
parameterMap.put("newEnd", punch.getString("time"));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//假勤组件-请假组件 Vacation
|
|
//假勤组件-请假组件 Vacation
|
|
} else if (SpNoEnum.control2.getCode().equals(control)) {
|
|
} else if (SpNoEnum.control2.getCode().equals(control)) {
|
|
- JSONObject value = contentEntity.getJSONObject("value");
|
|
|
|
|
|
+ JSONObject value = contentEntity.getJSONObject(VALUE);
|
|
if (!Check.isNull(value)) {
|
|
if (!Check.isNull(value)) {
|
|
JSONObject vacation = value.getJSONObject("vacation");
|
|
JSONObject vacation = value.getJSONObject("vacation");
|
|
if (!Check.isNull(vacation)) {
|
|
if (!Check.isNull(vacation)) {
|
|
@@ -219,7 +221,7 @@ public class WechatNoListServiceImpl extends ServiceImpl<WechatNoListMapper, Wec
|
|
}
|
|
}
|
|
//假勤组件-出差/外出/加班组件Attendance
|
|
//假勤组件-出差/外出/加班组件Attendance
|
|
} else if (SpNoEnum.control1.getCode().equals(control)) {
|
|
} else if (SpNoEnum.control1.getCode().equals(control)) {
|
|
- JSONObject value = contentEntity.getJSONObject("value");
|
|
|
|
|
|
+ JSONObject value = contentEntity.getJSONObject(VALUE);
|
|
if (!Check.isNull(value)) {
|
|
if (!Check.isNull(value)) {
|
|
JSONObject attendance = value.getJSONObject("attendance");
|
|
JSONObject attendance = value.getJSONObject("attendance");
|
|
if (!Check.isNull(attendance)) {
|
|
if (!Check.isNull(attendance)) {
|
|
@@ -242,9 +244,10 @@ public class WechatNoListServiceImpl extends ServiceImpl<WechatNoListMapper, Wec
|
|
* @Param [attendance, parameterMap]
|
|
* @Param [attendance, parameterMap]
|
|
*/
|
|
*/
|
|
private void getTimeData(JSONObject attendance, Map<String, String> parameterMap) {
|
|
private void getTimeData(JSONObject attendance, Map<String, String> parameterMap) {
|
|
- String type = attendance.getString("type");
|
|
|
|
- if (!"1".equals(type)) {
|
|
|
|
- parameterMap.put("type", SpNoEnum.getSpNoEnum(type).getName());
|
|
|
|
|
|
+ String type = attendance.getString(TYPE);
|
|
|
|
+ //假勤类型,排除类型为1的请假,因为有具体的请假类型,例如:年假,事假等具体类型
|
|
|
|
+ if (!NoEn.NO1.valueStr().equals(type)) {
|
|
|
|
+ parameterMap.put(TYPE, SpNoEnum.getSpNoEnum(type).getName());
|
|
}
|
|
}
|
|
JSONObject dateRange = attendance.getJSONObject("date_range");
|
|
JSONObject dateRange = attendance.getJSONObject("date_range");
|
|
if (!Check.isNull(dateRange)) {
|
|
if (!Check.isNull(dateRange)) {
|
|
@@ -252,6 +255,7 @@ public class WechatNoListServiceImpl extends ServiceImpl<WechatNoListMapper, Wec
|
|
parameterMap.put("newEnd", dateRange.getString("new_end"));
|
|
parameterMap.put("newEnd", dateRange.getString("new_end"));
|
|
BigDecimal duration = dateRange.getBigDecimal("new_duration");
|
|
BigDecimal duration = dateRange.getBigDecimal("new_duration");
|
|
if (!Check.isNull(duration)) {
|
|
if (!Check.isNull(duration)) {
|
|
|
|
+ //除以3600,取小时数
|
|
BigDecimal second = new BigDecimal(3600);
|
|
BigDecimal second = new BigDecimal(3600);
|
|
parameterMap.put("newDuration", String.valueOf(duration.divide(second, 1, 4)));
|
|
parameterMap.put("newDuration", String.valueOf(duration.divide(second, 1, 4)));
|
|
}
|
|
}
|
|
@@ -271,11 +275,11 @@ public class WechatNoListServiceImpl extends ServiceImpl<WechatNoListMapper, Wec
|
|
if (!Check.isNull(options)) {
|
|
if (!Check.isNull(options)) {
|
|
for (int j = 0; j < options.size(); j++) {
|
|
for (int j = 0; j < options.size(); j++) {
|
|
JSONObject option = options.getJSONObject(j);
|
|
JSONObject option = options.getJSONObject(j);
|
|
- JSONArray values = option.getJSONArray("value");
|
|
|
|
|
|
+ JSONArray values = option.getJSONArray(VALUE);
|
|
if (!Check.isNull(values)) {
|
|
if (!Check.isNull(values)) {
|
|
for (int k = 0; k < values.size(); k++) {
|
|
for (int k = 0; k < values.size(); k++) {
|
|
JSONObject val = values.getJSONObject(k);
|
|
JSONObject val = values.getJSONObject(k);
|
|
- parameterMap.put("type", val.getString("text"));
|
|
|
|
|
|
+ parameterMap.put(TYPE, val.getString("text"));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -301,15 +305,15 @@ public class WechatNoListServiceImpl extends ServiceImpl<WechatNoListMapper, Wec
|
|
* @author ZHAOXA
|
|
* @author ZHAOXA
|
|
*/
|
|
*/
|
|
private void finishingTime(Map<String, Object> paramsMap) {
|
|
private void finishingTime(Map<String, Object> paramsMap) {
|
|
- String startTime = (String) paramsMap.get("startTime");
|
|
|
|
|
|
+ String startTime = (String) paramsMap.get(START_TIME);
|
|
if (!Check.isNull(startTime)) {
|
|
if (!Check.isNull(startTime)) {
|
|
- startTime += " 00:00:00";
|
|
|
|
- paramsMap.put("startTime", startTime);
|
|
|
|
|
|
+ startTime += DAY_BEGIN;
|
|
|
|
+ paramsMap.put(START_TIME, startTime);
|
|
}
|
|
}
|
|
- String stopTime = (String) paramsMap.get("stopTime");
|
|
|
|
|
|
+ String stopTime = (String) paramsMap.get(STOP_TIME);
|
|
if (!Check.isNull(stopTime)) {
|
|
if (!Check.isNull(stopTime)) {
|
|
- stopTime += " 23:59:59";
|
|
|
|
- paramsMap.put("stopTime", stopTime);
|
|
|
|
|
|
+ stopTime += DAY_END;
|
|
|
|
+ paramsMap.put(STOP_TIME, stopTime);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -322,13 +326,13 @@ public class WechatNoListServiceImpl extends ServiceImpl<WechatNoListMapper, Wec
|
|
@Override
|
|
@Override
|
|
public PageInfo<WechatAttendance> selectNoListPage(Map<String, Object> paramsMap) {
|
|
public PageInfo<WechatAttendance> selectNoListPage(Map<String, Object> paramsMap) {
|
|
finishingTime(paramsMap);
|
|
finishingTime(paramsMap);
|
|
- Integer pageNo = (Integer) paramsMap.get("pageNo");
|
|
|
|
|
|
+ Integer pageNo = (Integer) paramsMap.get(PAGE_NO);
|
|
if (null == pageNo || pageNo == 0) {
|
|
if (null == pageNo || pageNo == 0) {
|
|
- pageNo = 1;
|
|
|
|
|
|
+ pageNo = NoEn.NO1.valueInt();
|
|
}
|
|
}
|
|
- Integer pageSize = (Integer) paramsMap.get("pageSize");
|
|
|
|
|
|
+ Integer pageSize = (Integer) paramsMap.get(PAGE_SIZE);
|
|
if (null == pageSize || pageSize == 0) {
|
|
if (null == pageSize || pageSize == 0) {
|
|
- pageSize = 10;
|
|
|
|
|
|
+ pageSize = NoEn.NO10.valueInt();
|
|
}
|
|
}
|
|
PageHelper.startPage(pageNo, pageSize);
|
|
PageHelper.startPage(pageNo, pageSize);
|
|
List<WechatAttendance> list = wechatNoListMapper.queryAttendanceData(paramsMap);
|
|
List<WechatAttendance> list = wechatNoListMapper.queryAttendanceData(paramsMap);
|