Commit f2db8cb4 by pansy

feat: [1003116] 权益配置中社群支持直接选择出版社对应编辑端的群分类

parent a1e1b440
package com.pcloud.book.applet.dto;
import com.pcloud.common.dto.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel
@Data
public class PcloudGroupActivityDTO extends BaseDto {
@ApiModelProperty("编号")
private String number;
@ApiModelProperty("链接")
private String groupExtLink;
@ApiModelProperty("群类型")
private Integer groupType;
@ApiModelProperty("名称")
private String name;
@ApiModelProperty("描述")
private String desc;
private String groupPic;
private Integer joinType;
private Long proLabelId;
private Long depLabelId;
private Long purLabelId;
private Long bookGroupClassifyId;
private String groupName;
private Long createUser;
private Long updateUser;
private Integer isDelete;
private Integer isShow;
}
\ No newline at end of file
...@@ -2,6 +2,7 @@ package com.pcloud.book.applet.service; ...@@ -2,6 +2,7 @@ package com.pcloud.book.applet.service;
import com.pcloud.book.applet.dto.AppletNewsVO; import com.pcloud.book.applet.dto.AppletNewsVO;
import com.pcloud.book.applet.dto.PcloudGroupActivityDTO;
import com.pcloud.common.dto.ResponseDto; import com.pcloud.common.dto.ResponseDto;
import org.springframework.cloud.netflix.feign.FeignClient; import org.springframework.cloud.netflix.feign.FeignClient;
...@@ -20,4 +21,10 @@ public interface AppletService { ...@@ -20,4 +21,10 @@ public interface AppletService {
@ApiOperation("根据资讯id查资讯") @ApiOperation("根据资讯id查资讯")
@GetMapping("getNewsById") @GetMapping("getNewsById")
public ResponseEntity<ResponseDto<AppletNewsVO>> getNewsById(@RequestParam("newsId") Long newsId); public ResponseEntity<ResponseDto<AppletNewsVO>> getNewsById(@RequestParam("newsId") Long newsId);
//add by pansy 2020/07/02
@ApiOperation("根据第三方群id获取信息")
@GetMapping("getGroupActivityById")
public ResponseEntity<ResponseDto<PcloudGroupActivityDTO>> getGroupActivityById(@RequestParam("id") Long id);
} }
...@@ -122,23 +122,34 @@ public class AppletGroupManageBizImpl implements AppletGroupManageBiz { ...@@ -122,23 +122,34 @@ public class AppletGroupManageBizImpl implements AppletGroupManageBiz {
String subStr = filterStr.length() > 60 ? filterStr.substring(0, 60) + "..." : filterStr; String subStr = filterStr.length() > 60 ? filterStr.substring(0, 60) + "..." : filterStr;
dto.setCutDesc(subStr); dto.setCutDesc(subStr);
Long classifyId = dto.getClassifyId(); Long classifyId = dto.getClassifyId();
String groupQrCode = groupQrcodeBiz.getChangeGroupQrCode(classifyId); if(classifyId != null && classifyId != 0) {
ClassifyQrcodeVO groupQrcodeInfo = groupQrcodeBiz.getGroupQrcodeInfo(groupQrCode, classifyId); String groupQrCode = groupQrcodeBiz.getChangeGroupQrCode(classifyId);
dto.setUserNumber(groupQrcodeInfo.getUserNumber()); ClassifyQrcodeVO groupQrcodeInfo = groupQrcodeBiz.getGroupQrcodeInfo(groupQrCode, classifyId);
dto.setBookGroupQrcodeId(groupQrcodeInfo.getId()); dto.setUserNumber(groupQrcodeInfo.getUserNumber());
dto.setGroupPic(groupQrCode); dto.setBookGroupQrcodeId(groupQrcodeInfo.getId());
dto.setStatus(0); dto.setGroupPic(groupQrCode);
// 付费群 查询用户是否已经购买过该群分类 dto.setStatus(0);
if (dto.getPrice().compareTo(BigDecimal.ZERO) > 0) { // 付费群 查询用户是否已经购买过该群分类
if (bookClassifyBuyRecordDao.checkUserBuy(wechatUserId, dto.getClassifyId())) { if (dto.getPrice() != null && dto.getPrice().compareTo(BigDecimal.ZERO) > 0) {
dto.setStatus(1); GroupQrcode4ClassifyVO userQrcode = bookQrcodeUserDao
.getUserQrcode(wechatUserId, dto.getClassifyId());
if (userQrcode != null && userQrcode.getGroupQrcodeId() != null) {
dto.setStatus(1);
}
} }
//头像列表从缓存里取
List<String> headUrlList = appletGroupSearchRecordBiz
.getHeadUrlList(dto.getUserNumber(), dto.getBookGroupQrcodeId());
dto.setHeadUrlList(headUrlList);
List<AppletGroupStatementDTO> statementDTOS = appletGroupSearchRecordBiz
.getStatementList(dto.getUserNumber(), headUrlList, dto.getBookGroupQrcodeId());
dto.setStatementDTOList(statementDTOS);
}else {
//头像、对话
List<String> headUrlList = appletGroupSearchRecordBiz
.getHeadUrlList(3, 3l);
dto.setHeadUrlList(headUrlList);
} }
//头像列表从缓存里取
List<String> headUrlList = appletGroupSearchRecordBiz.getHeadUrlList(dto.getUserNumber(),dto.getBookGroupQrcodeId());
dto.setHeadUrlList(headUrlList);
List<AppletGroupStatementDTO> statementDTOS = appletGroupSearchRecordBiz.getStatementList(dto.getUserNumber(),headUrlList,dto.getBookGroupQrcodeId());
dto.setStatementDTOList(statementDTOS);
} }
return recordList; return recordList;
} }
......
...@@ -2,14 +2,19 @@ package com.pcloud.book.applet.service.impl; ...@@ -2,14 +2,19 @@ package com.pcloud.book.applet.service.impl;
import com.pcloud.book.applet.biz.AppletNewsBiz; import com.pcloud.book.applet.biz.AppletNewsBiz;
import com.pcloud.book.applet.dto.AppletNewsVO; import com.pcloud.book.applet.dto.AppletNewsVO;
import com.pcloud.book.applet.dto.PcloudGroupActivityDTO;
import com.pcloud.book.applet.service.AppletService; import com.pcloud.book.applet.service.AppletService;
import com.pcloud.book.skill.biz.PcloudGroupActivityBiz;
import com.pcloud.book.skill.entity.PcloudGroupActivity;
import com.pcloud.common.dto.ResponseDto; import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.utils.ResponseHandleUtil; import com.pcloud.common.utils.ResponseHandleUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
/** /**
...@@ -26,10 +31,22 @@ public class AppletServiceImpl implements AppletService { ...@@ -26,10 +31,22 @@ public class AppletServiceImpl implements AppletService {
@Autowired @Autowired
private AppletNewsBiz appletNewsBiz; private AppletNewsBiz appletNewsBiz;
@Autowired
private PcloudGroupActivityBiz pcloudGroupActivityBiz;
@Override @Override
@GetMapping("getNewsById") @GetMapping("getNewsById")
public ResponseEntity<ResponseDto<AppletNewsVO>> getNewsById(Long newsId) { public ResponseEntity<ResponseDto<AppletNewsVO>> getNewsById(Long newsId) {
return ResponseHandleUtil.toResponse(appletNewsBiz.getNewsVOById(newsId)); return ResponseHandleUtil.toResponse(appletNewsBiz.getNewsVOById(newsId));
} }
@Override
@GetMapping("getGroupActivityById")
public ResponseEntity<ResponseDto<PcloudGroupActivityDTO>> getGroupActivityById(@RequestParam("id") Long id){
PcloudGroupActivity pcloudGroupActivity = pcloudGroupActivityBiz.getById(id);
PcloudGroupActivityDTO newData = new PcloudGroupActivityDTO();
BeanUtils.copyProperties(pcloudGroupActivity,newData);
return ResponseHandleUtil.toResponse(newData);
}
} }
...@@ -275,6 +275,7 @@ public interface BookGroupClassifyBiz { ...@@ -275,6 +275,7 @@ public interface BookGroupClassifyBiz {
/** /**
* 平台端分页获取群分类 * 平台端分页获取群分类
*
*/ */
PageBeanNew<PcloudBookGroupClassifyVO> listGroupClassify4Pcloud(String name, Long proLabelId, Long depLabelId, Integer currentPage, Integer numPerPage); PageBeanNew<PcloudBookGroupClassifyVO> listGroupClassify4Pcloud(String name, Long proLabelId, Long depLabelId,Long purLabelId,Long firstClassifyId,Long gradeLabelId,Long subjectLabelId,Long agentId,Long adviserId, Integer currentPage, Integer numPerPage);
} }
...@@ -83,6 +83,7 @@ import com.pcloud.book.util.properties.BookProps; ...@@ -83,6 +83,7 @@ import com.pcloud.book.util.properties.BookProps;
import com.pcloud.common.core.aspect.ParamLog; import com.pcloud.common.core.aspect.ParamLog;
import com.pcloud.common.core.constant.SystemCode; import com.pcloud.common.core.constant.SystemCode;
import com.pcloud.common.core.enums.NotifyOriginTypeEnum; import com.pcloud.common.core.enums.NotifyOriginTypeEnum;
import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.page.PageBeanNew; import com.pcloud.common.page.PageBeanNew;
import com.pcloud.common.page.PageParam; import com.pcloud.common.page.PageParam;
import com.pcloud.common.utils.DateUtils; import com.pcloud.common.utils.DateUtils;
...@@ -96,16 +97,22 @@ import com.pcloud.readercenter.wechat.dto.WechatUserRobotDto; ...@@ -96,16 +97,22 @@ import com.pcloud.readercenter.wechat.dto.WechatUserRobotDto;
import com.pcloud.resourcecenter.product.dto.UpdateAppProductParamDTO; import com.pcloud.resourcecenter.product.dto.UpdateAppProductParamDTO;
import com.pcloud.resourcecenter.product.entity.Product; import com.pcloud.resourcecenter.product.entity.Product;
import com.pcloud.resourcecenter.product.entity.Specification; import com.pcloud.resourcecenter.product.entity.Specification;
import com.pcloud.usercenter.party.adviser.entity.Adviser;
import com.pcloud.usercenter.party.adviser.service.AdviserService;
import com.pcloud.usercenter.party.agent.service.AgentService;
import com.pcloud.wechatgroup.group.dto.GroupMemberStatisDTO; import com.pcloud.wechatgroup.group.dto.GroupMemberStatisDTO;
import com.pcloud.wechatgroup.group.dto.GroupRobotDTO; import com.pcloud.wechatgroup.group.dto.GroupRobotDTO;
import com.pcloud.wechatgroup.message.dto.GroupChatCountDTO; import com.pcloud.wechatgroup.message.dto.GroupChatCountDTO;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import sun.management.resources.agent;
import org.apache.commons.collections.MapUtils; import org.apache.commons.collections.MapUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataIntegrityViolationException; import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
...@@ -132,6 +139,10 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz { ...@@ -132,6 +139,10 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz {
private static final Logger LOGGER = LoggerFactory.getLogger(BookGroupClassifyBizImpl.class); private static final Logger LOGGER = LoggerFactory.getLogger(BookGroupClassifyBizImpl.class);
@Autowired @Autowired
private AdviserService adviserService;
@Autowired
private AgentService agentService;
@Autowired
private WeixinQrcodeBiz weixinQrcodeBiz; private WeixinQrcodeBiz weixinQrcodeBiz;
@Autowired @Autowired
private BookGroupClassifyDao bookGroupClassifyDao; private BookGroupClassifyDao bookGroupClassifyDao;
...@@ -1357,7 +1368,7 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz { ...@@ -1357,7 +1368,7 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz {
} }
@Override @Override
public PageBeanNew<PcloudBookGroupClassifyVO> listGroupClassify4Pcloud(String name, Long proLabelId, Long depLabelId, Integer currentPage, Integer numPerPage) { public PageBeanNew<PcloudBookGroupClassifyVO> listGroupClassify4Pcloud(String name, Long proLabelId, Long depLabelId,Long purLabelId,Long firstClassifyId,Long gradeLabelId,Long subjectLabelId,Long agentId,Long adviserId, Integer currentPage, Integer numPerPage) {
// 根据数命查bookid // 根据数命查bookid
List<Long> ids = new ArrayList<>(); List<Long> ids = new ArrayList<>();
if (!StringUtil.isEmpty(name)){ if (!StringUtil.isEmpty(name)){
...@@ -1369,6 +1380,25 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz { ...@@ -1369,6 +1380,25 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz {
map.put("name", StringUtil.isEmpty(name) ? null : name); map.put("name", StringUtil.isEmpty(name) ? null : name);
map.put("proLabelId", proLabelId); map.put("proLabelId", proLabelId);
map.put("depLabelId", depLabelId); map.put("depLabelId", depLabelId);
return bookGroupClassifyDao.listPageNew(pageParam, map, "listGroupClassify4Pcloud"); map.put("purLabelId", purLabelId);
map.put("firstClassifyId", firstClassifyId);
map.put("gradeLabelId", gradeLabelId);
map.put("subjectLabelId", subjectLabelId);
map.put("agentId", agentId);
map.put("adviserId", adviserId);
PageBeanNew<PcloudBookGroupClassifyVO> pageBeanNew = bookGroupClassifyDao.listPageNew(pageParam, map, "listGroupClassify4Pcloud");
pageBeanNew.getRecordList().forEach(item->{
Adviser adviser = ResponseHandleUtil.parseResponse(adviserService.getById(item.getAdviserId()), Adviser.class);
String agentName = ResponseHandleUtil.parseResponse(agentService.getNameById(item.getAgentId()), String.class);
item.setAdviserName(adviser.getName());
item.setPhone(adviser.getPhone());
item.setAgentName(agentName);
});
return pageBeanNew;
} }
} }
...@@ -272,10 +272,17 @@ public interface BookGroupClassifyFacade { ...@@ -272,10 +272,17 @@ public interface BookGroupClassifyFacade {
@RequestParam(value = "name", required = false) @ApiParam("群分类名 | 书刊名") String name, @RequestParam(value = "name", required = false) @ApiParam("群分类名 | 书刊名") String name,
@RequestParam(value = "proLabelId", required = false) @ApiParam("专业标签") Long proLabelId, @RequestParam(value = "proLabelId", required = false) @ApiParam("专业标签") Long proLabelId,
@RequestParam(value = "depLabelId", required = false) @ApiParam("深度标签") Long depLabelId, @RequestParam(value = "depLabelId", required = false) @ApiParam("深度标签") Long depLabelId,
@RequestParam(value = "purLabelId", required = false) @ApiParam("目的") Long purLabelId,
@RequestParam(value = "firstClassifyId", required = false) @ApiParam("分类") Long firstClassifyId,
@RequestParam(value = "gradeLabelId", required = false) @ApiParam("年级") Long gradeLabelId,
@RequestParam(value = "subjectLabelId", required = false) @ApiParam("科目") Long subjectLabelId,
@RequestParam(value = "agentId", required = false) @ApiParam("出版社") Long agentId,
@RequestParam(value = "adviserId", required = false) @ApiParam("编辑id") Long adviserId,
@RequestParam("currentPage") Integer currentPage, @RequestParam("currentPage") Integer currentPage,
@RequestParam("numPerPage") Integer numPerPage) throws BizException, PermissionException; @RequestParam("numPerPage") Integer numPerPage) throws BizException, PermissionException;
@ApiOperation("根据群分类ID获取群二维码") @ApiOperation("根据群分类ID获取群二维码")
@GetMapping("getGroupQrcodeByClassify") @GetMapping("getGroupQrcodeByClassify")
ResponseDto<String> getGroupQrcodeByClassify(@RequestHeader("token") String token,@RequestParam("classifyId") Integer classifyId) throws BizException,PermissionException; ResponseDto<String> getGroupQrcodeByClassify(@RequestHeader("token") String token,@RequestParam("classifyId") Integer classifyId) throws BizException,PermissionException;
} }
...@@ -153,7 +153,13 @@ public interface BookGroupFacade { ...@@ -153,7 +153,13 @@ public interface BookGroupFacade {
@RequestParam(value = "startDate", required = false) String startDate, @RequestParam(value = "startDate", required = false) String startDate,
@RequestParam(value = "endDate", required = false) String endDate, @RequestParam(value = "endDate", required = false) String endDate,
@RequestParam(value = "hasServe", required = false) Boolean hasServe, @RequestParam(value = "hasServe", required = false) Boolean hasServe,
@RequestParam(value = "isPrint", required = false) Boolean isPrint) @RequestParam(value = "isPrint", required = false) Boolean isPrint,
@RequestParam(value = "proLabelId", required = false) @ApiParam("专业标签") Long proLabelId,
@RequestParam(value = "depLabelId", required = false) @ApiParam("深度标签") Long depLabelId,
@RequestParam(value = "purLabelId", required = false) @ApiParam("目的") Long purLabelId,
@RequestParam(value = "firstClassifyId", required = false) @ApiParam("分类") Long firstClassifyId,
@RequestParam(value = "gradeLabelId", required = false) @ApiParam("年级") Long gradeLabelId,
@RequestParam(value = "subjectLabelId", required = false) @ApiParam("科目") Long subjectLabelId)
throws BizException, PermissionException; throws BizException, PermissionException;
@ApiOperation(value = "获取社群书列表(运营)", httpMethod = "POST") @ApiOperation(value = "获取社群书列表(运营)", httpMethod = "POST")
......
...@@ -300,11 +300,18 @@ public class BookGroupClassifyFacadeImpl implements BookGroupClassifyFacade { ...@@ -300,11 +300,18 @@ public class BookGroupClassifyFacadeImpl implements BookGroupClassifyFacade {
@RequestParam(value = "name", required = false) @ApiParam("群分类名 | 书刊名") String name, @RequestParam(value = "name", required = false) @ApiParam("群分类名 | 书刊名") String name,
@RequestParam(value = "proLabelId", required = false) @ApiParam("专业标签") Long proLabelId, @RequestParam(value = "proLabelId", required = false) @ApiParam("专业标签") Long proLabelId,
@RequestParam(value = "depLabelId", required = false) @ApiParam("深度标签") Long depLabelId, @RequestParam(value = "depLabelId", required = false) @ApiParam("深度标签") Long depLabelId,
@RequestParam(value = "purLabelId", required = false) @ApiParam("目的") Long purLabelId,
@RequestParam(value = "firstClassifyId", required = false) @ApiParam("分类") Long firstClassifyId,
@RequestParam(value = "gradeLabelId", required = false) @ApiParam("年级") Long gradeLabelId,
@RequestParam(value = "subjectLabelId", required = false) @ApiParam("科目") Long subjectLabelId,
@RequestParam(value = "agentId", required = false) @ApiParam("出版社") Long agentId,
@RequestParam(value = "adviserId", required = false) @ApiParam("编辑id") Long adviserId,
@RequestParam("currentPage") Integer currentPage, @RequestParam("currentPage") Integer currentPage,
@RequestParam("numPerPage") Integer numPerPage @RequestParam("numPerPage") Integer numPerPage
) throws BizException, PermissionException { ) throws BizException, PermissionException {
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
return new ResponseDto<>(bookGroupClassifyBiz.listGroupClassify4Pcloud(name, proLabelId, depLabelId, currentPage, numPerPage)); return new ResponseDto<>(bookGroupClassifyBiz.listGroupClassify4Pcloud(name, proLabelId, depLabelId, purLabelId,
firstClassifyId, gradeLabelId, subjectLabelId, agentId,adviserId,currentPage, numPerPage));
} }
@Override @Override
......
...@@ -225,7 +225,13 @@ public class BookGroupFacadeImpl implements BookGroupFacade { ...@@ -225,7 +225,13 @@ public class BookGroupFacadeImpl implements BookGroupFacade {
@RequestParam(value = "startDate", required = false) String startDate, @RequestParam(value = "startDate", required = false) String startDate,
@RequestParam(value = "endDate", required = false) String endDate, @RequestParam(value = "endDate", required = false) String endDate,
@RequestParam(value = "hasServe", required = false) Boolean hasServe, @RequestParam(value = "hasServe", required = false) Boolean hasServe,
@RequestParam(value = "isPrint", required = false) Boolean isPrint ) @RequestParam(value = "isPrint", required = false) Boolean isPrint,
@RequestParam(value = "proLabelId", required = false) @ApiParam("专业标签") Long proLabelId,
@RequestParam(value = "depLabelId", required = false) @ApiParam("深度标签") Long depLabelId,
@RequestParam(value = "purLabelId", required = false) @ApiParam("目的") Long purLabelId,
@RequestParam(value = "firstClassifyId", required = false) @ApiParam("分类") Long firstClassifyId,
@RequestParam(value = "gradeLabelId", required = false) @ApiParam("年级") Long gradeLabelId,
@RequestParam(value = "subjectLabelId", required = false) @ApiParam("科目") Long subjectLabelId)
throws BizException, PermissionException { throws BizException, PermissionException {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) { if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) {
......
...@@ -26,6 +26,18 @@ public class PcloudBookGroupClassifyVO { ...@@ -26,6 +26,18 @@ public class PcloudBookGroupClassifyVO {
private BigDecimal price; private BigDecimal price;
@ApiModelProperty("群个数") @ApiModelProperty("群个数")
private Integer groupCount; private Integer groupCount;
@ApiModelProperty("出版社Id")
private Long agentId;
@ApiModelProperty("出版社")
private String agentName;
@ApiModelProperty("编辑账号名")
private Long adviserId;
@ApiModelProperty("编辑账号名")
private String adviserName;
@ApiModelProperty("电话")
private String phone;
@ApiModelProperty("图片")
private String groupPic;
public Integer getId() { public Integer getId() {
return id; return id;
...@@ -67,6 +79,54 @@ public class PcloudBookGroupClassifyVO { ...@@ -67,6 +79,54 @@ public class PcloudBookGroupClassifyVO {
this.groupCount = groupCount; this.groupCount = groupCount;
} }
public Long getAgentId() {
return agentId;
}
public void setAgentId(Long agentId) {
this.agentId = agentId;
}
public String getAgentName() {
return agentName;
}
public void setAgentName(String agentName) {
this.agentName = agentName;
}
public String getAdviserName() {
return adviserName;
}
public void setAdviserName(String adviserName) {
this.adviserName = adviserName;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public Long getAdviserId() {
return adviserId;
}
public void setAdviserId(Long adviserId) {
this.adviserId = adviserId;
}
public String getGroupPic() {
return groupPic;
}
public void setGroupPic(String groupPic) {
this.groupPic = groupPic;
}
@Override @Override
public String toString() { public String toString() {
return "PcloudBookGroupClassifyVO{" + return "PcloudBookGroupClassifyVO{" +
......
...@@ -95,4 +95,7 @@ public class RightsNowItem extends BaseEntity { ...@@ -95,4 +95,7 @@ public class RightsNowItem extends BaseEntity {
private Long bookGroupId; private Long bookGroupId;
@ApiModelProperty("群分类价格") @ApiModelProperty("群分类价格")
private BigDecimal price; private BigDecimal price;
@ApiModelProperty("群类型 2:编辑端群")
private String groupType;
} }
...@@ -14,6 +14,7 @@ import com.pcloud.common.utils.SessionUtil; ...@@ -14,6 +14,7 @@ import com.pcloud.common.utils.SessionUtil;
import com.pcloud.common.utils.cookie.Cookie; import com.pcloud.common.utils.cookie.Cookie;
import com.pcloud.common.utils.string.StringUtil; import com.pcloud.common.utils.string.StringUtil;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.CookieValue;
......
...@@ -4,6 +4,7 @@ import com.pcloud.book.applet.dto.AppletGroupManageDTO; ...@@ -4,6 +4,7 @@ import com.pcloud.book.applet.dto.AppletGroupManageDTO;
import com.pcloud.book.rightsSetting.entity.BaseTempletClassify; import com.pcloud.book.rightsSetting.entity.BaseTempletClassify;
import com.pcloud.book.skill.dto.GroupActivity4AppletDTO; import com.pcloud.book.skill.dto.GroupActivity4AppletDTO;
import com.pcloud.book.skill.dto.UpdateActivityShowStateDTO; import com.pcloud.book.skill.dto.UpdateActivityShowStateDTO;
import com.pcloud.book.skill.entity.PcloudGroupActivity;
import com.pcloud.book.skill.facade.request.SaveGroupActivityRequestVO; import com.pcloud.book.skill.facade.request.SaveGroupActivityRequestVO;
import com.pcloud.book.skill.facade.request.UpdateGroupActivityRequestVO; import com.pcloud.book.skill.facade.request.UpdateGroupActivityRequestVO;
import com.pcloud.book.skill.facade.response.QueryGroupActivityResponseVO; import com.pcloud.book.skill.facade.response.QueryGroupActivityResponseVO;
...@@ -65,5 +66,7 @@ public interface PcloudGroupActivityBiz { ...@@ -65,5 +66,7 @@ public interface PcloudGroupActivityBiz {
List<GroupActivity4AppletDTO> getTishBookSchoolListWrap(BaseTempletClassify baseTempletClassify, Integer limit); List<GroupActivity4AppletDTO> getTishBookSchoolListWrap(BaseTempletClassify baseTempletClassify, Integer limit);
PcloudGroupActivity getById(Long id);
void updateActivityShowState(UpdateActivityShowStateDTO showStateDTO); void updateActivityShowState(UpdateActivityShowStateDTO showStateDTO);
} }
...@@ -42,7 +42,11 @@ import com.pcloud.common.core.aspect.ParamLog; ...@@ -42,7 +42,11 @@ import com.pcloud.common.core.aspect.ParamLog;
import com.pcloud.common.page.PageBeanNew; import com.pcloud.common.page.PageBeanNew;
import com.pcloud.common.page.PageParam; import com.pcloud.common.page.PageParam;
import com.pcloud.common.utils.ListUtils; import com.pcloud.common.utils.ListUtils;
import com.pcloud.common.utils.ResponseHandleUtil;
import com.pcloud.common.utils.string.StringUtilParent; import com.pcloud.common.utils.string.StringUtilParent;
import com.pcloud.usercenter.party.adviser.entity.Adviser;
import com.pcloud.usercenter.party.adviser.service.AdviserService;
import com.pcloud.usercenter.party.agent.service.AgentService;
import com.sdk.wxgroup.RobotProcessTypeEnum; import com.sdk.wxgroup.RobotProcessTypeEnum;
import com.sdk.wxgroup.SendGroupInviteVO; import com.sdk.wxgroup.SendGroupInviteVO;
import com.sdk.wxgroup.SendPicMessageVO; import com.sdk.wxgroup.SendPicMessageVO;
...@@ -96,6 +100,11 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz { ...@@ -96,6 +100,11 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
private AppletGroupSearchRecordBiz appletGroupSearchRecordBiz; private AppletGroupSearchRecordBiz appletGroupSearchRecordBiz;
@Autowired @Autowired
private BookClassifyBuyRecordDao bookClassifyBuyRecordDao; private BookClassifyBuyRecordDao bookClassifyBuyRecordDao;
private BookQrcodeUserDao bookQrcodeUserDao;
@Autowired
private AdviserService adviserService;
@Autowired
private AgentService agentService;
@ParamLog("保存共读活动") @ParamLog("保存共读活动")
@Override @Override
...@@ -336,7 +345,15 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz { ...@@ -336,7 +345,15 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
if(ListUtils.isEmpty(ids)){ if(ListUtils.isEmpty(ids)){
return new HashMap<>(); return new HashMap<>();
} }
Map<Long, GroupActivity4AppletDTO> mapDto = pcloudGroupActivityDao.getByIds(ids); Map<Long, GroupActivity4AppletDTO> localMap = pcloudGroupActivityDao.getByIds(ids);
Map<Long, GroupActivity4AppletDTO> editDtoThree = pcloudGroupActivityDao.getGroupClassifyByIds(ids); //查询第编辑端群
// 合并
Map<Long, GroupActivity4AppletDTO> mapDto = new HashMap<Long, GroupActivity4AppletDTO>();
mapDto.putAll(localMap);
mapDto.putAll(editDtoThree);
if(mapDto.isEmpty()){ if(mapDto.isEmpty()){
return new HashMap<>(); return new HashMap<>();
} }
...@@ -423,4 +440,10 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz { ...@@ -423,4 +440,10 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
byId.setIsShow(showStateDTO.getIsShow()); byId.setIsShow(showStateDTO.getIsShow());
pcloudGroupActivityDao.updateByPrimaryKeySelective(byId); pcloudGroupActivityDao.updateByPrimaryKeySelective(byId);
} }
@Override
public PcloudGroupActivity getById(Long id){
return pcloudGroupActivityDao.getById(id);
}
} }
...@@ -19,5 +19,7 @@ public interface PcloudGroupActivityDao extends BaseDao<PcloudGroupActivity> { ...@@ -19,5 +19,7 @@ public interface PcloudGroupActivityDao extends BaseDao<PcloudGroupActivity> {
Map<Long, GroupActivity4AppletDTO> getByIds(List<Long> ids); Map<Long, GroupActivity4AppletDTO> getByIds(List<Long> ids);
Map<Long, GroupActivity4AppletDTO> getGroupClassifyByIds(List<Long> ids);
List<Long> getGroupClassifyIds(Map<String, Object> paraMap); List<Long> getGroupClassifyIds(Map<String, Object> paraMap);
} }
\ No newline at end of file
...@@ -52,6 +52,11 @@ public class PcloudGroupActivityDaoImpl extends BaseDaoImpl<PcloudGroupActivity> ...@@ -52,6 +52,11 @@ public class PcloudGroupActivityDaoImpl extends BaseDaoImpl<PcloudGroupActivity>
} }
@Override @Override
public Map<Long, GroupActivity4AppletDTO> getGroupClassifyByIds(List<Long> list){
return super.getSqlSession().selectMap(getStatement("getGroupClassifyByIds"), list,"id");
}
@Override
public List<Long> getGroupClassifyIds(Map<String, Object> paraMap) { public List<Long> getGroupClassifyIds(Map<String, Object> paraMap) {
return super.getSqlSession().selectList("getGroupClassifyIds",paraMap); return super.getSqlSession().selectList("getGroupClassifyIds",paraMap);
} }
......
...@@ -76,4 +76,7 @@ public class GroupActivity4AppletDTO implements Serializable { ...@@ -76,4 +76,7 @@ public class GroupActivity4AppletDTO implements Serializable {
@ApiModelProperty("关联社群书ID") @ApiModelProperty("关联社群书ID")
private Long relatedBookGroupId; private Long relatedBookGroupId;
@ApiModelProperty("群类型")
private Integer groupType;
} }
...@@ -6,6 +6,7 @@ import lombok.Data; ...@@ -6,6 +6,7 @@ import lombok.Data;
@Data @Data
public class QueryGroupActivityResponseVO { public class QueryGroupActivityResponseVO {
@ApiModelProperty("主键") @ApiModelProperty("主键")
private Integer id; private Integer id;
...@@ -72,4 +73,15 @@ public class QueryGroupActivityResponseVO { ...@@ -72,4 +73,15 @@ public class QueryGroupActivityResponseVO {
@ApiModelProperty("上下架") @ApiModelProperty("上下架")
private Integer isShow; private Integer isShow;
@ApiModelProperty("出版社Id")
private Long agentId;
@ApiModelProperty("出版社")
private String agentName;
@ApiModelProperty("编辑账号名")
private Long adviserId;
@ApiModelProperty("编辑账号名")
private String adviserName;
@ApiModelProperty("电话")
private String phone;
} }
...@@ -55,27 +55,28 @@ ...@@ -55,27 +55,28 @@
<select id="getList4Applet" resultType="com.pcloud.book.applet.dto.AppletGroupManageDTO"> <select id="getList4Applet" resultType="com.pcloud.book.applet.dto.AppletGroupManageDTO">
SELECT SELECT
a.id, a.id,
a.group_activity_id groupActivityId, a.group_activity_id groupActivityId,
b.`name`, b.`name`,
b.description as `desc`, b.description as `desc`,
b.book_group_classify_id AS classifyId, b.book_group_classify_id AS classifyId,
c.book_group_id bookGroupId, c.book_group_id bookGroupId,
c.price, c.price,
g.related_book_group_id relatedBookGroupId g.related_book_group_id relatedBookGroupId,
b.group_type as groupType
FROM FROM
applet_group_manage a applet_group_manage a
INNER JOIN pcloud_group_activity b ON a.group_activity_id = b.id AND b.is_delete = 0 LEFT JOIN pcloud_group_activity b ON a.group_activity_id = b.id AND b.is_delete = 0
INNER JOIN book_group_classify c ON b.book_group_classify_id = c.id AND c.is_delete = 0 LEFT JOIN book_group_classify c ON b.book_group_classify_id = c.id AND c.is_delete = 0
LEFT JOIN book_group g ON g.id = c.book_group_id LEFT JOIN book_group g ON g.id = c.book_group_id
WHERE a.enable=1 WHERE a.enable=1
<if test="recommend!=null"> <if test="recommend!=null">
AND a.recommend=#{recommend} AND a.recommend=#{recommend}
</if> </if>
<if test="name!=null"> <if test="name!=null">
AND b.name like concat('%',#{name},'%') AND b.name like concat('%',#{name},'%')
</if> </if>
ORDER BY a.seq_num, a.id DESC ORDER BY a.id DESC
</select> </select>
<select id="getMaxSeqNum" resultType="integer"> <select id="getMaxSeqNum" resultType="integer">
......
...@@ -1094,10 +1094,14 @@ ...@@ -1094,10 +1094,14 @@
a.classify, a.classify,
a.classify_introduce AS classifyIntroduce, a.classify_introduce AS classifyIntroduce,
a.price, a.price,
count(b.classify_id) AS groupCount a.create_user as adviserId,
count(b.classify_id) AS groupCount,
c.agent_id as agentId
FROM FROM
book_group_classify a LEFT JOIN book_group_qrcode b ON a.id = b.classify_id AND b.is_delete = 0 AND a.is_delete = 0 book_group_classify a
LEFT JOIN book_group c ON a.book_group_id = c. id LEFT JOIN book_group_qrcode b ON a.id = b.classify_id AND b.is_delete = 0 AND a.is_delete = 0
LEFT JOIN book_group c ON a.book_group_id = c. id
LEFT JOIN pcloud_group_activity activity on activity.book_group_classify_id = a.id
<where> <where>
<if test="name!=null or list.size()>0"> <if test="name!=null or list.size()>0">
<trim prefix="(" suffix=")" prefixOverrides="OR"> <trim prefix="(" suffix=")" prefixOverrides="OR">
...@@ -1118,6 +1122,21 @@ ...@@ -1118,6 +1122,21 @@
<if test="depLabelId!=null"> <if test="depLabelId!=null">
AND c.dep_label_id = #{depLabelId} AND c.dep_label_id = #{depLabelId}
</if> </if>
<if test="purLabelId!=null">
AND c.pur_label_id = #{purLabelId}
</if>
<if test="firstClassifyId!=null">
AND activity.first_classify = #{firstClassifyId}
</if>
<if test="subjectLabelId!=null">
AND activity.subject_label_id = #{subjectLabelId}
</if>
<if test="agentId!=null">
AND c.agent_id = #{agentId}
</if>
<if test="adviserId!=null">
AND a.create_user = #{adviserId}
</if>
</where> </where>
GROUP BY b.classify_id GROUP BY b.classify_id
HAVING groupCount > 0 HAVING groupCount > 0
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<insert id="batchInsert" parameterType="com.pcloud.book.rightsSetting.entity.RightsNowItem" useGeneratedKeys="true" keyProperty="id"> <insert id="batchInsert" parameterType="com.pcloud.book.rightsSetting.entity.RightsNowItem" useGeneratedKeys="true" keyProperty="id">
insert into rights_now_item ( insert into rights_now_item (
rights_setting_id, serve_id, serve_type, link_url, type, gift_coupon_package_id, create_time, rights_item_group_id, rights_setting_id, serve_id, serve_type, link_url, type, gift_coupon_package_id, create_time, rights_item_group_id,
rights_setting_title_id rights_setting_title_id,group_type
) values ) values
<foreach collection="list" item="item" index="index" separator=","> <foreach collection="list" item="item" index="index" separator=",">
( (
...@@ -64,7 +64,8 @@ ...@@ -64,7 +64,8 @@
#{item.giftCouponPackageId,jdbcType=BIGINT}, #{item.giftCouponPackageId,jdbcType=BIGINT},
NOW(), NOW(),
#{item.rightsItemGroupId,jdbcType=BIGINT}, #{item.rightsItemGroupId,jdbcType=BIGINT},
#{item.rightsSettingTitleId} #{item.rightsSettingTitleId},
#{item.groupType,jdbcType=VARCHAR},
) )
</foreach> </foreach>
</insert> </insert>
......
...@@ -104,44 +104,46 @@ ...@@ -104,44 +104,46 @@
<select id="getTishBookSchoolList" resultType="com.pcloud.book.skill.dto.GroupActivity4AppletDTO" parameterType="map" > <select id="getTishBookSchoolList" resultType="com.pcloud.book.skill.dto.GroupActivity4AppletDTO" parameterType="map" >
SELECT SELECT
a.id, a.id,
a.id groupActivityId, a.id groupActivityId,
a.`name`, a.`name`,
a.description as `desc`, a.description as `desc`,
a.join_type AS joinType, a.join_type AS joinType,
c.classify AS classifyName, c.classify AS classifyName,
a.book_group_classify_id classifyId, a.book_group_classify_id classifyId,
c.book_group_id bookGroupId, c.book_group_id bookGroupId,
a.first_classify AS firstClassify, a.first_classify AS firstClassify,
a.second_classify AS secondClassify, a.second_classify AS secondClassify,
a.grade_label_id AS gradeLabelId, a.grade_label_id AS gradeLabelId,
a.subject_label_id AS subjectLabelId, a.subject_label_id AS subjectLabelId,
c.id AS classifyId, d.related_book_group_id AS relatedBookGroupId,
c.book_group_id AS bookGroupId, c.id AS classifyId,
d.related_book_group_id AS relatedBookGroupId, c.book_group_id AS bookGroupId,
c.price AS price d.related_book_group_id AS relatedBookGroupId,
c.price AS price,
a.group_type as groupType
FROM FROM
pcloud_group_activity a pcloud_group_activity a
INNER JOIN book_group_classify c ON a.book_group_classify_id = c.id AND c.is_delete = 0 LEFT JOIN book_group_classify c ON a.book_group_classify_id = c.id AND c.is_delete = 0
INNER JOIN book_group_qrcode b ON b.classify_id = c.id AND b.is_delete = 0 LEFT JOIN book_group_qrcode b ON b.classify_id = c.id AND b.is_delete = 0
LEFT JOIN book_group d ON c.book_group_id = d.id LEFT JOIN book_group d ON c.book_group_id = d.id
WHERE WHERE
a.is_delete = 0 AND a.is_show = 1 a.is_delete = 0 AND a.is_show = 1
<if test="firstClassify != null"> <if test="firstClassify != null">
and a.first_classify = #{firstClassify} and a.first_classify = #{firstClassify}
</if> </if>
<if test="secondClassify != null"> <if test="secondClassify != null">
and a.second_classify = #{secondClassify} and a.second_classify = #{secondClassify}
</if> </if>
<if test="gradeLabelId != null"> <if test="gradeLabelId != null">
and a.grade_label_id = #{gradeLabelId} and a.grade_label_id = #{gradeLabelId}
</if> </if>
<if test="subjectLabelId != null"> <if test="subjectLabelId != null">
and a.subject_label_id = #{subjectLabelId} and a.subject_label_id = #{subjectLabelId}
</if> </if>
GROUP BY a.id GROUP BY a.id
ORDER BY a.id DESC ORDER BY a.id DESC
LIMIT #{limit} LIMIT #{limit}
</select> </select>
<select id="getById" resultMap="BaseResultMap" parameterType="long" > <select id="getById" resultMap="BaseResultMap" parameterType="long" >
...@@ -169,6 +171,33 @@ ...@@ -169,6 +171,33 @@
WHERE a.id = #{id,jdbcType=INTEGER} WHERE a.id = #{id,jdbcType=INTEGER}
</select> </select>
<!-- 立享权益加入 编辑端群 add by pansy 2020/7/2 -->
<select id="getGroupClassifyByIds" resultType="com.pcloud.book.skill.dto.GroupActivity4AppletDTO">
SELECT
c.id,
a.id groupActivityId,
a.`name`,
c.classify_introduce AS `desc`,
a.join_type AS joinType,
c.classify AS groupName,
b.user_number userNumber,
b.classify_id classifyId,
c.book_group_id bookGroupId,
a.first_classify AS firstClassify,
a.second_classify AS secondClassify,
a.grade_label_id AS gradeLabelId,
a.subject_label_id AS subjectLabelId
FROM
book_group_classify c
LEFT JOIN pcloud_group_activity a ON a.book_group_classify_id = c.id
LEFT JOIN book_group_qrcode b on b.classify_id = c.id AND b.is_delete = 0
<foreach collection="list" item="item" open="(" close=")" separator=",">
${item}
</foreach>
GROUP BY a.id
ORDER BY a.id DESC
</select>
<select id="getByIds" resultType="com.pcloud.book.skill.dto.GroupActivity4AppletDTO"> <select id="getByIds" resultType="com.pcloud.book.skill.dto.GroupActivity4AppletDTO">
SELECT SELECT
a.id, a.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