Browse Source

Merge branch 'master' of http://git.dayaedu.com/yonge/mec

yonge 5 năm trước cách đây
mục cha
commit
4919fc5390

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/OperatingReportServiceImpl.java

@@ -278,7 +278,7 @@ public class OperatingReportServiceImpl extends BaseServiceImpl<Integer, Operati
 
     private void updateReport(OperatingReport operatingReport, Map<String, Object> params) {
         //收入合计:销售收入+服务收入-业务退费
-        BigDecimal incomeTotal = operatingReport.getSellAmount().add(operatingReport.getServiceAmount()).subtract(operatingReport.getRefundAmount());
+        BigDecimal incomeTotal = operatingReport.getSellAmount().add(operatingReport.getServiceAmount()).add(operatingReport.getOtherIncome()).subtract(operatingReport.getRefundAmount());
         operatingReport.setIncomeTotal(incomeTotal);
         //成本费用合计:销售成本+固定支出+变动支出+分摊费用
         BigDecimal costAmount = operatingReport.getSellCost().add(operatingReport.getExpensesAmount()).add(operatingReport.getVariableCost()).add(operatingReport.getDistributionAmount());

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SellOrderServiceImpl.java

@@ -12,6 +12,7 @@ import com.ym.mec.biz.dal.enums.SellTypeEnum;
 import com.ym.mec.biz.service.*;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -45,7 +46,7 @@ public class SellOrderServiceImpl extends BaseServiceImpl<Integer, SellOrder> im
         }
         StudentPaymentOrder order = studentPaymentOrderDao.get(orderId);
         MusicGroup musicGroup = new MusicGroup();
-        if (musicGroupId != null) {
+        if (StringUtils.isNotBlank(musicGroupId)) {
             musicGroup = musicGroupDao.get(musicGroupId);
         }
         int goodsNum = goodsIds.size();

+ 32 - 10
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java

@@ -900,22 +900,44 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
             List<StudentPaymentOrderDetail> orderDetails = studentPaymentOrderDetailService.getOrderDetail(studentPaymentOrder.getId());
             if (orderDetails.size() > 0) {
                 List<SellOrder> sellOrders = new ArrayList<>();
-                BigDecimal remitFee = studentPaymentOrder.getRemitFee() != null ? studentPaymentOrder.getRemitFee() : BigDecimal.ZERO;
-                BigDecimal balancePaymentAmount = studentPaymentOrder.getBalancePaymentAmount() != null ? studentPaymentOrder.getBalancePaymentAmount() : BigDecimal.ZERO;
+                //总余额支付
+                BigDecimal totalBalance = studentPaymentOrder.getBalancePaymentAmount() != null ? studentPaymentOrder.getBalancePaymentAmount() : BigDecimal.ZERO;
                 //总价格
                 BigDecimal totalPrice = studentPaymentOrder.getExpectAmount();
+                //商品总付款
+                BigDecimal detailTotalPrice = orderDetails.stream().map(StudentPaymentOrderDetail::getPrice).reduce(BigDecimal.ZERO, BigDecimal::add);
+                //商品销售占的余额
+                BigDecimal detailTotalBalance = detailTotalPrice.multiply(totalBalance).divide(totalPrice,2,BigDecimal.ROUND_HALF_UP);
+
+                int i = 1;
+                BigDecimal detailRouteBalance = BigDecimal.ZERO;
                 for (StudentPaymentOrderDetail orderDetail : orderDetails) {
+                    BigDecimal detailBalance = orderDetail.getPrice().multiply(detailTotalBalance).divide(detailTotalPrice,2,BigDecimal.ROUND_HALF_UP);
+                    if(i == orderDetails.size()){
+                        detailBalance = detailTotalBalance.subtract(detailRouteBalance);
+                    }
+                    detailRouteBalance = detailRouteBalance.add(detailBalance);
+                    i++;
+
                     if (orderDetail.getType().equals(OrderDetailTypeEnum.MUSICAL) && orderDetail.getKitGroupPurchaseType().equals(KitGroupPurchaseTypeEnum.LEASE)) {
                         continue;
                     }
-                    if (orderDetail.getType().equals(OrderDetailTypeEnum.MUSICAL) && orderDetail.getKitGroupPurchaseType().equals(KitGroupPurchaseTypeEnum.GROUP)) {
-                        orderDetail.setPrice(orderDetail.getPrice().subtract(remitFee));
-                    }
 
                     BigDecimal goodsTotalPrice = orderDetail.getGoodsList().stream().map(Goods::getGroupPurchasePrice).reduce(BigDecimal.ZERO, BigDecimal::add);
+                    BigDecimal routePrice = BigDecimal.ZERO;
+                    BigDecimal routeBalance = BigDecimal.ZERO;
+                    int j = 1;
                     for (Goods goods : orderDetail.getGoodsList()) {
-                        BigDecimal actualAmount = goods.getGroupPurchasePrice().multiply(orderDetail.getPrice()).multiply(studentPaymentOrder.getActualAmount()).divide(goodsTotalPrice.multiply(totalPrice), 2, BigDecimal.ROUND_HALF_UP);
-                        BigDecimal balance = goods.getGroupPurchasePrice().multiply(orderDetail.getPrice()).multiply(balancePaymentAmount).divide(goodsTotalPrice.multiply(totalPrice), 2, BigDecimal.ROUND_HALF_UP);
+                        BigDecimal expectAmount = goods.getGroupPurchasePrice().multiply(orderDetail.getPrice()).divide(goodsTotalPrice, 2, BigDecimal.ROUND_HALF_UP);
+                        BigDecimal balance = goods.getGroupPurchasePrice().multiply(detailBalance).divide(goodsTotalPrice, 2, BigDecimal.ROUND_HALF_UP);
+                        if(j==orderDetail.getGoodsList().size()){
+                            expectAmount  = orderDetail.getPrice().subtract(routePrice);
+                            balance  = orderDetail.getPrice().subtract(routeBalance);
+                        }
+                        routePrice = routePrice.add(expectAmount);
+                        routeBalance = routeBalance.add(balance);
+                        j++;
+
                         SellOrder sellOrder = new SellOrder();
                         Map<String, BigDecimal> CostMap = new HashMap<>();
                         CostMap.put("sellCost",goods.getDiscountPrice());
@@ -927,9 +949,9 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
                         sellOrder.setTransNo(studentPaymentOrder.getTransNo());
                         sellOrder.setOrderId(studentPaymentOrder.getId());
                         sellOrder.setOrderNo(studentPaymentOrder.getOrderNo());
-                        sellOrder.setActualAmount(actualAmount);
-                        sellOrder.setBalanceAmount(balancePaymentAmount);
-                        sellOrder.setExpectAmount(actualAmount.add(balance));
+                        sellOrder.setActualAmount(expectAmount.subtract(balance));
+                        sellOrder.setBalanceAmount(balance);
+                        sellOrder.setExpectAmount(expectAmount);
                         sellOrder.setSellCost(goods.getDiscountPrice());
                         sellOrder.setSellCost2(JSON.toJSONString(CostMap));
                         sellOrder.setNum(1);

+ 107 - 25
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRepairServiceImpl.java

@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dao.SellOrderDao;
 import com.ym.mec.biz.dal.dao.StudentDao;
 import com.ym.mec.biz.dal.dao.StudentRepairDao;
 import com.ym.mec.biz.dal.dao.SysConfigDao;
@@ -65,6 +66,8 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
     private StudentPaymentRouteOrderService studentPaymentRouteOrderService;
     @Autowired
     private SellOrderService sellOrderService;
+    @Autowired
+    private SellOrderDao sellOrderDao;
 
     @Override
     public BaseDAO<Integer, StudentRepair> getDAO() {
@@ -102,22 +105,25 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
     @Transactional(rollbackFor = Exception.class)
     public Map addGoodsSellOrder(GoodsSellDto goodsSellDto) throws Exception {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("请登录");
-        }
         Integer studentId = sysUser.getId();
         String goodsId = goodsSellDto.getGoodsId();
-        if(StringUtils.isEmpty(goodsId)){
+        if (StringUtils.isEmpty(goodsId)) {
             throw new BizException("请选择需要购买的商品");
         }
-        if(studentId == null){
+        if (studentId == null) {
             throw new BizException("请指定学员");
         }
         studentDao.lockUser(studentId);
         SysUser student = sysUserFeignService.queryUserById(studentId);
         String orderNo = idGeneratorService.generatorId("payment") + "";
+
+        String[] goodsIds = goodsId.split(",");
+        Map<String, BigDecimal> map = getMap("goods", "id_", "group_purchase_price_", goodsId, String.class, BigDecimal.class);
+        BigDecimal amount = BigDecimal.ZERO;
+        for (String id : goodsIds) {
+            amount.add(map.get(id));
+        }
         List<Goods> goods = goodsService.findGoodsByIds(goodsId);
-        BigDecimal amount = goods.stream().map(e -> e.getGroupPurchasePrice()).reduce(BigDecimal.ZERO, BigDecimal::add);
 
         StudentPaymentOrder studentPaymentOrder = new StudentPaymentOrder();
         studentPaymentOrder.setUserId(studentId);
@@ -131,9 +137,10 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
         studentPaymentOrder.setRoutingOrganId(student.getOrganId());
         studentPaymentOrderService.insert(studentPaymentOrder);
 
-        Map<GoodsType, List<Goods>> collect = goods.stream().collect(Collectors.groupingBy(Goods::getType));
+        Map<Integer, List<Goods>> collect = goods.stream().collect(Collectors.groupingBy(Goods::getId));
         List<StudentPaymentOrderDetail> studentPaymentOrderDetailList = new ArrayList<>();
-        goods.forEach(e->{
+        for (String id : goodsIds) {
+            Goods e = collect.get(id).get(0);
             StudentPaymentOrderDetail studentPaymentOrderDetail = new StudentPaymentOrderDetail();
             studentPaymentOrderDetail.setRemitFee(BigDecimal.ZERO);
             OrderDetailTypeEnum type = null;
@@ -146,12 +153,11 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
             }
             studentPaymentOrderDetail.setType(type);
             studentPaymentOrderDetail.setPrice(e.getGroupPurchasePrice());
-            String join = StringUtils.join(collect.get(e.getType()).stream().map(g -> g.getId()).collect(Collectors.toList()), ",");
-            studentPaymentOrderDetail.setGoodsIdList(join);
+            studentPaymentOrderDetail.setGoodsIdList(id);
             studentPaymentOrderDetail.setPaymentOrderId(studentPaymentOrder.getId());
             studentPaymentOrderDetail.setKitGroupPurchaseType(KitGroupPurchaseTypeEnum.GROUP);
             studentPaymentOrderDetailList.add(studentPaymentOrderDetail);
-        });
+        }
         studentPaymentOrderDetailService.batchAdd(studentPaymentOrderDetailList);
 
         studentPaymentOrder.setVersion(0);
@@ -225,11 +231,11 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
         repairInfo.setCreateTime(date);
         repairInfo.setUpdateTime(date);
         String goodsJson = repairInfo.getGoodsJson();
-        if(StringUtils.isNotEmpty(goodsJson)){
+        if (StringUtils.isNotEmpty(goodsJson)) {
             List<RepairGoodsDto> repairGoodsDtos = JSONObject.parseArray(goodsJson, RepairGoodsDto.class);
             List<Integer> goodsIds = repairGoodsDtos.stream().map(e -> e.getId()).collect(Collectors.toList());
             Map<Integer, BigDecimal> map = getMap("goods", "id_", "group_purchase_price_", goodsIds, Integer.class, BigDecimal.class);
-            repairGoodsDtos.forEach(e->{
+            repairGoodsDtos.forEach(e -> {
                 e.setGroupPurchasePrice(map.get(e.getId()));
             });
             repairInfo.setGoodsJson(JSONObject.toJSONString(repairGoodsDtos));
@@ -241,13 +247,13 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
             return repairInfoMap;
         }
 
-        if(StringUtils.isNoneBlank(repairInfo.getGoodsJson())){
+        if (StringUtils.isNoneBlank(repairInfo.getGoodsJson())) {
             JSONArray goods = JSON.parseArray(repairInfo.getGoodsJson());
             for (Object good : goods) {
-                JSONObject goodObject= (JSONObject) good;
+                JSONObject goodObject = (JSONObject) good;
                 BigDecimal groupPurchasePrice = goodObject.getBigDecimal("groupPurchasePrice");
-                if(Objects.nonNull(groupPurchasePrice)){
-                    amount=amount.add(groupPurchasePrice);
+                if (Objects.nonNull(groupPurchasePrice)) {
+                    amount = amount.add(groupPurchasePrice);
                 }
             }
         }
@@ -396,7 +402,7 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
         studentDao.lockUser(studentRepair.getStudentId());
         BigDecimal amount = studentRepair.getAmount();
         String goodsJson = studentRepair.getGoodsJson();
-        if(StringUtils.isNotEmpty(goodsJson)){
+        if (StringUtils.isNotEmpty(goodsJson)) {
             List<RepairGoodsDto> repairGoodsDtos = JSONObject.parseArray(goodsJson, RepairGoodsDto.class);
             BigDecimal reduce = repairGoodsDtos.stream().map(e -> e.getGroupPurchasePrice()).reduce(BigDecimal.ZERO, BigDecimal::add);
             amount = amount.add(reduce);
@@ -545,7 +551,83 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
                 rechargeDetail.setPerAmount(studentPaymentOrder.getPerAmount().negate());
             }
             sysUserCashAccountDetailService.insert(paymentDetail);
-        }else if(studentPaymentOrder.getStatus() == DealStatusEnum.CLOSE || studentPaymentOrder.getStatus() == DealStatusEnum.FAILED){
+            //销售订单详情
+            List<StudentPaymentOrderDetail> orderDetails = studentPaymentOrderDetailService.getOrderDetail(studentPaymentOrder.getId());
+            if (orderDetails.size() > 0) {
+                List<SellOrder> sellOrders = new ArrayList<>();
+                //总余额支付
+                BigDecimal totalBalance = studentPaymentOrder.getBalancePaymentAmount() != null ? studentPaymentOrder.getBalancePaymentAmount() : BigDecimal.ZERO;
+                //总价格
+                BigDecimal totalPrice = studentPaymentOrder.getExpectAmount();
+                //商品总付款
+                BigDecimal detailTotalPrice = orderDetails.stream().map(StudentPaymentOrderDetail::getPrice).reduce(BigDecimal.ZERO, BigDecimal::add);
+                //商品销售占的余额
+                BigDecimal detailTotalBalance = detailTotalPrice.multiply(totalBalance).divide(totalPrice, 2, BigDecimal.ROUND_HALF_UP);
+
+                int i = 1;
+                BigDecimal detailRouteBalance = BigDecimal.ZERO;
+                for (StudentPaymentOrderDetail orderDetail : orderDetails) {
+                    BigDecimal detailBalance = orderDetail.getPrice().multiply(detailTotalBalance).divide(detailTotalPrice, 2, BigDecimal.ROUND_HALF_UP);
+                    if (i == orderDetails.size()) {
+                        detailBalance = detailTotalBalance.subtract(detailRouteBalance);
+                    }
+                    detailRouteBalance = detailRouteBalance.add(detailBalance);
+                    i++;
+
+                    if (orderDetail.getType().equals(OrderDetailTypeEnum.MUSICAL) && orderDetail.getKitGroupPurchaseType().equals(KitGroupPurchaseTypeEnum.LEASE)) {
+                        continue;
+                    }
+
+                    BigDecimal goodsTotalPrice = orderDetail.getGoodsList().stream().map(Goods::getGroupPurchasePrice).reduce(BigDecimal.ZERO, BigDecimal::add);
+                    BigDecimal routePrice = BigDecimal.ZERO;
+                    BigDecimal routeBalance = BigDecimal.ZERO;
+                    int j = 1;
+                    for (Goods goods : orderDetail.getGoodsList()) {
+                        BigDecimal expectAmount = goods.getGroupPurchasePrice().multiply(orderDetail.getPrice()).divide(goodsTotalPrice, 2, BigDecimal.ROUND_HALF_UP);
+                        BigDecimal balance = goods.getGroupPurchasePrice().multiply(detailBalance).divide(goodsTotalPrice, 2, BigDecimal.ROUND_HALF_UP);
+                        if (j == orderDetail.getGoodsList().size()) {
+                            expectAmount = orderDetail.getPrice().subtract(routePrice);
+                            balance = orderDetail.getPrice().subtract(routeBalance);
+                        }
+                        routePrice = routePrice.add(expectAmount);
+                        routeBalance = routeBalance.add(balance);
+                        j++;
+
+                        SellOrder sellOrder = new SellOrder();
+                        Map<String, BigDecimal> CostMap = new HashMap<>();
+                        CostMap.put("sellCost", goods.getDiscountPrice());
+                        if (goods.getAgreeCostPrice() != null) {
+                            CostMap.put("SellCost2", goods.getAgreeCostPrice());
+                        }
+                        sellOrder.setOrganId(studentPaymentOrder.getOrganId());
+                        sellOrder.setTransNo(studentPaymentOrder.getTransNo());
+                        sellOrder.setOrderId(studentPaymentOrder.getId());
+                        sellOrder.setOrderNo(studentPaymentOrder.getOrderNo());
+                        sellOrder.setActualAmount(expectAmount.subtract(balance));
+                        sellOrder.setBalanceAmount(balance);
+                        sellOrder.setExpectAmount(expectAmount);
+                        sellOrder.setSellCost(goods.getDiscountPrice());
+                        sellOrder.setSellCost2(JSON.toJSONString(CostMap));
+                        sellOrder.setNum(1);
+                        sellOrder.setUserId(studentPaymentOrder.getUserId());
+                        sellOrder.setPaymentChannel(studentPaymentOrder.getPaymentChannel());
+                        sellOrder.setMerNo(studentPaymentOrder.getMerNos());
+                        sellOrder.setSellTime(studentPaymentOrder.getCreateTime());
+                        sellOrder.setCreateIme(new Date());
+                        sellOrder.setUpdateTime(new Date());
+                        if (goods.getType().equals(GoodsType.INSTRUMENT)) {
+                            sellOrder.setType(SellTypeEnum.INSTRUMENT);
+                        } else if (goods.getType().equals(GoodsType.ACCESSORIES)) {
+                            sellOrder.setType(SellTypeEnum.ACCESSORIES);
+                        } else {
+                            sellOrder.setType(SellTypeEnum.OTHER);
+                        }
+                        sellOrders.add(sellOrder);
+                    }
+                }
+                sellOrderDao.batchInsert(sellOrders);
+            }
+        } else if (studentPaymentOrder.getStatus() == DealStatusEnum.CLOSE || studentPaymentOrder.getStatus() == DealStatusEnum.FAILED) {
             if (studentPaymentOrder.getBalancePaymentAmount() != null && studentPaymentOrder.getBalancePaymentAmount().compareTo(BigDecimal.ZERO) > 0) {
                 sysUserCashAccountService.updateBalance(studentPaymentOrder.getUserId(), studentPaymentOrder.getBalancePaymentAmount(), PlatformCashAccountDetailTypeEnum.REFUNDS, "乐器维修支付失败");
             }
@@ -567,7 +649,7 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
         if (repairInfo == null) {
             throw new BizException("维修单不存在");
         }
-        if(repairInfo.getPayStatus().equals(2)){
+        if (repairInfo.getPayStatus().equals(2)) {
             return true;
         }
 
@@ -620,14 +702,14 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
             }
             sysUserCashAccountDetailService.insert(paymentDetail);
             //生成销售订单
-            List<Integer> goodsIds = new ArrayList<>();
-            if(StringUtils.isNotBlank(repairInfo.getGoodsJson())){
+            if (StringUtils.isNotBlank(repairInfo.getGoodsJson())) {
                 List<Goods> goods = JSONObject.parseArray(repairInfo.getGoodsJson(), Goods.class);
-                goodsIds = goods.stream().map(Goods::getId).collect(Collectors.toList());
+                List<Integer> goodsIds = goods.stream().map(Goods::getId).collect(Collectors.toList());
+                if (goodsIds.size() > 0) {
+                    sellOrderService.addSellOrder(studentPaymentOrder.getId(), repairInfo.getMusicGroupId(), goodsIds, studentPaymentOrder.getExpectAmount(), studentPaymentOrder.getBalancePaymentAmount());
+                }
             }
 
-            sellOrderService.addSellOrder(studentPaymentOrder.getId(),repairInfo.getMusicGroupId(),goodsIds,studentPaymentOrder.getExpectAmount(),studentPaymentOrder.getBalancePaymentAmount());
-
             String imContent = repairInfo.getStudentName() + "学员您好,您的乐器维修已受理,我们会尽快完成保养维修";
 
             if (repairInfo.getType().equals(1)) { //线上

+ 1 - 1
mec-biz/src/main/resources/config/mybatis/GoodsMapper.xml

@@ -198,7 +198,7 @@
     </select>
     <select id="getGoodies" resultMap="Goods">
         SELECT * FROM goods WHERE id_ IN
-        <foreach collection="goodsIds" item="goodsId" open="(" close=")">
+        <foreach collection="goodsIds" item="goodsId" open="(" close=")" separator=",">
             #{goodsId}
         </foreach>
     </select>

+ 18 - 31
mec-student/src/main/java/com/ym/mec/student/controller/StudentOrderController.java

@@ -1,29 +1,28 @@
 package com.ym.mec.student.controller;
 
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
-import com.huifu.adapay.Adapay;
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.*;
+import com.ym.mec.biz.dal.enums.DealStatusEnum;
+import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.enums.OrderTypeEnum;
 import com.ym.mec.biz.service.*;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.thirdparty.adapay.ConfigInit;
 import com.ym.mec.thirdparty.adapay.Payment;
+import com.ym.mec.thirdparty.yqpay.Msg;
+import com.ym.mec.thirdparty.yqpay.RsqMsg;
+import com.ym.mec.thirdparty.yqpay.YqPayFeignService;
+import com.ym.mec.thirdparty.yqpay.YqPayUtil;
 import com.ym.mec.util.date.DateUtil;
+import com.ym.mec.util.http.HttpUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
-
-import java.io.IOException;
-import java.math.BigDecimal;
-import java.net.URLEncoder;
-import java.text.SimpleDateFormat;
-import java.util.*;
-import java.util.stream.Collectors;
-
-import javax.servlet.http.HttpServletResponse;
-
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -31,23 +30,15 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.scheduling.annotation.EnableScheduling;
 import org.springframework.util.DigestUtils;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.ModelAttribute;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
-import com.alibaba.fastjson.JSON;
-import com.ym.mec.biz.dal.enums.DealStatusEnum;
-import com.ym.mec.biz.dal.enums.GroupType;
-import com.ym.mec.common.controller.BaseController;
-import com.ym.mec.common.entity.HttpResponseResult;
-import com.ym.mec.thirdparty.yqpay.Msg;
-import com.ym.mec.thirdparty.yqpay.RsqMsg;
-import com.ym.mec.thirdparty.yqpay.YqPayFeignService;
-import com.ym.mec.thirdparty.yqpay.YqPayUtil;
-import com.ym.mec.util.http.HttpUtil;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.math.BigDecimal;
+import java.net.URLEncoder;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.stream.Collectors;
 
 @RequestMapping("studentOrder")
 @Api(tags = "订单回调")
@@ -58,8 +49,6 @@ public class StudentOrderController extends BaseController {
     @Autowired
     private StudentPaymentOrderService studentPaymentOrderService;
     @Autowired
-    private StudentRegistrationService studentRegistrationService;
-    @Autowired
     private VipGroupService vipGroupService;
     @Autowired
     private MusicGroupService musicGroupService;
@@ -76,8 +65,6 @@ public class StudentOrderController extends BaseController {
     @Autowired
     private OrganizationDao organizationDao;
     @Autowired
-    private TeacherCourseStatisticsDao teacherCourseStatisticsDao;
-    @Autowired
     private CourseScheduleEvaluateDao courseScheduleEvaluateDao;
     @Autowired
     private TenantPaymentOrderService tenantPaymentOrderService;