From 3223c2296253e3fa1d69e277f539b8190c0dc59d Mon Sep 17 00:00:00 2001 From: liwen Date: Thu, 18 Jan 2024 15:58:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E8=BD=A6=E8=BE=86?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E6=B6=88=E6=81=AF=E6=8E=A8=E9=80=81=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hnac/hzims/safeproduct/jobs/CarJob.java | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) 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("维保到期");