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

修改本月统计

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