| | |
| | | //package com.stylefeng.guns; |
| | | // |
| | | //import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | //import com.stylefeng.guns.modular.system.model.AssignOrder; |
| | | //import com.stylefeng.guns.modular.system.model.Company; |
| | | //import com.stylefeng.guns.modular.system.service.IAssignOrderService; |
| | | //import com.stylefeng.guns.modular.system.service.ICompanyCityService; |
| | | //import com.stylefeng.guns.modular.system.util.RedisUtil; |
| | | //import org.junit.Test; |
| | | //import org.junit.runner.RunWith; |
| | | //import org.springframework.beans.factory.annotation.Autowired; |
| | | //import org.springframework.boot.test.context.SpringBootTest; |
| | | //import org.springframework.test.context.junit4.SpringRunner; |
| | | // |
| | |
| | | //@SpringBootTest |
| | | //public class GunsApplicationTest { |
| | | // |
| | | // @Resource |
| | | // private RedisUtil redisUtil; |
| | | // @Autowired |
| | | // private ICompanyCityService companyCityService; |
| | | // |
| | | // @Autowired |
| | | // private IAssignOrderService assignOrderService; |
| | | // |
| | | // @Test |
| | | // public void test(){ |
| | | // boolean lock = redisUtil.lock("key_test", 10, 30); |
| | | // if(lock){ |
| | | // System.err.println("-----------------"); |
| | | // try { |
| | | // Company query = companyCityService.query("104.2350778537", "28.1113837348"); |
| | | // AssignOrder assignOrder = assignOrderService.selectOne(new EntityWrapper<AssignOrder>().eq("companyId", query.getId()).eq("type", 1)); |
| | | // System.err.println(assignOrder); |
| | | // }catch (Exception e){ |
| | | // e.printStackTrace(); |
| | | // } |
| | | //// redisUtil.unlock("key_test"); |
| | | // lock = redisUtil.lock("key_test", 10, 30); |
| | | // if(lock){ |
| | | // System.err.println("!!!!!!!!!!!!!!!!!!!!"); |
| | | // return; |
| | | // } |
| | | // System.err.println("*****************"); |
| | | // } |
| | | //} |