Selaa lähdekoodia

Merge branch 'master' of http://git.dayaedu.com/yonge/mec

yonge 4 vuotta sitten
vanhempi
commit
a98c4b9b98

+ 9 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentPaymentRouteOrderDao.java

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.dal.dao;
 
 
+import com.ym.mec.biz.dal.dto.FeeFlagNumDto;
 import com.ym.mec.biz.dal.dto.StudentPaymentOrderExportDto;
 import com.ym.mec.biz.dal.dto.StudentPaymentRouteOrderDto;
 import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
@@ -57,16 +58,18 @@ public interface StudentPaymentRouteOrderDao extends BaseDAO<Long, StudentPaymen
 
     /**
      * 插入外部订单
+     *
      * @return
      */
     int insertOrder(StudentPaymentOrder order);
-    
+
     int queryAuditCount(Map<String, Object> params);
-    
+
     List<StudentPaymentRouteOrder> queryAuditPage(Map<String, Object> params);
 
     /**
      * 是否有重复到订单号
+     *
      * @param transNos
      * @return
      */
@@ -74,6 +77,7 @@ public interface StudentPaymentRouteOrderDao extends BaseDAO<Long, StudentPaymen
 
     /**
      * 获取审核通过的学校缴费金额
+     *
      * @param calenderId
      * @return
      */
@@ -81,8 +85,11 @@ public interface StudentPaymentRouteOrderDao extends BaseDAO<Long, StudentPaymen
 
     /**
      * 更换订单号获取
+     *
      * @param orderNo
      * @return
      */
     StudentPaymentRouteOrder getByOrderNo(String orderNo);
+
+    FeeFlagNumDto getCountFeeFlagNum(@Param("orderNo") String orderNo);
 }

+ 22 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/FeeFlagNumDto.java

@@ -0,0 +1,22 @@
+package com.ym.mec.biz.dal.dto;
+
+public class FeeFlagNumDto {
+    private Integer totalNum;
+    private Integer yesNum;
+
+    public Integer getTotalNum() {
+        return totalNum;
+    }
+
+    public void setTotalNum(Integer totalNum) {
+        this.totalNum = totalNum;
+    }
+
+    public Integer getYesNum() {
+        return yesNum;
+    }
+
+    public void setYesNum(Integer yesNum) {
+        this.yesNum = yesNum;
+    }
+}

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentPaymentOrderExportDto.java

@@ -70,6 +70,8 @@ public class StudentPaymentOrderExportDto extends StudentPaymentOrder {
     //分润余额
     private BigDecimal routeBalance;
 
+    private String feeFlag;
+
     public BigDecimal getSporadicAmount() {
         return sporadicAmount;
     }
@@ -277,4 +279,12 @@ public class StudentPaymentOrderExportDto extends StudentPaymentOrder {
     public void setOtherFee(BigDecimal otherFee) {
         this.otherFee = otherFee;
     }
+
+    public String getFeeFlag() {
+        return feeFlag;
+    }
+
+    public void setFeeFlag(String feeFlag) {
+        this.feeFlag = feeFlag;
+    }
 }

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

@@ -495,6 +495,7 @@
         <result column="routeMerNo" property="routeMerNo"/>
         <result column="routeAmount" property="routeAmount"/>
         <result column="routeBalance" property="routeBalance"/>
+        <result column="feeFlag" property="feeFlag"/>
         <collection property="orderDetailList" ofType="com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail">
             <result column="detail_id_" property="id"/>
             <result column="detail_type_" property="type"/>

+ 7 - 1
mec-biz/src/main/resources/config/mybatis/StudentPaymentRouteOrderMapper.xml

@@ -284,7 +284,7 @@
         detail_price_,spod.kit_group_purchase_type_ detail_kit_group_purchase_type_,
         sci.charge_type_,g.id_ goods_id, g.name_ goods_name,o.name_ organ_name,spro.route_amount_
         routeAmount,spro.route_balance_amount_ routeBalance,
-        spro.mer_no_ routeMerNo
+        spro.mer_no_ routeMerNo,spro.fee_flag_ feeFlag
         FROM student_payment_order spo
         LEFT JOIN student_payment_route_order spro ON spro.order_no_ = spo.order_no_
         LEFT JOIN sys_user u on spo.user_id_ = u.id_
@@ -393,5 +393,11 @@
     <select id="getByOrderNo" resultMap="StudentPaymentRouteOrder">
         SELECT * FROM student_payment_route_order WHERE order_no_ = #{orderNo} LIMIT 1
     </select>
+    <select id="getCountFeeFlagNum" resultType="com.ym.mec.biz.dal.dto.FeeFlagNumDto">
+        SELECT SUM(1) totalNum,
+               SUM(IF(fee_flag_='Y',1, 0)) yesNum
+        FROM student_payment_route_order WHERE order_no_=#{orderNo}
+    </select>
+
 
 </mapper>

+ 10 - 30
mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java

@@ -1,6 +1,7 @@
 package com.ym.mec.web.controller;
 
 import com.ym.mec.biz.dal.dao.*;
+import com.ym.mec.biz.dal.dto.*;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 
@@ -33,32 +34,6 @@ import org.springframework.web.bind.annotation.RestController;
 
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.dto.BasicUserDto;
-import com.ym.mec.biz.dal.dto.CourseGroupExportDto;
-import com.ym.mec.biz.dal.dto.CourseReviewDto;
-import com.ym.mec.biz.dal.dto.CourseScheduleEndDto;
-import com.ym.mec.biz.dal.dto.ExportStudentAttendanceDto;
-import com.ym.mec.biz.dal.dto.ExportTeacherSalaryDto;
-import com.ym.mec.biz.dal.dto.ExtraExerciseStudentsDto;
-import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDto;
-import com.ym.mec.biz.dal.dto.MusicGroupRegisterDto;
-import com.ym.mec.biz.dal.dto.MusicGroupStudentsDto;
-import com.ym.mec.biz.dal.dto.MusicalListDetailDto;
-import com.ym.mec.biz.dal.dto.OrderByTypeExportDto;
-import com.ym.mec.biz.dal.dto.PageInfoDegree;
-import com.ym.mec.biz.dal.dto.PracticeCourseDto;
-import com.ym.mec.biz.dal.dto.PracticeGroupDto;
-import com.ym.mec.biz.dal.dto.RegisterSubjectDto;
-import com.ym.mec.biz.dal.dto.Student4operating;
-import com.ym.mec.biz.dal.dto.StudentApplyDetailDto;
-import com.ym.mec.biz.dal.dto.StudentBuyPracticeDto;
-import com.ym.mec.biz.dal.dto.StudentExercisesSituationDto;
-import com.ym.mec.biz.dal.dto.StudentManageListDto;
-import com.ym.mec.biz.dal.dto.StudentPaymentOrderExportDto;
-import com.ym.mec.biz.dal.dto.TeacherCourseSalaryDetail4WebDto;
-import com.ym.mec.biz.dal.dto.TeacherDefaultSalaryDto;
-import com.ym.mec.biz.dal.dto.TeacherSalaryDto;
-import com.ym.mec.biz.dal.dto.VipBuyResultDto;
 import com.ym.mec.biz.dal.entity.CooperationOrgan;
 import com.ym.mec.biz.dal.entity.DegreeRegistration;
 import com.ym.mec.biz.dal.entity.Employee;
@@ -2191,10 +2166,15 @@ public class ExportController extends BaseController {
             if (row.getMemo() == null) {
                 row.setMemo("");
             }
-            BigDecimal transferFee = row.getActualAmount().multiply(new BigDecimal("0.28")).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP);
-            String delayRouteStartDate = sysConfigDao.findConfigValue("delay_route_start_date");
-            if (row.getCreateTime().after(Objects.requireNonNull(DateUtil.stringToDate(delayRouteStartDate, "yyyy-MM-dd HH:mm:ss")))) {
-                transferFee = row.getRouteAmount().multiply(new BigDecimal("0.28")).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP);
+            BigDecimal transferFee = BigDecimal.ZERO;
+            if(row.getPaymentChannel() != null && row.getPaymentChannel().equals("ADAPAY")){
+                FeeFlagNumDto countFeeFlagNum = studentPaymentRouteOrderDao.getCountFeeFlagNum(row.getOrderNo());
+                if(countFeeFlagNum.getTotalNum() > countFeeFlagNum.getYesNum() && row.getFeeFlag().equals("Y")){
+                    transferFee = row.getActualAmount().multiply(new BigDecimal("0.28")).divide(new BigDecimal(100),2,BigDecimal.ROUND_HALF_UP);
+                }
+                if(countFeeFlagNum.getTotalNum().equals(countFeeFlagNum.getYesNum())){
+                    transferFee = row.getRouteAmount().multiply(new BigDecimal("0.28")).divide(new BigDecimal(100),2,BigDecimal.ROUND_HALF_UP);
+                }
             }
             row.setTransferFee(transferFee);