| | |
| | | package com.matrix; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.system.constance.Dictionary; |
| | | import com.matrix.system.hive.bean.MoneyCardUse; |
| | | import com.matrix.system.hive.bean.SysProjUse; |
| | | import com.matrix.system.hive.dao.MoneyCardUseDao; |
| | | import com.matrix.system.hive.dao.ShoppingGoodsDao; |
| | | import com.matrix.system.hive.service.SysProjUseService; |
| | | import com.matrix.system.hive.service.imp.SysVipInfoServiceImpl; |
| | | import com.matrix.system.score.dao.ScoreVipDetailDao; |
| | | import com.matrix.system.score.service.ScoreVipDetailService; |
| | | import com.matrix.system.shopXcx.dao.ShopOrderV2Dao; |
| | | import com.matrix.system.shopXcx.mqTask.OrderDingDingNoticeTask; |
| | | 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.annotation.Rollback; |
| | | import org.springframework.test.context.junit4.SpringRunner; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 测试类示例 |
| | | * |
| | | * |
| | | * @author jiangyouyao |
| | | * @email 512061637@qq.com |
| | | * @date 2019年2月25日 |
| | | */ |
| | | @RunWith(SpringRunner.class) |
| | | @SpringBootTest(classes = {ZqErpApplication.class},webEnvironment =SpringBootTest.WebEnvironment.RANDOM_PORT) |
| | | @SpringBootTest(classes = {ZqErpApplication.class}, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) |
| | | public class JyyTests { |
| | | |
| | | |
| | | @Autowired |
| | | private ShopOrderV2Dao shopOrderV2Dao; |
| | | @Autowired |
| | | private ShopOrderV2Dao shopOrderV2Dao; |
| | | |
| | | @Autowired |
| | | ScoreVipDetailDao scoreVipDetailDao; |
| | | @Autowired |
| | | ScoreVipDetailDao scoreVipDetailDao; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @Test |
| | | public void scoreVipDetailDao() throws InterruptedException { |
| | | System.out.println( scoreVipDetailDao.selectUserTotalScore("oJkRK4yelehsY4S7I6Ee1ydWtQMI",null)); |
| | | } |
| | | |
| | | @Test |
| | | public void testSelectReceivedOrderCount() throws InterruptedException { |
| | | System.out.println( shopOrderV2Dao.selectReceivedOrderCount("oJkRK4yelehsY4S7I6Ee1ydWtQMI")); |
| | | } |
| | | |
| | | @Test |
| | | public void testCountOrderAmount() throws InterruptedException { |
| | | System.out.println( shopOrderV2Dao.countOrderAmount("oJkRK4yelehsY4S7I6Ee1ydWtQMI")); |
| | | } |
| | | @Autowired |
| | | ScoreVipDetailService scoreVipDetailService; |
| | | |
| | | |
| | | @Test |
| | | public void countBuyZdcp() throws InterruptedException { |
| | | System.out.println( shopOrderV2Dao.countBuyZdcp("oJkRK4yelehsY4S7I6Ee1ydWtQMI","1167,1263,1262")); |
| | | } |
| | | @Autowired |
| | | SysVipInfoServiceImpl sysVipInfoService; |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | OrderDingDingNoticeTask orderDingDingNoticeTask; |
| | | |
| | | @Autowired |
| | | MoneyCardUseDao moneyCardUseDao; |
| | | @Resource |
| | | private SysProjUseService projUseService; |
| | | @Autowired |
| | | private ShoppingGoodsDao shoppingGoodsDao; |
| | | |
| | | @Test |
| | | public void testGetVipInfo(){ |
| | | |
| | | Long vipId = 111L; |
| | | AjaxResult result = AjaxResult.buildSuccessInstance("查询成功"); |
| | | SysProjUse queryUse = new SysProjUse(); |
| | | queryUse.setVipId(vipId); |
| | | queryUse.setType(Dictionary.SHOPPING_GOODS_TYPE_XM); |
| | | queryUse.setTaocanId(-1L); |
| | | queryUse.setStatus(Dictionary.TAOCAN_STATUS_YX); |
| | | List<SysProjUse> projList = projUseService.findInPage(queryUse, null); |
| | | //切换到套餐查询条件 |
| | | queryUse.setTaocanId(null); |
| | | queryUse.setType(Dictionary.SHOPPING_GOODS_TYPE_TC); |
| | | List<SysProjUse> taoCanList = projUseService.findInPage(queryUse, null); |
| | | taoCanList.forEach(item->{ |
| | | item.setTaocanProjUse(projUseService.selectTaocanProjUse(item.getId(), queryUse.getStatus())); |
| | | item.setProjInfo(shoppingGoodsDao.selectById(item.getProjId())); |
| | | }); |
| | | result.putInMap("projList", projList); |
| | | result.putInMap("taoCanList", taoCanList); |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void finxMoneyCardUserId() throws IOException { |
| | | long id=2531; |
| | | final List<MoneyCardUse> moneyCardUses = moneyCardUseDao.selectList(new LambdaQueryWrapper<MoneyCardUse>().gt(MoneyCardUse::getId, 2531)); |
| | | |
| | | for (MoneyCardUse moneyCardUs : moneyCardUses) { |
| | | moneyCardUseDao.updateId(moneyCardUs.getId(),++id); |
| | | } |
| | | |
| | | System.out.println(moneyCardUses.size()); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Test |
| | | @Rollback |
| | | public void testNoticeTask() throws IOException { |
| | | // orderDingDingNoticeTask.handle("",new Delivery(null,null,"1295".getBytes())); |
| | | List<JSONObject> storeReceiptWares =new ArrayList<>(); |
| | | JSONObject o=new JSONObject(); |
| | | o.put("id",12); |
| | | o.put("createBy",""); |
| | | |
| | | storeReceiptWares.add(o); |
| | | moneyCardUseDao.saveInTimeReceiptWare(storeReceiptWares); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void testRedis() { |
| | | |
| | | /*List<SysFunction> fnList = new ArrayList<>(); |
| | | fnList.add(new SysFunction()); |
| | | |
| | | Map map = new HashMap(); |
| | | map.put("a", fnList); |
| | | redisClient.saveMapValue("map", map); |
| | | */ |
| | | |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void testRedis2() { |
| | | /* |
| | | |
| | | String map = redisClient.getCachedValue("map"); |
| | | JSONObject json = JSONUtil.parseObj(map); |
| | | String a = json.get("a").toString(); |
| | | |
| | | |
| | | JSONArray jsonArray = JSONUtil.parseArray(a); |
| | | for (int i=0;i<jsonArray.size();i++){ |
| | | SysFunction sysFunction = jsonArray.get(i, SysFunction.class); |
| | | System.out.println(sysFunction.getHasThisFn()); |
| | | } |
| | | */ |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | } |