Kaynağa Gözat

update AMR 0元订单不增加缴费人数

周箭河 4 yıl önce
ebeveyn
işleme
60ff5dfb59

+ 20 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/OrganizationCloudTeacherFeeDao.java

@@ -0,0 +1,20 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.biz.dal.entity.OrganizationCloudTeacherFee;
+import com.ym.mec.biz.dal.entity.PracticeGroupSellPrice;
+import com.ym.mec.common.dal.BaseDAO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+
+public interface OrganizationCloudTeacherFeeDao extends BaseDAO<Integer, OrganizationCloudTeacherFee> {
+
+    /**
+     * 根据分部id获取云教练费用配置
+     *
+     * @param organId
+     * @return
+     */
+    OrganizationCloudTeacherFee getByOrganId(@Param("organId") Integer organId);
+}

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupSubjectGoodsAndInfoDto.java

@@ -3,6 +3,7 @@ package com.ym.mec.biz.dal.dto;
 import com.ym.mec.biz.dal.entity.*;
 import io.swagger.annotations.ApiModelProperty;
 
+import java.math.BigDecimal;
 import java.util.List;
 import java.util.Map;
 
@@ -32,6 +33,8 @@ public class MusicGroupSubjectGoodsAndInfoDto {
     @ApiModelProperty(value = "乐团信息",required = false)
     private MusicGroup musicGroup;
 
+    @ApiModelProperty(value = "乐团云教练价格",required = false)
+    private BigDecimal cloudTeacherFee;
 
     public Map getCourseScheduleInfo() {
         return CourseScheduleInfo;
@@ -88,4 +91,12 @@ public class MusicGroupSubjectGoodsAndInfoDto {
     public void setMusicGroup(MusicGroup musicGroup) {
         this.musicGroup = musicGroup;
     }
+
+    public BigDecimal getCloudTeacherFee() {
+        return cloudTeacherFee;
+    }
+
+    public void setCloudTeacherFee(BigDecimal cloudTeacherFee) {
+        this.cloudTeacherFee = cloudTeacherFee;
+    }
 }

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/RegisterPayDto.java

@@ -35,6 +35,9 @@ public class RegisterPayDto {
     @ApiModelProperty(value = "购买乐器保养",required = false)
     private Boolean buyMaintenance = false;
 
+    @ApiModelProperty(value = "购买云教练",required = false)
+    private Boolean buyCloudTeacher= false;
+
     public Integer getRegisterId() {
         return registerId;
     }
@@ -114,4 +117,12 @@ public class RegisterPayDto {
     public void setBuyMaintenance(Boolean buyMaintenance) {
         this.buyMaintenance = buyMaintenance;
     }
+
+    public Boolean getBuyCloudTeacher() {
+        return buyCloudTeacher;
+    }
+
+    public void setBuyCloudTeacher(Boolean buyCloudTeacher) {
+        this.buyCloudTeacher = buyCloudTeacher;
+    }
 }

+ 52 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/OrganizationCloudTeacherFee.java

@@ -0,0 +1,52 @@
+package com.ym.mec.biz.dal.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+public class OrganizationCloudTeacherFee {
+
+    @ApiModelProperty(value = "分部id")
+    private Integer organId;
+
+    @ApiModelProperty(value = "云教练价格")
+    private BigDecimal price;
+
+    private Date createTime;
+
+    private Date updateTime;
+
+    public Integer getOrganId() {
+        return organId;
+    }
+
+    public void setOrganId(Integer organId) {
+        this.organId = organId;
+    }
+
+    public BigDecimal getPrice() {
+        return price;
+    }
+
+    public void setPrice(BigDecimal price) {
+        this.price = price;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+}

+ 5 - 3
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/CourseViewTypeEnum.java

@@ -3,8 +3,9 @@ package com.ym.mec.biz.dal.enums;
 import com.ym.mec.common.enums.BaseEnum;
 
 public enum CourseViewTypeEnum implements BaseEnum<Integer, CourseViewTypeEnum> {
-    COURSE_lIST(0,"课程详情"),
-    AMR(1,"器乐练习系统");
+    COURSE_lIST(0, "课程详情"),
+    AMR(1, "器乐练习系统"),
+    CLOUD_TEACHER(2, "云教练收费");
 
     private Integer code;
 
@@ -30,4 +31,5 @@ public enum CourseViewTypeEnum implements BaseEnum<Integer, CourseViewTypeEnum>
     @Override
     public Integer getCode() {
         return this.code;
-    }}
+    }
+}

+ 17 - 37
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -20,6 +20,7 @@ import java.util.Map;
 import java.util.Set;
 import java.util.stream.Collectors;
 
+import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.*;
 import org.apache.commons.lang3.StringUtils;
@@ -35,43 +36,6 @@ import com.alibaba.fastjson.TypeReference;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.auth.api.entity.SysUserRole;
-import com.ym.mec.biz.dal.dao.ChargeTypeDao;
-import com.ym.mec.biz.dal.dao.ClassGroupDao;
-import com.ym.mec.biz.dal.dao.ClassGroupStudentMapperDao;
-import com.ym.mec.biz.dal.dao.ClassGroupTeacherMapperDao;
-import com.ym.mec.biz.dal.dao.CooperationOrganDao;
-import com.ym.mec.biz.dal.dao.CourseScheduleDao;
-import com.ym.mec.biz.dal.dao.CourseScheduleStudentPaymentDao;
-import com.ym.mec.biz.dal.dao.CourseScheduleTeacherSalaryDao;
-import com.ym.mec.biz.dal.dao.EmployeeDao;
-import com.ym.mec.biz.dal.dao.MusicGroupBuildLogDao;
-import com.ym.mec.biz.dal.dao.MusicGroupDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderCourseSettingsDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDetailDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderStudentDetailDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentEntitiesDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentStudentCourseDetailDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPurchaseListDao;
-import com.ym.mec.biz.dal.dao.MusicGroupQuitDao;
-import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
-import com.ym.mec.biz.dal.dao.MusicGroupSubjectGoodsGroupDao;
-import com.ym.mec.biz.dal.dao.MusicGroupSubjectPlanDao;
-import com.ym.mec.biz.dal.dao.OrganizationDao;
-import com.ym.mec.biz.dal.dao.SchoolDao;
-import com.ym.mec.biz.dal.dao.SporadicChargeInfoDao;
-import com.ym.mec.biz.dal.dao.StudentDao;
-import com.ym.mec.biz.dal.dao.StudentPaymentOrderDao;
-import com.ym.mec.biz.dal.dao.StudentPaymentOrderDetailDao;
-import com.ym.mec.biz.dal.dao.StudentPreRegistrationDao;
-import com.ym.mec.biz.dal.dao.StudentRegistrationDao;
-import com.ym.mec.biz.dal.dao.StudentVisitDao;
-import com.ym.mec.biz.dal.dao.SubjectChangeDao;
-import com.ym.mec.biz.dal.dao.SubjectDao;
-import com.ym.mec.biz.dal.dao.SysConfigDao;
-import com.ym.mec.biz.dal.dao.SysUserCashAccountDao;
-import com.ym.mec.biz.dal.dao.TeacherAttendanceDao;
-import com.ym.mec.biz.dal.dao.TeacherDao;
 import com.ym.mec.biz.dal.dto.BasicUserDto;
 import com.ym.mec.biz.dal.dto.CloseMusicGroupDto;
 import com.ym.mec.biz.dal.dto.CourseScheduleTeachersDto;
@@ -264,6 +228,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 
     @Autowired
     private StudentPreRegistrationDao studentPreRegistrationDao;
+    @Autowired
+    private OrganizationCloudTeacherFeeDao organizationCloudTeacherFeeDao;
 
     @Autowired
     private GroupEventSource groupEventSource;
@@ -731,6 +697,13 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             orderAmount = orderAmount.add(maintenancePrice);
         }
 
+        //云教练
+        if(registerPayDto.getBuyCloudTeacher()){
+            OrganizationCloudTeacherFee cloudTeacher = organizationCloudTeacherFeeDao.getByOrganId(studentRegistration.getOrganId());
+            BigDecimal cloudTeacherPrice = cloudTeacher.getPrice();
+            orderAmount = orderAmount.add(cloudTeacherPrice);
+        }
+
         if (amount.compareTo(orderAmount) != 0) {
             throw new BizException("商品价格不符");
         }
@@ -882,6 +855,13 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             orderAmount = orderAmount.add(maintenancePrice);
         }
 
+        //云教练
+        if(registerPayDto.getBuyCloudTeacher()){
+            OrganizationCloudTeacherFee cloudTeacher = organizationCloudTeacherFeeDao.getByOrganId(studentRegistration.getOrganId());
+            BigDecimal cloudTeacherPrice = cloudTeacher.getPrice();
+            orderAmount = orderAmount.add(cloudTeacherPrice);
+        }
+
         if (amount.compareTo(orderAmount) != 0) {
             throw new BizException("商品价格不符");
         }

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

@@ -9,7 +9,7 @@ import java.util.Map;
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.MusicGroupGoodsAndDiscountDto;
 import com.ym.mec.biz.dal.entity.*;
-import com.ym.mec.biz.dal.enums.KitGroupPurchaseTypeEnum;
+import com.ym.mec.biz.dal.enums.*;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -17,9 +17,6 @@ import org.springframework.stereotype.Service;
 import com.alibaba.fastjson.JSON;
 import com.ym.mec.biz.dal.dto.MusicGroupRegRespDto;
 import com.ym.mec.biz.dal.dto.MusicGroupSubjectGoodsAndInfoDto;
-import com.ym.mec.biz.dal.enums.DealStatusEnum;
-import com.ym.mec.biz.dal.enums.GoodsType;
-import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
 import com.ym.mec.biz.service.GoodsService;
 import com.ym.mec.biz.service.MusicGroupService;
 import com.ym.mec.biz.service.MusicGroupSubjectGoodsGroupService;
@@ -60,6 +57,8 @@ public class MusicGroupSubjectPlanServiceImpl extends BaseServiceImpl<Integer, M
     private MusicGroupPaymentCalenderCourseSettingsDao musicGroupPaymentCalenderCourseSettingsDao;
     @Autowired
     private MusicGroupPaymentCalenderDao musicGroupPaymentCalenderDao;
+    @Autowired
+    private OrganizationCloudTeacherFeeDao organizationCloudTeacherFeeDao;
 
     @Override
     public BaseDAO<Integer, MusicGroupSubjectPlan> getDAO() {
@@ -115,7 +114,7 @@ public class MusicGroupSubjectPlanServiceImpl extends BaseServiceImpl<Integer, M
                     childGoodIds += StringUtils.isNotBlank(childGoodIds) ? "," : "" + goods.getComplementGoodsIdList();
                 }
             }
-            if(StringUtils.isNotBlank(childGoodIds)) {
+            if (StringUtils.isNotBlank(childGoodIds)) {
                 goodsGroup.setChildGoodsList(goodsDao.findGoodsByIds(childGoodIds));
             }
         }
@@ -128,6 +127,10 @@ public class MusicGroupSubjectPlanServiceImpl extends BaseServiceImpl<Integer, M
         musicGroupSubjectGoodsAndInfo.setMusicGroupPaymentCalender(musicGroupRegCalender);
         musicGroupSubjectGoodsAndInfo.setMusicGroupSubjectGoodsGroupList(goodsGroups);
         musicGroupSubjectGoodsAndInfo.setMusicGroup(musicGroup);
+        if (musicGroup.getCourseViewType().equals(CourseViewTypeEnum.CLOUD_TEACHER)) {
+            OrganizationCloudTeacherFee cloudTeacherFee = organizationCloudTeacherFeeDao.getByOrganId(musicGroup.getOrganId());
+            musicGroupSubjectGoodsAndInfo.setCloudTeacherFee(cloudTeacherFee.getPrice());
+        }
         return musicGroupSubjectGoodsAndInfo;
     }
 

+ 64 - 0
mec-biz/src/main/resources/config/mybatis/OrganizationCloudTeacherFeeMapper.xml

@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!-- 这个文件是自动生成的。 不要修改此文件。所有改动将在下次重新自动生成时丢失。 -->
+<mapper namespace="com.ym.mec.biz.dal.dao.OrganizationCloudTeacherFeeDao">
+
+	<resultMap type="com.ym.mec.biz.dal.entity.OrganizationCloudTeacherFee" id="OrganizationCloudTeacherFee">
+		<result column="organ_id_" property="organId" />
+		<result column="price_" property="price" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+	</resultMap>
+
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="OrganizationCloudTeacherFee">
+		SELECT * FROM
+		organization_cloud_teacher_fee WHERE organ_id_ = #{id}
+	</select>
+
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="OrganizationCloudTeacherFee">
+		SELECT * FROM organization_cloud_teacher_fee
+		ORDER BY id_
+	</select>
+
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.OrganizationCloudTeacherFee"
+		useGeneratedKeys="true" keyColumn="id_" keyProperty="id">
+		INSERT INTO organization_cloud_teacher_fee
+		(organ_id_, price_,  create_time_, update_time_)
+		VALUES(#{organId},#{price},NOW(),NOW())
+	</insert>
+
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.ym.mec.biz.dal.entity.OrganizationCloudTeacherFee">
+		UPDATE organization_cloud_teacher_fee
+		<set>
+			<if test="price != null">
+				price_ = #{price},
+			</if>
+			update_time_=NOW()
+		</set>
+		WHERE organ_id_ = #{organId}
+	</update>
+
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete">
+		DELETE FROM organization_cloud_teacher_fee WHERE id_ = #{id}
+	</delete>
+
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="OrganizationCloudTeacherFee" parameterType="map">
+		SELECT * FROM organization_cloud_teacher_fee ORDER BY id_
+		<include refid="global.limit" />
+	</select>
+
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM organization_cloud_teacher_fee
+	</select>
+
+	<select id="getByOrganId" resultMap="OrganizationCloudTeacherFee">
+		SELECT * FROM organization_cloud_teacher_fee WHERE organ_id_ = #{organId}
+	</select>
+</mapper>