|  | @@ -1,6 +1,8 @@
 | 
	
		
			
				|  |  |  package com.ym.mec.web.controller;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dao.*;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.dto.*;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.entity.*;
 | 
	
		
			
				|  |  |  import io.swagger.annotations.Api;
 | 
	
		
			
				|  |  |  import io.swagger.annotations.ApiOperation;
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -23,6 +25,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;
 | 
	
	
		
			
				|  | @@ -32,48 +35,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;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.Goods;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.MusicGroupBuildLog;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.School;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.SellOrder;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.SporadicChargeInfo;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.Student;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.StudentRegistration;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.TeacherCourseReward;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.TeacherSalaryComplaints;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.TenantPaymentOrder;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.VipGroup;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.enums.AccountType;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.enums.CourseStatusEnum;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.enums.GroupType;
 | 
	
	
		
			
				|  | @@ -312,15 +273,15 @@ public class ExportController extends BaseController {
 | 
	
		
			
				|  |  |          if (sysUser == null) {
 | 
	
		
			
				|  |  |              throw new BizException("用户信息获取失败");
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -        if(!sysUser.getIsSuperAdmin()){
 | 
	
		
			
				|  |  | +        if (!sysUser.getIsSuperAdmin()) {
 | 
	
		
			
				|  |  |              Employee employee = employeeDao.get(sysUser.getId());
 | 
	
		
			
				|  |  |              if (StringUtils.isEmpty(queryInfo.getOrganId())) {
 | 
	
		
			
				|  |  |                  queryInfo.setOrganId(employee.getOrganIdList());
 | 
	
		
			
				|  |  | -            }else if(StringUtils.isEmpty(employee.getOrganIdList())){
 | 
	
		
			
				|  |  | +            } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
 | 
	
		
			
				|  |  |                  throw new BizException("用户所在分部异常");
 | 
	
		
			
				|  |  | -            }else {
 | 
	
		
			
				|  |  | +            } else {
 | 
	
		
			
				|  |  |                  List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
 | 
	
		
			
				|  |  | -                if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
 | 
	
		
			
				|  |  | +                if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
 | 
	
		
			
				|  |  |                      throw new BizException("非法请求");
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
	
		
			
				|  | @@ -330,7 +291,7 @@ public class ExportController extends BaseController {
 | 
	
		
			
				|  |  |          List<MusicGroupPaymentCalenderAuditDto> rows = musicGroupPaymentCalenderService.auditList(queryInfo).getRows();
 | 
	
		
			
				|  |  |          OutputStream outputStream = response.getOutputStream();
 | 
	
		
			
				|  |  |          try {
 | 
	
		
			
				|  |  | -            HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"分部名称","分部编号","乐团编号", "乐团名称", "申请类型", "订单类型", "加课总时长(分钟)", "原现价(元)",
 | 
	
		
			
				|  |  | +            HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"分部名称", "分部编号", "乐团编号", "乐团名称", "申请类型", "订单类型", "加课总时长(分钟)", "原现价(元)",
 | 
	
		
			
				|  |  |                      "申请价格(元)", "备注", "申请人", "状态", "申请时间"}, new String[]{
 | 
	
		
			
				|  |  |                      "organName", "organId", "musicGroupId", "musicGroupName", "paymentType.desc", "payUserType.desc",
 | 
	
		
			
				|  |  |                      "addCourseTotalTime", "courseCurrentPrice", "courseOriginalPrice", "memo", "operatorName", "auditStatus.desc", "createTime"}, rows);
 | 
	
	
		
			
				|  | @@ -537,11 +498,11 @@ public class ExportController extends BaseController {
 | 
	
		
			
				|  |  |                      "课程分部", "课程组编号", "课程班名称", "乐团模式", "vip活动名称", "Vip课程类型", "阶梯奖励名称", "线上课/线下课", "线上课单价", "线下课单价",
 | 
	
		
			
				|  |  |                      "课程类别", "课时时长", "实际上课时长", "上课日期",
 | 
	
		
			
				|  |  |                      "上课时间", "教师签到状态", "教师签退状态", "教师签到时间", "教师签退时间", "考勤申诉处理状态", "处理意见",
 | 
	
		
			
				|  |  | -                    "主辅", "上课地点", "应到学员","学员签到时间", "学员签退时间", "课时课酬", "阶梯奖励", "扣款原因"}, new String[]{
 | 
	
		
			
				|  |  | +                    "主辅", "上课地点", "应到学员", "学员签到时间", "学员签退时间", "课时课酬", "阶梯奖励", "扣款原因"}, new String[]{
 | 
	
		
			
				|  |  |                      "courseScheduleId", "teacherId", "teacherName", "teacherOrganName", "jobType",
 | 
	
		
			
				|  |  |                      "courseScheduleOrganName", "groupId", "groupName", "changeType", "vipActiveName", "vipCategoryName", "activeName", "teachMode", "onlineClassesUnitPrice", "offlineClassesUnitPrice",
 | 
	
		
			
				|  |  |                      "courseScheduleType", "signCourseScheduleTime", "currentTime", "classDate", "courseScheduleStartTime", "signInStatus",
 | 
	
		
			
				|  |  | -                    "signOutStatus", "signInTime", "signOutTime","complaintsStatus", "disposeContent", "teacherRole", "address", "studentNum",
 | 
	
		
			
				|  |  | +                    "signOutStatus", "signInTime", "signOutTime", "complaintsStatus", "disposeContent", "teacherRole", "address", "studentNum",
 | 
	
		
			
				|  |  |                      "studentSignInTime", "studentSignOutTime", "price", "rewards", "deductionReason"}, rows);
 | 
	
		
			
				|  |  |              response.setContentType("application/octet-stream");
 | 
	
		
			
				|  |  |              response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
 | 
	
	
		
			
				|  | @@ -814,16 +775,16 @@ public class ExportController extends BaseController {
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          List<CourseScheduleEndDto> rows = scheduleService.endFindCourseSchedules(queryInfo).getRows();
 | 
	
		
			
				|  |  | -        for(CourseScheduleEndDto row : rows){
 | 
	
		
			
				|  |  | -        	row.setIsComplaints(StringUtils.equals(row.getIsComplaints(), "1") ? "有" : "无");
 | 
	
		
			
				|  |  | +        for (CourseScheduleEndDto row : rows) {
 | 
	
		
			
				|  |  | +            row.setIsComplaints(StringUtils.equals(row.getIsComplaints(), "1") ? "有" : "无");
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          OutputStream ouputStream = null;
 | 
	
		
			
				|  |  |          try {
 | 
	
		
			
				|  |  |              HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"分部名称", "课程编号", "开始时间", "结束时间",
 | 
	
		
			
				|  |  |                      "班级名称", "班级声部", "课程名称", "课程类型", "教学模式",
 | 
	
		
			
				|  |  | -                    "教学点", "课程状态", "指导老师", "学员编号", "是否点名","是否有考勤申诉"}, new String[]{
 | 
	
		
			
				|  |  | +                    "教学点", "课程状态", "指导老师", "学员编号", "是否点名", "是否有考勤申诉"}, new String[]{
 | 
	
		
			
				|  |  |                      "organName", "id", "startClassTime", "endClassTime", "classGroupName", "subjectName", "name",
 | 
	
		
			
				|  |  | -                    "groupType.desc", "teachMode.msg", "schoolName", "status.msg", "teacherName", "studentId", "isCallNames.msg","isComplaints"}, rows);
 | 
	
		
			
				|  |  | +                    "groupType.desc", "teachMode.msg", "schoolName", "status.msg", "teacherName", "studentId", "isCallNames.msg", "isComplaints"}, rows);
 | 
	
		
			
				|  |  |              response.setContentType("application/octet-stream");
 | 
	
		
			
				|  |  |              response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
 | 
	
		
			
				|  |  |              ouputStream = response.getOutputStream();
 | 
	
	
		
			
				|  | @@ -1056,66 +1017,104 @@ public class ExportController extends BaseController {
 | 
	
		
			
				|  |  |          OutputStream outputStream = response.getOutputStream();
 | 
	
		
			
				|  |  |          long i = 1;
 | 
	
		
			
				|  |  |          for (StudentPaymentOrderExportDto row : studentPaymentOrderExportDtos) {
 | 
	
		
			
				|  |  | -            if (queryInfo.getOrderType().equals("1")) {
 | 
	
		
			
				|  |  | -                BigDecimal comAmount = row.getComAmount() == null ? BigDecimal.ZERO : row.getComAmount();
 | 
	
		
			
				|  |  | -                row.setActualAmount(comAmount);
 | 
	
		
			
				|  |  | -            } else if (queryInfo.getOrderType().equals("2")) {
 | 
	
		
			
				|  |  | -                BigDecimal perAmount = row.getPerAmount() == null ? BigDecimal.ZERO : row.getPerAmount();
 | 
	
		
			
				|  |  | -                row.setActualAmount(perAmount);
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  |              if (row.getActualAmount() == null) {
 | 
	
		
			
				|  |  |                  row.setActualAmount(BigDecimal.ZERO);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              if (row.getBalancePaymentAmount() == null) {
 | 
	
		
			
				|  |  |                  row.setBalancePaymentAmount(BigDecimal.ZERO);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            BigDecimal transferFee = (row.getActualAmount().multiply(new BigDecimal("0.28")).divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_HALF_UP);
 | 
	
		
			
				|  |  | +            if (row.getMemo() == null) {
 | 
	
		
			
				|  |  | +                row.setMemo("");
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            BigDecimal transferFee = BigDecimal.ZERO;
 | 
	
		
			
				|  |  | +            if(row.getPaymentChannel() != null && row.getPaymentChannel().equals("ADAPAY")){
 | 
	
		
			
				|  |  | +                FeeFlagNumDto countFeeFlagNum = studentPaymentRouteOrderDao.getCountFeeFlagNum(row.getOrderNo());
 | 
	
		
			
				|  |  | +                if(countFeeFlagNum.getTotalNum() > countFeeFlagNum.getYesNum()){
 | 
	
		
			
				|  |  | +                    transferFee = row.getActualAmount().multiply(new BigDecimal("0.28")).divide(new BigDecimal(100),2,BigDecimal.ROUND_HALF_UP);
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                if(countFeeFlagNum.getTotalNum().equals(countFeeFlagNum.getYesNum())){
 | 
	
		
			
				|  |  | +                    List<StudentPaymentRouteOrder> routeOrders = studentPaymentRouteOrderDao.getRouteOrders(row.getOrderNo());
 | 
	
		
			
				|  |  | +                    for (StudentPaymentRouteOrder routeOrder : routeOrders) {
 | 
	
		
			
				|  |  | +                        transferFee = transferFee.add(routeOrder.getRouteAmount().multiply(new BigDecimal("0.28")).divide(new BigDecimal(100),2,BigDecimal.ROUND_HALF_UP));
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  |              row.setTransferFee(transferFee);
 | 
	
		
			
				|  |  | -            BigDecimal musicalFee = BigDecimal.ZERO;
 | 
	
		
			
				|  |  | -            BigDecimal teachingFee = BigDecimal.ZERO;
 | 
	
		
			
				|  |  | -            BigDecimal courseFee = BigDecimal.ZERO;
 | 
	
		
			
				|  |  | -            BigDecimal leaseFee = BigDecimal.ZERO;
 | 
	
		
			
				|  |  | -            BigDecimal highOnlineCourseFee = 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:
 | 
	
		
			
				|  |  | +                            row.setMusicGroupCourseFee(row.getMusicGroupCourseFee().add(orderDetail.getPrice()));
 | 
	
		
			
				|  |  | +                            break;
 | 
	
		
			
				|  |  | +                        case HIGH:
 | 
	
		
			
				|  |  | +                        case HIGH_ONLINE:
 | 
	
		
			
				|  |  | +                        case HIGH_ONLINE_COURSE:
 | 
	
		
			
				|  |  | +                            row.setHighCourseFee(row.getHighCourseFee().add(orderDetail.getPrice()));
 | 
	
		
			
				|  |  | +                        case MUSICAL:
 | 
	
		
			
				|  |  | +                            if (orderDetail.getKitGroupPurchaseType() != null && orderDetail.getKitGroupPurchaseType().equals(KitGroupPurchaseTypeEnum.LEASE)) {
 | 
	
		
			
				|  |  | +                                row.setLeaseFee(orderDetail.getPrice());
 | 
	
		
			
				|  |  | +                            } else {
 | 
	
		
			
				|  |  | +                                row.setMusicalFee(orderDetail.getPrice());
 | 
	
		
			
				|  |  | +                            }
 | 
	
		
			
				|  |  | +                            break;
 | 
	
		
			
				|  |  | +                        case ACCESSORIES:
 | 
	
		
			
				|  |  | +                        case TEACHING:
 | 
	
		
			
				|  |  | +                            row.setTeachingFee(row.getTeachingFee().add(orderDetail.getPrice()));
 | 
	
		
			
				|  |  | +                            break;
 | 
	
		
			
				|  |  | +                        case OTHER:
 | 
	
		
			
				|  |  | +                            row.setOtherFee(row.getOtherFee().add(orderDetail.getPrice()));
 | 
	
		
			
				|  |  | +                        default:
 | 
	
		
			
				|  |  | +                            break;
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              if (row.getGoodsList() != null) {
 | 
	
		
			
				|  |  |                  goodsName = row.getGoodsList().stream().map(Goods::getName).collect(Collectors.joining("|"));
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            row.setCourseFee(courseFee);
 | 
	
		
			
				|  |  | -            row.setMusicalFee(musicalFee);
 | 
	
		
			
				|  |  | -            row.setTeachingFee(teachingFee);
 | 
	
		
			
				|  |  | -            row.setLeaseFee(leaseFee);
 | 
	
		
			
				|  |  | -            row.setMemo(goodsName);
 | 
	
		
			
				|  |  | -            row.setHighOnlineCourseFee(highOnlineCourseFee);
 | 
	
		
			
				|  |  | +            if (StringUtils.isNotBlank(goodsName)) {
 | 
	
		
			
				|  |  | +                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);
 | 
	
		
			
				|  |  | -                row.setTeachingFee(BigDecimal.ZERO);
 | 
	
		
			
				|  |  | +                //考级报名
 | 
	
		
			
				|  |  | +                if (row.getType().equals(OrderTypeEnum.DEGREE_REGISTRATION)) {
 | 
	
		
			
				|  |  | +                    String[] feeTypes = row.getMemo().split(";");
 | 
	
		
			
				|  |  | +                    List<String> feeTypeList = Arrays.asList(feeTypes);
 | 
	
		
			
				|  |  | +                    for (String feeTypeStr : feeTypeList) {
 | 
	
		
			
				|  |  | +                        int index = feeTypeStr.lastIndexOf(":");
 | 
	
		
			
				|  |  | +                        if (index < 0) {
 | 
	
		
			
				|  |  | +                            continue;
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +                        BigDecimal typeFee = new BigDecimal(feeTypeStr.substring(index + 1));
 | 
	
		
			
				|  |  | +                        if (feeTypeStr.contains("VIP")) {
 | 
	
		
			
				|  |  | +                            row.setVipCourseFee(typeFee);
 | 
	
		
			
				|  |  | +                        } else if (feeTypeStr.contains("网管课")) {
 | 
	
		
			
				|  |  | +                            row.setPracticeCourseFee(typeFee);
 | 
	
		
			
				|  |  | +                        } else if (feeTypeStr.contains("乐理课")) {
 | 
	
		
			
				|  |  | +                            row.setTheoryCourseFee(typeFee);
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +                    row.setDegreeFee(row.getExpectAmount().subtract(row.getVipCourseFee()).subtract(row.getPracticeCourseFee()).subtract(row.getTheoryCourseFee()));
 | 
	
		
			
				|  |  | +                } else {
 | 
	
		
			
				|  |  | +                    row.setOtherFee(row.getExpectAmount());
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  |                  if (row.getChargeType() != null) {
 | 
	
		
			
				|  |  |                      for (SporadicChargeTypeEnum chargeType : SporadicChargeTypeEnum.values()) {
 | 
	
		
			
				|  |  |                          if (!chargeType.getCode().equals(row.getChargeType())) continue;
 | 
	
	
		
			
				|  | @@ -1127,7 +1126,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());
 | 
	
	
		
			
				|  | @@ -1138,8 +1137,13 @@ public class ExportController extends BaseController {
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              } else {
 | 
	
		
			
				|  |  |                  StudentPaymentOrderExportDto feeByType = sellOrderDao.getFeeByType(row.getId());
 | 
	
		
			
				|  |  | +//                if(feeByType.getMusicalFee().add(feeByType.getTeachingFee()).add(feeByType.getRepairFee()).add(feeByType.getOtherFee()).compareTo(BigDecimal.ZERO) <=0){
 | 
	
		
			
				|  |  | +//                    break;
 | 
	
		
			
				|  |  | +//                }
 | 
	
		
			
				|  |  |                  row.setMusicalFee(feeByType.getMusicalFee());
 | 
	
		
			
				|  |  |                  row.setTeachingFee(feeByType.getTeachingFee());
 | 
	
		
			
				|  |  | +                row.setRepairFee(feeByType.getRepairFee());
 | 
	
		
			
				|  |  | +                row.setOtherFee(feeByType.getOtherFee());
 | 
	
		
			
				|  |  |                  if (row.getGroupType().equals(GroupType.MUSIC)) {
 | 
	
		
			
				|  |  |                      StudentRegistration studentRegistration = studentRegistrationDao.findStudentByMusicGroupIdAndUserId(row.getMusicGroupId(), row.getUserId());
 | 
	
		
			
				|  |  |                      if (studentRegistration != null) {
 | 
	
	
		
			
				|  | @@ -1147,19 +1151,20 @@ public class ExportController extends BaseController {
 | 
	
		
			
				|  |  |                          row.setSchoolName(studentRegistration.getSchoolName());
 | 
	
		
			
				|  |  |                          row.setCooperationOrganName(studentRegistration.getRemark());
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  | -                    if (row.getCourseFee().compareTo(BigDecimal.ZERO) == 0) {
 | 
	
		
			
				|  |  | -                        row.setCourseFee(feeByType.getExpectAmount().subtract(feeByType.getMusicalFee()).subtract(feeByType.getTeachingFee()));
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | +                    row.setMusicGroupCourseFee(feeByType.getExpectAmount().subtract(feeByType.getMusicalFee()).subtract(feeByType.getTeachingFee()).subtract(feeByType.getRepairFee()).subtract(feeByType.getOtherFee()).subtract(row.getHighCourseFee()));
 | 
	
		
			
				|  |  |                  } else if (row.getType().equals(OrderTypeEnum.REPAIR)) {
 | 
	
		
			
				|  |  | -                    row.setRepairFee(feeByType.getExpectAmount().subtract(feeByType.getMusicalFee()).subtract(feeByType.getTeachingFee()));
 | 
	
		
			
				|  |  | +                    row.setRepairFee(feeByType.getExpectAmount().subtract(feeByType.getMusicalFee()).subtract(feeByType.getTeachingFee()).subtract(feeByType.getOtherFee()));
 | 
	
		
			
				|  |  |                  } 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()).subtract(feeByType.getRepairFee()).subtract(feeByType.getOtherFee()));
 | 
	
		
			
				|  |  |                      row.setTransferFee(BigDecimal.ZERO);
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | +            if(row.getMusicGroupId()==null){
 | 
	
		
			
				|  |  | +                row.setMusicGroupId("");
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  |              String paymentChannel = "";
 | 
	
		
			
				|  |  | -            if (row.getPaymentChannel() == null) {
 | 
	
		
			
				|  |  | -            } else if (row.getPaymentChannel().equals("YQPAY")) {
 | 
	
		
			
				|  |  | +            if(row.getPaymentChannel() == null) {
 | 
	
		
			
				|  |  | +            }else if (row.getPaymentChannel().equals("YQPAY")) {
 | 
	
		
			
				|  |  |                  paymentChannel = "双乾";
 | 
	
		
			
				|  |  |              } else if (row.getPaymentChannel().equals("ADAPAY")) {
 | 
	
		
			
				|  |  |                  paymentChannel = "汇付";
 | 
	
	
		
			
				|  | @@ -1172,10 +1177,10 @@ public class ExportController extends BaseController {
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          try {
 | 
	
		
			
				|  |  | -            String[] header = {"序号", "学生姓名", "交易流水号", "订单编号", "收款渠道", "收款账户", "应付金额", "现金支付", "余额支付", "创建时间", "到账时间",
 | 
	
		
			
				|  |  | -                    "关联乐团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"};
 | 
	
		
			
				|  |  | +            String[] header = {"序号", "学生姓名", "交易流水号", "订单编号", "收款渠道", "收款账户", "应付金额", "现金支付", "余额支付", "乐团课", "网络基础训练", "VIP课", "网管课", "乐理课", "考级", "维修费用", "押金", "乐器", "教辅费用", "其它", "手续费", "到账时间",
 | 
	
		
			
				|  |  | +                    "关联乐团ID/VIP课ID", "课程形态", "零星收款类别", "专业", "分部", "教学点", "合作单位", "备注"};
 | 
	
		
			
				|  |  | +            String[] body = {"id", "user.username", "transNo", "orderNo", "paymentChannel", "merNos", "expectAmount", "actualAmount", "balancePaymentAmount", "musicGroupCourseFee", "highCourseFee", "vipCourseFee", "practiceCourseFee", "theoryCourseFee", "degreeFee", "repairFee", "leaseFee", "musicalFee", "teachingFee", "otherFee", "transferFee", "payTime", "musicGroupId",
 | 
	
		
			
				|  |  | +                    "groupType.desc", "sporadicType", "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");
 | 
	
	
		
			
				|  | @@ -1677,9 +1682,9 @@ public class ExportController extends BaseController {
 | 
	
		
			
				|  |  |                      row.setSignOutStatusStr(signOutTimeStr + "(异常签退)");
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            if(row.getBelongDaya()==1){
 | 
	
		
			
				|  |  | +            if (row.getBelongDaya() == 1) {
 | 
	
		
			
				|  |  |                  row.setSalaryType("基本课酬");
 | 
	
		
			
				|  |  | -            }else{
 | 
	
		
			
				|  |  | +            } else {
 | 
	
		
			
				|  |  |                  row.setSalaryType("其它课酬");
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
	
		
			
				|  | @@ -2147,66 +2152,104 @@ public class ExportController extends BaseController {
 | 
	
		
			
				|  |  |          OutputStream outputStream = response.getOutputStream();
 | 
	
		
			
				|  |  |          long i = 1;
 | 
	
		
			
				|  |  |          for (StudentPaymentOrderExportDto row : studentPaymentOrderExportDtos) {
 | 
	
		
			
				|  |  | -            if (queryInfo.getOrderType().equals("1")) {
 | 
	
		
			
				|  |  | -                BigDecimal comAmount = row.getComAmount() == null ? BigDecimal.ZERO : row.getComAmount();
 | 
	
		
			
				|  |  | -                row.setActualAmount(comAmount);
 | 
	
		
			
				|  |  | -            } else if (queryInfo.getOrderType().equals("2")) {
 | 
	
		
			
				|  |  | -                BigDecimal perAmount = row.getPerAmount() == null ? BigDecimal.ZERO : row.getPerAmount();
 | 
	
		
			
				|  |  | -                row.setActualAmount(perAmount);
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  |              if (row.getActualAmount() == null) {
 | 
	
		
			
				|  |  |                  row.setActualAmount(BigDecimal.ZERO);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              if (row.getBalancePaymentAmount() == null) {
 | 
	
		
			
				|  |  |                  row.setBalancePaymentAmount(BigDecimal.ZERO);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            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);
 | 
	
		
			
				|  |  | +            if (row.getRouteAmount() == null) {
 | 
	
		
			
				|  |  | +                row.setRouteAmount(BigDecimal.ZERO);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            if (row.getMemo() == null) {
 | 
	
		
			
				|  |  | +                row.setMemo("");
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            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);
 | 
	
		
			
				|  |  | -            BigDecimal musicalFee = BigDecimal.ZERO;
 | 
	
		
			
				|  |  | -            BigDecimal teachingFee = BigDecimal.ZERO;
 | 
	
		
			
				|  |  | -            BigDecimal courseFee = BigDecimal.ZERO;
 | 
	
		
			
				|  |  | -            BigDecimal leaseFee = 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:
 | 
	
		
			
				|  |  | +                            row.setMusicGroupCourseFee(row.getMusicGroupCourseFee().add(orderDetail.getPrice()));
 | 
	
		
			
				|  |  | +                            break;
 | 
	
		
			
				|  |  | +                        case HIGH:
 | 
	
		
			
				|  |  | +                        case HIGH_ONLINE:
 | 
	
		
			
				|  |  | +                        case HIGH_ONLINE_COURSE:
 | 
	
		
			
				|  |  | +                            row.setHighCourseFee(row.getHighCourseFee().add(orderDetail.getPrice()));
 | 
	
		
			
				|  |  | +                        case MUSICAL:
 | 
	
		
			
				|  |  | +                            if (orderDetail.getKitGroupPurchaseType() != null && orderDetail.getKitGroupPurchaseType().equals(KitGroupPurchaseTypeEnum.LEASE)) {
 | 
	
		
			
				|  |  | +                                row.setLeaseFee(orderDetail.getPrice());
 | 
	
		
			
				|  |  | +                            } else {
 | 
	
		
			
				|  |  | +                                row.setMusicalFee(orderDetail.getPrice());
 | 
	
		
			
				|  |  | +                            }
 | 
	
		
			
				|  |  | +                            break;
 | 
	
		
			
				|  |  | +                        case ACCESSORIES:
 | 
	
		
			
				|  |  | +                        case TEACHING:
 | 
	
		
			
				|  |  | +                            row.setTeachingFee(row.getTeachingFee().add(orderDetail.getPrice()));
 | 
	
		
			
				|  |  | +                            break;
 | 
	
		
			
				|  |  | +                        case OTHER:
 | 
	
		
			
				|  |  | +                            row.setOtherFee(row.getOtherFee().add(orderDetail.getPrice()));
 | 
	
		
			
				|  |  | +                        default:
 | 
	
		
			
				|  |  | +                            break;
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              if (row.getGoodsList() != null) {
 | 
	
		
			
				|  |  |                  goodsName = row.getGoodsList().stream().map(Goods::getName).collect(Collectors.joining("|"));
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            row.setCourseFee(courseFee);
 | 
	
		
			
				|  |  | -            row.setMusicalFee(musicalFee);
 | 
	
		
			
				|  |  | -            row.setTeachingFee(teachingFee);
 | 
	
		
			
				|  |  | -            row.setLeaseFee(leaseFee);
 | 
	
		
			
				|  |  | -            row.setMemo(goodsName);
 | 
	
		
			
				|  |  | +            if (StringUtils.isNotBlank(goodsName)) {
 | 
	
		
			
				|  |  | +                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);
 | 
	
		
			
				|  |  | -                row.setTeachingFee(BigDecimal.ZERO);
 | 
	
		
			
				|  |  | +                //考级报名
 | 
	
		
			
				|  |  | +                if (row.getType().equals(OrderTypeEnum.DEGREE_REGISTRATION)) {
 | 
	
		
			
				|  |  | +                    String[] feeTypes = row.getMemo().split(";");
 | 
	
		
			
				|  |  | +                    List<String> feeTypeList = Arrays.asList(feeTypes);
 | 
	
		
			
				|  |  | +                    for (String feeTypeStr : feeTypeList) {
 | 
	
		
			
				|  |  | +                        int index = feeTypeStr.lastIndexOf(":");
 | 
	
		
			
				|  |  | +                        if (index < 0) {
 | 
	
		
			
				|  |  | +                            continue;
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +                        BigDecimal typeFee = new BigDecimal(feeTypeStr.substring(index + 1));
 | 
	
		
			
				|  |  | +                        if (feeTypeStr.contains("VIP")) {
 | 
	
		
			
				|  |  | +                            row.setVipCourseFee(typeFee);
 | 
	
		
			
				|  |  | +                        } else if (feeTypeStr.contains("网管课")) {
 | 
	
		
			
				|  |  | +                            row.setPracticeCourseFee(typeFee);
 | 
	
		
			
				|  |  | +                        } else if (feeTypeStr.contains("乐理课")) {
 | 
	
		
			
				|  |  | +                            row.setTheoryCourseFee(typeFee);
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +                    row.setDegreeFee(row.getExpectAmount().subtract(row.getVipCourseFee()).subtract(row.getPracticeCourseFee()).subtract(row.getTheoryCourseFee()));
 | 
	
		
			
				|  |  | +                } else {
 | 
	
		
			
				|  |  | +                    row.setOtherFee(row.getExpectAmount());
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  |                  if (row.getChargeType() != null) {
 | 
	
		
			
				|  |  |                      for (SporadicChargeTypeEnum chargeType : SporadicChargeTypeEnum.values()) {
 | 
	
		
			
				|  |  |                          if (!chargeType.getCode().equals(row.getChargeType())) continue;
 | 
	
	
		
			
				|  | @@ -2218,7 +2261,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());
 | 
	
	
		
			
				|  | @@ -2227,10 +2270,12 @@ public class ExportController extends BaseController {
 | 
	
		
			
				|  |  |                  if (practiceGroup != null) {
 | 
	
		
			
				|  |  |                      row.setSubjectName(practiceGroup.getSubjectName());
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  | -            }else {
 | 
	
		
			
				|  |  | +            } else {
 | 
	
		
			
				|  |  |                  StudentPaymentOrderExportDto feeByType = sellOrderDao.getFeeByType(row.getId());
 | 
	
		
			
				|  |  |                  row.setMusicalFee(feeByType.getMusicalFee());
 | 
	
		
			
				|  |  |                  row.setTeachingFee(feeByType.getTeachingFee());
 | 
	
		
			
				|  |  | +                row.setRepairFee(feeByType.getRepairFee());
 | 
	
		
			
				|  |  | +                row.setOtherFee(feeByType.getOtherFee());
 | 
	
		
			
				|  |  |                  if (row.getGroupType().equals(GroupType.MUSIC)) {
 | 
	
		
			
				|  |  |                      StudentRegistration studentRegistration = studentRegistrationDao.findStudentByMusicGroupIdAndUserId(row.getMusicGroupId(), row.getUserId());
 | 
	
		
			
				|  |  |                      if (studentRegistration != null) {
 | 
	
	
		
			
				|  | @@ -2238,19 +2283,20 @@ public class ExportController extends BaseController {
 | 
	
		
			
				|  |  |                          row.setSchoolName(studentRegistration.getSchoolName());
 | 
	
		
			
				|  |  |                          row.setCooperationOrganName(studentRegistration.getRemark());
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  | -                    if (row.getCourseFee().compareTo(BigDecimal.ZERO) == 0) {
 | 
	
		
			
				|  |  | -                        row.setCourseFee(feeByType.getExpectAmount().subtract(feeByType.getMusicalFee()).subtract(feeByType.getTeachingFee()));
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | +                    row.setMusicGroupCourseFee(feeByType.getExpectAmount().subtract(feeByType.getMusicalFee()).subtract(feeByType.getTeachingFee()).subtract(feeByType.getRepairFee()).subtract(feeByType.getOtherFee()).subtract(row.getHighCourseFee()));
 | 
	
		
			
				|  |  |                  } else if (row.getType().equals(OrderTypeEnum.REPAIR)) {
 | 
	
		
			
				|  |  | -                    row.setRepairFee(feeByType.getExpectAmount().subtract(feeByType.getMusicalFee()).subtract(feeByType.getTeachingFee()));
 | 
	
		
			
				|  |  | +                    row.setRepairFee(feeByType.getExpectAmount().subtract(feeByType.getMusicalFee()).subtract(feeByType.getTeachingFee()).subtract(feeByType.getOtherFee()));
 | 
	
		
			
				|  |  |                  } 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()).subtract(feeByType.getRepairFee()).subtract(feeByType.getOtherFee()));
 | 
	
		
			
				|  |  |                      row.setTransferFee(BigDecimal.ZERO);
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | +            if(row.getMusicGroupId()==null){
 | 
	
		
			
				|  |  | +                row.setMusicGroupId("");
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  |              String paymentChannel = "";
 | 
	
		
			
				|  |  | -            if (row.getPaymentChannel() == null) {
 | 
	
		
			
				|  |  | -            } else if (row.getPaymentChannel().equals("YQPAY")) {
 | 
	
		
			
				|  |  | +            if(row.getPaymentChannel() == null) {
 | 
	
		
			
				|  |  | +            }else if (row.getPaymentChannel().equals("YQPAY")) {
 | 
	
		
			
				|  |  |                  paymentChannel = "双乾";
 | 
	
		
			
				|  |  |              } else if (row.getPaymentChannel().equals("ADAPAY")) {
 | 
	
		
			
				|  |  |                  paymentChannel = "汇付";
 | 
	
	
		
			
				|  | @@ -2263,10 +2309,10 @@ public class ExportController extends BaseController {
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          try {
 | 
	
		
			
				|  |  | -            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"};
 | 
	
		
			
				|  |  | +            String[] header = {"序号", "学生姓名", "交易流水号", "订单编号", "收款渠道", "收款账户", "应付金额", "现金支付", "余额支付", "分润账户", "分润金额", "分润余额", "乐团课", "网络基础训练", "VIP课", "网管课", "乐理课", "考级", "维修费用", "押金", "乐器", "教辅费用", "其它", "手续费", "到账时间",
 | 
	
		
			
				|  |  | +                    "关联乐团ID/VIP课ID", "课程形态", "零星收款类别", "专业", "分部", "教学点", "合作单位", "备注"};
 | 
	
		
			
				|  |  | +            String[] body = {"id", "user.username", "transNo", "orderNo", "paymentChannel", "merNos", "expectAmount", "actualAmount", "balancePaymentAmount", "routeMerNo", "routeAmount", "routeBalance", "musicGroupCourseFee", "highCourseFee", "vipCourseFee", "practiceCourseFee", "theoryCourseFee", "degreeFee", "repairFee", "leaseFee", "musicalFee", "teachingFee", "otherFee", "transferFee", "payTime", "musicGroupId",
 | 
	
		
			
				|  |  | +                    "groupType.desc", "sporadicType", "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"); //    //收款账户
 | 
	
	
		
			
				|  | @@ -2314,12 +2360,12 @@ public class ExportController extends BaseController {
 | 
	
		
			
				|  |  |                      "基础技能课2.0(助教)", "课堂课(助教)", "单技课3.0(助教)", "合奏课3.0(助教)", "综合课3.0(助教)", "集训单技课3.0(助教)", "集训合奏课3.0(助教)",
 | 
	
		
			
				|  |  |                      "基础技能课3.0(助教)", "网络基础训练课1v3", "网络基础训练课1v4", "网络基础训练课1v5", "乐团网管课1v1"};
 | 
	
		
			
				|  |  |              String[] body = {"userId", "realName", "organName", "jobNature", "demissionStatus", "status", "vip1", "vip2", "vip3", "vip4", "vip5", "vip6", "vip7",
 | 
	
		
			
				|  |  | -                    "practiceSalary","mainSingleSalary2", "mainMixSalary2", "mainComprehensiveSalary2", "mainTraningSigleSalary2", "mainTraningMixSalary2",
 | 
	
		
			
				|  |  | -                    "mainHighSalary2","mainClassroomSalary2", "mainSingleSalary", "mainMixSalary", "mainComprehensiveSalary", "mainTraningSigleSalary", "mainTraningMixSalary",
 | 
	
		
			
				|  |  | +                    "practiceSalary", "mainSingleSalary2", "mainMixSalary2", "mainComprehensiveSalary2", "mainTraningSigleSalary2", "mainTraningMixSalary2",
 | 
	
		
			
				|  |  | +                    "mainHighSalary2", "mainClassroomSalary2", "mainSingleSalary", "mainMixSalary", "mainComprehensiveSalary", "mainTraningSigleSalary", "mainTraningMixSalary",
 | 
	
		
			
				|  |  |                      "mainHighSalary",
 | 
	
		
			
				|  |  |                      "assistantSingleSalary2", "assistantMixSalary2", "assistantComprehensiveSalary2", "assistantTraningSigleSalary2", "assistantTraningMixSalary2",
 | 
	
		
			
				|  |  | -                    "assistantHighSalary2","assistantClassroomSalary2", "assistantSingleSalary", "assistantMixSalary", "assistantComprehensiveSalary", "assistantTraningSigleSalary", "assistantTraningMixSalary",
 | 
	
		
			
				|  |  | -                    "assistantHighSalary","highOnline3Salary", "highOnline4Salary", "highOnline5Salary", "musicNetwork1Salary"};
 | 
	
		
			
				|  |  | +                    "assistantHighSalary2", "assistantClassroomSalary2", "assistantSingleSalary", "assistantMixSalary", "assistantComprehensiveSalary", "assistantTraningSigleSalary", "assistantTraningMixSalary",
 | 
	
		
			
				|  |  | +                    "assistantHighSalary", "highOnline3Salary", "highOnline4Salary", "highOnline5Salary", "musicNetwork1Salary"};
 | 
	
		
			
				|  |  |              HSSFWorkbook workbook = POIUtil.exportExcel(header, body, pageList);
 | 
	
		
			
				|  |  |              response.setContentType("application/octet-stream");
 | 
	
		
			
				|  |  |              response.setHeader("Content-Disposition", "attachment;filename=teacherDefaultSalary-" + DateUtil.getDate(new Date()) + ".xls");
 | 
	
	
		
			
				|  | @@ -2560,11 +2606,11 @@ public class ExportController extends BaseController {
 | 
	
		
			
				|  |  |          queryInfo.setRows(49999);
 | 
	
		
			
				|  |  |          List<SellOrder> rows = sellOrderService.queryPage(queryInfo).getRows();
 | 
	
		
			
				|  |  |          for (SellOrder row : rows) {
 | 
	
		
			
				|  |  | -            if(StringUtils.isNoneBlank(row.getPaymentChannel())){
 | 
	
		
			
				|  |  | +            if (StringUtils.isNoneBlank(row.getPaymentChannel())) {
 | 
	
		
			
				|  |  |                  row.setPaymentChannelStr(PaymentChannelEnum.valueOf(row.getPaymentChannel()).getDesc());
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            row.setAccountTypeStr(AccountType.INTERNAL.equals(row.getAccountType())?"对内":"对外");
 | 
	
		
			
				|  |  | -            switch (row.getReceiveStatus()){
 | 
	
		
			
				|  |  | +            row.setAccountTypeStr(AccountType.INTERNAL.equals(row.getAccountType()) ? "对内" : "对外");
 | 
	
		
			
				|  |  | +            switch (row.getReceiveStatus()) {
 | 
	
		
			
				|  |  |                  case "NO_RECEIVE":
 | 
	
		
			
				|  |  |                      row.setReceiveStatusStr("未确认");
 | 
	
		
			
				|  |  |                      break;
 | 
	
	
		
			
				|  | @@ -2579,8 +2625,8 @@ public class ExportController extends BaseController {
 | 
	
		
			
				|  |  |          OutputStream outputStream = response.getOutputStream();
 | 
	
		
			
				|  |  |          try {
 | 
	
		
			
				|  |  |              HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{
 | 
	
		
			
				|  |  | -                    "交易流水号", "订单号", "销售日期", "销售类型", "商品名称", "数量","应付金额(元)", "余额支付(元)",
 | 
	
		
			
				|  |  | -                    "现金支付(元)", "销售成本(元)", "学员姓名","交易方式", "收款账户", "账户类型", "扣减库存", "所属分部",
 | 
	
		
			
				|  |  | +                    "交易流水号", "订单号", "销售日期", "销售类型", "商品名称", "数量", "应付金额(元)", "余额支付(元)",
 | 
	
		
			
				|  |  | +                    "现金支付(元)", "销售成本(元)", "学员姓名", "交易方式", "收款账户", "账户类型", "扣减库存", "所属分部",
 | 
	
		
			
				|  |  |                      "所属学校", "教务老师", "确认收货", "状态"}, new String[]{
 | 
	
		
			
				|  |  |                      "transNo", "orderNo", "sellTime", "type.desc", "goodsName", "num", "expectAmount", "balanceAmount",
 | 
	
		
			
				|  |  |                      "actualAmount", "sellCost", "userName", "paymentChannelStr", "merNo", "accountTypeStr", "stockType.msg", "organName",
 |