Bläddra i källkod

Merge branch 'feature/0826_music' into test

liujc 10 månader sedan
förälder
incheckning
36a0169dea

+ 2 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/MusicSheetDao.java

@@ -223,4 +223,6 @@ public interface MusicSheetDao extends BaseMapper<MusicSheet> {
     void tenantInsert(@Param("item") CbsMusicSheetApplicationExtendWrapper.MusicSheetApplicationExtend extend);
 
     void platformInsert(@Param("item") CbsMusicSheetApplicationExtendWrapper.MusicSheetApplicationExtend extend);
+
+    void updateState(@Param("ids") String ids);
 }

+ 1 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/CbsMusicSheetServiceImpl.java

@@ -128,6 +128,7 @@ public class CbsMusicSheetServiceImpl implements CbsMusicSheetService {
             musicSheetService.getDao().batchEnable(updateMusicSheet.getIds(),updateMusicSheet.getStatus(),true);
         } else {
             musicSheetService.getDao().batchEnable(updateMusicSheet.getIds(),updateMusicSheet.getStatus(),false);
+            musicSheetService.getDao().updateState(updateMusicSheet.getIds());
         }
         return true;
     }

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

@@ -310,7 +310,7 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
         CbsMusicSheetWrapper.MusicSheetApplication musicSheetApplication = rows.get(0);
         CbsMusicSheetApplicationExtendClientWrapper.MusicSheetApplicationExtendStatus extendStatus = new CbsMusicSheetApplicationExtendClientWrapper.MusicSheetApplicationExtendStatus();
         extendStatus.setIds(musicSheetApplication.getApplicationExtendId().toString());
-        extendStatus.setStatus(musicSheet.getState()!=YesOrNoEnum.YES);
+        extendStatus.setStatus(!musicSheet.getClientState());
         R<JSONObject> jsonObjectR = musicFeignClientService.musicSheetApplicationExtendStatus(extendStatus);
         if (jsonObjectR.getCode() != 200) {
             throw new BizException("修改曲目状态失败,{}", jsonObjectR.getMessage());

+ 9 - 3
cooleshow-user/user-biz/src/main/resources/config/mybatis/MusicSheetMapper.xml

@@ -1000,7 +1000,6 @@
                 tenant_state_ = #{status},
             </if>
             <if test="tenantFlag == 0">
-                state_ = #{status},
                 client_state_ = #{status}
             </if>
         </set>
@@ -1185,6 +1184,8 @@
     <update id="updatePlatformByCbsId">
         update music_sheet ms set
         ms.music_tag_ = #{item.musicTagIds},ms.payment_type_ = #{item.paymentType},
+        ms.first_pass_audit_time_ = IF((#{item.musicSheetUpdate.sourceType} = 'PERSON' and ms.first_pass_audit_time_ is null) or !find_in_set('PLATFORM',ms.provider_type_),
+        now(), ms.first_pass_audit_time_),
         ms.charge_type_ = #{item.paymentType},
         ms.music_price_ = #{item.musicPrice},ms.top_flag_ = #{item.topFlag},
         ms.exquisite_flag_ = #{item.exquisiteFlag},ms.sort_number_ = #{item.sortNo},ms.del_flag_ = 0,
@@ -1211,8 +1212,7 @@
             ms.show_fingering_ = #{item.musicSheetUpdate.showFingering},
             ms.can_evaluate_ = #{item.musicSheetUpdate.canEvaluate},
             ms.source_type_ = CASE WHEN #{item.musicSheetUpdate.sourceType} = 'PLATFORM' THEN 'PLATFORM'
-            WHEN #{item.musicSheetUpdate.sourceType} = 'PERSON' THEN 'TEACHER' ELSE 'TENANT' END,
-            ms.first_pass_audit_time_ = IF(#{item.musicSheetUpdate.sourceType} = 'PERSON' and ms.first_pass_audit_time_ is null, now(), ms.first_pass_audit_time_)
+            WHEN #{item.musicSheetUpdate.sourceType} = 'PERSON' THEN 'TEACHER' ELSE 'TENANT' END
         </if>
         where ms.cbs_music_sheet_id_ = #{item.musicSheetId}
     </update>
@@ -1285,5 +1285,11 @@
         now()
         )
     </insert>
+
+    <update id="updateState">
+        update music_sheet
+        set state_ = client_state_ and platform_state_
+        where FIND_IN_SET(cbs_music_sheet_id_,#{ids})
+    </update>
     <!--单曲专辑数量统计-->
 </mapper>