From ade617c7bd6899c0e9367e30303137bd6fc3dd81 Mon Sep 17 00:00:00 2001
From: KKSU <15274802129@163.com>
Date: Wed, 31 Jan 2024 11:42:16 +0800
Subject: [PATCH] 会员列表增加波卷功能
---
src/main/java/cc/mrbird/febs/mall/controller/AdminSystemController.java | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 50 insertions(+), 1 deletions(-)
diff --git a/src/main/java/cc/mrbird/febs/mall/controller/AdminSystemController.java b/src/main/java/cc/mrbird/febs/mall/controller/AdminSystemController.java
index b4d8cd2..64e7d6a 100644
--- a/src/main/java/cc/mrbird/febs/mall/controller/AdminSystemController.java
+++ b/src/main/java/cc/mrbird/febs/mall/controller/AdminSystemController.java
@@ -22,6 +22,8 @@
import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
+import java.util.Arrays;
+import java.util.List;
import java.util.Map;
@Slf4j
@@ -76,6 +78,12 @@
return new FebsResponse().fail().message("请刷新页面重试");
}
+ DataDictionaryCustom chargeAmountDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.CHARGE_AMOUNT.getType(),
+ DataDictionaryEnum.CHARGE_AMOUNT.getCode());
+ if(ObjectUtil.isEmpty(chargeAmountDic)){
+ return new FebsResponse().fail().message("请刷新页面重试");
+ }
+
String giveState = adminAgentAmountDto.getGiveState();
if(1 == Integer.parseInt(giveState)){
if(ObjectUtil.isEmpty(adminAgentAmountDto.getActivityBulletin())){
@@ -86,6 +94,12 @@
}
if(BigDecimal.ZERO.compareTo(new BigDecimal(adminAgentAmountDto.getGiveAmount())) > 0){
return new FebsResponse().fail().message("请输入正确的赠送金额");
+ }
+ if(ObjectUtil.isEmpty(adminAgentAmountDto.getChargeAmount())){
+ return new FebsResponse().fail().message("请输入正确的充值金额");
+ }
+ if(BigDecimal.ZERO.compareTo(new BigDecimal(adminAgentAmountDto.getChargeAmount())) > 0){
+ return new FebsResponse().fail().message("请输入正确的充值金额");
}
}
@@ -101,7 +115,17 @@
giveAmountDic.setValue(adminAgentAmountDto.getGiveAmount());
dataDictionaryCustomMapper.updateById(giveAmountDic);
- return new FebsResponse().success();
+ chargeAmountDic.setValue(adminAgentAmountDto.getChargeAmount());
+ dataDictionaryCustomMapper.updateById(chargeAmountDic);
+
+
+ DataDictionaryCustom minAmountDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+ DataDictionaryEnum.MIN_AMOUNT_IS_MEMBER.getType(),
+ DataDictionaryEnum.MIN_AMOUNT_IS_MEMBER.getCode());
+ minAmountDic.setValue(adminAgentAmountDto.getMinAmount());
+ dataDictionaryCustomMapper.updateById(minAmountDic);
+
+ return new FebsResponse().success().message("操作成功");
}
@PostMapping(value = "/agentDetail")
@@ -117,4 +141,29 @@
dataDictionaryCustomMapper.updateById(dic);
return new FebsResponse().success();
}
+
+// public static void main(String[] args) {
+// List<Integer> lines = Arrays.asList(new Integer[]{1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0});
+// //数字连续出现的计数
+// Integer symbol = 0;
+// //数字连续出现的次数限制
+// Integer times = 3;
+// //出现的数字
+// Integer symbolNum = 1;
+// //满足规则的次数
+// Integer timesOneSign = 0;
+// for(int i=0;i<lines.size();i++){
+// if(symbolNum == lines.get(i)){
+// symbol = symbol + 1;
+// if(symbol >= times){
+// timesOneSign = timesOneSign + 1;
+// symbol = 0;
+// }
+// }else{
+// symbol = 0;
+// }
+// }
+//
+// System.out.println(timesOneSign);
+// }
}
--
Gitblit v1.9.1