Browse Source

乐团缴费修改

zouxuan 3 năm trước cách đây
mục cha
commit
a7fc64bd33

+ 0 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/StudentPaymentOrderDetailService.java

@@ -2,8 +2,6 @@ package com.ym.mec.biz.service;
 
 import com.ym.mec.biz.dal.dto.MusicalListDetailDto;
 import com.ym.mec.biz.dal.entity.Goods;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
-import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
 import com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail;
 import com.ym.mec.biz.dal.enums.DealStatusEnum;
 import com.ym.mec.common.exception.BizException;

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

@@ -248,6 +248,7 @@ public class ActivityUserMapperServiceImpl extends BaseServiceImpl<Integer, Acti
 		List<ActivityUserMapper> activityUserMapperList = new ArrayList<>();
 		for (StudentPaymentOrderDetail orderDetail : activity) {
 			ActivityUserMapper activityUserMapper = new ActivityUserMapper();
+			activityUserMapper.setTenantId(studentPaymentOrder.getTenantId());
 			activityUserMapper.setActualPrice(orderDetail.getPrice());
 			//这里的studentInstrumentId存的是活动编号
 			activityUserMapper.setActivityId(orderDetail.getStudentInstrumentId().intValue());

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

@@ -300,6 +300,7 @@ public class CloudTeacherOrderServiceImpl extends BaseServiceImpl<Long, CloudTea
     @Transactional(rollbackFor = Exception.class)
 	public void addOrderDetail2CloudTeacher(StudentPaymentOrder order,BigDecimal cloudTeacherFee) {
         CloudTeacherOrder cloudTeacherOrder = new CloudTeacherOrder();
+        cloudTeacherOrder.setTenantId(order.getTenantId());
         cloudTeacherOrder.setOrganId(order.getOrganId());
         cloudTeacherOrder.setOrderId(order.getId());
         MusicGroupPaymentCalenderMember calenderMember = musicGroupPaymentCalenderMemberService.findByCalenderId(order.getCalenderId());

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

@@ -728,15 +728,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                 remitFee = groupType.get(kitGroupPurchaseType) == null ? BigDecimal.ZERO : groupType.get(kitGroupPurchaseType);
             }
             goodsGroup.setGoodsList(goodsService.findGoodsByIds(goodsGroup.getGoodsIdList()));
-            
-//            if(goodsGroup.getType().equals(GoodsType.ACCESSORIES)){
-//                goodsGroup.setPrice(BigDecimal.ZERO);
-//            	if((registerPayDto.getBuyCloudTeacher() || registerPayDto.getBuyCloudTeacherPlus()) && musicGroup.getCourseViewType() == CourseViewTypeEnum.MEMBER_FEE){
-//            		goodsGroup.setPrice(BigDecimal.ZERO);
-//            		continue;
-//            	}
-//            }
-            
+
             if(musicGroup.getOrganId() == 55 && (registerPayDto.getNewCourse() == null || registerPayDto.getNewCourse().size() == 0) && !(registerPayDto.getBuyCloudTeacher() || registerPayDto.getBuyCloudTeacherPlus())){
             	//取商品零售价
                 if (StringUtils.isNotBlank(goodsGroup.getGoodsIdList())) {

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SellOrderServiceImpl.java

@@ -236,6 +236,7 @@ public class SellOrderServiceImpl extends BaseServiceImpl<Integer, SellOrder> im
     @Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
     public List<SellOrder> addOrderDetail2SellOrder(List<StudentPaymentOrderDetail> orderDetails,
                                                     StudentPaymentOrder studentPaymentOrder, MusicGroup musicGroup,BigDecimal musicRemitFee) {
+        Integer tenantId = studentPaymentOrder.getTenantId();
         List<SellOrder> sellOrders = new ArrayList<>();
         //总余额支付
         BigDecimal totalBalance = studentPaymentOrder.getBalancePaymentAmount() != null ? studentPaymentOrder.getBalancePaymentAmount() : BigDecimal.ZERO;
@@ -302,6 +303,7 @@ public class SellOrderServiceImpl extends BaseServiceImpl<Integer, SellOrder> im
                     if (sellOrder.getHasRoute()) {
                         continue;
                     }
+                    sellOrder.setTenantId(tenantId);
                     BigDecimal sellOrderExpectAmount = BigDecimal.ZERO;
                     BigDecimal sellOrderBalance = BigDecimal.ZERO;
                     if (complementPrice.compareTo(BigDecimal.ZERO) > 0) {

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

@@ -18,6 +18,7 @@ import com.ym.mec.biz.service.*;
 
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.common.tenant.TenantContextHolder;
 import com.ym.mec.util.excel.POIUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;

+ 11 - 15
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java

@@ -173,6 +173,8 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
     private ActivityUserMapperService activityUserMapperService;
     @Autowired
     private MusicGroupPaymentCalenderActivityService musicGroupPaymentCalenderActivityService;
+    @Autowired
+    private MusicGroupPaymentCalenderMemberService musicGroupPaymentCalenderMemberService;
 
     @Override
     public BaseDAO<Long, StudentRegistration> getDAO() {
@@ -679,24 +681,11 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
         
         //云教练/云教练+
         if (registerPayDto.getBuyCloudTeacher()) {
-        	
-        	BigDecimal cloudTeacherPrice = BigDecimal.ZERO;
-        	
-        	if(musicGroup.getCloudTeacherType() != null){
-        		OrganizationCloudTeacherFee cloudTeacher = organizationCloudTeacherFeeDao.getByOrganId(studentRegistration.getOrganId());
-                cloudTeacherPrice = musicGroup.getCloudTeacherType() == 0 ? cloudTeacher.getPrice() : cloudTeacher.getPlusPrice();
-        	}else {
-        		MusicGroupPaymentCalender musicGroupRegCalender = musicGroupPaymentCalenderDao.getMusicGroupRegCalender(studentRegistration.getMusicGroupId());
-                if(musicGroupRegCalender == null){
-                	throw new BizException("缴费信息不存在");
-                }
-                
-                cloudTeacherPrice = musicGroupRegCalender.getMemberPaymentAmount();
-        	}
+            MusicGroupPaymentCalenderMember calenderMember = musicGroupPaymentCalenderMemberService.findByCalenderId(studentPaymentOrder.getCalenderId());
             OrderDetailTypeEnum orderDetailTypeEnum = OrderDetailTypeEnum.CLOUD_TEACHER;
             StudentPaymentOrderDetail cloudTeacherOrderDetail = new StudentPaymentOrderDetail();
             cloudTeacherOrderDetail.setType(orderDetailTypeEnum);
-            cloudTeacherOrderDetail.setPrice(cloudTeacherPrice);
+            cloudTeacherOrderDetail.setPrice(calenderMember.getActualAmount());
             cloudTeacherOrderDetail.setRemitFee(BigDecimal.ZERO);
             cloudTeacherOrderDetail.setCreateTime(date);
             cloudTeacherOrderDetail.setUpdateTime(date);
@@ -1094,6 +1083,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
         if (updateCount <= 0) {
             throw new BizException("订单更新失败");
         }
+        Integer tenantId = studentPaymentOrder.getTenantId();
         Date nowDate = new Date();
 
         //成功报名状态变更
@@ -1152,6 +1142,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
 
             //添加日志
             StudentCourseFeeDetail studentCourseFeeDetail = new StudentCourseFeeDetail();
+            studentCourseFeeDetail.setTenantId(tenantId);
             studentCourseFeeDetail.setStudentRegistrationId(studentRegistration.getId());
             studentCourseFeeDetail.setAmount(courseFee);
             studentCourseFeeDetail.setSurplusCourseFee(studentRegistration.getSurplusCourseFee());
@@ -1176,6 +1167,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
             rechargeDetail.setChannel(studentPaymentOrder.getPaymentChannel());
             rechargeDetail.setComAmount(studentPaymentOrder.getComAmount());
             rechargeDetail.setPerAmount(studentPaymentOrder.getPerAmount());
+            rechargeDetail.setTenantId(tenantId);
             sysUserCashAccountDetailService.insert(rechargeDetail);
 
             //缴费
@@ -1194,6 +1186,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
                 rechargeDetail.setComAmount(studentPaymentOrder.getComAmount().negate());
                 rechargeDetail.setPerAmount(studentPaymentOrder.getPerAmount().negate());
             }
+            paymentDetail.setTenantId(tenantId);
             sysUserCashAccountDetailService.insert(paymentDetail);
 
             //销售订单详情
@@ -1325,6 +1318,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
         if (musicGroupRegCalender == null) {
             throw new BizException("报名缴费信息查询失败");
         }
+        Integer tenantId = studentPaymentOrder.getTenantId();
 
         String batchNo = musicGroupRegCalender.getBatchNo();
         Long currentPaymentCalenderId = musicGroupRegCalender.getId();
@@ -1360,6 +1354,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
 
         for (MusicGroupPaymentCalender musicGroupPaymentCalender : musicGroupPaymentCalenderList) {
             MusicGroupPaymentCalenderDetail musicGroupPaymentCalenderDetail = new MusicGroupPaymentCalenderDetail();
+            musicGroupPaymentCalenderDetail.setTenantId(tenantId);
             musicGroupPaymentCalenderDetail.setMusicGroupPaymentCalenderId(musicGroupPaymentCalender.getId());
             musicGroupPaymentCalenderDetail.setUserId(studentPaymentOrder.getUserId());
             musicGroupPaymentCalenderDetail.setResponsibleUserId(musicGroupPaymentCalender.getOperator());
@@ -1414,6 +1409,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
                 musicGroupPaymentStudentCourseDetail.setUsedCourseMinutes(0);
                 musicGroupPaymentStudentCourseDetail.setCreateTime(nowDate);
                 musicGroupPaymentStudentCourseDetail.setUpdateTime(nowDate);
+                musicGroupPaymentStudentCourseDetail.setTenantId(tenantId);
 
                 musicGroupPaymentStudentCourseDetails.add(musicGroupPaymentStudentCourseDetail);
             }

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

@@ -59,15 +59,12 @@
     <!-- 向数据库增加一条记录 -->
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail" useGeneratedKeys="true"
             keyColumn="id" keyProperty="id">
-        <!--
-        <selectKey resultClass="int" keyProperty="id" >
-        SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
-        </selectKey>
-        -->
         INSERT INTO student_payment_order_detail
-        (id_,type_,goods_id_list_,price_,create_time_,update_time_,payment_order_id_,kit_group_purchase_type_,student_instrument_id_,is_renew_,tenant_id_)
-        VALUES(#{id},#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{goodsIdList},#{price},now(),now(),
-        #{paymentOrderId},#{kitGroupPurchaseType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{studentInstrumentId},#{isRenew},#{tenantId})
+        (type_,goods_id_list_,price_,create_time_,update_time_,payment_order_id_,kit_group_purchase_type_,
+         student_instrument_id_,is_renew_,tenant_id_)
+        VALUES(#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{goodsIdList},#{price},now(),now(),
+        #{paymentOrderId},#{kitGroupPurchaseType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+               #{studentInstrumentId},#{isRenew},#{tenantId})
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -121,12 +118,14 @@
 
     <insert id="batchAdd" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id_">
         INSERT INTO student_payment_order_detail
-        (id_,type_,goods_id_list_,price_,remit_fee_,create_time_,update_time_,payment_order_id_,kit_group_purchase_type_,student_instrument_id_,is_renew_,tenant_id_)
+        (type_,goods_id_list_,price_,remit_fee_,create_time_,update_time_,payment_order_id_,
+         kit_group_purchase_type_,student_instrument_id_,is_renew_,tenant_id_)
         VALUE
         <foreach collection="studentPaymentOrderDetailList" item="orderDetail" separator=",">
-            (#{orderDetail.id},#{orderDetail.type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+            (#{orderDetail.type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
             #{orderDetail.goodsIdList},#{orderDetail.price},#{orderDetail.remitFee},now(),now(),#{orderDetail.paymentOrderId},
-            #{orderDetail.kitGroupPurchaseType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{orderDetail.studentInstrumentId},#{orderDetail.isRenew},#{orderDetail.tenantId})
+            #{orderDetail.kitGroupPurchaseType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+            #{orderDetail.studentInstrumentId},#{orderDetail.isRenew},#{orderDetail.tenantId})
         </foreach>
     </insert>