浏览代码

Merge remote-tracking branch 'origin/master'

Joburgess 5 年之前
父节点
当前提交
7d7400e868

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

@@ -182,6 +182,11 @@ public class MusicGroupSubjectPlanServiceImpl extends BaseServiceImpl<Integer, M
                 musicGroupSubjectGoodsGroup.setName("辅件");
                 musicGroupSubjectGoodsGroup.setType(GoodsType.ACCESSORIES);
             }
+            if(orderDetail.getKitGroupPurchaseType() != null){
+                String kitGroupPurchaseTypeJson = "{\""+orderDetail.getKitGroupPurchaseType().getCode()+"\":0}";
+                musicGroupSubjectGoodsGroup.setKitGroupPurchaseTypeJson(kitGroupPurchaseTypeJson);
+            }
+
             musicGroupSubjectGoodsGroup.setId(orderDetail.getId());
             musicGroupSubjectGoodsGroup.setGoodsIdList(orderDetail.getGoodsIdList());
             musicGroupSubjectGoodsGroup.setMusicGroupId(musicGroupId);

+ 11 - 4
mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderDetailMapper.xml

@@ -14,6 +14,7 @@
         <result column="create_time_" property="createTime"/>
         <result column="update_time_" property="updateTime"/>
         <result column="payment_order_id_" property="paymentOrderId"/>
+        <result column="kit_group_purchase_type_" property="kitGroupPurchaseType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
     </resultMap>
 
     <!-- 根据主键查询一条记录 -->
@@ -37,8 +38,9 @@
         </selectKey>
         -->
         INSERT INTO student_payment_order_detail
-        (id_,type_,goods_id_list_,price_,create_time_,update_time_,payment_order_id_)
-        VALUES(#{id},#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{goodsIdList},#{price},now(),now(),#{paymentOrderId})
+        (id_,type_,goods_id_list_,price_,create_time_,update_time_,payment_order_id_,kit_group_purchase_type_)
+        VALUES(#{id},#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+        #{goodsIdList},#{price},now(),now(),#{paymentOrderId},#{kitGroupPurchaseType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler})
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -57,6 +59,9 @@
             <if test="paymentOrderId != null">
                 payment_order_id_ = #{paymentOrderId},
             </if>
+            <if test="kitGroupPurchaseType != null">
+                kit_group_purchase_type_ = #{kitGroupPurchaseType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+            </if>
             <if test="type != null">
                 type_ = #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
             </if>
@@ -83,10 +88,12 @@
 
     <insert id="batchAdd" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id_">
         INSERT INTO student_payment_order_detail
-        (id_,type_,goods_id_list_,price_,create_time_,update_time_,payment_order_id_)
+        (id_,type_,goods_id_list_,price_,create_time_,update_time_,payment_order_id_,kit_group_purchase_type_)
         VALUES
         <foreach collection="studentPaymentOrderDetailList" item="orderDetail" separator=",">
-            (#{orderDetail.id},#{orderDetail.type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{orderDetail.goodsIdList},#{orderDetail.price},now(),now(),#{orderDetail.paymentOrderId})
+            (#{orderDetail.id},#{orderDetail.type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+            #{orderDetail.goodsIdList},#{orderDetail.price},now(),now(),#{orderDetail.paymentOrderId},
+            #{orderDetail.kitGroupPurchaseType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler})
         </foreach>
     </insert>
 

+ 3 - 2
mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderMapper.xml

@@ -424,6 +424,7 @@
             <result column="detail_id_" property="id"/>
             <result column="detail_type_" property="type"/>
             <result column="detail_price_" property="price"/>
+            <result column="detail_kit_group_purchase_type_" property="kitGroupPurchaseType"/>
         </collection>
         <collection property="goodsList" ofType="com.ym.mec.biz.dal.entity.Goods">
             <result column="goods_id" property="id"/>
@@ -433,8 +434,8 @@
 
     <!-- 分页查询 -->
     <select id="ExportQueryPage" resultMap="orderAndDetail" parameterType="map">
-        SELECT spo.*,u.username_,spod.id_ detail_id_,spod.type_ detail_type_,spod.price_ detail_price_,o.name_ organ_name,
-        sci.charge_type_,g.id_ goods_id, g.name_ goods_name FROM student_payment_order spo
+        SELECT spo.*,u.username_,spod.id_ detail_id_,spod.type_ detail_type_,spod.price_ detail_price_,spod.kit_group_purchase_type_ detail_kit_group_purchase_type_,
+        o.name_ organ_name,sci.charge_type_,g.id_ goods_id, g.name_ goods_name FROM student_payment_order spo
         LEFT JOIN sys_user u on spo.user_id_ = u.id_
         LEFT JOIN student_payment_order_detail spod on spo.id_ = spod.payment_order_id_
         LEFT JOIN organization o on spo.organ_id_ = o.id_

+ 8 - 2
mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java

@@ -9,6 +9,7 @@ import com.ym.mec.biz.dal.dao.VipGroupDao;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.GroupType;
+import com.ym.mec.biz.dal.enums.KitGroupPurchaseTypeEnum;
 import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
 import com.ym.mec.biz.dal.enums.OrderTypeEnum;
 import com.ym.mec.biz.dal.page.CourseScheduleTeacherSalaryQueryInfo;
@@ -195,12 +196,15 @@ public class ExportController extends BaseController {
             BigDecimal musicalFee = BigDecimal.ZERO;
             BigDecimal teachingFee = BigDecimal.ZERO;
             BigDecimal courseFee = BigDecimal.ZERO;
+            BigDecimal leaseFee = BigDecimal.ZERO;
             String goodsName = "";
             if (row.getOrderDetailList() != null) {
                 for (StudentPaymentOrderDetail orderDetail : row.getOrderDetailList()) {
                     if (orderDetail.getType().equals(OrderDetailTypeEnum.MUSICAL)) {
-                        musicalFee = musicalFee.add(orderDetail.getPrice());
-
+                        musicalFee = orderDetail.getPrice();
+                        if(orderDetail.getKitGroupPurchaseType() != null && orderDetail.getKitGroupPurchaseType().equals(KitGroupPurchaseTypeEnum.LEASE)){
+                            leaseFee = orderDetail.getPrice();
+                        }
                     } else if (orderDetail.getType().equals(OrderDetailTypeEnum.COURSE)) {
                         courseFee = courseFee.add(orderDetail.getPrice());
                     } else if (orderDetail.getType().equals(OrderDetailTypeEnum.ACCESSORIES) || orderDetail.getType().equals(OrderDetailTypeEnum.TEACHING) || orderDetail.getType().equals(OrderDetailTypeEnum.OTHER)) {
@@ -214,6 +218,7 @@ public class ExportController extends BaseController {
             row.setCourseFee(courseFee);
             row.setMusicalFee(musicalFee);
             row.setTeachingFee(teachingFee);
+            row.setLeaseFee(leaseFee);
             row.setMemo(goodsName);
             //专业
             if (row.getGroupType().equals(GroupType.MUSIC)) {
@@ -221,6 +226,7 @@ public class ExportController extends BaseController {
                 if (studentRegistration != null) {
                     row.setSubjectName(studentRegistration.getSubjectName());
                     row.setSchoolName(studentRegistration.getSchoolName());
+                    //更新数据后删除
                     if (row.getType().equals(OrderTypeEnum.APPLY) && studentRegistration.getKitType() != null && studentRegistration.getKitType().equals("LEASE")) {
                         row.setLeaseFee(musicalFee);
                         row.setMusicalFee(BigDecimal.ZERO);