Browse Source

为品牌添加show_delete字段
为潜客池服务层添加事务
删除企业实体类不存在的字段

云殇忆 1 year ago
parent
commit
978f0f0e3b

+ 2 - 1
benyun-core/src/main/java/com/benyun/core/dao/BrandMapper.java

@@ -1,5 +1,6 @@
 package com.benyun.core.dao;
 
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.benyun.core.entity.Brand;
 import com.benyun.core.entity.bo.BrandAddrDistribution;
 import com.benyun.core.entity.bo.BrandSearch;
@@ -9,7 +10,7 @@ import org.apache.ibatis.annotations.Param;
 import java.util.List;
 
 @Mapper
-public interface BrandMapper {
+public interface BrandMapper extends BaseMapper<Brand> {
     List<Brand> searchList(String text);
     Brand searchById(String brandId);
     List<Brand> searchByIndustryCodeList(String brandId, String industryCode);

+ 22 - 62
benyun-core/src/main/java/com/benyun/core/entity/Brand.java

@@ -1,93 +1,53 @@
 package com.benyun.core.entity;
 
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.ruoyi.common.core.domain.BaseEntity;
 import lombok.Data;
-import lombok.EqualsAndHashCode;
 
 import java.util.Date;
 
 @Data
-@EqualsAndHashCode(callSuper = true)
 @TableName("ddt_origin_brand")
 public class Brand extends BaseEntity {
-
-    private static final long serialVersionUID=1L;
-
-    /**
-     *
-     */
+    @TableId("brand_id")
     private String brandId;
-    /**
-     *
-     */
+    @TableField("brand_img")
     private String brandImg;
-    /**
-     *
-     */
+    @TableField("brand_name")
     private String brandName;
-    /**
-     *
-     */
+    @TableField("industry_code")
     private String industryCode;
-    /**
-     *
-     */
+    @TableField("enterprise_usci")
     private String enterpriseUsci;
-    /**
-     *
-     */
+    @TableField("per_capita_consumption")
     private Float perCapitaConsumption;
-    /**
-     *
-     */
+    @TableField("comment_count")
     private Long commentCount;
-    /**
-     *
-     */
+    @TableField("socre")
     private Float score;
-    /**
-     *
-     */
+    @TableField("menu_info")
     private String menuInfo;
-    /**
-     *
-     */
+    @TableField("index_score")
     private Float indexScore;
-
+    @TableField("contact")
     private String contact;
+    @TableField("telephone")
     private String telephone;
-    /**
-     *
-     */
+    @TableField("create_data")
     private Date createDate;
-    /**
-     *
-     */
+    @TableField("audit")
     private Long audit;
-    /**
-     *
-     */
+    @TableField("collect_person")
     private String collectPerson;
-    /**
-     *
-     */
+    @TableField("collect_time")
     private Date collectTime;
-    /**
-     *
-     */
+    @TableField("enter_time")
     private Date enterTime;
-    /**
-     *
-     */
+    @TableField("hash")
     private String hash;
-    /**
-     *
-     */
-    private Long agree;
-    /**
-     *
-     */
-    private Long oppose;
 
+    @TableField("show_delete")
+    private int showDelete;
 }

+ 4 - 4
benyun-core/src/main/java/com/benyun/core/entity/Enterprise.java

@@ -79,8 +79,8 @@ public class Enterprise {
     private LocalDateTime updateTime;
     @TableField("hash")
     private String hash;
-    @TableField("telephone")
-    private String telephone;
-    @TableField("website")
-    private String website;
+//    @TableField("telephone")
+//    private String telephone;
+//    @TableField("website")
+//    private String website;
 }

+ 2 - 0
benyun-core/src/main/java/com/benyun/core/service/impl/AttentionPoolServiceImpl.java

@@ -10,6 +10,7 @@ import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.util.ArrayList;
 import java.util.Date;
@@ -17,6 +18,7 @@ import java.util.List;
 import java.util.UUID;
 
 @Service
+@Transactional
 public class AttentionPoolServiceImpl implements AttentionPoolService {
     @Autowired
     AttentionPoolDao attentionPoolDao;

+ 0 - 1
benyun-core/src/main/java/com/benyun/core/service/impl/BrandServiceImpl.java

@@ -64,7 +64,6 @@ public class BrandServiceImpl implements BrandService {
                 info.setEnterpriseName(enterprise.getEnterpriseName());
                 info.setAddrCode(enterprise.getAddrCode());
                 info.setAddrInfo(enterprise.getAddrInfo());
-                info.setTelephone(enterprise.getTelephone());
             }
             info.setUpdateTime(brand.getUpdateTime());
         }else return null;

+ 5 - 6
benyun-core/src/main/resources/mapper/BrandMapper.xml

@@ -23,8 +23,7 @@
         <result property="enterTime" column="enter_time"/>
         <result property="updateTime" column="update_time"/>
         <result property="hash" column="hash"/>
-        <result property="agree" column="agree"/>
-        <result property="oppose" column="oppose"/>
+        <result property="showDelete" column="show_delete"/>
     </resultMap>
     <resultMap type="com.benyun.core.entity.bo.BrandSearch" id="BrandSearchResult">
         <result property="brandId" column="brand_id"/>
@@ -41,13 +40,13 @@
         <result property="count" column="count"/>
     </resultMap>
     <select id="searchList" resultMap="BrandResult">
-        select * from ddt_brand where brand_name like concat("%",#{text},"%")
+        select * from ddt_brand where brand_name like concat("%",#{text},"%") and show_delete=0
     </select>
     <select id="searchById" resultMap="BrandResult">
-        select * from ddt_brand where brand_id = #{brandId}
+        select * from ddt_brand where brand_id = #{brandId} and show_delete=0
     </select>
     <select id="searchByIndustryCodeList" resultMap="BrandResult">
-        select * from ddt_brand where industry_code = #{industryCode} and brand_id <![CDATA[<>]]> #{brandId}
+        select * from ddt_brand where industry_code = #{industryCode} and brand_id <![CDATA[<>]]> #{brandId} and show_delete=0
     </select>
     <select id="searchSearchByMulti" resultMap="BrandSearchResult">
         SELECT
@@ -62,7 +61,7 @@
             `ddt_brand` db,
             `bl_brand_statistics` bbs
         WHERE
-            bbs.brand_id = db.brand_id
+            bbs.brand_id = db.brand_id and show_delete=0
         <if test="text != null">
             AND db.brand_name LIKE concat('%',#{text},'%')
         </if>

+ 0 - 2
benyun-core/src/main/resources/mapper/EnterpriseMapper.xml

@@ -19,8 +19,6 @@
         <result property="industryCode" column="industry_code"/>
         <result property="enterpriseType" column="enterprise_type"/>
         <result property="creditScore" column="credit_score"/>
-        <result property="telephone" column="telephone"/>
-        <result property="website" column="website"/>
         <result property="updateTime" column="update_time"/>
     </resultMap>
     <select id="searchByUsci" resultMap="EnterpriseResult">