浏览代码

Merge remote-tracking branch 'origin/master'

Joburgess 4 年之前
父节点
当前提交
6c1da21a90

+ 16 - 5
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentPaymentOrderDao.java

@@ -170,14 +170,14 @@ public interface StudentPaymentOrderDao extends BaseDAO<Long, StudentPaymentOrde
     Integer findOrderByGroupType(@Param("userId") Integer userId, @Param("sporadicId") Integer sporadicId, @Param("groupType") String groupType, @Param("status") DealStatusEnum status);
 
     /**
-     * @describe 获取零星订单
-     * @author qnc99
-     * @date 2020/12/5 0005
      * @param userId:
      * @param sporadicId:
      * @param groupType:
      * @param status:
      * @return java.util.List<com.ym.mec.biz.dal.entity.StudentPaymentOrder>
+     * @describe 获取零星订单
+     * @author qnc99
+     * @date 2020/12/5 0005
      */
     List<StudentPaymentOrder> findPaymentOrderByGroupType(@Param("userId") Integer userId, @Param("sporadicId") Integer sporadicId, @Param("groupType") String groupType, @Param("status") DealStatusEnum status);
 
@@ -359,6 +359,7 @@ public interface StudentPaymentOrderDao extends BaseDAO<Long, StudentPaymentOrde
 
     /**
      * 获取用户某种类型的订单
+     *
      * @param userId
      * @param type
      * @param status
@@ -367,14 +368,24 @@ public interface StudentPaymentOrderDao extends BaseDAO<Long, StudentPaymentOrde
     List<StudentPaymentOrder> getUserOrderByType(@Param("userId") Integer userId, @Param("type") OrderTypeEnum type, @Param("status") DealStatusEnum status);
 
     /**
+     * @param params:
+     * @return java.util.List<com.ym.mec.biz.dal.dto.StudentVipDouble11Dto>
      * @describe 获取参与双十一的学员
      * @author qnc99
      * @date 2020/11/25 0025
-     * @param params:
-     * @return java.util.List<com.ym.mec.biz.dal.dto.StudentVipDouble11Dto>
      */
     List<StudentVipDouble11Dto> queryDouble11Students(Map<String, Object> params);
+
     int countDouble11Students(Map<String, Object> params);
 
     List<StudentVipDouble11Dto> findStudentsDouble11Infos(@Param("studentIds") List<Integer> studentIds);
+
+
+    /**
+     * 获取学生的报名订单
+     * @param userId
+     * @param musicGroupId
+     * @return
+     */
+    List<StudentPaymentOrderExportDto> getUserApplyOrders(@Param("userId") Integer userId, @Param("musicGroupId") String musicGroupId);
 }

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

@@ -284,7 +284,7 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
             confirm.put("order_no", idGeneratorService.generatorId("payment"));
             confirm.put("confirm_amt", routeOrder.getRouteAmount());
             confirm.put("div_members", divMembers);
-            Payment.createConfirm(confirm);
+            Map<String, Object> confirm1 = Payment.createConfirm(confirm);
         }
         return true;
     }

+ 23 - 0
mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderMapper.xml

@@ -839,4 +839,27 @@
             GROUP BY
                 spo.user_id_
     </select>
+
+    <resultMap type="com.ym.mec.biz.dal.dto.StudentPaymentOrderExportDto" id="applyOrderAndDetail"
+               extends="StudentPaymentOrder">
+        <collection property="orderDetailList" ofType="com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail">
+            <result column="detail_id_" property="id"/>
+            <result column="detail_type_" property="type"/>
+            <result column="detail_price_" property="price"/>
+            <result column="detail_kit_group_purchase_type_" property="kitGroupPurchaseType"/>
+            <collection property="goodsList" ofType="com.ym.mec.biz.dal.entity.Goods">
+                <result column="goods_id" property="id"/>
+                <result column="goods_name" property="name"/>
+            </collection>
+        </collection>
+    </resultMap>
+    <select id="getUserApplyOrders" resultMap="applyOrderAndDetail" parameterType="map">
+        SELECT spo.*,spod.id_ detail_id_,spod.type_ detail_type_,spod.price_
+        detail_price_,spod.kit_group_purchase_type_ detail_kit_group_purchase_type_,
+        g.id_ goods_id, g.name_ goods_name
+        FROM student_payment_order spo
+        LEFT JOIN student_payment_order_detail spod on spo.id_ = spod.payment_order_id_
+        LEFT JOIN goods g on FIND_IN_SET(g.id_,spod.goods_id_list_)
+        WHERE spo.user_id_ = #{userId} AND spo.type_='APPLY' AND spo.music_group_id_=#{musicGroupId}
+    </select>
 </mapper>

+ 15 - 0
mec-student/src/main/java/com/ym/mec/student/controller/StudentOrderController.java

@@ -2,6 +2,8 @@ package com.ym.mec.student.controller;
 
 import com.alibaba.fastjson.JSON;
 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.*;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.*;
@@ -28,6 +30,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.HttpStatus;
 import org.springframework.scheduling.annotation.EnableScheduling;
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.DigestUtils;
@@ -78,6 +81,8 @@ public class StudentOrderController extends BaseController {
     private LuckDrawCountService luckDrawCountService;
     @Autowired
     private DegreeRegistrationDao degreeRegistrationDao;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
 
 
     @Value("${spring.profiles.active:dev}")
@@ -747,4 +752,14 @@ public class StudentOrderController extends BaseController {
         practice4Organs = practice4Organs.stream().sorted(Comparator.comparingDouble(Practice4OrganDto::getScale).reversed()).collect(Collectors.toList());
         return succeed(practice4Organs);
     }
+
+    @GetMapping("/getUserApplyOrders")
+    public HttpResponseResult<List<StudentPaymentOrderExportDto>> getUserApplyOrders(String musicGroupId){
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed(HttpStatus.FORBIDDEN, "请登录");
+        }
+        return succeed(studentPaymentOrderDao.getUserApplyOrders(sysUser.getId(),musicGroupId));
+    }
+
 }