| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.ltkj.LtkjApplication; |
| | | import com.ltkj.hosp.domain.TjOrder; |
| | | import com.ltkj.common.core.redis.RedisCache; |
| | | import com.ltkj.hosp.service.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.junit.Test; |
| | |
| | | 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.RedisTemplate; |
| | | 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.List; |
| | | import java.util.Locale; |
| | | |
| | | |
| | | /** |
| | |
| | | private ITjOrderDetailService tjOrderDetailService; |
| | | @Resource |
| | | private ITjOrderRemarkService remarkService; |
| | | |
| | | @Resource |
| | | private RedisCache redisCache; |
| | | |
| | | @Autowired |
| | | public RedisTemplate<String,String> redisTemplate; |
| | | @Resource |
| | | private StringRedisTemplate stringRedisTemplate; |
| | | |
| | | @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); |
| | | // util.setDataBase(1); |
| | | // stringRedisTemplate.opsForValue().set("1","1"); |
| | | // ExecutorService pool = Executors.newFixedThreadPool(5); |
| | | // |
| | | // for (int i = 1; i < 6; i++) { |
| | | // int finalI = i; |
| | | // pool.execute(new Runnable() { |
| | | // @Override |
| | | // public void run() { |
| | | // try { |
| | | // redisCache.setDataBase(finalI); |
| | | // redisCache.setCacheObject("测试",finalI+"111111111111111111"); |
| | | // } catch (Exception e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // }else { |
| | | // order.setStatus(299); |
| | | // pool.shutdown(); |
| | | // } |
| | | // }else { |
| | | // if(order.getCheckStatus()==0){ |
| | | // order.setStatus(288); |
| | | // }else { |
| | | // order.setStatus(401); |
| | | // } |
| | | // } |
| | | // tjOrderService.updateById(order); |
| | | // }); |
| | | // } |
| | | log.info("嘿嘿!!!"); |
| | | } |