zouxuan 4 年之前
父節點
當前提交
fc4b0bb6ef

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderDao.java

@@ -237,4 +237,16 @@ public interface MusicGroupPaymentCalenderDao extends BaseDAO<Long, MusicGroupPa
      * @return
      */
     MusicGroupPaymentCalender getMusicGroupRegCalender(@Param("musicGroupId") String musicGroupId);
+
+    /**
+     * @describe 获取学员在乐团的缴费状态
+     * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
+     * @author zouxuan
+     * @date 2020/11/4
+     * @time 15:43
+     * @param userId:
+     * @param musicGroupId:
+     * @return java.util.Map<java.lang.String,java.lang.String>
+     */
+    Map<String, String> queryUserPaymentStatus(@Param("userId") Integer userId, @Param("musicGroupId") String musicGroupId);
 }

+ 3 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -1123,7 +1123,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
     public List<MusicCardDto> queryUserMusicGroups(Integer userId) {
         List<MusicCardDto> musicCardDtos = musicGroupDao.queryUserMusicGroups(userId);
         Set<String> musicGroupIds = musicCardDtos.stream().map(MusicCardDto::getMusicGroupId).collect(Collectors.toSet());
-        Map<String, String> paymentStatus = MapUtil.convertMybatisMap(musicGroupStudentFeeDao.queryUserPaymentStatus(userId, StringUtils.join(musicGroupIds, ",")));
+//        Map<String, String> paymentStatus = MapUtil.convertMybatisMap(musicGroupStudentFeeDao.queryUserPaymentStatus(userId, StringUtils.join(musicGroupIds, ",")));
+        Map<String, String> paymentStatus = musicGroupPaymentCalenderDao.queryUserPaymentStatus(userId, StringUtils.join(musicGroupIds, ","));
         // 获取学员在该乐团续费状态
         musicCardDtos.forEach(e -> {
             e.setPaymentStatus(paymentStatus.get(e.getMusicGroupId()));
@@ -1740,7 +1741,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 
         if (amount.compareTo(BigDecimal.ZERO) == 0) {
             studentPaymentRouteOrderService.addRouteOrder(orderNo,organId, balance);
-            Map<String, String> notifyMap = new HashMap<>();
+            Map<String, String> notifyMap = new HashMap<>(4);
             notifyMap.put("tradeState", "1");
             notifyMap.put("merOrderNo", studentPaymentOrder.getOrderNo());
             notifyMap.put("channelType", "");

+ 7 - 0
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderMapper.xml

@@ -462,4 +462,11 @@
         AND pay_user_type_='STUDENT'
         AND status_='OPEN'
     </select>
+    <select id="queryUserPaymentStatus" resultType="java.util.Map">
+        SELECT mgpc.music_group_id_ 'key',CASE WHEN COUNT(DISTINCT mgpcd.id_) > 0 THEN 'NON_PAYMENT' ELSE 'PAID_COMPLETED' END 'value'
+        FROM music_group_payment_calender mgpc
+        LEFT JOIN music_group_payment_calender_detail mgpcd ON mgpc.id_ = mgpcd.music_group_payment_calender_id_
+        WHERE FIND_IN_SET(mgpc.music_group_id_,#{musicGroupId}) AND mgpcd.user_id_ = #{userId} AND payment_status_ = 'NON_PAYMENT'
+        GROUP BY mgpc.music_group_id_
+    </select>
 </mapper>

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

@@ -236,7 +236,7 @@ public class MusicGroupController extends BaseController {
             throw new BizException("缴费项不存在该学员,请联系教务老师");
         }
         if(calenderDetail.getPaymentStatus() == PaymentStatus.PAID_COMPLETED){
-            throw new BizException("当前缴费项已缴费");
+            throw new BizException("您已缴费请勿重复支付");
         }else if(calenderDetail.getPaymentStatus() == PaymentStatus.PROCESSING){
             throw new BizException("当前缴费项存在待处理的订单,请稍候尝试");
         }