Commit 140ee8fd by 陶光胜

Merge branch 'developer' of…

Merge branch 'developer' of http://115.159.76.241/base_platform_enterprise/gic-platform-enterprise into developer

 Conflicts:
	gic-platform-enterprise-service/src/main/resources/dubbo-gic-platform-enterprise-service.xml
parents c428cee7 778a36e6
......@@ -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 +
'}';
}
}
package com.gic.enterprise.dto;
import java.io.Serializable;
import java.util.Date;
/**
* 小程序装修-顶部导航
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/6/2 1:57 PM

*/
public class CustomGuideTopDTO implements Serializable{
private static final long serialVersionUID = 8618674958994205102L;
/**
*
*/
private Integer guideTopId;
/**
*
*/
private Integer enterpriseId;
/**
* 导航颜色,#ffffff
*/
private String guideTopColor;
/**
* 标题颜色1:黑色 2:白色
*/
private Integer titleColor;
/**
* 小程序appid
*/
private String appid;
/**
* 0:未删除
*/
private Integer deleteFlag;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
public Integer getGuideTopId() {
return guideTopId;
}
public CustomGuideTopDTO setGuideTopId(Integer guideTopId) {
this.guideTopId = guideTopId;
return this;
}
public Integer getEnterpriseId() {
return enterpriseId;
}
public CustomGuideTopDTO setEnterpriseId(Integer enterpriseId) {
this.enterpriseId = enterpriseId;
return this;
}
public String getGuideTopColor() {
return guideTopColor;
}
public CustomGuideTopDTO setGuideTopColor(String guideTopColor) {
this.guideTopColor = guideTopColor;
return this;
}
public Integer getTitleColor() {
return titleColor;
}
public CustomGuideTopDTO setTitleColor(Integer titleColor) {
this.titleColor = titleColor;
return this;
}
public String getAppid() {
return appid;
}
public CustomGuideTopDTO setAppid(String appid) {
this.appid = appid;
return this;
}
public Integer getDeleteFlag() {
return deleteFlag;
}
public CustomGuideTopDTO setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Date getCreateTime() {
return createTime;
}
public CustomGuideTopDTO setCreateTime(Date createTime) {
this.createTime = createTime;
return this;
}
public Date getUpdateTime() {
return updateTime;
}
public CustomGuideTopDTO setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
return this;
}
@Override
public String toString() {
return "CustomGuideTopDTO{" +
"guideTopId=" + guideTopId +
", enterpriseId=" + enterpriseId +
", guideTopColor='" + guideTopColor + '\'' +
", titleColor=" + titleColor +
", appid='" + appid + '\'' +
", deleteFlag=" + deleteFlag +
", createTime=" + createTime +
", updateTime=" + updateTime +
'}';
}
}
package com.gic.enterprise.service;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.enterprise.dto.CustomGuideTopDTO;
/**
* 小程序装修-顶部导航
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/6/2 1:58 PM

*/
public interface CustomGuideTopApiService {
/**
* 新增/更新,根据商户ID和小程序key唯一确认一条数据
* @param guideTopColor 导航颜色,#ffffff
* @param titleColor 标题颜色1:黑色 2:白色
* @param enterpriseId 商户ID
* @param appKey 小程序key
* @return
*/
ServiceResponse<Void> saveCustomGuideTop(String guideTopColor, Integer titleColor, Integer enterpriseId, String appKey);
/**
* 查询顶部导航配置信息
* @param enterpriseId
* @param appKey
* @return
*/
ServiceResponse<CustomGuideTopDTO> getCustomGuideTop(Integer enterpriseId, String appKey);
}
package com.gic.enterprise.dao.mapper;
import com.gic.enterprise.entity.TabCustomGuideTop;
import org.apache.ibatis.annotations.Param;
/**
* 小程序装修-顶部导航
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/6/3 9:32 AM

*/
public interface TabCustomGuideTopMapper {
/**
* 插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insert(TabCustomGuideTop record);
/**
* 动态插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insertSelective(TabCustomGuideTop record);
/**
* 根据主键查询
*
* @param guideTopId 主键
* @return 实体对象
*/
TabCustomGuideTop selectByPrimaryKey(Integer guideTopId);
/**
* 根据主键动态更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKeySelective(TabCustomGuideTop record);
/**
* 根据主键更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKey(TabCustomGuideTop record);
/**
* 详情
* @param enterpriseId
* @param appKey
* @return
*/
TabCustomGuideTop getCustomGuideTop(@Param("enterpriseId") Integer enterpriseId, @Param("appKey") String appKey);
}
\ No newline at end of file
......@@ -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
package com.gic.enterprise.entity;
import java.util.Date;
/**
* 小程序装修-顶部导航
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/6/2 1:56 PM

*/
public class TabCustomGuideTop {
/**
*
*/
private Integer guideTopId;
/**
*
*/
private Integer enterpriseId;
/**
* 导航颜色,#ffffff
*/
private String guideTopColor;
/**
* 标题颜色1:黑色 2:白色
*/
private Integer titleColor;
/**
* 小程序appid
*/
private String appid;
/**
* 0:未删除
*/
private Integer deleteFlag;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
public Integer getGuideTopId() {
return guideTopId;
}
public TabCustomGuideTop setGuideTopId(Integer guideTopId) {
this.guideTopId = guideTopId;
return this;
}
public Integer getEnterpriseId() {
return enterpriseId;
}
public TabCustomGuideTop setEnterpriseId(Integer enterpriseId) {
this.enterpriseId = enterpriseId;
return this;
}
public String getGuideTopColor() {
return guideTopColor;
}
public TabCustomGuideTop setGuideTopColor(String guideTopColor) {
this.guideTopColor = guideTopColor;
return this;
}
public Integer getTitleColor() {
return titleColor;
}
public TabCustomGuideTop setTitleColor(Integer titleColor) {
this.titleColor = titleColor;
return this;
}
public String getAppid() {
return appid;
}
public TabCustomGuideTop setAppid(String appid) {
this.appid = appid;
return this;
}
public Integer getDeleteFlag() {
return deleteFlag;
}
public TabCustomGuideTop setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Date getCreateTime() {
return createTime;
}
public TabCustomGuideTop setCreateTime(Date createTime) {
this.createTime = createTime;
return this;
}
public Date getUpdateTime() {
return updateTime;
}
public TabCustomGuideTop setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
return this;
}
}
\ No newline at end of file
package com.gic.enterprise.service;
import com.gic.enterprise.entity.TabCustomGuideTop;
/**
* 小程序装修-顶部导航
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/6/3 9:29 AM

*/
public interface CustomGuideTopService {
/**
* 新增
* @param record
*/
void saveCustomGuideTop(TabCustomGuideTop record);
/**
* 编辑
* @param record
*/
void editCustomGuideTop(TabCustomGuideTop record);
/**
* 获取详情
* @param enterpriseId
* @param appKey
* @return
*/
TabCustomGuideTop getCustomGuideTop(Integer enterpriseId, String appKey);
}
package com.gic.enterprise.service.impl;
import com.gic.enterprise.constant.DeleteFlagConstants;
import com.gic.enterprise.dao.mapper.TabCustomGuideTopMapper;
import com.gic.enterprise.entity.TabCustomGuideTop;
import com.gic.enterprise.service.CustomGuideTopService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
/**
* 小程序装修-顶部导航
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/6/3 9:31 AM

*/
@Service("customGuideTopService")
public class CustomGuideTopServiceImpl implements CustomGuideTopService{
@Autowired
private TabCustomGuideTopMapper tabCustomGuideTopMapper;
@Override
public void saveCustomGuideTop(TabCustomGuideTop record) {
Date now = new Date();
record.setCreateTime(now);
record.setUpdateTime(now);
record.setDeleteFlag(DeleteFlagConstants.NORMAL_STATUS);
tabCustomGuideTopMapper.insert(record);
}
@Override
public void editCustomGuideTop(TabCustomGuideTop record) {
record.setUpdateTime(new Date());
tabCustomGuideTopMapper.updateByPrimaryKeySelective(record);
}
@Override
public TabCustomGuideTop getCustomGuideTop(Integer enterpriseId, String appKey) {
return tabCustomGuideTopMapper.getCustomGuideTop(enterpriseId, appKey);
}
}
......@@ -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);
......
package com.gic.enterprise.service.outer.impl;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil;
import com.gic.enterprise.dto.CustomGuideTopDTO;
import com.gic.enterprise.entity.TabCustomGuideTop;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.exception.CommonException;
import com.gic.enterprise.service.CustomGuideTopApiService;
import com.gic.enterprise.service.CustomGuideTopService;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/6/2 4:34 PM

*/
@Service("customGuideTopApiService")
public class CustomGuideTopApiServiceImpl implements CustomGuideTopApiService{
private static final Logger LOGGER = LogManager.getLogger(CustomGuideTopApiServiceImpl.class);
@Autowired
private CustomGuideTopService customGuideTopService;
@Override
public ServiceResponse<Void> saveCustomGuideTop(String guideTopColor, Integer titleColor, Integer enterpriseId, String appKey) {
if (StringUtils.isBlank(guideTopColor) || titleColor == null) {
throw new CommonException(ErrorCode.PARAMETER_ERROR.getCode(), "参数为空");
}
TabCustomGuideTop record = customGuideTopService.getCustomGuideTop(enterpriseId, appKey);
if (record == null) {
customGuideTopService.saveCustomGuideTop(new TabCustomGuideTop()
.setAppid(appKey)
.setEnterpriseId(enterpriseId)
.setGuideTopColor(guideTopColor)
.setTitleColor(titleColor));
} else {
customGuideTopService.editCustomGuideTop(new TabCustomGuideTop()
.setGuideTopId(record.getGuideTopId())
.setTitleColor(titleColor)
.setGuideTopColor(guideTopColor));
}
return ServiceResponse.success();
}
@Override
public ServiceResponse<CustomGuideTopDTO> getCustomGuideTop(Integer enterpriseId, String appKey) {
TabCustomGuideTop record = customGuideTopService.getCustomGuideTop(enterpriseId, appKey);
if (record == null) {
LOGGER.info("查询参数:{}-{}", enterpriseId, appKey);
throw new CommonException(ErrorCode.PARAMETER_ERROR.getCode(), "查无数据");
}
return ServiceResponse.success(EntityUtil.changeEntityNew(CustomGuideTopDTO.class, record));
}
}
......@@ -132,7 +132,8 @@ public class EnterpriseApiServiceImpl implements EnterpriseApiService {
enterpriseResourceRel.setEnterpriseId(enterpriseId);
enterpriseResourceRel.setResourceCode(res.getResourceCode());
enterpriseResourceRel.setResourceName(res.getResourceName());
enterpriseResourceRel.setResourceSwitch(0);
//去掉前置资源,默认都有权限
enterpriseResourceRel.setResourceSwitch(1);
enterpriseResourceRelService.saveResource(enterpriseResourceRel);
}
}
......@@ -271,7 +272,12 @@ public class EnterpriseApiServiceImpl implements EnterpriseApiService {
public ServiceResponse<List<EnterpriseResourceRelDTO>> getBusinessFrontRes(Integer enterpriseId) {
List<TabEnterpriseResourceRel> list = enterpriseResourceRelService.getByEnterpriseId(enterpriseId);
if (CollectionUtils.isNotEmpty(list)) {
return ServiceResponse.success(EntityUtil.changeEntityListNew(EnterpriseResourceRelDTO.class, list));
List<EnterpriseResourceRelDTO> temp = EntityUtil.changeEntityListNew(EnterpriseResourceRelDTO.class, list);
for (EnterpriseResourceRelDTO dto : temp) {
//去掉前置资源,默认都有权限
dto.setResourceSwitch(1);
}
return ServiceResponse.success(temp);
} else {
ServiceResponse<List<BusinessFrontResDTO>> businessFrontResListResult = businessFrontResApiService
.listGroupResourceCode();
......@@ -281,7 +287,8 @@ public class EnterpriseApiServiceImpl implements EnterpriseApiService {
List<EnterpriseResourceRelDTO> result = new ArrayList<>(resourceList.size());
for (BusinessFrontResDTO res : resourceList) {
EnterpriseResourceRelDTO temp = new EnterpriseResourceRelDTO();
temp.setResourceSwitch(0);
//去掉前置资源,默认都有权限
temp.setResourceSwitch(1);
temp.setResourceName(res.getResourceName());
temp.setResourceCode(res.getResourceCode());
result.add(temp);
......
......@@ -31,6 +31,7 @@ public class EnterpriseGoodsResourceApiServiceImpl implements EnterpriseGoodsRes
if (CollectionUtils.isNotEmpty(businessFront)) {
hasGoodsAuth = businessFront.stream().anyMatch(e -> "goods".equals(e.getResourceCode()) && e.getResourceSwitch().intValue() == 1);
}
return ServiceResponse.success(hasGoodsAuth);
//去掉前置资源,全部有权限
return ServiceResponse.success(true);
}
}
......@@ -138,6 +138,7 @@
<dubbo:service interface="com.gic.enterprise.service.BlackListApiService" ref="blackListApiService" timeout="6000" />
<dubbo:service interface="com.gic.enterprise.service.CustomSettingApiService" ref="customSettingApiService" timeout="6000" />
<dubbo:service interface="com.gic.enterprise.service.HiveDataDownloadApiService" ref="hiveDataDownloadApiService" timeout="6000" />
<dubbo:service interface="com.gic.enterprise.service.CustomGuideTopApiService" ref="customGuideTopApiService" timeout="6000" />
<dubbo:reference interface="com.gic.mall.share.api.service.ShopApiService" id="shopApiService" timeout="6000" />
......
......@@ -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},
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gic.enterprise.dao.mapper.TabCustomGuideTopMapper">
<resultMap id="BaseResultMap" type="com.gic.enterprise.entity.TabCustomGuideTop">
<id column="guide_top_id" jdbcType="INTEGER" property="guideTopId" />
<result column="enterprise_id" jdbcType="INTEGER" property="enterpriseId" />
<result column="guide_top_color" jdbcType="VARCHAR" property="guideTopColor" />
<result column="title_color" jdbcType="INTEGER" property="titleColor" />
<result column="appid" jdbcType="VARCHAR" property="appid" />
<result column="delete_flag" jdbcType="INTEGER" property="deleteFlag" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
guide_top_id, enterprise_id, guide_top_color, title_color, appid, delete_flag, create_time,
update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_custom_guide_top
where guide_top_id = #{guideTopId,jdbcType=INTEGER}
</select>
<insert id="insert" parameterType="com.gic.enterprise.entity.TabCustomGuideTop">
insert into tab_custom_guide_top (guide_top_id, enterprise_id, guide_top_color,
title_color, appid, delete_flag,
create_time, update_time)
values (#{guideTopId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER}, #{guideTopColor,jdbcType=VARCHAR},
#{titleColor,jdbcType=INTEGER}, #{appid,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.gic.enterprise.entity.TabCustomGuideTop">
insert into tab_custom_guide_top
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="guideTopId != null">
guide_top_id,
</if>
<if test="enterpriseId != null">
enterprise_id,
</if>
<if test="guideTopColor != null">
guide_top_color,
</if>
<if test="titleColor != null">
title_color,
</if>
<if test="appid != null">
appid,
</if>
<if test="deleteFlag != null">
delete_flag,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="guideTopId != null">
#{guideTopId,jdbcType=INTEGER},
</if>
<if test="enterpriseId != null">
#{enterpriseId,jdbcType=INTEGER},
</if>
<if test="guideTopColor != null">
#{guideTopColor,jdbcType=VARCHAR},
</if>
<if test="titleColor != null">
#{titleColor,jdbcType=INTEGER},
</if>
<if test="appid != null">
#{appid,jdbcType=VARCHAR},
</if>
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.enterprise.entity.TabCustomGuideTop">
update tab_custom_guide_top
<set>
<if test="enterpriseId != null">
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
</if>
<if test="guideTopColor != null">
guide_top_color = #{guideTopColor,jdbcType=VARCHAR},
</if>
<if test="titleColor != null">
title_color = #{titleColor,jdbcType=INTEGER},
</if>
<if test="appid != null">
appid = #{appid,jdbcType=VARCHAR},
</if>
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where guide_top_id = #{guideTopId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.enterprise.entity.TabCustomGuideTop">
update tab_custom_guide_top
set enterprise_id = #{enterpriseId,jdbcType=INTEGER},
guide_top_color = #{guideTopColor,jdbcType=VARCHAR},
title_color = #{titleColor,jdbcType=INTEGER},
appid = #{appid,jdbcType=VARCHAR},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where guide_top_id = #{guideTopId,jdbcType=INTEGER}
</update>
<select id="getCustomGuideTop" resultMap="BaseResultMap">
select <include refid="Base_Column_List"></include>
from tab_custom_guide_top
where enterprise_id = #{enterpriseId}
and appid = #{appKey}
and delete_flag = 0
</select>
</mapper>
\ No newline at end of file
......@@ -11,6 +11,8 @@ import com.gic.enterprise.dto.CustomGuideDTO;
import com.gic.enterprise.dto.GuideTypeDTO;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.service.CustomGuideApiService;
import com.gic.enterprise.service.CustomGuideTopApiService;
import com.gic.enterprise.utils.ResultControllerUtils;
import com.gic.enterprise.utils.UserDetailUtils;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
......@@ -33,9 +35,11 @@ public class CustomGuideController {
private static final Logger log = LogManager.getLogger(CustomGuideController.class);
@Autowired
private CustomGuideApiService customGuideApiService;
@Autowired
private CustomGuideTopApiService customGuideTopApiService;
@RequestMapping("save-custom-guide")
public RestResponse saveCustomGuide(String param, boolean isNeedNewVersion, String appId){
public RestResponse saveCustomGuide(String param, boolean isNeedNewVersion, String appId, String guideTopColor, Integer titleColor ){
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
JSONArray array = JSON.parseArray(param);
List<CustomGuideDTO> list = new ArrayList<>();
......@@ -77,6 +81,7 @@ public class CustomGuideController {
log.info("保存的导航内容:{}", JSON.toJSONString(list));
ServiceResponse<Void> serviceResponse = this.customGuideApiService.saveGuide(list, isNeedNewVersion, enterpriseId, appId);
if(serviceResponse.isSuccess()){
customGuideTopApiService.saveCustomGuideTop(guideTopColor, titleColor, enterpriseId, appId);
return RestResponse.success();
}else {
return RestResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage());
......@@ -89,6 +94,30 @@ public class CustomGuideController {
return RestResponse.success(response.getResult());
}
/**
* 新增顶部导航
* @param appId
* @param guideTopColor
* @param titleColor
* @return
*/
@RequestMapping("save-or-update-custom-guide-top")
public RestResponse saveOrUpdateCustomGuideTop(String appId, String guideTopColor, Integer titleColor){
return ResultControllerUtils.commonResult(customGuideTopApiService
.saveCustomGuideTop(guideTopColor, titleColor, UserDetailUtils.getUserDetail().getEnterpriseId(), appId));
}
/**
* 顶部导航
* @param appId
* @return
*/
@RequestMapping("get-custom-guide-top")
public RestResponse getCustomGuideTop(String appId){
return ResultControllerUtils.commonResult(this.customGuideTopApiService
.getCustomGuideTop(UserDetailUtils.getUserDetail().getEnterpriseId(), appId));
}
@RequestMapping("list-guide-type")
public RestResponse listGuideType(){
ServiceResponse<List<GuideTypeDTO>> response = this.customGuideApiService.listGuideType();
......
......@@ -475,10 +475,20 @@ public class IndexModuleController {
result.put("card", card);
result.put("service", service);
result.put("applet", applet);
result.put("isSingleArea", card.size()<=1 && service.size()<=1 && applet.size()<=1);
result.put("isSingleArea", isSingleArea());
return RestResponse.success(result);
}
private boolean isSingleArea() {
List<MemberCardInfoVO> memberCardList = getAreaData(null,
UserDetailUtils.getUserDetail().getEnterpriseId(), CuTypeEnum.MCU);
List<MemberCardInfoVO> appletList = getAreaData(null,
UserDetailUtils.getUserDetail().getEnterpriseId(), CuTypeEnum.ACU);
List<MemberCardInfoVO> serviceList = getAreaData(null,
UserDetailUtils.getUserDetail().getEnterpriseId(), CuTypeEnum.SCU);
return memberCardList.size()<=1 && serviceList.size()<=1 && appletList.size()<=1;
}
/**
* 首页-品牌列表
* @return
......
......@@ -38,7 +38,10 @@ public class RiskModeController {
public RestResponse getRiskModeRemainingTime() {
UserDetail userDetail = UserDetailUtils.getUserDetail();
ServiceResponse<Long> serviceResponse = riskModeApiService.getRiskModeRemainingTime(userDetail.getEnterpriseId(), userDetail.getUserId());
return ResultControllerUtils.commonResult(serviceResponse);
if (serviceResponse.isSuccess()) {
return RestResponse.success(serviceResponse.getResult() != null ? serviceResponse.getResult().intValue() : null);
}
return RestResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage());
}
@RequestMapping("/check-risk-mode")
......
......@@ -37,6 +37,21 @@ public class AppletPageDetailVO implements Serializable{
private Integer quickGuideSwitch;
/**
* 小程序标题
*/
private String appletTitle;
/**
* 背景颜色 0 灰色 1 白色 ,默认灰色(会员中心页面、积分服务页面、自定义页面、商城装首页 有该设置)2:背景图片(自定义页面有)
*/
private Integer backgroundType;
/**
* 自定义页面有。页面背景是图片的时候有值
*/
private String backgroundImage;
/**
* 背景颜色 灰色 白色 ,默认灰色(会员中心页面、积分服务页面、自定义页面、商城装首页 有该设置)
*/
private String backgroundColor;
......@@ -130,6 +145,33 @@ public class AppletPageDetailVO implements Serializable{
return this;
}
public String getAppletTitle() {
return appletTitle;
}
public AppletPageDetailVO setAppletTitle(String appletTitle) {
this.appletTitle = appletTitle;
return this;
}
public Integer getBackgroundType() {
return backgroundType;
}
public AppletPageDetailVO setBackgroundType(Integer backgroundType) {
this.backgroundType = backgroundType;
return this;
}
public String getBackgroundImage() {
return backgroundImage;
}
public AppletPageDetailVO setBackgroundImage(String backgroundImage) {
this.backgroundImage = backgroundImage;
return this;
}
@Override
public String toString() {
return "AppletPageDetailVO{" +
......@@ -138,6 +180,9 @@ public class AppletPageDetailVO implements Serializable{
", title='" + title + '\'' +
", entryCondition=" + entryCondition +
", quickGuideSwitch=" + quickGuideSwitch +
", appletTitle='" + appletTitle + '\'' +
", backgroundType=" + backgroundType +
", backgroundImage='" + backgroundImage + '\'' +
", backgroundColor='" + backgroundColor + '\'' +
", setting='" + setting + '\'' +
", componentStr='" + componentStr + '\'' +
......
......@@ -159,4 +159,5 @@
<dubbo:reference interface="com.gic.member.config.api.service.UserListFieldApiService" id="userListFieldApiService" timeout="6000" retries="0"/>
<dubbo:reference interface="com.gic.store.service.StoreResourceApiService" id="storeResourceApiService" timeout="6000" retries="0"/>
<dubbo:reference interface="com.gic.enterprise.service.CustomGuideTopApiService" id="customGuideTopApiService" timeout="6000" retries="0"/>
</beans>
package com.gic.operation.web.controller;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.dto.ProductMarketDTO;
import com.gic.enterprise.qo.ProductMarketQO;
......@@ -26,21 +27,23 @@ public class ProductMarketController {
/**
* 新增情报
* @param productMarketDTO
* @param param
* @return
*/
@RequestMapping("save-product-market")
public RestResponse saveProductMarket(ProductMarketDTO productMarketDTO) {
public RestResponse saveProductMarket(com.gic.operation.web.qo.ProductMarketQO param) {
ProductMarketDTO productMarketDTO = EntityUtil.changeEntityNew(ProductMarketDTO.class, param);
return ResultControllerUtils.commonResult(productMarketApiService.saveProductMarket(productMarketDTO));
}
/**
* 编辑情报
* @param productMarketDTO
* @param param
* @return
*/
@RequestMapping("update-product-market")
public RestResponse updateProductMarket(ProductMarketDTO productMarketDTO) {
public RestResponse updateProductMarket(com.gic.operation.web.qo.ProductMarketQO param) {
ProductMarketDTO productMarketDTO = EntityUtil.changeEntityNew(ProductMarketDTO.class, param);
return ResultControllerUtils.commonResult(productMarketApiService.updateProductMarket(productMarketDTO));
}
......
package com.gic.operation.web.qo;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* 情报
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/6/1 11:40 AM

*/
public class ProductMarketQO implements Serializable{
private static final long serialVersionUID = -6693359417336191988L;
/**
*
*/
private Integer productMarketId;
/**
* 标题
*/
private String title;
/**
* 类型(1 功能更新、2 产品推广、3 成功案例)
*/
private Integer infoType;
/**
* 超链接
*/
private String hyperLink;
/**
* 发布时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date releaseTime;
public Integer getProductMarketId() {
return productMarketId;
}
public ProductMarketQO setProductMarketId(Integer productMarketId) {
this.productMarketId = productMarketId;
return this;
}
public String getTitle() {
return title;
}
public ProductMarketQO setTitle(String title) {
this.title = title;
return this;
}
public Integer getInfoType() {
return infoType;
}
public ProductMarketQO setInfoType(Integer infoType) {
this.infoType = infoType;
return this;
}
public String getHyperLink() {
return hyperLink;
}
public ProductMarketQO setHyperLink(String hyperLink) {
this.hyperLink = hyperLink;
return this;
}
public Date getReleaseTime() {
return releaseTime;
}
public ProductMarketQO setReleaseTime(Date releaseTime) {
this.releaseTime = releaseTime;
return this;
}
@Override
public String toString() {
return "ProductMarketQO{" +
"productMarketId=" + productMarketId +
", title='" + title + '\'' +
", infoType=" + infoType +
", hyperLink='" + hyperLink + '\'' +
", releaseTime=" + releaseTime +
'}';
}
}
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