Commit 8c843902 by 郑永强

feat: [1006277] H5落地页新增新的风格

parent dca47acc
package com.pcloud.book.consumer.promotion;
import cn.hutool.core.collection.CollUtil;
import com.pcloud.common.core.aspect.ParamLog;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.utils.ResponseHandleUtil;
import com.pcloud.promotion.couponsnew.dto.CouponMapRequestDto;
import com.pcloud.promotion.couponsnew.dto.CouponsNewDto;
import com.pcloud.promotion.couponsnew.service.CouponsNewService;
import com.pcloud.promotion.fission.dto.UpdateQrDTO;
import com.pcloud.promotion.groupFission.service.GroupFissionService;
......@@ -11,6 +15,10 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Component("promotionConsr")
public class PromotionConsr {
/**
......@@ -21,6 +29,8 @@ public class PromotionConsr {
@Autowired
private GroupFissionService groupFissionService;
@Autowired
private CouponsNewService couponsNewService;
@ParamLog("获取备用二维码")
public String getSpareQr() throws BizException {
......@@ -40,4 +50,20 @@ public class PromotionConsr {
LOGGER.warn("同步更新二维码失败:" + e.getMessage(), e);
}
}
@ParamLog("获取优惠券信息")
public Map<Long, CouponsNewDto> mapByCouponIds(List<Long> couponsIds, Long wechatUserId) throws BizException {
if(CollUtil.isEmpty(couponsIds)){
return new HashMap<>();
}
try {
CouponMapRequestDto dto = new CouponMapRequestDto();
dto.setCouponIds(couponsIds);
dto.setWechatUserId(wechatUserId);
return ResponseHandleUtil.parseMap(couponsNewService.mapByCouponIds(dto), Long.class, CouponsNewDto.class);
} catch (Exception e) {
LOGGER.warn("同步更新二维码失败:" + e.getMessage(), e);
}
return new HashMap<>();
}
}
package com.pcloud.book.group.biz;
import com.pcloud.book.group.entity.ResourcePageBookstore;
import com.pcloud.book.group.enums.ResourcePageFixtureTypeEnum;
import com.pcloud.book.group.vo.ResourcePageBookstoreVO;
import com.pcloud.common.page.PageBeanNew;
import java.util.List;
......@@ -43,7 +44,7 @@ public interface ResourcePageBookstoreBiz {
*/
void deleteById(Long id);
void deleteByResourcePageId(Long resourcePageId);
void deleteByResourcePageId(Long resourcePageId, Integer fixtureType);
List<ResourcePageBookstoreVO> getByResourcePageId(Long resourcePageId, Long channelId);
List<ResourcePageBookstoreVO> getByResourcePageId(Long resourcePageId, Long channelId, Long wechatUserId, ResourcePageFixtureTypeEnum fixtureTypeEnum);
}
package com.pcloud.book.group.biz.impl;
import cn.hutool.core.util.ObjectUtil;
import com.google.common.collect.Lists;
import com.pcloud.advertising.advertising.dto.AdvertisingSpaceDTO;
......@@ -89,6 +90,7 @@ import com.pcloud.book.group.entity.ResourcePageTool;
import com.pcloud.book.group.entity.ResourcePageWxwork;
import com.pcloud.book.group.entity.ResourceRecomManage;
import com.pcloud.book.group.enums.PageLandingPageTypeEnum;
import com.pcloud.book.group.enums.ResourcePageFixtureTypeEnum;
import com.pcloud.book.group.mapper.ResourcePageShareMapper;
import com.pcloud.book.group.tools.SendWeixinRequestTools;
import com.pcloud.book.group.vo.CrmContactQrcodeVO;
......@@ -175,6 +177,7 @@ import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.function.Function;
import java.util.stream.Collectors;
import cn.hutool.core.collection.CollUtil;
......@@ -861,15 +864,17 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
}
// 加载实体书购买
this.fillBookStore(resourcePageVO);
// 加载固定项
this.fillFixture(resourcePageVO);
//加载导航
this.fillNavigation(resourcePageVO);
this.fillNavigation(resourcePageVO, null);
return resourcePageVO;
}
/**
* 加载导航
*/
private void fillNavigation(ResourcePageVO resourcePageVO) {
private void fillNavigation(ResourcePageVO resourcePageVO, Long wechatUserId) {
if(resourcePageVO == null || resourcePageVO.getId() == null){
return;
}
......@@ -881,21 +886,80 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
this.addDefaultBookServeNavigation(resourcePageId);
navigations = resourcePageNavigationDao.getByPageId(resourcePageId);
}
// 加载跳转数据
this.fillCustomServe(navigations, wechatUserId);
resourcePageVO.setNavigationList(navigations);
}
}
/**
* 加载菜单跳转应用数据
*/
private void fillCustomServe(List<ResourcePageNavigation> navigations, Long wechatUserId) {
if(CollUtil.isEmpty(navigations)){
return;
}
List<Long> appIds = navigations.stream().filter(x -> ObjectUtil.equal(ResourcePageConstants.NavigationTypeEnum.CUSTOM_SERVE.getCode(), x.getNavigationType()) && ObjectUtil.equal("APP", x.getServeType())).map(x -> x.getServeId()).collect(Collectors.toList());
if(CollUtil.isEmpty(appIds)){
return;
}
// 对象转换
List<ResourcePageItemVO> list = CollUtil.toList();
for (ResourcePageNavigation navigation : navigations) {
if(ObjectUtil.notEqual(ResourcePageConstants.NavigationTypeEnum.CUSTOM_SERVE.getCode(), navigation.getNavigationType())
|| ObjectUtil.notEqual("APP", navigation.getServeType())){
continue;
}
ResourcePageItemVO itemVO = new ResourcePageItemVO();
itemVO.setServeId(navigation.getServeId());
itemVO.setServeType(navigation.getServeType());
itemVO.setLinkUrl(navigation.getLinkUrl());
itemVO.setTypeCode(navigation.getTypeCode());
itemVO.setCreateUser(navigation.getCreateUser());
list.add(itemVO);
}
// 填充应用跳转信息
this.fillAppProductServe(list, wechatUserId);
Map<Long, ResourcePageItemVO> itemVOMap = list.stream().collect(Collectors.toMap(x -> x.getServeId(), Function.identity(), (v1, v2) -> v1));
// 填充参数
for (ResourcePageNavigation navigation : navigations) {
if(ObjectUtil.notEqual(ResourcePageConstants.NavigationTypeEnum.CUSTOM_SERVE.getCode(), navigation.getNavigationType())
|| ObjectUtil.notEqual("APP", navigation.getServeType()) || !itemVOMap.containsKey(navigation.getServeId())){
continue;
}
ResourcePageItemVO itemVO = itemVOMap.get(navigation.getServeId());
navigation.setServeName(itemVO.getServeName());
navigation.setServePic(itemVO.getServePic());
navigation.setTypeCode(itemVO.getTypeCode());
navigation.setTypeName(itemVO.getTypeName());
navigation.setHasThirdLink(itemVO.getHasThirdLink());
navigation.setHasOfficialAccountsTool(itemVO.getHasOfficialAccountsTool());
navigation.setResultUrl(itemVO.getResultUrl());
}
}
/**
* 加载实体书购买
*/
private void fillBookStore(ResourcePageVO resourcePageVO) {
if(resourcePageVO == null || resourcePageVO.getId() == null){
return;
}
List<ResourcePageBookstoreVO> resourcePageBookstoreList = resourcePageBookstoreBiz.getByResourcePageId(resourcePageVO.getId(), resourcePageVO.getChannelId());
List<ResourcePageBookstoreVO> resourcePageBookstoreList = resourcePageBookstoreBiz.getByResourcePageId(resourcePageVO.getId(), resourcePageVO.getChannelId(), null, ResourcePageFixtureTypeEnum.BOOKSTORE);
resourcePageVO.setResourcePageBookstoreList(resourcePageBookstoreList);
}
/**
* 加载固定项
*/
private void fillFixture(ResourcePageVO resourcePageVO) {
if(resourcePageVO == null || resourcePageVO.getId() == null){
return;
}
List<ResourcePageBookstoreVO> resourcePageBookstoreList = resourcePageBookstoreBiz.getByResourcePageId(resourcePageVO.getId(), resourcePageVO.getChannelId(), null, ResourcePageFixtureTypeEnum.COUPONS);
resourcePageVO.setResourcePageCouponList(resourcePageBookstoreList);
}
@Override
public List<ResourceColumnAndServeVO> getColumnAndServeListByPageId(Long resourcePageId, Long wechatUserId, Long bookId, Long adviserId, Long channelId, Integer enableAdverting, Long navigationId) {
/* //上邮临时处理方案
......@@ -1652,14 +1716,9 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
}
// 更新实体书购买
List<ResourcePageBookstore> resourcePageBookstoreList = updateResourcePageVO.getResourcePageBookstoreList();
resourcePageBookstoreBiz.deleteByResourcePageId(resourcePageId);
if(CollUtil.isNotEmpty(resourcePageBookstoreList)){
for (ResourcePageBookstore bookstore : resourcePageBookstoreList) {
bookstore.setResourcePageId(resourcePageId);
}
resourcePageBookstoreBiz.insert(resourcePageBookstoreList);
}
this.updateResourcePageBookstore(resourcePageId, updateResourcePageVO.getResourcePageBookstoreList(), ResourcePageFixtureTypeEnum.BOOKSTORE);
// 更新优惠券
this.updateResourcePageBookstore(resourcePageId, updateResourcePageVO.getResourcePageCouponList(), ResourcePageFixtureTypeEnum.COUPONS);
//发送编辑任务queue
adviserTaskConsr.sendAdviserTaskQueue(updateResourcePageVO.getCreateUser(), AdviserTaskConstants.TargetTypeEnum.QRCODE.getValue(),
......@@ -1673,6 +1732,16 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
return resourcePageId;
}
private void updateResourcePageBookstore(Long resourcePageId, List<ResourcePageBookstore> resourcePageBookstoreList, ResourcePageFixtureTypeEnum fixtureTypeEnum) {
resourcePageBookstoreBiz.deleteByResourcePageId(resourcePageId, fixtureTypeEnum.fixtureType);
if (CollUtil.isNotEmpty(resourcePageBookstoreList)) {
for (ResourcePageBookstore bookstore : resourcePageBookstoreList) {
bookstore.setResourcePageId(resourcePageId);
}
resourcePageBookstoreBiz.insert(resourcePageBookstoreList);
}
}
/**
* 配置会员活动,发topic
* @author:zhuyajie
......@@ -1726,13 +1795,15 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
ResourcePageCollect collect = resourcePageCollectDao.getCollectRecordByUser(wechatUserId, resourcePageVO.getId());
resourcePageVO.setCollectState(null == collect ? 0 : 1);
// 实体店铺
resourcePageVO.setResourcePageBookstoreList(resourcePageBookstoreBiz.getByResourcePageId(resourcePageVO.getId(), resourcePageVO.getChannelId()));
resourcePageVO.setResourcePageBookstoreList(resourcePageBookstoreBiz.getByResourcePageId(resourcePageVO.getId(), resourcePageVO.getChannelId(), wechatUserId, ResourcePageFixtureTypeEnum.BOOKSTORE));
// 优惠券
resourcePageVO.setResourcePageCouponList(resourcePageBookstoreBiz.getByResourcePageId(resourcePageVO.getId(), resourcePageVO.getChannelId(), wechatUserId, ResourcePageFixtureTypeEnum.COUPONS));
}
if (null != resourcePageVO.getAdviserId()) {
resourcePageVO.setPushTextOpenStatus(qrcodeSceneConsr.getPushTextOpenStatus(resourcePageVO.getAdviserId()));
}
//加载导航
this.fillNavigation(resourcePageVO);
this.fillNavigation(resourcePageVO, wechatUserId);
//加载企业微信落地页信息
this.fillWxworkPage(resourcePageVO);
return resourcePageVO;
......@@ -1840,6 +1911,7 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
resourcePageVO.setWatermarkStyle(resourcePage.getWatermarkStyle());
resourcePageVO.setLandingPageType(resourcePage.getLandingPageType());
resourcePageVO.setTransparency(resourcePage.getTransparency());
resourcePageVO.setNavigationJumpType(resourcePage.getNavigationJumpType());
}
return resourcePageVO;
}
......@@ -2788,8 +2860,8 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
this.updateOwnMessage4Qr(null == resourcePage ? null : resourcePage.getSceneId());
});
}
//修改导航样式,版式
resourcePageDao.updateNavigationFormat(navigationParamDTO.getResourcePageId(), navigationParamDTO.getNavigationColor(),navigationParamDTO.getNavigationFormat());
//修改导航样式,版式,菜单跳转模式
resourcePageDao.updateNavigationFormat(navigationParamDTO.getResourcePageId(), navigationParamDTO.getNavigationColor(),navigationParamDTO.getNavigationFormat(), navigationParamDTO.getNavigationJumpType());
}
private void checkNavigationList(NavigationParamDTO navigationParamDTO) {
......@@ -3163,7 +3235,7 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
this.deleteNavigation(id);
}
}
resourcePageBookstoreBiz.deleteByResourcePageId(resourcePage.getId());
resourcePageBookstoreBiz.deleteByResourcePageId(resourcePage.getId(), null);
}
});
}
......
......@@ -5,19 +5,21 @@ import cn.hutool.core.util.ObjectUtil;
import com.pcloud.appcenter.app.dto.AppDto;
import com.pcloud.book.consumer.app.AppConsr;
import com.pcloud.book.consumer.channel.QrcodeSceneConsr;
import com.pcloud.book.consumer.promotion.PromotionConsr;
import com.pcloud.book.consumer.resource.ProductConsr;
import com.pcloud.book.group.entity.ResourcePageBookstore;
import com.pcloud.book.group.dao.ResourcePageBookstoreDao;
import com.pcloud.book.group.biz.ResourcePageBookstoreBiz;
import com.pcloud.book.group.enums.ResourcePageFixtureTypeEnum;
import com.pcloud.book.group.tools.SendWeixinRequestTools;
import com.pcloud.book.group.vo.ResourcePageBookstoreVO;
import com.pcloud.channelcenter.wechat.dto.AccountSettingDto;
import com.pcloud.common.core.aspect.ParamLog;
import com.pcloud.common.page.PageBeanNew;
import com.pcloud.common.page.PageParam;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.utils.ListUtils;
import com.pcloud.common.utils.NumberUtil;
import com.pcloud.promotion.couponsnew.dto.CouponsNewDto;
import com.pcloud.resourcecenter.product.dto.ProductDto;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -46,6 +48,8 @@ public class ResourcePageBookstoreBizImpl implements ResourcePageBookstoreBiz {
private ProductConsr productConsr;
@Autowired
private QrcodeSceneConsr qrcodeSceneConsr;
@Autowired
private PromotionConsr promotionConsr;
@Override
public ResourcePageBookstore getById(Long id) {
......@@ -89,16 +93,43 @@ public class ResourcePageBookstoreBizImpl implements ResourcePageBookstoreBiz {
}
@Override
public void deleteByResourcePageId(Long resourcePageId) {
resourcePageBookstoreDao.deleteByResourcePageId(resourcePageId);
public void deleteByResourcePageId(Long resourcePageId, Integer fixtureType) {
resourcePageBookstoreDao.deleteByResourcePageId(resourcePageId, fixtureType);
}
@Override
public List<ResourcePageBookstoreVO> getByResourcePageId(Long resourcePageId, Long channelId) {
List<ResourcePageBookstoreVO> list = resourcePageBookstoreDao.getByResourcePageId(resourcePageId);
if(CollUtil.isEmpty(list) || channelId == null){
public List<ResourcePageBookstoreVO> getByResourcePageId(Long resourcePageId, Long channelId, Long wechatUserId, ResourcePageFixtureTypeEnum fixtureTypeEnum) {
List<ResourcePageBookstoreVO> list = resourcePageBookstoreDao.getByResourcePageId(resourcePageId, fixtureTypeEnum.fixtureType);
if(CollUtil.isEmpty(list)){
return CollUtil.toList();
}
switch (fixtureTypeEnum){
case BOOKSTORE:
if(channelId != null){
this.fillBookstore(list, channelId);
}
break;
case COUPONS:
this.fillCoupons(list, wechatUserId);
break;
}
return CollUtil.defaultIfEmpty(list, CollUtil.toList());
}
private void fillCoupons(List<ResourcePageBookstoreVO> list, Long wechatUserId) {
List<Long> couponIds = list.stream().map(x -> x.getServeId()).collect(Collectors.toList());
Map<Long, CouponsNewDto> couponsNewMap = promotionConsr.mapByCouponIds(couponIds, wechatUserId);
for (int i = list.size() - 1; i >= 0; i--) {
ResourcePageBookstoreVO vo = list.get(i);
CouponsNewDto couponsNewDto = couponsNewMap.get(vo.getServeId());
if(couponsNewDto.getState() == -1){
list.remove(vo);
}
vo.setCouponsNewDto(couponsNewDto);
}
}
private void fillBookstore(List<ResourcePageBookstoreVO> list, Long channelId) {
List<Long> appIds = list.stream().filter(x -> ObjectUtil.equal(x.getServeType(), "APP")).map(x -> x.getServeId()).collect(Collectors.toList());
List<Long> productIds = list.stream().filter(x -> ObjectUtil.equal(x.getServeType(), "PRODUCT")).map(x -> x.getServeId()).collect(Collectors.toList());
Map<Long, AppDto> appDtoMap = appConsr.getBaseByIds(appIds);
......@@ -106,7 +137,7 @@ public class ResourcePageBookstoreBizImpl implements ResourcePageBookstoreBiz {
AccountSettingDto accountSettingDto = qrcodeSceneConsr.getWechatInfo(channelId);
if (null == accountSettingDto) {
LOGGER.info("未配置公众号");
return CollUtil.toList();
return;
}
for (ResourcePageBookstoreVO vo : list) {
if(ObjectUtil.equal(vo.getServeType(), "APP")){
......@@ -134,6 +165,5 @@ public class ResourcePageBookstoreBizImpl implements ResourcePageBookstoreBiz {
vo.setResultUrl(SendWeixinRequestTools.splitUrl(accountSettingDto, vo.getLinkUrl()));
}
}
return list;
}
}
......@@ -343,7 +343,8 @@ public class ResourcePageConstants {
BOOK_SERVE(1,"本书配套"),
APPLET_QA(2,"书友互助"),
CUSTOM(3,"自定义"),
CLOCK(4,"阅读打卡");
CLOCK(4,"阅读打卡"),
CUSTOM_SERVE(5,"自定义服务跳转");
private Integer code;
private String name;
......
......@@ -13,8 +13,8 @@ import java.util.List;
*/
public interface ResourcePageBookstoreDao extends BaseDao<ResourcePageBookstore> {
Integer deleteByResourcePageId(Long resourcePageId);
Integer deleteByResourcePageId(Long resourcePageId, Integer fixtureType);
List<ResourcePageBookstoreVO> getByResourcePageId(Long resourcePageId);
List<ResourcePageBookstoreVO> getByResourcePageId(Long resourcePageId, Integer fixtureType);
}
......@@ -120,5 +120,5 @@ public interface ResourcePageDao extends BaseDao<ResourcePage>{
* @date:2021/8/18 16:46
* * @param null
*/
void updateNavigationFormat(Long resourcePageId, Integer navigationColor, Integer navigationFormat);
void updateNavigationFormat(Long resourcePageId, Integer navigationColor, Integer navigationFormat, Integer navigationJumpType);
}
......@@ -6,7 +6,10 @@ import com.pcloud.book.group.vo.ResourcePageBookstoreVO;
import com.pcloud.common.core.dao.BaseDaoImpl;
import org.springframework.stereotype.Repository;
import org.apache.ibatis.annotations.Param;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 实体书购买(ResourcePageBookstore)表数据库访问层
......@@ -18,12 +21,18 @@ import java.util.List;
public class ResourcePageBookstoreDaoImpl extends BaseDaoImpl<ResourcePageBookstore> implements ResourcePageBookstoreDao {
@Override
public Integer deleteByResourcePageId(Long resourcePageId) {
return super.sqlSessionTemplate.delete(getStatement("deleteByResourcePageId"), resourcePageId);
public Integer deleteByResourcePageId(Long resourcePageId, Integer fixtureType) {
Map<String, Object> params = new HashMap<>();
params.put("resourcePageId", resourcePageId);
params.put("fixtureType", fixtureType);
return super.sqlSessionTemplate.delete(getStatement("deleteByResourcePageId"), params);
}
@Override
public List<ResourcePageBookstoreVO> getByResourcePageId(Long resourcePageId) {
return super.sqlSessionTemplate.selectList(getStatement("getByResourcePageId"), resourcePageId);
public List<ResourcePageBookstoreVO> getByResourcePageId(Long resourcePageId, Integer fixtureType) {
Map<String, Object> params = new HashMap<>();
params.put("resourcePageId", resourcePageId);
params.put("fixtureType", fixtureType);
return super.sqlSessionTemplate.selectList(getStatement("getByResourcePageId"), params);
}
}
......@@ -140,11 +140,12 @@ public class ResourcePageDaoImpl extends BaseDaoImpl<ResourcePage> implements Re
}
@Override
public void updateNavigationFormat(Long resourcePageId, Integer navigationColor, Integer navigationFormat) {
public void updateNavigationFormat(Long resourcePageId, Integer navigationColor, Integer navigationFormat, Integer navigationJumpType) {
Map<String, Object> map = new HashMap<>();
map.put("id", resourcePageId);
map.put("navigationColor", navigationColor);
map.put("navigationFormat", navigationFormat);
map.put("navigationJumpType", navigationJumpType);
getSessionTemplate().update(getStatement("updateNavigationFormat"), map);
}
}
......@@ -37,4 +37,8 @@ public class NavigationParamDTO {
* 导航版式
*/
private Integer navigationFormat;
/**
* 导航跳转模式
*/
private Integer navigationJumpType;
}
......@@ -95,4 +95,9 @@ public class ResourcePage extends BaseEntity {
* 透明度
*/
private Integer transparency;
/**
* 导航使用场景;1:菜单切换;2:功能跳转
*/
private Integer navigationJumpType;
}
......@@ -28,6 +28,9 @@ public class ResourcePageBookstore extends BaseEntity {
@ApiModelProperty("资源页id")
private Long resourcePageId;
@ApiModelProperty("固定项类型;1:书店;2:优惠券;")
private Integer fixtureType;
@ApiModelProperty("服务id")
private Long serveId;
......
......@@ -4,6 +4,7 @@ import com.pcloud.common.entity.BaseEntity;
import java.util.Date;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
......@@ -40,4 +41,50 @@ public class ResourcePageNavigation extends BaseEntity {
*/
private Long createUser;
}
\ No newline at end of file
/**
* 服务id
*/
private Long serveId;
/**
* 服务类型
*/
private String serveType;
/**
* 资源类型
*/
private String typeCode;
/**
* 链接地址
*/
private String linkUrl;
/**
* 是否隐藏
*/
private Integer isHide;
@ApiModelProperty("应用或作品图片")
private String servePic;
@ApiModelProperty("应用或作品名称")
private String serveName;
@ApiModelProperty("应用或作品类型名称")
private String typeName;
@ApiModelProperty("是否第三方链接")
private Boolean hasThirdLink;
@ApiModelProperty("跳转结果链接")
private String resultUrl;
@ApiModelProperty("是否配置了公众号工具")
private Boolean hasOfficialAccountsTool;
}
package com.pcloud.book.group.enums;
public enum ResourcePageFixtureTypeEnum {
BOOKSTORE(1, "书店"),
COUPONS(2, "优惠券");
public final Integer fixtureType;
public final String desc;
ResourcePageFixtureTypeEnum(Integer fixtureType, String desc) {
this.fixtureType = fixtureType;
this.desc = desc;
}
}
......@@ -3,9 +3,11 @@ package com.pcloud.book.group.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.pcloud.common.entity.BaseEntity;
import com.pcloud.promotion.couponsnew.dto.CouponsNewDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
......@@ -23,6 +25,9 @@ public class ResourcePageBookstoreVO {
@ApiModelProperty("资源页id")
private Long resourcePageId;
@ApiModelProperty("固定资源类型")
private Integer fixtureType;
@ApiModelProperty("服务id")
private Long serveId;
......@@ -52,4 +57,8 @@ public class ResourcePageBookstoreVO {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime;
@ApiModelProperty("优惠券对象")
private CouponsNewDto couponsNewDto;
}
......@@ -95,6 +95,9 @@ public class ResourcePageVO extends BaseDto {
@ApiModelProperty("实体书购买")
private List<ResourcePageBookstoreVO> resourcePageBookstoreList;
@ApiModelProperty("优惠券")
private List<ResourcePageBookstoreVO> resourcePageCouponList;
/**
* 导航
*/
......@@ -128,4 +131,8 @@ public class ResourcePageVO extends BaseDto {
* 透明度
*/
private Integer transparency;
/**
* 导航使用场景;1:菜单切换;2:功能跳转
*/
private Integer navigationJumpType;
}
......@@ -63,6 +63,9 @@ public class UpdateResourcePageVO {
@ApiModelProperty("实体书购买")
private List<ResourcePageBookstore> resourcePageBookstoreList;
@ApiModelProperty("优惠券")
private List<ResourcePageBookstore> resourcePageCouponList;
/**
* 字体颜色
*/
......
......@@ -5,6 +5,7 @@
<resultMap id="BaseResultMap" type="com.pcloud.book.group.entity.ResourcePageBookstore">
<id column="id" property="id" jdbcType="BIGINT"/>
<result column="resource_page_id" property="resourcePageId" jdbcType="BIGINT"/>
<result column="fixture_type" property="fixtureType" jdbcType="INTEGER"/>
<result column="serve_id" property="serveId" jdbcType="BIGINT"/>
<result column="serve_type" property="serveType" jdbcType="VARCHAR"/>
<result column="link_url" property="linkUrl" jdbcType="VARCHAR"/>
......@@ -15,7 +16,7 @@
</resultMap>
<sql id="Base_Column_List">
id, resource_page_id, serve_id, serve_type, link_url, create_time
id, resource_page_id, fixture_type, serve_id, serve_type, link_url, create_time
</sql>
<select id="getById" resultMap="BaseResultMap">
......@@ -30,6 +31,7 @@
<include refid="Base_Column_List"/>
FROM resource_page_bookstore
WHERE resource_page_id = #{resourcePageId}
AND fixture_type = #{fixtureType}
</select>
<select id="getList" resultMap="BaseResultMap">
......@@ -41,12 +43,14 @@
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
INSERT INTO resource_page_bookstore(
resource_page_id,
fixture_type,
serve_id,
serve_type,
link_url,
create_time
) VALUES (
#{resourcePageId, jdbcType=BIGINT},
#{fixtureType, jdbcType=INTEGER},
#{serveId, jdbcType=BIGINT},
#{serveType, jdbcType=VARCHAR},
#{linkUrl, jdbcType=VARCHAR},
......@@ -57,6 +61,7 @@
<insert id="batchInsert" keyProperty="id" useGeneratedKeys="true">
INSERT INTO resource_page_bookstore (
resource_page_id,
fixture_type,
serve_id,
serve_type,
link_url,
......@@ -65,6 +70,7 @@
<foreach collection="list" item="item" separator=",">
(
#{item.resourcePageId, jdbcType=BIGINT},
#{item.fixtureType, jdbcType=INTEGER},
#{item.serveId, jdbcType=BIGINT},
#{item.serveType, jdbcType=VARCHAR},
#{item.linkUrl, jdbcType=VARCHAR},
......@@ -80,6 +86,9 @@
<if test="resourcePageId != null">
resource_page_id = #{resourcePageId},
</if>
<if test="fixtureType != null">
fixture_type = #{fixtureType},
</if>
<if test="serveId != null">
serve_id = #{serveId},
</if>
......@@ -101,6 +110,9 @@
<!--通过主键删除-->
<delete id="deleteByResourcePageId">
DELETE FROM resource_page_bookstore WHERE resource_page_id = #{resourcePageId}
<if test="fixtureType != null">
AND fixture_type = #{fixtureType}
</if>
</delete>
</mapper>
......@@ -26,12 +26,13 @@
<result property="watermarkStyle" column="watermark_style" jdbcType="TINYINT"/>
<result property="landingPageType" column="landing_page_type" jdbcType="INTEGER"/>
<result property="transparency" column="transparency" jdbcType="INTEGER"/>
<result property="navigationJumpType" column="navigation_jump_type" jdbcType="INTEGER"/>
</resultMap>
<sql id="Base_Column_List">
id, book_group_id, style, show_book, open_rays, open_food, create_time, update_time, create_user, qrcode_url, scene_id, official_scene_id,
book_cover, book_id, channel_id, background_img, navigation_color, navigation_format, font_color,watermark, watermark_style, landing_page_type
,transparency
,transparency, navigation_jump_type
</sql>
<!--查询单个-->
......@@ -46,9 +47,9 @@
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into book.resource_page(book_group_id, style, show_book, open_rays, open_food, create_time, update_time, create_user,
qrcode_url, scene_id, book_cover, book_id, channel_id, background_img, font_color, watermark, watermark_style, landing_page_type, transparency)
qrcode_url, scene_id, book_cover, book_id, channel_id, background_img, font_color, watermark, watermark_style, landing_page_type, transparency, navigation_jump_type)
values (#{bookGroupId}, #{style}, #{showBook}, #{openRays}, IFNULL(#{openFood},0), now(), now(), #{createUser}, #{qrcodeUrl}, #{sceneId}, #{bookCover},
#{bookId}, #{channelId}, #{backgroundImg}, #{fontColor}, #{watermark}, #{watermarkStyle}, IFNULL(#{landingPageType},1), IFNULL(#{transparency},0))
#{bookId}, #{channelId}, #{backgroundImg}, #{fontColor}, #{watermark}, #{watermarkStyle}, IFNULL(#{landingPageType},1), IFNULL(#{transparency},0), IFNULL(#{navigationJumpType},0))
</insert>
<!--通过主键修改数据-->
......@@ -94,6 +95,9 @@
<if test="transparency != null">
transparency = #{transparency},
</if>
<if test="navigationJumpType != null">
navigation_jump_type = #{navigationJumpType},
</if>
</set>
where id = #{id}
</update>
......@@ -310,6 +314,9 @@
<if test="navigationFormat != null">
navigation_format = #{navigationFormat},
</if>
<if test="navigationJumpType != null">
navigation_jump_type = #{navigationJumpType},
</if>
update_time = NOW(),
</set>
where id = #{id}
......
......@@ -9,13 +9,18 @@
<result property="navigationName" column="navigation_name" jdbcType="VARCHAR"/>
<result property="navigationIcon" column="navigation_icon" jdbcType="VARCHAR"/>
<result property="navigationSeq" column="navigation_seq" jdbcType="INTEGER"/>
<result property="serveId" column="serve_id" jdbcType="INTEGER"/>
<result property="serveType" column="serve_type" jdbcType="INTEGER"/>
<result property="typeCode" column="type_code" jdbcType="INTEGER"/>
<result property="linkUrl" column="link_url" jdbcType="INTEGER"/>
<result property="isHide" column="is_hide" jdbcType="INTEGER"/>
<result property="createUser" column="create_user" jdbcType="INTEGER"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
id, resource_page_id, navigation_type, navigation_name, navigation_icon, navigation_seq
id, resource_page_id, navigation_type, navigation_name, navigation_icon, navigation_seq, serve_id, serve_type, type_code, link_url, is_hide
</sql>
<!--查询单个-->
<select id="getById" resultMap="ResourcePageNavigationMap">
......@@ -27,15 +32,15 @@
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into book.resource_page_navigation(resource_page_id, navigation_type, navigation_name, navigation_icon, navigation_seq, create_user, create_time, update_time)
values (#{resourcePageId}, #{navigationType}, #{navigationName}, #{navigationIcon}, #{navigationSeq}, #{createUser}, now(), now())
insert into book.resource_page_navigation(resource_page_id, navigation_type, navigation_name, navigation_icon, navigation_seq, create_user, serve_id, serve_type, type_code, link_url, is_hide, create_time, update_time)
values (#{resourcePageId}, #{navigationType}, #{navigationName}, #{navigationIcon}, #{navigationSeq}, #{createUser}, #{serveId}, #{serveType}, #{typeCode}, #{linkUrl}, IFNULL(#{isHide},0), now(), now())
</insert>
<insert id="batchInsert" keyProperty="id" useGeneratedKeys="true">
insert into book.resource_page_navigation(resource_page_id, navigation_type, navigation_name, navigation_icon, navigation_seq, create_user, create_time, update_time)
insert into book.resource_page_navigation(resource_page_id, navigation_type, navigation_name, navigation_icon, navigation_seq, create_user, serve_id, serve_type, type_code, link_url, is_hide, create_time, update_time)
values
<foreach collection="list" item="item" separator=",">
(#{item.resourcePageId}, #{item.navigationType}, #{item.navigationName}, #{item.navigationIcon}, #{item.navigationSeq}, #{item.createUser}, now(), now())
(#{item.resourcePageId}, #{item.navigationType}, #{item.navigationName}, #{item.navigationIcon}, #{item.navigationSeq}, #{item.createUser}, #{item.serveId}, #{item.serveType}, #{item.typeCode}, #{item.linkUrl}, IFNULL(#{item.isHide}, 0), now(), now())
</foreach>
</insert>
......@@ -50,6 +55,21 @@
<if test="navigationSeq != null">
navigation_seq = #{navigationSeq},
</if>
<if test="serveId != null">
serve_id = #{serveId},
</if>
<if test="serveType != null">
serve_type = #{serveType},
</if>
<if test="typeCode != null">
type_code = #{typeCode},
</if>
<if test="isHide != null">
is_hide = #{isHide},
</if>
<if test="linkUrl != null">
link_url = #{linkUrl},
</if>
update_time = now(),
</set>
where id = #{id}
......@@ -156,4 +176,4 @@
update_time = now()
where id = #{id}
</update>
</mapper>
\ No newline at end of file
</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