فهرست منبع

feat: 多站点切换统一移至全局

周玉环 2 روز پیش
والد
کامیت
c6de657565

+ 5 - 0
xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/system/example/TplPcMallDataExample.java

@@ -43,6 +43,11 @@ public class TplPcMallDataExample implements Serializable {
     private String tplPcNameLike;
 
     /**
+     * 模板数据站点
+     */
+    private String  site;
+
+    /**
      * 模板类型
      */
     private String tplPcType;

+ 3 - 0
xinkeaboard-server/b2b2c-entity/src/main/java/com/slodon/b2b2c/system/pojo/TplPcMallData.java

@@ -15,6 +15,9 @@ public class TplPcMallData implements Serializable {
     @ApiModelProperty("装修模板数据id")
     private Integer dataId;
 
+    @ApiModelProperty("装修模板输数据站点")
+    private String  site;
+
     @ApiModelProperty("装修模板id")
     private Integer tplPcId;
 

+ 6 - 2
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/controller/system/seller/SellerTplPcController.java

@@ -79,6 +79,7 @@ public class SellerTplPcController extends BaseController {
     @ApiOperation("实例化模板列表")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "tplId", value = "模板id", paramType = "query"),
+            @ApiImplicitParam(name = "site", value = "模板站点", paramType = "query"),
             @ApiImplicitParam(name = "tplType", value = "模板类型,banner_except==除了主轮播之外的模板类型", paramType = "query"),
             @ApiImplicitParam(name = "name", value = "实例化模板名称", paramType = "query"),
             @ApiImplicitParam(name = "isEnable", value = "是否启用,0==不启用;1==启用", paramType = "query"),
@@ -87,13 +88,14 @@ public class SellerTplPcController extends BaseController {
             @ApiImplicitParam(name = "current", value = "当前页面位置", defaultValue = "1", paramType = "query")
     })
     @GetMapping("data/list")
-    public JsonResult<PageVO<TplPcMallDataVO>> getTplData(HttpServletRequest request, Integer tplId, String tplType,
+    public JsonResult<PageVO<TplPcMallDataVO>> getTplData(HttpServletRequest request, Integer tplId, String site, String tplType,
                                                           String name, Integer isEnable, String tplName) {
         Vendor vendor = UserUtil.getUser(request, Vendor.class);
         PagerInfo pager = WebUtil.handlerPagerInfo(request);
         TplPcMallDataExample example = new TplPcMallDataExample();
         example.setStoreId(vendor.getStoreId());
         example.setTplPcId(tplId);
+        example.setSite(site);
         if (!StringUtil.isEmpty(tplType)) {
             if ("banner_except".equals(tplType)) {
                 example.setTplPcTypeNotEquals("notNull");
@@ -117,6 +119,7 @@ public class SellerTplPcController extends BaseController {
     @ApiOperation("添加实例化模板数据")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "tplPcId", value = "装修模板id", required = true),
+            @ApiImplicitParam(name = "site", value = "模板站点", paramType = "query"),
             @ApiImplicitParam(name = "name", value = "实例化模板名称"),
             @ApiImplicitParam(name = "html", value = "实例化装修模板(html片段)"),
             @ApiImplicitParam(name = "json", value = "装修模板数据(json)"),
@@ -125,12 +128,13 @@ public class SellerTplPcController extends BaseController {
     })
     @VendorLogger(option = "添加实例化模板数据")
     @PostMapping("data/add")
-    public JsonResult<Integer> addTplData(HttpServletRequest request, Integer tplPcId, String name, String html, String json,
+    public JsonResult<Integer> addTplData(HttpServletRequest request, Integer tplPcId,String site, String name, String html, String json,
                                  Integer sort, Integer isEnable) {
         Vendor vendor = UserUtil.getUser(request, Vendor.class);
 
         TplPcMallData tplPcMallData = new TplPcMallData();
         tplPcMallData.setTplPcId(tplPcId);
+        tplPcMallData.setSite(site);
         tplPcMallData.setName(name);
         tplPcMallData.setHtml(html);
         tplPcMallData.setJson(json);

+ 8 - 0
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/model/system/TplPcMallDataModel.java

@@ -39,6 +39,7 @@ public class TplPcMallDataModel {
         TplPcMallDataExample example = new TplPcMallDataExample();
         example.setName(tplPcMallData.getName());
         example.setStoreId(tplPcMallData.getStoreId());
+        example.setSite(tplPcMallData.getSite());
         int count = tplPcMallDataReadMapper.countByExample(example);
         AssertUtil.isTrue(count > 0, "模板名称重复,请重新输入");
 
@@ -87,6 +88,13 @@ public class TplPcMallDataModel {
         if (StringUtils.isEmpty(tplPcMallData.getDataId())) {
             throw new MallException("请选择要修改的数据");
         }
+        TplPcMallDataExample example = new TplPcMallDataExample();
+        example.setName(tplPcMallData.getName());
+        example.setStoreId(tplPcMallData.getStoreId());
+        example.setSite(tplPcMallData.getSite());
+        example.setDataIdNotEquals(tplPcMallData.getDataId());
+        AssertUtil.isTrue(tplPcMallDataReadMapper.countByExample(example) > 0, "模板名称重复,请重新输入");
+
         int count = tplPcMallDataWriteMapper.updateByPrimaryKeySelective(tplPcMallData);
         if (count == 0) {
             log.error("根据dataId:" + tplPcMallData.getDataId() + "更新PC商城装修模板实例化数据表失败");

+ 3 - 0
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/vo/system/TplPcMallDataVO.java

@@ -22,6 +22,9 @@ public class TplPcMallDataVO implements Serializable {
     @ApiModelProperty("装修模板id")
     private Integer tplPcId;
 
+    @ApiModelProperty("装修模板数据站点")
+    private String  site;
+
     @ApiModelProperty("模板风格")
     private String tplPcName;
 

+ 4 - 0
xinkeaboard-server/b2b2c-web/src/main/resources/mapper/read/system/TplPcMallDataReadMapper.xml

@@ -7,6 +7,7 @@
     <result column="tpl_pc_name" property="tplPcName" />
     <result column="tpl_pc_type" property="tplPcType" />
     <result column="tpl_pc_type_name" property="tplPcTypeName" />
+    <result column="site" property="site" />
     <result column="name" property="name" />
     <result column="create_time" property="createTime" />
     <result column="create_user_id" property="createUserId" />
@@ -56,6 +57,9 @@
         <if test="example.tplPcTypeNameLike != null">
           AND `tpl_pc_type_name` like concat('%',#{example.tplPcTypeNameLike},'%')
         </if>
+        <if test="example.site != null">
+          AND `site` = #{example.site}
+        </if>
         <if test="example.name != null">
           AND `name` = #{example.name}
         </if>

+ 16 - 0
xinkeaboard-server/b2b2c-web/src/main/resources/mapper/write/system/TplPcMallDataWriteMapper.xml

@@ -7,6 +7,7 @@
     <result column="tpl_pc_name" property="tplPcName" />
     <result column="tpl_pc_type" property="tplPcType" />
     <result column="tpl_pc_type_name" property="tplPcTypeName" />
+    <result column="site" property="site" />
     <result column="name" property="name" />
     <result column="create_time" property="createTime" />
     <result column="create_user_id" property="createUserId" />
@@ -33,6 +34,9 @@
       <if test="tplPcTypeName != null">
         `tpl_pc_type_name`,
       </if>
+      <if test="site != null">
+        `site`,
+      </if>
       <if test="name != null">
         `name`,
       </if>
@@ -97,6 +101,9 @@
         <if test="example.tplPcTypeNameLike != null">
           AND `tpl_pc_type_name` like concat('%',#{example.tplPcTypeNameLike},'%')
         </if>
+        <if test="example.site != null">
+          AND `site` = #{example.site}
+        </if>
         <if test="example.name != null">
           AND `name` = #{example.name}
         </if>
@@ -273,6 +280,9 @@
       <if test="tplPcTypeName != null">
         #{tplPcTypeName},
       </if>
+      <if test="site != null">
+        #{site},
+      </if>
       <if test="name != null">
         #{name},
       </if>
@@ -322,6 +332,9 @@
       <if test="record.tplPcTypeName != null">
         `tpl_pc_type_name` = #{record.tplPcTypeName},
       </if>
+      <if test="record.site != null">
+        `site` = #{record.site},
+      </if>
       <if test="record.name != null">
         `name` = #{record.name},
       </if>
@@ -371,6 +384,9 @@
       <if test="tplPcTypeName != null">
         `tpl_pc_type_name` = #{tplPcTypeName},
       </if>
+      <if test="site != null">
+        `site` = #{site},
+      </if>
       <if test="name != null">
         `name` = #{name},
       </if>

+ 3 - 1
xinkeaboard-server/doc/DDL/update.sql

@@ -13,4 +13,6 @@ ALTER TABLE goods_parameter_group ADD COLUMN distribution_channel TINYINT NOT NU
 
 ALTER TABLE enquiry ADD COLUMN channel TINYINT NOT NULL DEFAULT 1 COMMENT '渠道 1:海外门户 2:国内分销门户';
 
-ALTER TABLE  enquiry_receive_mail_setting ADD COLUMN channel TINYINT NOT NULL DEFAULT 1 COMMENT '渠道 1:海外门户 2:国内分销门户';
+ALTER TABLE  enquiry_receive_mail_setting ADD COLUMN channel TINYINT NOT NULL DEFAULT 1 COMMENT '渠道 1:海外门户 2:国内分销门户';
+
+ALTER TABLE  sys_tpl_pc_mall_data ADD COLUMN site TINYINT NOT NULL DEFAULT 1 COMMENT '站点 1:海外门户 2:国内分销门户';