|
|
@ -12,9 +12,13 @@ import com.hnac.hzims.safeproduct.service.ICarMaintenanceService; |
|
|
|
import com.hnac.hzims.safeproduct.service.ICarService; |
|
|
|
import com.hnac.hzims.safeproduct.service.ICarService; |
|
|
|
import com.xxl.job.core.biz.model.ReturnT; |
|
|
|
import com.xxl.job.core.biz.model.ReturnT; |
|
|
|
import com.xxl.job.core.handler.annotation.XxlJob; |
|
|
|
import com.xxl.job.core.handler.annotation.XxlJob; |
|
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.utils.DateUtil; |
|
|
|
import org.springblade.core.tool.utils.DateUtil; |
|
|
|
import org.springblade.system.feign.ISysClient; |
|
|
|
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.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
@ -29,6 +33,7 @@ import java.util.List; |
|
|
|
* @author liwen |
|
|
|
* @author liwen |
|
|
|
* @date 2024-01-11 |
|
|
|
* @date 2024-01-11 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@Slf4j |
|
|
|
@Component |
|
|
|
@Component |
|
|
|
public class CarJob { |
|
|
|
public class CarJob { |
|
|
|
|
|
|
|
|
|
|
@ -44,6 +49,9 @@ public class CarJob { |
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
ISysClient sysClient; |
|
|
|
ISysClient sysClient; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
IUserClient userClient; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 车辆台账自动变更 |
|
|
|
* 车辆台账自动变更 |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -92,10 +100,16 @@ public class CarJob { |
|
|
|
* @param carEntity 车辆实体类 |
|
|
|
* @param carEntity 车辆实体类 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void sendUninsuredMessage(CarEntity carEntity) { |
|
|
|
private void sendUninsuredMessage(CarEntity carEntity) { |
|
|
|
|
|
|
|
if (carEntity.getManagerId() == null) { |
|
|
|
|
|
|
|
log.error("系统无该用户信息,推送车保过期消息失败"); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 查询用户
|
|
|
|
|
|
|
|
R<User> userRes = userClient.userInfoById(carEntity.getManagerId()); |
|
|
|
|
|
|
|
User user = userRes.getData(); |
|
|
|
BusinessMessageDTO businessMessageDTO = new BusinessMessageDTO(); |
|
|
|
BusinessMessageDTO businessMessageDTO = new BusinessMessageDTO(); |
|
|
|
String deptId = AuthUtil.getDeptId(); |
|
|
|
if (StringUtils.isNotEmpty(user.getDeptId())) { |
|
|
|
if (StringUtils.isNotEmpty(deptId)) { |
|
|
|
Long id = Long.valueOf(user.getDeptId()); |
|
|
|
Long id = Long.valueOf(deptId); |
|
|
|
|
|
|
|
businessMessageDTO.setDeptId(id); |
|
|
|
businessMessageDTO.setDeptId(id); |
|
|
|
businessMessageDTO.setDeptName(sysClient.getDeptName(id).getData()); |
|
|
|
businessMessageDTO.setDeptName(sysClient.getDeptName(id).getData()); |
|
|
|
businessMessageDTO.setBusinessKey("车保到期"); |
|
|
|
businessMessageDTO.setBusinessKey("车保到期"); |
|
|
@ -115,10 +129,16 @@ public class CarJob { |
|
|
|
* @param carEntity 车辆实体类 |
|
|
|
* @param carEntity 车辆实体类 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void sendUnMaintainedMessage(CarEntity carEntity) { |
|
|
|
private void sendUnMaintainedMessage(CarEntity carEntity) { |
|
|
|
|
|
|
|
if (carEntity.getManagerId() == null) { |
|
|
|
|
|
|
|
log.error("系统无该用户信息,推送维保过期消息失败"); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 查询用户
|
|
|
|
|
|
|
|
R<User> userRes = userClient.userInfoById(carEntity.getManagerId()); |
|
|
|
|
|
|
|
User user = userRes.getData(); |
|
|
|
BusinessMessageDTO businessMessageDTO = new BusinessMessageDTO(); |
|
|
|
BusinessMessageDTO businessMessageDTO = new BusinessMessageDTO(); |
|
|
|
String deptId = AuthUtil.getDeptId(); |
|
|
|
if (StringUtils.isNotEmpty(user.getDeptId())) { |
|
|
|
if (StringUtils.isNotEmpty(deptId)) { |
|
|
|
Long id = Long.valueOf(user.getDeptId()); |
|
|
|
Long id = Long.valueOf(deptId); |
|
|
|
|
|
|
|
businessMessageDTO.setDeptId(id); |
|
|
|
businessMessageDTO.setDeptId(id); |
|
|
|
businessMessageDTO.setDeptName(sysClient.getDeptName(id).getData()); |
|
|
|
businessMessageDTO.setDeptName(sysClient.getDeptName(id).getData()); |
|
|
|
businessMessageDTO.setBusinessKey("维保到期"); |
|
|
|
businessMessageDTO.setBusinessKey("维保到期"); |
|
|
|