|
|
@ -12,12 +12,15 @@ import com.ruoyi.common.core.redis.RedisCache; |
|
|
|
import com.ruoyi.common.utils.DateUtils; |
|
|
|
import com.ruoyi.common.utils.SecurityUtils; |
|
|
|
import com.ruoyi.common.utils.spring.SpringUtils; |
|
|
|
import com.zc.business.domain.DcEmployees; |
|
|
|
import com.zc.business.domain.DcEventProcess; |
|
|
|
import com.zc.business.domain.DcPublishManage; |
|
|
|
import com.zc.business.enums.UniversalEnum; |
|
|
|
import com.zc.business.mapper.DcEmployeesMapper; |
|
|
|
import com.zc.business.mapper.DcPublishManageMapper; |
|
|
|
import com.zc.business.service.IMsmService; |
|
|
|
import com.zc.business.utils.HttpUtil; |
|
|
|
import com.zc.business.utils.QYWXUtil; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.json.JSONObject; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
@ -27,9 +30,7 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
import java.io.InputStream; |
|
|
|
import java.net.HttpURLConnection; |
|
|
|
import java.net.URL; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Random; |
|
|
|
import java.util.*; |
|
|
|
import java.util.concurrent.CountDownLatch; |
|
|
|
import java.util.concurrent.Executors; |
|
|
|
import java.util.concurrent.ThreadPoolExecutor; |
|
|
@ -51,6 +52,10 @@ public class MsmServiceImpl implements IMsmService { |
|
|
|
private DcEventProcessServiceImpl dcEventProcessService; |
|
|
|
@Autowired |
|
|
|
private DcPublishManageMapper dcPublishManageMapper; |
|
|
|
@Autowired |
|
|
|
private DcEmployeesMapper employeesMapper; |
|
|
|
@Autowired |
|
|
|
private QYWXUtil qywxUtil; |
|
|
|
/** |
|
|
|
* 发送短信 |
|
|
|
* |
|
|
@ -280,6 +285,26 @@ public class MsmServiceImpl implements IMsmService { |
|
|
|
// continue;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//企业微信推送
|
|
|
|
List<Integer> employees = (List<Integer>) map.get("employees"); |
|
|
|
Long[] ids = employees.stream().mapToLong(Integer::longValue).boxed().toArray(Long[]::new); |
|
|
|
List<DcEmployees> employeesList = employeesMapper.selectEmployeesByIds(ids); |
|
|
|
List<String> wxUserIds = new ArrayList<>(); |
|
|
|
for (DcEmployees dcEmployees : employeesList) { |
|
|
|
if (StringUtils.isNotBlank(dcEmployees.getWxUserId())){ |
|
|
|
wxUserIds.add(dcEmployees.getWxUserId()); |
|
|
|
} else { |
|
|
|
String wxUserId = qywxUtil.getUserIdByMobile(dcEmployees.getContactNumber()); |
|
|
|
if (StringUtils.isNotBlank(wxUserId)){ |
|
|
|
dcEmployees.setWxUserId(wxUserId); |
|
|
|
employeesMapper.updateDcEmployees(dcEmployees); |
|
|
|
wxUserIds.add(wxUserId); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
qywxUtil.sendMessageByWxUserId(wxUserIds,content); |
|
|
|
|
|
|
|
|
|
|
|
DcEventProcess dcEventProcess = new DcEventProcess(); |
|
|
|
dcEventProcess.setEventId(eventId); |
|
|
|
dcEventProcess.setSource(UniversalEnum.ONE.getNumber()); |
|
|
|