Commit 4d43872b by 田超

Merge branch 'feature/getBookResource' into 'master'

feat: [none] getbookResource

See merge request rays/pcloud-book!945
parents c7c4b079 f2abd445
...@@ -557,11 +557,11 @@ public class AppletUserBookcaseBizImpl implements AppletUserBookcaseBiz { ...@@ -557,11 +557,11 @@ public class AppletUserBookcaseBizImpl implements AppletUserBookcaseBiz {
BookResourceExcelDTO bookResourceExcelDTO = new BookResourceExcelDTO(); BookResourceExcelDTO bookResourceExcelDTO = new BookResourceExcelDTO();
num = i + 2; num = i + 2;
bookResourceExcelDTO.setRowNo(Long.valueOf(num)); bookResourceExcelDTO.setRowNo(Long.valueOf(num));
bookResourceExcelDTO.setBookId(Long.valueOf(data[i][1])); bookResourceExcelDTO.setBookId(null == data[i][1] ? null : Long.valueOf(data[i][1]));
bookResourceExcelDTO.setBookName(data[i][2]); bookResourceExcelDTO.setBookName(null == data[i][2] ? "" : data[i][2]);
bookResourceExcelDTO.setAdviserId(Long.valueOf(data[i][3])); bookResourceExcelDTO.setAdviserId(null == data[i][3] ? null : Long.valueOf(data[i][3]));
bookResourceExcelDTO.setChannelId(Long.valueOf(data[i][5])); bookResourceExcelDTO.setChannelId(null == data[i][5] ? null : Long.valueOf(data[i][5]));
bookResourceExcelDTO.setUrl(data[i][6]); bookResourceExcelDTO.setUrl(null == data[i][6] ? "" : data[i][6]);
bookResourceExcelDTOList.add(bookResourceExcelDTO); bookResourceExcelDTOList.add(bookResourceExcelDTO);
} }
return bookResourceExcelDTOList; return bookResourceExcelDTOList;
......
...@@ -275,20 +275,9 @@ public class ExcelUtil { ...@@ -275,20 +275,9 @@ public class ExcelUtil {
continue; continue;
} }
resultStr[j] = returnArray[i]; resultStr[j] = returnArray[i];
if (StringUtil.isEmpty(returnArray[i][0])) {
throw new ChannelBizException(BookBizException.PARAM_IS_NULL, "论文题名不能为空");
}
if (StringUtil.isEmpty(returnArray[i][1])) {
throw new ChannelBizException(BookBizException.PARAM_IS_NULL, "关键词不能为空");
}
if (StringUtil.isEmpty(returnArray[i][2])) {
throw new ChannelBizException(BookBizException.PARAM_IS_NULL, "全部作者不能为空");
}
if (StringUtil.isEmpty(returnArray[i][5])) {
throw new ChannelBizException(BookBizException.PARAM_IS_NULL, "论文语言不能为空");
}
j++; j++;
} }
return resultStr; return resultStr;
} }
} }
...@@ -5559,7 +5559,7 @@ public class BookGroupBizImpl implements BookGroupBiz { ...@@ -5559,7 +5559,7 @@ public class BookGroupBizImpl implements BookGroupBiz {
@Override @Override
public List<BookServeDTO> getBookAndBookGroupServeIds4Price(Long adviserId, Long bookId, Long channelId) { public List<BookServeDTO> getBookAndBookGroupServeIds4Price(Long adviserId, Long bookId, Long channelId) {
List<BookServeDTO> serveDTOList = new ArrayList<>(); List<BookServeDTO> serveDTOList = new ArrayList<>();
BookGroupDTO bookGroupDTO = bookGroupDao.getDTOByBookId(bookId, channelId, adviserId); BookGroupDTO bookGroupDTO = bookGroupDao.getDTOByBookId4Price(bookId, channelId, adviserId);
List<Long> appIds = new ArrayList<>(); List<Long> appIds = new ArrayList<>();
List<Long> productIds = new ArrayList<>(); List<Long> productIds = new ArrayList<>();
AccountSettingDto accountSettingDto = qrcodeSceneConsr.getWechatInfo(channelId); AccountSettingDto accountSettingDto = qrcodeSceneConsr.getWechatInfo(channelId);
...@@ -5602,6 +5602,7 @@ public class BookGroupBizImpl implements BookGroupBiz { ...@@ -5602,6 +5602,7 @@ public class BookGroupBizImpl implements BookGroupBiz {
bookServeDTO.setPrice(bookServeVO.getRetailPrice()); bookServeDTO.setPrice(bookServeVO.getRetailPrice());
bookServeDTO.setTypeCode(bookServeVO.getTypeCode()); bookServeDTO.setTypeCode(bookServeVO.getTypeCode());
bookServeDTO.setFromType(bookServeVO.getFromType()); bookServeDTO.setFromType(bookServeVO.getFromType());
bookServeDTO.setFromTypeName(bookServeVO.getFromTypeName());
String url = SendWeixinRequestTools.splitUrl(accountSettingDto, bookServeVO.getUrl()); String url = SendWeixinRequestTools.splitUrl(accountSettingDto, bookServeVO.getUrl());
if (AppAndProductTypeEnum.APP.value.equals(bookServeVO.getTypeCode()) && !appIds.contains(serveId)) { if (AppAndProductTypeEnum.APP.value.equals(bookServeVO.getTypeCode()) && !appIds.contains(serveId)) {
bookServeDTO.setServeId(serveId); bookServeDTO.setServeId(serveId);
......
...@@ -362,4 +362,13 @@ public interface BookGroupDao extends BaseDao<BookGroup> { ...@@ -362,4 +362,13 @@ public interface BookGroupDao extends BaseDao<BookGroup> {
* * @param null * * @param null
*/ */
Integer getBookGroupCountByAgent(Integer joinGroupType, Long agentId); Integer getBookGroupCountByAgent(Integer joinGroupType, Long agentId);
/**
*
* @param bookId
* @param channelId
* @param adviserId
* @return
*/
BookGroupDTO getDTOByBookId4Price(Long bookId, Long channelId, Long adviserId);
} }
...@@ -454,4 +454,13 @@ public class BookGroupDaoImpl extends BaseDaoImpl<BookGroup> implements BookGrou ...@@ -454,4 +454,13 @@ public class BookGroupDaoImpl extends BaseDaoImpl<BookGroup> implements BookGrou
map.put("joinGroupType", joinGroupType); map.put("joinGroupType", joinGroupType);
return getSessionTemplate().selectOne(getStatement("getBookGroupCountByAgent"), map); return getSessionTemplate().selectOne(getStatement("getBookGroupCountByAgent"), map);
} }
@Override
public BookGroupDTO getDTOByBookId4Price(Long bookId, Long channelId, Long adviserId) {
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("bookId", bookId);
paramMap.put("channelId", channelId);
paramMap.put("adviserId", adviserId);
return super.getSqlSession().selectOne(getStatement("getDTOByBookId4Price"), paramMap);
}
} }
...@@ -1118,4 +1118,21 @@ ...@@ -1118,4 +1118,21 @@
</if> </if>
</select> </select>
<select id="getDTOByBookId4Price" resultMap="BookGroupDTO" parameterType="map">
select
<include refid="Base_Column_List"/>
from book_group
where is_delete = 0
<if test="bookId != null">
and book_id = #{bookId,jdbcType=BIGINT}
</if>
<if test="channelId != null">
and channel_id = #{channelId,jdbcType=BIGINT}
</if>
<if test="adviserId != null">
and create_user = #{adviserId,jdbcType=BIGINT}
</if>
ORDER BY create_time ASC limit 1
</select>
</mapper> </mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!--
This is the JRebel configuration file. It maps the running application to your IDE workspace, enabling JRebel reloading for this project.
Refer to https://manuals.jrebel.com/jrebel/standalone/config.html for more information.
-->
<application generated-by="intellij" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://update.zeroturnaround.com/jrebel/rebel-2_1.xsd">
<classpath>
<dir name="C:/project/书籍资源数据/prod/pcloud-book/pcloud-service-book/target/classes">
</dir>
</classpath>
</application>
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