Browse Source

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

zouxuan 5 years ago
parent
commit
808cb1ce7e

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentPaymentOrderDetailDao.java

@@ -20,9 +20,17 @@ public interface StudentPaymentOrderDetailDao extends BaseDAO<Long, StudentPayme
 
 
     /**
     /**
      * 查询注册支付的订单详情
      * 查询注册支付的订单详情
+     *
      * @param musicGroupId
      * @param musicGroupId
      * @param status
      * @param status
      * @return
      * @return
      */
      */
     List<StudentPaymentOrderDetail> findApplyOrderSuccess(@Param("musicGroupId") String musicGroupId, @Param("status") DealStatusEnum status);
     List<StudentPaymentOrderDetail> findApplyOrderSuccess(@Param("musicGroupId") String musicGroupId, @Param("status") DealStatusEnum status);
+
+    /**
+     * 查询订单商品
+     * @param orderId
+     * @return
+     */
+    List<StudentPaymentOrderDetail> findApplyOrderGoods(@Param("orderId") Long orderId);
 }
 }

+ 7 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/StudentPaymentOrderDetailService.java

@@ -41,4 +41,11 @@ public interface StudentPaymentOrderDetailService extends BaseService<Long, Stud
      */
      */
     List<Goods> verifyMusicalList(String musicGroupId);
     List<Goods> verifyMusicalList(String musicGroupId);
 
 
+    /**
+     * 查询订单商品
+     * @param orderId
+     * @return
+     */
+    List<Goods> findApplyOrderGoods(Long orderId);
+
 }
 }

+ 30 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderDetailServiceImpl.java

@@ -90,4 +90,34 @@ public class StudentPaymentOrderDetailServiceImpl extends BaseServiceImpl<Long,
         musicGroupPurchaseListDao.batchInsert(musicGroupPurchaseLists);
         musicGroupPurchaseListDao.batchInsert(musicGroupPurchaseLists);
         return  musicalList;
         return  musicalList;
     }
     }
+
+    @Override
+    public List<Goods> findApplyOrderGoods(Long orderId) {
+        List<StudentPaymentOrderDetail> applyOrderGoods = studentPaymentOrderDetailDao.findApplyOrderGoods(orderId);
+
+        if(applyOrderGoods == null || applyOrderGoods.size()==0){
+            return null;
+        }
+        String goodsIdsStr = "";
+        for (StudentPaymentOrderDetail studentPaymentOrderDetail : applyOrderGoods) {
+            if (studentPaymentOrderDetail.getGoodsIdList() != null && !studentPaymentOrderDetail.getGoodsIdList().isEmpty()) {
+                goodsIdsStr += studentPaymentOrderDetail.getGoodsIdList()+",";
+            }
+        }
+        goodsIdsStr = goodsIdsStr.substring(0, goodsIdsStr.length() - 1);
+
+        String[] goodSIdArr = goodsIdsStr.split(",");
+
+        List<Goods> goodies = goodsService.findGoodsByIds(goodsIdsStr);
+
+        for (Goods goods : goodies) {
+            goods.setSellCount(0);
+            for (String goodsIdStr : goodSIdArr) {
+                if(goods.getId().equals(Integer.parseInt(goodsIdStr))){
+                    goods.setSellCount(goods.getSellCount()+1);
+                }
+            }
+        }
+        return goodies;
+    }
 }
 }

+ 5 - 0
mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderDetailMapper.xml

@@ -98,4 +98,9 @@
         AND spo.status_=#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
         AND spo.status_=#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
         AND spo.type_ = 'APPLY'
         AND spo.type_ = 'APPLY'
     </select>
     </select>
+
+    <!-- 查询订单详情 -->
+    <select id="findApplyOrderGoods" resultMap="StudentPaymentOrderDetail">
+        SELECT * FROM student_payment_order_detail WHERE payment_order_id_ = #{orderId}
+    </select>
 </mapper>
 </mapper>

+ 20 - 2
mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupController.java

@@ -20,6 +20,7 @@ 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;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.HttpStatus;
 import org.springframework.ui.ModelMap;
 import org.springframework.ui.ModelMap;
@@ -27,8 +28,10 @@ import org.springframework.web.bind.annotation.*;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
+import java.util.HashMap;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
+import java.util.Objects;
 
 
 @RequestMapping("musicGroup")
 @RequestMapping("musicGroup")
 @Api(tags = "乐团服务")
 @Api(tags = "乐团服务")
@@ -55,6 +58,8 @@ public class MusicGroupController extends BaseController {
     private MusicGroupStudentFeeDao musicGroupStudentFeeDao;
     private MusicGroupStudentFeeDao musicGroupStudentFeeDao;
     @Autowired
     @Autowired
     private IdGeneratorService idGeneratorService;
     private IdGeneratorService idGeneratorService;
+    @Autowired
+    private StudentPaymentOrderDetailService studentPaymentOrderDetailService;
 
 
     @ApiOperation("获取学生所在乐团列表")
     @ApiOperation("获取学生所在乐团列表")
     @GetMapping(value = "/queryUserMusicGroups")
     @GetMapping(value = "/queryUserMusicGroups")
@@ -371,7 +376,20 @@ public class MusicGroupController extends BaseController {
     @GetMapping("/getOrderStatus")
     @GetMapping("/getOrderStatus")
     @ApiImplicitParams({@ApiImplicitParam(name = "orderNo", value = "订单号", required = true, dataType = "String")})
     @ApiImplicitParams({@ApiImplicitParam(name = "orderNo", value = "订单号", required = true, dataType = "String")})
     public HttpResponseResult getOrderStatus(String orderNo) {
     public HttpResponseResult getOrderStatus(String orderNo) {
-        StudentPaymentOrder order = studentPaymentOrderService.findOrderByOrderNo(orderNo);
-        return succeed(order);
+        if (StringUtils.isBlank(orderNo)) {
+            return failed("请指定订单");
+        }
+        StudentPaymentOrder orderByOrderNo = studentPaymentOrderService.findOrderByOrderNo(orderNo);
+        if (Objects.isNull(orderByOrderNo)) {
+            return failed("未找到指定订单");
+        }
+        MusicGroup musicGroup = musicGroupService.get(orderByOrderNo.getMusicGroupId());
+        List<Goods> goodsList = studentPaymentOrderDetailService.findApplyOrderGoods(orderByOrderNo.getId());
+        HashMap<String, Object> orderDetail = new HashMap<>();
+        orderDetail.put("order",orderByOrderNo);
+        orderDetail.put("goods",goodsList);
+        orderDetail.put("course",musicGroup.getCourseForm());
+
+        return succeed(orderDetail);
     }
     }
 }
 }

+ 12 - 1
mec-student/src/main/java/com/ym/mec/student/controller/StudentOrderController.java

@@ -3,6 +3,8 @@ package com.ym.mec.student.controller;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSON;
 import com.huifu.adapay.model.payment.PayChannelEnum;
 import com.huifu.adapay.model.payment.PayChannelEnum;
 import com.huifu.adapay.model.payment.Payment;
 import com.huifu.adapay.model.payment.Payment;
+import com.ym.mec.biz.dal.entity.Goods;
+import com.ym.mec.biz.dal.entity.MusicGroup;
 import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
 import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
 import com.ym.mec.biz.dal.enums.DealStatusEnum;
 import com.ym.mec.biz.dal.enums.DealStatusEnum;
 import com.ym.mec.biz.dal.enums.OrderTypeEnum;
 import com.ym.mec.biz.dal.enums.OrderTypeEnum;
@@ -51,6 +53,8 @@ public class StudentOrderController extends BaseController {
     private MusicGroupService musicGroupService;
     private MusicGroupService musicGroupService;
     @Autowired
     @Autowired
     private YqPayFeignService yqQueryService;
     private YqPayFeignService yqQueryService;
+    @Autowired
+    private StudentPaymentOrderDetailService studentPaymentOrderDetailService;
 
 
 //    @PostMapping("/notify")
 //    @PostMapping("/notify")
 //    public String notify(@ModelAttribute NotifyMsg notifyMsg) {
 //    public String notify(@ModelAttribute NotifyMsg notifyMsg) {
@@ -134,7 +138,14 @@ public class StudentOrderController extends BaseController {
         if (Objects.isNull(orderByOrderNo)) {
         if (Objects.isNull(orderByOrderNo)) {
             return failed("未找到指定订单");
             return failed("未找到指定订单");
         }
         }
-        return succeed(orderByOrderNo.getStatus());
+        MusicGroup musicGroup = musicGroupService.get(orderByOrderNo.getMusicGroupId());
+        List<Goods> goodsList = studentPaymentOrderDetailService.findApplyOrderGoods(orderByOrderNo.getId());
+        HashMap<String, Object> orderDetail = new HashMap<>();
+        orderDetail.put("order",orderByOrderNo);
+        orderDetail.put("goods",goodsList);
+        orderDetail.put("course",musicGroup.getCourseForm());
+
+        return succeed(orderDetail);
     }
     }
 
 
     @ApiOperation(value = "台牌支付")
     @ApiOperation(value = "台牌支付")

+ 3 - 3
mec-web/src/main/java/com/ym/mec/web/controller/CourseScheduleController.java

@@ -185,7 +185,7 @@ public class CourseScheduleController extends BaseController {
 
 
 	@ApiOperation(value = "课酬调整")
 	@ApiOperation(value = "课酬调整")
 	@PostMapping("/updateTeacherCoursesSalary")
 	@PostMapping("/updateTeacherCoursesSalary")
-    @PreAuthorize("@pcs.hasPermissions('course/updateTeacherCoursesSalary')")
+    @PreAuthorize("@pcs.hasPermissions('courseSchedule/updateTeacherCoursesSalary')")
 	public Object updateTeacherCoursesSalary(Long courseScheduleId, Integer teacherId, BigDecimal salary, BigDecimal subsidy, String scope) {
 	public Object updateTeacherCoursesSalary(Long courseScheduleId, Integer teacherId, BigDecimal salary, BigDecimal subsidy, String scope) {
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
 		if (sysUser == null || sysUser.getId() == null) {
 		if (sysUser == null || sysUser.getId() == null) {
@@ -197,14 +197,14 @@ public class CourseScheduleController extends BaseController {
 
 
 	@ApiOperation(value = "乐团详情--课酬调整--课程教师列表")
 	@ApiOperation(value = "乐团详情--课酬调整--课程教师列表")
 	@GetMapping("/queryTeacherSalary")
 	@GetMapping("/queryTeacherSalary")
-    @PreAuthorize("@pcs.hasPermissions('course/queryTeacherSalary')")
+    @PreAuthorize("@pcs.hasPermissions('courseSchedule/queryTeacherSalary')")
 	public Object queryTeacherSalary(Integer courseScheduleId) {
 	public Object queryTeacherSalary(Integer courseScheduleId) {
 		return succeed(musicGroupService.queryTeacherSalary(courseScheduleId));
 		return succeed(musicGroupService.queryTeacherSalary(courseScheduleId));
 	}
 	}
 
 
     @ApiOperation(value = "根据班级获取课程计划")
     @ApiOperation(value = "根据班级获取课程计划")
     @GetMapping("/findCourseScheduleByClassGroup")
     @GetMapping("/findCourseScheduleByClassGroup")
-    @PreAuthorize("@pcs.hasPermissions('course/findCourseScheduleByClassGroup')")
+    @PreAuthorize("@pcs.hasPermissions('courseSchedule/findCourseScheduleByClassGroup')")
 	public Object findCourseScheduleByClassGroup(Integer classGroupId){
 	public Object findCourseScheduleByClassGroup(Integer classGroupId){
         return succeed(scheduleService.findCourseScheduleByClassGroup(classGroupId));
         return succeed(scheduleService.findCourseScheduleByClassGroup(classGroupId));
     }
     }