Commit 09d99ea8 authored by 赵啸非's avatar 赵啸非

考勤异常添加绩效考核

parent d40edea2
...@@ -90,9 +90,9 @@ public class AuthTokenServiceImpl implements IAuthTokenService { ...@@ -90,9 +90,9 @@ public class AuthTokenServiceImpl implements IAuthTokenService {
Claims claims = parseToken(token); Claims claims = parseToken(token);
String uuid = (String) claims.get(SysConstains.LOGIN_USER_KEY); String uuid = (String) claims.get(SysConstains.LOGIN_USER_KEY);
String userKey = getTokenKey(uuid); String userKey = getTokenKey(uuid);
//cacheService.select(portalDb); cacheService.select(portalDb);
String userStr = cacheService.get(userKey); String userStr = cacheService.get(userKey);
//cacheService.select(db); cacheService.select(db);
if (StringUtils.isNotEmpty(userStr)) { if (StringUtils.isNotEmpty(userStr)) {
UserEntity userEntity = JSONObject.parseObject(userStr, UserEntity.class); UserEntity userEntity = JSONObject.parseObject(userStr, UserEntity.class);
userEntity.setToken(token); userEntity.setToken(token);
......
...@@ -25,6 +25,8 @@ import com.mortals.xhx.common.code.GoWorkResultEnum; ...@@ -25,6 +25,8 @@ import com.mortals.xhx.common.code.GoWorkResultEnum;
import com.mortals.xhx.common.code.OffWorkResultEnum; import com.mortals.xhx.common.code.OffWorkResultEnum;
import com.mortals.xhx.common.key.RedisKey; import com.mortals.xhx.common.key.RedisKey;
import com.mortals.xhx.common.pdu.HomeStatInfo; import com.mortals.xhx.common.pdu.HomeStatInfo;
import com.mortals.xhx.common.pdu.user.UserPdu;
import com.mortals.xhx.feign.user.IUserFeign;
import com.mortals.xhx.module.attendance.model.AttendanceRecordEntity; import com.mortals.xhx.module.attendance.model.AttendanceRecordEntity;
import com.mortals.xhx.module.attendance.model.AttendanceRecordQuery; import com.mortals.xhx.module.attendance.model.AttendanceRecordQuery;
import com.mortals.xhx.module.attendance.model.AttendanceVacationBalanceQuery; import com.mortals.xhx.module.attendance.model.AttendanceVacationBalanceQuery;
...@@ -80,10 +82,25 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi ...@@ -80,10 +82,25 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
@Autowired @Autowired
private DeptService deptService; private DeptService deptService;
@Autowired
private IUserFeign userFeign;
@RequestMapping("login") @RequestMapping("login")
public String login(@RequestBody LoginForm loginForm) throws Exception { public String login(@RequestBody LoginForm loginForm) throws Exception {
String loginName = loginForm.getLoginName();
String password = loginForm.getPassword();
UserPdu userPdu = new UserPdu();
userPdu.setLoginName(loginName);
userPdu.setPassword(password);
String resp = userFeign.portalLogin(userPdu);
return resp;
/*
JSONObject ret = new JSONObject(); JSONObject ret = new JSONObject();
String loginName = loginForm.getLoginName(); String loginName = loginForm.getLoginName();
String password = loginForm.getPassword(); String password = loginForm.getPassword();
...@@ -137,7 +154,7 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi ...@@ -137,7 +154,7 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE); ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e)); ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString(); return ret.toJSONString();
} }*/
} }
@RequestMapping("logout") @RequestMapping("logout")
......
...@@ -83,11 +83,6 @@ public class AttendanceRecordErrorServiceImpl extends AbstractCRUDServiceImpl<At ...@@ -83,11 +83,6 @@ public class AttendanceRecordErrorServiceImpl extends AbstractCRUDServiceImpl<At
//判断后打绩效 //判断后打绩效
String ruleCode = ""; String ruleCode = "";
if (ErrorStatusEnum.早退.getValue() == DataUtil.converStr2Int(entity.getProcessResult(), 3)) { if (ErrorStatusEnum.早退.getValue() == DataUtil.converStr2Int(entity.getProcessResult(), 3)) {
if (ObjectUtils.isEmpty(entity.getErrorDateTime()) || ObjectUtils.isEmpty(entity.getGoOffDateTime())) {
//早退5分钟内
ruleCode = "ATTEND1002";
}
if (!ObjectUtils.isEmpty(entity.getErrorDateTime()) && !ObjectUtils.isEmpty(entity.getGoOffDateTime())) { if (!ObjectUtils.isEmpty(entity.getErrorDateTime()) && !ObjectUtils.isEmpty(entity.getGoOffDateTime())) {
//判断时间差定义 //判断时间差定义
Long earlyMin = DateUtil.between(entity.getErrorDateTime(), entity.getGoOffDateTime(), DateUnit.MINUTE); Long earlyMin = DateUtil.between(entity.getErrorDateTime(), entity.getGoOffDateTime(), DateUnit.MINUTE);
...@@ -104,12 +99,11 @@ public class AttendanceRecordErrorServiceImpl extends AbstractCRUDServiceImpl<At ...@@ -104,12 +99,11 @@ public class AttendanceRecordErrorServiceImpl extends AbstractCRUDServiceImpl<At
//早退5分钟内 //早退5分钟内
ruleCode = "ATTEND1006"; ruleCode = "ATTEND1006";
} }
}else {
ruleCode = "ATTEND1002";
} }
} else if (ErrorStatusEnum.迟到.getValue() == DataUtil.converStr2Int(entity.getProcessResult(), 3)) { } else if (ErrorStatusEnum.迟到.getValue() == DataUtil.converStr2Int(entity.getProcessResult(), 3)) {
if (ObjectUtils.isEmpty(entity.getErrorDateTime()) || ObjectUtils.isEmpty(entity.getGoOffDateTime())) {
//早退5分钟内
ruleCode = "ATTEND1001";
}
if (!ObjectUtils.isEmpty(entity.getErrorDateTime()) && !ObjectUtils.isEmpty(entity.getGoOffDateTime())) { if (!ObjectUtils.isEmpty(entity.getErrorDateTime()) && !ObjectUtils.isEmpty(entity.getGoOffDateTime())) {
Long lateMin = DateUtil.between(entity.getErrorDateTime(), entity.getGoOffDateTime(), DateUnit.MINUTE); Long lateMin = DateUtil.between(entity.getErrorDateTime(), entity.getGoOffDateTime(), DateUnit.MINUTE);
...@@ -125,6 +119,9 @@ public class AttendanceRecordErrorServiceImpl extends AbstractCRUDServiceImpl<At ...@@ -125,6 +119,9 @@ public class AttendanceRecordErrorServiceImpl extends AbstractCRUDServiceImpl<At
//迟到60分钟以上 //迟到60分钟以上
ruleCode = "ATTEND1005"; ruleCode = "ATTEND1005";
} }
}else{
//早退5分钟内
ruleCode = "ATTEND1001";
} }
} else if (ErrorStatusEnum.缺卡.getValue() == DataUtil.converStr2Int(entity.getProcessResult(), 3)) { } else if (ErrorStatusEnum.缺卡.getValue() == DataUtil.converStr2Int(entity.getProcessResult(), 3)) {
ruleCode = "ATTEND1007"; ruleCode = "ATTEND1007";
...@@ -139,7 +136,7 @@ public class AttendanceRecordErrorServiceImpl extends AbstractCRUDServiceImpl<At ...@@ -139,7 +136,7 @@ public class AttendanceRecordErrorServiceImpl extends AbstractCRUDServiceImpl<At
attendSaveReq.setActualAttendTime(entity.getActualAttendanceDateTime()); attendSaveReq.setActualAttendTime(entity.getActualAttendanceDateTime());
attendSaveReq.setErrorResult(entity.getRemark()); attendSaveReq.setErrorResult(entity.getRemark());
// attendSaveReq.setTitle("考勤:" + ErrorStatusEnum.getByValue(entity.getErrorStatus()).getDesc()); attendSaveReq.setTitle("考勤");
attendSaveReq.setHappenTime(entity.getErrorDateTime()); attendSaveReq.setHappenTime(entity.getErrorDateTime());
attendSaveReq.setRuleCode(ruleCode); attendSaveReq.setRuleCode(ruleCode);
attendSaveReq.setStaffId(entity.getStaffId()); attendSaveReq.setStaffId(entity.getStaffId());
......
...@@ -18,7 +18,7 @@ import java.util.List; ...@@ -18,7 +18,7 @@ import java.util.List;
* @author zxfei * @author zxfei
* @date 2022-07-06 * @date 2022-07-06
*/ */
//@FeignClient(name = "portal-manager", path = "/zwfw", fallbackFactory = UserFeignFallbackFactory.class) @FeignClient(name = "portal-manager", path = "/zwfw", fallbackFactory = UserFeignFallbackFactory.class)
public interface IUserFeign extends IFeign { public interface IUserFeign extends IFeign {
......
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