|
|
@ -13,19 +13,21 @@ import com.hnac.hzims.message.fegin.IMessageConfigClient; |
|
|
|
import com.hnac.hzims.scheduled.mapper.basic.PersonManagemetMapper; |
|
|
|
import com.hnac.hzims.scheduled.mapper.basic.PersonManagemetMapper; |
|
|
|
import com.hnac.hzims.scheduled.service.basic.IImsCertificatetNoticeService; |
|
|
|
import com.hnac.hzims.scheduled.service.basic.IImsCertificatetNoticeService; |
|
|
|
import com.hnac.hzims.scheduled.service.basic.IImsCertificatetService; |
|
|
|
import com.hnac.hzims.scheduled.service.basic.IImsCertificatetService; |
|
|
|
|
|
|
|
import com.hnac.hzims.scheduled.service.basic.IImsPresonManagementService; |
|
|
|
import com.xxl.job.core.biz.model.ReturnT; |
|
|
|
import com.xxl.job.core.biz.model.ReturnT; |
|
|
|
import com.xxl.job.core.handler.annotation.XxlJob; |
|
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
|
|
|
import org.apache.commons.lang.StringUtils; |
|
|
|
|
|
|
|
import org.junit.jupiter.api.Test; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.utils.CollectionUtil; |
|
|
|
import org.springblade.core.tool.utils.CollectionUtil; |
|
|
|
import org.springblade.core.tool.utils.DateUtil; |
|
|
|
import org.springblade.core.tool.utils.DateUtil; |
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
|
|
|
|
import org.springblade.core.tool.utils.ObjectUtil; |
|
|
|
import org.springblade.core.tool.utils.ObjectUtil; |
|
|
|
import org.springblade.system.feign.ISysClient; |
|
|
|
import org.springblade.system.feign.ISysClient; |
|
|
|
import org.springblade.system.user.cache.UserCache; |
|
|
|
import org.springblade.system.user.cache.UserCache; |
|
|
|
import org.springblade.system.user.entity.User; |
|
|
|
import org.springblade.system.user.entity.User; |
|
|
|
import org.springblade.system.user.feign.IUserClient; |
|
|
|
import org.springblade.system.user.feign.IUserClient; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
|
|
|
import org.springframework.scheduling.annotation.Scheduled; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
|
|
|
|
import java.text.ParseException; |
|
|
|
import java.text.ParseException; |
|
|
@ -33,8 +35,6 @@ import java.text.SimpleDateFormat; |
|
|
|
import java.util.*; |
|
|
|
import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
import static com.hnac.hzims.operational.main.constant.MainConstants.*; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 排班到期定时任务通知 |
|
|
|
* 排班到期定时任务通知 |
|
|
@ -43,7 +43,7 @@ import static com.hnac.hzims.operational.main.constant.MainConstants.*; |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Slf4j |
|
|
|
@Slf4j |
|
|
|
@Component |
|
|
|
@Component |
|
|
|
public class basicScheduledTask { |
|
|
|
public class BasicScheduledTask { |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private IImsCertificatetService iImsCertificatetService; |
|
|
|
private IImsCertificatetService iImsCertificatetService; |
|
|
@ -56,18 +56,20 @@ public class basicScheduledTask { |
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private IMessageClient messageClient; |
|
|
|
private IMessageClient messageClient; |
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private PersonManagemetMapper personManagemetMapper; |
|
|
|
private IImsPresonManagementService presonManagementService; |
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private IMessageConfigClient messageConfigClient; |
|
|
|
private IMessageConfigClient messageConfigClient; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* realId刷新 |
|
|
|
* realId刷新 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@XxlJob(CERTIFICATET_DEAD_LINE_NOTICE) |
|
|
|
// @XxlJob(CERTIFICATET_DEAD_LINE_NOTICE)
|
|
|
|
// @Scheduled(cron = "0 */1 * * * ? ")
|
|
|
|
@Scheduled(cron = "0/40 * * * * ? ") |
|
|
|
public ReturnT<String> certificatetDeadLineNotice(String param) throws ParseException { |
|
|
|
// public ReturnT<String> certificatetDeadLineNotice(String param) throws ParseException {
|
|
|
|
|
|
|
|
public ReturnT<String> certificatetDeadLineNotice() throws ParseException { |
|
|
|
Date endTime = new Date(); |
|
|
|
Date endTime = new Date(); |
|
|
|
if (Func.isBlank(param)) { |
|
|
|
String param=""; |
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(param)) { |
|
|
|
endTime = new SimpleDateFormat("yyyy-MM-dd").parse(param); |
|
|
|
endTime = new SimpleDateFormat("yyyy-MM-dd").parse(param); |
|
|
|
} |
|
|
|
} |
|
|
|
CertificatetNoticeEntity noticeEntity = iImsCertificatetNoticeService.getOne(Wrappers.<CertificatetNoticeEntity>lambdaQuery() |
|
|
|
CertificatetNoticeEntity noticeEntity = iImsCertificatetNoticeService.getOne(Wrappers.<CertificatetNoticeEntity>lambdaQuery() |
|
|
@ -81,7 +83,7 @@ public class basicScheduledTask { |
|
|
|
List<String> userList = Arrays.asList(noticeUsers.split(",")); |
|
|
|
List<String> userList = Arrays.asList(noticeUsers.split(",")); |
|
|
|
if (CollectionUtil.isNotEmpty(userList) && CollectionUtil.isNotEmpty(list)) { |
|
|
|
if (CollectionUtil.isNotEmpty(userList) && CollectionUtil.isNotEmpty(list)) { |
|
|
|
List<String> personIds = list.stream().map(CertificatetEntity::getPersonId).collect(Collectors.toList()); |
|
|
|
List<String> personIds = list.stream().map(CertificatetEntity::getPersonId).collect(Collectors.toList()); |
|
|
|
List<PersonManagemetEntity> personManagemetEntities = personManagemetMapper.selectList(Wrappers.<PersonManagemetEntity>query().lambda().in(PersonManagemetEntity::getId, personIds)); |
|
|
|
List<PersonManagemetEntity> personManagemetEntities = presonManagementService.list(Wrappers.<PersonManagemetEntity>query().lambda().in(PersonManagemetEntity::getId, personIds)); |
|
|
|
String personNotice=""; |
|
|
|
String personNotice=""; |
|
|
|
if (CollectionUtil.isNotEmpty(personManagemetEntities)) { |
|
|
|
if (CollectionUtil.isNotEmpty(personManagemetEntities)) { |
|
|
|
personNotice = personManagemetEntities.stream().map(PersonManagemetEntity::getName).collect(Collectors.joining(",")); |
|
|
|
personNotice = personManagemetEntities.stream().map(PersonManagemetEntity::getName).collect(Collectors.joining(",")); |
|
|
@ -94,6 +96,11 @@ public class basicScheduledTask { |
|
|
|
return new ReturnT<>("SUCCESS"); |
|
|
|
return new ReturnT<>("SUCCESS"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
public void getVideoMonitor() throws ParseException { |
|
|
|
|
|
|
|
ReturnT<String> stringReturnT = this.certificatetDeadLineNotice(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void sendSmsByUserList(List<String> userList, Date date,String personNotice) { |
|
|
|
private void sendSmsByUserList(List<String> userList, Date date,String personNotice) { |
|
|
|
//区分用户
|
|
|
|
//区分用户
|
|
|
|
for (String s : userList) { |
|
|
|
for (String s : userList) { |