|
@@ -68,15 +68,15 @@ public class ExportController extends BaseController {
|
|
|
@ApiOperation(value = "导出学员是否有课")
|
|
|
@PostMapping("export/studentHasCourse")
|
|
|
@PreAuthorize("@pcs.hasPermissions('export/studentHasCourse')")
|
|
|
- public void studentHasCourse(HttpServletResponse response){
|
|
|
+ public void studentHasCourse(HttpServletResponse response) {
|
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- if(sysUser == null){
|
|
|
+ if (sysUser == null) {
|
|
|
throw new BizException("获取用户信息失败");
|
|
|
}
|
|
|
- List<StudentHasCourseDto> hasCourseDtos = studentManageService.queryHasCourseStudent(sysUser.getOrganId());
|
|
|
+ List<StudentHasCourseDto> hasCourseDtos = studentManageService.queryHasCourseStudent(sysUser.getOrganId());
|
|
|
try {
|
|
|
- HSSFWorkbook workbook = POIUtil.exportExcel(new String[] {"学员编号", "姓名","分部","所在乐团","乐团所属声部","所在vip课"}, new String[] {
|
|
|
- "userId","userName","organName","musicGroupName","subjectName","vipGroupName"}, hasCourseDtos);
|
|
|
+ HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"学员编号", "姓名", "分部", "所在乐团", "乐团所属声部", "所在vip课"}, new String[]{
|
|
|
+ "userId", "userName", "organName", "musicGroupName", "subjectName", "vipGroupName"}, hasCourseDtos);
|
|
|
response.setContentType("application/octet-stream");
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
|
|
|
response.flushBuffer();
|
|
@@ -91,11 +91,11 @@ public class ExportController extends BaseController {
|
|
|
@ApiOperation(value = "导出乐器采购清单")
|
|
|
@PostMapping("order/musicalListExport")
|
|
|
@PreAuthorize("@pcs.hasPermissions('order/musicalListExport')")
|
|
|
- public void musicalListExport(HttpServletResponse response, String musicGroupId){
|
|
|
+ public void musicalListExport(HttpServletResponse response, String musicGroupId) {
|
|
|
List<Goods> musicalList = studentPaymentOrderDetailService.getMusicalList(musicGroupId);
|
|
|
try {
|
|
|
- HSSFWorkbook workbook = POIUtil.exportExcel(new String[] {"分部","乐团","商品类型", "商品名称", "型号", "数量"}, new String[] {
|
|
|
- "brief","memo","type.desc","name","specification","sellCount"}, musicalList);
|
|
|
+ HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"分部", "乐团", "商品类型", "商品名称", "型号", "数量"}, new String[]{
|
|
|
+ "brief", "memo", "type.desc", "name", "specification", "sellCount"}, musicalList);
|
|
|
response.setContentType("application/octet-stream");
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
|
|
|
response.flushBuffer();
|
|
@@ -109,11 +109,11 @@ public class ExportController extends BaseController {
|
|
|
@ApiOperation(value = "导出学员采购清单明细")
|
|
|
@PostMapping("order/musicalListDetailExport")
|
|
|
@PreAuthorize("@pcs.hasPermissions('order/musicalListDetailExport')")
|
|
|
- public void musicalListDetailExport(HttpServletResponse response, String musicGroupId){
|
|
|
+ public void musicalListDetailExport(HttpServletResponse response, String musicGroupId) {
|
|
|
List<musicalListDetailDto> musicalList = studentPaymentOrderDetailService.getMusicalListDetail(musicGroupId);
|
|
|
try {
|
|
|
- HSSFWorkbook workbook = POIUtil.exportExcel(new String[] {"分部", "乐团","学员编号","学员姓名","购买商品", "采购方式", "乐器金额", "教辅金额", "课程金额", "订单总价"}, new String[] {
|
|
|
- "organName","musicGroupName","userId","username","goodsNames","kitGroupPurchaseTypeEnum.msg","musicalAmount","accessoriesAmount","courseAmount","orderAmount"}, musicalList);
|
|
|
+ HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"分部", "乐团", "学员编号", "学员姓名", "购买商品", "采购方式", "乐器金额", "教辅金额", "课程金额", "订单总价"}, new String[]{
|
|
|
+ "organName", "musicGroupName", "userId", "username", "goodsNames", "kitGroupPurchaseTypeEnum.msg", "musicalAmount", "accessoriesAmount", "courseAmount", "orderAmount"}, musicalList);
|
|
|
response.setContentType("application/octet-stream");
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
|
|
|
response.flushBuffer();
|
|
@@ -130,8 +130,8 @@ public class ExportController extends BaseController {
|
|
|
public void queryStudentApplyDetailExport(StudentRegistrationQueryInfo queryInfo, HttpServletResponse response) {
|
|
|
List<StudentApplyDetailDto> studentApplyDetail = studentRegistrationService.queryStudentDetailPage(queryInfo).getRows();
|
|
|
try {
|
|
|
- HSSFWorkbook workbook = POIUtil.exportExcel(new String[] { "学生姓名","家长姓名", "年级", "班级", "性别", "服从调剂","报名专业", "实际专业","联系电话", "学员缴费状态", "乐器购买方式"}, new String[] {
|
|
|
- "studentName","parentsName", "currentGrade", "currentClass", "gender.description", "isAllowAdjust.msg", "subjectName", "actualSubjectName", "parentsPhone","paymentStatus.desc","kitGroupPurchaseTypeEnum.msg"}, studentApplyDetail);
|
|
|
+ HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"学生姓名", "家长姓名", "年级", "班级", "性别", "服从调剂", "报名专业", "实际专业", "联系电话", "学员缴费状态", "乐器购买方式"}, new String[]{
|
|
|
+ "studentName", "parentsName", "currentGrade", "currentClass", "gender.description", "isAllowAdjust.msg", "subjectName", "actualSubjectName", "parentsPhone", "paymentStatus.desc", "kitGroupPurchaseTypeEnum.msg"}, studentApplyDetail);
|
|
|
response.setContentType("application/octet-stream");
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
|
|
|
response.flushBuffer();
|
|
@@ -148,8 +148,8 @@ public class ExportController extends BaseController {
|
|
|
public void export(CourseScheduleTeacherSalaryQueryInfo queryInfo, HttpServletResponse response) {
|
|
|
List<TeacherSalaryDto> teacherSalaries = courseScheduleTeacherSalaryService.querySalaries(queryInfo).getRows();
|
|
|
try {
|
|
|
- HSSFWorkbook workbook = POIUtil.exportExcel(new String[] { "用户编号","用户名", "手机号", "课程类型", "实际薪水", "补助", "结算时间", "教师角色"}, new String[] {
|
|
|
- "userId","username", "phone", "type.msg", "name", "actualSalary", "subsidy", "settlementTime", "teacherRole.msg"}, teacherSalaries);
|
|
|
+ HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"用户编号", "用户名", "手机号", "课程类型", "实际薪水", "补助", "结算时间", "教师角色"}, new String[]{
|
|
|
+ "userId", "username", "phone", "type.msg", "name", "actualSalary", "subsidy", "settlementTime", "teacherRole.msg"}, teacherSalaries);
|
|
|
response.setContentType("application/octet-stream");
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
|
|
|
response.flushBuffer();
|
|
@@ -180,62 +180,77 @@ public class ExportController extends BaseController {
|
|
|
if (queryInfo.getOrderType().equals("1")) {
|
|
|
BigDecimal comAmount = row.getComAmount() == null ? BigDecimal.ZERO : row.getComAmount();
|
|
|
row.setActualAmount(comAmount);
|
|
|
- }else {
|
|
|
+ } 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);
|
|
|
+ }
|
|
|
BigDecimal transferFee = (row.getActualAmount().multiply(new BigDecimal(0.28)).divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
row.setTransferFee(transferFee);
|
|
|
List<StudentPaymentOrderDetail> orderDetails = studentPaymentOrderDetailDao.findApplyOrderGoods(row.getId());
|
|
|
BigDecimal musicalFee = BigDecimal.ZERO;
|
|
|
BigDecimal teachingFee = BigDecimal.ZERO;
|
|
|
- if(orderDetails.size() > 0) {
|
|
|
+ if (orderDetails.size() > 0) {
|
|
|
for (StudentPaymentOrderDetail orderDetail : orderDetails) {
|
|
|
if (orderDetail.getType().equals(OrderDetailTypeEnum.MUSICAL)) {
|
|
|
- musicalFee = musicalFee.add(orderDetail.getPrice());
|
|
|
+ musicalFee = musicalFee.add(orderDetail.getPrice());
|
|
|
} else if (orderDetail.getType().equals(OrderDetailTypeEnum.ACCESSORIES) || orderDetail.getType().equals(OrderDetailTypeEnum.TEACHING)) {
|
|
|
- teachingFee = teachingFee.add(orderDetail.getPrice());
|
|
|
+ teachingFee = teachingFee.add(orderDetail.getPrice());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
row.setMusicalFee(musicalFee);
|
|
|
row.setTeachingFee(teachingFee);
|
|
|
//专业
|
|
|
- if(row.getGroupType().equals(GroupType.MUSIC)) {
|
|
|
- StudentRegistration studentRegistration = studentRegistrationDao.findStudentByMusicGroupIdAndUserId(row.getMusicGroupId(),row.getUserId());
|
|
|
- row.setSubjectName(studentRegistration.getSubjectName());
|
|
|
- row.setOrganName(studentRegistration.getOrganName());
|
|
|
- row.setSchoolName(studentRegistration.getSchoolName());
|
|
|
- if(studentRegistration.getKitType()!= null && studentRegistration.getKitType().equals(KitPurchaseMethodEnum.LEASE)){
|
|
|
- row.setLeaseFee(musicalFee);
|
|
|
- row.setMusicalFee(BigDecimal.ZERO);
|
|
|
+ if (row.getGroupType().equals(GroupType.MUSIC)) {
|
|
|
+ StudentRegistration studentRegistration = studentRegistrationDao.findStudentByMusicGroupIdAndUserId(row.getMusicGroupId(), row.getUserId());
|
|
|
+ if (studentRegistration != null) {
|
|
|
+ row.setSubjectName(studentRegistration.getSubjectName());
|
|
|
+ row.setOrganName(studentRegistration.getOrganName());
|
|
|
+ row.setSchoolName(studentRegistration.getSchoolName());
|
|
|
+ if (studentRegistration.getKitType() != null && studentRegistration.getKitType().equals(KitPurchaseMethodEnum.LEASE)) {
|
|
|
+ row.setLeaseFee(musicalFee);
|
|
|
+ row.setMusicalFee(BigDecimal.ZERO);
|
|
|
+ }
|
|
|
}
|
|
|
- }else if (row.getGroupType().equals(GroupType.VIP)){
|
|
|
+ } else if (row.getGroupType().equals(GroupType.VIP)) {
|
|
|
VipGroup vipGroupInfo = vipGroupDao.findVipGroupInfo(Integer.parseInt(row.getMusicGroupId()), row.getClassGroupId());
|
|
|
- if(vipGroupInfo != null) {
|
|
|
+ if (vipGroupInfo != null) {
|
|
|
row.setOrganName(vipGroupInfo.getOrganName());
|
|
|
row.setSchoolName(vipGroupInfo.getSchoolName());
|
|
|
row.setSubjectName(vipGroupInfo.getSubjectName());
|
|
|
}
|
|
|
|
|
|
- }else if(row.getGroupType().equals(GroupType.SPORADIC)){
|
|
|
+ } else if (row.getGroupType().equals(GroupType.SPORADIC)) {
|
|
|
SporadicChargeInfo sporadicChargeInfo = sporadicChargeInfoDao.findInfoById(Integer.parseInt(row.getMusicGroupId()));
|
|
|
- row.setSporadicAmount(row.getActualAmount());
|
|
|
- row.setMusicalFee(BigDecimal.ZERO);
|
|
|
- row.setTeachingFee(BigDecimal.ZERO);
|
|
|
- row.setTeachingFee(BigDecimal.ZERO);
|
|
|
- if(sporadicChargeInfo.getChargeType().equals("1")){
|
|
|
- row.setSporadicType("考级");
|
|
|
- }else if(sporadicChargeInfo.getChargeType().equals("2")){
|
|
|
- row.setSporadicType("缴费");
|
|
|
- }else if(sporadicChargeInfo.getChargeType().equals("3")){
|
|
|
- row.setSporadicType("声部更改");
|
|
|
- }else if(sporadicChargeInfo.getChargeType().equals("4")){
|
|
|
- row.setSporadicType("乐器更换");
|
|
|
+ if(sporadicChargeInfo != null) {
|
|
|
+ row.setSporadicAmount(row.getActualAmount());
|
|
|
+ row.setMusicalFee(BigDecimal.ZERO);
|
|
|
+ row.setTeachingFee(BigDecimal.ZERO);
|
|
|
+ row.setTeachingFee(BigDecimal.ZERO);
|
|
|
+ if (sporadicChargeInfo.getChargeType().equals("1")) {
|
|
|
+ row.setSporadicType("考级");
|
|
|
+ } else if (sporadicChargeInfo.getChargeType().equals("2")) {
|
|
|
+ row.setSporadicType("缴费");
|
|
|
+ } else if (sporadicChargeInfo.getChargeType().equals("3")) {
|
|
|
+ row.setSporadicType("声部更改");
|
|
|
+ } else if (sporadicChargeInfo.getChargeType().equals("4")) {
|
|
|
+ row.setSporadicType("乐器更换");
|
|
|
+ }
|
|
|
+ row.setOrganName(sporadicChargeInfo.getOrganName());
|
|
|
}
|
|
|
- row.setOrganName(sporadicChargeInfo.getOrganName());
|
|
|
}
|
|
|
- String paymentChannel = row.getPaymentChannel().equals("YQPAY") ? "双乾" : "汇付";
|
|
|
+ String paymentChannel = "";
|
|
|
+ if (row.getPaymentChannel() == null) {
|
|
|
+ } else if (row.getPaymentChannel().equals("YQPAY")) {
|
|
|
+ paymentChannel = "双乾";
|
|
|
+ } else if (row.getPaymentChannel().equals("ADAPAY")) {
|
|
|
+ paymentChannel = "汇付";
|
|
|
+ } else if (row.getPaymentChannel().equals("BALANCE")) {
|
|
|
+ paymentChannel = "余额";
|
|
|
+ }
|
|
|
row.setPaymentChannel(paymentChannel);
|
|
|
row.setId(i);
|
|
|
i++;
|
|
@@ -243,9 +258,9 @@ public class ExportController extends BaseController {
|
|
|
|
|
|
try {
|
|
|
String[] header = {"序号", "学生姓名", "交易流水号", "订单编号", "收款渠道", "收款账户", "支付金额", "到账时间",
|
|
|
- "关联乐团ID/VIP课ID","课程形态","押金","乐器","教辅费用","零星收款费用","零星收款类别","手续费","专业","分部","单位/学校","备注"};
|
|
|
+ "关联乐团ID/VIP课ID", "课程形态", "押金", "乐器", "教辅费用", "零星收款费用", "零星收款类别", "手续费", "专业", "分部", "单位/学校", "备注"};
|
|
|
String[] body = {"id", "user.username", "transNo", "orderNo", "paymentChannel", "merNos", "actualAmount", "payTime", "musicGroupId",
|
|
|
- "groupType.desc","leaseFee","musicalFee","teachingFee","sporadicAmount","sporadicType","transferFee","subjectName","organName","schoolName","memo"};
|
|
|
+ "groupType.desc", "leaseFee", "musicalFee", "teachingFee", "sporadicAmount", "sporadicType", "transferFee", "subjectName", "organName", "schoolName", "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");
|