Browse Source

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

yonge 5 years ago
parent
commit
f98c6fbd67

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

@@ -262,12 +262,12 @@ public interface MusicGroupPaymentCalenderDao extends BaseDAO<Long, MusicGroupPa
      * @author zouxuan
      * @param userId
      */
-    void delStudentNoPaymentCalender(Integer userId);
+    void delStudentNoPaymentCalender(Integer userId, @Param("musicGroupId") String musicGroupId);
 
     /**
      * 缴费预计人数减一
      * @author
      * @param userId
      */
-    void cutCalenderExpectNum(Integer userId);
+    void cutCalenderExpectNum(@Param("userId") Integer userId, @Param("musicGroupId") String musicGroupId);
 }

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderDetailDao.java

@@ -211,5 +211,5 @@ public interface MusicGroupPaymentCalenderDetailDao extends BaseDAO<Long, MusicG
 	 * @author
 	 * @param userId
 	 */
-    void delStudentNoPaymentCalenderDetail(Integer userId);
+    void delStudentNoPaymentCalenderDetail(@Param("userId") Integer userId, @Param("musicGroupId") String musicGroupId);
 }

+ 5 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentRouteOrderServiceImpl.java

@@ -486,6 +486,11 @@ public class StudentPaymentRouteOrderServiceImpl extends BaseServiceImpl<Long, S
 		HttpResponseResult httpResponseResult = new HttpResponseResult();
 		httpResponseResult.setData(studentPaymentRouteOrders);
 		httpResponseResult.setMsg(sb.toString());
+		if(StringUtils.isNotEmpty(sb.toString())){
+			httpResponseResult.setCode(0);
+		}else {
+			httpResponseResult.setCode(200);
+		}
 		return httpResponseResult;
 	}
 

+ 3 - 2
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderDetailMapper.xml

@@ -185,8 +185,9 @@
 		DELETE FROM music_group_payment_calender_detail WHERE music_group_payment_calender_id_ = #{id}
 	</delete>
     <delete id="delStudentNoPaymentCalenderDetail">
-		DELETE FROM  music_group_payment_calender_detail
-		WHERE user_id_ = #{userId} AND payment_status_ = 'NON_PAYMENT'
+		DELETE mgpcd FROM  music_group_payment_calender_detail mgpcd
+		LEFT JOIN music_group_payment_calender mgpc ON mgpc.id_ = mgpcd.music_group_payment_calender_id_
+		WHERE mgpcd.user_id_ = #{userId} AND mgpcd.payment_status_ = 'NON_PAYMENT' AND mgpc.music_group_id_ = #{musicGroupId}
 	</delete>
 
     <!-- 分页查询 -->

+ 4 - 3
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderMapper.xml

@@ -210,7 +210,8 @@
         UPDATE music_group_payment_calender
         SET expect_num_ = expect_num_ - 1
         WHERE id_ IN (SELECT music_group_payment_calender_id_ FROM music_group_payment_calender_detail
-        WHERE user_id_ = #{userId} AND payment_status_ = 'NON_PAYMENT') AND payment_type_ != 'ADD_STUDENT' AND expect_num_ > 0
+        WHERE user_id_ = #{userId} AND payment_status_ = 'NON_PAYMENT')
+        AND payment_type_ != 'ADD_STUDENT' AND expect_num_ > 0 AND music_group_id_ = #{musicGroupId}
     </update>
 
     <!-- 根据主键删除一条记录 -->
@@ -224,14 +225,14 @@
     <delete id="delStudentNoPaymentCalender">
         DELETE FROM music_group_payment_calender
         WHERE id_ IN (SELECT music_group_payment_calender_id_ FROM music_group_payment_calender_detail
-        WHERE user_id_ = #{userId} AND payment_status_ = 'NON_PAYMENT') AND payment_type_ = 'ADD_STUDENT'
+        WHERE user_id_ = #{userId} AND payment_status_ = 'NON_PAYMENT') AND payment_type_ = 'ADD_STUDENT' AND music_group_id_ = #{musicGroupId}
     </delete>
 
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="MusicGroupPaymentCalender" parameterType="map">
         SELECT * FROM music_group_payment_calender mgpc
         <include refid="queryPageSql"/>
-        ORDER BY mgpc.payment_valid_start_date_ DESC
+        ORDER BY mgpc.payment_valid_start_date_,mgpc.id_ DESC
         <include refid="global.limit"/>
     </select>