浏览代码

fix(system):
1.部门创建逻辑修改
2.查询补课课表

wzq 2 天之前
父节点
当前提交
1fd004ef4d

+ 9 - 1
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/controller/commercial/CommercialController.java

@@ -9,7 +9,9 @@ import io.swagger.v3.oas.annotations.media.Schema;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.modules.app.form.ClassPostponeForm;
 import org.jeecg.modules.app.form.CourseQueryUsersForm;
 import org.jeecg.modules.app.vo.FamilyUserVO;
@@ -177,9 +179,15 @@ public class CommercialController {
         return Result.OK(appOrderService.scanCodeVerification(orderProInfoIds));
     }
 
+    /**
+     * 查询补课课表
+     * @return
+     */
     @Operation(summary = "查询补课课表")
     @GetMapping("/queryMakeUpClassTable")
     public Result<List<AppCoursesPriceRules>> queryMakeUpClassTable() {
-        return Result.OK(appCoursesPriceRulesService.list(Wrappers.<AppCoursesPriceRules>lambdaQuery().eq(AppCoursesPriceRules::getCoursesType,1)));
+        LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        List<AppCoursesPriceRules> list = appCoursesPriceRulesService.list(Wrappers.<AppCoursesPriceRules>lambdaQuery().eq(AppCoursesPriceRules::getCoursesType, 1).eq(AppCoursesPriceRules::getOrgCode, loginUser.getOrgCode()));
+        return Result.OK(list);
     }
 }

+ 1 - 15
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/form/ClassPostponeForm.java

@@ -1,15 +1,12 @@
 package org.jeecg.modules.app.form;
 
-import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 import org.jeecg.modules.app.vo.FamilyUserVO;
-import org.springframework.format.annotation.DateTimeFormat;
 
 import java.io.Serializable;
-import java.util.Date;
 import java.util.List;
 
 @Data
@@ -22,20 +19,9 @@ public class ClassPostponeForm implements Serializable {
     @Schema(description = "订单ID")
     private String orderId;
 
-    @Schema(description = "所选课时ID")
+    @Schema(description = "所选补课课时ID")
     private String coursePriceRulesId;
 
-    //补课课时
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @Schema(description = "开始时间")
-    private Date startTime;
-
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @Schema(description = "结束时间")
-    private Date endTime;
-
     @Schema(description = "用户列表")
     private List<FamilyUserVO> familyUserVOList;
 

+ 3 - 13
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/impl/AppCoureseServiceImpl.java

@@ -377,7 +377,7 @@ public class AppCoureseServiceImpl extends ServiceImpl<AppCoursesMapper, AppCour
     public Boolean classPostpone(ClassPostponeForm form) {
 
         AppOrder appOrder = appOrderMapper.selectById(form.getOrderId());
-        //课时
+        //补课课时
         AppCoursesPriceRules appCoursesPriceRules = priceRulesMapper.selectById(form.getCoursePriceRulesId());
         //设置为延期状态
         appCoursesPriceRules.setClassStatus(CommonConstant.STATUS_1_INT);
@@ -389,16 +389,6 @@ public class AppCoureseServiceImpl extends ServiceImpl<AppCoursesMapper, AppCour
                     .setPostponeReason(form.getPostponeReason());
             appCoursesVerificationRecordMapper.updateById(appCoursesVerificationRecord);
         }
-        //补课新课时
-        AppCoursesPriceRules priceRules = new AppCoursesPriceRules();
-        priceRules.setOrgCode(appCoursesPriceRules.getOrgCode());
-        priceRules.setTenantId(appCoursesPriceRules.getTenantId());
-        priceRules.setCoursesId(appCoursesPriceRules.getCoursesId());
-        priceRules.setName("(补课)" + appCoursesPriceRules.getName());
-        priceRules.setStartTime(form.getStartTime());
-        priceRules.setEndTime(form.getEndTime());
-        priceRules.setCoursesType(CommonConstant.STATUS_1_INT);
-        priceRulesMapper.insert(priceRules);
 
         for (FamilyUserVO familyUserVO : form.getFamilyUserVOList()) {
             AppCoursesVerificationRecord verificationRecord = new AppCoursesVerificationRecord();
@@ -407,8 +397,8 @@ public class AppCoureseServiceImpl extends ServiceImpl<AppCoursesMapper, AppCour
             verificationRecord.setCoursesId(appOrder.getProductIds());
             verificationRecord.setCoursesPriceRuleId(appCoursesPriceRules.getId());
             verificationRecord.setCoursesName(appCoursesPriceRules.getName());
-            verificationRecord.setCoursesStartTime(form.getStartTime());
-            verificationRecord.setCoursesEndTime(form.getEndTime());
+            verificationRecord.setCoursesStartTime(appCoursesPriceRules.getStartTime());
+            verificationRecord.setCoursesEndTime(appCoursesPriceRules.getEndTime());
             verificationRecord.setUseUserId(familyUserVO.getFamilyUserId());
             verificationRecord.setUseUserName(familyUserVO.getFamilyUserName());
             verificationRecord.setUseUserImage(familyUserVO.getFamilyUserImage());

+ 1 - 1
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/impl/AppSitePlaceServiceImpl.java

@@ -855,7 +855,7 @@ public class AppSitePlaceServiceImpl extends ServiceImpl<AppSitePlaceMapper, App
     public AppSitePlaceParkDTO queryPack(String siteId) {
         AppSitePlaceParkDTO appSitePlaceParkDTO = new AppSitePlaceParkDTO();
         AppSite site = appSiteMapper.selectById(siteId);
-        List<AppSitePlace> appSitePlaceList = this.baseMapper.selectList(Wrappers.<AppSitePlace>lambdaQuery().eq(AppSitePlace::getSiteId, site.getId()));
+        List<AppSitePlace> appSitePlaceList = this.baseMapper.selectList(Wrappers.<AppSitePlace>lambdaQuery().eq(AppSitePlace::getSiteId, site.getId()).eq(AppSitePlace::getType, 1));
         if (ObjectUtils.isNotEmpty(appSitePlaceList)) {
             List<AppSiteCategoryRuleDTO> appSiteCategoryRuleDTOS = new ArrayList<>();
             if (CollUtil.isNotEmpty(appSitePlaceList)) {

+ 13 - 13
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysDepartServiceImpl.java

@@ -236,27 +236,27 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
             this.save(sysDepart);
 
             //若为学校或体育馆
-            if (Objects.equals(sysDepart.getOrgCategory(), "2") || Objects.equals(sysDepart.getOrgCategory(), "3")) {
+            if (Objects.equals(sysDepart.getOrgCategory(), "20") || Objects.equals(sysDepart.getOrgCategory(), "21")) {
                 //创建学校或体育馆的扩展信息内容
                 AppSite site = new AppSite();
                 site
                         .setTenantId(sysDepart.getId())
                         .setOrgCode(sysDepart.getOrgCode())
                         .setName(sysDepart.getDepartName())
-                        .setType(sysDepart.getOrgCategory().equals("2") ? 0 : 1);
+                        .setType(sysDepart.getOrgCategory().equals("20") ? 0 : 1);
                 appSiteMapper.insert(site);
                 //若为包场
-                if (Objects.equals(sysDepart.getOrgCategory(), "4")) {
-                    //常见默认类目
-                    List<String> categoryNames = List.of("篮球","足球","羽毛球","乒乓球","排球");
-                    for (int i = 0; i < categoryNames.size(); i++) {
-                        AppCategory category = new AppCategory();
-                        category.setOrgCode(site.getOrgCode());
-                        category.setTenantId(site.getTenantId());
-                        category.setName(categoryNames.get(i));
-                        category.setSort(i);
-                    }
-                }
+//                if (Objects.equals(sysDepart.getOrgCategory(), "4")) {
+//                    //常见默认类目
+//                    List<String> categoryNames = List.of("篮球","足球","羽毛球","乒乓球","排球");
+//                    for (int i = 0; i < categoryNames.size(); i++) {
+//                        AppCategory category = new AppCategory();
+//                        category.setOrgCode(site.getOrgCode());
+//                        category.setTenantId(site.getTenantId());
+//                        category.setName(categoryNames.get(i));
+//                        category.setSort(i);
+//                    }
+//                }
                 //创建学校场地表
                 if (Objects.equals(sysDepart.getOrgCategory(), "2")){
                     AppSitePlace place = new AppSitePlace();