Bläddra i källkod

增加包含老师的合奏班子班列表

周箭河 5 år sedan
förälder
incheckning
d93a0ea7ee

+ 39 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -20,6 +20,7 @@ import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.im.ImFeignService;
+import com.ym.mec.jiari.JiaRiFeignService;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateConvertor;
 import com.ym.mec.util.date.DateUtil;
@@ -82,6 +83,8 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     private StudentRegistrationService studentRegistrationService;
     @Autowired
     private ImFeignService imFeignService;
+    @Autowired
+    private JiaRiFeignService jiaRiFeignService;
 
 
     @Override
@@ -846,8 +849,19 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         List<CourseScheduleStudentPayment> courseScheduleStudentPaymentList = new ArrayList<>();
         BigDecimal expectPrice = new BigDecimal("0");
         int times = 0;
+
+        Map<String, Integer> holidayDays = new HashMap<>();
+        if(classGroup4MixDto.getHoliday()) {
+            Map<Integer, Map<String, Integer>> holiday = jiaRiFeignService.query(now.getYear());
+            holidayDays = holiday.get(now.getYear());
+        }
+
         WhileNode:
         while (true) {
+            if (classGroup4MixDto.getHoliday() && !holidayDays.containsKey(now.format(DateTimeFormatter.ofPattern("MM-dd")))) {
+                now = now.plusDays(1);
+                continue;
+            }
             int dayOfWeek = now.getDayOfWeek().getValue();//当前星期
             for (CourseTimeDto courseTimeDto : classGroup4MixDto.getCourseTimeDtoList()) {
                 if (!courseTimeDto.getDayOfWeek().equals(dayOfWeek)) continue;
@@ -1037,8 +1051,18 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         List<CourseScheduleStudentPayment> courseScheduleStudentPaymentList = new ArrayList<>();
         BigDecimal expectPrice = new BigDecimal("0");
         int times = 0;
+        Map<String, Integer> holidayDays = new HashMap<>();
+        if(classGroup4MixDto.getHoliday()) {
+            Map<Integer, Map<String, Integer>> holiday = jiaRiFeignService.query(now.getYear());
+            holidayDays = holiday.get(now.getYear());
+        }
+
         WhileNode:
         while (true) {
+            if (classGroup4MixDto.getHoliday() && !holidayDays.containsKey(now.format(DateTimeFormatter.ofPattern("MM-dd")))) {
+                now = now.plusDays(1);
+                continue;
+            }
             int dayOfWeek = now.getDayOfWeek().getValue();
             for (CourseTimeDto courseTimeDto : classGroup4MixDto.getCourseTimeDtoList()) {
                 if (!courseTimeDto.getDayOfWeek().equals(dayOfWeek)) continue;
@@ -1225,8 +1249,23 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         List<CourseScheduleStudentPayment> courseScheduleStudentPaymentList = new ArrayList<>();
         BigDecimal expectPrice = new BigDecimal("0");
         int times = 0;
+        Map<String, Integer> holidayDays = new HashMap<>();
+        if(classGroup4MixDto.getHoliday()) {
+            Map<Integer, Map<String, Integer>> holiday = jiaRiFeignService.query(now.getYear());
+            holidayDays = holiday.get(now.getYear());
+        }
+
         WhileNode:
         while (true) {
+            if (classGroup4MixDto.getHoliday() && !holidayDays.containsKey(now.format(DateTimeFormatter.ofPattern("MM-dd")))) {
+                now = now.plusDays(1);
+                continue;
+            }
+            if (!holidayDays.containsKey(now.format(DateTimeFormatter.ofPattern("MM-dd")))) {
+                now = now.plusDays(1);
+                continue;
+            }
+
             int dayOfWeek = now.getDayOfWeek().getValue();
             for (CourseTimeDto courseTimeDto : classGroup4MixDto.getCourseTimeDtoList()) {
                 if (!courseTimeDto.getDayOfWeek().equals(dayOfWeek)) continue;

+ 14 - 0
mec-client-api/src/main/java/com/ym/mec/jiari/JiaRiFeignService.java

@@ -0,0 +1,14 @@
+package com.ym.mec.jiari;
+
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Map;
+
+@FeignClient(value = "JiaRiFeignService", url = "https://tool.bitefu.net")
+public interface JiaRiFeignService {
+
+    @RequestMapping(name = "查询订单", value = "/jiari", method = RequestMethod.GET)
+    Map<Integer,Map<String,Integer>> query(@RequestParam("d") Integer d);
+
+}

+ 1 - 1
mec-student/src/main/java/com/ym/mec/student/config/ResourceServerConfig.java

@@ -25,7 +25,7 @@ public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
 	@Override
 	public void configure(HttpSecurity http) throws Exception {
 		http.csrf().disable().exceptionHandling().accessDeniedHandler(baseAccessDeniedHandler).authenticationEntryPoint(baseAuthenticationEntryPoint).and()
-				.authorizeRequests().antMatchers("/v2/api-docs","/studentOrder/notify","/code/*","/register/add").permitAll().anyRequest().authenticated().and().httpBasic();
+				.authorizeRequests().antMatchers("/v2/api-docs","/studentOrder/notify","/code/*","/register/add","/register/getMusicGroupRegInfo").permitAll().anyRequest().authenticated().and().httpBasic();
 	}
 
 	@Override

+ 13 - 2
mec-web/src/main/java/com/ym/mec/web/controller/ClassGroupController.java

@@ -5,6 +5,8 @@ import com.ym.mec.biz.dal.dto.ClassGroupAdjustDto;
 import com.ym.mec.biz.dal.dto.HighClassGroupDto;
 import com.ym.mec.biz.dal.entity.ClassGroup;
 import com.ym.mec.biz.dal.entity.ClassGroupTeacherMapper;
+import com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment;
+import com.ym.mec.biz.dal.entity.CourseScheduleTeacherSalary;
 import com.ym.mec.biz.dal.enums.SalarySettlementTypeEnum;
 import com.ym.mec.biz.dal.page.queryMusicGroupCourseScheduleQueryInfo;
 import com.ym.mec.biz.service.ClassGroupService;
@@ -13,6 +15,7 @@ import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.page.QueryInfo;
 
+import com.ym.mec.jiari.JiaRiFeignService;
 import io.swagger.annotations.*;
 
 import org.apache.commons.lang3.StringUtils;
@@ -20,8 +23,14 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
 
 @RequestMapping("classGroup")
 @Api(tags = "班级服务")
@@ -32,6 +41,8 @@ public class ClassGroupController extends BaseController {
     private ClassGroupService classGroupService;
     @Autowired
     private ClassGroupTeacherMapperService classGroupTeacherMapperService;
+    @Autowired
+    private JiaRiFeignService jiaRiFeignService;
 
     @ApiOperation(value = "新增单技班班级")
     @PostMapping("/add")
@@ -64,7 +75,7 @@ public class ClassGroupController extends BaseController {
     @PostMapping("/delSingle")
     @PreAuthorize("@pcs.hasPermissions('classGroup/delSingle')")
     public Object delSingle(Integer classGroupId) {
-        classGroupService.delete(classGroupId);
+        classGroupService.delSingle(classGroupId);
         return succeed();
     }
 
@@ -211,7 +222,7 @@ public class ClassGroupController extends BaseController {
 
     @ApiOperation(value = "调整班级(临时调整)")
     @PostMapping("/revisionClassGroup")
-    @PreAuthorize("@pcs.hasPermissions('classGroup/classGroupSnap')")
+    @PreAuthorize("@pcs.hasPermissions('classGroup/revisionClassGroup')")
     @ApiImplicitParams({@ApiImplicitParam(name = "classGroupIds", value = "添加班级结构", required = true, dataType = "String")})
     public HttpResponseResult revisionClassGroup(@RequestBody ClassGroup4MixDto classGroup4MixDto) throws Exception {
         return succeed(classGroupService.classGroupSnap(classGroup4MixDto));