| | |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUnit; |
| | | 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.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; |
| | |
| | | // |
| | | // @Autowired |
| | | // private ITjGroupingProService groupingProService; |
| | | // @Autowired |
| | | // private ITjProjectService projectService; |
| | | @Autowired |
| | | private ITjProjectService projectService; |
| | | // |
| | | // @Resource |
| | | // private ITjOrderService tjOrderService; |
| | |
| | | @Test |
| | | public void test() { |
| | | // List<DictHosp> list = dictHospService.list(); |
| | | // DateTime dateTime1 = DateUtil.offsetMonth(new Date(),100); |
| | | // for (DictHosp dictHosp : list) { |
| | | // DateTime dateTime1 = DateUtil.offsetMonth(new Date(),6); |
| | | // String mallMerchantSecretKey = SecurityUtils.getMallMerchantSecretKey(secret,dictHosp.getHospAreaId(),dictHosp.getHospAreaName(),dictHosp.getExpirationTime()); |
| | | // String mallMerchantSecretKey = SecurityUtils.getMallMerchantSecretKey(secret,dictHosp.getHospAreaId(),dictHosp.getHospAreaName(),dateTime1); |
| | | // dictHosp.setSecretKey(mallMerchantSecretKey); |
| | | // dictHosp.setExpirationTime(DateUtil.offsetDay(new Date(),30)); |
| | | // dictHosp.setExpirationTime(dateTime1); |
| | | // 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); |
| | | // // 处理匹配的key |
| | | // List<Object> multiCacheMapValue = redisCache.getMultiCacheMapValue(key, null); |
| | | // list.add(multiCacheMapValue); |
| | | // } |
| | | // } |
| | | // System.out.println(list); |
| | | // System.out.println(redisCache.getMultiCacheMapValue("check",null)); |
| | | // } |
| | | } |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | // lat 39.97646 |
| | | //log 116.3039 |
| | | // String add = getAdd("116.3039", "39.97646"); |
| | | // JSONObject jsonObject = JSONObject.parseObject(add); |
| | | // JSONArray jsonArray = JSONArray.parseArray(jsonObject.getString("addrList")); |
| | | // JSONObject j_2 = JSONObject.parseObject(String.valueOf(jsonArray.get(0))); |
| | | // String allAdd = j_2.getString("admName"); |
| | | // String arr[] = allAdd.split(","); |
| | | // System.out.println("省:"+arr[0]+"\n市:"+arr[1]+"\n区:"+arr[2]); |
| | | |
| | | // String a ="你好哈哈哈哈哈哈"; |
| | | // String s = a.toUpperCase(Locale.ROOT); |
| | | // System.out.println(s); |
| | | // String dateStr1 = "2024-03-01 22:33:23"; |
| | | // Date date1 = DateUtil.parse(dateStr1); |
| | | // |
| | | ////相差一个月,31天 |
| | | // long betweenDay = DateUtil.between(new Date(),date1, DateUnit.DAY); |
| | | // System.out.println(betweenDay); |
| | | // System.out.println(DateUtil.between(new Date(),date1, DateUnit.MS)); |
| | | // System.out.println(DateUtil.between(new Date(),date1, DateUnit.SECOND)); |
| | | } |
| | | // |
| | | // public static String getAdd(String log, String lat ){ |