From b27efc697f2f81e0d0f247a2708e58af52a5df9b Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期四, 23 十月 2025 15:14:33 +0800
Subject: [PATCH] bug修改,后台新增修改用户积分
---
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TDiscountController.java | 139 ++++++++++++++++++++++++++++++++++------------
1 files changed, 102 insertions(+), 37 deletions(-)
diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TDiscountController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TDiscountController.java
index ebdf705..bf025a0 100644
--- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TDiscountController.java
+++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TDiscountController.java
@@ -147,39 +147,9 @@
model.addAttribute("item", tCoursePackage);
List<CoursePackagePaymentConfig> list4 = coursePackagePaymentConfigClient.queryCoursePackagePaymentConfigList(id);
List<Map<String, Object>> list = new ArrayList<>();
- for (CoursePackagePaymentConfig coursePackagePaymentConfig : list4) {
- if(coursePackagePaymentConfig.getCashPayment() == 0){
- continue;
- }
- Map<String, Object> map = new HashMap<>();
- map.put("coursePackagePaymentConfigId", coursePackagePaymentConfig.getId());
- map.put("classHours", coursePackagePaymentConfig.getClassHours());
- String payment = "";
- if(coursePackagePaymentConfig.getCashPayment() > 0){
- payment += "现金支付";
- }
- if(coursePackagePaymentConfig.getPlayPaiCoin() > 0){
- payment += (ToolUtil.isNotEmpty(payment) ? "、" : "") + "玩湃币支付";
- }
- map.put("payment", payment);
- map.put("cashPayment", coursePackagePaymentConfig.getCashPayment());
- List<TCoursePackageDiscount> tCoursePackageDiscounts = coursePackageDiscountClient.queryCoursePackageDiscount(coursePackagePaymentConfig.getId());
- map.put("coursePackageDiscount", tCoursePackageDiscounts);
- list.add(map);
- }
- model.addAttribute("role",UserExt.getUser().getObjectType());
- model.addAttribute("type",tCoursePackage.getType());
- model.addAttribute("coursePackagePaymentConfig", JSON.toJSONString(list));
- return PREFIX + "coursePackageDiscount.html";
- }
- @RequestMapping("/infoOne")
- public String infoOne( Integer id, Model model) {
- TCoursePackage tCoursePackage = coursePackageService.queryById(id);
- model.addAttribute("item", tCoursePackage);
- List<CoursePackagePaymentConfig> list4 = coursePackagePaymentConfigClient.queryCoursePackagePaymentConfigList(id);
- List<Map<String, Object>> list = new ArrayList<>();
// 拒绝理由
StringBuilder reasons = new StringBuilder("");
+ int a =0;
for (CoursePackagePaymentConfig coursePackagePaymentConfig : list4) {
if(coursePackagePaymentConfig.getCashPayment() == 0){
continue;
@@ -196,13 +166,25 @@
}
map.put("payment", payment);
map.put("cashPayment", coursePackagePaymentConfig.getCashPayment());
+
List<TCoursePackageDiscount> tCoursePackageDiscounts = coursePackageDiscountClient.queryCoursePackageDiscount(coursePackagePaymentConfig.getId());
for (TCoursePackageDiscount tCoursePackageDiscount : tCoursePackageDiscounts) {
if (tCoursePackageDiscount.getAuditStatus()==3){
- reasons.append(tCoursePackageDiscount.getAuditRemark()+",");
+ a = 3;
model.addAttribute("type1",3);
- }else{
+ break;
+ }else if (tCoursePackageDiscount.getAuditStatus()==2){
+ a=2;
model.addAttribute("type1",-1);
+ }else{
+ a=1;
+ model.addAttribute("type1",-1);
+ break;
+ }
+ }
+ for (TCoursePackageDiscount tCoursePackageDiscount : tCoursePackageDiscounts) {
+ if (tCoursePackageDiscount.getAuditStatus()==3){
+ reasons.append(tCoursePackageDiscount.getAuditRemark()+",");
}
}
map.put("coursePackageDiscount", tCoursePackageDiscounts);
@@ -213,7 +195,7 @@
// 审核状态
StringBuilder stringBuilder = new StringBuilder("");
- switch (type1){
+ switch (a){
case 1:
stringBuilder.append("待审核");
break;
@@ -228,12 +210,93 @@
String string = reasons.toString();
if (!string.equals("")){
- String substring = string.substring(0, string.length() - 1);
- model.addAttribute("reasons", substring);
+ int index = string.indexOf(",");
+ String result = string.substring(0, index);
+ model.addAttribute("reasons", result);
}else{
model.addAttribute("reasons", "");
}
model.addAttribute("coursePackagePaymentConfig", JSON.toJSONString(list));
+ model.addAttribute("type2",tCoursePackage.getType());
+ return PREFIX + "coursePackageDiscount.html";
+ }
+ @RequestMapping("/infoOne")
+ public String infoOne( Integer id, Model model) {
+ TCoursePackage tCoursePackage = coursePackageService.queryById(id);
+ model.addAttribute("item", tCoursePackage);
+ List<CoursePackagePaymentConfig> list4 = coursePackagePaymentConfigClient.queryCoursePackagePaymentConfigList(id);
+ List<Map<String, Object>> list = new ArrayList<>();
+ // 拒绝理由
+ StringBuilder reasons = new StringBuilder("");
+ int a =0;
+ for (CoursePackagePaymentConfig coursePackagePaymentConfig : list4) {
+ if(coursePackagePaymentConfig.getCashPayment() == 0){
+ continue;
+ }
+ Map<String, Object> map = new HashMap<>();
+ map.put("coursePackagePaymentConfigId", coursePackagePaymentConfig.getId());
+ map.put("classHours", coursePackagePaymentConfig.getClassHours());
+ String payment = "";
+ if(coursePackagePaymentConfig.getCashPayment() > 0){
+ payment += "现金支付";
+ }
+ if(coursePackagePaymentConfig.getPlayPaiCoin() > 0){
+ payment += (ToolUtil.isNotEmpty(payment) ? "、" : "") + "玩湃币支付";
+ }
+ map.put("payment", payment);
+ map.put("cashPayment", coursePackagePaymentConfig.getCashPayment());
+
+ List<TCoursePackageDiscount> tCoursePackageDiscounts = coursePackageDiscountClient.queryCoursePackageDiscount(coursePackagePaymentConfig.getId());
+ for (TCoursePackageDiscount tCoursePackageDiscount : tCoursePackageDiscounts) {
+ if (tCoursePackageDiscount.getAuditStatus()==3){
+ a = 3;
+ model.addAttribute("type1",3);
+ break;
+ }else if (tCoursePackageDiscount.getAuditStatus()==2){
+ a=2;
+ model.addAttribute("type1",-1);
+ }else{
+ a=1;
+ model.addAttribute("type1",-1);
+ break;
+ }
+ }
+ for (TCoursePackageDiscount tCoursePackageDiscount : tCoursePackageDiscounts) {
+ if (tCoursePackageDiscount.getAuditStatus()==3){
+ reasons.append(tCoursePackageDiscount.getAuditRemark()+",");
+ }
+ }
+ map.put("coursePackageDiscount", tCoursePackageDiscounts);
+ list.add(map);
+ }
+ model.addAttribute("role",UserExt.getUser().getObjectType());
+ Integer type1 = tCoursePackage.getType();
+ // 审核状态
+ StringBuilder stringBuilder = new StringBuilder("");
+
+ switch (a){
+ case 1:
+ stringBuilder.append("待审核");
+ break;
+ case 2:
+ stringBuilder.append("已通过");
+ break;
+ case 3:
+ stringBuilder.append("未通过");
+ break;
+ }
+ model.addAttribute("type",stringBuilder);
+
+ String string = reasons.toString();
+ if (!string.equals("")){
+ int index = string.indexOf(",");
+ String result = string.substring(0, index);
+ model.addAttribute("reasons", result);
+ }else{
+ model.addAttribute("reasons", "");
+ }
+ model.addAttribute("coursePackagePaymentConfig", JSON.toJSONString(list));
+ model.addAttribute("type2",tCoursePackage.getType());
return PREFIX1 + "coursePackageDiscount.html";
}
@@ -254,7 +317,9 @@
}
List<TStore> list = storeService.list(wrapper);
Page<DiscountList> page = new PageFactory<DiscountList>().defaultPage();
- List<DiscountList> discountLists = courseClient.queryDiscountList(new QueryDiscountList(page.getCurrent(),page.getSize(),provinceCode,cityCode,name,type,list.stream().map(TStore::getId).collect(Collectors.toList())));
+ List<DiscountList> discountLists = courseClient.queryDiscountList(new QueryDiscountList
+ (page.getCurrent(),page.getSize(),provinceCode,cityCode,name,type,
+ list.stream().map(TStore::getId).collect(Collectors.toList())));
for (DiscountList discountList : discountLists) {
for (TStore tStore : list) {
if(discountList.getStoreId().equals(tStore.getId())){
--
Gitblit v1.7.1