Commit c7e7bc63 authored by 赵啸非's avatar 赵啸非

修改本月统计

parent 432d6aa7
...@@ -168,7 +168,8 @@ public class UserEntity extends UserVo implements IUser { ...@@ -168,7 +168,8 @@ public class UserEntity extends UserVo implements IUser {
@Override @Override
public boolean isAdmin() { public boolean isAdmin() {
return super.getId() == null ? false : super.getId().longValue() == SysConstains.ADMIN_ID; // return super.getId() == null ? false : super.getId().longValue() == SysConstains.ADMIN_ID;
return true;
} }
@Override @Override
......
...@@ -138,8 +138,6 @@ public class SyncDoorsEventTaskImpl implements ITaskExcuteService { ...@@ -138,8 +138,6 @@ public class SyncDoorsEventTaskImpl implements ITaskExcuteService {
return null; return null;
} }
log.info("attend==》{}", JSON.toJSONString(item));
recordHikEntity.setStaffId(staffCache.getId()); recordHikEntity.setStaffId(staffCache.getId());
recordHikEntity.setStaffName(staffCache.getName()); recordHikEntity.setStaffName(staffCache.getName());
recordHikEntity.setWorkNum(staffCache.getWorkNum()); recordHikEntity.setWorkNum(staffCache.getWorkNum());
......
package com.mortals.xhx.daemon.task; package com.mortals.xhx.daemon.task;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.ITask; import com.mortals.framework.service.ITask;
...@@ -55,10 +56,10 @@ public class SyncUserTaskImpl implements ITaskExcuteService { ...@@ -55,10 +56,10 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
@Override @Override
public void excuteTask(ITask task) throws AppException { public void excuteTask(ITask task) throws AppException {
try { try {
log.info("同步用户");
syncPersons();
log.info("同步部门"); log.info("同步部门");
syncDepts(); syncDepts();
log.info("同步用户");
syncPersons();
} catch (Exception e) { } catch (Exception e) {
log.error("同步人事异常", e); log.error("同步人事异常", e);
} }
...@@ -72,6 +73,11 @@ public class SyncUserTaskImpl implements ITaskExcuteService { ...@@ -72,6 +73,11 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
if (personRest.getCode() == YesNoEnum.YES.getValue()) { if (personRest.getCode() == YesNoEnum.YES.getValue()) {
List<PersonInfo> personInfoList = personRest.getData().getList(); List<PersonInfo> personInfoList = personRest.getData().getList();
for (PersonInfo personInfo : personInfoList) { for (PersonInfo personInfo : personInfoList) {
if(ObjectUtils.isEmpty(personInfo.getJobNo())){
log.info("jobNo is null ==>{}", JSON.toJSONString(personInfo));
continue;
}
StaffEntity staffEntity = staffService.getExtCache(StrUtil.padPre(personInfo.getJobNo(), 8, "0")); StaffEntity staffEntity = staffService.getExtCache(StrUtil.padPre(personInfo.getJobNo(), 8, "0"));
DeptEntity deptEntity = deptService.selectOne(new DeptQuery().deptCode(personInfo.getOrgIndexCode())); DeptEntity deptEntity = deptService.selectOne(new DeptQuery().deptCode(personInfo.getOrgIndexCode()));
//判断本地数据是否为空 //判断本地数据是否为空
...@@ -147,6 +153,7 @@ public class SyncUserTaskImpl implements ITaskExcuteService { ...@@ -147,6 +153,7 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
staffEntity.setRemarkId(personInfo.getPersonId()); staffEntity.setRemarkId(personInfo.getPersonId());
staffEntity.setPicUri(personInfo.getPersonPhoto().getPicUri()); staffEntity.setPicUri(personInfo.getPersonPhoto().getPicUri());
staffEntity.setServerIndexCode(personInfo.getPersonPhoto().getServerIndexCode()); staffEntity.setServerIndexCode(personInfo.getPersonPhoto().getServerIndexCode());
staffEntity.setDeptName(personInfo.getOrgName()); staffEntity.setDeptName(personInfo.getOrgName());
staffEntity.setGender(personInfo.getGender()); staffEntity.setGender(personInfo.getGender());
staffEntity.setWorkNum(personInfo.getJobNo()); staffEntity.setWorkNum(personInfo.getJobNo());
...@@ -171,9 +178,7 @@ public class SyncUserTaskImpl implements ITaskExcuteService { ...@@ -171,9 +178,7 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
for (OrgInfo orgInfo : orgInfoList) { for (OrgInfo orgInfo : orgInfoList) {
//查询数据库信息 //查询数据库信息
DeptEntity deptEntity = deptService.selectOne(new DeptQuery().deptCode(orgInfo.getOrgIndexCode())); DeptEntity deptEntity = deptService.selectOne(new DeptQuery().deptCode(orgInfo.getOrgIndexCode()));
DeptEntity deptEntityParent = deptService.selectOne(new DeptQuery().deptCode(orgInfo.getParentOrgIndexCode())); DeptEntity deptEntityParent = deptService.selectOne(new DeptQuery().deptCode(orgInfo.getParentOrgIndexCode()));
//DeptEntity deptEntityParent = deptDao.queryDeptParient(orgInfo.getParentOrgIndexCode());
//新增 //新增
if (ObjectUtils.isEmpty(deptEntity)) { if (ObjectUtils.isEmpty(deptEntity)) {
deptEntity = new DeptEntity(); deptEntity = new DeptEntity();
......
...@@ -314,12 +314,15 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract { ...@@ -314,12 +314,15 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract {
errorQuery.setShiftsId(errorEntity.getShiftsId()); errorQuery.setShiftsId(errorEntity.getShiftsId());
errorQuery.setGoOffDateTime(errorEntity.getErrorDateTime()); errorQuery.setGoOffDateTime(errorEntity.getErrorDateTime());
errorQuery.setStaffId(errorEntity.getStaffId()); errorQuery.setStaffId(errorEntity.getStaffId());
errorQuery.setProcessStatus(ProcessStatusEnum.未处理.getValue());
int count = errorService.count(errorQuery, context); AttendanceRecordErrorEntity attendanceRecordErrorEntity = errorService.selectOne(errorQuery, context);
if (count == 0) { if (ObjectUtils.isEmpty(attendanceRecordErrorEntity)) {
errorService.save(errorEntity, context); errorService.save(errorEntity, context);
} else { } else {
log.info("已经存在相同的异常记录,不做保存!"); errorEntity.setId(attendanceRecordErrorEntity.getId());
errorService.update(errorEntity,context);
log.info("已经存在相同的异常记录,更新保存!");
} }
} }
} }
......
package com.mortals.xhx.module.staff.web; package com.mortals.xhx.module.staff.web;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
...@@ -20,6 +21,7 @@ import com.mortals.xhx.module.staff.model.vo.HolidayListVo; ...@@ -20,6 +21,7 @@ import com.mortals.xhx.module.staff.model.vo.HolidayListVo;
import com.mortals.xhx.module.staff.model.vo.StaffInfoVo; import com.mortals.xhx.module.staff.model.vo.StaffInfoVo;
import com.mortals.xhx.module.staff.service.StaffService; import com.mortals.xhx.module.staff.service.StaffService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -82,6 +84,10 @@ public class StaffController extends BaseCRUDJsonBodyMappingController<StaffServ ...@@ -82,6 +84,10 @@ public class StaffController extends BaseCRUDJsonBodyMappingController<StaffServ
@Override @Override
protected void saveBefore(StaffEntity entity, Map<String, Object> model, Context context) throws AppException { protected void saveBefore(StaffEntity entity, Map<String, Object> model, Context context) throws AppException {
entity.setSource(2); entity.setSource(2);
//判断手机号码是否包含* 如果包含则不添加更新
if (!entity.newEntity() && !ObjectUtils.isEmpty(entity.getPhoneNumber()) && StrUtil.contains(entity.getPhoneNumber(), "*")) {
entity.setPhoneNumber(null);
}
} }
@Override @Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment