Browse Source

手续费算法fix

周箭河 4 years ago
parent
commit
e079212317

+ 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;
+    }
 }

+ 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);