diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/basicScheduledTask.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/BasicScheduledTask.java similarity index 86% rename from hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/basicScheduledTask.java rename to hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/BasicScheduledTask.java index 9b72730..843c270 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/basicScheduledTask.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/BasicScheduledTask.java @@ -13,19 +13,21 @@ import com.hnac.hzims.message.fegin.IMessageConfigClient; import com.hnac.hzims.scheduled.mapper.basic.PersonManagemetMapper; import com.hnac.hzims.scheduled.service.basic.IImsCertificatetNoticeService; 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.handler.annotation.XxlJob; 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.utils.CollectionUtil; import org.springblade.core.tool.utils.DateUtil; -import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.system.feign.ISysClient; import org.springblade.system.user.cache.UserCache; import org.springblade.system.user.entity.User; import org.springblade.system.user.feign.IUserClient; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import java.text.ParseException; @@ -33,8 +35,6 @@ import java.text.SimpleDateFormat; import java.util.*; 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 @Component -public class basicScheduledTask { +public class BasicScheduledTask { @Autowired private IImsCertificatetService iImsCertificatetService; @@ -56,18 +56,20 @@ public class basicScheduledTask { @Autowired private IMessageClient messageClient; @Autowired - private PersonManagemetMapper personManagemetMapper; + private IImsPresonManagementService presonManagementService; @Autowired private IMessageConfigClient messageConfigClient; /** * realId刷新 */ - @XxlJob(CERTIFICATET_DEAD_LINE_NOTICE) -// @Scheduled(cron = "0 */1 * * * ? ") - public ReturnT certificatetDeadLineNotice(String param) throws ParseException { +// @XxlJob(CERTIFICATET_DEAD_LINE_NOTICE) + @Scheduled(cron = "0/40 * * * * ? ") +// public ReturnT certificatetDeadLineNotice(String param) throws ParseException { + public ReturnT certificatetDeadLineNotice() throws ParseException { Date endTime = new Date(); - if (Func.isBlank(param)) { + String param=""; + if (StringUtils.isNotBlank(param)) { endTime = new SimpleDateFormat("yyyy-MM-dd").parse(param); } CertificatetNoticeEntity noticeEntity = iImsCertificatetNoticeService.getOne(Wrappers.lambdaQuery() @@ -81,7 +83,7 @@ public class basicScheduledTask { List userList = Arrays.asList(noticeUsers.split(",")); if (CollectionUtil.isNotEmpty(userList) && CollectionUtil.isNotEmpty(list)) { List personIds = list.stream().map(CertificatetEntity::getPersonId).collect(Collectors.toList()); - List personManagemetEntities = personManagemetMapper.selectList(Wrappers.query().lambda().in(PersonManagemetEntity::getId, personIds)); + List personManagemetEntities = presonManagementService.list(Wrappers.query().lambda().in(PersonManagemetEntity::getId, personIds)); String personNotice=""; if (CollectionUtil.isNotEmpty(personManagemetEntities)) { personNotice = personManagemetEntities.stream().map(PersonManagemetEntity::getName).collect(Collectors.joining(",")); @@ -94,6 +96,11 @@ public class basicScheduledTask { return new ReturnT<>("SUCCESS"); } + @Test + public void getVideoMonitor() throws ParseException { + ReturnT stringReturnT = this.certificatetDeadLineNotice(); + } + private void sendSmsByUserList(List userList, Date date,String personNotice) { //区分用户 for (String s : userList) { diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/basic/IImsPresonManagementService.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/basic/IImsPresonManagementService.java new file mode 100644 index 0000000..bc00a78 --- /dev/null +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/basic/IImsPresonManagementService.java @@ -0,0 +1,21 @@ +package com.hnac.hzims.scheduled.service.basic; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import com.hnac.hzims.basic.entity.PersonManagemetEntity; +import com.hnac.hzims.basic.vo.PersonManagemetExportVo; +import com.hnac.hzims.basic.vo.PersonManagemetVo; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; + +import java.util.List; + +/** + * 服务类 + * + * @author Chill + */ +public interface IImsPresonManagementService extends IService { + + +} diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/basic/impl/CertificatetNoticeServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/basic/impl/CertificatetNoticeServiceImpl.java index b4e956d..f1b2210 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/basic/impl/CertificatetNoticeServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/basic/impl/CertificatetNoticeServiceImpl.java @@ -1,5 +1,6 @@ package com.hnac.hzims.scheduled.service.basic.impl; +import com.baomidou.dynamic.datasource.annotation.DS; import com.hnac.hzims.basic.entity.CertificatetNoticeEntity; import com.hnac.hzims.scheduled.mapper.basic.CertificatetNoticeMapper; import com.hnac.hzims.scheduled.service.basic.IImsCertificatetNoticeService; @@ -17,5 +18,6 @@ import org.springframework.stereotype.Service; @Service @Slf4j @RequiredArgsConstructor +@DS("basic") public class CertificatetNoticeServiceImpl extends BaseServiceImpl implements IImsCertificatetNoticeService { } diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/basic/impl/CertificatetServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/basic/impl/CertificatetServiceImpl.java index 8849e80..79b890c 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/basic/impl/CertificatetServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/basic/impl/CertificatetServiceImpl.java @@ -1,5 +1,6 @@ package com.hnac.hzims.scheduled.service.basic.impl; +import com.baomidou.dynamic.datasource.annotation.DS; import com.hnac.hzims.basic.entity.CertificatetEntity; import com.hnac.hzims.scheduled.mapper.basic.CertificatetMapper; import com.hnac.hzims.scheduled.service.basic.IImsCertificatetService; @@ -17,5 +18,6 @@ import org.springframework.stereotype.Service; @Service @Slf4j @RequiredArgsConstructor +@DS("basic") public class CertificatetServiceImpl extends BaseServiceImpl implements IImsCertificatetService { } diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/basic/impl/PresonManagementServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/basic/impl/PresonManagementServiceImpl.java new file mode 100644 index 0000000..04b2f84 --- /dev/null +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/basic/impl/PresonManagementServiceImpl.java @@ -0,0 +1,27 @@ +package com.hnac.hzims.scheduled.service.basic.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hnac.hzims.basic.entity.PersonManagemetEntity; +import com.hnac.hzims.scheduled.mapper.basic.PersonManagemetMapper; +import com.hnac.hzims.scheduled.service.basic.IImsPresonManagementService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + + + +/** + * 人员信息实现类 + * + * @author ty + */ +@Service +@Slf4j +@RequiredArgsConstructor +@DS("basic") +public class PresonManagementServiceImpl extends BaseServiceImpl implements IImsPresonManagementService { + + + +} diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/basic/CertificatetMapper.xml b/hzims-service/hzims-scheduled/src/main/resources/mapper/basic/CertificatetMapper.xml similarity index 100% rename from hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/basic/CertificatetMapper.xml rename to hzims-service/hzims-scheduled/src/main/resources/mapper/basic/CertificatetMapper.xml diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/basic/CertificatetNoticeMapper.xml b/hzims-service/hzims-scheduled/src/main/resources/mapper/basic/CertificatetNoticeMapper.xml similarity index 100% rename from hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/basic/CertificatetNoticeMapper.xml rename to hzims-service/hzims-scheduled/src/main/resources/mapper/basic/CertificatetNoticeMapper.xml diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/basic/PersonManagemetMapper.xml b/hzims-service/hzims-scheduled/src/main/resources/mapper/basic/PersonManagemetMapper.xml similarity index 100% rename from hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/basic/PersonManagemetMapper.xml rename to hzims-service/hzims-scheduled/src/main/resources/mapper/basic/PersonManagemetMapper.xml