|
|
|
@ -1,11 +1,23 @@ |
|
|
|
package com.elink.esua.epdc.modules.async; |
|
|
|
|
|
|
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
|
|
|
import com.elink.esua.epdc.constant.EventIssueItemState; |
|
|
|
import com.elink.esua.epdc.constant.SysSmsTemplateConstant; |
|
|
|
import com.elink.esua.epdc.dto.events.form.EpdcEventSubmitFormDTO; |
|
|
|
import com.elink.esua.epdc.dto.events.form.EpdcEventsReviewFormDTO; |
|
|
|
import com.elink.esua.epdc.dto.form.SmsNoticeFormDTO; |
|
|
|
import com.elink.esua.epdc.dto.item.form.ItemHandleSubmitFormDTO; |
|
|
|
import com.elink.esua.epdc.enums.ItemHandleCategoryEnum; |
|
|
|
import com.elink.esua.epdc.modules.feign.AdminFeignClient; |
|
|
|
import com.elink.esua.epdc.modules.feign.MessageFeignClient; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.scheduling.annotation.Async; |
|
|
|
import org.springframework.scheduling.annotation.AsyncResult; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
import java.util.concurrent.Future; |
|
|
|
|
|
|
|
/** |
|
|
|
* |
|
|
|
* 议题审核结果 - 发送短信 |
|
|
|
@ -18,8 +30,11 @@ public class IssueOverseeResultsTask { |
|
|
|
@Autowired |
|
|
|
private MessageFeignClient messageFeignClient; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private AdminFeignClient adminFeignClient; |
|
|
|
|
|
|
|
/** |
|
|
|
* 议题:待回应事件 审核结果短信通知 议题发起人 |
|
|
|
* 短信通知 关联人 |
|
|
|
* |
|
|
|
* @param smsNoticeFormDTO |
|
|
|
* @return void |
|
|
|
@ -30,4 +45,76 @@ public class IssueOverseeResultsTask { |
|
|
|
public void sendSmsNotice(SmsNoticeFormDTO smsNoticeFormDTO) { |
|
|
|
messageFeignClient.sendSmsNotice(smsNoticeFormDTO); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description: 根据部门id,异步查询部门下的所有用户手机号 |
|
|
|
* @Description: 根据手机号进行短信推送 |
|
|
|
* @Param: [dto, deptId] |
|
|
|
* @return: void |
|
|
|
* @Author: zy |
|
|
|
* @Date: 2020-01-09 |
|
|
|
*/ |
|
|
|
@Async |
|
|
|
public void getUserPhoneByListDeptId(ItemHandleSubmitFormDTO dto, List<Long> deptId){ |
|
|
|
Result<List<String>> data = adminFeignClient.getUserPhoneByListDeptId(deptId); |
|
|
|
if (data.success() && data.getData() != null && data.getData().size() > 0) { |
|
|
|
this.projectSmsNotification(dto, data.getData());//向部门下的,所有人员发送短信
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description: 根据议题网格ID 异步查询拥有这个网格数据权限且是网格长的角色,再根据角色查出所有用户手机号 |
|
|
|
* @Description: 根据手机号进行短信推送 |
|
|
|
* @Param: [deptId] |
|
|
|
* @return: void |
|
|
|
* @Author: zy |
|
|
|
* @Date: 2020-01-09 |
|
|
|
*/ |
|
|
|
@Async |
|
|
|
public void getSysGridLeaderPhone(Long deptId){ |
|
|
|
Result<List<String>> data = adminFeignClient.getSysGridLeaderPhone(deptId); |
|
|
|
if (data.success() && data.getData() != null && data.getData().size() > 0) { |
|
|
|
this.issueSmsNotification(data.getData());//短信通知 所有有菜单权限的议题审核员
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description: 工作端:项目处理,发送短信 |
|
|
|
* @Param: [dto] |
|
|
|
* @Param: userId 用户手机号 |
|
|
|
* @return: void |
|
|
|
* @Author: zy |
|
|
|
* @Date: 2020-01-08 |
|
|
|
*/ |
|
|
|
public void projectSmsNotification(ItemHandleSubmitFormDTO dto, List<String> userMobiles){ |
|
|
|
// 审核操作发送短信
|
|
|
|
SmsNoticeFormDTO sms = new SmsNoticeFormDTO(); |
|
|
|
sms.setMobiles(userMobiles); |
|
|
|
|
|
|
|
if (ItemHandleCategoryEnum.HANDLE_CLOSE.getValue() == dto.getHandleCategory()){ |
|
|
|
sms.setSmsTemplateType(SysSmsTemplateConstant.SMS_TEMPLATE_WORK_ITEM_CLOSED);// 关闭
|
|
|
|
}else if(ItemHandleCategoryEnum.HANDLE_CLOSING_CASE.getValue() == dto.getHandleCategory()){ |
|
|
|
sms.setSmsTemplateType(SysSmsTemplateConstant.SMS_TEMPLATE_WORK_ITEM_SETTLE);// 结案
|
|
|
|
}else if(ItemHandleCategoryEnum.HANDLE_CIRCULATION_ASSISTANCE.getValue() == dto.getHandleCategory()){ |
|
|
|
sms.setSmsTemplateType(SysSmsTemplateConstant.SMS_TEMPLATE_WORK_ITEM_WHISTLE);// 被吹哨
|
|
|
|
}else if(ItemHandleCategoryEnum.HANDLE_I_HANDLE.getValue() == dto.getHandleCategory()){ |
|
|
|
sms.setSmsTemplateType(SysSmsTemplateConstant.SMS_TEMPLATE_WORK_ITEM_WHISTLE_FEEDBACK);// 回应:吹哨反馈
|
|
|
|
} |
|
|
|
this.sendSmsNotice(sms); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description: 工作端:议题:议题发布短信通知 当前网格下的网格长 |
|
|
|
* @Param: [userMobiles] 手机号列表 |
|
|
|
* @return: void |
|
|
|
* @Author: zy |
|
|
|
* @Date: 2020-01-08 |
|
|
|
*/ |
|
|
|
private void issueSmsNotification(List<String> userMobiles){ |
|
|
|
// 审核操作发送短信
|
|
|
|
SmsNoticeFormDTO sms = new SmsNoticeFormDTO(); |
|
|
|
sms.setMobiles(userMobiles); |
|
|
|
sms.setSmsTemplateType(SysSmsTemplateConstant.SMS_TEMPLATE_WORK_ISSUE_WAIT_REVIEW);//议题发布,状态为待审核
|
|
|
|
this.sendSmsNotice(sms); |
|
|
|
} |
|
|
|
} |
|
|
|
|