liujunchi 3 jaren geleden
bovenliggende
commit
be88e0abe1

+ 3 - 2
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/MusicSheetServiceImpl.java

@@ -532,8 +532,9 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
 
         }
 
-        if (musicSheetDto.getId() != null && musicSheetDto.getSourceType().equals(SourceTypeEnum.PLATFORM)
-                || oldMusicSheet != null && oldMusicSheet.getAuditStatus().equals(AuthStatusEnum.DOING) && musicSheetDto.getSourceType().equals(SourceTypeEnum.TEACHER)) {
+        if ((musicSheetDto.getId() != null && musicSheetDto.getSourceType().equals(SourceTypeEnum.PLATFORM))
+                || ( oldMusicSheet != null && oldMusicSheet.getAuditStatus().equals(AuthStatusEnum.DOING)
+                && musicSheetDto.getSourceType().equals(SourceTypeEnum.TEACHER))) {
             musicSheetAccompanimentService.delByMusicSheetId(musicSheetDto.getId());
         }
 

+ 4 - 2
cooleshow-user/user-biz/src/main/resources/config/mybatis/CouponInfoMapper.xml

@@ -165,11 +165,13 @@
             </when>
             <when test="inOrOut.code == 'OUT'">
                 - #{size}
-                where inventory_ - #{size} &gt;= 0
             </when>
         </choose>
         <where>
-            id_ = #{couponId}
+            <if  test="inOrOut.code == 'OUT'">
+                and inventory_ - #{size} &gt;= 0
+            </if>
+            and id_ = #{couponId}
         </where>
     </update>