Commit 1ddc1457 by 李传峰

Merge branch 'feature/1008854' into 'release'

Feature/1008854

See merge request rays/pcloud-book!1694
parents 5f2b708d 9514e7d9
......@@ -28,6 +28,28 @@ public class BookAuthServerDTO implements Serializable {
@ApiModelProperty("服务标识")
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(){
return null == bookId || null == channelId || null == adviserId || CollectionUtils.isEmpty(serveIds);
}
......
......@@ -9,11 +9,14 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
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.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
import java.util.Map;
/**
......@@ -45,4 +48,8 @@ public interface BookAuthServeService {
ResponseEntity<ResponseDto<Map<String, Boolean>>> listIsOpen4AuthorizedPay(@RequestBody BookAuthServerDTO bookAuthServerDTO)
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;
import com.pcloud.channelcenter.qrcode.dto.OwnMessageDTO;
import com.pcloud.channelcenter.qrcode.dto.QrcodeMessageDTO;
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.QrcodeTemp;
import com.pcloud.channelcenter.qrcode.service.QrcodeLocationAssocService;
......@@ -779,4 +780,17 @@ public class QrcodeSceneConsr {
}
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;
import com.pcloud.book.copyright.dto.BookAuthServerDTO;
import com.pcloud.book.copyright.vo.ServeVO;
import java.util.List;
......@@ -55,4 +56,6 @@ public interface BookAuthServeBiz {
* 获取图书是否开启授权后仍需付费
*/
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;
import com.pcloud.book.consumer.resource.ProductConsr;
import com.pcloud.book.copyright.biz.BookAuthServeBiz;
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.entity.BookAuthServe;
import com.pcloud.book.copyright.vo.ServeVO;
......@@ -183,4 +184,9 @@ public class BookAuthServeBizImpl implements BookAuthServeBiz {
}
return null;
}
@Override
public List<BookAuthServerDTO> getBookAuthServeList(Long channelId) {
return CollUtil.defaultIfEmpty(bookAuthServeDao.getBookAuthServeList(channelId), CollUtil.toList());
}
}
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.entity.BookAuthServe;
import com.pcloud.book.copyright.vo.ServeVO;
......@@ -38,4 +39,6 @@ public interface BookAuthServeDao extends BaseDao<BookAuthServe> {
* 获取需要删除的数据
*/
List<Long> selectNeedDelete(Long bookId, Long channelId, Long adviserId);
List<BookAuthServerDTO> getBookAuthServeList(Long channelId);
}
package com.pcloud.book.copyright.dao.impl;
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.entity.BookAuthServe;
import com.pcloud.book.copyright.vo.ServeVO;
......@@ -60,4 +61,11 @@ public class BookAuthServeDaoImpl extends BaseDaoImpl<BookAuthServe> implements
paramMap.put("adviserId", adviserId);
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;
import cn.hutool.core.collection.CollUtil;
import com.pcloud.book.book.dto.BookAuthServeStatusParam;
import com.pcloud.book.copyright.biz.BookAuthServeBiz;
import com.pcloud.book.copyright.dto.BookAuthServerDTO;
......@@ -10,11 +11,14 @@ import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.utils.ResponseHandleUtil;
import org.springframework.beans.factory.annotation.Autowired;
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.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
......@@ -68,4 +72,13 @@ public class BookAuthServeServiceImpl implements BookAuthServeService {
}
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;
import com.pcloud.channelcenter.qrcode.dto.BookSceneIdListDTO;
import com.pcloud.channelcenter.qrcode.dto.GroupQrcodeVO;
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.QrcodeTemp;
import com.pcloud.channelcenter.wechat.dto.AccountSettingDto;
......@@ -3261,6 +3262,9 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
itemVO.setTypeCode(s.getTypeCode());
itemVO.setSceneId(s.getSceneId());
itemVO.setResourcePageId(s.getResourcePageId());
itemVO.setSelfBigPic(s.getSelfBigPic());
itemVO.setSelfSmallPic(s.getSelfSmallPic());
itemVO.setSelfServeName(s.getSelfServeName());
itemVOS.add(itemVO);
});
fillAppProductServe(itemVOS, null);
......@@ -3273,7 +3277,7 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
serveDTO.setServeUrl(itemVO.getLinkUrl());
serveDTO.setTypeCode(itemVO.getTypeCode());
serveDTO.setServeName(itemVO.getServeName());
serveDTO.setPicUrl(itemVO.getServePic());
serveDTO.setPicUrl(StrUtil.isNotBlank(itemVO.getSelfSmallPic()) ? itemVO.getSelfSmallPic() : itemVO.getServePic());
serveDTO.setTransverseImg(itemVO.getTransverseImg());
serveDTO.setTypeName(itemVO.getTypeName());
serveDTO.setSceneId(itemVO.getSceneId());
......@@ -5170,6 +5174,11 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
if (MapUtils.isEmpty(resourceDTOMap)) {
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<>();
for (ResourcePageItemResourceVO vo:list) {
ResourceDTO dto = resourceDTOMap.get(vo.getServeId());
......@@ -5187,8 +5196,10 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
vo.setConvertState(dto.getConvertState());
vo.setResourceOfficeItemDTOs(dto.getResourceOfficeItemDTOs());
vo.setResourcePdfItems(dto.getResourcePdfItems());
vo.setSceneId(vo.getSceneId());
resourceVOS.add(vo);
}
resourceVOS.sort(Comparator.nullsFirst(Comparator.comparing(x-> qrcodeSorts.indexOf(x.getSceneId()))));
return resourceVOS;
}
......
......@@ -76,4 +76,13 @@ public class BookGroupServe extends BaseEntity {
private Long resourcePageId;
@ApiModelProperty("自定义图")
private String selfBigPic;
@ApiModelProperty("自定义图")
private String selfSmallPic;
@ApiModelProperty("自定义名称")
private String selfServeName;
}
......@@ -45,6 +45,7 @@ public class ResourcePageItemResourceVO extends BaseDto {
private String selfServeName;
private Long sceneId;
private String typeName;
private String resourceName;
......
......@@ -93,4 +93,13 @@
IS_DELETE = 0
</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>
\ No newline at end of file
......@@ -249,6 +249,9 @@
p.create_user createUser,
i.type_code typeCode,
p.scene_id sceneId,
i.self_big_pic selfBigPic,
i.self_small_pic selfSmallPic,
i.self_serve_name selfServeName,
i.resource_page_id resourcePageId
FROM
resource_page_item i
......@@ -503,7 +506,8 @@
i.type_code typeCode,
i.self_big_pic selfBigPic,
i.self_small_pic selfSmallPic,
i.self_serve_name selfServeName
i.self_serve_name selfServeName,
p.scene_id sceneId
FROM
resource_page_item i
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