|
@@ -10,10 +10,18 @@ import com.ruoyi.common.utils.jPush.JPushToolUtil;
|
|
|
import com.ruoyi.framework.manager.AsyncManager;
|
|
|
import com.ruoyi.framework.manager.factory.AsyncFactory;
|
|
|
import com.ruoyi.system.domain.SysHoliday;
|
|
|
+import com.ruoyi.system.domain.fgw.FgwJdap;
|
|
|
+import com.ruoyi.system.domain.fgw.FgwJdapDw;
|
|
|
+import com.ruoyi.system.domain.fgw.FgwXmsb;
|
|
|
+import com.ruoyi.system.domain.fgw.FgwYjpz;
|
|
|
import com.ruoyi.system.domain.projectV2.*;
|
|
|
import com.ruoyi.system.domain.projectV2.common.SendSmsConfig;
|
|
|
import com.ruoyi.system.mapper.SysHolidayMapper;
|
|
|
import com.ruoyi.system.mapper.SysUserMapper;
|
|
|
+import com.ruoyi.system.mapper.fgw.FgwJdapDwMapper;
|
|
|
+import com.ruoyi.system.mapper.fgw.FgwJdapMapper;
|
|
|
+import com.ruoyi.system.mapper.fgw.FgwXmsbMapper;
|
|
|
+import com.ruoyi.system.mapper.fgw.FgwYjpzMapper;
|
|
|
import com.ruoyi.system.mapper.projectV2.*;
|
|
|
import com.ruoyi.system.service.ISysUserService;
|
|
|
import com.ruoyi.system.service.projectV2.common.ISendSmsConfigService;
|
|
@@ -65,6 +73,18 @@ public class Task {
|
|
|
@Autowired
|
|
|
private ISysUserService sysUserService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private FgwYjpzMapper fgwYjpzMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private FgwJdapMapper fgwJdapMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private FgwXmsbMapper fgwXmsbMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private FgwJdapDwMapper fgwJdapDwMapper;
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -901,6 +921,73 @@ public class Task {
|
|
|
/***
|
|
|
* 发改委节点安排未完成数据推送
|
|
|
*/
|
|
|
+ @Async
|
|
|
+ @Scheduled(cron = "0 18 0 * * ? ")
|
|
|
+ public void jdapY() throws Exception {
|
|
|
+ //将消息推送给相关人员
|
|
|
+ List<SendSmsConfig> sendSmsConfigs = new ArrayList<>();
|
|
|
+ List<SysUser> sysUserList = new ArrayList<>();
|
|
|
+
|
|
|
+ //获取当前年月
|
|
|
+ String nowTime = DateUtils.getYearMonth();
|
|
|
+ //当前时间
|
|
|
+ //查询预警配置时间
|
|
|
+ FgwYjpz fgwYjpz = fgwYjpzMapper.selectFgwYjpzNew();
|
|
|
+ //预警项目
|
|
|
+ List<FgwJdap> fgwJdapList = fgwJdapMapper.selectFgwJdapNum(fgwYjpz.getYjts());
|
|
|
+ List<FgwXmsb> fgwXmsbList = new ArrayList<>();
|
|
|
+ List<FgwJdapDw> fgwJdapDwList = new ArrayList<>();
|
|
|
+ FgwXmsb fgwXmsb = new FgwXmsb();
|
|
|
+ if (fgwJdapList!=null && fgwJdapList.size() > 0) {
|
|
|
+ List<Long> xmidList = fgwJdapList.stream().map(FgwJdap::getXmId).collect(Collectors.toList());
|
|
|
+ fgwXmsb.setIdList(xmidList);
|
|
|
+ fgwXmsbList = fgwXmsbMapper.selectFgwXmsbList(fgwXmsb);
|
|
|
+
|
|
|
+ //查询项目的所有人员
|
|
|
+ List<Long> idList = fgwJdapList.stream().map(FgwJdap::getId).collect(Collectors.toList());
|
|
|
+ fgwJdapDwList = fgwJdapDwMapper.selectFgwJdapDwListByXmid(idList);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if (fgwXmsbList!=null && fgwXmsbList.size() > 0) {
|
|
|
|
|
|
+ for (FgwXmsb xmsb : fgwXmsbList) {
|
|
|
+ SysUser sysUse = userMapper.selectUserById(xmsb.getUserId());
|
|
|
+ sysUserList.add(sysUse);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if (fgwJdapDwList!=null && fgwJdapDwList.size() > 0) {
|
|
|
+ List<Long> deptIdList = fgwJdapDwList.stream().map(FgwJdapDw::getDeptId).collect(Collectors.toList());
|
|
|
+ List<SysUser> sysUsers = userMapper.selectUserByDeptIdList(deptIdList);
|
|
|
+ sysUserList.addAll(sysUsers);
|
|
|
+ }
|
|
|
+ if (sysUserList != null) {
|
|
|
+ //发极光推送
|
|
|
+ String notificationTitle = "消息通知";
|
|
|
+ String msgTitle = "节点催办";
|
|
|
+ String msgContent = "您有一条节点催办信息,请及时处理!";
|
|
|
+ String jPushVO = "";
|
|
|
+ List<String> listS = sysUserList.stream().map(SysUser::getJgId).collect(Collectors.toList());
|
|
|
+ listS.removeAll(Collections.singleton(null));
|
|
|
+ if(listS!=null && listS.size()>0){
|
|
|
+ String[] registrationId = listS.toArray(new String[listS.size()]);
|
|
|
+ JPushToolUtil.sendToRegistrationId(notificationTitle,msgTitle,msgContent,jPushVO,registrationId);
|
|
|
+ }
|
|
|
+
|
|
|
+ for (SysUser sysUser : sysUserList) {
|
|
|
+ if (StringUtils.isNotEmpty(sysUser.getPhonenumber())) {
|
|
|
+ SendSmsConfig sendSmsConfig = new SendSmsConfig();
|
|
|
+ sendSmsConfig.setPhone(sysUser.getPhonenumber());
|
|
|
+ sendSmsConfigs.add(sendSmsConfig);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (sendSmsConfigs.size() > 0) {
|
|
|
+ //TOdo 模板
|
|
|
+ //AsyncManager.me().execute(AsyncFactory.sendSms(sendSmsConfigs, "SMS_272470945"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
}
|