| | |
| | | package com.matrix; |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.json.JSONArray; |
| | | import cn.hutool.json.JSONObject; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.matrix.component.redis.RedisClient; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.bean.SysFunction; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.fenxiao.constant.FenxiaoSettingConstant; |
| | | import com.matrix.system.fenxiao.dao.ShopSalesmanGradeDao; |
| | | import com.matrix.system.fenxiao.dao.ShopSalesmanOrderDao; |
| | | import com.matrix.system.fenxiao.entity.ShopSalesmanGrade; |
| | | import com.matrix.system.fenxiao.entity.ShopSalesmanOrder; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.SysOrderDao; |
| | | import com.matrix.system.hive.dao.SysOrderItemDao; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.system.hive.service.CodeService; |
| | | import com.matrix.system.hive.service.ShoppingGoodsService; |
| | | import com.matrix.system.hive.service.SysOrderService; |
| | | import com.matrix.system.hive.service.SysVipInfoService; |
| | | 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.bean.ShopOrder; |
| | | import com.matrix.system.shopXcx.bean.ShopOrderDetails; |
| | | import com.matrix.system.shopXcx.bean.ShopProduct; |
| | | import com.matrix.system.shopXcx.dao.ShopOrderDao; |
| | | import com.matrix.system.shopXcx.dao.ShopOrderDetailsDao; |
| | | import com.matrix.system.shopXcx.dao.ShopOrderV2Dao; |
| | | import com.matrix.system.shopXcx.dao.ShopSkuDao; |
| | | 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.BeanUtils; |
| | | 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 org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 测试类示例 |
| | | * |
| | | * |
| | | * @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 |
| | | ScoreVipDetailService scoreVipDetailService; |
| | | |
| | | |
| | | @Autowired |
| | | SysVipInfoServiceImpl sysVipInfoService; |
| | | |
| | | @Autowired |
| | | RedisClient redisClient; |
| | | |
| | | |
| | | @Autowired |
| | | OrderDingDingNoticeTask orderDingDingNoticeTask; |
| | | |
| | | @Test |
| | | @Rollback |
| | | public void testNoticeTask() throws IOException { |
| | | // orderDingDingNoticeTask.handle("",new Delivery(null,null,"1295".getBytes())); |
| | | |
| | | |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @Test |
| | | public void testSelectReceivedOrderCount() throws InterruptedException { |
| | | System.out.println( shopOrderV2Dao.selectReceivedOrderCount("oJkRK4yelehsY4S7I6Ee1ydWtQMI")); |
| | | } |
| | | |
| | | @Test |
| | | public void testCountOrderAmount() throws InterruptedException { |
| | | System.out.println( shopOrderV2Dao.countOrderAmount("oJkRK4yelehsY4S7I6Ee1ydWtQMI")); |
| | | } |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void countBuyZdcp() throws InterruptedException { |
| | | System.out.println( shopOrderV2Dao.countBuyZdcp("oJkRK4yelehsY4S7I6Ee1ydWtQMI","1167,1263,1262")); |
| | | } |
| | | @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()); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | } |