Commit afe300bc by guojuxing

装修页面添加页面背景颜色字段

parent 47b22720
......@@ -79,6 +79,24 @@ public enum AppletPageTypeEnum {
return false;
}
/**
* 是否需要设置页面背景字段的页面
* @param code
* @return
*/
public static boolean hasBackgroundColor(Integer code) {
if (code == null) {
return false;
}
if (MEMBER_CENTER.getCode() == code.intValue() ||
CUSTOM.getCode() == code.intValue() ||
INTEGRAL_SERVICE.getCode() == code.intValue() ||
MALL_HOME_PAGE.getCode() == code.intValue()) {
return true;
}
return false;
}
private AppletPageTypeEnum(int code, String message, int type, int hasDefault) {
this.code = code;
this.message = message;
......
......@@ -34,6 +34,11 @@ public class AppletCustomPageDTO implements Serializable{
private Integer entryCondition;
/**
* 背景颜色 1:灰色 2:白色 ,默认灰色(会员中心页面、积分服务页面、自定义页面、商城装首页 有该设置)
*/
private Integer backgroundColor;
/**
* 1:自定义 2:会员中心,3:客服页面
*/
private Integer pageType;
......@@ -167,4 +172,13 @@ public class AppletCustomPageDTO implements Serializable{
public void setComponentStr(String componentStr) {
this.componentStr = componentStr;
}
public Integer getBackgroundColor() {
return backgroundColor;
}
public AppletCustomPageDTO setBackgroundColor(Integer backgroundColor) {
this.backgroundColor = backgroundColor;
return this;
}
}
......@@ -27,6 +27,11 @@ public class TabAppletCustomPage {
private Integer entryCondition;
/**
* 背景颜色 1:灰色 2:白色 ,默认灰色(会员中心页面、积分服务页面、自定义页面、商城装首页 有该设置)
*/
private Integer backgroundColor;
/**
* 1:自定义 2:会员卡 3:积分 4:特权 5:集团 6:会员中心,7:客服页面,8:积分服务页
*/
private Integer pageType;
......@@ -148,4 +153,13 @@ public class TabAppletCustomPage {
public void setSetting(String setting) {
this.setting = setting;
}
public Integer getBackgroundColor() {
return backgroundColor;
}
public TabAppletCustomPage setBackgroundColor(Integer backgroundColor) {
this.backgroundColor = backgroundColor;
return this;
}
}
\ No newline at end of file
......@@ -91,6 +91,19 @@ public class AppletCustomPageApiServiceImpl implements AppletCustomPageApiServic
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "页面类型错误");
}
Integer backgroundColor = jsonObject.getInteger("backgroundColor");
if (AppletPageTypeEnum.hasBackgroundColor(pageType)) {
if (backgroundColor == null) {
backgroundColor = 1;
}
if (backgroundColor.intValue() != 1 && backgroundColor.intValue() != 2) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "页面背景值非法");
}
} else {
//其他页面默认设置null
backgroundColor = null;
}
//填充实体类
TabAppletCustomPage record = new TabAppletCustomPage();
record.setEnterpriseId(enterpriseId);
......
......@@ -6,6 +6,7 @@
<result column="enterprise_id" jdbcType="INTEGER" property="enterpriseId" />
<result column="title" jdbcType="VARCHAR" property="title" />
<result column="entry_condition" jdbcType="INTEGER" property="entryCondition" />
<result column="background_color" jdbcType="INTEGER" property="backgroundColor" />
<result column="page_type" jdbcType="INTEGER" property="pageType" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="app_type" jdbcType="INTEGER" property="appType" />
......@@ -17,7 +18,7 @@
<result column="setting" jdbcType="LONGVARCHAR" property="setting" />
</resultMap>
<sql id="Base_Column_List">
page_id, enterprise_id, title, entry_condition, page_type, status,
page_id, enterprise_id, title, entry_condition, background_color, page_type, status,
app_type, app_id, create_time, update_time
</sql>
<sql id="Blob_Column_List">
......@@ -37,11 +38,11 @@
</delete>
<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, page_type, status, app_type,
entry_condition, background_color, page_type, status, app_type,
app_id, create_time, update_time,
setting)
values (#{pageId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR},
#{entryCondition,jdbcType=INTEGER}, #{pageType,jdbcType=INTEGER},
#{entryCondition,jdbcType=INTEGER}, #{backgroundColor,jdbcType=INTEGER}, #{pageType,jdbcType=INTEGER},
#{status,jdbcType=INTEGER}, #{appType,jdbcType=INTEGER},
#{appId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{setting,jdbcType=LONGVARCHAR})
......@@ -61,6 +62,9 @@
<if test="entryCondition != null">
entry_condition,
</if>
<if test="backgroundColor != null">
background_color,
</if>
<if test="pageType != null">
page_type,
</if>
......@@ -96,6 +100,9 @@
<if test="entryCondition != null">
#{entryCondition,jdbcType=INTEGER},
</if>
<if test="backgroundColor != null">
#{backgroundColor,jdbcType=INTEGER},
</if>
<if test="pageType != null">
#{pageType,jdbcType=INTEGER},
</if>
......@@ -131,6 +138,9 @@
<if test="entryCondition != null">
entry_condition = #{entryCondition,jdbcType=INTEGER},
</if>
<if test="backgroundColor != null">
background_color = #{backgroundColor,jdbcType=INTEGER},
</if>
<if test="pageType != null">
page_type = #{pageType,jdbcType=INTEGER},
</if>
......@@ -160,6 +170,7 @@
set enterprise_id = #{enterpriseId,jdbcType=INTEGER},
title = #{title,jdbcType=VARCHAR},
entry_condition = #{entryCondition,jdbcType=INTEGER},
background_color = #{backgroundColor,jdbcType=INTEGER},
page_type = #{pageType,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
app_type = #{appType,jdbcType=INTEGER},
......@@ -174,6 +185,7 @@
set enterprise_id = #{enterpriseId,jdbcType=INTEGER},
title = #{title,jdbcType=VARCHAR},
entry_condition = #{entryCondition,jdbcType=INTEGER},
background_color = #{backgroundColor,jdbcType=INTEGER},
page_type = #{pageType,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
app_type = #{appType,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