Ver código fonte

Merge branch 'dev_v1.3.5_20220929' into dev_v1.3.5_20220927

Eric 2 anos atrás
pai
commit
802d5954e2

+ 5 - 5
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/MusicAlbumSearch.java

@@ -58,17 +58,17 @@ public class MusicAlbumSearch extends QueryInfo{
     private Long musicId;
 
     @ApiModelProperty(value = "收费类型(FREE:免费;VIP:会员;CHARGE:单曲收费)")
-    private ChargeTypeEnum chargeType;  //收费类型(0:免费;1:会员;2:单曲收费)
+    private ChargeTypeEnum paymentType;  //收费类型(0:免费;1:会员;2:单曲收费)
 
     @ApiModelProperty(hidden = true)
     private List<Long> subjectIdList;
 
-    public ChargeTypeEnum getChargeType() {
-        return chargeType;
+    public ChargeTypeEnum getPaymentType() {
+        return paymentType;
     }
 
-    public void setChargeType(ChargeTypeEnum chargeType) {
-        this.chargeType = chargeType;
+    public void setPaymentType(ChargeTypeEnum paymentType) {
+        this.paymentType = paymentType;
     }
 
     public Long getUserId() {

+ 7 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/MusicSheetService.java

@@ -101,6 +101,13 @@ public interface MusicSheetService extends IService<MusicSheet> {
     IPage<MusicSheetVo> selectStudentPage(IPage<MusicSheetVo> page, StudentMusicSheetSearch query, ClientEnum clientType);
 
     /**
+     * 更新曲目专辑数
+     * @param records List<MusicSheetVo>
+     * @return List<MusicSheetVo>
+     */
+    List<MusicSheetVo> updateMusicAlbumNumInfo(List<MusicSheetVo> records);
+
+    /**
      * 收藏/取消收藏 曲目
      *
      * @param userId 用户id , 学生id

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

@@ -221,6 +221,11 @@ public class ContractServiceImpl implements ContractService {
 
         Map<String, Object> params = new HashMap<>();
         String companyName = sysConfigService.findConfigValue(SysConfigConstant.COMPANY_NAME);
+        if (contractType.equals(ContractTemplateTypeEnum.REGISTER)) {
+            params.put("contractName", "用户注册协议");
+        } else {
+            params.put("contractName", "产品与服务协议");
+        }
         params.put("companyName", companyName);
         params.put("companySealPicture", sysConfigService.findConfigValue(SysConfigConstant.COMPANY_SEAL_PICTURE));
         params.put("contractMainContent", mainContent);

+ 12 - 4
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/MusicAlbumServiceImpl.java

@@ -150,10 +150,18 @@ public class MusicAlbumServiceImpl extends ServiceImpl<MusicAlbumDao,MusicAlbum>
 
         IPage<MusicSheetVo> musicSheetVoIPage = musicSheetService.selectAlbumDetailPage(page,query);
 
-        // 专辑曲目付费方式
-        List<String> paymentTypes = musicSheetVoIPage.getRecords().stream()
-                .flatMap(x -> Arrays.stream(x.getPaymentType().split(","))).distinct().collect(Collectors.toList());
-        albumDetailVo.setMusicPaymentTypes(paymentTypes);
+        List<MusicSheetVo> records = musicSheetVoIPage.getRecords();
+        if (CollectionUtils.isNotEmpty(records)) {
+
+            // 专辑曲目付费方式
+            List<String> paymentTypes = musicSheetVoIPage.getRecords().stream()
+                    .flatMap(x -> Arrays.stream(x.getPaymentType().split(","))).distinct().collect(Collectors.toList());
+            albumDetailVo.setMusicPaymentTypes(paymentTypes);
+
+            // 更新曲目专辑数量
+            musicSheetService.updateMusicAlbumNumInfo(records);
+        }
+
 
         albumDetailVo.setMusicSheetList(PageUtil.pageInfo(musicSheetVoIPage));
 

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

@@ -360,16 +360,7 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
         if (CollectionUtils.isNotEmpty(records)) {
 
             // 统计单曲归属专辑数
-            List<Long> musicIds = records.stream()
-                    .map(MusicSheet::getId).distinct().collect(Collectors.toList());
-
-            Map<Long, Integer> collect = getBaseMapper().selectMusicAlbumStatInfo(musicIds).stream()
-                    .collect(Collectors.toMap(StatGroupWrapper::getId, StatGroupWrapper::getTotal, (o, n) -> n));
-
-            for (MusicSheetVo item : records) {
-
-                item.setAlbumNums(collect.getOrDefault(item.getId(), 0));
-            }
+            updateMusicAlbumNumInfo(records);
         }
     	
     	/*if(query.getMyself() != null && query.getMyself() == false){//首页
@@ -396,6 +387,26 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
 
     }
 
+    /**
+     * 更新曲目专辑数
+     * @param records List<MusicSheetVo>
+     * @return List<MusicSheetVo>
+     */
+    public List<MusicSheetVo> updateMusicAlbumNumInfo(List<MusicSheetVo> records) {
+        List<Long> musicIds = records.stream()
+                .map(MusicSheet::getId).distinct().collect(Collectors.toList());
+
+        Map<Long, Integer> collect = getBaseMapper().selectMusicAlbumStatInfo(musicIds).stream()
+                .collect(Collectors.toMap(StatGroupWrapper::getId, StatGroupWrapper::getTotal, (o, n) -> n));
+
+        for (MusicSheetVo item : records) {
+
+            item.setAlbumNums(collect.getOrDefault(item.getId(), 0));
+        }
+
+        return records;
+    }
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public boolean setFavorite(Long userId, Long musicSheetId, ClientEnum clientType) {

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

@@ -85,8 +85,8 @@
             <if test="query.auditVersion != null">
                 and t.audit_version_ = #{query.auditVersion}
             </if>
-            <if test="query.chargeType != null">
-                and t.payment_type_ = #{query.chargeType}
+            <if test="query.paymentType != null">
+                and t.payment_type_ = #{query.paymentType}
             </if>
         </where>
         order by t.sort_number_ desc