From 7cb90b47c42b4ee5944964ad62ae89e7e6a2f9ca Mon Sep 17 00:00:00 2001
From: 44323 <443237572@qq.com>
Date: 星期五, 17 十一月 2023 09:03:36 +0800
Subject: [PATCH] 后台bug修改
---
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCoursePackageController.java | 106 ++++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 96 insertions(+), 10 deletions(-)
diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCoursePackageController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCoursePackageController.java
index 8459e35..8db1499 100644
--- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCoursePackageController.java
+++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCoursePackageController.java
@@ -10,6 +10,7 @@
import com.dsh.course.feignClient.account.CoachClient;
import com.dsh.course.feignClient.account.model.CityManager;
import com.dsh.course.feignClient.account.model.Coach;
+import com.dsh.course.feignClient.account.model.CoachSerchVO;
import com.dsh.course.feignClient.course.*;
import com.dsh.course.feignClient.course.model.*;
import com.dsh.course.feignClient.other.model.Site;
@@ -166,7 +167,9 @@
TStore store = list2.get(0);
List<TSite> list3 = siteService.list(new QueryWrapper<TSite>().eq("storeId", store.getId()).eq("state", 1));
model.addAttribute("site", list3);
- List<Coach> coaches = coachClient.queryCoachByCity(code1);
+
+
+ List<Coach> coaches = coachClient.queryCoachByOperatorId(objectId);
model.addAttribute("coach", coaches);
System.out.println("========type========"+type);
}
@@ -250,8 +253,18 @@
model.addAttribute("store", list2);
List<TSite> list3 = siteService.list(new QueryWrapper<TSite>().eq("storeId", tCoursePackage.getStoreId()).eq("state", 1));
model.addAttribute("site", list3);
- List<Coach> coaches = coachClient.queryCoachByCity(cityCode);
- model.addAttribute("coach", coaches);
+ if (UserExt.getUser().getObjectType() == 2){
+ List<Coach> coaches = coachClient.queryCoachByOperatorId(UserExt.getUser().getObjectId());
+ model.addAttribute("coach", coaches);
+ }else{
+ CoachQuery coachQuery = new CoachQuery();
+ coachQuery.setProvince(tCoursePackage.getProvince());
+ coachQuery.setCity(tCoursePackage.getCity());
+ List<CoachSerchVO> coachSerchVOS = coachClient.listAll(coachQuery);
+ model.addAttribute("coach",coachSerchVOS);
+ }
+
+
List<CoursePackagePaymentConfig> list4 = coursePackagePaymentConfigClient.queryCoursePackagePaymentConfigList(id);
@@ -374,6 +387,7 @@
System.out.println("=========coursePackagePaymentConfig=============>" + coursePackagePaymentConfig);
// model.addAttribute("couponIds", "3,2");
}
+
return PREFIX + "coursePackage_info.html";
}
@@ -410,10 +424,44 @@
map.put("coursePackageDiscount", tCoursePackageDiscounts);
list.add(map);
}
+ model.addAttribute("role",UserExt.getUser().getObjectType());
+ model.addAttribute("type",tCoursePackage.getType());
+ List<TCoursePackageDiscount> tCoursePackageDiscounts = coursePackageDiscountClient.queryByCoursePackageId1(tCoursePackage.getId());
+ if (tCoursePackageDiscounts.size()>0){
+ TCoursePackageDiscount tCoursePackageDiscount = tCoursePackageDiscounts.get(0);
+ model.addAttribute("audit",tCoursePackageDiscount.getAuditStatus());
+ StringBuilder stringBuilder = new StringBuilder("");
+ // 如果折扣未通过
+ if (tCoursePackageDiscount.getAuditStatus() == 3){
+ model.addAttribute("state","未通过");
+ for (TCoursePackageDiscount coursePackageDiscount : tCoursePackageDiscounts) {
+ stringBuilder.append(coursePackageDiscount.getAuditRemark()+",");
+ }
+ if (!stringBuilder.equals("")){
+ String string = stringBuilder.toString();
+ String substring = string.substring(0, string.length() - 1);
+ model.addAttribute("reasons",substring);
+ }else{
+ model.addAttribute("reasons",stringBuilder);
+ }
+ }else{
+ model.addAttribute("reasons",stringBuilder);
+ }
+ if(tCoursePackageDiscount.getAuditStatus() == 2){
+ model.addAttribute("state","已通过");
+ }
+ if (tCoursePackageDiscount.getAuditStatus() == 1){
+ model.addAttribute("state","待审核");
+ }
+ }else{
+ model.addAttribute("audit",2);
+ model.addAttribute("state",0);
+ model.addAttribute("reasons","");
+ }
+
model.addAttribute("coursePackagePaymentConfig", JSON.toJSONString(list));
return PREFIX + "coursePackageDiscount.html";
}
-
/**
* 跳转到报名列表页
@@ -595,8 +643,32 @@
model.addAttribute("auditStatus", tCoursePackage.getAuditStatus());
model.addAttribute("authRemark", tCoursePackage.getAuthRemark());
+ String classStartTime = tCoursePackage.getClassStartTime();
+ String classEndTime = tCoursePackage.getClassEndTime();
+ if (tCoursePackage.getStartTime()!=null) {
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+ String dateString = sdf.format(tCoursePackage.getStartTime());
+ String dateString1 = sdf.format(tCoursePackage.getEndTime());
+ model.addAttribute("holi", dateString + " - " + dateString1);
+ }
+ String[] split1 = classStartTime.split(",");
+ String[] split2 = classEndTime.split(",");
- model.addAttribute("classTime", tCoursePackage.getClassStartTime() + ":00 - " + tCoursePackage.getClassEndTime() + ":00");
+ List<String> listtime = new ArrayList<>();
+
+ for (int i = 0; i < split1.length; i++) {
+ String o = split1[i]+"-"+split2[i];
+ listtime.add(o);
+ }
+
+
+ model.addAttribute("time1",listtime.remove(0));
+ if (listtime.size()!=0) {
+ model.addAttribute("times", listtime);
+ }
+ model.addAttribute("classTime",
+ tCoursePackage.getClassStartTime() + ":00 - "
+ + tCoursePackage.getClassEndTime() + ":00");
String[] split = tCoursePackage.getClassWeeks().split(";");
List<String> list5 = Arrays.asList("周一", "周二", "周三", "周四", "周五", "周六", "周日");
List<Map<String, Object>> classWeeks = new ArrayList<>();
@@ -633,7 +705,8 @@
model.addAttribute("playPaiCoin", coursePackagePaymentConfig.getPlayPaiCoin() == 0 ? false : true);}
model.addAttribute("coursePackagePaymentConfig", list4.remove(0));
model.addAttribute("coursePackagePaymentConfigs", list4);
-
+ Integer type = tCoursePackage.getType();
+ model.addAttribute("type",type);
return PREFIX + "examineCoursePackage_info.html";
}
@@ -648,7 +721,6 @@
@ResponseBody
@PostMapping("/queryCity")
public List<Map<String, Object>> queryCity(String code){
-
Integer objectType = UserExt.getUser().getObjectType();
Integer objectId = UserExt.getUser().getObjectId();
String cityCode = null;
@@ -850,7 +922,8 @@
if(objectType == 3) {// 门店
storeIds.add(objectId);
}
- Page<Map<String, Object>> mapPage = coursePackageService.queryCoursePackageLists(provinceCode, cityCode, coursePackageTypeId, storeIds, name, status, state);
+ Page<Map<String, Object>> mapPage = coursePackageService.queryCoursePackageLists(provinceCode,
+ cityCode, coursePackageTypeId, storeIds, name, status, state);
return super.packForBT(mapPage);
}
@@ -863,7 +936,8 @@
*/
@ResponseBody
@PostMapping("/addCoursePackage")
- public ResultUtil addCoursePackage(TCoursePackage coursePackage, String coursePackagePaymentConfig) throws ParseException {
+ public ResultUtil addCoursePackage(TCoursePackage coursePackage,
+ String coursePackagePaymentConfig) throws ParseException {
String classStartTime = coursePackage.getClassStartTime();
// String classEndTime = coursePackage.getClassEndTime();
Date startDate = null;
@@ -879,7 +953,14 @@
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
startDate = dateFormat.parse(startDateString);
endDate = dateFormat.parse(endDateString);
-
+ if (coursePackage.getType() == 2){
+ startDate.setHours(0);
+ startDate.setMinutes(0);
+ startDate.setSeconds(0);
+ endDate.setHours(23);
+ endDate.setMinutes(59);
+ endDate.setSeconds(59);
+ }
}
@@ -931,6 +1012,7 @@
coursePackage.setProvinceCode(store.getProvinceCode());
coursePackage.setCity(store.getCity());
coursePackage.setCityCode(store.getCityCode());
+ coursePackage.setAuditStatus(1);
}
@@ -981,6 +1063,10 @@
// classEndTime = classEndTime.substring(0, classEndTime.lastIndexOf(":"));
coursePackage.setClassStartTime(firstString);
coursePackage.setClassEndTime(secondString);
+ coursePackage.setAuditStatus(2);
+ if (UserExt.getUser().getObjectType() != 1){
+ coursePackage.setAuditStatus(1);
+ }
coursePackageService.updateCoursePackage(coursePackage, coursePackagePaymentConfig);
return ResultUtil.success();
}
--
Gitblit v1.7.1