|
@@ -3,20 +3,29 @@ package thyyxxk.webserver.service.redislike;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.scheduling.annotation.Scheduled;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import thyyxxk.webserver.dao.his.redislike.RedisLikeDao;
|
|
|
+import thyyxxk.webserver.dao.his.zhuyuanyisheng.YiZhuLuRuDao;
|
|
|
import thyyxxk.webserver.entity.dictionary.CodeName;
|
|
|
import thyyxxk.webserver.entity.login.UserInfo;
|
|
|
+import thyyxxk.webserver.entity.zhuyuanyisheng.yizhuluru.YzZdOrderItemConfirm;
|
|
|
import thyyxxk.webserver.service.TokenService;
|
|
|
import thyyxxk.webserver.service.externalhttp.CorpWxSrvc;
|
|
|
import thyyxxk.webserver.utils.StringUtil;
|
|
|
import thyyxxk.webserver.utils.TokenUtil;
|
|
|
|
|
|
+import javax.annotation.PostConstruct;
|
|
|
import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.concurrent.ExecutorService;
|
|
|
+import java.util.concurrent.Executors;
|
|
|
|
|
|
@Service
|
|
|
@Slf4j
|
|
|
+@Component
|
|
|
public class RedisLikeService {
|
|
|
|
|
|
public final static String SCROLLING_MESSAGES = "scrollingMessages";
|
|
@@ -33,8 +42,11 @@ public class RedisLikeService {
|
|
|
private final static Map<String, UserInfo> USER_MAP = new HashMap<>();
|
|
|
private final static Map<String, String> YB_CONTACT_RELATION_MAP = new HashMap<>();
|
|
|
private final static Map<String, String> YB_DEPT_MAP = new HashMap<>();
|
|
|
+
|
|
|
+ public static final Map<String, YzZdOrderItemConfirm> specialMedicalAdvice = new HashMap<>();
|
|
|
private final RedisLikeDao dao;
|
|
|
private final CorpWxSrvc srvc;
|
|
|
+ private final YiZhuLuRuDao yzDao;
|
|
|
private final TokenService tokenService;
|
|
|
|
|
|
private final static Map<String, String> MESSAGE = new HashMap<>(2);
|
|
@@ -47,9 +59,10 @@ public class RedisLikeService {
|
|
|
return MESSAGE;
|
|
|
}
|
|
|
|
|
|
- public RedisLikeService(RedisLikeDao dao, CorpWxSrvc srvc, TokenService tokenService) {
|
|
|
+ public RedisLikeService(RedisLikeDao dao, CorpWxSrvc srvc, YiZhuLuRuDao yzDao, TokenService tokenService) {
|
|
|
this.dao = dao;
|
|
|
this.srvc = srvc;
|
|
|
+ this.yzDao = yzDao;
|
|
|
this.tokenService = tokenService;
|
|
|
}
|
|
|
|
|
@@ -248,4 +261,18 @@ public class RedisLikeService {
|
|
|
USER_MAP.remove(code);
|
|
|
getUserInfoByCode(code);
|
|
|
}
|
|
|
+
|
|
|
+ @PostConstruct
|
|
|
+ public void initSpecialMedicalAdvice() {
|
|
|
+ refreshSpecialMedicalAdvice();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Scheduled(cron = "0 0 0 * * ?")
|
|
|
+ public void refreshSpecialMedicalAdvice() {
|
|
|
+ specialMedicalAdvice.clear();
|
|
|
+ List<YzZdOrderItemConfirm> list = yzDao.selectYzItemConfirm();
|
|
|
+ list.forEach(item -> {
|
|
|
+ specialMedicalAdvice.put(item.getOrderCode(), item);
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|