|
|
|
@ -3,6 +3,8 @@ package cn.iocoder.yudao.module.system.job;
|
|
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
|
import cn.iocoder.yudao.framework.common.util.date.DateUtils; |
|
|
|
|
import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler; |
|
|
|
|
import cn.iocoder.yudao.module.system.api.notify.NotifyMessageSendApi; |
|
|
|
|
import cn.iocoder.yudao.module.system.api.notify.dto.NotifySendSingleToUserReqDTO; |
|
|
|
|
import cn.iocoder.yudao.module.system.api.social.SocialClientApi; |
|
|
|
|
import cn.iocoder.yudao.module.system.api.social.dto.SocialWxaSubscribeMessageSendReqDTO; |
|
|
|
|
import cn.iocoder.yudao.module.system.controller.admin.enterpriseinspections.vo.EnterpriseInspectionsCorrectionVO; |
|
|
|
@ -21,6 +23,7 @@ import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
|
import javax.swing.*; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
@ -40,6 +43,8 @@ public class InspectionsSendStartMessageJob implements JobHandler {
|
|
|
|
|
EnterpriseService enterpriseService; |
|
|
|
|
@Resource |
|
|
|
|
EnterpriseInspectionsService enterpriseInspectionsService; |
|
|
|
|
@Resource |
|
|
|
|
NotifyMessageSendApi notifyMessageSendApi; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public String execute(String param) throws Exception { |
|
|
|
@ -49,8 +54,24 @@ public class InspectionsSendStartMessageJob implements JobHandler {
|
|
|
|
|
if (enterpriseInspectionsCorrectionVOS != null && enterpriseInspectionsCorrectionVOS.size() > 0) { |
|
|
|
|
for (final EnterpriseInspectionsCorrectionVO item : enterpriseInspectionsCorrectionVOS) { |
|
|
|
|
final InspectionsLogDO inspectionsLogNew = enterpriseInspectionsService.getInspectionsLogNew(item.getInspectionsId()); |
|
|
|
|
//站内信发送通知
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (inspectionsLogNew != null && inspectionsLogNew.getStatus() == 3) { |
|
|
|
|
|
|
|
|
|
//站内信发送通知
|
|
|
|
|
final EnterpriseDO enterprise = enterpriseService.getEnterprise(item.getEnterpriseId()); |
|
|
|
|
|
|
|
|
|
//站内信发送通知
|
|
|
|
|
NotifySendSingleToUserReqDTO notifyMessage = new NotifySendSingleToUserReqDTO(); |
|
|
|
|
notifyMessage.setUserId(Long.valueOf(item.getCreator())); |
|
|
|
|
notifyMessage.setTemplateCode("correction_time"); |
|
|
|
|
Map<String, Object> templateParams = new HashMap<>(); |
|
|
|
|
templateParams.put("title", enterpriseService.getEnterprise(item.getEnterpriseId()).getEnterprisesName()); |
|
|
|
|
templateParams.put("correctionTime", inspectionsLogNew.getCorrectionTime()); |
|
|
|
|
notifyMessage.setTemplateParams(templateParams); |
|
|
|
|
notifyMessageSendApi.sendSingleMessageToAdmin(notifyMessage); |
|
|
|
|
|
|
|
|
|
num ++ ; |
|
|
|
|
try { |
|
|
|
|
SocialWxaSubscribeMessageSendReqDTO reqDTO = new SocialWxaSubscribeMessageSendReqDTO(); |
|
|
|
|