Commit 81025197 by guojuxing

小程序装修字段调整

parent 6ae2e8c2
......@@ -24,7 +24,7 @@ public enum AppletPageComponentEnum {
*/
IMAGE_TEXT("A4", "图文导航", 0),
/**
* 文本
* 文本 (舍弃)
*/
TEXT("A5", "文本", 0),
/**
......@@ -32,15 +32,15 @@ public enum AppletPageComponentEnum {
*/
CROSS_BAR("A6", "横栏", 0),
/**
* 辅助线
* 辅助线 (舍弃)
*/
GUIDE_LINE("A7", "辅助线", 0),
/**
* 辅助空白
* 辅助空白 (舍弃)
*/
GUIDE_BLANK("A8", "辅助空白", 0),
/**
* 文本标题
* 文本标题 (舍弃)
*/
TEXT_TITLE("A9", "文本标题", 0),
/**
......@@ -94,7 +94,17 @@ public enum AppletPageComponentEnum {
/**
* 会员任务
*/
MEMBER_TASK("C3", "会员任务", 6);
MEMBER_TASK("C3", "会员任务", 6),
/**
* A9 和 A5 合并
*/
TITLE_TEXT("A13", "标题文本", 0),
/**
* 辅助分割 A7 和 A8 合并
*/
GUIDE_SPLIT("A14", "辅助分割", 0);
private String code;
private String message;
......
......@@ -39,6 +39,21 @@ public class AppletCustomPageDTO implements Serializable{
private Integer quickGuideSwitch;
/**
* 小程序标题
*/
private String appletTitle;
/**
* 背景颜色 0 灰色 1 白色 ,默认灰色(会员中心页面、积分服务页面、自定义页面、商城装首页 有该设置)2:背景图片(自定义页面有)
*/
private Integer backgroundType;
/**
* 自定义页面有。页面背景是图片的时候有值
*/
private String backgroundImage;
/**
* 背景颜色 1:灰色 2:白色 ,默认灰色(会员中心页面、积分服务页面、自定义页面、商城装首页 有该设置)
*/
private String backgroundColor;
......@@ -244,6 +259,33 @@ public class AppletCustomPageDTO implements Serializable{
return this;
}
public Integer getBackgroundType() {
return backgroundType;
}
public AppletCustomPageDTO setBackgroundType(Integer backgroundType) {
this.backgroundType = backgroundType;
return this;
}
public String getBackgroundImage() {
return backgroundImage;
}
public AppletCustomPageDTO setBackgroundImage(String backgroundImage) {
this.backgroundImage = backgroundImage;
return this;
}
public String getAppletTitle() {
return appletTitle;
}
public AppletCustomPageDTO setAppletTitle(String appletTitle) {
this.appletTitle = appletTitle;
return this;
}
@Override
public String toString() {
return "AppletCustomPageDTO{" +
......@@ -264,6 +306,9 @@ public class AppletCustomPageDTO implements Serializable{
", crowdWidgetId=" + crowdWidgetId +
", serialNumber=" + serialNumber +
", crowdWidgetType=" + crowdWidgetType +
", backgroundType=" + backgroundType +
", backgroundImage=" + backgroundImage +
", appletTitle=" + appletTitle +
'}';
}
}
......@@ -36,6 +36,21 @@ public class TabAppletCustomPage {
private Integer quickGuideSwitch;
/**
* 小程序标题
*/
private String appletTitle;
/**
* 背景颜色 0 灰色 1 白色 ,默认灰色(会员中心页面、积分服务页面、自定义页面、商城装首页 有该设置)2:背景图片(自定义页面有)
*/
private Integer backgroundType;
/**
* 自定义页面有。页面背景是图片的时候有值
*/
private String backgroundImage;
/**
* 背景颜色 灰色 白色 ,默认灰色(会员中心页面、积分服务页面、自定义页面、商城装首页 有该设置)
*/
private String backgroundColor;
......@@ -232,4 +247,31 @@ public class TabAppletCustomPage {
this.crowdWidgetType = crowdWidgetType;
return this;
}
public String getAppletTitle() {
return appletTitle;
}
public TabAppletCustomPage setAppletTitle(String appletTitle) {
this.appletTitle = appletTitle;
return this;
}
public Integer getBackgroundType() {
return backgroundType;
}
public TabAppletCustomPage setBackgroundType(Integer backgroundType) {
this.backgroundType = backgroundType;
return this;
}
public String getBackgroundImage() {
return backgroundImage;
}
public TabAppletCustomPage setBackgroundImage(String backgroundImage) {
this.backgroundImage = backgroundImage;
return this;
}
}
\ No newline at end of file
......@@ -59,7 +59,7 @@ public class AppletCustomPageApiServiceImpl implements AppletCustomPageApiServic
@Override
public ServiceResponse<Integer> saveOrUpdate(String param, Integer pageId, Integer enterpriseId, Integer saveType,
Integer appType, String appId) {
ServiceResponse valiParams = this.valiParams(enterpriseId, saveType, appType, appId, param);
ServiceResponse valiParams = this.validParams(enterpriseId, saveType, appType, appId, param);
if(!valiParams.isSuccess()){
return valiParams;
}
......@@ -73,10 +73,17 @@ public class AppletCustomPageApiServiceImpl implements AppletCustomPageApiServic
quickGuideSwitch = 1;
}
String backgroundColor = jsonObject.getString("backgroundColor");
Integer backgroundType = jsonObject.getInteger("backgroundType");
String backgroundImage = jsonObject.getString("backgroundImage");
String appletTitle = jsonObject.getString("appletTitle");
if (AppletPageTypeEnum.hasBackgroundColor(pageType)) {
if (backgroundColor == null) {
backgroundColor = "#f6f6f6";
}
if (backgroundType == null) {
//灰色
backgroundType = 0;
}
} else {
//其他页面默认设置null
backgroundColor = null;
......@@ -110,6 +117,9 @@ public class AppletCustomPageApiServiceImpl implements AppletCustomPageApiServic
record.setSetting(jsonObject.getString("setting"));
record.setPageType(pageType);
record.setBackgroundColor(backgroundColor);
record.setAppletTitle(appletTitle);
record.setBackgroundType(backgroundType);
record.setBackgroundImage(backgroundImage);
record.setQuickGuideSwitch(quickGuideSwitch);
//如果是有默认数据的类型(会员中心),第一条记录,即使saveType = 2,也自动变成1
if (AppletPageTypeEnum.hasDefault(pageType)) {
......@@ -187,7 +197,7 @@ public class AppletCustomPageApiServiceImpl implements AppletCustomPageApiServic
return ServiceResponse.success(pageId);
}
private ServiceResponse valiParams(Integer enterpriseId, Integer saveType, Integer appType, String appId, String param){
private ServiceResponse validParams(Integer enterpriseId, Integer saveType, Integer appType, String appId, String param){
//参数校验
if (enterpriseId == null) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "商户ID不能为空");
......@@ -314,8 +324,7 @@ public class AppletCustomPageApiServiceImpl implements AppletCustomPageApiServic
@Override
public ServiceResponse<AppletCustomPageDTO> getDetailByAppId(Integer enterpriseId, Integer appType, String appId,
Integer pageType) {
//todo 为了以前的代码不报错,暂时 && AppletPageTypeEnum.needCrowdWidget(pageType)
if (!AppletPageTypeEnum.isOnlyOneCode(pageType) && AppletPageTypeEnum.needCrowdWidget(pageType)) {
if (!AppletPageTypeEnum.isOnlyOneCode(pageType)) {
throw new CommonException(ErrorCode.PARAMETER_ERROR.getCode(), "页面类型值有误,非只能有一条发布状态的页面类型值");
}
List<TabAppletCustomPage> record = getPageListByAppId(enterpriseId, appType, appId, pageType);
......
......@@ -7,6 +7,9 @@
<result column="title" jdbcType="VARCHAR" property="title" />
<result column="entry_condition" jdbcType="INTEGER" property="entryCondition" />
<result column="quick_guide_switch" jdbcType="INTEGER" property="quickGuideSwitch" />
<result column="applet_title" jdbcType="VARCHAR" property="appletTitle" />
<result column="background_type" jdbcType="INTEGER" property="backgroundType" />
<result column="background_image" jdbcType="VARCHAR" property="backgroundImage" />
<result column="background_color" jdbcType="VARCHAR" property="backgroundColor" />
<result column="page_type" jdbcType="INTEGER" property="pageType" />
<result column="status" jdbcType="INTEGER" property="status" />
......@@ -23,7 +26,8 @@
<result column="setting" jdbcType="LONGVARCHAR" property="setting" />
</resultMap>
<sql id="Base_Column_List">
page_id, enterprise_id, title, entry_condition, quick_guide_switch, background_color, page_type, status,
page_id, enterprise_id, title, entry_condition, quick_guide_switch, applet_title, background_type, background_image,
background_color, page_type, status,
app_type, app_id, create_time, update_time, delete_flag, crowd_widget_id, serial_number, crowd_widget_type
</sql>
<sql id="Blob_Column_List">
......@@ -40,11 +44,14 @@
<insert id="insert" parameterType="com.gic.enterprise.entity.TabAppletCustomPage" useGeneratedKeys="true" keyProperty="pageId">
insert into tab_applet_custom_page (page_id, enterprise_id, title,
entry_condition, quick_guide_switch, background_color, page_type, status, app_type,
entry_condition, quick_guide_switch, applet_title, background_type, background_image,
background_color, page_type, status, app_type,
app_id, create_time, update_time,
setting, delete_flag, crowd_widget_id, serial_number, crowd_widget_type)
values (#{pageId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR},
#{entryCondition,jdbcType=INTEGER}, #{quickGuideSwitch,jdbcType=INTEGER}, #{backgroundColor,jdbcType=VARCHAR}, #{pageType,jdbcType=INTEGER},
#{entryCondition,jdbcType=INTEGER}, #{quickGuideSwitch,jdbcType=INTEGER},
#{appletTitle,jdbcType=VARCHAR}, #{backgroundType,jdbcType=INTEGER}, #{backgroundImage,jdbcType=VARCHAR},
#{backgroundColor,jdbcType=VARCHAR}, #{pageType,jdbcType=INTEGER},
#{status,jdbcType=INTEGER}, #{appType,jdbcType=INTEGER},
#{appId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{setting,jdbcType=LONGVARCHAR}, #{deleteFlag, jdbcType=INTEGER}, #{crowdWidgetId, jdbcType=BIGINT}, #{serialNumber, jdbcType=INTEGER}, #{crowdWidgetType, jdbcType=INTEGER})
......@@ -67,6 +74,15 @@
<if test="quickGuideSwitch != null">
quick_guide_switch,
</if>
<if test="appletTitle != null">
applet_title,
</if>
<if test="backgroundType != null">
background_type,
</if>
<if test="backgroundImage != null">
background_image,
</if>
<if test="backgroundColor != null">
background_color,
</if>
......@@ -120,6 +136,15 @@
<if test="quickGuideSwitch != null">
#{quickGuideSwitch,jdbcType=INTEGER},
</if>
<if test="appletTitle != null">
#{appletTitle,jdbcType=VARCHAR},
</if>
<if test="backgroundType != null">
#{backgroundType,jdbcType=INTEGER},
</if>
<if test="backgroundImage != null">
#{backgroundImage,jdbcType=VARCHAR},
</if>
<if test="backgroundColor != null">
#{backgroundColor,jdbcType=VARCHAR},
</if>
......@@ -173,6 +198,15 @@
<if test="quickGuideSwitch != null">
quick_guide_switch = #{quickGuideSwitch,jdbcType=INTEGER},
</if>
<if test="appletTitle != null">
applet_title = #{appletTitle,jdbcType=VARCHAR},
</if>
<if test="backgroundType != null">
background_type = #{backgroundType,jdbcType=INTEGER},
</if>
<if test="backgroundImage != null">
background_image = #{backgroundImage,jdbcType=VARCHAR},
</if>
<if test="backgroundColor != null">
background_color = #{backgroundColor,jdbcType=VARCHAR},
</if>
......@@ -218,6 +252,9 @@
title = #{title,jdbcType=VARCHAR},
entry_condition = #{entryCondition,jdbcType=INTEGER},
quick_guide_switch = #{quickGuideSwitch,jdbcType=INTEGER},
applet_title = #{appletTitle,jdbcType=VARCHAR},
background_type = #{backgroundType,jdbcType=INTEGER},
background_image = #{backgroundImage,jdbcType=VARCHAR},
background_color = #{backgroundColor,jdbcType=VARCHAR},
page_type = #{pageType,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
......@@ -238,6 +275,9 @@
title = #{title,jdbcType=VARCHAR},
entry_condition = #{entryCondition,jdbcType=INTEGER},
quick_guide_switch = #{quickGuideSwitch,jdbcType=INTEGER},
applet_title = #{appletTitle,jdbcType=VARCHAR},
background_type = #{backgroundType,jdbcType=INTEGER},
background_image = #{backgroundImage,jdbcType=VARCHAR},
background_color = #{backgroundColor,jdbcType=VARCHAR},
page_type = #{pageType,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
......
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