Просмотр исходного кода

合作平台账号增加内部账号类别

wangyunpeng 11 часов назад
Родитель
Сommit
d30d46508c

+ 2 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/AccountSaveParam.java

@@ -10,6 +10,8 @@ public class AccountSaveParam {
     private Long id;
     @ApiModelProperty(value = "公司主体名称")
     private String name;
+    @ApiModelProperty(value = "类型(1-合作方账号 2-内部账号)")
+    private Integer type;
     @ApiModelProperty(value = "身份(0-代理商 1-流量主)")
     private Integer identity;
     @ApiModelProperty(value = "渠道")

+ 11 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformAccount.java

@@ -5,6 +5,8 @@ public class ContentPlatformAccount {
 
     private String name;
 
+    private Integer type;
+
     private Integer identity;
 
     private String channel;
@@ -51,6 +53,14 @@ public class ContentPlatformAccount {
         this.name = name;
     }
 
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
     public Integer getIdentity() {
         return identity;
     }
@@ -179,6 +189,7 @@ public class ContentPlatformAccount {
         sb.append("Hash = ").append(hashCode());
         sb.append(", id=").append(id);
         sb.append(", name=").append(name);
+        sb.append(", type=").append(type);
         sb.append(", identity=").append(identity);
         sb.append(", channel=").append(channel);
         sb.append(", layerType=").append(layerType);

+ 60 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformAccountExample.java

@@ -245,6 +245,66 @@ public class ContentPlatformAccountExample {
             return (Criteria) this;
         }
 
+        public Criteria andTypeIsNull() {
+            addCriterion("`type` is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeIsNotNull() {
+            addCriterion("`type` is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeEqualTo(Integer value) {
+            addCriterion("`type` =", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeNotEqualTo(Integer value) {
+            addCriterion("`type` <>", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeGreaterThan(Integer value) {
+            addCriterion("`type` >", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeGreaterThanOrEqualTo(Integer value) {
+            addCriterion("`type` >=", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeLessThan(Integer value) {
+            addCriterion("`type` <", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeLessThanOrEqualTo(Integer value) {
+            addCriterion("`type` <=", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeIn(List<Integer> values) {
+            addCriterion("`type` in", values, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeNotIn(List<Integer> values) {
+            addCriterion("`type` not in", values, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeBetween(Integer value1, Integer value2) {
+            addCriterion("`type` between", value1, value2, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeNotBetween(Integer value1, Integer value2) {
+            addCriterion("`type` not between", value1, value2, "type");
+            return (Criteria) this;
+        }
+
         public Criteria andIdentityIsNull() {
             addCriterion("`identity` is null");
             return (Criteria) this;

+ 2 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/AccountLoginVO.java

@@ -10,6 +10,8 @@ public class AccountLoginVO {
     private Long id;
     @ApiModelProperty(value = "公司主体名称")
     private String name;
+    @ApiModelProperty(value = "类型(1-合作方账号 2-内部账号)")
+    private Integer type;
     @ApiModelProperty(value = "身份(0-代理商 1-流量主)")
     private Integer identity;
     @ApiModelProperty(value = "渠道")

+ 2 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/AccountVO.java

@@ -10,6 +10,8 @@ public class AccountVO {
 	private Long id;
 	@ApiModelProperty(value = "公司主体名称")
 	private String name;
+	@ApiModelProperty(value = "类型(1-合作方账号 2-内部账号)")
+	private Integer type;
 	@ApiModelProperty(value = "身份(0-代理商 1-流量主)")
 	private Integer identity;
 	@ApiModelProperty(value = "渠道")

+ 2 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformAccountServiceImpl.java

@@ -157,6 +157,7 @@ public class ContentPlatformAccountServiceImpl implements ContentPlatformAccount
             AccountVO accountVO = new AccountVO();
             accountVO.setId(account.getId());
             accountVO.setName(account.getName());
+            accountVO.setType(account.getType());
             accountVO.setIdentity(account.getIdentity());
             accountVO.setChannel(account.getChannel());
             accountVO.setContactName(account.getContactName());
@@ -215,6 +216,7 @@ public class ContentPlatformAccountServiceImpl implements ContentPlatformAccount
         Long now = System.currentTimeMillis();
         ContentPlatformAccount account = new ContentPlatformAccount();
         account.setName(param.getName());
+        account.setType(param.getType());
         account.setIdentity(param.getIdentity());
         account.setChannel(param.getChannel());
         account.setContactName(param.getContactName());

+ 6 - 4
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformPlanServiceImpl.java

@@ -568,15 +568,17 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
 
     private void updateGhDetail(ContentPlatformGzhAccount account, Integer selectVideoType, List<Long> videoIds,
                                 Map<Long, String> videoIdTestIdMap) {
-        GhDetail ghDetail = ghDetailService.getGhDetailByGhIdType(account.getGhId(), GhTypeEnum.THIRD_PARTY_GH.type);
+        ContentPlatformAccount loginUser = LoginUserContext.getUser();
+        // 根据 content_platform_account 的 type 判断公众号类型:type=2 内部账号 -> 内部公众号,否则 -> 外部公众号
+        Integer ghType = Objects.equals(loginUser.getType(), 2) ? GhTypeEnum.GH.type : GhTypeEnum.THIRD_PARTY_GH.type;
+        GhDetail ghDetail = ghDetailService.getGhDetailByGhIdType(account.getGhId(), ghType);
         GhDetailVo detailVo = new GhDetailVo();
         Integer strategyStatus = selectVideoType == 0 ? StrategyStatusEnum.DEFAULT.status : StrategyStatusEnum.STRATEGY.status;
-        ContentPlatformAccount loginUser = LoginUserContext.getUser();
         if (Objects.nonNull(ghDetail)) {
             BeanUtils.copyProperties(ghDetail, detailVo);
             detailVo.setAccountId(account.getGhId());
             detailVo.setAccountName(account.getName());
-            detailVo.setType(GhTypeEnum.THIRD_PARTY_GH.type);
+            detailVo.setType(ghType);
             detailVo.setChannel(loginUser.getChannel());
             detailVo.setCategory1(account.getContentType());
             detailVo.setStrategyStatus(strategyStatus);
@@ -586,7 +588,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         } else {
             detailVo.setAccountId(account.getGhId());
             detailVo.setAccountName(account.getName());
-            detailVo.setType(GhTypeEnum.THIRD_PARTY_GH.type);
+            detailVo.setType(ghType);
             detailVo.setChannel(loginUser.getChannel());
             detailVo.setCategory1(account.getContentType());
             detailVo.setStrategyStatus(strategyStatus);

+ 32 - 15
api-module/src/main/resources/mapper/contentplatform/ContentPlatformAccountMapper.xml

@@ -4,6 +4,7 @@
   <resultMap id="BaseResultMap" type="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformAccount">
     <id column="id" jdbcType="BIGINT" property="id" />
     <result column="name" jdbcType="VARCHAR" property="name" />
+    <result column="type" jdbcType="INTEGER" property="type" />
     <result column="identity" jdbcType="INTEGER" property="identity" />
     <result column="channel" jdbcType="VARCHAR" property="channel" />
     <result column="layer_type" jdbcType="VARCHAR" property="layerType" />
@@ -79,9 +80,9 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, `name`, `identity`, channel, layer_type, contact_name, tel_num, price, `password`, 
-    token, token_expire_timestamp, reply_secret, `status`, create_account, create_timestamp, 
-    update_account, update_timestamp
+    id, `name`, `type`, `identity`, channel, layer_type, contact_name, tel_num, price, 
+    `password`, token, token_expire_timestamp, reply_secret, `status`, create_account, 
+    create_timestamp, update_account, update_timestamp
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformAccountExample" resultMap="BaseResultMap">
     select
@@ -117,18 +118,20 @@
     </if>
   </delete>
   <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformAccount">
-    insert into content_platform_account (id, `name`, `identity`, 
-      channel, layer_type, contact_name, 
-      tel_num, price, `password`, 
-      token, token_expire_timestamp, reply_secret, 
-      `status`, create_account, create_timestamp, 
-      update_account, update_timestamp)
-    values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{identity,jdbcType=INTEGER}, 
-      #{channel,jdbcType=VARCHAR}, #{layerType,jdbcType=VARCHAR}, #{contactName,jdbcType=VARCHAR}, 
-      #{telNum,jdbcType=VARCHAR}, #{price,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, 
-      #{token,jdbcType=VARCHAR}, #{tokenExpireTimestamp,jdbcType=BIGINT}, #{replySecret,jdbcType=VARCHAR}, 
-      #{status,jdbcType=INTEGER}, #{createAccount,jdbcType=VARCHAR}, #{createTimestamp,jdbcType=BIGINT}, 
-      #{updateAccount,jdbcType=VARCHAR}, #{updateTimestamp,jdbcType=BIGINT})
+    insert into content_platform_account (id, `name`, `type`, 
+      `identity`, channel, layer_type, 
+      contact_name, tel_num, price, 
+      `password`, token, token_expire_timestamp, 
+      reply_secret, `status`, create_account, 
+      create_timestamp, update_account, update_timestamp
+      )
+    values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, 
+      #{identity,jdbcType=INTEGER}, #{channel,jdbcType=VARCHAR}, #{layerType,jdbcType=VARCHAR}, 
+      #{contactName,jdbcType=VARCHAR}, #{telNum,jdbcType=VARCHAR}, #{price,jdbcType=VARCHAR}, 
+      #{password,jdbcType=VARCHAR}, #{token,jdbcType=VARCHAR}, #{tokenExpireTimestamp,jdbcType=BIGINT}, 
+      #{replySecret,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{createAccount,jdbcType=VARCHAR}, 
+      #{createTimestamp,jdbcType=BIGINT}, #{updateAccount,jdbcType=VARCHAR}, #{updateTimestamp,jdbcType=BIGINT}
+      )
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformAccount">
     insert into content_platform_account
@@ -139,6 +142,9 @@
       <if test="name != null">
         `name`,
       </if>
+      <if test="type != null">
+        `type`,
+      </if>
       <if test="identity != null">
         `identity`,
       </if>
@@ -192,6 +198,9 @@
       <if test="name != null">
         #{name,jdbcType=VARCHAR},
       </if>
+      <if test="type != null">
+        #{type,jdbcType=INTEGER},
+      </if>
       <if test="identity != null">
         #{identity,jdbcType=INTEGER},
       </if>
@@ -254,6 +263,9 @@
       <if test="record.name != null">
         `name` = #{record.name,jdbcType=VARCHAR},
       </if>
+      <if test="record.type != null">
+        `type` = #{record.type,jdbcType=INTEGER},
+      </if>
       <if test="record.identity != null">
         `identity` = #{record.identity,jdbcType=INTEGER},
       </if>
@@ -308,6 +320,7 @@
     update content_platform_account
     set id = #{record.id,jdbcType=BIGINT},
       `name` = #{record.name,jdbcType=VARCHAR},
+      `type` = #{record.type,jdbcType=INTEGER},
       `identity` = #{record.identity,jdbcType=INTEGER},
       channel = #{record.channel,jdbcType=VARCHAR},
       layer_type = #{record.layerType,jdbcType=VARCHAR},
@@ -333,6 +346,9 @@
       <if test="name != null">
         `name` = #{name,jdbcType=VARCHAR},
       </if>
+      <if test="type != null">
+        `type` = #{type,jdbcType=INTEGER},
+      </if>
       <if test="identity != null">
         `identity` = #{identity,jdbcType=INTEGER},
       </if>
@@ -384,6 +400,7 @@
   <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformAccount">
     update content_platform_account
     set `name` = #{name,jdbcType=VARCHAR},
+      `type` = #{type,jdbcType=INTEGER},
       `identity` = #{identity,jdbcType=INTEGER},
       channel = #{channel,jdbcType=VARCHAR},
       layer_type = #{layerType,jdbcType=VARCHAR},

+ 2 - 2
api-module/src/main/resources/mybatis-api-contentPlatform-generator-config.xml

@@ -50,7 +50,7 @@
             <property name="enableSubPackages" value="true"/>
         </javaClientGenerator>
 
-<!--        <table tableName="content_platform_account" domainObjectName="ContentPlatformAccount" alias=""/>-->
+        <table tableName="content_platform_account" domainObjectName="ContentPlatformAccount" alias=""/>
 <!--        <table tableName="content_platform_gzh_account" domainObjectName="ContentPlatformGzhAccount" alias=""/>-->
 <!--        <table tableName="content_platform_gzh_datastat" domainObjectName="ContentPlatformGzhDataStat" alias=""/>-->
 <!--        <table tableName="content_platform_gzh_video_datastat" domainObjectName="ContentPlatformGzhVideoDataStat" alias=""/>-->
@@ -77,7 +77,7 @@
 <!--        <table tableName="content_platform_illegal_msg" domainObjectName="ContentPlatformIllegalMsg" alias=""/>-->
 <!--        <table tableName="content_platform_pq_account_rel" domainObjectName="ContentPlatformPqAccountRel" alias=""/>-->
 <!--        <table tableName="content_platform_upload_video" domainObjectName="ContentPlatformUploadVideo" alias=""/>-->
-        <table tableName="content_platform_demand_video" domainObjectName="ContentPlatformDemandVideo" alias=""/>
+<!--        <table tableName="content_platform_demand_video" domainObjectName="ContentPlatformDemandVideo" alias=""/>-->
     </context>
 
 </generatorConfiguration>