|
@@ -14,6 +14,7 @@ import org.dromara.common.core.enums.ResultCodeEnum;
|
|
|
import org.dromara.common.json.utils.JsonUtils;
|
|
import org.dromara.common.json.utils.JsonUtils;
|
|
|
import org.dromara.common.redis.utils.RedisUtils;
|
|
import org.dromara.common.redis.utils.RedisUtils;
|
|
|
import org.dromara.server.common.constant.ConsumeConstants;
|
|
import org.dromara.server.common.constant.ConsumeConstants;
|
|
|
|
|
+import org.dromara.server.consume.cache.CardCacheManager;
|
|
|
import org.dromara.server.consume.cache.UserAccountCacheManager;
|
|
import org.dromara.server.consume.cache.UserAccountCacheManager;
|
|
|
import org.dromara.server.consume.domain.vo.yc.*;
|
|
import org.dromara.server.consume.domain.vo.yc.*;
|
|
|
import org.dromara.system.api.RemoteDeptService;
|
|
import org.dromara.system.api.RemoteDeptService;
|
|
@@ -36,13 +37,13 @@ import java.util.List;
|
|
|
@RequiredArgsConstructor
|
|
@RequiredArgsConstructor
|
|
|
public class EmployeeBusiness {
|
|
public class EmployeeBusiness {
|
|
|
private final UserAccountCacheManager userAccountCacheManager;
|
|
private final UserAccountCacheManager userAccountCacheManager;
|
|
|
- private final CardBusiness cardBusiness;
|
|
|
|
|
|
|
+ private final CardCacheManager cardCacheManager;
|
|
|
|
|
|
|
|
@DubboReference
|
|
@DubboReference
|
|
|
private final RemoteDeptService remoteDeptService;
|
|
private final RemoteDeptService remoteDeptService;
|
|
|
|
|
|
|
|
public ReturnResult getEmployeeVoByNumb(String userNumb) {
|
|
public ReturnResult getEmployeeVoByNumb(String userNumb) {
|
|
|
- RemoteUserAccountVo userAccountVo = getAccountFromCache(userNumb, ConsumeConstants.USER_NUMB);
|
|
|
|
|
|
|
+ RemoteUserAccountVo userAccountVo = userAccountCacheManager.getByUserNumb(userNumb);
|
|
|
if (userAccountVo == null) {
|
|
if (userAccountVo == null) {
|
|
|
ErrorResult result = new ErrorResult();
|
|
ErrorResult result = new ErrorResult();
|
|
|
result.setStatusCode(HttpStatus.NOT_FOUND.value());
|
|
result.setStatusCode(HttpStatus.NOT_FOUND.value());
|
|
@@ -84,14 +85,14 @@ public class EmployeeBusiness {
|
|
|
departmentVo.setDepartmentName(userAccountVo.getDeptName());
|
|
departmentVo.setDepartmentName(userAccountVo.getDeptName());
|
|
|
|
|
|
|
|
Long userId = userAccountVo.getUserId();
|
|
Long userId = userAccountVo.getUserId();
|
|
|
- RemoteCardVo remoteCardVo = cardBusiness.getCardFromCache(userId, ConsumeConstants.CARD_USER);
|
|
|
|
|
-
|
|
|
|
|
- if (remoteCardVo == null) {
|
|
|
|
|
|
|
+ Object objCard = cardCacheManager.getByUserId(userId);
|
|
|
|
|
+ if (objCard == null) {
|
|
|
log.warn("无人员有效卡片信息,userNumb:{},userId:{}", userAccountVo.getUserNumb(), userAccountVo.getUserId());
|
|
log.warn("无人员有效卡片信息,userNumb:{},userId:{}", userAccountVo.getUserNumb(), userAccountVo.getUserId());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
+ RemoteCardVo remoteCardVo = JsonUtils.parseObject(objCard.toString(), RemoteCardVo.class);
|
|
|
UserCardVo userCardVo = new UserCardVo();
|
|
UserCardVo userCardVo = new UserCardVo();
|
|
|
- Long cardNo = 0L;
|
|
|
|
|
|
|
+ Long cardNo;
|
|
|
CardStatusVo cardStatusVo = new CardStatusVo();
|
|
CardStatusVo cardStatusVo = new CardStatusVo();
|
|
|
int cardStatusId = Integer.parseInt(remoteCardVo.getStatus());
|
|
int cardStatusId = Integer.parseInt(remoteCardVo.getStatus());
|
|
|
cardStatusVo.setCardStatusID(cardStatusId);
|
|
cardStatusVo.setCardStatusID(cardStatusId);
|