Joburgess 5 vuotta sitten
vanhempi
commit
387bcec527

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/VipGroupStudentDto.java

@@ -2,6 +2,8 @@ package com.ym.mec.biz.dal.dto;
 
 import io.swagger.annotations.ApiModelProperty;
 
+import java.math.BigDecimal;
+
 /**
  * @Author Joburgess
  * @Date 2019/10/9
@@ -23,6 +25,16 @@ public class VipGroupStudentDto {
     @ApiModelProperty(value = "当前课时")
     private Integer currentClassTimes;
 
+    private BigDecimal courseSalary;
+
+    public BigDecimal getCourseSalary() {
+        return courseSalary;
+    }
+
+    public void setCourseSalary(BigDecimal courseSalary) {
+        this.courseSalary = courseSalary;
+    }
+
     public String getPhone() {
         return phone;
     }

+ 22 - 24
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -196,31 +196,29 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 				true,
 				true);
 
-		VipGroupSalarySettlementDto vipGroupSalarySettlementDto = JSON.parseObject(vipGroupActivity.getSalarySettlementJson(), VipGroupSalarySettlementDto.class);
-
-		BigDecimal offlineClassNum=new BigDecimal(vipGroupApplyBaseInfoDto.getOfflineClassesNum());
-		BigDecimal onlineClassNum=new BigDecimal(vipGroupApplyBaseInfoDto.getOnlineClassesNum());
-
-		if(vipGroupActivity.getType().equals(VipGroupActivityTypeEnum.GIVE_CLASS)){
-			if(vipGroupApplyBaseInfoDto.getGiveTeachMode()==TeachModeEnum.OFFLINE){
-				if(new BigDecimal(totalClassTimes).compareTo(new BigDecimal(vipGroupActivity.getAttribute1()))>-1){
-					offlineClassNum=offlineClassNum.subtract(new BigDecimal(vipGroupActivity.getAttribute2()));
-				}
-			}else if(vipGroupApplyBaseInfoDto.getGiveTeachMode()==TeachModeEnum.ONLINE){
-				if(new BigDecimal(totalClassTimes).compareTo(new BigDecimal(vipGroupActivity.getAttribute1()))>-1){
-					onlineClassNum=onlineClassNum.subtract(new BigDecimal(vipGroupActivity.getAttribute2()));
-				}
-			}else{
-				throw new BizException("请指定赠送课程类型!");
-			}
-		}
+//		BigDecimal offlineClassNum=new BigDecimal(vipGroupApplyBaseInfoDto.getOfflineClassesNum());
+//		BigDecimal onlineClassNum=new BigDecimal(vipGroupApplyBaseInfoDto.getOnlineClassesNum());
+//
+//		if(vipGroupActivity.getType().equals(VipGroupActivityTypeEnum.GIVE_CLASS)){
+//			if(vipGroupApplyBaseInfoDto.getGiveTeachMode()==TeachModeEnum.OFFLINE){
+//				if(new BigDecimal(totalClassTimes).compareTo(new BigDecimal(vipGroupActivity.getAttribute1()))>-1){
+//					offlineClassNum=offlineClassNum.subtract(new BigDecimal(vipGroupActivity.getAttribute2()));
+//				}
+//			}else if(vipGroupApplyBaseInfoDto.getGiveTeachMode()==TeachModeEnum.ONLINE){
+//				if(new BigDecimal(totalClassTimes).compareTo(new BigDecimal(vipGroupActivity.getAttribute1()))>-1){
+//					onlineClassNum=onlineClassNum.subtract(new BigDecimal(vipGroupActivity.getAttribute2()));
+//				}
+//			}else{
+//				throw new BizException("请指定赠送课程类型!");
+//			}
+//		}
 
-		BigDecimal tempFee = costInfo.get("totalPrice").multiply(new BigDecimal(0.6));
-		BigDecimal totalSalary = vipGroupApplyBaseInfoDto.getOfflineTeacherSalary().multiply(offlineClassNum)
-				.add(vipGroupApplyBaseInfoDto.getOnlineTeacherSalary().multiply(onlineClassNum));
-		if(totalSalary.compareTo(tempFee)>0){
-			throw new BizException("教师总课酬不能高于课程总价60%");
-		}
+//		BigDecimal tempFee = costInfo.get("totalPrice").multiply(new BigDecimal(0.6));
+//		BigDecimal totalSalary = vipGroupApplyBaseInfoDto.getOfflineTeacherSalary().multiply(offlineClassNum)
+//				.add(vipGroupApplyBaseInfoDto.getOnlineTeacherSalary().multiply(onlineClassNum));
+//		if(totalSalary.compareTo(tempFee)>0){
+//			throw new BizException("教师总课酬不能高于课程总价60%");
+//		}
 
 		//如果默认课酬与实际课酬不匹配则需要审批
 		if(costInfo.get("offlineTeacherSalary").compareTo(vipGroupApplyBaseInfoDto.getOfflineTeacherSalary())!=0||

+ 1 - 0
mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -476,6 +476,7 @@
             AND cs.type_=#{type}
         </if>
         AND csts.user_id_ = #{teacherId} AND cg.del_flag_ = 0
+        ORDER start_class_time_
     </select>
 
     <select id="getCourseScheduleDateByMonth" resultType="java.util.Date">

+ 7 - 4
mec-biz/src/main/resources/config/mybatis/VipGroupMapper.xml

@@ -473,6 +473,7 @@
         <result column="phone_" property="phone"/>
         <result column="total_class_times_" property="totalClassTimes"/>
         <result column="current_class_times_" property="currentClassTimes"/>
+        <result column="course_balance_" property="courseSalary"/>
     </resultMap>
 
     <select id="findVipGroupStudents" resultMap="vipGroupStudentDto">
@@ -481,15 +482,17 @@
             su.username_,
             su.phone_,
             cg.total_class_times_,
-            cg.current_class_times_
+            cg.current_class_times_,
+            suaa.course_balance_
         FROM
             class_group cg
             LEFT JOIN class_group_student_mapper cgsm ON cg.id_=cgsm.class_group_id_
             LEFT JOIN sys_user su ON cgsm.user_id_=su.id_
+            LEFT JOIN sys_user_cash_account suaa ON cgsm.user_id_=suaa.user_id_
         WHERE cg.music_group_id_=#{vipGroupId}
-        AND cg.group_type_='VIP'
-        AND cgsm.status_!='QUIT'
-        AND cgsm.user_id_ IS NOT NULL
+            AND cg.group_type_='VIP'
+            AND cgsm.status_!='QUIT'
+            AND cgsm.user_id_ IS NOT NULL
         ORDER BY su.id_
         <include refid="global.limit"/>
     </select>

+ 11 - 3
mec-web/src/main/java/com/ym/mec/web/controller/VipGroupManageController.java

@@ -18,10 +18,10 @@ import com.ym.mec.biz.service.StudentApplyRefundsService;
 import com.ym.mec.biz.service.StudentPaymentOrderService;
 import com.ym.mec.biz.service.VipGroupService;
 import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.exception.BizException;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.ibatis.annotations.Param;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -110,8 +110,16 @@ public class VipGroupManageController extends BaseController {
     @ApiOperation(value = "添加vip课学员")
     @GetMapping(value = "/addVipGroupStudents")
     @PreAuthorize("@pcs.hasPermissions('vipGroupManage/addVipGroupStudents')")
-    public Object addVipGroupStudents(Long vipGroupId,@Param("studentIds[]") List<Integer> studentIds){
-        vipGroupService.addVipGroupStudents(vipGroupId,studentIds);
+    public Object addVipGroupStudents(Long vipGroupId, String studentIds){
+        if(StringUtils.isBlank(studentIds)){
+            throw new BizException("请指定学员");
+        }
+        List<Integer> ids=new ArrayList<>();
+        String[] split = studentIds.split(",");
+        for (String s : split) {
+            ids.add(Integer.parseInt(s));
+        }
+        vipGroupService.addVipGroupStudents(vipGroupId,ids);
         return succeed();
     }