Helius
2022-05-19 7e6bbd05a75b07cb0717812d0b51aad128361012
src/test/java/cc/mrbird/febs/AgentTest.java
@@ -4,7 +4,10 @@
import cc.mrbird.febs.mall.dto.AgentLevelUpdateDto;
import cc.mrbird.febs.mall.entity.AgentInfo;
import cc.mrbird.febs.mall.entity.DataDictionaryCustom;
import cc.mrbird.febs.mall.entity.MallGoodsStyle;
import cc.mrbird.febs.mall.mapper.DataDictionaryCustomMapper;
import cc.mrbird.febs.mall.mapper.MallGoodsStyleMapper;
import cc.mrbird.febs.mall.quartz.ProfitJob;
import cc.mrbird.febs.mall.service.IAgentService;
import cc.mrbird.febs.rabbit.producter.AgentProducer;
import com.alibaba.fastjson.JSONObject;
@@ -15,6 +18,8 @@
import org.springframework.boot.test.context.SpringBootTest;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.List;
/**
 * @author wzy
@@ -32,6 +37,15 @@
    @Autowired
    private IAgentService agentService;
    @Autowired
    private MallGoodsStyleMapper mallGoodsStyleMapper;
    @Test
    public void skusTest() {
        List<MallGoodsStyle> mallGoodsStyles = mallGoodsStyleMapper.selectByGoodsId(1L);
        System.out.println(mallGoodsStyles);
    }
    @Test
    public void agentTest() {
@@ -98,6 +112,32 @@
    @Test
    public void autoLevelUp() {
        // agentService.autoUpAgentLevel(3L);
        agentProducer.sendAutoLevelUpMsg(3L);
//        agentProducer.sendAutoLevelUpMsg(5L);
        agentProducer.sendReturnMoneyMsg(2L);
    }
    @Test
    public void returnMoney() {
        // agentService.autoUpAgentLevel(3L);
//        agentProducer.sendAutoLevelUpMsg(5L);
//        agentProducer.sendReturnMoneyMsg(52L);
        agentService.returnMoneyToAgent(52L);
    }
    @Test
    public void bigdecimalTest() {
        BigDecimal aa = new BigDecimal("1.345");
        System.out.println(aa.setScale(2, RoundingMode.DOWN));
        System.out.println(aa.setScale(2, RoundingMode.UP));
    }
    @Autowired
    private ProfitJob profitJob;
    @Test
    public void profitJobTest() {
        profitJob.profitJob();
    }
}