|
|
@ -1,13 +1,7 @@ |
|
|
|
package com.hnac.hzims.operational.maintenance.scheduled; |
|
|
|
package com.hnac.hzims.operational.maintenance.scheduled; |
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.hnac.hzims.message.fegin.IMessagePushClient; |
|
|
|
|
|
|
|
import com.hnac.hzims.message.req.PushExtrasReq; |
|
|
|
|
|
|
|
import com.hnac.hzims.operational.OperationalConstants; |
|
|
|
|
|
|
|
import com.hnac.hzims.operational.maintenance.constants.MaintenanceConstant; |
|
|
|
|
|
|
|
import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity; |
|
|
|
import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity; |
|
|
|
import com.hnac.hzims.operational.maintenance.service.IOperMaintenanceTaskService; |
|
|
|
|
|
|
|
import com.sun.javafx.binding.StringFormatter; |
|
|
|
|
|
|
|
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 lombok.extern.slf4j.Slf4j; |
|
|
@ -19,8 +13,6 @@ import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.time.ZoneOffset; |
|
|
|
import java.time.ZoneOffset; |
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.Set; |
|
|
|
import java.util.Set; |
|
|
|
|
|
|
|
|
|
|
|
import static com.hnac.hzims.operational.maintenance.constants.ScheduledConstant.TASK_VALUE_MAINTENANCE_PUSH_MSG; |
|
|
|
import static com.hnac.hzims.operational.maintenance.constants.ScheduledConstant.TASK_VALUE_MAINTENANCE_PUSH_MSG; |
|
|
@ -35,9 +27,6 @@ public class MaintenanceTaskPushMsg { |
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private RedisTemplate redisTemplate; |
|
|
|
private RedisTemplate redisTemplate; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private IMessagePushClient messagePushClient; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Value("${hzims.operation.task.jgPushCode}") |
|
|
|
@Value("${hzims.operation.task.jgPushCode}") |
|
|
|
private String jgPushCode; |
|
|
|
private String jgPushCode; |
|
|
|
|
|
|
|
|
|
|
@ -56,14 +45,14 @@ public class MaintenanceTaskPushMsg { |
|
|
|
return new ReturnT<>("SUCCESS"); |
|
|
|
return new ReturnT<>("SUCCESS"); |
|
|
|
} |
|
|
|
} |
|
|
|
operMaintenanceTaskEntityList.forEach(operMaintenanceTaskEntity -> { |
|
|
|
operMaintenanceTaskEntityList.forEach(operMaintenanceTaskEntity -> { |
|
|
|
this.maintenancePushMsg(operMaintenanceTaskEntity.getDisposer(),operMaintenanceTaskEntity.getTenantId(),operMaintenanceTaskEntity.getCreateDept(),operMaintenanceTaskEntity.getCreateUser()); |
|
|
|
//this.maintenancePushMsg(operMaintenanceTaskEntity.getDisposer(),operMaintenanceTaskEntity.getTenantId(),operMaintenanceTaskEntity.getCreateDept(),operMaintenanceTaskEntity.getCreateUser());
|
|
|
|
//把已发送的数据移除
|
|
|
|
//把已发送的数据移除
|
|
|
|
redisTemplate.opsForZSet().remove(maintenanceTaskKey, operMaintenanceTaskEntity); |
|
|
|
redisTemplate.opsForZSet().remove(maintenanceTaskKey, operMaintenanceTaskEntity); |
|
|
|
}); |
|
|
|
}); |
|
|
|
return new ReturnT<>("SUCCESS"); |
|
|
|
return new ReturnT<>("SUCCESS"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void maintenancePushMsg(String userId,String tenantId,Long createDept,Long createUser){ |
|
|
|
/*public void maintenancePushMsg(String userId,String tenantId,Long createDept,Long createUser){ |
|
|
|
PushExtrasReq pushExtrasReq = new PushExtrasReq(); |
|
|
|
PushExtrasReq pushExtrasReq = new PushExtrasReq(); |
|
|
|
pushExtrasReq.setCode(jgPushCode); |
|
|
|
pushExtrasReq.setCode(jgPushCode); |
|
|
|
pushExtrasReq.setTitle(MaintenanceConstant.MESSAGE_TITLE); |
|
|
|
pushExtrasReq.setTitle(MaintenanceConstant.MESSAGE_TITLE); |
|
|
@ -73,5 +62,5 @@ public class MaintenanceTaskPushMsg { |
|
|
|
log.info("日常维护消息推送开始,推送人为:{}",userId); |
|
|
|
log.info("日常维护消息推送开始,推送人为:{}",userId); |
|
|
|
messagePushClient.sendMessage(userId,pushExtrasReq,tenantId,createDept,createUser); |
|
|
|
messagePushClient.sendMessage(userId,pushExtrasReq,tenantId,createDept,createUser); |
|
|
|
log.info("---日常维护消息推送结束---"); |
|
|
|
log.info("---日常维护消息推送结束---"); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
} |
|
|
|
} |
|
|
|