Commit 841a8eb0 by 李传峰

Merge branch 'feature/1009603' into 'master'

feature[1009603] 抖音书店

See merge request rays/pcloud-book!1736
parents 0865bb47 02a15970
...@@ -29,16 +29,23 @@ public enum MofangBookTypeEnum { ...@@ -29,16 +29,23 @@ public enum MofangBookTypeEnum {
/** /**
* 山东新鑫 * 山东新鑫
*/ */
SDXX(6) SDXX(6),
; /**
* 浙江教育出版社
*/
ZHE_JIANG(7),
/**
* 青岛
*/
QING_DAO(8);
public final Integer value; public final Integer value;
private MofangBookTypeEnum(Integer value) { private MofangBookTypeEnum(Integer value) {
this.value = value; this.value = value;
} }
public static final List<Integer> bjxyType= CollUtil.toList(BJXY.value,SJHY.value); public static final List<Integer> bjxyType= CollUtil.toList(BJXY.value,SJHY.value);
public static final List<Integer> zmbType=CollUtil.toList(WYWH.value, ZHE_JIANG.value);
public static final List<Integer> zmbType=CollUtil.toList(ZMB.value,WYWH.value); public static final List<Integer> sdxxType= CollUtil.toList(ZMB.value, SDXX.value, QING_DAO.value);
} }
...@@ -359,6 +359,6 @@ public interface BookService { ...@@ -359,6 +359,6 @@ public interface BookService {
@GetMapping("getMoFangSceneIds") @GetMapping("getMoFangSceneIds")
ResponseEntity<ResponseDto<List<Long>>> getMoFangSceneIds (@RequestParam(value = "mofangId") Long mofangId); ResponseEntity<ResponseDto<List<Long>>> getMoFangSceneIds (@RequestParam(value = "mofangId") Long mofangId);
@GetMapping("getMoFangSceneIdsByType") @PostMapping("getMoFangSceneIdsByType")
ResponseEntity<ResponseDto<List<Long>>> getMoFangSceneIdsByType (@RequestParam(value = "type") Integer type); ResponseEntity<ResponseDto<List<Long>>> getMoFangSceneIdsByType (@RequestBody List<Integer> typeList);
} }
...@@ -866,5 +866,5 @@ public interface BookBiz { ...@@ -866,5 +866,5 @@ public interface BookBiz {
*/ */
PageBeanNew<MoFangBookStoreDto> listBookStore(String keyWords, Integer currentPage, Integer numPerPage, Integer type, String ip); PageBeanNew<MoFangBookStoreDto> listBookStore(String keyWords, Integer currentPage, Integer numPerPage, Integer type, String ip);
List<Long> getMoFangSceneIdsByType(Integer type); List<Long> getMoFangSceneIdsByType(List<Integer> typeList);
} }
...@@ -408,7 +408,9 @@ public class BookBizImpl implements BookBiz { ...@@ -408,7 +408,9 @@ public class BookBizImpl implements BookBiz {
@Autowired @Autowired
private BookBrowseRecordBiz bookBrowseRecordBiz; private BookBrowseRecordBiz bookBrowseRecordBiz;
private static final List<Integer> zouMuBaiTypeList = CollUtil.toList(3,4,6); private static final List<Integer> zouMuBaiTypeList = CollUtil.toList(3,4,6,7);
private static final List<Integer> zhejiangTypeList = CollUtil.toList(3,4,6,8);
/** /**
* 创建书籍,同时建立与编辑的推广关系 * 创建书籍,同时建立与编辑的推广关系
...@@ -4820,7 +4822,7 @@ public class BookBizImpl implements BookBiz { ...@@ -4820,7 +4822,7 @@ public class BookBizImpl implements BookBiz {
if(MofangBookTypeEnum.zmbType.contains(type)){ if(MofangBookTypeEnum.zmbType.contains(type)){
dealZmb(list); dealZmb(list);
} }
if (MofangBookTypeEnum.SDXX.value.equals(type)) { if (MofangBookTypeEnum.sdxxType.contains(type)) {
dealSDXX(list); dealSDXX(list);
} }
} }
...@@ -4961,7 +4963,7 @@ public class BookBizImpl implements BookBiz { ...@@ -4961,7 +4963,7 @@ public class BookBizImpl implements BookBiz {
if(null==mofangBook){ if(null==mofangBook){
return new ArrayList<>(); return new ArrayList<>();
} }
if(null!=mofangBook.getType() && zouMuBaiTypeList.contains(mofangBook.getType())){ if(null!=mofangBook.getType() && zhejiangTypeList.contains(mofangBook.getType())){
return bookDao.getZmbBookIds(mofangId); return bookDao.getZmbBookIds(mofangId);
} }
if(null!=mofangBook.getBookId()){ if(null!=mofangBook.getBookId()){
...@@ -4999,9 +5001,7 @@ public class BookBizImpl implements BookBiz { ...@@ -4999,9 +5001,7 @@ public class BookBizImpl implements BookBiz {
} }
@Override @Override
public List<Long> getMoFangSceneIdsByType(Integer type) { public List<Long> getMoFangSceneIdsByType(List<Integer> typeList) {
Map<String, Object> paramMap = new HashMap<>(); return bookDao.getMoFangSceneIdsByType(typeList);
paramMap.put("type",type);
return bookDao.getMoFangSceneIdsByType(type);
} }
} }
...@@ -418,5 +418,5 @@ public interface BookDao extends BaseDao<Book> { ...@@ -418,5 +418,5 @@ public interface BookDao extends BaseDao<Book> {
List<Long> getZmbSceneIds(Long mofangId); List<Long> getZmbSceneIds(Long mofangId);
List<Long> getMoFangSceneIdsByType(Integer type); List<Long> getMoFangSceneIdsByType(List<Integer> list);
} }
...@@ -25,7 +25,6 @@ import com.pcloud.common.page.PageBean; ...@@ -25,7 +25,6 @@ import com.pcloud.common.page.PageBean;
import com.pcloud.common.page.PageParam; import com.pcloud.common.page.PageParam;
import com.pcloud.common.utils.ListForInSQL; import com.pcloud.common.utils.ListForInSQL;
import com.pcloud.common.utils.ListUtils; import com.pcloud.common.utils.ListUtils;
import io.swagger.models.auth.In;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.HashMap; import java.util.HashMap;
...@@ -557,9 +556,9 @@ public class BookDaoImpl extends BaseDaoImpl<Book> implements BookDao { ...@@ -557,9 +556,9 @@ public class BookDaoImpl extends BaseDaoImpl<Book> implements BookDao {
} }
@Override @Override
public List<Long> getMoFangSceneIdsByType(Integer type) { public List<Long> getMoFangSceneIdsByType(List<Integer> list) {
Map<String, Object> paramMap = Maps.newHashMap(); Map<String, Object> paramMap = Maps.newHashMap();
paramMap.put("type", type); paramMap.put("list", list);
return getSessionTemplate().selectList(getStatement("getMoFangSceneIdsByType"), paramMap); return getSessionTemplate().selectList(getStatement("getMoFangSceneIdsByType"), paramMap);
} }
} }
...@@ -343,7 +343,7 @@ public class BookServiceImpl implements BookService { ...@@ -343,7 +343,7 @@ public class BookServiceImpl implements BookService {
} }
@Override @Override
public ResponseEntity<ResponseDto<List<Long>>> getMoFangSceneIdsByType(Integer type) { public ResponseEntity<ResponseDto<List<Long>>> getMoFangSceneIdsByType(List<Integer> typeList) {
return ResponseHandleUtil.toResponse(bookBiz.getMoFangSceneIdsByType(type)); return ResponseHandleUtil.toResponse(bookBiz.getMoFangSceneIdsByType(typeList));
} }
} }
...@@ -3522,7 +3522,7 @@ ...@@ -3522,7 +3522,7 @@
select select
scene_id scene_id
from mofang_zmb from mofang_zmb
where mofang_id = #{mofangId} and scene_id != null where mofang_id = #{mofangId} and scene_id is not null
</select> </select>
<select id="listBookStore" resultType="com.pcloud.book.book.vo.MoFangBookStoreDto"> <select id="listBookStore" resultType="com.pcloud.book.book.vo.MoFangBookStoreDto">
...@@ -3544,6 +3544,9 @@ ...@@ -3544,6 +3544,9 @@
select select
scene_id scene_id
from mofang_scene from mofang_scene
where type = #{type} where type in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
${item}
</foreach>
</select> </select>
</mapper> </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