|
@@ -12,6 +12,7 @@ import com.ym.mec.common.controller.BaseController;
|
|
|
import com.ym.mec.common.entity.HttpResponseResult;
|
|
|
import com.ym.mec.common.exception.BizException;
|
|
|
import com.ym.mec.common.page.PageInfo;
|
|
|
+import com.ym.mec.common.page.QueryInfo;
|
|
|
import com.ym.mec.util.collection.MapUtil;
|
|
|
import com.ym.mec.util.date.DateUtil;
|
|
|
import com.ym.mec.util.excel.POIUtil;
|
|
@@ -85,6 +86,8 @@ public class ExportController extends BaseController {
|
|
|
@Autowired
|
|
|
private TeacherAttendanceService teacherAttendanceService;
|
|
|
@Autowired
|
|
|
+ private StudentAttendanceService studentAttendanceService;
|
|
|
+ @Autowired
|
|
|
private TeacherCourseRewardService teacherCourseRewardService;
|
|
|
@Autowired
|
|
|
private DegreeRegistrationService degreeRegistrationService;
|
|
@@ -102,11 +105,66 @@ public class ExportController extends BaseController {
|
|
|
private TeacherService teacherService;
|
|
|
@Autowired
|
|
|
private MusicGroupBuildLogDao musicGroupBuildLogDao;
|
|
|
+ @Autowired
|
|
|
+ private CourseScheduleStudentPaymentDao courseScheduleStudentPaymentDao;
|
|
|
+ @Autowired
|
|
|
+ private SellOrderDao sellOrderDao;
|
|
|
+
|
|
|
+ @ApiOperation(value = "学员考勤记录导出")
|
|
|
+ @PostMapping("export/exportStudentAttendances")
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('export/exportStudentAttendances')")
|
|
|
+ public void exportStudentAttendances(HttpServletResponse response, ExportStudentAttendanceQueryInfo queryInfo) throws IOException {
|
|
|
+ queryInfo.setPage(1);
|
|
|
+ queryInfo.setRows(49999);
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if (sysUser == null) {
|
|
|
+ throw new BizException("用户信息获取失败");
|
|
|
+ }
|
|
|
+ if (!sysUser.getIsSuperAdmin()) {
|
|
|
+ Employee employee = employeeDao.get(sysUser.getId());
|
|
|
+ if (StringUtils.isEmpty(queryInfo.getOrganId())) {
|
|
|
+ queryInfo.setOrganId(employee.getOrganIdList());
|
|
|
+ } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
|
|
|
+ throw new BizException("用户所在分部异常");
|
|
|
+ } else {
|
|
|
+ List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
|
|
|
+ if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
|
|
|
+ throw new BizException("非法请求");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<ExportStudentAttendanceDto> rows = studentAttendanceService.exportStudentAttendancesQueryPage(queryInfo).getRows();
|
|
|
+ OutputStream outputStream = response.getOutputStream();
|
|
|
+ try {
|
|
|
+ HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"分部编号", "分部名称", "课程组类型", "课程组编号", "课程组名称", "学员姓名",
|
|
|
+ "学员编号", "课程编号", "课程名称", "上课日期", "上课开始时间", "上课结束时间",
|
|
|
+ "指导老师名称", "指导老师编号", "教务老师名称", "教务老师编号", "授课老师名称", "授课老师编号", "学员考勤状态"}, new String[]{
|
|
|
+ "organId", "organName", "groupType.desc", "groupId", "groupName", "username",
|
|
|
+ "userId", "courseScheduleId", "courseScheduleName", "classDate", "startClassTime", "endClassTime", "guideTeacherName", "guideTeacherId"
|
|
|
+ , "educationalTeacherName", "educationalTeacherId", "actualTeacherName", "actualTeacherId", "studentAttendanceStatus.msg"}, rows);
|
|
|
+ response.setContentType("application/octet-stream");
|
|
|
+ response.setHeader("Content-Disposition", "attachment;filename=studentAttendance-" + DateUtil.getDate(new Date()) + ".xls");
|
|
|
+ response.flushBuffer();
|
|
|
+ outputStream = response.getOutputStream();
|
|
|
+ workbook.write(outputStream);
|
|
|
+ outputStream.flush();
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ } finally {
|
|
|
+ if (outputStream != null) {
|
|
|
+ try {
|
|
|
+ outputStream.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
@ApiOperation(value = "乐团管理--修改--缴费设置--缴费记录导出")
|
|
|
@PostMapping("export/musicGroupPaymentCalenderDetail")
|
|
|
@PreAuthorize("@pcs.hasPermissions('export/musicGroupPaymentCalenderDetail')")
|
|
|
- public void exportTeacherAttendances(HttpServletResponse response, MusicCalenderDetailQueryInfo queryInfo) throws IOException {
|
|
|
+ public void exportMusicGroupPaymentCalenderDetail(HttpServletResponse response, MusicCalenderDetailQueryInfo queryInfo) throws IOException {
|
|
|
queryInfo.setPage(1);
|
|
|
queryInfo.setRows(49999);
|
|
|
List<MusicGroupPaymentCalenderDetail> rows = musicGroupPaymentCalenderDetailService.queryPage(queryInfo).getRows();
|
|
@@ -882,14 +940,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) {
|
|
@@ -921,6 +972,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) {
|
|
@@ -937,10 +1007,10 @@ public class ExportController extends BaseController {
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
- String[] header = {"序号", "学生姓名", "交易流水号", "订单编号", "收款渠道", "收款账户", "应付金额", "现金支付", "余额支付", "到账时间",
|
|
|
- "关联乐团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"};
|
|
|
+ String[] header = {"序号", "学生姓名", "交易流水号", "订单编号", "收款渠道", "应付金额", "现金支付", "余额支付", "到账时间",
|
|
|
+ "关联乐团ID/VIP课ID", "课程形态", "课程费用", "新生专享课程费用", "乐器减免费用", "课程减免费用", "押金", "乐器", "教辅费用", "维修费用", "零星收款费用", "零星收款类别", "手续费", "专业", "分部", "单位/学校", "合作机构", "备注"};
|
|
|
+ String[] body = {"id", "user.username", "transNo", "orderNo", "paymentChannel", "expectAmount", "actualAmount", "balancePaymentAmount", "payTime", "musicGroupId",
|
|
|
+ "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");
|
|
@@ -1213,11 +1283,21 @@ public class ExportController extends BaseController {
|
|
|
}
|
|
|
OutputStream outputStream = response.getOutputStream();
|
|
|
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)) {
|
|
|
+ studentLastCourseMap = MapUtil.convertMybatisMap(studentLastCourseSchedule);
|
|
|
+ }
|
|
|
List<CourseGroupExportDto> studentCourseInfos = courseScheduleDao.getStudentVipCourseInfo(studentIds);
|
|
|
List<CourseGroupExportDto> totalClassTimes = courseScheduleDao.getStudentCourseScheduleNum(studentIds, GroupType.VIP, null);
|
|
|
List<CourseGroupExportDto> noStartClassTimes = courseScheduleDao.getStudentCourseScheduleNum(studentIds, GroupType.VIP, CourseStatusEnum.NOT_START);
|
|
|
for (CourseGroupExportDto vipGroupExport : vipGroupExports) {
|
|
|
|
|
|
+ String lastClassDateStr = studentLastCourseMap.get(vipGroupExport.getStudentId());
|
|
|
+ if (StringUtils.isNotBlank(lastClassDateStr)) {
|
|
|
+ vipGroupExport.setLastClassDate(DateUtil.stringToDate(lastClassDateStr));
|
|
|
+ }
|
|
|
+
|
|
|
for (CourseGroupExportDto studentCourseInfo : studentCourseInfos) {
|
|
|
if (studentCourseInfo.getStudentId().equals(vipGroupExport.getStudentId())) {
|
|
|
vipGroupExport.setTeacherIds(studentCourseInfo.getTeacherIds());
|
|
@@ -1242,8 +1322,8 @@ public class ExportController extends BaseController {
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
- String[] header = {"分部", "学生编号", "学生姓名", "指导老师id", "指导老师", "教务老师id", "教务老师", "课程开始时间", "课程截止时间", "总课时", "剩余课时"};
|
|
|
- String[] body = {"organName", "studentId", "studentName", "teacherIds", "teacherName", "eduTeacherIds", "eduTeacherName", "classStartDate", "classEndDate", "totalClassTimes", "noStartClassTimes"};
|
|
|
+ String[] header = {"分部", "学生编号", "学生姓名", "指导老师id", "指导老师", "教务老师id", "教务老师", "课程开始时间", "课程截止时间", "上次课时间", "总课时", "剩余课时"};
|
|
|
+ String[] body = {"organName", "studentId", "studentName", "teacherIds", "teacherName", "eduTeacherIds", "eduTeacherName", "classStartDate", "classEndDate", "lastClassDate", "totalClassTimes", "noStartClassTimes"};
|
|
|
HSSFWorkbook workbook = POIUtil.exportExcel(header, body, vipGroupExports);
|
|
|
response.setContentType("application/octet-stream");
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
|
|
@@ -1940,14 +2020,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) {
|
|
@@ -1960,27 +2033,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());
|
|
@@ -1997,6 +2052,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) {
|
|
@@ -2014,9 +2088,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"); // //收款账户
|