|
@@ -107,6 +107,8 @@ public class ExportController extends BaseController {
|
|
|
private MusicGroupBuildLogDao musicGroupBuildLogDao;
|
|
|
@Autowired
|
|
|
private CourseScheduleStudentPaymentDao courseScheduleStudentPaymentDao;
|
|
|
+ @Autowired
|
|
|
+ private SellOrderDao sellOrderDao;
|
|
|
|
|
|
@ApiOperation(value = "学员考勤记录导出")
|
|
|
@PostMapping("export/exportStudentAttendances")
|
|
@@ -135,7 +137,7 @@ public class ExportController extends BaseController {
|
|
|
OutputStream outputStream = response.getOutputStream();
|
|
|
try {
|
|
|
HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"分部编号", "分部名称", "课程组类型", "课程组编号", "课程组名称", "学员姓名",
|
|
|
- "学员编号", "课程编号", "课程名称", "上课日期", "上课开始时间","上课结束时间","指导老师名称","指导老师编号","教务老师名称","教务老师编号","学员考勤状态"}, new String[]{
|
|
|
+ "学员编号", "课程编号", "课程名称", "上课日期", "上课开始时间", "上课结束时间", "指导老师名称", "指导老师编号", "教务老师名称", "教务老师编号", "学员考勤状态"}, new String[]{
|
|
|
"organId", "organName", "groupType.desc", "groupId", "groupName", "username",
|
|
|
"userId", "courseScheduleId", "courseScheduleName", "classDate", "startClassTime", "endClassTime", "guideTeacherName", "guideTeacherId"
|
|
|
, "educationalTeacherName", "educationalTeacherId", "studentAttendanceStatus.msg"}, rows);
|
|
@@ -937,14 +939,7 @@ public class ExportController extends BaseController {
|
|
|
row.setMemo(goodsName);
|
|
|
row.setHighOnlineCourseFee(highOnlineCourseFee);
|
|
|
//专业
|
|
|
- if (row.getGroupType().equals(GroupType.MUSIC)) {
|
|
|
- StudentRegistration studentRegistration = studentRegistrationDao.findStudentByMusicGroupIdAndUserId(row.getMusicGroupId(), row.getUserId());
|
|
|
- if (studentRegistration != null) {
|
|
|
- row.setSubjectName(studentRegistration.getSubjectName());
|
|
|
- row.setSchoolName(studentRegistration.getSchoolName());
|
|
|
- row.setCooperationOrganName(studentRegistration.getRemark());
|
|
|
- }
|
|
|
- } else if (row.getGroupType().equals(GroupType.VIP)) {
|
|
|
+ if (row.getGroupType().equals(GroupType.VIP)) {
|
|
|
row.setCourseFee(row.getActualAmount());
|
|
|
VipGroup vipGroupInfo = vipGroupDao.findVipGroupInfo(Integer.parseInt(row.getMusicGroupId()), row.getClassGroupId());
|
|
|
if (vipGroupInfo != null) {
|
|
@@ -976,6 +971,25 @@ public class ExportController extends BaseController {
|
|
|
if (practiceGroup != null) {
|
|
|
row.setSubjectName(practiceGroup.getSubjectName());
|
|
|
}
|
|
|
+ } else {
|
|
|
+ StudentPaymentOrderExportDto feeByType = sellOrderDao.getFeeByType(row.getId());
|
|
|
+ row.setMusicalFee(feeByType.getMusicalFee());
|
|
|
+ row.setTeachingFee(feeByType.getTeachingFee());
|
|
|
+ if (row.getGroupType().equals(GroupType.MUSIC)) {
|
|
|
+ StudentRegistration studentRegistration = studentRegistrationDao.findStudentByMusicGroupIdAndUserId(row.getMusicGroupId(), row.getUserId());
|
|
|
+ if (studentRegistration != null) {
|
|
|
+ row.setSubjectName(studentRegistration.getSubjectName());
|
|
|
+ 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()));
|
|
|
+ }
|
|
|
+ } 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()));
|
|
|
+ }
|
|
|
}
|
|
|
String paymentChannel = "";
|
|
|
if (row.getPaymentChannel() == null) {
|
|
@@ -993,9 +1007,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", "payTime", "musicGroupId",
|
|
|
- "groupType.desc", "courseFee", "highOnlineCourseFee", "remitFee", "courseRemitFee", "leaseFee", "musicalFee", "teachingFee", "sporadicAmount", "sporadicType", "transferFee", "subjectName", "organName", "schoolName", "cooperationOrganName", "memo"};
|
|
|
+ "groupType.desc", "courseFee", "highOnlineCourseFee", "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");
|
|
@@ -1270,7 +1284,7 @@ public class ExportController extends BaseController {
|
|
|
Set<Integer> studentIds = vipGroupExports.stream().map(CourseGroupExportDto::getStudentId).collect(Collectors.toSet());
|
|
|
List<Map<Integer, Date>> studentLastCourseSchedule = courseScheduleStudentPaymentDao.findStudentLastCourseSchedule(new ArrayList<>(studentIds));
|
|
|
Map<Integer, String> studentLastCourseMap = new HashMap<>();
|
|
|
- if(!CollectionUtils.isEmpty(studentLastCourseSchedule)){
|
|
|
+ if (!CollectionUtils.isEmpty(studentLastCourseSchedule)) {
|
|
|
studentLastCourseMap = MapUtil.convertMybatisMap(studentLastCourseSchedule);
|
|
|
}
|
|
|
List<CourseGroupExportDto> studentCourseInfos = courseScheduleDao.getStudentVipCourseInfo(studentIds);
|
|
@@ -1279,7 +1293,7 @@ public class ExportController extends BaseController {
|
|
|
for (CourseGroupExportDto vipGroupExport : vipGroupExports) {
|
|
|
|
|
|
String lastClassDateStr = studentLastCourseMap.get(vipGroupExport.getStudentId());
|
|
|
- if(StringUtils.isNotBlank(lastClassDateStr)){
|
|
|
+ if (StringUtils.isNotBlank(lastClassDateStr)) {
|
|
|
vipGroupExport.setLastClassDate(DateUtil.stringToDate(lastClassDateStr));
|
|
|
}
|
|
|
|
|
@@ -2005,14 +2019,7 @@ public class ExportController extends BaseController {
|
|
|
row.setLeaseFee(leaseFee);
|
|
|
row.setMemo(goodsName);
|
|
|
//专业
|
|
|
- if (row.getGroupType().equals(GroupType.MUSIC)) {
|
|
|
- StudentRegistration studentRegistration = studentRegistrationDao.findStudentByMusicGroupIdAndUserId(row.getMusicGroupId(), row.getUserId());
|
|
|
- if (studentRegistration != null) {
|
|
|
- row.setSubjectName(studentRegistration.getSubjectName());
|
|
|
- row.setSchoolName(studentRegistration.getSchoolName());
|
|
|
- row.setCooperationOrganName(studentRegistration.getRemark());
|
|
|
- }
|
|
|
- } else if (row.getGroupType().equals(GroupType.VIP)) {
|
|
|
+ if (row.getGroupType().equals(GroupType.VIP)) {
|
|
|
row.setCourseFee(row.getActualAmount());
|
|
|
VipGroup vipGroupInfo = vipGroupDao.findVipGroupInfo(Integer.parseInt(row.getMusicGroupId()), row.getClassGroupId());
|
|
|
if (vipGroupInfo != null) {
|
|
@@ -2025,27 +2032,9 @@ public class ExportController extends BaseController {
|
|
|
row.setMusicalFee(BigDecimal.ZERO);
|
|
|
row.setTeachingFee(BigDecimal.ZERO);
|
|
|
if (row.getChargeType() != null) {
|
|
|
-
|
|
|
- if (row.getChargeType().equals(1)) {
|
|
|
- row.setSporadicType("考级");
|
|
|
- } else if (row.getChargeType().equals(2)) {
|
|
|
- row.setSporadicType("声部更改");
|
|
|
- } else if (row.getChargeType().equals(3)) {
|
|
|
- row.setSporadicType("乐器更换");
|
|
|
- } else if (row.getChargeType().equals(4)) {
|
|
|
- row.setSporadicType("配件销售");
|
|
|
- } else if (row.getChargeType().equals(5)) {
|
|
|
- row.setSporadicType("维修费");
|
|
|
- } else if (row.getChargeType().equals(6)) {
|
|
|
- row.setSporadicType("福袋活动");
|
|
|
- } else if (row.getChargeType().equals(7)) {
|
|
|
- row.setSporadicType("上门费");
|
|
|
- } else if (row.getChargeType().equals(9)) {
|
|
|
- row.setSporadicType("账户充值");
|
|
|
- } else if (row.getChargeType().equals(10)) {
|
|
|
- row.setSporadicType("乐保服务");
|
|
|
- } else if (row.getChargeType().equals(11)) {
|
|
|
- row.setSporadicType("其他");
|
|
|
+ for (SporadicChargeTypeEnum chargeType : SporadicChargeTypeEnum.values()) {
|
|
|
+ if (!chargeType.getCode().equals(row.getChargeType())) continue;
|
|
|
+ row.setSporadicType(chargeType.getMsg());
|
|
|
}
|
|
|
}
|
|
|
School userSchool = musicGroupDao.findUserSchool(row.getUserId());
|
|
@@ -2062,6 +2051,25 @@ public class ExportController extends BaseController {
|
|
|
if (practiceGroup != null) {
|
|
|
row.setSubjectName(practiceGroup.getSubjectName());
|
|
|
}
|
|
|
+ }else {
|
|
|
+ StudentPaymentOrderExportDto feeByType = sellOrderDao.getFeeByType(row.getId());
|
|
|
+ row.setMusicalFee(feeByType.getMusicalFee());
|
|
|
+ row.setTeachingFee(feeByType.getTeachingFee());
|
|
|
+ if (row.getGroupType().equals(GroupType.MUSIC)) {
|
|
|
+ StudentRegistration studentRegistration = studentRegistrationDao.findStudentByMusicGroupIdAndUserId(row.getMusicGroupId(), row.getUserId());
|
|
|
+ if (studentRegistration != null) {
|
|
|
+ row.setSubjectName(studentRegistration.getSubjectName());
|
|
|
+ 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()));
|
|
|
+ }
|
|
|
+ } 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()));
|
|
|
+ }
|
|
|
}
|
|
|
String paymentChannel = "";
|
|
|
if (row.getPaymentChannel() == null) {
|
|
@@ -2079,9 +2087,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", "routeMerNo", "routeAmount", "routeBalance", "payTime", "musicGroupId",
|
|
|
- "groupType.desc", "courseFee", "remitFee", "leaseFee", "musicalFee", "teachingFee", "sporadicAmount", "sporadicType", "transferFee", "subjectName", "organName", "schoolName", "cooperationOrganName", "memo"};
|
|
|
+ "groupType.desc", "courseFee", "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"); // //收款账户
|