From a6e6348c8008fd3984fc0f42323c17b322be142f Mon Sep 17 00:00:00 2001 From: zjh <1084500556@qq.com> Date: 星期二, 23 一月 2024 14:50:16 +0800 Subject: [PATCH] zjh 2024/01/23--2 --- ltkj-admin/src/test/java/zjhTest.java | 64 ++++++++++++++++++++++--------- 1 files changed, 45 insertions(+), 19 deletions(-) diff --git a/ltkj-admin/src/test/java/zjhTest.java b/ltkj-admin/src/test/java/zjhTest.java index b5caa2e..d0cc02f 100644 --- a/ltkj-admin/src/test/java/zjhTest.java +++ b/ltkj-admin/src/test/java/zjhTest.java @@ -1,19 +1,32 @@ +import cn.hutool.core.date.DateTime; +import cn.hutool.core.date.DateUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ltkj.LtkjApplication; import com.ltkj.common.core.redis.RedisCache; +import com.ltkj.common.utils.SecurityUtils; +import com.ltkj.hosp.domain.DictHosp; +import com.ltkj.hosp.domain.TjProject; 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 org.springframework.web.bind.annotation.PostMapping; import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; /** @@ -25,32 +38,45 @@ @Slf4j @EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class}) public class zjhTest { - - @Autowired - private ITjGroupingProService groupingProService; +// +// @Autowired +// private ITjGroupingProService groupingProService; @Autowired private ITjProjectService projectService; - - @Resource - private ITjOrderService tjOrderService; - @Resource - private ITjOrderDetailService tjOrderDetailService; - @Resource - private ITjOrderRemarkService remarkService; - +// +// @Resource +// private ITjOrderService tjOrderService; +// @Resource +// private ITjOrderDetailService tjOrderDetailService; +// @Resource +// private ITjOrderRemarkService remarkService; +// @Resource private RedisCache redisCache; - +// @Autowired - public RedisTemplate<String,String> redisTemplate; - @Resource - private StringRedisTemplate stringRedisTemplate; - + public RedisTemplate<Object,Object> redisTemplate; +// @Resource +// private StringRedisTemplate stringRedisTemplate; +@Resource +private IDictHospService dictHospService; + @Value("${token.secret_key}") + private String secret; @Test public void test() { -// redisCache.setCacheObject("璧典匠璞�","hahahahaha"); -// log.info("鍢垮樋!!!"); - } +// List<DictHosp> list = dictHospService.list(); +// DateTime dateTime1 = DateUtil.offsetMonth(new Date(),100); +// for (DictHosp dictHosp : list) { +// String mallMerchantSecretKey = SecurityUtils.getMallMerchantSecretKey(secret,dictHosp.getHospAreaId(),dictHosp.getHospAreaName(),dateTime1); +// dictHosp.setSecretKey(mallMerchantSecretKey); +// dictHosp.setExpirationTime(dateTime1); +// dictHospService.updateById(dictHosp); +// System.out.println(dateTime1); +// System.out.println("================================================="); +// System.out.println(mallMerchantSecretKey); +// } + + } public static void main(String[] args) { -- Gitblit v1.8.0