diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/GetPatientInfoTask.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/GetPatientInfoTask.java index d1b3c5a..fa91415 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/GetPatientInfoTask.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/GetPatientInfoTask.java @@ -57,15 +57,19 @@ public class GetPatientInfoTask { private LymsTcardService lymsTcardService;//问诊卡信息 @Autowired private LymsHisInfoService lymsHisInfoService;//问诊卡信息 - + @Value("${getAccessToken.on_off}") + public boolean on_off;//配置yml 微信公众号获取access_token(测试环境部署不要开启。会与线上环境冲突) /** * 获取医院患者信息。添加到问诊平台患者信息 * 10分钟执行一次 */ @Scheduled(cron = "0 */10 * * * ?") -// @Scheduled(cron = "0 */5 * * * ?"up)//测试用 +// @Scheduled(cron = "0 */5 * * * ?")//测试用 public void getPatientInfo() throws Exception { + if(!on_off){ + return; + } //每次执行时间范围是上一个小时 String param = collateTime(); if (StringUtil.isNotEmpty(param)) { diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/PushArticleTask.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/PushArticleTask.java index 589920b..607758d 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/PushArticleTask.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/PushArticleTask.java @@ -12,6 +12,7 @@ import com.lyms.talkonlineweb.util.WeiXinUtil; import lombok.Data; import lombok.extern.log4j.Log4j2; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; @@ -27,6 +28,8 @@ import static com.lyms.talkonlineweb.util.DateUtil.YYYY_MM_DD; @Component @Log4j2 public class PushArticleTask { + @Value("${getAccessToken.on_off}") + public boolean on_off;//配置yml 微信公众号获取access_token(测试环境部署不要开启。会与线上环境冲突) @Autowired private LymsArticleService lymsArticleService; @@ -53,6 +56,9 @@ public class PushArticleTask { @Scheduled(cron = "0 0 18 * * ?") // @Scheduled(cron = "0 15 17 * * ?")//测试用 下午5点15 public void pushArtcle(){ + if(!on_off){ + return; + } Map param=new HashMap<>(); param.put("vtype",999); List dcLst=lymsDictService.listByMap(param); diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/PushArticleTaskData.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/PushArticleTaskData.java index 6452ee1..2ea99bb 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/PushArticleTaskData.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/PushArticleTaskData.java @@ -14,6 +14,7 @@ import lombok.extern.log4j.Log4j2; import org.springframework.beans.BeanUtils; import org.springframework.beans.BeansException; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; @@ -30,7 +31,8 @@ import static com.lyms.talkonlineweb.util.DateUtil.YYYY_MM_DD; @Component @Log4j2 public class PushArticleTaskData { - + @Value("${getAccessToken.on_off}") + public boolean on_off;//配置yml 微信公众号获取access_token(测试环境部署不要开启。会与线上环境冲突) @Autowired private LymsArticleService lymsArticleService; @Autowired @@ -59,8 +61,10 @@ public class PushArticleTaskData { */ @Scheduled(cron = "0 0 17 * * ?") // @Scheduled(cron = "0 */3 * * * ?")//测试用 - @Transactional(rollbackFor = Exception.class) public void pushArtcleData(){ + if(!on_off){ + return; + } Map param=new HashMap<>(); param.put("vtype",999); List dcLst=lymsDictService.listByMap(param); diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/PushChatInfoTask.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/PushChatInfoTask.java index cf7097b..5efa742 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/PushChatInfoTask.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/PushChatInfoTask.java @@ -66,6 +66,8 @@ public class PushChatInfoTask { private LymsPushVisitRecordService lymsPushVisitRecordService; @Autowired private PushArticleTask pushArticleTask; + @Value("${getAccessToken.on_off}") + public boolean on_off;//配置yml 微信公众号获取access_token(测试环境部署不要开启。会与线上环境冲突) /** * 每天19点执行自动回访功能 @@ -77,6 +79,9 @@ public class PushChatInfoTask { */ @Scheduled(cron = "0 0 19 * * ?") public void pushChatInfo() { + if(!on_off){ + return; + } //用户下的病例信息。每个环信群组代表一个病例,一个病例下有多个疾病种类。 List> PcInfoList=lymsPatientService.getPcInfoList(); for (Map map : PcInfoList) { diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/PushIllnessTypeData.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/PushIllnessTypeData.java index 3ce30f9..6abc5a3 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/PushIllnessTypeData.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/PushIllnessTypeData.java @@ -12,6 +12,7 @@ import com.lyms.talkonlineweb.util.DateUtil; import com.lyms.talkonlineweb.util.StringUtil; import lombok.extern.log4j.Log4j2; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; import org.springframework.scheduling.annotation.Scheduled; @@ -30,7 +31,8 @@ public class PushIllnessTypeData { @Autowired private LymsPushIllnessMsgService lymsPushIllnessMsgService; - + @Value("${getAccessToken.on_off}") + public boolean on_off;//配置yml 微信公众号获取access_token(测试环境部署不要开启。会与线上环境冲突) /** @@ -38,6 +40,9 @@ public class PushIllnessTypeData { */ @Scheduled(cron = "0 0 0 * * ?") public void PushIllnessTypeData(){ + if(!on_off){ + return; + } Map param=new HashMap<>(); param.put("push_type", 0); final List list = lymsPushIllnessMsgService.listByMap(param); diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/PushIllnessTypeTask.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/PushIllnessTypeTask.java index 1247786..f4c7bde 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/PushIllnessTypeTask.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/PushIllnessTypeTask.java @@ -12,6 +12,7 @@ import lombok.extern.log4j.Log4j2; import org.springframework.beans.BeanUtils; import org.springframework.beans.BeansException; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; import org.springframework.scheduling.annotation.Scheduled; @@ -35,7 +36,8 @@ public class PushIllnessTypeTask { @Autowired private LymsPushIllnessMsgService lymsPushIllnessMsgService; - + @Value("${getAccessToken.on_off}") + public boolean on_off;//配置yml 微信公众号获取access_token(测试环境部署不要开启。会与线上环境冲突) /** @@ -43,6 +45,9 @@ public class PushIllnessTypeTask { */ @Scheduled(cron = "0 30 18 * * ?") public void PushIllnessTypeTask(){ + if(!on_off){ + return; + } Map param=new HashMap<>(); param.put("push_type", 0); final List list = lymsPushIllnessMsgService.listByMap(param); @@ -60,7 +65,7 @@ public class PushIllnessTypeTask { map.put("keyword3",new DataEntity(lymsPushIllnessMsg.getDname(),"#173177")); map.put("keyword4",new DataEntity(lymsPushIllnessMsg.getDtname(),"#173177")); map.put("keyword5",new DataEntity(lymsPushIllnessMsg.getValue(),"#173177")); - String illnessType="疾病种类"; + String illnessType=""; if(null!=lymsPushIllnessMsg.getIllnessType()){ illnessType=(1==lymsPushIllnessMsg.getIllnessType()?"普通疾病":"慢性病"); }