Browse Source

文章/百科优化part1

Aslee 3 years ago
parent
commit
8cf086970b

+ 7 - 1
src/main/java/com/caimei365/user/model/dto/BaikeProductDto.java

@@ -84,12 +84,18 @@ public class BaikeProductDto {
 	@ApiModelProperty("分类id")
 	@ApiModelProperty("分类id")
 	private Integer typeId;
 	private Integer typeId;
 
 
-	@ApiModelProperty("状态:0停用,1启用")
+	@ApiModelProperty("状态:0草稿箱,1发布")
 	private Integer status;
 	private Integer status;
 
 
 	@ApiModelProperty("审核状态:1待审核,2审核通过,3审核失败")
 	@ApiModelProperty("审核状态:1待审核,2审核通过,3审核失败")
 	private Integer auditStatus;
 	private Integer auditStatus;
 
 
+    @ApiModelProperty("百科上线状态:1待上线,2已上线,3已下线")
+    private Integer onlineStatus;
+
+    @ApiModelProperty("空数据条数")
+    private Integer emptyNum;
+
 	@ApiModelProperty("参数列表")
 	@ApiModelProperty("参数列表")
 	private String paramList;
 	private String paramList;
 
 

+ 4 - 1
src/main/java/com/caimei365/user/model/dto/ShopArticleDto.java

@@ -46,7 +46,7 @@ public class ShopArticleDto{
 	@ApiModelProperty("引导图")
 	@ApiModelProperty("引导图")
 	private String guidanceImage;
 	private String guidanceImage;
 
 
-	@ApiModelProperty("状态:0停用,1启用")
+	@ApiModelProperty("状态:0草稿箱,1发布")
 	private Integer status;
 	private Integer status;
 
 
     @ApiModelProperty("供应商名称")
     @ApiModelProperty("供应商名称")
@@ -54,4 +54,7 @@ public class ShopArticleDto{
 
 
     @ApiModelProperty("审核状态:1待审核,2审核通过,3审核失败")
     @ApiModelProperty("审核状态:1待审核,2审核通过,3审核失败")
 	private Integer auditStatus;
 	private Integer auditStatus;
+
+    @ApiModelProperty("文章上线状态:1待上线,2已上线,3已下线")
+	private Integer onlineStatus;
 }
 }

+ 4 - 0
src/main/java/com/caimei365/user/model/po/ArticlePo.java

@@ -98,5 +98,9 @@ public class ArticlePo {
 	 * 文章审核状态:1待审核,2审核通过,3审核失败
 	 * 文章审核状态:1待审核,2审核通过,3审核失败
 	 */
 	 */
 	private Integer auditStatus;
 	private Integer auditStatus;
+	/**
+	 * 文章上线状态:1待上线,2已上线,3已下线
+	 */
+	private Integer onlineStatus;
 
 
 }
 }

+ 8 - 0
src/main/java/com/caimei365/user/model/po/BaikeProductPo.java

@@ -151,4 +151,12 @@ public class BaikeProductPo {
 	 * 文章审核状态:1待审核,2审核通过,3审核失败
 	 * 文章审核状态:1待审核,2审核通过,3审核失败
 	 */
 	 */
 	private Integer auditStatus;
 	private Integer auditStatus;
+	/**
+	 * 百科上线状态:1待上线,2已上线,3已下线
+	 */
+	private Integer onlineStatus;
+	/**
+	 * 空数据条数
+	 */
+	private Integer emptyNum;
 }
 }

+ 2 - 2
src/main/java/com/caimei365/user/model/vo/BaikeProductFormVo.java

@@ -92,7 +92,7 @@ public class BaikeProductFormVo {
 	/**
 	/**
 	 * 上市时间
 	 * 上市时间
 	 */
 	 */
-	private Date marketTime;
+	private String marketTime;
 
 
 	/**
 	/**
 	 * 公司/供应商
 	 * 公司/供应商
@@ -102,7 +102,7 @@ public class BaikeProductFormVo {
 	/**
 	/**
 	 * NMPA认证时间
 	 * NMPA认证时间
 	 */
 	 */
-	private Date nmpaTime;
+	private String nmpaTime;
 
 
 	/**
 	/**
 	 * 适应人群
 	 * 适应人群

+ 10 - 0
src/main/java/com/caimei365/user/model/vo/BaikeProductListVo.java

@@ -50,11 +50,21 @@ public class BaikeProductListVo {
 	 */
 	 */
 	private Integer auditStatus;
 	private Integer auditStatus;
 
 
+	/**
+	 * 百科上线状态:1待上线,2已上线,3已下线
+	 */
+	private Integer onlineStatus;
+
     /**
     /**
      * 审核失败原因
      * 审核失败原因
      */
      */
     private String failReason;
     private String failReason;
 
 
+	/**
+	 * 空数据条数
+	 */
+	private Integer emptyNum;
+
 	/**
 	/**
 	 * 添加时间
 	 * 添加时间
 	 */
 	 */

+ 5 - 0
src/main/java/com/caimei365/user/model/vo/ShopArticleVo.java

@@ -87,6 +87,11 @@ public class ShopArticleVo {
 	 */
 	 */
 	private Integer auditStatus;
 	private Integer auditStatus;
 
 
+	/**
+	 * 文章上线状态:1待上线,2已上线,3已下线
+	 */
+	private Integer onlineStatus;
+
 	/**
 	/**
 	 * 审核失败原因
 	 * 审核失败原因
 	 */
 	 */

+ 4 - 0
src/main/java/com/caimei365/user/service/impl/ShopServiceImpl.java

@@ -479,9 +479,11 @@ public class ShopServiceImpl implements ShopService {
             articlePo.setBasePv(0);
             articlePo.setBasePv(0);
             articlePo.setPriorityIndex(0);
             articlePo.setPriorityIndex(0);
             articlePo.setAuditStatus(1);
             articlePo.setAuditStatus(1);
+            articlePo.setOnlineStatus(1);
             articleMapper.insertShopArticle(articlePo);
             articleMapper.insertShopArticle(articlePo);
         } else {
         } else {
             articlePo.setAuditStatus(1);
             articlePo.setAuditStatus(1);
+            articlePo.setOnlineStatus(1);
             articleMapper.updateShopArticle(articlePo);
             articleMapper.updateShopArticle(articlePo);
         }
         }
         // 更新文章索引
         // 更新文章索引
@@ -553,9 +555,11 @@ public class ShopServiceImpl implements ShopService {
             baikeProductPo.setAuditStatus(1);
             baikeProductPo.setAuditStatus(1);
             baikeProductPo.setBasePv(0);
             baikeProductPo.setBasePv(0);
             baikeProductPo.setActualPv(0);
             baikeProductPo.setActualPv(0);
+            baikeProductPo.setOnlineStatus(1);
             baikeProductMapper.insertBaikeProduct(baikeProductPo);
             baikeProductMapper.insertBaikeProduct(baikeProductPo);
         } else {
         } else {
             baikeProductPo.setAuditStatus(1);
             baikeProductPo.setAuditStatus(1);
+            baikeProductPo.setOnlineStatus(1);
             baikeProductMapper.updateBaikeProduct(baikeProductPo);
             baikeProductMapper.updateBaikeProduct(baikeProductPo);
         }
         }
         Integer productId = baikeProductPo.getProductId();
         Integer productId = baikeProductPo.getProductId();

+ 12 - 4
src/main/resources/mapper/ArticleMapper.xml

@@ -20,7 +20,7 @@
         where id = #{articleId}
         where id = #{articleId}
     </select>
     </select>
     <select id="getArticleTypeList" resultType="com.caimei365.user.model.vo.ArticleTypeVo">
     <select id="getArticleTypeList" resultType="com.caimei365.user.model.vo.ArticleTypeVo">
-        select id as typeId, name as typeName from info_type where enabledStatus = '1' order by sort desc,createDate desc
+        select id as typeId, name as typeName from info_type where enabledStatus = '1' and shopUseFlag = 1 order by sort desc,createDate desc
     </select>
     </select>
     <select id="getArticleLabelId" resultType="java.lang.Integer">
     <select id="getArticleLabelId" resultType="java.lang.Integer">
         select id from info_label where name = #{label}
         select id from info_label where name = #{label}
@@ -37,6 +37,7 @@
                i.pubdate as publishDate,
                i.pubdate as publishDate,
                i.createDate,
                i.createDate,
                i.auditStatus,
                i.auditStatus,
+               i.onlineStatus,
                i.failReason,
                i.failReason,
                i.enabledStatus as status
                i.enabledStatus as status
         from info i
         from info i
@@ -55,9 +56,15 @@
         <if test="typeId != null">
         <if test="typeId != null">
             and typeId = #{typeId}
             and typeId = #{typeId}
         </if>
         </if>
+        <if test="status != null">
+            and i.enabledStatus = #{status}
+        </if>
         <if test="auditStatus != null">
         <if test="auditStatus != null">
             and auditStatus = #{auditStatus}
             and auditStatus = #{auditStatus}
         </if>
         </if>
+        <if test="onlineStatus != null">
+            and onlineStatus = #{onlineStatus}
+        </if>
         order by i.createDate desc
         order by i.createDate desc
     </select>
     </select>
     <select id="getArticleLabelList" resultType="java.lang.String">
     <select id="getArticleLabelList" resultType="java.lang.String">
@@ -67,10 +74,10 @@
         insert into info (typeId, title, label, publisher, source, publishSource, shopId, keyword,
         insert into info (typeId, title, label, publisher, source, publishSource, shopId, keyword,
                           recommendContent, infoContent, guidanceImage,
                           recommendContent, infoContent, guidanceImage,
                           recommendStatus, enabledStatus, basePraise, basePv, priorityIndex,
                           recommendStatus, enabledStatus, basePraise, basePv, priorityIndex,
-                          auditStatus, createDate)
+                          auditStatus, onlineStatus, createDate)
         values (#{typeId}, #{title}, #{label}, #{publisher}, #{source}, #{publishSource}, #{shopId},
         values (#{typeId}, #{title}, #{label}, #{publisher}, #{source}, #{publishSource}, #{shopId},
                 #{keyword}, #{recommendContent}, #{articleContent}, #{guidanceImage}, #{recommendStatus},
                 #{keyword}, #{recommendContent}, #{articleContent}, #{guidanceImage}, #{recommendStatus},
-                #{status}, #{basePraise}, #{basePv}, #{priorityIndex}, #{auditStatus}, NOW())
+                #{status}, #{basePraise}, #{basePv}, #{priorityIndex}, #{auditStatus}, #{onlineStatus}, NOW())
     </insert>
     </insert>
     <insert id="insertArticleLabel">
     <insert id="insertArticleLabel">
         insert into info_label (name, createDate)
         insert into info_label (name, createDate)
@@ -92,7 +99,8 @@
             infoContent      = #{articleContent},
             infoContent      = #{articleContent},
             guidanceImage    = #{guidanceImage},
             guidanceImage    = #{guidanceImage},
             enabledStatus    = #{status},
             enabledStatus    = #{status},
-            auditStatus      = #{auditStatus}
+            auditStatus      = #{auditStatus},
+            onlineStatus     = #{onlineStatus}
         where id = #{articleId}
         where id = #{articleId}
     </update>
     </update>
     <update id="updateArticleStatus">
     <update id="updateArticleStatus">

+ 15 - 5
src/main/resources/mapper/BaikeProductMapper.xml

@@ -3,15 +3,15 @@
 <mapper namespace="com.caimei365.user.mapper.BaikeProductMapper">
 <mapper namespace="com.caimei365.user.mapper.BaikeProductMapper">
 
 
     <insert id="insertBaikeProduct" parameterType="com.caimei365.user.model.po.BaikeProductPo" keyProperty="productId" useGeneratedKeys="true">
     <insert id="insertBaikeProduct" parameterType="com.caimei365.user.model.po.BaikeProductPo" keyProperty="productId" useGeneratedKeys="true">
-        insert into cm_baike_product (commodityType, publishSource, auditStatus, shopId, name, alias, discription, seoKeyword, image,
+        insert into cm_baike_product (commodityType, publishSource, auditStatus,onlineStatus, shopId, name, alias, discription, seoKeyword, image,
                                       authLink,authQrCode, advantage,disadvantage, principle, brand,
                                       authLink,authQrCode, advantage,disadvantage, principle, brand,
                                       producePlace, marketTime,company, nmpaTime, adaptiveMan,
                                       producePlace, marketTime,company, nmpaTime, adaptiveMan,
-                                      unAdaptiveMan, aroundOperation,basePv, actualPv, typeId,
+                                      unAdaptiveMan, aroundOperation,basePv, actualPv, typeId, emptyNum,
                                       topPosition, status,addTime)
                                       topPosition, status,addTime)
-        VALUES (#{commodityType}, #{publishSource}, #{auditStatus}, #{shopId}, #{name}, #{alias}, #{discription}, #{seoKeyword}, #{image},
+        VALUES (#{commodityType}, #{publishSource}, #{auditStatus}, #{onlineStatus}, #{shopId}, #{name}, #{alias}, #{discription}, #{seoKeyword}, #{image},
                 #{authLink},#{authQrCode}, #{advantage},#{disadvantage}, #{principle}, #{brand},
                 #{authLink},#{authQrCode}, #{advantage},#{disadvantage}, #{principle}, #{brand},
                 #{producePlace}, #{marketTime},#{company}, #{nmpaTime}, #{adaptiveMan},
                 #{producePlace}, #{marketTime},#{company}, #{nmpaTime}, #{adaptiveMan},
-                #{unAdaptiveMan}, #{aroundOperation},#{basePv}, #{actualPv}, #{typeId}, null,
+                #{unAdaptiveMan}, #{aroundOperation},#{basePv}, #{actualPv}, #{typeId}, #{emptyNum}, null,
                 #{status}, NOW());
                 #{status}, NOW());
     </insert>
     </insert>
     <insert id="insertProductParam">
     <insert id="insertProductParam">
@@ -47,8 +47,10 @@
             unAdaptiveMan   = #{unAdaptiveMan},
             unAdaptiveMan   = #{unAdaptiveMan},
             aroundOperation = #{aroundOperation},
             aroundOperation = #{aroundOperation},
             typeId          = #{typeId},
             typeId          = #{typeId},
+            emptyNum        = #{emptyNum},
             status          = #{status},
             status          = #{status},
-            auditStatus     = #{auditStatus}
+            auditStatus     = #{auditStatus},
+            onlineStatus    = #{onlineStatus}
         where id = #{productId};
         where id = #{productId};
     </update>
     </update>
     <update id="updateBaikeProductStatus">
     <update id="updateBaikeProductStatus">
@@ -101,7 +103,9 @@
                cbt.name as typeName,
                cbt.name as typeName,
                p.actualPv,
                p.actualPv,
                p.auditStatus,
                p.auditStatus,
+               p.onlineStatus,
                p.failReason,
                p.failReason,
+               p.emptyNum,
                p.publishTime,
                p.publishTime,
                p.addTime,
                p.addTime,
                p.status
                p.status
@@ -117,9 +121,15 @@
         <if test="typeId != null">
         <if test="typeId != null">
             and typeId = #{typeId}
             and typeId = #{typeId}
         </if>
         </if>
+        <if test="status != null">
+            and p.status = #{status}
+        </if>
         <if test="auditStatus != null">
         <if test="auditStatus != null">
             and auditStatus = #{auditStatus}
             and auditStatus = #{auditStatus}
         </if>
         </if>
+        <if test="onlineStatus != null">
+            and onlineStatus = #{onlineStatus}
+        </if>
         order by p.addTime desc
         order by p.addTime desc
     </select>
     </select>
     <select id="getParamList" resultType="com.caimei365.user.model.po.BaikeProductParamPo">
     <select id="getParamList" resultType="com.caimei365.user.model.po.BaikeProductParamPo">