Commit 9514e7d9 by 郑永强

feat: [1008854] 编辑运营需求(一书多码、音频应用、运营端知识商城)

parent ce5399d8
...@@ -28,6 +28,28 @@ public class BookAuthServerDTO implements Serializable { ...@@ -28,6 +28,28 @@ public class BookAuthServerDTO implements Serializable {
@ApiModelProperty("服务标识") @ApiModelProperty("服务标识")
private List<Long> serveIds; private List<Long> serveIds;
@ApiModelProperty("服务id")
private Long serveId;
@ApiModelProperty("服务标识")
private String serveType;
public Long getServeId() {
return serveId;
}
public void setServeId(Long serveId) {
this.serveId = serveId;
}
public String getServeType() {
return serveType;
}
public void setServeType(String serveType) {
this.serveType = serveType;
}
public Boolean check(){ public Boolean check(){
return null == bookId || null == channelId || null == adviserId || CollectionUtils.isEmpty(serveIds); return null == bookId || null == channelId || null == adviserId || CollectionUtils.isEmpty(serveIds);
} }
......
...@@ -9,11 +9,14 @@ import io.swagger.annotations.Api; ...@@ -9,11 +9,14 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
...@@ -45,4 +48,8 @@ public interface BookAuthServeService { ...@@ -45,4 +48,8 @@ public interface BookAuthServeService {
ResponseEntity<ResponseDto<Map<String, Boolean>>> listIsOpen4AuthorizedPay(@RequestBody BookAuthServerDTO bookAuthServerDTO) ResponseEntity<ResponseDto<Map<String, Boolean>>> listIsOpen4AuthorizedPay(@RequestBody BookAuthServerDTO bookAuthServerDTO)
throws BizException; throws BizException;
@ApiOperation("获取渠道下的版权保护资源")
@GetMapping("getBookAuthServeList")
ResponseEntity<ResponseDto<List<BookAuthServerDTO>>> getBookAuthServeList(@RequestParam("channelId") Long channelId);
} }
...@@ -16,6 +16,7 @@ import com.pcloud.channelcenter.qrcode.dto.MapResourceCountDTO; ...@@ -16,6 +16,7 @@ import com.pcloud.channelcenter.qrcode.dto.MapResourceCountDTO;
import com.pcloud.channelcenter.qrcode.dto.OwnMessageDTO; import com.pcloud.channelcenter.qrcode.dto.OwnMessageDTO;
import com.pcloud.channelcenter.qrcode.dto.QrcodeMessageDTO; import com.pcloud.channelcenter.qrcode.dto.QrcodeMessageDTO;
import com.pcloud.channelcenter.qrcode.dto.QrcodeSceneDto; import com.pcloud.channelcenter.qrcode.dto.QrcodeSceneDto;
import com.pcloud.channelcenter.qrcode.dto.QrcodeSortDTO;
import com.pcloud.channelcenter.qrcode.entity.QrcodeScene; import com.pcloud.channelcenter.qrcode.entity.QrcodeScene;
import com.pcloud.channelcenter.qrcode.entity.QrcodeTemp; import com.pcloud.channelcenter.qrcode.entity.QrcodeTemp;
import com.pcloud.channelcenter.qrcode.service.QrcodeLocationAssocService; import com.pcloud.channelcenter.qrcode.service.QrcodeLocationAssocService;
...@@ -779,4 +780,17 @@ public class QrcodeSceneConsr { ...@@ -779,4 +780,17 @@ public class QrcodeSceneConsr {
} }
return new HashMap<>(); return new HashMap<>();
} }
@ParamLog("获取二维码排序列表")
public List<QrcodeSortDTO> getQrcodeSortList(List<Long> sceneIds) {
try {
if(CollUtil.isEmpty(sceneIds)) {
return new ArrayList<>();
}
return ResponseHandleUtil.parseList(qrcodeSceneService.getQrcodeSortList(sceneIds), QrcodeSortDTO.class);
} catch (Exception e) {
LOGGER.error("获取二维码排序列表[qrcodeSceneService.getQrcodeSortList]调用失败:{}", e.getMessage(), e);
}
return new ArrayList<>();
}
} }
package com.pcloud.book.copyright.biz; package com.pcloud.book.copyright.biz;
import com.pcloud.book.copyright.dto.BookAuthServerDTO;
import com.pcloud.book.copyright.vo.ServeVO; import com.pcloud.book.copyright.vo.ServeVO;
import java.util.List; import java.util.List;
...@@ -55,4 +56,6 @@ public interface BookAuthServeBiz { ...@@ -55,4 +56,6 @@ public interface BookAuthServeBiz {
* 获取图书是否开启授权后仍需付费 * 获取图书是否开启授权后仍需付费
*/ */
Map<String, Boolean> listIsOpen4AuthorizedPay(Long bookId, Long adviserId, Long channelId, List<Long> serveIds); Map<String, Boolean> listIsOpen4AuthorizedPay(Long bookId, Long adviserId, Long channelId, List<Long> serveIds);
List<BookAuthServerDTO> getBookAuthServeList(Long channelId);
} }
...@@ -10,6 +10,7 @@ import com.pcloud.book.consumer.channel.QrcodeSceneConsr; ...@@ -10,6 +10,7 @@ import com.pcloud.book.consumer.channel.QrcodeSceneConsr;
import com.pcloud.book.consumer.resource.ProductConsr; import com.pcloud.book.consumer.resource.ProductConsr;
import com.pcloud.book.copyright.biz.BookAuthServeBiz; import com.pcloud.book.copyright.biz.BookAuthServeBiz;
import com.pcloud.book.copyright.dao.BookAuthServeDao; import com.pcloud.book.copyright.dao.BookAuthServeDao;
import com.pcloud.book.copyright.dto.BookAuthServerDTO;
import com.pcloud.book.copyright.dto.ServeDTO; import com.pcloud.book.copyright.dto.ServeDTO;
import com.pcloud.book.copyright.entity.BookAuthServe; import com.pcloud.book.copyright.entity.BookAuthServe;
import com.pcloud.book.copyright.vo.ServeVO; import com.pcloud.book.copyright.vo.ServeVO;
...@@ -183,4 +184,9 @@ public class BookAuthServeBizImpl implements BookAuthServeBiz { ...@@ -183,4 +184,9 @@ public class BookAuthServeBizImpl implements BookAuthServeBiz {
} }
return null; return null;
} }
@Override
public List<BookAuthServerDTO> getBookAuthServeList(Long channelId) {
return CollUtil.defaultIfEmpty(bookAuthServeDao.getBookAuthServeList(channelId), CollUtil.toList());
}
} }
package com.pcloud.book.copyright.dao; package com.pcloud.book.copyright.dao;
import com.pcloud.book.copyright.dto.BookAuthServerDTO;
import com.pcloud.book.copyright.dto.ServeDTO; import com.pcloud.book.copyright.dto.ServeDTO;
import com.pcloud.book.copyright.entity.BookAuthServe; import com.pcloud.book.copyright.entity.BookAuthServe;
import com.pcloud.book.copyright.vo.ServeVO; import com.pcloud.book.copyright.vo.ServeVO;
...@@ -38,4 +39,6 @@ public interface BookAuthServeDao extends BaseDao<BookAuthServe> { ...@@ -38,4 +39,6 @@ public interface BookAuthServeDao extends BaseDao<BookAuthServe> {
* 获取需要删除的数据 * 获取需要删除的数据
*/ */
List<Long> selectNeedDelete(Long bookId, Long channelId, Long adviserId); List<Long> selectNeedDelete(Long bookId, Long channelId, Long adviserId);
List<BookAuthServerDTO> getBookAuthServeList(Long channelId);
} }
package com.pcloud.book.copyright.dao.impl; package com.pcloud.book.copyright.dao.impl;
import com.pcloud.book.copyright.dao.BookAuthServeDao; import com.pcloud.book.copyright.dao.BookAuthServeDao;
import com.pcloud.book.copyright.dto.BookAuthServerDTO;
import com.pcloud.book.copyright.dto.ServeDTO; import com.pcloud.book.copyright.dto.ServeDTO;
import com.pcloud.book.copyright.entity.BookAuthServe; import com.pcloud.book.copyright.entity.BookAuthServe;
import com.pcloud.book.copyright.vo.ServeVO; import com.pcloud.book.copyright.vo.ServeVO;
...@@ -60,4 +61,11 @@ public class BookAuthServeDaoImpl extends BaseDaoImpl<BookAuthServe> implements ...@@ -60,4 +61,11 @@ public class BookAuthServeDaoImpl extends BaseDaoImpl<BookAuthServe> implements
paramMap.put("adviserId", adviserId); paramMap.put("adviserId", adviserId);
return this.getSqlSession().selectList(this.getStatement("selectNeedDelete"), paramMap); return this.getSqlSession().selectList(this.getStatement("selectNeedDelete"), paramMap);
} }
@Override
public List<BookAuthServerDTO> getBookAuthServeList(Long channelId) {
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("channelId", channelId);
return this.getSqlSession().selectList(this.getStatement("getBookAuthServeList"), paramMap);
}
} }
package com.pcloud.book.copyright.service.impl; package com.pcloud.book.copyright.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.pcloud.book.book.dto.BookAuthServeStatusParam; import com.pcloud.book.book.dto.BookAuthServeStatusParam;
import com.pcloud.book.copyright.biz.BookAuthServeBiz; import com.pcloud.book.copyright.biz.BookAuthServeBiz;
import com.pcloud.book.copyright.dto.BookAuthServerDTO; import com.pcloud.book.copyright.dto.BookAuthServerDTO;
...@@ -10,11 +11,14 @@ import com.pcloud.common.exceptions.BizException; ...@@ -10,11 +11,14 @@ import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.utils.ResponseHandleUtil; import com.pcloud.common.utils.ResponseHandleUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
...@@ -68,4 +72,13 @@ public class BookAuthServeServiceImpl implements BookAuthServeService { ...@@ -68,4 +72,13 @@ public class BookAuthServeServiceImpl implements BookAuthServeService {
} }
return ResponseHandleUtil.toResponse(isOpen4ServeIds); return ResponseHandleUtil.toResponse(isOpen4ServeIds);
} }
@Override
@GetMapping("getBookAuthServeList")
public ResponseEntity<ResponseDto<List<BookAuthServerDTO>>> getBookAuthServeList(@RequestParam("channelId") Long channelId) {
if(channelId == null) {
return ResponseHandleUtil.toResponse(CollUtil.toList());
}
return ResponseHandleUtil.toResponse(bookAuthServeBiz.getBookAuthServeList(channelId));
}
} }
...@@ -154,6 +154,7 @@ import com.pcloud.channelcenter.base.constants.MessageFromTypeEnum; ...@@ -154,6 +154,7 @@ import com.pcloud.channelcenter.base.constants.MessageFromTypeEnum;
import com.pcloud.channelcenter.qrcode.dto.BookSceneIdListDTO; import com.pcloud.channelcenter.qrcode.dto.BookSceneIdListDTO;
import com.pcloud.channelcenter.qrcode.dto.GroupQrcodeVO; import com.pcloud.channelcenter.qrcode.dto.GroupQrcodeVO;
import com.pcloud.channelcenter.qrcode.dto.QrcodeSceneDto; import com.pcloud.channelcenter.qrcode.dto.QrcodeSceneDto;
import com.pcloud.channelcenter.qrcode.dto.QrcodeSortDTO;
import com.pcloud.channelcenter.qrcode.entity.NftBookState; import com.pcloud.channelcenter.qrcode.entity.NftBookState;
import com.pcloud.channelcenter.qrcode.entity.QrcodeTemp; import com.pcloud.channelcenter.qrcode.entity.QrcodeTemp;
import com.pcloud.channelcenter.wechat.dto.AccountSettingDto; import com.pcloud.channelcenter.wechat.dto.AccountSettingDto;
...@@ -3261,6 +3262,9 @@ public class ResourcePageBizImpl implements ResourcePageBiz { ...@@ -3261,6 +3262,9 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
itemVO.setTypeCode(s.getTypeCode()); itemVO.setTypeCode(s.getTypeCode());
itemVO.setSceneId(s.getSceneId()); itemVO.setSceneId(s.getSceneId());
itemVO.setResourcePageId(s.getResourcePageId()); itemVO.setResourcePageId(s.getResourcePageId());
itemVO.setSelfBigPic(s.getSelfBigPic());
itemVO.setSelfSmallPic(s.getSelfSmallPic());
itemVO.setSelfServeName(s.getSelfServeName());
itemVOS.add(itemVO); itemVOS.add(itemVO);
}); });
fillAppProductServe(itemVOS, null); fillAppProductServe(itemVOS, null);
...@@ -3273,7 +3277,7 @@ public class ResourcePageBizImpl implements ResourcePageBiz { ...@@ -3273,7 +3277,7 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
serveDTO.setServeUrl(itemVO.getLinkUrl()); serveDTO.setServeUrl(itemVO.getLinkUrl());
serveDTO.setTypeCode(itemVO.getTypeCode()); serveDTO.setTypeCode(itemVO.getTypeCode());
serveDTO.setServeName(itemVO.getServeName()); serveDTO.setServeName(itemVO.getServeName());
serveDTO.setPicUrl(itemVO.getServePic()); serveDTO.setPicUrl(StrUtil.isNotBlank(itemVO.getSelfSmallPic()) ? itemVO.getSelfSmallPic() : itemVO.getServePic());
serveDTO.setTransverseImg(itemVO.getTransverseImg()); serveDTO.setTransverseImg(itemVO.getTransverseImg());
serveDTO.setTypeName(itemVO.getTypeName()); serveDTO.setTypeName(itemVO.getTypeName());
serveDTO.setSceneId(itemVO.getSceneId()); serveDTO.setSceneId(itemVO.getSceneId());
...@@ -5170,6 +5174,11 @@ public class ResourcePageBizImpl implements ResourcePageBiz { ...@@ -5170,6 +5174,11 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
if (MapUtils.isEmpty(resourceDTOMap)) { if (MapUtils.isEmpty(resourceDTOMap)) {
return new ArrayList<>(); return new ArrayList<>();
} }
// 获取二维码信息(排序属性)
List<Long> sceneIds = list.stream().map(ResourcePageItemResourceVO::getSceneId).distinct().collect(Collectors.toList());
List<QrcodeSortDTO> qrcodeSortList = qrcodeSceneConsr.getQrcodeSortList(sceneIds);
List<Long> qrcodeSorts = qrcodeSortList.stream().map(x -> x.getSceneId()).collect(Collectors.toList());
List<ResourcePageItemResourceVO> resourceVOS = new ArrayList<>(); List<ResourcePageItemResourceVO> resourceVOS = new ArrayList<>();
for (ResourcePageItemResourceVO vo:list) { for (ResourcePageItemResourceVO vo:list) {
ResourceDTO dto = resourceDTOMap.get(vo.getServeId()); ResourceDTO dto = resourceDTOMap.get(vo.getServeId());
...@@ -5187,8 +5196,10 @@ public class ResourcePageBizImpl implements ResourcePageBiz { ...@@ -5187,8 +5196,10 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
vo.setConvertState(dto.getConvertState()); vo.setConvertState(dto.getConvertState());
vo.setResourceOfficeItemDTOs(dto.getResourceOfficeItemDTOs()); vo.setResourceOfficeItemDTOs(dto.getResourceOfficeItemDTOs());
vo.setResourcePdfItems(dto.getResourcePdfItems()); vo.setResourcePdfItems(dto.getResourcePdfItems());
vo.setSceneId(vo.getSceneId());
resourceVOS.add(vo); resourceVOS.add(vo);
} }
resourceVOS.sort(Comparator.nullsFirst(Comparator.comparing(x-> qrcodeSorts.indexOf(x.getSceneId()))));
return resourceVOS; return resourceVOS;
} }
......
...@@ -76,4 +76,13 @@ public class BookGroupServe extends BaseEntity { ...@@ -76,4 +76,13 @@ public class BookGroupServe extends BaseEntity {
private Long resourcePageId; private Long resourcePageId;
@ApiModelProperty("自定义图")
private String selfBigPic;
@ApiModelProperty("自定义图")
private String selfSmallPic;
@ApiModelProperty("自定义名称")
private String selfServeName;
} }
...@@ -45,6 +45,7 @@ public class ResourcePageItemResourceVO extends BaseDto { ...@@ -45,6 +45,7 @@ public class ResourcePageItemResourceVO extends BaseDto {
private String selfServeName; private String selfServeName;
private Long sceneId;
private String typeName; private String typeName;
private String resourceName; private String resourceName;
......
...@@ -93,4 +93,13 @@ ...@@ -93,4 +93,13 @@
IS_DELETE = 0 IS_DELETE = 0
</select> </select>
<select id="getBookAuthServeList" resultType="com.pcloud.book.copyright.dto.BookAuthServerDTO">
SELECT DISTINCT b.serve_id serveId, b.serve_type serveType
FROM `book_auth_info` a
INNER JOIN book_auth_serve b ON b.book_id = a.book_id AND b. channel_id = a.channel_id AND b.adviser_id = a.adviser_id
WHERE a.book_status = 1
AND b.is_delete = 0
AND a.channel_id = #{channelId}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -249,6 +249,9 @@ ...@@ -249,6 +249,9 @@
p.create_user createUser, p.create_user createUser,
i.type_code typeCode, i.type_code typeCode,
p.scene_id sceneId, p.scene_id sceneId,
i.self_big_pic selfBigPic,
i.self_small_pic selfSmallPic,
i.self_serve_name selfServeName,
i.resource_page_id resourcePageId i.resource_page_id resourcePageId
FROM FROM
resource_page_item i resource_page_item i
...@@ -503,7 +506,8 @@ ...@@ -503,7 +506,8 @@
i.type_code typeCode, i.type_code typeCode,
i.self_big_pic selfBigPic, i.self_big_pic selfBigPic,
i.self_small_pic selfSmallPic, i.self_small_pic selfSmallPic,
i.self_serve_name selfServeName i.self_serve_name selfServeName,
p.scene_id sceneId
FROM FROM
resource_page_item i resource_page_item i
LEFT JOIN resource_page p ON i.resource_page_id = p.id LEFT JOIN resource_page p ON i.resource_page_id = p.id
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment