1
This commit is contained in:
parent
31f481a78b
commit
99640b1edc
@ -602,7 +602,6 @@ public class RzAttendanceServiceImpl extends ServiceImpl<RzAttendanceMapper, RzA
|
||||
Long hours = (userCheckTime - attendance.getWorkStartTime().getTime())/1000/60/60;
|
||||
new BigDecimal(hours).subtract(new BigDecimal(dingsShift.getWorkHour())).subtract(BigDecimal.valueOf(1)).subtract(new BigDecimal(String.valueOf(DataUtils.findDefaultValue(dingsShift.getDeductionHour(), 0))));
|
||||
}
|
||||
|
||||
}else{
|
||||
log.info("未找到相关考勤班次数据, 疑似加班打卡=====>>>>> {}", result);
|
||||
}
|
||||
|
||||
@ -77,7 +77,6 @@ public class CallbackController extends BaseController {
|
||||
log.info("发生了:" + eventType + "事件");
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
// 添加其他已注册的
|
||||
log.info("发生了:" + eventType + "事件");
|
||||
|
||||
@ -85,6 +85,35 @@ public class TestController {
|
||||
return AjaxResult.success(DingUtils.getUserIdByPhoto(phone));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/buildUser")
|
||||
public AjaxResult buildUser() throws ParseException {
|
||||
List<SysStaff> staffList = sysStaffService.list(new LambdaQueryWrapper<SysStaff>().ne(SysStaff::getStatus, -1).isNull(SysStaff::getDingUserId));
|
||||
List<String> notDingDing = Collections.emptyList();
|
||||
if(Collections.isNotEmpty(staffList)){
|
||||
staffList.stream().forEach(data ->{
|
||||
String result = DingUtils.getUserIdByPhoto(data.getPhone());
|
||||
JSONObject resObject = JSON.parseObject(result);
|
||||
if(Integer.valueOf(0).equals(resObject.getInteger("errcode"))){
|
||||
JSONObject dingRes = resObject.getJSONObject("result");
|
||||
String userId = dingRes.getString("userid");
|
||||
data.setDingUserId(userId);
|
||||
}else{
|
||||
notDingDing.add(data.getName());
|
||||
}
|
||||
});
|
||||
}
|
||||
sysStaffService.updateBatchById(staffList);
|
||||
if(Collections.isNotEmpty(notDingDing)){
|
||||
return AjaxResult.success("部分更新失败, 未找到钉钉数据, 人员名单如下: "+ String.join(",", notDingDing));
|
||||
}
|
||||
return AjaxResult.success("更新完成");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 清洗加班
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user