Commit b9ec0883 by gaopeng

社群码

parent 7268c451
...@@ -138,6 +138,13 @@ ...@@ -138,6 +138,13 @@
<artifactId>pcloud-facade-readercenter</artifactId> <artifactId>pcloud-facade-readercenter</artifactId>
<version>${pcloud-facade-readercenter.version}</version> <version>${pcloud-facade-readercenter.version}</version>
</dependency> </dependency>
<dependency>
<groupId>com.pcloud.facade</groupId>
<artifactId>pcloud-facade-labelcenter</artifactId>
<version>${pcloud-facade-labelcenter.version}</version>
</dependency>
<dependency> <dependency>
<groupId>fakepath</groupId> <groupId>fakepath</groupId>
<artifactId>jbarcode</artifactId> <artifactId>jbarcode</artifactId>
......
...@@ -33,7 +33,7 @@ import java.util.ArrayList; ...@@ -33,7 +33,7 @@ import java.util.ArrayList;
@ComponentScan("com.pcloud") @ComponentScan("com.pcloud")
@EnableEurekaClient @EnableEurekaClient
@EnableFeignClients("com.pcloud") @EnableFeignClients("com.pcloud")
@PropertySources(@PropertySource(value = "classpath:properties/book.properties")) @PropertySource({ "classpath:properties/book.properties", "classpath:public_system.properties" })
@Configuration @Configuration
@EnableSwagger2 @EnableSwagger2
public class BookApplication { public class BookApplication {
......
package com.pcloud.book.group.biz;
import java.util.Map;
import com.pcloud.book.group.dto.BookGroupDTO;
import com.pcloud.book.group.entity.BookGroup;
import com.pcloud.common.exceptions.BizException;
/**
* Description 社群书群二维码业务逻辑层接口
* Created by PENG on 2019/4/17.
*/
public interface BookGroupBiz {
/**
* 创建社群书时生成群二维码
* @param bookId 书刊ID
* @param channelId 运营ID
* @param adviserId 编辑ID
* @throws BizException
*/
BookGroup createBookGroupAfterCreateBook(Long bookId, Long channelId, Long adviserId) throws BizException;
/**
* 获取社群书群二维码信息
* @param bookGroupId 群二维码ID
* @return
* @throws BizException
*/
BookGroupDTO getBookGroupInfo(Long bookGroupId) throws BizException;
/**
* 获取社群书群二维码信息
* @param bookId 书刊ID
* @param channelId 运营ID
* @param adviserId 编辑ID
* @return
* @throws BizException
*/
BookGroupDTO getBookGroupInfoByBookId(Long bookId, Long channelId, Long adviserId) throws BizException;
/**
* 更新群二维码信息
* @param bookGroup 群二维码实体
* @throws BizException
*/
void updateBookGroup(BookGroup bookGroup) throws BizException;
/**
* 根据书刊ID删除
* @param bookId 书刊ID
* @param channelId 运营ID
* @param adviserId 编辑ID
* @throws BizException
*/
void deleteByBookId(Long bookId, Long channelId, Long adviserId) throws BizException;
/**
* 根据书刊ID恢复
* @param bookId 书刊ID
* @param channelId 运营ID
* @param adviserId 编辑ID
* @throws BizException
*/
void recoverByBookId(Long bookId, Long channelId, Long adviserId) throws BizException;
/**
* 根据社群码ID获取书名
* @param bookGroupId 社群码ID
* @return
* @throws BizException
*/
Map<String, Object> getBookNameByBookGroupId(Long bookGroupId) throws BizException;
}
package com.pcloud.book.group.dao;
import com.pcloud.book.group.dto.BookGroupDTO;
import com.pcloud.book.group.entity.BookGroup;
import com.pcloud.common.core.dao.BaseDao;
/**
* Description 社群书群二维码数据访问层接口
* Created by PENG on 2019/4/17.
*/
public interface BookGroupDao extends BaseDao<BookGroup> {
/**
* 获取DTO信息
* @param bookGroupId 群二维码ID
* @return
*/
BookGroupDTO getDTOById(Long bookGroupId);
/**
* 获取DTO信息
* @param bookId 书刊ID
* @param channelId 运营ID
* @param adviserId 编辑ID
* @return
*/
BookGroupDTO getDTOByBookId(Long bookId, Long channelId, Long adviserId);
/**
* 根据书刊ID删除
* @param bookId 书刊ID
* @param channelId 运营ID
* @param adviserId 编辑ID
* @return
*/
long deleteByBookId(Long bookId, Long channelId, Long adviserId);
/**
* 根据书刊ID恢复
* @param bookId 书刊ID
* @param channelId 运营ID
* @param adviserId 编辑ID
* @return
*/
long recoverByBookId(Long bookId, Long channelId, Long adviserId);
}
package com.pcloud.book.group.dao.impl;
import java.util.HashMap;
import java.util.Map;
import org.springframework.stereotype.Repository;
import com.pcloud.book.group.dao.BookGroupDao;
import com.pcloud.book.group.dto.BookGroupDTO;
import com.pcloud.book.group.entity.BookGroup;
import com.pcloud.common.core.dao.BaseDaoImpl;
/**
* Description 社群书群二维码数据访问层接口实现类
* Created by PENG on 2019/4/17.
*/
@Repository("bookGroupDao")
public class BookGroupDaoImpl extends BaseDaoImpl<BookGroup> implements BookGroupDao {
/**
* 获取DTO信息
*/
@Override
public BookGroupDTO getDTOById(Long bookGroupId) {
return super.getSqlSession().selectOne(getStatement("getDTOById"), bookGroupId);
}
/**
* 获取DTO信息
*/
@Override
public BookGroupDTO getDTOByBookId(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("getDTOByBookId"), paramMap);
}
/**
* 根据书刊ID删除
*/
@Override
public long deleteByBookId(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().update(getStatement("deleteByBookId"), paramMap);
}
/**
* 根据书刊ID恢复
*/
@Override
public long recoverByBookId(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().update(getStatement("recoverByBookId"), paramMap);
}
}
package com.pcloud.book.group.dto;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.pcloud.common.dto.BaseDto;
/**
* 社群书群二维码DTO
* @author PENG
* @date 2019年4月17日11:31:16
*/
public class BookGroupDTO extends BaseDto {
private static final long serialVersionUID = 7620868422261683212L;
/**
* book_group.id (唯一标识)
*/
private Long id;
/**
* book_group.book_id (书刊ID)
*/
private Long bookId;
/**
* book_group.channel_id (运营ID)
*/
private Long channelId;
/**
* book_group.group_qrcode_url (群二维码图片)
*/
private String groupQrcodeUrl;
/**
* book_group.group_qrcode_name (群二维码名称)
*/
private String groupQrcodeName;
/**
* book_group.pro_label_id (专业标签ID)
*/
private Long proLabelId;
/**
* 专业标签名称
*/
private String proLabelName;
/**
* book_group.dep_label_id (深度标签ID)
*/
private Long depLabelId;
/**
* 深度标签名称
*/
private String depLabelName;
/**
* book_group.pur_label_id (目的标签ID)
*/
private Long purLabelId;
/**
* 目的标签名称
*/
private String purLabelName;
/**
* 选择群页面标题
*/
private String joinTitle;
/**
* book_group.join_slogan (进群宣传语)
*/
private String joinSlogan;
/**
* book_group.personal_qrcode_url (个人二维码)
*/
private String personalQrcodeUrl;
/**
* book_group.product_id (商品ID)
*/
private Long productId;
/**
* book_group.create_user (创建人)
*/
private Long createUser;
/**
* book_group.create_time (创建时间)
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime;
/**
* book_group.update_time (修改时间)
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date updateTime;
/**
* book_group.is_delete (是否删除)
*/
private Boolean isDelete;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getBookId() {
return bookId;
}
public void setBookId(Long bookId) {
this.bookId = bookId;
}
public Long getChannelId() {
return channelId;
}
public void setChannelId(Long channelId) {
this.channelId = channelId;
}
public String getGroupQrcodeUrl() {
return groupQrcodeUrl;
}
public void setGroupQrcodeUrl(String groupQrcodeUrl) {
this.groupQrcodeUrl = groupQrcodeUrl;
}
public String getGroupQrcodeName() {
return groupQrcodeName;
}
public void setGroupQrcodeName(String groupQrcodeName) {
this.groupQrcodeName = groupQrcodeName;
}
public Long getProLabelId() {
return proLabelId;
}
public void setProLabelId(Long proLabelId) {
this.proLabelId = proLabelId;
}
public Long getDepLabelId() {
return depLabelId;
}
public void setDepLabelId(Long depLabelId) {
this.depLabelId = depLabelId;
}
public Long getPurLabelId() {
return purLabelId;
}
public void setPurLabelId(Long purLabelId) {
this.purLabelId = purLabelId;
}
public String getJoinTitle() {
return joinTitle;
}
public void setJoinTitle(String joinTitle) {
this.joinTitle = joinTitle;
}
public String getJoinSlogan() {
return joinSlogan;
}
public void setJoinSlogan(String joinSlogan) {
this.joinSlogan = joinSlogan;
}
public String getPersonalQrcodeUrl() {
return personalQrcodeUrl;
}
public void setPersonalQrcodeUrl(String personalQrcodeUrl) {
this.personalQrcodeUrl = personalQrcodeUrl;
}
public Long getProductId() {
return productId;
}
public void setProductId(Long productId) {
this.productId = productId;
}
public Long getCreateUser() {
return createUser;
}
public void setCreateUser(Long createUser) {
this.createUser = createUser;
}
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Boolean getIsDelete() {
return isDelete;
}
public void setIsDelete(Boolean isDelete) {
this.isDelete = isDelete;
}
public String getProLabelName() {
return proLabelName;
}
public void setProLabelName(String proLabelName) {
this.proLabelName = proLabelName;
}
public String getDepLabelName() {
return depLabelName;
}
public void setDepLabelName(String depLabelName) {
this.depLabelName = depLabelName;
}
public String getPurLabelName() {
return purLabelName;
}
public void setPurLabelName(String purLabelName) {
this.purLabelName = purLabelName;
}
@Override
public String toString() {
return "BookGroupDTO{" +
"id=" + id +
", bookId=" + bookId +
", channelId=" + channelId +
", groupQrcodeUrl='" + groupQrcodeUrl + '\'' +
", groupQrcodeName='" + groupQrcodeName + '\'' +
", proLabelId=" + proLabelId +
", proLabelName='" + proLabelName + '\'' +
", depLabelId=" + depLabelId +
", depLabelName='" + depLabelName + '\'' +
", purLabelId=" + purLabelId +
", purLabelName='" + purLabelName + '\'' +
", joinTitle='" + joinTitle + '\'' +
", joinSlogan='" + joinSlogan + '\'' +
", personalQrcodeUrl='" + personalQrcodeUrl + '\'' +
", productId=" + productId +
", createUser=" + createUser +
", createTime=" + createTime +
", updateTime=" + updateTime +
", isDelete=" + isDelete +
"} " + super.toString();
}
}
\ No newline at end of file
package com.pcloud.book.group.entity;
import java.util.Date;
import com.pcloud.common.entity.BaseEntity;
/**
* 社群书群二维码实体
* @author PENG
* @date 2019年4月17日11:31:16
*/
public class BookGroup extends BaseEntity {
private static final long serialVersionUID = 7446049698462097220L;
/**
* book_group.id (唯一标识)
*/
private Long id;
/**
* book_group.book_id (书刊ID)
*/
private Long bookId;
/**
* book_group.channel_id (运营ID)
*/
private Long channelId;
/**
* book_group.group_qrcode_url (群二维码图片)
*/
private String groupQrcodeUrl;
/**
* book_group.group_qrcode_name (群二维码名称)
*/
private String groupQrcodeName;
/**
* book_group.pro_label_id (专业标签ID)
*/
private Long proLabelId;
/**
* book_group.dep_label_id (深度标签ID)
*/
private Long depLabelId;
/**
* book_group.pur_label_id (目的标签ID)
*/
private Long purLabelId;
/**
* 选择群页面标题
*/
private String joinTitle;
/**
* book_group.join_slogan (进群宣传语)
*/
private String joinSlogan;
/**
* book_group.personal_qrcode_url (个人二维码)
*/
private String personalQrcodeUrl;
/**
* book_group.product_id (商品ID)
*/
private Long productId;
/**
* book_group.create_user (创建人)
*/
private Long createUser;
/**
* book_group.create_time (创建时间)
*/
private Date createTime;
/**
* book_group.update_time (修改时间)
*/
private Date updateTime;
/**
* book_group.is_delete (是否删除)
*/
private Boolean isDelete;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getBookId() {
return bookId;
}
public void setBookId(Long bookId) {
this.bookId = bookId;
}
public Long getChannelId() {
return channelId;
}
public void setChannelId(Long channelId) {
this.channelId = channelId;
}
public String getGroupQrcodeUrl() {
return groupQrcodeUrl;
}
public void setGroupQrcodeUrl(String groupQrcodeUrl) {
this.groupQrcodeUrl = groupQrcodeUrl;
}
public String getGroupQrcodeName() {
return groupQrcodeName;
}
public void setGroupQrcodeName(String groupQrcodeName) {
this.groupQrcodeName = groupQrcodeName;
}
public Long getProLabelId() {
return proLabelId;
}
public void setProLabelId(Long proLabelId) {
this.proLabelId = proLabelId;
}
public Long getDepLabelId() {
return depLabelId;
}
public void setDepLabelId(Long depLabelId) {
this.depLabelId = depLabelId;
}
public Long getPurLabelId() {
return purLabelId;
}
public void setPurLabelId(Long purLabelId) {
this.purLabelId = purLabelId;
}
public String getJoinTitle() {
return joinTitle;
}
public void setJoinTitle(String joinTitle) {
this.joinTitle = joinTitle;
}
public String getJoinSlogan() {
return joinSlogan;
}
public void setJoinSlogan(String joinSlogan) {
this.joinSlogan = joinSlogan;
}
public String getPersonalQrcodeUrl() {
return personalQrcodeUrl;
}
public void setPersonalQrcodeUrl(String personalQrcodeUrl) {
this.personalQrcodeUrl = personalQrcodeUrl;
}
public Long getProductId() {
return productId;
}
public void setProductId(Long productId) {
this.productId = productId;
}
public Long getCreateUser() {
return createUser;
}
public void setCreateUser(Long createUser) {
this.createUser = createUser;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Boolean getIsDelete() {
return isDelete;
}
public void setIsDelete(Boolean isDelete) {
this.isDelete = isDelete;
}
@Override
public String toString() {
return "BookGroup{" +
"id=" + id +
", bookId=" + bookId +
", channelId=" + channelId +
", groupQrcodeUrl='" + groupQrcodeUrl + '\'' +
", groupQrcodeName='" + groupQrcodeName + '\'' +
", proLabelId=" + proLabelId +
", depLabelId=" + depLabelId +
", purLabelId=" + purLabelId +
", joinTitle='" + joinTitle + '\'' +
", joinSlogan='" + joinSlogan + '\'' +
", personalQrcodeUrl='" + personalQrcodeUrl + '\'' +
", productId=" + productId +
", createUser=" + createUser +
", createTime=" + createTime +
", updateTime=" + updateTime +
", isDelete=" + isDelete +
"} " + super.toString();
}
}
\ No newline at end of file
package com.pcloud.book.group.facade;
import org.codehaus.jackson.JsonParseException;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import com.pcloud.book.group.entity.BookGroup;
import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.permission.PermissionException;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
/**
* Description 社群书群二维码接口
* Created by PENG on 2019/4/17.
*/
@FeignClient(value = "pcloud-service-book", qualifier = "bookGroupFacadeCloud", path = "bookGroup")
@Api(description = "社群书群二维码接口")
public interface BookGroupFacade {
/**
* 获取社群书群二维码信息
* @param token 用户身份信息
* @param bookGroupId 群二维码ID
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "获取社群书群二维码信息", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "用户身份信息", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "bookGroupId", value = "群二维码ID", dataType = "long", paramType = "query")
})
@RequestMapping(value = "getBookGroupInfo", method = RequestMethod.GET)
ResponseDto<?> getBookGroupInfo(@RequestHeader("token") String token, @RequestParam(value = "bookGroupId", required = false) Long bookGroupId)
throws BizException, PermissionException, JsonParseException;
/**
* 获取社群书群二维码信息
* @param token 用户身份信息
* @param bookId 书刊ID
* @param channelId 运营ID
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "获取社群书群二维码信息", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "用户身份信息", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "bookId", value = "书刊ID", dataType = "long", paramType = "query"),
@ApiImplicitParam(name = "channelId", value = "运营ID", dataType = "long", paramType = "query")
})
@RequestMapping(value = "getBookGroupInfoByBookId", method = RequestMethod.GET)
ResponseDto<?> getBookGroupInfoByBookId(@RequestHeader("token") String token, @RequestParam(value = "bookId", required = false) Long bookId,
@RequestParam(value = "channelId", required = false) Long channelId) throws BizException, PermissionException, JsonParseException;
/**
* 更新群二维码信息
* @param token 用户身份信息
* @param bookGroup 群二维码实体
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "更新群二维码信息", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "用户身份信息", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "bookGroup", value = "群二维码实体", dataType = "BookGroup", paramType = "body")
})
@RequestMapping(value = "updateBookGroup", method = RequestMethod.POST)
ResponseDto<?> updateBookGroup(@RequestHeader("token") String token, @RequestBody BookGroup bookGroup)
throws BizException, PermissionException, JsonParseException;
/**
* 根据社群码ID获取书名
* @param bookGroupId 社群码ID
* @return
* @throws BizException
* @throws PermissionException
* @throws JsonParseException
*/
@ApiOperation(value = "根据社群码ID获取书名", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "bookGroupId", value = "社群码ID", dataType = "long", paramType = "query")
})
@RequestMapping(value = "getBookNameByBookGroupId", method = RequestMethod.GET)
ResponseDto<?> getBookNameByBookGroupId(@RequestParam(value = "bookGroupId", required = false) Long bookGroupId)
throws BizException, PermissionException, JsonParseException;
}
package com.pcloud.book.group.facade.impl;
import org.codehaus.jackson.JsonParseException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.pcloud.book.base.exception.BookBizException;
import com.pcloud.book.group.biz.BookGroupBiz;
import com.pcloud.book.group.entity.BookGroup;
import com.pcloud.book.group.facade.BookGroupFacade;
import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.permission.PermissionException;
import com.pcloud.common.utils.SessionUtil;
/**
* Description 社群书群二维码接口实现类
* Created by PENG on 2019/4/17.
*/
@RestController("bookGroupFacade")
@RequestMapping("bookGroup")
public class BookGroupFacadeImpl implements BookGroupFacade {
@Autowired
private BookGroupBiz bookGroupBiz;
/**
* 获取社群书群二维码信息
*/
@Override
@RequestMapping(value = "getBookGroupInfo", method = RequestMethod.GET)
public ResponseDto<?> getBookGroupInfo(@RequestHeader("token") String token, @RequestParam(value = "bookGroupId", required = false) Long bookGroupId)
throws BizException, PermissionException, JsonParseException {
if (null == bookGroupId) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "参数有误!");
}
SessionUtil.getToken4Redis(token);
return new ResponseDto<>(bookGroupBiz.getBookGroupInfo(bookGroupId));
}
/**
* 获取社群书群二维码信息
*/
@Override
@RequestMapping(value = "getBookGroupInfoByBookId", method = RequestMethod.GET)
public ResponseDto<?> getBookGroupInfoByBookId(@RequestHeader("token") String token, @RequestParam(value = "bookId", required = false) Long bookId,
@RequestParam(value = "channelId", required = false) Long channelId) throws BizException, PermissionException, JsonParseException {
if (null == bookId || null == channelId) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "参数有误!");
}
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
return new ResponseDto<>(bookGroupBiz.getBookGroupInfoByBookId(bookId, channelId, adviserId));
}
/**
* 更新群二维码信息
*/
@Override
@RequestMapping(value = "updateBookGroup", method = RequestMethod.POST)
public ResponseDto<?> updateBookGroup(@RequestHeader("token") String token, @RequestBody BookGroup bookGroup)
throws BizException, PermissionException, JsonParseException {
if (null == bookGroup) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "参数有误!");
}
bookGroupBiz.updateBookGroup(bookGroup);
return new ResponseDto<>();
}
/**
* 根据社群码ID获取书名
*/
@Override
@RequestMapping(value = "getBookNameByBookGroupId", method = RequestMethod.GET)
public ResponseDto<?> getBookNameByBookGroupId(@RequestParam(value = "bookGroupId", required = false) Long bookGroupId)
throws BizException, PermissionException, JsonParseException {
if (null == bookGroupId) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "参数有误!");
}
return new ResponseDto<>(bookGroupBiz.getBookNameByBookGroupId(bookGroupId));
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "mybatis-3-mapper.dtd" >
<mapper namespace="com.pcloud.book.group.dao.impl.BookGroupDaoImpl">
<resultMap id="BaseResultMap" type="com.pcloud.book.group.entity.BookGroup">
<id column="id" property="id" jdbcType="BIGINT"/>
<result column="book_id" property="bookId" jdbcType="BIGINT"/>
<result column="channel_id" property="channelId" jdbcType="BIGINT"/>
<result column="group_qrcode_url" property="groupQrcodeUrl" jdbcType="VARCHAR"/>
<result column="group_qrcode_name" property="groupQrcodeName" jdbcType="VARCHAR"/>
<result column="pro_label_id" property="proLabelId" jdbcType="BIGINT"/>
<result column="dep_label_id" property="depLabelId" jdbcType="BIGINT"/>
<result column="pur_label_id" property="purLabelId" jdbcType="BIGINT"/>
<result column="join_title" property="joinTitle" jdbcType="VARCHAR"/>
<result column="join_slogan" property="joinSlogan" jdbcType="VARCHAR"/>
<result column="personal_qrcode_url" property="personalQrcodeUrl" jdbcType="VARCHAR"/>
<result column="product_id" property="productId" jdbcType="BIGINT"/>
<result column="create_user" property="createUser" jdbcType="BIGINT"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
<result column="is_delete" property="isDelete" jdbcType="BIT"/>
</resultMap>
<resultMap id="BookGroupDTO" type="com.pcloud.book.group.dto.BookGroupDTO">
<id column="id" property="id" jdbcType="BIGINT"/>
<result column="book_id" property="bookId" jdbcType="BIGINT"/>
<result column="channel_id" property="channelId" jdbcType="BIGINT"/>
<result column="group_qrcode_url" property="groupQrcodeUrl" jdbcType="VARCHAR"/>
<result column="group_qrcode_name" property="groupQrcodeName" jdbcType="VARCHAR"/>
<result column="pro_label_id" property="proLabelId" jdbcType="BIGINT"/>
<result column="dep_label_id" property="depLabelId" jdbcType="BIGINT"/>
<result column="pur_label_id" property="purLabelId" jdbcType="BIGINT"/>
<result column="join_title" property="joinTitle" jdbcType="VARCHAR"/>
<result column="join_slogan" property="joinSlogan" jdbcType="VARCHAR"/>
<result column="personal_qrcode_url" property="personalQrcodeUrl" jdbcType="VARCHAR"/>
<result column="product_id" property="productId" jdbcType="BIGINT"/>
<result column="create_user" property="createUser" jdbcType="BIGINT"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
<result column="is_delete" property="isDelete" jdbcType="BIT"/>
</resultMap>
<sql id="Base_Column_List">
id, book_id, channel_id, group_qrcode_url, group_qrcode_name, pro_label_id, dep_label_id,
pur_label_id, join_title, join_slogan, personal_qrcode_url, product_id, create_user, create_time,
update_time, is_delete
</sql>
<select id="getById" resultMap="BaseResultMap" parameterType="java.lang.Long">
select
<include refid="Base_Column_List"/>
from book_group
where id = #{id,jdbcType=BIGINT}
</select>
<select id="getDTOById" resultMap="BookGroupDTO" parameterType="java.lang.Long">
select
<include refid="Base_Column_List"/>
from book_group
where id = #{id,jdbcType=BIGINT}
</select>
<select id="getDTOByBookId" resultMap="BookGroupDTO" parameterType="map">
select
<include refid="Base_Column_List"/>
from book_group
where book_id = #{bookId,jdbcType=BIGINT}
and channel_id = #{channelId,jdbcType=BIGINT}
and create_user = #{adviserId,jdbcType=BIGINT}
</select>
<delete id="deleteById" parameterType="java.lang.Long">
update book_group set is_delete = 1
where id = #{id,jdbcType=BIGINT} and is_delete = 0
</delete>
<update id="deleteByBookId" parameterType="map">
update book_group set is_delete = 1
where book_id = #{bookId,jdbcType=BIGINT}
and channel_id = #{channelId,jdbcType=BIGINT}
and create_user = #{adviserId,jdbcType=BIGINT}
and is_delete = 0
</update>
<update id="recoverByBookId" parameterType="map">
update book_group set is_delete = 0
where book_id = #{bookId,jdbcType=BIGINT}
and channel_id = #{channelId,jdbcType=BIGINT}
and create_user = #{adviserId,jdbcType=BIGINT}
and is_delete = 1
</update>
<insert id="insert" parameterType="com.pcloud.book.group.entity.BookGroup" useGeneratedKeys="true"
keyProperty="id">
insert into book_group
<trim prefix="(" suffix=")" suffixOverrides=",">
book_id,
channel_id,
group_qrcode_url,
group_qrcode_name,
pro_label_id,
dep_label_id,
pur_label_id,
join_title,
join_slogan,
personal_qrcode_url,
product_id,
create_user,
create_time,
update_time,
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
#{bookId,jdbcType=BIGINT},
#{channelId,jdbcType=BIGINT},
#{groupQrcodeUrl,jdbcType=VARCHAR},
#{groupQrcodeName,jdbcType=VARCHAR},
#{proLabelId,jdbcType=BIGINT},
#{depLabelId,jdbcType=BIGINT},
#{purLabelId,jdbcType=BIGINT},
#{joinTitle,jdbcType=VARCHAR},
#{joinSlogan,jdbcType=VARCHAR},
#{personalQrcodeUrl,jdbcType=VARCHAR},
#{productId,jdbcType=BIGINT},
#{createUser,jdbcType=BIGINT},
NOW(),
NOW(),
</trim>
</insert>
<update id="update" parameterType="com.pcloud.book.group.entity.BookGroup">
update book_group
<set>
<if test="bookId != null">
book_id = #{bookId,jdbcType=BIGINT},
</if>
<if test="channelId != null">
channel_id = #{channelId,jdbcType=BIGINT},
</if>
<if test="groupQrcodeUrl != null">
group_qrcode_url = #{groupQrcodeUrl,jdbcType=VARCHAR},
</if>
<if test="groupQrcodeName != null">
group_qrcode_name = #{groupQrcodeName,jdbcType=VARCHAR},
</if>
<if test="proLabelId != null">
pro_label_id = #{proLabelId,jdbcType=BIGINT},
</if>
<if test="depLabelId != null">
dep_label_id = #{depLabelId,jdbcType=BIGINT},
</if>
<if test="purLabelId != null">
pur_label_id = #{purLabelId,jdbcType=BIGINT},
</if>
<if test="joinTitle != null">
join_title = #{joinTitle,jdbcType=VARCHAR},
</if>
<if test="joinSlogan != null">
join_slogan = #{joinSlogan,jdbcType=VARCHAR},
</if>
<if test="personalQrcodeUrl != null">
personal_qrcode_url = #{personalQrcodeUrl,jdbcType=VARCHAR},
</if>
<if test="productId != null">
product_id = #{productId,jdbcType=BIGINT},
</if>
update_time = NOW(),
</set>
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
...@@ -117,6 +117,7 @@ ...@@ -117,6 +117,7 @@
<pcloud-facade-contentcenter.version>2.1.0-SNAPSHOT</pcloud-facade-contentcenter.version> <pcloud-facade-contentcenter.version>2.1.0-SNAPSHOT</pcloud-facade-contentcenter.version>
<pcloud-facade-tradecenter.version>2.1.0-RELEASE</pcloud-facade-tradecenter.version> <pcloud-facade-tradecenter.version>2.1.0-RELEASE</pcloud-facade-tradecenter.version>
<pcloud-facade-readercenter.version>2.1.0-RELEASE</pcloud-facade-readercenter.version> <pcloud-facade-readercenter.version>2.1.0-RELEASE</pcloud-facade-readercenter.version>
<pcloud-facade-labelcenter.version>2.1.0-RELEASE</pcloud-facade-labelcenter.version>
</properties> </properties>
<dependencyManagement> <dependencyManagement>
......
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