Procházet zdrojové kódy

增加订单导出接口

周箭河 před 5 roky
rodič
revize
22b7923d26

+ 35 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentPaymentOrder.java

@@ -105,9 +105,18 @@ public class StudentPaymentOrder {
 	
 	private SysUser user = new SysUser();
 
-
+	//零星费用
 	private BigDecimal sporadicAmount;
-	
+
+	//乐器费用
+	private BigDecimal musicalFee;
+
+	//教辅费用
+	private BigDecimal teachingFee;
+
+	//手续费
+	private BigDecimal transferFee;
+
 	public void setId(Long id){
 		this.id = id;
 	}
@@ -319,4 +328,28 @@ public class StudentPaymentOrder {
 	public void setSporadicAmount(BigDecimal sporadicAmount) {
 		this.sporadicAmount = sporadicAmount;
 	}
+
+	public BigDecimal getMusicalFee() {
+		return musicalFee;
+	}
+
+	public void setMusicalFee(BigDecimal musicalFee) {
+		this.musicalFee = musicalFee;
+	}
+
+	public BigDecimal getTeachingFee() {
+		return teachingFee;
+	}
+
+	public void setTeachingFee(BigDecimal teachingFee) {
+		this.teachingFee = teachingFee;
+	}
+
+	public BigDecimal getTransferFee() {
+		return transferFee;
+	}
+
+	public void setTransferFee(BigDecimal transferFee) {
+		this.transferFee = transferFee;
+	}
 }

+ 19 - 1
mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java

@@ -11,7 +11,9 @@ import com.ym.mec.biz.dal.dto.musicalListDetailDto;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.Goods;
 import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
+import com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail;
 import com.ym.mec.biz.dal.enums.GroupType;
+import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
 import com.ym.mec.biz.dal.page.CourseScheduleTeacherSalaryQueryInfo;
 import com.ym.mec.biz.dal.page.StudentPaymentOrderQueryInfo;
 import com.ym.mec.biz.dal.page.StudentRegistrationQueryInfo;
@@ -180,11 +182,27 @@ public class ExportController extends BaseController {
                 row.setExpectAmount(perAmount.add(balancePaymentAmount));
                 row.setActualAmount(perAmount.add(balancePaymentAmount));
             }
+            BigDecimal transferFee = (row.getActualAmount().subtract(balancePaymentAmount).multiply(new BigDecimal(0.28)).divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_HALF_UP);
+            row.setTransferFee(transferFee);
             if(row.getGroupType().equals(GroupType.SPORADIC)){
                 row.setSporadicAmount(row.getActualAmount());
                 row.setExpectAmount(BigDecimal.ZERO);
                 row.setActualAmount(BigDecimal.ZERO);
             }
+            List<StudentPaymentOrderDetail> orderDetails = studentPaymentOrderDetailDao.findApplyOrderGoods(row.getId());
+            BigDecimal musicalFee = BigDecimal.ZERO;
+            BigDecimal teachingFee = BigDecimal.ZERO;
+            if(orderDetails.size() > 0) {
+                for (StudentPaymentOrderDetail orderDetail : orderDetails) {
+                    if (orderDetail.getType().equals(OrderDetailTypeEnum.MUSICAL)) {
+                        musicalFee =  musicalFee.add(orderDetail.getPrice());
+                    } else if (orderDetail.getType().equals(OrderDetailTypeEnum.ACCESSORIES) || orderDetail.getType().equals(OrderDetailTypeEnum.TEACHING)) {
+                        teachingFee =  teachingFee.add(orderDetail.getPrice());
+                    }
+                }
+            }
+            row.setMusicalFee(musicalFee);
+            row.setTeachingFee(teachingFee);
 
         }
 
@@ -192,7 +210,7 @@ public class ExportController extends BaseController {
             String[] header = {"序号", "学生姓名", "交易流水号", "订单编号", "收款渠道", "收款账户", "支付金额", "到账时间",
             "关联乐团ID/VIP课ID","课程形态","押金","乐器","教辅费用","零星收款费用","零星收款类别","手续费","专业","分部","单位/学校","备注"};
             String[] body = {"id", "user.username", "transNo", "orderNo", "paymentChannel", "merNos", "actualAmount", "payTime", "musicGroupId",
-            "groupType",    "groupType","groupType","groupType","SporadicAmount","SporadicAmount","groupType","groupType","groupType","groupType","memo"};
+            "groupType","musicalFee","musicalFee","teachingFee","SporadicAmount","SporadicAmount","transferFee","groupType","groupType","groupType","memo"};
             HSSFWorkbook workbook = POIUtil.exportExcel(header, body, studentPaymentOrderPageInfo.getRows());
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");