From 10ad2e710d2bd52aac31d5d63a7bb6beae76b6a8 Mon Sep 17 00:00:00 2001
From: KKSU <15274802129@163.com>
Date: Tue, 07 Nov 2023 14:35:32 +0800
Subject: [PATCH] 用户列表增加搜索条件
---
src/test/java/cc/mrbird/febs/ProfitTest.java | 216 +++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 207 insertions(+), 9 deletions(-)
diff --git a/src/test/java/cc/mrbird/febs/ProfitTest.java b/src/test/java/cc/mrbird/febs/ProfitTest.java
index 9df3b58..9babaf5 100644
--- a/src/test/java/cc/mrbird/febs/ProfitTest.java
+++ b/src/test/java/cc/mrbird/febs/ProfitTest.java
@@ -1,11 +1,17 @@
package cc.mrbird.febs;
+import cc.mrbird.febs.mall.mapper.ChatUserMapper;
import cc.mrbird.febs.mall.service.IAgentService;
-import cc.mrbird.febs.mall.service.IMemberProfitService;
-import cc.mrbird.febs.rabbit.consumer.AgentConsumer;
+import cc.mrbird.febs.rabbit.producter.AgentProducer;
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.date.DateTime;
+import cn.hutool.core.date.DateUtil;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
+
+import java.math.BigDecimal;
+import java.util.List;
/**
* @author wzy
@@ -14,17 +20,209 @@
@SpringBootTest
public class ProfitTest {
- @Autowired
- private AgentConsumer agentConsumer;
+ public static void main(String[] args) {
+ BigDecimal bigDecimal = new BigDecimal("290000");
+ BigDecimal bigDecimal1 = new BigDecimal("0.000244427982");
+ BigDecimal bigDecimal2 = bigDecimal.multiply(bigDecimal1).setScale(2, BigDecimal.ROUND_DOWN);
+ BigDecimal divide = bigDecimal.divide(bigDecimal1, 8, BigDecimal.ROUND_DOWN);
+ System.out.println(bigDecimal2);
+ System.out.println(divide);
+ }
+ /**
+ * 22977.21 回流的30%
+ *
+ * 344,632.0667 实际入金
+ */
+// @Autowired
+// private AgentConsumer agentConsumer;
+//
@Autowired
- private IAgentService agentService;
-
+ private AgentProducer agentProducer;
+//
@Autowired
- private IMemberProfitService memberProfitService;
-
+ private ChatUserMapper chatUserMapper;
+////
+//// @Autowired
+//// private IMemberProfitService memberProfitService;
+////
@Test
public void dynamicProfit() {
- memberProfitService.dynamicProfit(43L);
+ for(int i =0;i<75;i++){
+ agentProducer.sendAddRobotMsg("32074345");
+ }
+// agentService.autoUpAgentLevel(640L);
}
+ @Test
+ public void agentProfit() {
+
+ DateTime date = DateUtil.date();
+ DateTime dateTime = DateUtil.offsetHour(date, -26);
+ System.out.println("dateTime:"+dateTime);
+ chatUserMapper.deleteMsgByCreateTime(dateTime);
+ List<Long> ids = chatUserMapper.selectChatRedBagByCreateTime(dateTime);
+ if(CollUtil.isNotEmpty(ids)){
+ Long aLong = ids.get(0);
+ chatUserMapper.deleteChatRedBagById(aLong);
+
+ List<Long> recordIds = chatUserMapper.selectChatRedBagRecordByRebBagId(aLong);
+ if(CollUtil.isNotEmpty(recordIds)){
+ Long aLong1 = recordIds.get(0);
+ chatUserMapper.deleteChatRedBagRecordById(aLong1);
+ }
+ }
+ }
+//
+//
+//// @Test
+//// public void staticProfit() {
+//// memberProfitService.staticProfit(new Date());
+//// }
+//
+// @Test
+// public void thankfulProfit() {
+// memberProfitService.thankfulProfit(new Date());
+// }
+//
+// @Test
+// public void rankProfit() {
+// memberProfitService.rankProfit();
+// }
+//
+// @Autowired
+// private MallOrderInfoMapper mallOrderInfoMapper;
+//
+// @Test
+// public void directorProfitTest() {
+// memberProfitService.storeAndDirectorProfit(new Date());
+// }
+//
+// @Autowired
+// private MallOrderItemMapper mallOrderItemMapper;
+//
+// @Autowired
+// private IMallAchieveService mallAchieveService;
+//
+// @Test
+// public void achieveTest() {
+// List<MallOrderItem> items = mallOrderItemMapper.selectList(null);
+// for (MallOrderItem item : items) {
+// mallAchieveService.add(item.getId());
+// }
+// }
+//
+// @Test
+// public void paramTest() {
+// Map<String, Integer> map = new HashMap<>();
+// BigDecimal amount = new BigDecimal("100");
+// map.put("amount", 1);
+// changeAmount(map);
+// System.out.println(map.get("amount"));
+// }
+//
+// public void changeAmount(Map<String, Integer> amount) {
+// amount.put("amount", 2);
+// }
+//
+// @Test
+// public void scorePool(){
+// memberProfitService.scorePool();
+// }
+//
+// @Test
+// public void staticProfit(){
+// memberProfitService.staticProfit(null);
+// }
+//
+// @Autowired
+// private OrderSettlementJob orderSettlementJob;
+//
+// @Test
+// public void orderSettlementJobTest() {
+//// orderSettlementJob.normalGoodsSettlementJob();
+//
+// mallAchieveService.add(83L);
+// }
+//
+//
+// @Autowired
+// private UnipayService unipayService;
+// @Test
+// public void unipay(){
+// UnipayDto unipayDto = new UnipayDto();
+// unipayDto.setAmount(new BigDecimal("0.01"));
+// unipayDto.setFrpCode("ALIPAY_H5");
+// unipayDto.setTradeMerchantNo("777180800385820");
+//// unipayDto.setFrpCode("WEIXIN_APP3");
+// unipayDto.setOrderNo("2022082316415386395");
+// unipayDto.setProductName("洗护套装");
+// unipayService.unipay(unipayDto);
+// }
+// @Test
+// public void getAgreeMentPaySms(){
+// AgreeMentPaySmsDto agreeMentPaySmsDto = new AgreeMentPaySmsDto();
+// agreeMentPaySmsDto.setOrderNo("2022082617305930328");
+//
+// BigDecimal value = new BigDecimal("0.1").setScale(2, BigDecimal.ROUND_DOWN);
+// DecimalFormat decimalFormat = new DecimalFormat("0.00#");
+// String strVal = decimalFormat.format(value);
+// agreeMentPaySmsDto.setOrderAmount(new BigDecimal(strVal));
+// agreeMentPaySmsDto.setName("肖永");
+// agreeMentPaySmsDto.setCreatedTime(DateUtil.now());
+// agreeMentPaySmsDto.setIdType("1");
+// agreeMentPaySmsDto.setIdCardNum("430321199310113713");
+// agreeMentPaySmsDto.setBankNo("6222031901002389639");
+// agreeMentPaySmsDto.setPhone("15274802129");
+// String agreeMentPaySms = unipayService.getAgreeMentPaySms(agreeMentPaySmsDto);
+// if("JS000000".equals(agreeMentPaySms)){
+// System.out.println("获取成功");
+// }else{
+// System.out.println(agreeMentPaySms);
+// }
+// }
+//
+// @Test
+// public void agreementSign(){
+// AgreementSignDto agreementSignDto = new AgreementSignDto();
+// agreementSignDto.setOrderNo("2022082614465345250");
+// agreementSignDto.setSmsCode("841243");
+// unipayService.agreementSign(agreementSignDto);
+// }
+//
+// @Test
+// public void agreementPay(){
+// AgreementPayDto agreementPayDto = new AgreementPayDto();
+// agreementPayDto.setOrderNo("2022082614465345250");
+//
+// BigDecimal value = new BigDecimal("0.1").setScale(2, BigDecimal.ROUND_DOWN);
+// DecimalFormat decimalFormat = new DecimalFormat("0.00#");
+// String strVal = decimalFormat.format(value);
+// agreementPayDto.setOrderAmount(new BigDecimal(strVal));
+// agreementPayDto.setOrderTime(DateUtil.now());
+// agreementPayDto.setOrderDesc("测试");
+// agreementPayDto.setBankNo("6222031901002389639");
+// unipayService.agreementPay(agreementPayDto);
+// }
+//
+// @Test
+// public void singlePay(){
+// /**
+// * 调用汇聚代付
+// */
+// String orderNo = MallUtils.getOrderNum("W");
+// SinglePayDto singlePayDto = new SinglePayDto();
+// singlePayDto.setMerchantOrderNo(orderNo);
+// singlePayDto.setReceiverAccountNoEncBankNo("6222031903210023839639");
+// singlePayDto.setReceiverAccountNoEncName("肖永");
+// singlePayDto.setReceiverAccountType("201");
+// BigDecimal paidAmount = new BigDecimal(1.00);
+// singlePayDto.setPaidAmount(paidAmount);
+// singlePayDto.setCurrency("201");
+// singlePayDto.setIsChecked("202");
+// singlePayDto.setPaidDesc("用户提现");
+// singlePayDto.setPaidUse("202");
+// String singlePayRep = unipayService.singlePay(singlePayDto);
+//
+// System.out.println(singlePayRep);
+// }
}
--
Gitblit v1.9.1