From 3caee5ce51a218f4bc1f3757a4d09b0ed18aa6df Mon Sep 17 00:00:00 2001
From: 44323 <443237572@qq.com>
Date: 星期一, 06 十一月 2023 14:21:12 +0800
Subject: [PATCH] 后台bug修改

---
 cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCoursePackageController.java |   29 +++++++++++++++++++++++++----
 1 files changed, 25 insertions(+), 4 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 4bbf06d..f2c32b3 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;
@@ -252,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.queryCoachByOperatorId(UserExt.getUser().getObjectId());
-        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);
 
 
@@ -412,6 +423,8 @@
             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";
     }
@@ -865,7 +878,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;
@@ -881,7 +895,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);
+            }
         }
 
 

--
Gitblit v1.7.1