周箭河 пре 4 година
родитељ
комит
9d83c57fc4

+ 81 - 8
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentPaymentOrderExportDto.java

@@ -14,24 +14,41 @@ public class StudentPaymentOrderExportDto extends StudentPaymentOrder {
     //零星费用类型
     private String sporadicType;
 
-    private BigDecimal courseFee;
+    //课程费用(废弃)
+    private BigDecimal courseFee = BigDecimal.ZERO;
 
-    private BigDecimal highOnlineCourseFee;
+    //新生专享(废弃)
+    private BigDecimal highOnlineCourseFee = BigDecimal.ZERO;
 
     //乐器费用
-    private BigDecimal musicalFee;
+    private BigDecimal musicalFee = BigDecimal.ZERO;
 
-    //租赁费用
-    private BigDecimal leaseFee;
+    //押金费用
+    private BigDecimal leaseFee = BigDecimal.ZERO;
 
     //教辅费用
-    private BigDecimal teachingFee;
+    private BigDecimal teachingFee = BigDecimal.ZERO;
 
     //维修费用
-    private BigDecimal repairFee;
+    private BigDecimal repairFee = BigDecimal.ZERO;
 
     //手续费
-    private BigDecimal transferFee;
+    private BigDecimal transferFee = BigDecimal.ZERO;
+
+    //乐团课程费用
+    private BigDecimal musicGroupCourseFee = BigDecimal.ZERO;
+    //网络基础训练课程费用
+    private BigDecimal HighCourseFee = BigDecimal.ZERO;
+    //VIP课程费用
+    private BigDecimal vipCourseFee = BigDecimal.ZERO;
+    //网管课程费用
+    private BigDecimal practiceCourseFee = BigDecimal.ZERO;
+    //乐理课程费用
+    private BigDecimal theoryCourseFee = BigDecimal.ZERO;
+    //考级费用
+    private BigDecimal degreeFee = BigDecimal.ZERO;
+    //其它费用
+    private BigDecimal otherFee = BigDecimal.ZERO;
 
     private String organName;
     private String schoolName;
@@ -204,4 +221,60 @@ public class StudentPaymentOrderExportDto extends StudentPaymentOrder {
     public void setRepairFee(BigDecimal repairFee) {
         this.repairFee = repairFee;
     }
+
+    public BigDecimal getMusicGroupCourseFee() {
+        return musicGroupCourseFee;
+    }
+
+    public void setMusicGroupCourseFee(BigDecimal musicGroupCourseFee) {
+        this.musicGroupCourseFee = musicGroupCourseFee;
+    }
+
+    public BigDecimal getHighCourseFee() {
+        return HighCourseFee;
+    }
+
+    public void setHighCourseFee(BigDecimal highCourseFee) {
+        HighCourseFee = highCourseFee;
+    }
+
+    public BigDecimal getVipCourseFee() {
+        return vipCourseFee;
+    }
+
+    public void setVipCourseFee(BigDecimal vipCourseFee) {
+        this.vipCourseFee = vipCourseFee;
+    }
+
+    public BigDecimal getPracticeCourseFee() {
+        return practiceCourseFee;
+    }
+
+    public void setPracticeCourseFee(BigDecimal practiceCourseFee) {
+        this.practiceCourseFee = practiceCourseFee;
+    }
+
+    public BigDecimal getTheoryCourseFee() {
+        return theoryCourseFee;
+    }
+
+    public void setTheoryCourseFee(BigDecimal theoryCourseFee) {
+        this.theoryCourseFee = theoryCourseFee;
+    }
+
+    public BigDecimal getDegreeFee() {
+        return degreeFee;
+    }
+
+    public void setDegreeFee(BigDecimal degreeFee) {
+        this.degreeFee = degreeFee;
+    }
+
+    public BigDecimal getOtherFee() {
+        return otherFee;
+    }
+
+    public void setOtherFee(BigDecimal otherFee) {
+        this.otherFee = otherFee;
+    }
 }

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

@@ -23,6 +23,7 @@ import javax.servlet.http.HttpServletResponse;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -1076,21 +1077,49 @@ public class ExportController extends BaseController {
             BigDecimal courseFee = BigDecimal.ZERO;
             BigDecimal leaseFee = BigDecimal.ZERO;
             BigDecimal highOnlineCourseFee = BigDecimal.ZERO;
+
+            BigDecimal musicGroupCourseFee = BigDecimal.ZERO; //乐团课程费用
+            BigDecimal highCourseFee = BigDecimal.ZERO; //网络基础训练课程费用
+            BigDecimal vipCourseFee = BigDecimal.ZERO; //VIP课程费用
+            BigDecimal practiceCourseFee = BigDecimal.ZERO; //网管课程费用
+            BigDecimal theoryCourseFee = BigDecimal.ZERO; //乐理课程费用
+            BigDecimal degreeFee = BigDecimal.ZERO; //考级费用
+            BigDecimal repairFee = BigDecimal.ZERO; //维修费用
+            BigDecimal otherFee = BigDecimal.ZERO; //其它费用
+
             String goodsName = "";
             if (row.getOrderDetailList() != null) {
                 for (StudentPaymentOrderDetail orderDetail : row.getOrderDetailList()) {
-                    if (orderDetail.getType().equals(OrderDetailTypeEnum.MUSICAL)) {
-                        if (orderDetail.getKitGroupPurchaseType() != null && orderDetail.getKitGroupPurchaseType().equals(KitGroupPurchaseTypeEnum.LEASE)) {
-                            leaseFee = orderDetail.getPrice();
-                        } else {
-                            musicalFee = 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)) {
-                        teachingFee = teachingFee.add(orderDetail.getPrice());
-                    } else if (orderDetail.getType().equals(OrderDetailTypeEnum.HIGH_ONLINE_COURSE)) {
-                        highOnlineCourseFee = highOnlineCourseFee.add(orderDetail.getPrice());
+                    switch (orderDetail.getType()){
+                        case COURSE:
+                        case CLASSROOM:
+                        case SINGLE:
+                        case MIX:
+                        case COMPREHENSIVE:
+                        case ENLIGHTENMENT:
+                        case TRAINING_SINGLE:
+                        case TRAINING_MIX:
+                        case MUSIC_NETWORK:
+                            musicGroupCourseFee = musicGroupCourseFee.add(orderDetail.getPrice());
+                            break;
+                        case HIGH:
+                        case HIGH_ONLINE:
+                            highCourseFee = highCourseFee.add(orderDetail.getPrice());
+                        case MUSICAL:
+                            if (orderDetail.getKitGroupPurchaseType() != null && orderDetail.getKitGroupPurchaseType().equals(KitGroupPurchaseTypeEnum.LEASE)) {
+                                leaseFee = orderDetail.getPrice();
+                            } else {
+                                musicalFee = orderDetail.getPrice();
+                            }
+                            break;
+                        case ACCESSORIES:
+                        case TEACHING:
+                            teachingFee = teachingFee.add(orderDetail.getPrice());
+                            break;
+                        case OTHER:
+                            otherFee = otherFee.add(orderDetail.getPrice());
+                        default:
+                            break;
                     }
                 }
             }
@@ -1105,7 +1134,7 @@ public class ExportController extends BaseController {
             row.setHighOnlineCourseFee(highOnlineCourseFee);
             //专业
             if (row.getGroupType().equals(GroupType.VIP)) {
-                row.setCourseFee(row.getActualAmount());
+                row.setVipCourseFee(row.getActualAmount());
                 VipGroup vipGroupInfo = vipGroupDao.findVipGroupInfo(Integer.parseInt(row.getMusicGroupId()), row.getClassGroupId());
                 if (vipGroupInfo != null) {
                     row.setSchoolName(vipGroupInfo.getSchoolName());
@@ -1173,9 +1202,9 @@ public class ExportController extends BaseController {
 
         try {
             String[] header = {"序号", "学生姓名", "交易流水号", "订单编号", "收款渠道", "收款账户", "应付金额", "现金支付", "余额支付", "创建时间", "到账时间",
-                    "关联乐团ID/VIP课ID", "课程形态", "课程费用", "新生专享课程费用", "乐器减免费用", "课程减免费用", "押金", "乐器", "教辅费用", "维修费用", "零星收款费用", "零星收款类别", "手续费", "专业", "分部", "单位/学校", "合作机构", "备注"};
+                    "关联乐团ID/VIP课ID", "课程形态", "课程费用", "网络基础训练", "乐器减免费用", "课程减免费用", "押金", "乐器", "教辅费用", "维修费用", "零星收款费用", "零星收款类别", "手续费", "专业", "分部", "单位/学校", "合作机构", "备注"};
             String[] body = {"id", "user.username", "transNo", "orderNo", "paymentChannel", "merNos", "expectAmount", "actualAmount", "balancePaymentAmount", "createTime", "payTime", "musicGroupId",
-                    "groupType.desc", "courseFee", "highOnlineCourseFee", "remitFee", "courseRemitFee", "leaseFee", "musicalFee", "teachingFee", "repairFee", "sporadicAmount", "sporadicType", "transferFee", "subjectName", "organName", "schoolName", "cooperationOrganName", "memo"};
+                    "groupType.desc", "courseFee", "highCourseFee", "remitFee", "courseRemitFee", "leaseFee", "musicalFee", "teachingFee", "repairFee", "sporadicAmount", "sporadicType", "transferFee", "subjectName", "organName", "schoolName", "cooperationOrganName", "memo"};
             HSSFWorkbook workbook = POIUtil.exportExcel(header, body, studentPaymentOrderExportDtos);
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
@@ -2170,19 +2199,50 @@ public class ExportController extends BaseController {
             BigDecimal teachingFee = BigDecimal.ZERO; //教辅费用
             BigDecimal courseFee = BigDecimal.ZERO; //课程费用
             BigDecimal leaseFee = BigDecimal.ZERO; //押金费用
+
+            BigDecimal musicGroupCourseFee = BigDecimal.ZERO; //乐团课程费用
+            BigDecimal highCourseFee = BigDecimal.ZERO; //网络基础训练课程费用
+            BigDecimal vipCourseFee = BigDecimal.ZERO; //VIP课程费用
+            BigDecimal practiceCourseFee = BigDecimal.ZERO; //网管课程费用
+            BigDecimal theoryCourseFee = BigDecimal.ZERO; //乐理课程费用
+            BigDecimal degreeFee = BigDecimal.ZERO; //考级费用
+            BigDecimal repairFee = BigDecimal.ZERO; //维修费用
+            BigDecimal otherFee = BigDecimal.ZERO; //其它费用
+
             String goodsName = "";
             if (row.getOrderDetailList() != null) {
                 for (StudentPaymentOrderDetail orderDetail : row.getOrderDetailList()) {
-                    if (orderDetail.getType().equals(OrderDetailTypeEnum.MUSICAL)) {
-                        if (orderDetail.getKitGroupPurchaseType() != null && orderDetail.getKitGroupPurchaseType().equals(KitGroupPurchaseTypeEnum.LEASE)) {
-                            leaseFee = orderDetail.getPrice();
-                        } else {
-                            musicalFee = 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)) {
-                        teachingFee = teachingFee.add(orderDetail.getPrice());
+                    switch (orderDetail.getType()){
+                        case COURSE:
+                        case CLASSROOM:
+                        case SINGLE:
+                        case MIX:
+                        case COMPREHENSIVE:
+                        case ENLIGHTENMENT:
+                        case TRAINING_SINGLE:
+                        case TRAINING_MIX:
+                        case MUSIC_NETWORK:
+                            musicGroupCourseFee = musicGroupCourseFee.add(orderDetail.getPrice());
+                            break;
+                        case HIGH:
+                        case HIGH_ONLINE:
+                        case HIGH_ONLINE_COURSE:
+                            highCourseFee = highCourseFee.add(orderDetail.getPrice());
+                        case MUSICAL:
+                            if (orderDetail.getKitGroupPurchaseType() != null && orderDetail.getKitGroupPurchaseType().equals(KitGroupPurchaseTypeEnum.LEASE)) {
+                                leaseFee = orderDetail.getPrice();
+                            } else {
+                                musicalFee = orderDetail.getPrice();
+                            }
+                            break;
+                        case ACCESSORIES:
+                        case TEACHING:
+                            teachingFee = teachingFee.add(orderDetail.getPrice());
+                            break;
+                        case OTHER:
+                            otherFee = otherFee.add(orderDetail.getPrice());
+                        default:
+                            break;
                     }
                 }
             }
@@ -2190,19 +2250,19 @@ public class ExportController extends BaseController {
                 goodsName = row.getGoodsList().stream().map(Goods::getName).collect(Collectors.joining("|"));
             }
             row.setCourseFee(courseFee);
+            row.setMusicGroupCourseFee(musicGroupCourseFee);
             row.setMusicalFee(musicalFee);
             row.setTeachingFee(teachingFee);
             row.setLeaseFee(leaseFee);
             row.setMemo(goodsName);
             //专业
             if (row.getGroupType().equals(GroupType.VIP)) {
-                row.setCourseFee(row.getActualAmount());
+                row.setVipCourseFee(row.getActualAmount());
                 VipGroup vipGroupInfo = vipGroupDao.findVipGroupInfo(Integer.parseInt(row.getMusicGroupId()), row.getClassGroupId());
                 if (vipGroupInfo != null) {
                     row.setSchoolName(vipGroupInfo.getSchoolName());
                     row.setSubjectName(vipGroupInfo.getSubjectName());
                 }
-
             } else if (row.getGroupType().equals(GroupType.SPORADIC)) {
                 row.setSporadicAmount(row.getActualAmount());
                 row.setMusicalFee(BigDecimal.ZERO);
@@ -2218,7 +2278,7 @@ public class ExportController extends BaseController {
                     row.setSchoolName(userSchool.getName());
                 }
             } else if (row.getGroupType().equals(GroupType.PRACTICE)) {
-                row.setCourseFee(row.getActualAmount());
+                row.setPracticeCourseFee(row.getActualAmount());
                 School userSchool = musicGroupDao.findUserSchool(row.getUserId());
                 if (userSchool != null) {
                     row.setSchoolName(userSchool.getName());
@@ -2244,7 +2304,7 @@ public class ExportController extends BaseController {
                 } else if (row.getType().equals(OrderTypeEnum.REPAIR)) {
                     row.setRepairFee(feeByType.getExpectAmount().subtract(feeByType.getMusicalFee()).subtract(feeByType.getTeachingFee()));
                 } else if (row.getType().equals(OrderTypeEnum.OUTORDER)) {
-                    row.setCourseFee(feeByType.getExpectAmount().subtract(feeByType.getMusicalFee()).subtract(feeByType.getTeachingFee()));
+                    row.setMusicGroupCourseFee(feeByType.getExpectAmount().subtract(feeByType.getMusicalFee()).subtract(feeByType.getTeachingFee()));
                     row.setTransferFee(BigDecimal.ZERO);
                 }
             }
@@ -2266,7 +2326,7 @@ public class ExportController extends BaseController {
             String[] header = {"序号", "学生姓名", "交易流水号", "订单编号", "收款渠道", "收款账户", "应付金额", "现金支付", "余额支付", "分润账户", "分润金额", "分润余额", "到账时间",
                     "关联乐团ID/VIP课ID", "课程形态", "课程费用", "减免费用", "押金", "乐器", "教辅费用", "维修费用", "零星收款费用", "零星收款类别", "手续费", "专业", "分部", "教学点", "合作单位", "备注"};
             String[] body = {"id", "user.username", "transNo", "orderNo", "paymentChannel", "merNos", "expectAmount", "actualAmount", "balancePaymentAmount", "routeMerNo", "routeAmount", "routeBalance", "payTime", "musicGroupId",
-                    "groupType.desc", "courseFee", "remitFee", "leaseFee", "musicalFee", "teachingFee","repairFee", "sporadicAmount", "sporadicType", "transferFee", "subjectName", "organName", "schoolName", "cooperationOrganName", "memo"};
+                    "groupType.desc", "musicGroupCourseFee", "remitFee", "leaseFee", "musicalFee", "teachingFee","repairFee", "sporadicAmount", "sporadicType", "transferFee", "subjectName", "organName", "schoolName", "cooperationOrganName", "memo"};
             HSSFWorkbook workbook = POIUtil.exportExcel(header, body, studentPaymentOrderExportDtos);
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls"); //    //收款账户