Commit addbd98d by guojuxing

小程序装修配置

parent b13cc5a1
package com.gic.enterprise.dto;
import java.io.Serializable;
/**
* 小程序装修配置 数据资产范围
* @ClassName: AppletDataAssetAreaDTO

* @Description: 

* @author guojuxing

* @date 2019/12/31 9:26 AM

*/
public class AppletDataAssetAreaDTO implements Serializable{
private static final long serialVersionUID = -8555323283383515771L;
/**
* 积分 会员卡ID,英文逗号隔开
*/
private String integral;
/**
* 卡券包 会员卡ID,英文逗号隔开
*/
private String coupon;
/**
* 零售订单 会员卡ID,英文逗号隔开
*/
private String order;
/**
* 商城订单 默认选中和主卡关联的店铺,不可编辑
*/
private String mallOrder;
public String getIntegral() {
return integral;
}
public void setIntegral(String integral) {
this.integral = integral;
}
public String getCoupon() {
return coupon;
}
public void setCoupon(String coupon) {
this.coupon = coupon;
}
public String getOrder() {
return order;
}
public void setOrder(String order) {
this.order = order;
}
public String getMallOrder() {
return mallOrder;
}
public void setMallOrder(String mallOrder) {
this.mallOrder = mallOrder;
}
}
package com.gic.enterprise.dto;
import java.io.Serializable;
import java.util.Date;
/**
* 小程序装修配置
* @ClassName: AppletDecorationConfigDTO

* @Description: 

* @author guojuxing

* @date 2019/12/31 9:23 AM

*/
public class AppletDecorationConfigDTO implements Serializable{
private static final long serialVersionUID = 6066863361454403565L;
/**
*
*/
private Integer configId;
/**
*
*/
private Integer enterpriseId;
/**
* 会员中心页面卡范围,会员卡ID,英文逗号隔开
*/
private String memberCardArea;
/**
* 数据资产范围:积分、卡券包、零售订单、商城订单 json
*/
private String dataAssetArea;
/**
* 数据资产范围:积分、卡券包、零售订单、商城订单 对象信息,里面的每个字段就是对应的数据资产项,与dataAssetArea数据一致
*/
private AppletDataAssetAreaDTO appletDataAssetArea;
/**
* 开卡认证关联,会员卡ID,英文逗号隔开
*/
private String openCardAuth;
/**
* GPS智能判定卡 1:开启 0 :关闭
*/
private Integer gpsDecisionCard;
/**
* 小程序的key
*/
private String appId;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
public Integer getConfigId() {
return configId;
}
public void setConfigId(Integer configId) {
this.configId = configId;
}
public Integer getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(Integer enterpriseId) {
this.enterpriseId = enterpriseId;
}
public String getMemberCardArea() {
return memberCardArea;
}
public void setMemberCardArea(String memberCardArea) {
this.memberCardArea = memberCardArea;
}
public String getDataAssetArea() {
return dataAssetArea;
}
public void setDataAssetArea(String dataAssetArea) {
this.dataAssetArea = dataAssetArea;
}
public String getOpenCardAuth() {
return openCardAuth;
}
public void setOpenCardAuth(String openCardAuth) {
this.openCardAuth = openCardAuth;
}
public Integer getGpsDecisionCard() {
return gpsDecisionCard;
}
public void setGpsDecisionCard(Integer gpsDecisionCard) {
this.gpsDecisionCard = gpsDecisionCard;
}
public String getAppId() {
return appId;
}
public void setAppId(String appId) {
this.appId = appId;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public AppletDataAssetAreaDTO getAppletDataAssetArea() {
return appletDataAssetArea;
}
public void setAppletDataAssetArea(AppletDataAssetAreaDTO appletDataAssetArea) {
this.appletDataAssetArea = appletDataAssetArea;
}
}
package com.gic.enterprise.service;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.enterprise.dto.AppletDecorationConfigDTO;
/**
* 小程序装修配置
* @ClassName: AppletDecorationConfigApiService

* @Description: 

* @author guojuxing

* @date 2019/12/31 9:35 AM

*/
public interface AppletDecorationConfigApiService {
/**
* 新增
* @Title: save

* @Description:

 * @author guojuxing
* @param dto

* @return com.gic.api.base.commons.ServiceResponse<java.lang.Integer>


 */
ServiceResponse<Integer> save(AppletDecorationConfigDTO dto);
/**
* 修改
* @Title: edit

* @Description:

 * @author guojuxing
* @param dto

* @return com.gic.api.base.commons.ServiceResponse<java.lang.String>


 */
ServiceResponse<String> edit(AppletDecorationConfigDTO dto);
/**
* 装修配置详情
* @Title: getDetailByAppId

* @Description:

 * @author guojuxing
* @param appId 小程序key
* @param enterpriseId
 商户ID
* @return com.gic.api.base.commons.ServiceResponse<com.gic.enterprise.dto.AppletDecorationConfigDTO>


 */
ServiceResponse<AppletDecorationConfigDTO> getDetailByAppId(String appId, Integer enterpriseId);
}
......@@ -165,6 +165,11 @@
<artifactId>gic-member-config-api</artifactId>
<version>${gic-member-config-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-mall-share-api</artifactId>
<version>${gic-mall-share-api}</version>
</dependency>
</dependencies>
<build>
......
package com.gic.enterprise.dao.mapper;
import com.gic.enterprise.entity.TabAppletDecorationConfig;
import org.apache.ibatis.annotations.Param;
public interface TabAppletDecorationConfigMapper {
/**
* 根据主键删除
*
* @param configId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer configId);
/**
* 插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insert(TabAppletDecorationConfig record);
/**
* 动态插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insertSelective(TabAppletDecorationConfig record);
/**
* 根据主键查询
*
* @param configId 主键
* @return 实体对象
*/
TabAppletDecorationConfig selectByPrimaryKey(Integer configId);
/**
* 根据主键动态更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKeySelective(TabAppletDecorationConfig record);
/**
* 根据主键更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKey(TabAppletDecorationConfig record);
TabAppletDecorationConfig getByAppId(@Param("appId") String appId, @Param("enterpriseId") Integer enterpriseId);
}
\ No newline at end of file
package com.gic.enterprise.entity;
import java.util.Date;
/**
* tab_applet_decoration_config
*/
public class TabAppletDecorationConfig {
/**
*
*/
private Integer configId;
/**
*
*/
private Integer enterpriseId;
/**
* 会员中心页面卡范围,会员卡ID,英文逗号隔开
*/
private String memberCardArea;
/**
* 数据资产范围:积分、卡券包、零售订单、商城订单 json
*/
private String dataAssetArea;
/**
* 开卡认证关联,会员卡ID,英文逗号隔开
*/
private String openCardAuth;
/**
* GPS智能判定卡 1:开启 0 :关闭
*/
private Integer gpsDecisionCard;
/**
* 小程序的key
*/
private String appId;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
public Integer getConfigId() {
return configId;
}
public void setConfigId(Integer configId) {
this.configId = configId;
}
public Integer getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(Integer enterpriseId) {
this.enterpriseId = enterpriseId;
}
public String getMemberCardArea() {
return memberCardArea;
}
public void setMemberCardArea(String memberCardArea) {
this.memberCardArea = memberCardArea;
}
public String getDataAssetArea() {
return dataAssetArea;
}
public void setDataAssetArea(String dataAssetArea) {
this.dataAssetArea = dataAssetArea;
}
public String getOpenCardAuth() {
return openCardAuth;
}
public void setOpenCardAuth(String openCardAuth) {
this.openCardAuth = openCardAuth;
}
public Integer getGpsDecisionCard() {
return gpsDecisionCard;
}
public void setGpsDecisionCard(Integer gpsDecisionCard) {
this.gpsDecisionCard = gpsDecisionCard;
}
public String getAppId() {
return appId;
}
public void setAppId(String appId) {
this.appId = appId;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}
\ No newline at end of file
package com.gic.enterprise.service;
import com.gic.enterprise.dto.AppletDecorationConfigDTO;
import com.gic.enterprise.entity.TabAppletDecorationConfig;
/**
* 小程序装修配置
* @ClassName: AppletDecorationConfigService

* @Description: 

* @author guojuxing

* @date 2019/12/31 9:37 AM

*/
public interface AppletDecorationConfigService {
/**
* 新增
* @Title: save

* @Description:

 * @author guojuxing
* @param dto

* @return int


 */
int save(AppletDecorationConfigDTO dto);
void edit(AppletDecorationConfigDTO dto);
/**
* 查询详情
* @Title: getById

* @Description:

 * @author guojuxing
* @param configId

* @return com.gic.enterprise.entity.TabAppletDecorationConfig


 */
TabAppletDecorationConfig getById(Integer configId);
/**
* 查询(一个小程序只有一个配置,同一个商户下)
* @Title: getByAppId

* @Description:

 * @author guojuxing
* @param appId 小程序ID
* @param enterpriseId
 商户ID
* @return com.gic.enterprise.entity.TabAppletDecorationConfig


 */
TabAppletDecorationConfig getByAppId(String appId, Integer enterpriseId);
}
package com.gic.enterprise.service.impl;
import com.gic.commons.util.EntityUtil;
import com.gic.enterprise.dao.mapper.TabAppletDecorationConfigMapper;
import com.gic.enterprise.dto.AppletDecorationConfigDTO;
import com.gic.enterprise.entity.TabAppletDecorationConfig;
import com.gic.enterprise.service.AppletDecorationConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
@Service("appletDecorationConfigService")
public class AppletDecorationConfigServiceImpl implements AppletDecorationConfigService{
@Autowired
private TabAppletDecorationConfigMapper tabAppletDecorationConfigMapper;
@Override
public int save(AppletDecorationConfigDTO dto) {
dto.setCreateTime(new Date());
dto.setUpdateTime(new Date());
TabAppletDecorationConfig record = EntityUtil.changeEntityNew(TabAppletDecorationConfig.class, dto);
tabAppletDecorationConfigMapper.insert(record);
return record.getConfigId();
}
@Override
public void edit(AppletDecorationConfigDTO dto) {
dto.setUpdateTime(new Date());
TabAppletDecorationConfig record = EntityUtil.changeEntityNew(TabAppletDecorationConfig.class, dto);
tabAppletDecorationConfigMapper.updateByPrimaryKeySelective(record);
}
@Override
public TabAppletDecorationConfig getById(Integer configId) {
return tabAppletDecorationConfigMapper.selectByPrimaryKey(configId);
}
@Override
public TabAppletDecorationConfig getByAppId(String appId, Integer enterpriseId) {
return tabAppletDecorationConfigMapper.getByAppId(appId, enterpriseId);
}
}
......@@ -119,6 +119,8 @@
<dubbo:service interface="com.gic.enterprise.service.SmsRecordApiService" ref="smsRecordApiService" timeout="6000" />
<dubbo:service interface="com.gic.enterprise.service.AccountStandardApiService" ref="accountStandardApiService" timeout="6000" />
<dubbo:service interface="com.gic.enterprise.service.CustomUdeskFieldApiService" ref="customUdeskFieldApiService" timeout="6000" />
<dubbo:service interface="com.gic.enterprise.service.AppletDecorationConfigApiService" ref="appletDecorationConfigApiService" timeout="6000" />
<dubbo:reference interface="com.gic.mall.share.api.service.ShopApiService" id="shopApiService" timeout="6000" />
</beans>
<?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.TabAppletDecorationConfigMapper">
<resultMap id="BaseResultMap" type="com.gic.enterprise.entity.TabAppletDecorationConfig">
<id column="config_id" jdbcType="INTEGER" property="configId" />
<result column="enterprise_id" jdbcType="INTEGER" property="enterpriseId" />
<result column="member_card_area" jdbcType="VARCHAR" property="memberCardArea" />
<result column="data_asset_area" jdbcType="VARCHAR" property="dataAssetArea" />
<result column="open_card_auth" jdbcType="VARCHAR" property="openCardAuth" />
<result column="gps_decision_card" jdbcType="INTEGER" property="gpsDecisionCard" />
<result column="app_id" jdbcType="VARCHAR" property="appId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
config_id, enterprise_id, member_card_area, data_asset_area, open_card_auth, gps_decision_card,
app_id, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_applet_decoration_config
where config_id = #{configId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_applet_decoration_config
where config_id = #{configId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.enterprise.entity.TabAppletDecorationConfig" useGeneratedKeys="true" keyProperty="configId">
insert into tab_applet_decoration_config (config_id, enterprise_id, member_card_area,
data_asset_area, open_card_auth, gps_decision_card,
app_id, create_time, update_time
)
values (#{configId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER}, #{memberCardArea,jdbcType=VARCHAR},
#{dataAssetArea,jdbcType=VARCHAR}, #{openCardAuth,jdbcType=VARCHAR}, #{gpsDecisionCard,jdbcType=INTEGER},
#{appId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" parameterType="com.gic.enterprise.entity.TabAppletDecorationConfig">
insert into tab_applet_decoration_config
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="configId != null">
config_id,
</if>
<if test="enterpriseId != null">
enterprise_id,
</if>
<if test="memberCardArea != null">
member_card_area,
</if>
<if test="dataAssetArea != null">
data_asset_area,
</if>
<if test="openCardAuth != null">
open_card_auth,
</if>
<if test="gpsDecisionCard != null">
gps_decision_card,
</if>
<if test="appId != null">
app_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="configId != null">
#{configId,jdbcType=INTEGER},
</if>
<if test="enterpriseId != null">
#{enterpriseId,jdbcType=INTEGER},
</if>
<if test="memberCardArea != null">
#{memberCardArea,jdbcType=VARCHAR},
</if>
<if test="dataAssetArea != null">
#{dataAssetArea,jdbcType=VARCHAR},
</if>
<if test="openCardAuth != null">
#{openCardAuth,jdbcType=VARCHAR},
</if>
<if test="gpsDecisionCard != null">
#{gpsDecisionCard,jdbcType=INTEGER},
</if>
<if test="appId != null">
#{appId,jdbcType=VARCHAR},
</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.TabAppletDecorationConfig">
update tab_applet_decoration_config
<set>
<if test="enterpriseId != null">
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
</if>
<if test="memberCardArea != null">
member_card_area = #{memberCardArea,jdbcType=VARCHAR},
</if>
<if test="dataAssetArea != null">
data_asset_area = #{dataAssetArea,jdbcType=VARCHAR},
</if>
<if test="openCardAuth != null">
open_card_auth = #{openCardAuth,jdbcType=VARCHAR},
</if>
<if test="gpsDecisionCard != null">
gps_decision_card = #{gpsDecisionCard,jdbcType=INTEGER},
</if>
<if test="appId != null">
app_id = #{appId,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where config_id = #{configId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.enterprise.entity.TabAppletDecorationConfig">
update tab_applet_decoration_config
set enterprise_id = #{enterpriseId,jdbcType=INTEGER},
member_card_area = #{memberCardArea,jdbcType=VARCHAR},
data_asset_area = #{dataAssetArea,jdbcType=VARCHAR},
open_card_auth = #{openCardAuth,jdbcType=VARCHAR},
gps_decision_card = #{gpsDecisionCard,jdbcType=INTEGER},
app_id = #{appId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where config_id = #{configId,jdbcType=INTEGER}
</update>
<select id="getByAppId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"></include>
from tab_applet_decoration_config
where enterprise_id = #{enterpriseId};
and app_id = #{appId}
</select>
</mapper>
\ No newline at end of file
package com.gic.enterprise.web.controller;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.dto.AppletDecorationConfigDTO;
import com.gic.enterprise.service.AppletDecorationConfigApiService;
import com.gic.enterprise.utils.ResultControllerUtils;
import com.gic.enterprise.utils.UserDetailUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/applet-decoration-config")
public class AppletDecorationConfigController {
@Autowired
private AppletDecorationConfigApiService appletDecorationConfigApiService;
@RequestMapping("/save")
public RestResponse save(AppletDecorationConfigDTO dto) {
return ResultControllerUtils.commonResult(appletDecorationConfigApiService.save(dto));
}
@RequestMapping("/edit")
public RestResponse edit(AppletDecorationConfigDTO dto) {
return ResultControllerUtils.commonResult(appletDecorationConfigApiService.edit(dto));
}
@RequestMapping("/get-detail")
public RestResponse getDetail(String appId) {
return ResultControllerUtils.commonResult(appletDecorationConfigApiService.getDetailByAppId(appId,
UserDetailUtils.getUserDetail().getEnterpriseId()));
}
}
......@@ -104,4 +104,5 @@
<dubbo:reference interface="com.gic.enterprise.service.BillingRefundApiService" id="billingRefundApiService" timeout="6000" />
<dubbo:reference interface="com.gic.auth.service.MenuApiService" id="menuApiService" timeout="6000"/>
<dubbo:reference interface="com.gic.enterprise.service.AppletDecorationConfigApiService" id="appletDecorationConfigApiService" timeout="6000"/>
</beans>
\ No newline at end of file
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