Commit fa5dda92 by guojuxing

装修页面,顶部导航从全局迁移到自定义页面

parent 76833805
...@@ -114,6 +114,16 @@ public class AppletCustomPageDTO implements Serializable{ ...@@ -114,6 +114,16 @@ public class AppletCustomPageDTO implements Serializable{
*/ */
private Integer crowdWidgetType; private Integer crowdWidgetType;
/**
* 自定义页面专属 导航颜色,#ffffff
*/
private String guideTopColor;
/**
* 自定义页面专属 标题颜色1:黑色 2:白色
*/
private Integer titleColor;
public Integer getPageId() { public Integer getPageId() {
return pageId; return pageId;
} }
...@@ -286,6 +296,24 @@ public class AppletCustomPageDTO implements Serializable{ ...@@ -286,6 +296,24 @@ public class AppletCustomPageDTO implements Serializable{
return this; return this;
} }
public String getGuideTopColor() {
return guideTopColor;
}
public AppletCustomPageDTO setGuideTopColor(String guideTopColor) {
this.guideTopColor = guideTopColor;
return this;
}
public Integer getTitleColor() {
return titleColor;
}
public AppletCustomPageDTO setTitleColor(Integer titleColor) {
this.titleColor = titleColor;
return this;
}
@Override @Override
public String toString() { public String toString() {
return "AppletCustomPageDTO{" + return "AppletCustomPageDTO{" +
...@@ -309,6 +337,8 @@ public class AppletCustomPageDTO implements Serializable{ ...@@ -309,6 +337,8 @@ public class AppletCustomPageDTO implements Serializable{
", backgroundType=" + backgroundType + ", backgroundType=" + backgroundType +
", backgroundImage=" + backgroundImage + ", backgroundImage=" + backgroundImage +
", appletTitle=" + appletTitle + ", appletTitle=" + appletTitle +
", guideTopColor=" + guideTopColor +
", titleColor=" + titleColor +
'}'; '}';
} }
} }
...@@ -17,15 +17,24 @@ public interface CustomGuideTopApiService { ...@@ -17,15 +17,24 @@ public interface CustomGuideTopApiService {
* @param titleColor 标题颜色1:黑色 2:白色 * @param titleColor 标题颜色1:黑色 2:白色
* @param enterpriseId 商户ID * @param enterpriseId 商户ID
* @param appKey 小程序key * @param appKey 小程序key
* @param pageId
* @return * @return
*/ */
ServiceResponse<Void> saveCustomGuideTop(String guideTopColor, Integer titleColor, Integer enterpriseId, String appKey); ServiceResponse<Void> saveCustomGuideTop(String guideTopColor, Integer titleColor, Integer enterpriseId, String appKey, Integer pageId);
/** /**
* 已经废弃 @Deprecated
* 查询顶部导航配置信息 * 查询顶部导航配置信息
* @param enterpriseId * @param enterpriseId
* @param appKey * @param appKey
* @return * @return
*/ */
ServiceResponse<CustomGuideTopDTO> getCustomGuideTop(Integer enterpriseId, String appKey); ServiceResponse<CustomGuideTopDTO> getCustomGuideTop(Integer enterpriseId, String appKey);
/**
* 查询顶部导航配置信息
* @param pageId
* @return
*/
ServiceResponse<CustomGuideTopDTO> getCustomGuideTop(Integer pageId);
} }
...@@ -54,9 +54,8 @@ public interface TabCustomGuideTopMapper { ...@@ -54,9 +54,8 @@ public interface TabCustomGuideTopMapper {
/** /**
* 详情 * 详情
* @param enterpriseId * @param pageId
* @param appKey
* @return * @return
*/ */
TabCustomGuideTop getCustomGuideTop(@Param("enterpriseId") Integer enterpriseId, @Param("appKey") String appKey); TabCustomGuideTop getCustomGuideTop(@Param("pageId") Integer pageId);
} }
\ No newline at end of file
...@@ -50,6 +50,11 @@ public class TabCustomGuideTop { ...@@ -50,6 +50,11 @@ public class TabCustomGuideTop {
*/ */
private Date updateTime; private Date updateTime;
/**
* 自定义页面的页面ID
*/
private Integer pageId;
public Integer getGuideTopId() { public Integer getGuideTopId() {
return guideTopId; return guideTopId;
} }
...@@ -121,4 +126,13 @@ public class TabCustomGuideTop { ...@@ -121,4 +126,13 @@ public class TabCustomGuideTop {
this.updateTime = updateTime; this.updateTime = updateTime;
return this; return this;
} }
public Integer getPageId() {
return pageId;
}
public TabCustomGuideTop setPageId(Integer pageId) {
this.pageId = pageId;
return this;
}
} }
\ No newline at end of file
...@@ -24,9 +24,8 @@ public interface CustomGuideTopService { ...@@ -24,9 +24,8 @@ public interface CustomGuideTopService {
/** /**
* 获取详情 * 获取详情
* @param enterpriseId * @param pageId
* @param appKey
* @return * @return
*/ */
TabCustomGuideTop getCustomGuideTop(Integer enterpriseId, String appKey); TabCustomGuideTop getCustomGuideTop(Integer pageId);
} }
...@@ -37,7 +37,7 @@ public class CustomGuideTopServiceImpl implements CustomGuideTopService{ ...@@ -37,7 +37,7 @@ public class CustomGuideTopServiceImpl implements CustomGuideTopService{
} }
@Override @Override
public TabCustomGuideTop getCustomGuideTop(Integer enterpriseId, String appKey) { public TabCustomGuideTop getCustomGuideTop(Integer pageId) {
return tabCustomGuideTopMapper.getCustomGuideTop(enterpriseId, appKey); return tabCustomGuideTopMapper.getCustomGuideTop(pageId);
} }
} }
...@@ -10,15 +10,13 @@ import com.gic.enterprise.constant.applet.AppletPageComponentEnum; ...@@ -10,15 +10,13 @@ import com.gic.enterprise.constant.applet.AppletPageComponentEnum;
import com.gic.enterprise.constant.applet.AppletPageTypeEnum; import com.gic.enterprise.constant.applet.AppletPageTypeEnum;
import com.gic.enterprise.constant.applet.EntryConditionEnum; import com.gic.enterprise.constant.applet.EntryConditionEnum;
import com.gic.enterprise.dto.AppletCustomPageDTO; import com.gic.enterprise.dto.AppletCustomPageDTO;
import com.gic.enterprise.dto.CustomGuideTopDTO;
import com.gic.enterprise.entity.TabAppletCustomPage; import com.gic.enterprise.entity.TabAppletCustomPage;
import com.gic.enterprise.entity.TabAppletPageComponent; import com.gic.enterprise.entity.TabAppletPageComponent;
import com.gic.enterprise.error.ErrorCode; import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.exception.CommonException; import com.gic.enterprise.exception.CommonException;
import com.gic.enterprise.qo.AppletPageQO; import com.gic.enterprise.qo.AppletPageQO;
import com.gic.enterprise.service.AppletCustomPageApiService; import com.gic.enterprise.service.*;
import com.gic.enterprise.service.AppletCustomPageService;
import com.gic.enterprise.service.AppletPageComponentService;
import com.gic.enterprise.service.CustomStoreApiService;
import com.gic.member.filter.api.dto.CrowdWidgetDTO; import com.gic.member.filter.api.dto.CrowdWidgetDTO;
import com.gic.member.filter.api.service.CrowdWidgetApiService; import com.gic.member.filter.api.service.CrowdWidgetApiService;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
...@@ -54,6 +52,8 @@ public class AppletCustomPageApiServiceImpl implements AppletCustomPageApiServic ...@@ -54,6 +52,8 @@ public class AppletCustomPageApiServiceImpl implements AppletCustomPageApiServic
private CustomStoreApiService customStoreApiService; private CustomStoreApiService customStoreApiService;
@Autowired @Autowired
private CrowdWidgetApiService crowdWidgetApiService; private CrowdWidgetApiService crowdWidgetApiService;
@Autowired
private CustomGuideTopApiService customGuideTopApiService;
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
...@@ -178,6 +178,12 @@ public class AppletCustomPageApiServiceImpl implements AppletCustomPageApiServic ...@@ -178,6 +178,12 @@ public class AppletCustomPageApiServiceImpl implements AppletCustomPageApiServic
appletCustomPageService.edit(record); appletCustomPageService.edit(record);
} }
} }
//顶部导航
if (pageType == AppletPageTypeEnum.CUSTOM.getCode()) {
String guideTopColor = jsonObject.getString("guideTopColor");
Integer titleColor = jsonObject.getInteger("titleColor");
customGuideTopApiService.saveCustomGuideTop(guideTopColor, titleColor, enterpriseId, appId, pageId);
}
//保存组件表数据 //保存组件表数据
List<TabAppletPageComponent> componentList = new ArrayList<>(); List<TabAppletPageComponent> componentList = new ArrayList<>();
//组件key存储 //组件key存储
...@@ -321,6 +327,12 @@ public class AppletCustomPageApiServiceImpl implements AppletCustomPageApiServic ...@@ -321,6 +327,12 @@ public class AppletCustomPageApiServiceImpl implements AppletCustomPageApiServic
public ServiceResponse<AppletCustomPageDTO> getDetailByPageId(Integer pageId) { public ServiceResponse<AppletCustomPageDTO> getDetailByPageId(Integer pageId) {
TabAppletCustomPage record = exist(pageId); TabAppletCustomPage record = exist(pageId);
AppletCustomPageDTO dto = EntityUtil.changeEntityNew(AppletCustomPageDTO.class, record); AppletCustomPageDTO dto = EntityUtil.changeEntityNew(AppletCustomPageDTO.class, record);
if (record.getPageType() == AppletPageTypeEnum.CUSTOM.getCode()) {
CustomGuideTopDTO guideTopDTO = customGuideTopApiService.getCustomGuideTop(pageId).getResult();
dto.setGuideTopColor(guideTopDTO.getGuideTopColor());
dto.setTitleColor(guideTopDTO.getTitleColor());
}
//查询组件数据 //查询组件数据
List<TabAppletPageComponent> componentList = appletPageComponentService.listByPageId(pageId); List<TabAppletPageComponent> componentList = appletPageComponentService.listByPageId(pageId);
JSONArray component = new JSONArray(); JSONArray component = new JSONArray();
......
...@@ -27,17 +27,18 @@ public class CustomGuideTopApiServiceImpl implements CustomGuideTopApiService{ ...@@ -27,17 +27,18 @@ public class CustomGuideTopApiServiceImpl implements CustomGuideTopApiService{
private CustomGuideTopService customGuideTopService; private CustomGuideTopService customGuideTopService;
@Override @Override
public ServiceResponse<Void> saveCustomGuideTop(String guideTopColor, Integer titleColor, Integer enterpriseId, String appKey) { public ServiceResponse<Void> saveCustomGuideTop(String guideTopColor, Integer titleColor, Integer enterpriseId, String appKey, Integer pageId) {
if (StringUtils.isBlank(guideTopColor) || titleColor == null) { if (StringUtils.isBlank(guideTopColor) || titleColor == null) {
throw new CommonException(ErrorCode.PARAMETER_ERROR.getCode(), "参数为空"); throw new CommonException(ErrorCode.PARAMETER_ERROR.getCode(), "参数为空");
} }
TabCustomGuideTop record = customGuideTopService.getCustomGuideTop(enterpriseId, appKey); TabCustomGuideTop record = customGuideTopService.getCustomGuideTop(pageId);
if (record == null) { if (record == null) {
customGuideTopService.saveCustomGuideTop(new TabCustomGuideTop() customGuideTopService.saveCustomGuideTop(new TabCustomGuideTop()
.setAppid(appKey) .setAppid(appKey)
.setEnterpriseId(enterpriseId) .setEnterpriseId(enterpriseId)
.setGuideTopColor(guideTopColor) .setGuideTopColor(guideTopColor)
.setTitleColor(titleColor)); .setTitleColor(titleColor)
.setPageId(pageId));
} else { } else {
customGuideTopService.editCustomGuideTop(new TabCustomGuideTop() customGuideTopService.editCustomGuideTop(new TabCustomGuideTop()
.setGuideTopId(record.getGuideTopId()) .setGuideTopId(record.getGuideTopId())
...@@ -50,7 +51,18 @@ public class CustomGuideTopApiServiceImpl implements CustomGuideTopApiService{ ...@@ -50,7 +51,18 @@ public class CustomGuideTopApiServiceImpl implements CustomGuideTopApiService{
@Override @Override
public ServiceResponse<CustomGuideTopDTO> getCustomGuideTop(Integer enterpriseId, String appKey) { public ServiceResponse<CustomGuideTopDTO> getCustomGuideTop(Integer enterpriseId, String appKey) {
LOGGER.info("查询参数:{}-{}", enterpriseId, appKey); LOGGER.info("查询参数:{}-{}", enterpriseId, appKey);
TabCustomGuideTop record = customGuideTopService.getCustomGuideTop(enterpriseId, appKey); TabCustomGuideTop record = new TabCustomGuideTop();
record.setGuideTopColor("#ffffff");
record.setTitleColor(1);
return ServiceResponse.success(EntityUtil.changeEntityNew(CustomGuideTopDTO.class, record));
}
@Override
public ServiceResponse<CustomGuideTopDTO> getCustomGuideTop(Integer pageId) {
TabCustomGuideTop record = customGuideTopService.getCustomGuideTop(pageId);
if (record == null) {
new TabCustomGuideTop().setTitleColor(1).setGuideTopColor("#ffffff");
}
return ServiceResponse.success(EntityUtil.changeEntityNew(CustomGuideTopDTO.class, record)); return ServiceResponse.success(EntityUtil.changeEntityNew(CustomGuideTopDTO.class, record));
} }
} }
...@@ -10,10 +10,11 @@ ...@@ -10,10 +10,11 @@
<result column="delete_flag" jdbcType="INTEGER" property="deleteFlag" /> <result column="delete_flag" jdbcType="INTEGER" property="deleteFlag" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="page_id" jdbcType="INTEGER" property="pageId" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
guide_top_id, enterprise_id, guide_top_color, title_color, appid, delete_flag, create_time, guide_top_id, enterprise_id, guide_top_color, title_color, appid, delete_flag, create_time,
update_time update_time, page_id
</sql> </sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select select
...@@ -24,10 +25,10 @@ ...@@ -24,10 +25,10 @@
<insert id="insert" parameterType="com.gic.enterprise.entity.TabCustomGuideTop"> <insert id="insert" parameterType="com.gic.enterprise.entity.TabCustomGuideTop">
insert into tab_custom_guide_top (guide_top_id, enterprise_id, guide_top_color, insert into tab_custom_guide_top (guide_top_id, enterprise_id, guide_top_color,
title_color, appid, delete_flag, title_color, appid, delete_flag,
create_time, update_time) create_time, update_time, page_id)
values (#{guideTopId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER}, #{guideTopColor,jdbcType=VARCHAR}, values (#{guideTopId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER}, #{guideTopColor,jdbcType=VARCHAR},
#{titleColor,jdbcType=INTEGER}, #{appid,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=INTEGER}, #{titleColor,jdbcType=INTEGER}, #{appid,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}) #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{pageId,jdbcType=INTEGER})
</insert> </insert>
<insert id="insertSelective" parameterType="com.gic.enterprise.entity.TabCustomGuideTop"> <insert id="insertSelective" parameterType="com.gic.enterprise.entity.TabCustomGuideTop">
insert into tab_custom_guide_top insert into tab_custom_guide_top
...@@ -56,6 +57,9 @@ ...@@ -56,6 +57,9 @@
<if test="updateTime != null"> <if test="updateTime != null">
update_time, update_time,
</if> </if>
<if test="pageId != null">
page_id,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="guideTopId != null"> <if test="guideTopId != null">
...@@ -82,6 +86,9 @@ ...@@ -82,6 +86,9 @@
<if test="updateTime != null"> <if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
</if> </if>
<if test="pageId != null">
#{pageId,jdbcType=INTEGER},
</if>
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.enterprise.entity.TabCustomGuideTop"> <update id="updateByPrimaryKeySelective" parameterType="com.gic.enterprise.entity.TabCustomGuideTop">
...@@ -108,6 +115,9 @@ ...@@ -108,6 +115,9 @@
<if test="updateTime != null"> <if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP}, update_time = #{updateTime,jdbcType=TIMESTAMP},
</if> </if>
<if test="pageId != null">
page_id = #{pageId,jdbcType=INTEGER},
</if>
</set> </set>
where guide_top_id = #{guideTopId,jdbcType=INTEGER} where guide_top_id = #{guideTopId,jdbcType=INTEGER}
</update> </update>
...@@ -119,15 +129,15 @@ ...@@ -119,15 +129,15 @@
appid = #{appid,jdbcType=VARCHAR}, appid = #{appid,jdbcType=VARCHAR},
delete_flag = #{deleteFlag,jdbcType=INTEGER}, delete_flag = #{deleteFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP} update_time = #{updateTime,jdbcType=TIMESTAMP},
page_id = #{pageId,jdbcType=INTEGER}
where guide_top_id = #{guideTopId,jdbcType=INTEGER} where guide_top_id = #{guideTopId,jdbcType=INTEGER}
</update> </update>
<select id="getCustomGuideTop" resultMap="BaseResultMap"> <select id="getCustomGuideTop" resultMap="BaseResultMap">
select <include refid="Base_Column_List"></include> select <include refid="Base_Column_List"></include>
from tab_custom_guide_top from tab_custom_guide_top
where enterprise_id = #{enterpriseId} where page_id = #{pageId}
and appid = #{appKey}
and delete_flag = 0 and delete_flag = 0
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -81,7 +81,6 @@ public class CustomGuideController { ...@@ -81,7 +81,6 @@ public class CustomGuideController {
log.info("保存的导航内容:{}", JSON.toJSONString(list)); log.info("保存的导航内容:{}", JSON.toJSONString(list));
ServiceResponse<Void> serviceResponse = this.customGuideApiService.saveGuide(list, isNeedNewVersion, enterpriseId, appId); ServiceResponse<Void> serviceResponse = this.customGuideApiService.saveGuide(list, isNeedNewVersion, enterpriseId, appId);
if(serviceResponse.isSuccess()){ if(serviceResponse.isSuccess()){
customGuideTopApiService.saveCustomGuideTop(guideTopColor, titleColor, enterpriseId, appId);
return RestResponse.success(); return RestResponse.success();
}else { }else {
return RestResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage()); return RestResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage());
...@@ -103,8 +102,7 @@ public class CustomGuideController { ...@@ -103,8 +102,7 @@ public class CustomGuideController {
*/ */
@RequestMapping("save-or-update-custom-guide-top") @RequestMapping("save-or-update-custom-guide-top")
public RestResponse saveOrUpdateCustomGuideTop(String appId, String guideTopColor, Integer titleColor){ public RestResponse saveOrUpdateCustomGuideTop(String appId, String guideTopColor, Integer titleColor){
return ResultControllerUtils.commonResult(customGuideTopApiService return RestResponse.success();
.saveCustomGuideTop(guideTopColor, titleColor, UserDetailUtils.getUserDetail().getEnterpriseId(), appId));
} }
/** /**
......
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