Commit b92a415c by 宋祥

Merge branch 'mymaster' into 'master'

修改群发记录bug

See merge request rays/pcloud-book!47
parents f725f7e2 d4cd50d4
...@@ -103,7 +103,7 @@ public interface PushBiz { ...@@ -103,7 +103,7 @@ public interface PushBiz {
* @param numPerPage * @param numPerPage
* @return * @return
*/ */
PageBeanNew<PushGroupDTO> getPushGroupList(Long pushId, Integer currentPage, Integer numPerPage); PageBeanNew<PushGroupDTO> getPushGroupList(Long pushId, Boolean isRecord, Integer currentPage, Integer numPerPage);
/** /**
* 获取群发记录集合 * 获取群发记录集合
......
...@@ -616,10 +616,11 @@ public class PushBizImpl implements PushBiz { ...@@ -616,10 +616,11 @@ public class PushBizImpl implements PushBiz {
@ParamLog("获取群发关联集合") @ParamLog("获取群发关联集合")
@Override @Override
public PageBeanNew<PushGroupDTO> getPushGroupList(Long pushId, Integer currentPage, Integer numPerPage) { public PageBeanNew<PushGroupDTO> getPushGroupList(Long pushId, Boolean isRecord, Integer currentPage, Integer numPerPage) {
PageParam pageParam = new PageParam(currentPage, numPerPage); PageParam pageParam = new PageParam(currentPage, numPerPage);
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("pushId",pushId); map.put("pushId",pushId);
map.put("isRecord",isRecord);
PageBeanNew<PushGroupDTO> pageBeanNew = pushGroupDao.listPageNew(pageParam, map, "getPushGroupList"); PageBeanNew<PushGroupDTO> pageBeanNew = pushGroupDao.listPageNew(pageParam, map, "getPushGroupList");
return pageBeanNew; return pageBeanNew;
} }
...@@ -1245,7 +1246,7 @@ public class PushBizImpl implements PushBiz { ...@@ -1245,7 +1246,7 @@ public class PushBizImpl implements PushBiz {
return; return;
} }
List<Long> pushIds = pushRecordDTOS.stream().map(PushRecordDTO::getPushId).distinct().collect(Collectors.toList()); List<Long> pushIds = pushRecordDTOS.stream().map(PushRecordDTO::getPushId).distinct().collect(Collectors.toList());
List<PushItem> pushItems = pushItemDao.getListByPushIds(pushIds); List<PushItem> pushItems = pushItemDao.getAllListByPushIds(pushIds);
Map<Long, List<PushItem>> pushItemMap = new HashMap<>(); Map<Long, List<PushItem>> pushItemMap = new HashMap<>();
List<Long> appIds = new ArrayList<>(); List<Long> appIds = new ArrayList<>();
List<Long> productIds = new ArrayList<>(); List<Long> productIds = new ArrayList<>();
......
...@@ -64,4 +64,11 @@ public interface PushItemDao extends BaseDao<PushItem> { ...@@ -64,4 +64,11 @@ public interface PushItemDao extends BaseDao<PushItem> {
* @return * @return
*/ */
List<PushItem> getListByPushId(Long pushId); List<PushItem> getListByPushId(Long pushId);
/**
* 根据群发id集合查询所有(包括删除了的)
* @param pushIds
* @return
*/
List<PushItem> getAllListByPushIds(List<Long> pushIds);
} }
...@@ -66,4 +66,11 @@ public class PushItemDaoImpl extends BaseDaoImpl<PushItem> implements PushItemDa ...@@ -66,4 +66,11 @@ public class PushItemDaoImpl extends BaseDaoImpl<PushItem> implements PushItemDa
public List<PushItem> getListByPushId(Long pushId) { public List<PushItem> getListByPushId(Long pushId) {
return super.getSqlSession().selectList(getStatement("getListByPushId"), pushId); return super.getSqlSession().selectList(getStatement("getListByPushId"), pushId);
} }
@Override
public List<PushItem> getAllListByPushIds(List<Long> pushIds) {
Map<String, Object> map = new HashMap<>();
map.put("pushIds",pushIds);
return super.getSqlSession().selectList(getStatement("getAllListByPushIds"), map);
}
} }
...@@ -105,6 +105,7 @@ public interface PushFacade { ...@@ -105,6 +105,7 @@ public interface PushFacade {
ResponseDto<?> getPushGroupList( ResponseDto<?> getPushGroupList(
@RequestHeader("token") @ApiParam("token信息") String token, @RequestHeader("token") @ApiParam("token信息") String token,
@RequestParam("pushId") @ApiParam("群发id") Long pushId, @RequestParam("pushId") @ApiParam("群发id") Long pushId,
@RequestParam(value = "isRecord", required = false) @ApiParam("是否记录") Boolean isRecord,
@RequestParam("currentPage") @ApiParam("当前页") Integer currentPage, @RequestParam("currentPage") @ApiParam("当前页") Integer currentPage,
@RequestParam("numPerPage") @ApiParam("每页条数") Integer numPerPage @RequestParam("numPerPage") @ApiParam("每页条数") Integer numPerPage
) throws BizException, PermissionException; ) throws BizException, PermissionException;
......
...@@ -191,6 +191,7 @@ public class PushFacadeImpl implements PushFacade { ...@@ -191,6 +191,7 @@ public class PushFacadeImpl implements PushFacade {
public ResponseDto<?> getPushGroupList( public ResponseDto<?> getPushGroupList(
@RequestHeader("token") @ApiParam("token信息") String token, @RequestHeader("token") @ApiParam("token信息") String token,
@RequestParam("pushId") @ApiParam("群发id") Long pushId, @RequestParam("pushId") @ApiParam("群发id") Long pushId,
@RequestParam(value = "isRecord", required = false) @ApiParam("是否记录") Boolean isRecord,
@RequestParam("currentPage") @ApiParam("当前页") Integer currentPage, @RequestParam("currentPage") @ApiParam("当前页") Integer currentPage,
@RequestParam("numPerPage") @ApiParam("每页条数") Integer numPerPage @RequestParam("numPerPage") @ApiParam("每页条数") Integer numPerPage
) throws BizException, PermissionException { ) throws BizException, PermissionException {
...@@ -204,7 +205,7 @@ public class PushFacadeImpl implements PushFacade { ...@@ -204,7 +205,7 @@ public class PushFacadeImpl implements PushFacade {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "群发id不能为空!"); throw new BookBizException(BookBizException.PARAM_IS_ERROR, "群发id不能为空!");
} }
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
return new ResponseDto<>(pushBiz.getPushGroupList(pushId, currentPage, numPerPage)); return new ResponseDto<>(pushBiz.getPushGroupList(pushId, isRecord, currentPage, numPerPage));
} }
@ApiOperation("获取群发记录列表") @ApiOperation("获取群发记录列表")
......
...@@ -186,8 +186,10 @@ ...@@ -186,8 +186,10 @@
push_group t1 push_group t1
LEFT JOIN book t2 ON t1.book_id = t2.BOOK_ID LEFT JOIN book t2 ON t1.book_id = t2.BOOK_ID
LEFT JOIN book_group_qrcode t3 ON t1.book_group_qrcode_id = t3.id LEFT JOIN book_group_qrcode t3 ON t1.book_group_qrcode_id = t3.id
WHERE WHERE 1=1
t1.is_delete = 0 <if test="isRecord==null or isRecord==false">
AND t1.is_delete = 0
</if>
AND t1.push_id = #{pushId} AND t1.push_id = #{pushId}
</select> </select>
......
...@@ -248,4 +248,15 @@ ...@@ -248,4 +248,15 @@
where is_delete=0 where is_delete=0
and push_id =#{pushId} and push_id =#{pushId}
</select> </select>
<!--根据群发id集合查询所有(包括删除了的)-->
<select id="getAllListByPushIds" parameterType="map" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/> from push_item
where
push_id in
<foreach collection="pushIds" item="pushId" open="(" separator="," close=")">
#{pushId}
</foreach>
order by push_id asc, seq_num asc
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -119,7 +119,6 @@ ...@@ -119,7 +119,6 @@
LEFT JOIN push_group t1 ON t.push_id = t1.push_id LEFT JOIN push_group t1 ON t.push_id = t1.push_id
WHERE WHERE
t.is_delete = 0 t.is_delete = 0
AND t1.is_delete = 0
AND t.create_user = #{partyId} AND t.create_user = #{partyId}
GROUP BY GROUP BY
t.id t.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