|
|
@@ -111,6 +111,8 @@ public class ExportController extends BaseController {
|
|
|
private SellOrderService sellOrderService;
|
|
|
@Autowired
|
|
|
private CourseScheduleStudentPaymentDao courseScheduleStudentPaymentDao;
|
|
|
+ @Autowired
|
|
|
+ private SellOrderDao sellOrderDao;
|
|
|
|
|
|
@ApiOperation(value = "学员考勤记录导出")
|
|
|
@PostMapping("export/exportStudentAttendances")
|
|
|
@@ -139,7 +141,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);
|
|
|
@@ -990,14 +992,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) {
|
|
|
@@ -1029,6 +1024,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) {
|
|
|
@@ -1046,9 +1060,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");
|
|
|
@@ -1323,7 +1337,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);
|
|
|
@@ -1332,7 +1346,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));
|
|
|
}
|
|
|
|