| | |
| | | package com.matrix; |
| | | |
| | | import cn.hutool.json.JSONArray; |
| | | import cn.hutool.json.JSONObject; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.matrix.component.redis.RedisClient; |
| | | import com.matrix.system.common.bean.SysFunction; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.matrix.system.hive.bean.MoneyCardUse; |
| | | import com.matrix.system.hive.dao.MoneyCardUseDao; |
| | | 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 com.rabbitmq.client.Delivery; |
| | | 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 java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 测试类示例 |
| | |
| | | @Autowired |
| | | SysVipInfoServiceImpl sysVipInfoService; |
| | | |
| | | @Autowired |
| | | RedisClient redisClient; |
| | | |
| | | |
| | | @Autowired |
| | | OrderDingDingNoticeTask orderDingDingNoticeTask; |
| | | |
| | | @Autowired |
| | | MoneyCardUseDao moneyCardUseDao; |
| | | |
| | | |
| | | @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())); |
| | | // 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<>(); |
| | | /*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); |
| | |
| | | SysFunction sysFunction = jsonArray.get(i, SysFunction.class); |
| | | System.out.println(sysFunction.getHasThisFn()); |
| | | } |
| | | */ |
| | | |
| | | |
| | | |