|  |  |  | 
|---|
|  |  |  | package com.matrix.system.job; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.matrix.component.asyncmessage.AsyncMessageManager; | 
|---|
|  |  |  | import com.matrix.component.rabbitmq.RabiitMqTemplate; | 
|---|
|  |  |  | import com.matrix.core.tools.LogUtil; | 
|---|
|  |  |  | import com.matrix.system.common.bean.SysUsers; | 
|---|
|  |  |  | import com.matrix.system.constance.Dictionary; | 
|---|
|  |  |  | import com.matrix.system.hive.bean.MoneyCardUse; | 
|---|
|  |  |  | import com.matrix.system.hive.bean.SysProjServices; | 
|---|
|  |  |  | import com.matrix.system.hive.bean.SysProjUse; | 
|---|
|  |  |  | import com.matrix.system.hive.dao.MoneyCardUseDao; | 
|---|
|  |  |  | import com.matrix.system.hive.dao.SysProjServicesDao; | 
|---|
|  |  |  | import com.matrix.system.hive.dao.SysProjUseDao; | 
|---|
|  |  |  | import com.matrix.system.hive.plugin.util.CollectionUtils; | 
|---|
|  |  |  | import com.matrix.system.shopXcx.mqTask.MQTaskRouting; | 
|---|
|  |  |  | import com.matrix.system.shopXcx.mqTask.AsyncMessageRouting; | 
|---|
|  |  |  | import com.matrix.system.wechart.templateMsg.UniformMsgParam; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Value; | 
|---|
|  |  |  | import org.springframework.scheduling.annotation.Scheduled; | 
|---|
|  |  |  | import org.springframework.stereotype.Component; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.ArrayList; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | import java.util.stream.Collectors; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @Value("${evn}") | 
|---|
|  |  |  | private  String evn; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private RabiitMqTemplate rabiitMqTemplate; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private AsyncMessageManager asyncMessageManager; | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 每分钟执行一次 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Scheduled(cron = "0 0/1 * * * ?") | 
|---|
|  |  |  | @Scheduled(cron = "0/30 * * * * ?") | 
|---|
|  |  |  | public void serviceOvertimeNotice() { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<SysProjServices> needNoticeService=projServicesDao.selectNeedNoticeService(); | 
|---|
|  |  |  | 
|---|
|  |  |  | //发送微信公众号提醒 | 
|---|
|  |  |  | UniformMsgParam uniformMsgParam=new UniformMsgParam(projServices.getCompanyId(),UniformMsgParam.GZH_YYDS); | 
|---|
|  |  |  | uniformMsgParam.put("serviceId",projServices.getId()); | 
|---|
|  |  |  | rabiitMqTemplate.sendMsg(MQTaskRouting.SEND_UNIFORM_TEMPLATE_MSG+evn,uniformMsgParam.toJSONString()); | 
|---|
|  |  |  | asyncMessageManager.sendMsg(AsyncMessageRouting.SEND_UNIFORM_TEMPLATE_MSG ,uniformMsgParam); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | List<Long> noticedIds = needNoticeService.stream().map(SysProjServices::getId).collect(Collectors.toList()); | 
|---|
|  |  |  | projServicesDao.updateNoticeTimes(noticedIds); | 
|---|