lige
2023-11-30 3f28b46171934066aeeff9af80d3f0ce6afb3adf
ltkj-admin/src/test/java/zjhTest.java
@@ -1,11 +1,16 @@
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
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.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;
@@ -14,6 +19,8 @@
import org.springframework.test.context.junit4.SpringRunner;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
/**
@@ -25,31 +32,43 @@
@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
    public RedisTemplate<String,String> redisTemplate;
    @Resource
    private StringRedisTemplate stringRedisTemplate;
//
//    @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
//    public RedisTemplate<String,String> 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();
//        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);
//        }
    }