Browse Source

Merge remote-tracking branch 'origin/master'

Joburgess 4 years ago
parent
commit
39b2ccfa90

+ 12 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentRegistrationDao.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.dal.dao;
 
+import java.math.BigDecimal;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -396,11 +397,21 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
      * @return
      */
     Integer getMusicGroupSubjectStudentNum(@Param("musicGroupId") String musicGroupId, @Param("subjectIds") String subjectIds);
-    
+
     /**
      * 查询用户所在乐团信息
+     *
      * @param userId
      * @return
      */
     List<StudentMusicGroupDto> queryStudentMusicGroupInfo(Integer userId);
+
+    /**
+     * 获取学员剩余课程费用
+     *
+     * @param classGroupId
+     * @param studentIds
+     * @return
+     */
+    List<Map<Integer, BigDecimal>> querySurplusCourseFeeByClassGroupId(@Param("classGroupId") Integer classGroupId, @Param("studentIds") String studentIds);
 }

+ 10 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysPaymentConfigDao.java

@@ -10,6 +10,7 @@ import java.util.List;
 public interface SysPaymentConfigDao extends BaseDAO<Integer, SysPaymentConfig> {
     /**
      * 获取分部的收费配置
+     *
      * @param organId
      * @return
      */
@@ -17,6 +18,7 @@ public interface SysPaymentConfigDao extends BaseDAO<Integer, SysPaymentConfig>
 
     /**
      * 根据分部ids获取收费配置
+     *
      * @param organIds
      * @return
      */
@@ -25,14 +27,21 @@ public interface SysPaymentConfigDao extends BaseDAO<Integer, SysPaymentConfig>
 
     /**
      * 根据支付渠道获取账户
+     *
      * @param payType
      * @return
      */
     List<SysPaymentConfig> getPaymentConfigs(@Param("payType") PaymentChannelEnum payType);
 
     /**
-     *
      * @return
      */
     List<SysPaymentConfig> getOutAccounts(@Param("payType") PaymentChannelEnum payType);
+
+    /**
+     * 根据汇付账户获取配置
+     * @param merNo
+     * @return
+     */
+    SysPaymentConfig findPaymentConfigByMerNo(@Param("merNo") String merNo);
 }

+ 95 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentPaymentCalenderDto.java

@@ -0,0 +1,95 @@
+package com.ym.mec.biz.dal.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import java.math.BigDecimal;
+
+public class StudentPaymentCalenderDto {
+
+    @ApiModelProperty(value = "学员编号",required = false)
+    private Integer userId;
+
+    @ApiModelProperty(value = "学员名称",required = false)
+    private String username;
+
+    @ApiModelProperty(value = "学员手机号",required = false)
+    private String phone;
+
+    @ApiModelProperty(value = "原价",required = false)
+    private BigDecimal courseOriginalPrice;
+
+    @ApiModelProperty(value = "现价",required = false)
+    private BigDecimal courseCurrentPrice;
+
+    @ApiModelProperty(value = "课程类型",required = false)
+    private String courseType;
+
+    @ApiModelProperty(value = "课程时长",required = false)
+    private Long courseTime;
+
+    @ApiModelProperty(value = "班级编号",required = false)
+    private Integer classGroupId;
+
+    public Integer getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
+    public BigDecimal getCourseOriginalPrice() {
+        return courseOriginalPrice;
+    }
+
+    public void setCourseOriginalPrice(BigDecimal courseOriginalPrice) {
+        this.courseOriginalPrice = courseOriginalPrice;
+    }
+
+    public BigDecimal getCourseCurrentPrice() {
+        return courseCurrentPrice;
+    }
+
+    public void setCourseCurrentPrice(BigDecimal courseCurrentPrice) {
+        this.courseCurrentPrice = courseCurrentPrice;
+    }
+
+    public String getCourseType() {
+        return courseType;
+    }
+
+    public void setCourseType(String courseType) {
+        this.courseType = courseType;
+    }
+
+    public Long getCourseTime() {
+        return courseTime;
+    }
+
+    public void setCourseTime(Long courseTime) {
+        this.courseTime = courseTime;
+    }
+
+    public Integer getClassGroupId() {
+        return classGroupId;
+    }
+
+    public void setClassGroupId(Integer classGroupId) {
+        this.classGroupId = classGroupId;
+    }
+}

+ 10 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/ClassGroupService.java

@@ -373,6 +373,13 @@ public interface ClassGroupService extends BaseService<Integer, ClassGroup> {
     List<ClassGroupTeachersDto> getClassGroupAndTeacherByType(String musicGroupId, ClassGroupTypeEnum type);
 
     /**
+     * 根据乐团id,班级类型获取班级和老师
+     * @param queryInfo
+     * @return
+     */
+    List<ClassGroupTeachersDto> queryClassGroupPage(ClassGroupQueryInfo queryInfo);
+
+    /**
      * 添加IM群组
      * @param classGroup
      * @param userIds
@@ -506,12 +513,12 @@ public interface ClassGroupService extends BaseService<Integer, ClassGroup> {
      * @param mergeClassSplitClassAffirmDto
      * @return
      */
-    Object queryStudentPaymentCalenders(MergeClassSplitClassAffirmDto mergeClassSplitClassAffirmDto);
+    Map<Integer, List<StudentPaymentCalenderDto>> queryStudentPaymentCalenders(MergeClassSplitClassAffirmDto mergeClassSplitClassAffirmDto);
 
     /**
      * 获取班级列表最大可排课时长
-     * @param classGroupIds
+     * @param classGroupId
      * @return
      */
-    Map<String,Long> querySubCourseTime(List<Integer> classGroupIds);
+    Map<String,Long> querySubCourseTime(Integer classGroupId);
 }

+ 7 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/SysPaymentConfigService.java

@@ -39,4 +39,11 @@ public interface SysPaymentConfigService extends BaseService<Integer, SysPayment
      * @return
      */
     AccountType checkAccountType(PaymentChannelEnum payType, String merNos);
+
+    /**
+     * 根据汇付获取配置
+     * @param merNo
+     * @return
+     */
+    SysPaymentConfig findPaymentConfigByMerNo(String merNo);
 }

+ 68 - 10
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -2919,6 +2919,11 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     }
 
     @Override
+    public List<ClassGroupTeachersDto> queryClassGroupPage(ClassGroupQueryInfo queryInfo) {
+        return null;
+    }
+
+    @Override
     public Boolean addImGroup(ClassGroup classGroup, List<Integer> userIds) {
         MusicGroup musicGroup = musicGroupDao.get(classGroup.getMusicGroupId());
         List<Integer> userIdList = new ArrayList<>();
@@ -3527,19 +3532,39 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     }
 
     @Override
-    public Object queryStudentPaymentCalenders(MergeClassSplitClassAffirmDto mergeClassSplitClassAffirmDto) {
-        ArrayList masterClassGroupId = new ArrayList();
-        masterClassGroupId.add(mergeClassSplitClassAffirmDto.getMasterClassGroupId());
+    public Map<Integer, List<StudentPaymentCalenderDto>> queryStudentPaymentCalenders(MergeClassSplitClassAffirmDto mergeClassSplitClassAffirmDto) {
         //获取主班剩余时长
-        Map<String, Long> masterMap = MapUtil.convertIntegerMap(courseScheduleDao.findClassMaxCourseNumMap(masterClassGroupId));
-        //获取其他班级剩余时长
-        Map<String, Long> subMap = MapUtil.convertIntegerMap(courseScheduleDao.findClassMaxCourseNumMap(mergeClassSplitClassAffirmDto.getClassGroupIds()));
+        Map<String, Long> masterMap = MapUtil.convertIntegerMap(courseScheduleDao.querySubCourseNumMap(mergeClassSplitClassAffirmDto.getMasterClassGroupId()));
+        if(masterMap.size() <= 0){
+            throw new BizException("所选主班没有剩余课程,请重新选择");
+        }
+        //获取学员列表
+        Map<Integer, String> userNames = MapUtil.convertMybatisMap(teacherDao.queryUsernameByIds(mergeClassSplitClassAffirmDto.getStudentIds()));
+        Map<Integer, String> phoneMaps = MapUtil.convertMybatisMap(teacherDao.queryPhoneByIds(StringUtils.join(mergeClassSplitClassAffirmDto.getStudentIds(),",")));
+
+        Map<Integer, Integer> studentCLassMap = new HashMap<>();
+        List<Map<Integer, BigDecimal>> surplusCourseFeeMapList = new ArrayList<>();
+        List<Map<Integer, String>> classGroupStudents = mergeClassSplitClassAffirmDto.getClassGroupStudents();
+        for (Map<Integer, String> classGroupStudent : classGroupStudents) {
+            for (Integer integer : classGroupStudent.keySet()) {
+                //获取学员剩余课程费用
+                surplusCourseFeeMapList.addAll(studentRegistrationDao.querySurplusCourseFeeByClassGroupId(integer,classGroupStudent.get(integer)));
+                String[] s = classGroupStudent.get(integer).split(",");
+                for (String s1 : s) {
+                    studentCLassMap.put(Integer.parseInt(s1),integer);
+                }
+            }
+        }
+        //学员剩余课程费用
+        Map<Integer, BigDecimal> surplusCourseFeeMap = MapUtil.convertIntegerMap(surplusCourseFeeMapList);
         //获取分布默认的课程类型单价
         MusicGroup musicGroup = musicGroupDao.findByClassGroupId(mergeClassSplitClassAffirmDto.getMasterClassGroupId());
         Map<String, BigDecimal> unitPriceMap = MapUtil.convertIntegerMap(organizationCourseUnitPriceSettingsDao.queryMapByOrganIdAndChargeTypeId(musicGroup.getChargeTypeId(), musicGroup.getOrganId()));
         Set<String> masterKeySet = masterMap.keySet();
         //计算主班课程类型剩余价值
         Map<String, BigDecimal> masterTotalPriceMap = new HashMap<>(masterKeySet.size());
+        //学员缴费项目列表
+        List<StudentPaymentCalenderDto> studentPaymentCalenderDtos = new ArrayList<>();
         for (String s : masterKeySet) {
             BigDecimal unitPrice = unitPriceMap.get(s);
             if (unitPrice == null) {
@@ -3551,13 +3576,46 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                 masterTotalPriceMap.put(s,BigDecimal.ZERO);
             }
             //总价四舍五入取整
-            masterTotalPriceMap.put(s,unitPrice.multiply(new BigDecimal(courseTime)).setScale(0, BigDecimal.ROUND_HALF_UP));
+            BigDecimal totalPrice = unitPrice.multiply(new BigDecimal(courseTime)).setScale(0, BigDecimal.ROUND_HALF_UP);
+            masterTotalPriceMap.put(s,totalPrice);
+            //课程余额转移
+            for (Integer studentId : studentCLassMap.keySet()) {
+                //学员剩余课程余额
+                BigDecimal bigDecimal = surplusCourseFeeMap.get(studentId);
+                //创建学员缴费项目
+                StudentPaymentCalenderDto calenderDto = new StudentPaymentCalenderDto();
+                calenderDto.setClassGroupId(studentCLassMap.get(studentId));
+                //如果剩余课程余额小于等于0
+                if(bigDecimal.doubleValue() <= 0d){
+                    calenderDto.setCourseCurrentPrice(totalPrice);
+                    calenderDto.setCourseOriginalPrice(totalPrice);
+                }else {
+                    //如果剩余课程余额大于等于总价值,那么补交0元
+                    if(bigDecimal.doubleValue() >= totalPrice.doubleValue()){
+                        calenderDto.setCourseCurrentPrice(BigDecimal.ZERO);
+                        calenderDto.setCourseOriginalPrice(BigDecimal.ZERO);
+                    }else {
+                        calenderDto.setCourseCurrentPrice(totalPrice.subtract(bigDecimal));
+                        calenderDto.setCourseOriginalPrice(totalPrice.subtract(bigDecimal));
+                    }
+                    //剩余课程余额减去主班对应课程类型总的课程价值,负数就是需要补交的金额
+//                    bigDecimal = bigDecimal.subtract(totalPrice);
+                    surplusCourseFeeMap.put(studentId,bigDecimal.subtract(totalPrice));
+                }
+                calenderDto.setCourseTime(courseTime);
+                calenderDto.setCourseType(s);
+
+                calenderDto.setPhone(phoneMaps.get(studentId));
+                calenderDto.setUserId(studentId);
+                calenderDto.setUsername(userNames.get(studentId));
+                studentPaymentCalenderDtos.add(calenderDto);
+            }
         }
-        return null;
+        return studentPaymentCalenderDtos.stream().collect(Collectors.groupingBy(e -> e.getClassGroupId()));
     }
 
     @Override
-    public Map<String, Long> querySubCourseTime(List<Integer> classGroupIds) {
-        return MapUtil.convertIntegerMap(courseScheduleDao.findClassMaxCourseNumMap(classGroupIds));
+    public Map<String, Long> querySubCourseTime(Integer classGroupId) {
+        return MapUtil.convertIntegerMap(courseScheduleDao.querySubCourseNumMap(classGroupId));
     }
 }

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java

@@ -1260,7 +1260,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		MusicGroupPaymentCalenderDetail calenderDetail = musicGroupPaymentCalenderDetailDao.get(calenderDetailId);
 		MusicGroupPaymentCalender calender = this.get(calenderDetail.getMusicGroupPaymentCalenderId());
 		MusicGroupStudentFee musicGroupStudentFee = musicGroupStudentFeeDao.findByUser(userId, calender.getMusicGroupId());
-		if(calender.getIsGiveMusicNetwork()){
+		if(calender.getIsGiveMusicNetwork() && musicGroupStudentFee != null){
 			//赠送网管课
 			musicGroupStudentFee.setRemainNetworkClassTimes(musicGroupStudentFee.getRemainNetworkClassTimes() + 1);
 		}

+ 8 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -2084,16 +2084,19 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             //当前乐团报名是否赠送乐团网管课
             MusicGroupPaymentCalenderDetail calenderDetail = musicGroupPaymentCalenderDetailDao.findByOrderId(studentPaymentOrder.getId());
             MusicGroupStudentFee musicGroupStudentFee = musicGroupPaymentCalenderService.updateCalender(calenderDetail.getId(), studentRegistration.getUserId());
-            musicGroupStudentFee.setUpdateTime(date);
-            musicGroupStudentFee.setLatestPaidTime(date);
-            musicGroupStudentFee.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
-            musicGroupStudentFee.setTemporaryCourseFee(new BigDecimal(0));
+            if(musicGroupStudentFee != null){
+                musicGroupStudentFee.setUpdateTime(date);
+                musicGroupStudentFee.setLatestPaidTime(date);
+                musicGroupStudentFee.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
+                musicGroupStudentFee.setTemporaryCourseFee(new BigDecimal(0));
+                musicGroupStudentFeeDao.update(musicGroupStudentFee);
+            }
             /*if (musicGroupPaymentCalender.getType().equals(MusicGroupPaymentCalender.FeeType.ONLINE)) {
                 Integer getRemainNetworkClassTimes = musicGroupStudentFee.getRemainNetworkClassTimes() == null ? 0 : musicGroupStudentFee.getRemainNetworkClassTimes();
                 musicGroupStudentFee.setRemainNetworkClassTimes(getRemainNetworkClassTimes + 1);
             }*/
 //            musicGroupStudentFee.setNextPaymentDate(musicGroupPaymentCalenderService.getNextPaymentDate(musicGroupId, musicGroupStudentFee.getNextPaymentDate(), musicGroupStudentFee));
-            musicGroupStudentFeeDao.update(musicGroupStudentFee);
+
 
             //插入交易明细
             SysUserCashAccount cashAccount = sysUserCashAccountService.get(userId);

+ 25 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PayServiceImpl.java

@@ -2,7 +2,6 @@ package com.ym.mec.biz.service.impl;
 
 import com.alibaba.fastjson.JSON;
 import com.ym.mec.biz.dal.dao.HfMemberDao;
-import com.ym.mec.biz.dal.dao.MusicGroupDao;
 import com.ym.mec.biz.dal.dao.StudentPaymentRouteOrderDao;
 import com.ym.mec.biz.dal.dao.SysConfigDao;
 import com.ym.mec.biz.dal.dto.AmountChannelDto;
@@ -10,22 +9,22 @@ import com.ym.mec.biz.dal.dto.RouteScaleDto;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.FeeTypeEnum;
 import com.ym.mec.biz.dal.enums.PaymentChannelEnum;
-import com.ym.mec.biz.dal.enums.PaymentChannelTypeEnum;
 import com.ym.mec.biz.service.*;
 import com.ym.mec.common.exception.BizException;
+import com.ym.mec.common.redis.service.RedisCache;
 import com.ym.mec.thirdparty.adapay.ConfigInit;
 import com.ym.mec.thirdparty.adapay.Payment;
-import com.ym.mec.thirdparty.union.UnionPay;
-import com.ym.mec.thirdparty.union.UnionPayFeignService;
 import com.ym.mec.thirdparty.yqpay.YqPayUtil;
 import com.ym.mec.util.date.DateUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.core.ValueOperations;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
 import java.util.*;
+import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 
 /**
@@ -45,6 +44,8 @@ public class PayServiceImpl implements PayService {
     private SellOrderService sellOrderService;
     @Autowired
     private HfMemberDao hfMemberDao;
+    @Autowired
+    private RedisCache<String, Object> redisCache;
 
     @Override
     public Map<String, Object> getPayMap(BigDecimal amount, BigDecimal balanceAmount, String orderNo, String notifyUrl, String returnUrl, String orderSubject, String orderBody, Integer organId, String receiver) throws Exception {
@@ -543,8 +544,26 @@ public class PayServiceImpl implements PayService {
         List<PaymentChannelEnum> paymentChannelList = new ArrayList<>();
         paymentChannelList.add(PaymentChannelEnum.ADAPAY);
 
-        BigDecimal monthHasReceipt = studentPaymentRouteOrderDao.getRouteOrderAmount(routeScaleDto.getOrganId(), paymentChannelList, monthStartTime);
-        monthHasReceipt = monthHasReceipt == null ? BigDecimal.ZERO : monthHasReceipt;
+//        String key = "month_max_receipt_"+routeScaleDto.getOrganId();
+//        if(redisCache.exists(key)){
+//            RedisTemplate<String, Object> redisTemplate = redisCache.getRedisTemplate();
+//            try {
+//                ValueOperations<String, Object> valueOper = redisTemplate.opsForValue();
+//                Long index = valueOper.increment(key, 1);
+//            } catch (Exception ex) {
+//                log.error("分布式订单号生成失败异常。。。。。", ex);
+//            } finally {
+//                redisTemplate.expire(key, 600, TimeUnit.SECONDS);// 保留10分钟内的key
+//            }
+//        }else {
+            BigDecimal monthHasReceipt = studentPaymentRouteOrderDao.getRouteOrderAmount(routeScaleDto.getOrganId(), paymentChannelList, monthStartTime);
+            monthHasReceipt = monthHasReceipt == null ? BigDecimal.ZERO : monthHasReceipt;
+//            monthHasReceipt.multiply(new BigDecimal(100));
+//
+//        }
+
+
+
         if (routeScaleDto.getAmount().add(monthHasReceipt).compareTo(monthMaxReceipt) > 0) {
             routeScaleDto.setMerNo(hfmember.getRouteMemberId());
             routeScaleDto.setOrganId(hfmember.getRouteOrganId());

+ 6 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderServiceImpl.java

@@ -262,7 +262,7 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
         callOrderCallBack(order);
     }
 
-    private Boolean confirmOrder(StudentPaymentOrder order) throws Exception {
+    private Boolean confirmOrder(StudentPaymentOrder order) {
         String delayRouteStartDate = sysConfigDao.findConfigValue("delay_route_start_date");
         if (order.getCreateTime().before(Objects.requireNonNull(DateUtil.stringToDate(delayRouteStartDate, "yyyy-MM-dd HH:mm:ss")))) {
             return true;
@@ -284,7 +284,11 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
             confirm.put("order_no", idGeneratorService.generatorId("payment"));
             confirm.put("confirm_amt", routeOrder.getRouteAmount());
             confirm.put("div_members", divMembers);
-            Payment.createConfirm(confirm);
+            try {
+                Payment.createConfirm(confirm);
+            } catch (Exception e) {
+                continue;
+            }
         }
         return true;
     }

+ 5 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysPaymentConfigServiceImpl.java

@@ -63,4 +63,9 @@ public class SysPaymentConfigServiceImpl extends BaseServiceImpl<Integer, SysPay
         }
         return accountType;
     }
+
+    @Override
+    public SysPaymentConfig findPaymentConfigByMerNo(String merNo) {
+        return sysPaymentConfigDao.findPaymentConfigByMerNo(merNo);
+    }
 }

+ 7 - 0
mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml

@@ -728,4 +728,11 @@
     	where sr.user_id_ = #{userId} 
     	order by sr.id_ 
     </select>
+
+    <select id="querySurplusCourseFeeByClassGroupId" resultType="java.util.Map">
+        SELECT sr.user_id_ 'key',sr.surplus_course_fee_ 'value' FROM student_registration sr
+        LEFT JOIN class_group cg ON cg.music_group_id_ = sr.music_group_id_
+        WHERE cg.id_ = #{classGroupId} AND FIND_IN_SET(sr.user_id_,#{studentIds})
+        AND sr.music_group_status_ != 'QUIT'
+    </select>
 </mapper>

+ 3 - 0
mec-biz/src/main/resources/config/mybatis/SysPaymentConfigMapper.xml

@@ -230,4 +230,7 @@
             AND hf_mer_no_ != ''
         </if>
     </select>
+    <select id="findPaymentConfigByMerNo" resultMap="SysPaymentConfig">
+        SELECT * FROM sys_payment_config WHERE hf_mer_no_ = #{merNo} LIMIT 1
+    </select>
 </mapper>

+ 10 - 3
mec-web/src/main/java/com/ym/mec/web/controller/ClassGroupController.java

@@ -280,6 +280,13 @@ public class ClassGroupController extends BaseController {
         return succeed(classGroupService.getClassGroupAndTeacherByType(musicGroupId, type));
     }
 
+    @ApiOperation(value = "获取所有班级列表")
+    @GetMapping("/queryClassGroupPage")
+    @PreAuthorize("@pcs.hasPermissions('classGroup/queryClassGroupPage')")
+    public HttpResponseResult queryClassGroupPage(ClassGroupQueryInfo queryInfo) throws Exception {
+        return succeed(classGroupService.queryClassGroupPage(queryInfo));
+    }
+
     @ApiOperation(value = "查询是否设置课酬")
     @GetMapping("/checkSetSalary")
     @PreAuthorize("@pcs.hasPermissions('classGroup/checkSetSalary')")
@@ -343,12 +350,12 @@ public class ClassGroupController extends BaseController {
     @ApiOperation(value = "进行中乐团-修改-班级详情-学员班级调整-获取班级最大剩余可排课时长")
     @PostMapping("/querySubCourseTime")
     @PreAuthorize("@pcs.hasPermissions('classGroup/querySubCourseTime')")
-    public HttpResponseResult querySubCourseTime(@RequestBody List<Integer> classGroupIds) {
-        return succeed(classGroupService.querySubCourseTime(classGroupIds));
+    public HttpResponseResult querySubCourseTime(Integer classGroupId) {
+        return succeed(classGroupService.querySubCourseTime(classGroupId));
     }
 
     @ApiOperation(value = "进行中乐团-修改-班级详情-班级合并-获取学员需要补交的费用以及需要退还的课程余额")
-    @GetMapping("/queryStudentPaymentCalenders")
+    @PostMapping("/queryStudentPaymentCalenders")
     @PreAuthorize("@pcs.hasPermissions('classGroup/queryStudentPaymentCalenders')")
     public HttpResponseResult queryStudentPaymentCalenders(@RequestBody MergeClassSplitClassAffirmDto mergeClassSplitClassAffirmDto) {
         return succeed(classGroupService.queryStudentPaymentCalenders(mergeClassSplitClassAffirmDto));

+ 14 - 0
mec-web/src/main/java/com/ym/mec/web/controller/SysPaymentConfigController.java

@@ -34,6 +34,13 @@ public class SysPaymentConfigController extends BaseController {
         if (paymentConfig != null) {
             return failed("此分部配置已经存在");
         }
+        if(StringUtils.isNotBlank(sysPaymentConfig.getHfMerNo())){
+            SysPaymentConfig nowConfig = sysPaymentConfigService.findPaymentConfigByMerNo(sysPaymentConfig.getHfMerNo());
+            if(nowConfig != null){
+                return failed("汇付商户号已配置,不同分部请勿配置相同商户号");
+            }
+        }
+
         Date nowDate = new Date();
         sysPaymentConfig.setCreateTime(nowDate);
         sysPaymentConfig.setUpdateTime(nowDate);
@@ -56,6 +63,13 @@ public class SysPaymentConfigController extends BaseController {
     @PostMapping("/update")
     @PreAuthorize("@pcs.hasPermissions('paymentConfig/update')")
     public Object update(SysPaymentConfig sysPaymentConfig) {
+        if(StringUtils.isNotBlank(sysPaymentConfig.getHfMerNo())){
+            SysPaymentConfig nowConfig = sysPaymentConfigService.findPaymentConfigByMerNo(sysPaymentConfig.getHfMerNo());
+            if(nowConfig != null && !nowConfig.getOrganId().equals(sysPaymentConfig.getOrganId())){
+                return failed("汇付商户号已配置,不同分部请勿配置相同商户号");
+            }
+        }
+
         sysPaymentConfig.setUpdateTime(new Date());
         sysPaymentConfigService.update(sysPaymentConfig);
         return succeed();