diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/CarJob.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/CarJob.java index c150dd7..dc9baef 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/CarJob.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/CarJob.java @@ -14,8 +14,11 @@ import com.xxl.job.core.biz.model.ReturnT; import com.xxl.job.core.handler.annotation.XxlJob; import lombok.extern.slf4j.Slf4j; import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.DateUtil; import org.springblade.system.feign.ISysClient; +import org.springblade.system.user.entity.User; +import org.springblade.system.user.feign.IUserClient; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; @@ -46,6 +49,9 @@ public class CarJob { @Autowired ISysClient sysClient; + @Autowired + IUserClient userClient; + /** * 车辆台账自动变更 */ @@ -98,10 +104,12 @@ public class CarJob { log.error("系统无该用户信息,推送车保过期消息失败"); return; } + // 查询用户 + R userRes = userClient.userInfoById(carEntity.getManagerId()); + User user = userRes.getData(); BusinessMessageDTO businessMessageDTO = new BusinessMessageDTO(); - String deptId = AuthUtil.getDeptId(); - if (StringUtils.isNotEmpty(deptId)) { - Long id = Long.valueOf(deptId); + if (StringUtils.isNotEmpty(user.getDeptId())) { + Long id = Long.valueOf(user.getDeptId()); businessMessageDTO.setDeptId(id); businessMessageDTO.setDeptName(sysClient.getDeptName(id).getData()); businessMessageDTO.setBusinessKey("车保到期"); @@ -125,10 +133,12 @@ public class CarJob { log.error("系统无该用户信息,推送维保过期消息失败"); return; } + // 查询用户 + R userRes = userClient.userInfoById(carEntity.getManagerId()); + User user = userRes.getData(); BusinessMessageDTO businessMessageDTO = new BusinessMessageDTO(); - String deptId = AuthUtil.getDeptId(); - if (StringUtils.isNotEmpty(deptId)) { - Long id = Long.valueOf(deptId); + if (StringUtils.isNotEmpty(user.getDeptId())) { + Long id = Long.valueOf(user.getDeptId()); businessMessageDTO.setDeptId(id); businessMessageDTO.setDeptName(sysClient.getDeptName(id).getData()); businessMessageDTO.setBusinessKey("维保到期");