Commit 3fc80bba by 吴博

feat: [1003839] 已购引导

parent 3f7411cd
......@@ -290,4 +290,13 @@ public interface BookAdviserBiz {
PageBeanNew<AgentBookStatsDetailVO> getAgentBookStatsDetail(Long agentId, String name, Date startDate, Date endDate, Integer isRay, Integer currentPage, Integer numPerPage);
void exportAgentBookStatsDetail(Long agentId, String name, Date startDate, Date endDate, Integer isRay);
/**
* 购书流程获取书籍基本信息
* @param bookId
* @param adviserId
* @param channelId
* @return
*/
BookDto getBookDetail4Buy(Long bookId, Long adviserId, Long channelId);
}
......@@ -699,4 +699,15 @@ public interface BookBiz {
Long getDefaultRightsSettingId();
void clearCache4BookBaseInfo(String pwd);
/**
* 获取书籍基本信息
* @param bookId
* @param adviserId
* @param channelId
* @return
*/
BookDto getBaseById4Buy(Long bookId, Long adviserId, Long channelId);
void fillAgentSale(List<BookDto> bookDtos);
}
......@@ -1912,6 +1912,17 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
});
}
@Override
@ParamLog("购书流程获取书籍基本信息")
public BookDto getBookDetail4Buy(Long bookId, Long adviserId, Long channelId) {
BookDto bookDto = bookBiz.getBaseById4Buy(bookId, adviserId, channelId);
if (null == bookDto) {
return new BookDto();
}
bookBiz.fillAgentSale(Lists.newArrayList(bookDto));
return bookDto;
}
public void sendMsg4ExportAgentBookStatsDetail(String agentName, long data, String url, Date sendDate) {
LOGGER.info("发送出版社做书明细导出Excel完成站内信【Start】data=" + data + "url=" + url);
String letterType = "pcloud_book_download";
......
......@@ -2507,7 +2507,8 @@ public class BookBizImpl implements BookBiz {
return page;
}
private void fillAgentSale(List<BookDto> bookDtos) {
@Override
public void fillAgentSale(List<BookDto> bookDtos) {
if (ListUtils.isEmpty(bookDtos)) {
return;
}
......@@ -3275,6 +3276,39 @@ public class BookBizImpl implements BookBiz {
}
}
@Override
public BookDto getBaseById4Buy(Long bookId, Long adviserId, Long channelId) {
if (bookId == null) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "bookId 不能为空");
}
BookDto bookDto = null;
if(channelId != null && adviserId != null){
Map<String, Object> paramMap = Maps.newHashMap();
paramMap.put("bookId", bookId);
paramMap.put("adviserId", adviserId);
paramMap.put("channelId", channelId);
bookDto = bookDao.getBaseById4Buy(paramMap);
bookDto.setAdviserId(adviserId);
bookDto.setChannelId(channelId);
Long agentId = adviserConsr.getAgentIdByAdviser(adviserId);
Map<Long, String> agentNameMap = agentConsr.getNames(Collections.singletonList(agentId));
if (!MapUtils.isEmpty(agentNameMap) && agentNameMap.containsKey(agentId)) {
bookDto.setAgentName(agentNameMap.get(agentId));
bookDto.setAgentId(agentId);
}
} else {
// 从redis获取书籍信息
bookDto = bookCache.getBookToRedis(bookId);
if (null == bookDto) {
bookDto = bookDao.getBaseById(bookId);
// 将数据存入redis
bookCache.setBookToRedis(bookDto);
}
}
return bookDto == null ? new BookDto() : bookDto;
}
/**
* 查询社群书二维码信息
*/
......
......@@ -360,4 +360,6 @@ public interface BookDao extends BaseDao<Book> {
void updateByPrimaryKeySelective(Book book);
Integer checkIsGroupBook(Long bookId);
BookDto getBaseById4Buy(Map<String, Object> paramMap);
}
......@@ -410,4 +410,9 @@ public class BookDaoImpl extends BaseDaoImpl<Book> implements BookDao {
public Integer checkIsGroupBook(Long bookId) {
return getSqlSession().selectOne(getStatement("checkIsGroupBook"), MapUtil.of("bookId", bookId));
}
@Override
public BookDto getBaseById4Buy(Map<String, Object> paramMap) {
return getSqlSession().selectOne(getStatement("getBaseById4Buy"),paramMap);
}
}
......@@ -11,6 +11,7 @@ import com.pcloud.book.book.dto.AdviserManageDto;
import com.pcloud.book.book.dto.BookAdviserDto;
import com.pcloud.book.book.dto.BookCountDto;
import com.pcloud.book.book.dto.BookDataStatisticsDTO;
import com.pcloud.book.book.dto.BookDto;
import com.pcloud.book.book.dto.BookQrcodeStatisticsDTO;
import com.pcloud.book.book.dto.BookResourceStatisticsDTO;
import com.pcloud.book.book.dto.MapResourceTotalCountDTO;
......@@ -26,9 +27,14 @@ import com.pcloud.common.page.PageBeanNew;
import com.pcloud.common.permission.PermissionException;
import com.pcloud.common.utils.ParamChecker;
import com.pcloud.common.utils.SessionUtil;
import com.pcloud.common.utils.cookie.Cookie;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.codehaus.jackson.JsonParseException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -311,4 +317,22 @@ public class BookAdviserFacadeImpl implements BookAdviserFacade {
return new ResponseDto<>();
}
@ApiOperation(value = "丢书页面获取书刊及商铺信息", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "userInfo", value = "Cookie", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "bookId", value = "书籍标识", dataType = "long", paramType = "query"),
@ApiImplicitParam(name = "channelId", value = "渠道标识", dataType = "long", paramType = "query"),
@ApiImplicitParam(name = "adviserId", value = "编辑标识", dataType = "long", paramType = "query")})
@RequestMapping(value = "getBookDetail4Buy", method = RequestMethod.GET)
ResponseDto<BookDto> getBookDetail4Buy(@CookieValue("userInfo") String userInfo,
@RequestParam(value = "bookId") Long bookId,
@RequestParam(value = "channelId") Long channelId,
@RequestParam(value = "adviserId") Long adviserId)
throws BizException, PermissionException, JsonParseException{
Cookie.getUserInfo(userInfo);
BookDto bookDto = bookAdviserBiz.getBookDetail4Buy(bookId, adviserId, channelId);
return new ResponseDto<>(bookDto);
}
}
......@@ -2548,4 +2548,50 @@
book_id = #{bookId}
AND is_delete = 0
</select>
<select id="getBaseById4Buy" parameterType="map" resultMap="bookMap">
select
B.BOOK_ID,
B.TYPE_CODE,
B.ISBN,
B.BOOK_NAME,
B.REMARK,
B.AUTHOR,
B.PUBLISH,
B.PUBLISH_DATE,
B.COVER_IMG,
B.AD_IMG,
B.DETAIL,
B.`VERSION`,
B.BOOK_PRICE,
B.ISSN,
B.SERIAL_NUMBER,
BA.IS_MAIN_EDITOR,
BA.TEMPLET_ID,
BA.SECOND_TEMPLET_ID,
BA.GRA_LABEL_ID,
BA.SUB_LABEL_ID,
BA.VER_LABEL_ID,
BA.AREA_LABEL_ID,
BA.IS_PRINT isPrint,
BA.pro_label_id,
BA.dep_label_id,
BA.pur_label_id,
BA.vol_label_id,
BA.is_open_robot_process,
B.unique_number,
BA.CREATED_DATE
from
book B
left join book_adviser BA on B.book_id = BA.book_id
where
B.book_id = #{bookId}
<if test="adviserId != null">
and BA.adviser_id = #{adviserId}
</if>
<if test="channelId != null">
and BA.channel_id = #{channelId}
</if>
limit 1
</select>
</mapper>
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