From c560f1a14ae1fc468d90e50e6a32d805295875da Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期一, 01 九月 2025 15:35:59 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/2.0' into 2.0
---
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TDiscountController.java | 123 ++++++++++++++++++++++++++++++++++++-----
1 files changed, 108 insertions(+), 15 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 5c09f57..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
@@ -72,6 +72,7 @@
public String index(Model model) {
List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0));
model.addAttribute("list",list);
+ model.addAttribute("role",UserExt.getUser().getObjectType());
return PREFIX + "TDiscount.html";
}
@RequestMapping("/audit")
@@ -142,11 +143,13 @@
private CoursePackageDiscountClient coursePackageDiscountClient;
@RequestMapping("/info")
public String info( Integer id, Model model) {
- TCoursePackage tCoursePackage1 = courseClient.queryByDiscountId(id);
- TCoursePackage tCoursePackage = coursePackageService.queryById(tCoursePackage1.getId());
+ 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;
@@ -163,29 +166,69 @@
}
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 PREFIX + "coursePackageDiscount.html";
}
@RequestMapping("/infoOne")
public String infoOne( Integer id, Model model) {
- Integer state = courseClient.queryDiscountById(id);
- if(state==1){
- model.addAttribute("stateStr","待审核");
- model.addAttribute("state",1);
- }else {
- model.addAttribute("stateStr","未通过");
- model.addAttribute("state",3);
- }
-
- TCoursePackage tCoursePackage1 = courseClient.queryByDiscountId(id);
- TCoursePackage tCoursePackage = coursePackageService.queryById(tCoursePackage1.getId());
+ 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;
@@ -202,11 +245,59 @@
}
map.put("payment", payment);
map.put("cashPayment", coursePackagePaymentConfig.getCashPayment());
- List<TCoursePackageDiscount> tCoursePackageDiscounts = coursePackageDiscountClient.queryCoursePackageDiscountOne(coursePackagePaymentConfig.getId());
+
+ 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";
}
@@ -226,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