From e00d0891b7477fd97c766b2cc6a66cdec94bfc5e Mon Sep 17 00:00:00 2001 From: lige <bestlige@outlook.com> Date: 星期四, 14 十二月 2023 20:23:42 +0800 Subject: [PATCH] 体检套餐优化 --- ltkj-admin/src/test/java/zjhTest.java | 102 ++++++++++++++++++++++++++++++-------------------- 1 files changed, 61 insertions(+), 41 deletions(-) diff --git a/ltkj-admin/src/test/java/zjhTest.java b/ltkj-admin/src/test/java/zjhTest.java index 2904714..8ce92c8 100644 --- a/ltkj-admin/src/test/java/zjhTest.java +++ b/ltkj-admin/src/test/java/zjhTest.java @@ -1,26 +1,29 @@ -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; +import cn.hutool.core.date.DateTime; +import cn.hutool.core.date.DateUtil; import com.ltkj.LtkjApplication; -import com.ltkj.hosp.domain.TjOrder; +import com.ltkj.common.core.redis.RedisCache; +import com.ltkj.common.utils.SecurityUtils; +import com.ltkj.hosp.domain.DictHosp; import com.ltkj.hosp.service.*; import lombok.extern.slf4j.Slf4j; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.data.redis.core.Cursor; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.ScanOptions; +import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.test.context.junit4.SpringRunner; + import javax.annotation.Resource; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLConnection; +import java.util.ArrayList; +import java.util.Date; import java.util.List; -import java.util.Locale; /** @@ -32,42 +35,59 @@ @Slf4j @EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class}) public class zjhTest { - +// +// @Autowired +// private ITjGroupingProService groupingProService; +// @Autowired +// private ITjProjectService projectService; +// +// @Resource +// private ITjOrderService tjOrderService; +// @Resource +// private ITjOrderDetailService tjOrderDetailService; +// @Resource +// private ITjOrderRemarkService remarkService; +// + @Resource + private RedisCache redisCache; +// @Autowired - private ITjGroupingProService groupingProService; - @Autowired - private ITjProjectService projectService; - - @Resource - private ITjOrderService tjOrderService; - @Resource - private ITjOrderDetailService tjOrderDetailService; - @Resource - private ITjOrderRemarkService remarkService; + public RedisTemplate<Object,Object> redisTemplate; +// @Resource +// private StringRedisTemplate stringRedisTemplate; +@Resource +private IDictHospService dictHospService; + @Value("${token.secret_key}") + private String secret; @Test public void test() { -// List<TjOrder> list = tjOrderService.list(); -// for (TjOrder order : list) { -// if(null !=order.getConfirmStatus()){ -// if(order.getConfirmStatus().equals("0")){ -// if(order.getCheckStatus()==0){ -// order.setStatus(301); -// }else { -// order.setStatus(401); -// } -// }else { -// order.setStatus(299); -// } -// }else { -// if(order.getCheckStatus()==0){ -// order.setStatus(288); -// }else { -// order.setStatus(401); -// } +// List<DictHosp> list = dictHospService.list(); +// for (DictHosp dictHosp : list) { +// DateTime dateTime1 = DateUtil.offsetMonth(new Date(),6); +// String mallMerchantSecretKey = SecurityUtils.getMallMerchantSecretKey(secret,dictHosp.getHospAreaId(),dictHosp.getHospAreaName(),dictHosp.getExpirationTime()); +// dictHosp.setSecretKey(mallMerchantSecretKey); +// dictHosp.setExpirationTime(DateUtil.offsetDay(new Date(),30)); +// dictHospService.updateById(dictHosp); +// System.out.println(dateTime1); +// System.out.println("================================================="); +// System.out.println(mallMerchantSecretKey); + +// List<Object> list=new ArrayList<>(); +// ScanOptions options = ScanOptions.scanOptions().match("cS*").build(); +// try (Cursor<byte[]> cursor = redisTemplate.executeWithStickyConnection(redisConnection -> { +// return redisConnection.scan(options); +// })) { +// while (cursor.hasNext()) { +// byte[] keyBytes = cursor.next(); +// String key = new String(keyBytes); +// // 澶勭悊鍖归厤鐨刱ey +// List<Object> multiCacheMapValue = redisCache.getMultiCacheMapValue(key, null); +// list.add(multiCacheMapValue); // } -// tjOrderService.updateById(order); // } - log.info("鍢垮樋!!!"); +// System.out.println(list); + System.out.println(redisCache.getMultiCacheMapValue("check",null)); +// } } -- Gitblit v1.8.0