|
@@ -2,10 +2,12 @@ package com.ym.mec.student.controller;
|
|
|
|
|
|
import com.ym.mec.biz.dal.dao.OrganizationDao;
|
|
import com.ym.mec.biz.dal.dao.OrganizationDao;
|
|
import com.ym.mec.biz.dal.dao.SysConfigDao;
|
|
import com.ym.mec.biz.dal.dao.SysConfigDao;
|
|
|
|
+import com.ym.mec.biz.dal.dao.TeacherCourseStatisticsDao;
|
|
import com.ym.mec.biz.dal.dto.LuckStatisDto;
|
|
import com.ym.mec.biz.dal.dto.LuckStatisDto;
|
|
import com.ym.mec.biz.dal.dto.OrderStatisDto;
|
|
import com.ym.mec.biz.dal.dto.OrderStatisDto;
|
|
import com.ym.mec.biz.dal.entity.*;
|
|
import com.ym.mec.biz.dal.entity.*;
|
|
import com.ym.mec.biz.service.*;
|
|
import com.ym.mec.biz.service.*;
|
|
|
|
+import com.ym.mec.util.date.DateUtil;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
@@ -76,6 +78,8 @@ public class StudentOrderController extends BaseController {
|
|
private SporadicChargeInfoService sporadicChargeInfoService;
|
|
private SporadicChargeInfoService sporadicChargeInfoService;
|
|
@Autowired
|
|
@Autowired
|
|
private OrganizationDao organizationDao;
|
|
private OrganizationDao organizationDao;
|
|
|
|
+ @Autowired
|
|
|
|
+ private TeacherCourseStatisticsDao teacherCourseStatisticsDao;
|
|
|
|
|
|
@PostMapping("/notify")
|
|
@PostMapping("/notify")
|
|
public Msg notify(@ModelAttribute Msg msg) throws Exception {
|
|
public Msg notify(@ModelAttribute Msg msg) throws Exception {
|
|
@@ -126,7 +130,7 @@ public class StudentOrderController extends BaseController {
|
|
List<Goods> goodsList = studentPaymentOrderDetailService.findApplyOrderGoods(orderByOrderNo.getId());
|
|
List<Goods> goodsList = studentPaymentOrderDetailService.findApplyOrderGoods(orderByOrderNo.getId());
|
|
orderDetail.put("goods", goodsList);
|
|
orderDetail.put("goods", goodsList);
|
|
orderDetail.put("course", musicGroup.getCourseForm());
|
|
orderDetail.put("course", musicGroup.getCourseForm());
|
|
- orderDetail.put("ownershipType",musicGroup.getOwnershipType());
|
|
|
|
|
|
+ orderDetail.put("ownershipType", musicGroup.getOwnershipType());
|
|
} else if (orderByOrderNo.getGroupType().equals(GroupType.VIP)) {
|
|
} else if (orderByOrderNo.getGroupType().equals(GroupType.VIP)) {
|
|
VipBuyResultDto vipBuyResultInfo = vipGroupService.findVipBuyResultInfo(Integer.valueOf(orderByOrderNo.getMusicGroupId()));
|
|
VipBuyResultDto vipBuyResultInfo = vipGroupService.findVipBuyResultInfo(Integer.valueOf(orderByOrderNo.getMusicGroupId()));
|
|
orderDetail.put("detail", vipBuyResultInfo);
|
|
orderDetail.put("detail", vipBuyResultInfo);
|
|
@@ -285,7 +289,7 @@ public class StudentOrderController extends BaseController {
|
|
|
|
|
|
|
|
|
|
@RequestMapping("paymentResult")
|
|
@RequestMapping("paymentResult")
|
|
- public void paymentResult(HttpServletResponse response,String orderNo) {
|
|
|
|
|
|
+ public void paymentResult(HttpServletResponse response, String orderNo) {
|
|
try {
|
|
try {
|
|
String baseApiUrl = sysConfigDao.findConfigValue("base_api_url");
|
|
String baseApiUrl = sysConfigDao.findConfigValue("base_api_url");
|
|
response.sendRedirect(baseApiUrl + "/#/paymentresult?orderNo=" + orderNo);
|
|
response.sendRedirect(baseApiUrl + "/#/paymentresult?orderNo=" + orderNo);
|
|
@@ -320,9 +324,9 @@ public class StudentOrderController extends BaseController {
|
|
BigDecimal totalMoney = BigDecimal.ZERO;
|
|
BigDecimal totalMoney = BigDecimal.ZERO;
|
|
Integer totalNum = 0;
|
|
Integer totalNum = 0;
|
|
Iterator<OrderStatisDto> iterator = orders.iterator();
|
|
Iterator<OrderStatisDto> iterator = orders.iterator();
|
|
- while (iterator.hasNext()){
|
|
|
|
|
|
+ while (iterator.hasNext()) {
|
|
OrderStatisDto order = iterator.next();
|
|
OrderStatisDto order = iterator.next();
|
|
- if (order.getOrganName().equals("总部国际") || order.getOrganName().equals("阳光总部国际") || order.getOrganName().equals("武汉小学")){
|
|
|
|
|
|
+ if (order.getOrganName().equals("总部国际") || order.getOrganName().equals("阳光总部国际") || order.getOrganName().equals("武汉小学")) {
|
|
iterator.remove();
|
|
iterator.remove();
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
@@ -369,22 +373,58 @@ public class StudentOrderController extends BaseController {
|
|
if (tempRoutingResultList.contains("武汉大雅乐盟教育咨询有限公司")) {
|
|
if (tempRoutingResultList.contains("武汉大雅乐盟教育咨询有限公司")) {
|
|
type = "com";
|
|
type = "com";
|
|
}
|
|
}
|
|
- fixUpdateOrder(orderNo,type);
|
|
|
|
|
|
+ fixUpdateOrder(orderNo, type);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- void fixUpdateOrder(String orderNo,String type) {
|
|
|
|
|
|
+ void fixUpdateOrder(String orderNo, String type) {
|
|
StudentPaymentOrder order = studentPaymentOrderService.findOrderByOrderNo(orderNo);
|
|
StudentPaymentOrder order = studentPaymentOrderService.findOrderByOrderNo(orderNo);
|
|
- if(type.equals("com")){
|
|
|
|
|
|
+ if (type.equals("com")) {
|
|
order.setComAmount(order.getActualAmount());
|
|
order.setComAmount(order.getActualAmount());
|
|
order.setPerAmount(BigDecimal.ZERO);
|
|
order.setPerAmount(BigDecimal.ZERO);
|
|
order.setMerNos("0023115");
|
|
order.setMerNos("0023115");
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
order.setComAmount(BigDecimal.ZERO);
|
|
order.setComAmount(BigDecimal.ZERO);
|
|
order.setPerAmount(order.getActualAmount());
|
|
order.setPerAmount(order.getActualAmount());
|
|
order.setMerNos("0031215");
|
|
order.setMerNos("0031215");
|
|
}
|
|
}
|
|
studentPaymentOrderService.update(order);
|
|
studentPaymentOrderService.update(order);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @GetMapping("/teacherCourseStatistic")
|
|
|
|
+ public HttpResponseResult teacherCourseStatistic() {
|
|
|
|
+ Date nowDate = new Date();
|
|
|
|
+ Date startDate = DateUtil.getFirstDayOfMonth(nowDate);
|
|
|
|
+ Date endDate = DateUtil.getLastDayOfMonth(nowDate);
|
|
|
|
+ BigDecimal salary = new BigDecimal("4000");
|
|
|
|
+ List<TeacherCourseStatistics> teacherCourseStatisticsList = teacherCourseStatisticsDao.findUserByWarringSalary(startDate, endDate, salary);
|
|
|
|
+ if(teacherCourseStatisticsList.size() ==0){
|
|
|
|
+ return failed("没有做");
|
|
|
|
+ }
|
|
|
|
+ List<Integer> userIds = teacherCourseStatisticsList.stream().map(TeacherCourseStatistics::getUserId).collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ List<TeacherCourseStatistics> teCourseSalaryStatisAndTypes = teacherCourseStatisticsDao.findUserCourseSalaryByUserIds(userIds);
|
|
|
|
+
|
|
|
|
+ for (TeacherCourseStatistics teacherCourseStatistics : teacherCourseStatisticsList) {
|
|
|
|
+ for (TeacherCourseStatistics teCourseSalaryStatisAndType : teCourseSalaryStatisAndTypes) {
|
|
|
|
+ if(!teacherCourseStatistics.getUserId().equals(teCourseSalaryStatisAndType.getUserId())) continue;
|
|
|
|
+
|
|
|
|
+ if(teCourseSalaryStatisAndType.getGroupType().equals("VIP")){
|
|
|
|
+ teacherCourseStatistics.setExpectVipCourseSalary(teCourseSalaryStatisAndType.getExpectTotalSalary());
|
|
|
|
+ teacherCourseStatistics.setVipCourseNum(teCourseSalaryStatisAndType.getMusicCourseNum());
|
|
|
|
+ }else if(teCourseSalaryStatisAndType.getGroupType().equals("MUSIC")){
|
|
|
|
+ teacherCourseStatistics.setExpectMusicCourseSalary(teCourseSalaryStatisAndType.getExpectTotalSalary());
|
|
|
|
+ teacherCourseStatistics.setMusicCourseNum(teCourseSalaryStatisAndType.getMusicCourseNum());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(teacherCourseStatistics.getSubjectIdList()==null){
|
|
|
|
+ teacherCourseStatistics.setSubjectIdList("");
|
|
|
|
+ }
|
|
|
|
+ teacherCourseStatistics.setMonth(startDate);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ teacherCourseStatisticsDao.batchAdd(teacherCourseStatisticsList);
|
|
|
|
+ return succeed(teacherCourseStatisticsList);
|
|
|
|
+ }
|
|
}
|
|
}
|