Browse Source

信息中心V1.3.9

kaick 1 năm trước cách đây
mục cha
commit
6cef25a7a7
33 tập tin đã thay đổi với 2519 bổ sung420 xóa
  1. 23 5
      src/main/java/com/caimei/modules/archive/entity/CmProductArchiveContent.java
  2. 115 0
      src/main/java/com/caimei/modules/info/dao/CmRelatedMapper.java
  3. 20 1
      src/main/java/com/caimei/modules/info/dao/InfoDao.java
  4. 9 2
      src/main/java/com/caimei/modules/info/dao/InfoTypeDao.java
  5. 54 0
      src/main/java/com/caimei/modules/info/entity/CmRelated.java
  6. 46 0
      src/main/java/com/caimei/modules/info/entity/Info.java
  7. 19 41
      src/main/java/com/caimei/modules/info/entity/InfoType.java
  8. 194 0
      src/main/java/com/caimei/modules/info/service/CmRelatedService.java
  9. 35 1
      src/main/java/com/caimei/modules/info/service/InfoService.java
  10. 35 7
      src/main/java/com/caimei/modules/info/service/InfoTypeService.java
  11. 129 0
      src/main/java/com/caimei/modules/info/web/InfoController.java
  12. 14 7
      src/main/java/com/caimei/modules/info/web/InfoTypeController.java
  13. 9 197
      src/main/java/com/caimei/modules/landing/domain/CmBrandLanding.java
  14. 23 7
      src/main/java/com/caimei/modules/landing/mapper/CmBrandLandingMapper.java
  15. 8 7
      src/main/java/com/thinkgem/jeesite/common/persistence/DataEntity.java
  16. 51 36
      src/main/java/com/thinkgem/jeesite/common/persistence/Page.java
  17. 1 1
      src/main/resources/config/dev/caimei.properties
  18. 21 15
      src/main/resources/mappings/modules/archive/CmProductArchiveContentMapper.xml
  19. 443 0
      src/main/resources/mappings/modules/info/CmRelatedMapper.xml
  20. 241 3
      src/main/resources/mappings/modules/info/InfoMapper.xml
  21. 116 22
      src/main/resources/mappings/modules/info/InfoTypeMapper.xml
  22. 76 1
      src/main/resources/mappings/modules/landing/CmBrandLandingMapper.xml
  23. 11 0
      src/main/webapp/WEB-INF/views/modules/archive/addFileForm.jsp
  24. 2 0
      src/main/webapp/WEB-INF/views/modules/archive/addVideoForm.jsp
  25. 11 2
      src/main/webapp/WEB-INF/views/modules/archive/cmProductArchiveContentList.jsp
  26. 148 0
      src/main/webapp/WEB-INF/views/modules/info/addInfoForm.jsp
  27. 20 19
      src/main/webapp/WEB-INF/views/modules/info/infoList.jsp
  28. 213 0
      src/main/webapp/WEB-INF/views/modules/info/infoRelatedForm.jsp
  29. 167 0
      src/main/webapp/WEB-INF/views/modules/info/infoSelectedList.jsp
  30. 242 27
      src/main/webapp/WEB-INF/views/modules/info/infoTypeForm.jsp
  31. 13 6
      src/main/webapp/WEB-INF/views/modules/info/infoTypeList.jsp
  32. 1 0
      src/main/webapp/WEB-INF/views/modules/info/shopInfoList.jsp
  33. 9 13
      src/main/webapp/WEB-INF/views/modules/user/newCmShopSetForm.jsp

+ 23 - 5
src/main/java/com/caimei/modules/archive/entity/CmProductArchiveContent.java

@@ -14,12 +14,14 @@ import com.thinkgem.jeesite.common.persistence.DataEntity;
  * @version 2021-09-06
  */
 public class CmProductArchiveContent extends DataEntity<CmProductArchiveContent> {
-	
+
 	private static final long serialVersionUID = 1L;
 	private Integer productArchiveId;		// 商品资料库id
 	private String title;		// 资料标题
 	private Integer type;		// 资料类型:1图片资料,2视频资料,3文件资料
 	private Date addTime;		// 添加时间
+	private Integer actualPv;		//浏览量
+	private String content;		//内容
 
 	private List<CmProductArchiveFile> fileList;	//图片列表
     private Integer fileId;                 //上传的文件id
@@ -30,6 +32,22 @@ public class CmProductArchiveContent extends DataEntity<CmProductArchiveContent>
 	private String ossUrl;			//oss链接
 	private String waterOssUrl;			//水印图片oss链接
 
+	public String getContent() {
+		return content;
+	}
+
+	public void setContent(String content) {
+		this.content = content;
+	}
+
+	public Integer getActualPv() {
+		return actualPv;
+	}
+
+	public void setActualPv(Integer actualPv) {
+		this.actualPv = actualPv;
+	}
+
 	public CmProductArchiveContent() {
 		super();
 	}
@@ -45,7 +63,7 @@ public class CmProductArchiveContent extends DataEntity<CmProductArchiveContent>
 	public void setProductArchiveId(Integer productArchiveId) {
 		this.productArchiveId = productArchiveId;
 	}
-	
+
 	@Length(min=0, max=50, message="资料标题长度必须介于 0 和 50 之间")
 	public String getTitle() {
 		return title;
@@ -54,7 +72,7 @@ public class CmProductArchiveContent extends DataEntity<CmProductArchiveContent>
 	public void setTitle(String title) {
 		this.title = title;
 	}
-	
+
 	public Integer getType() {
 		return type;
 	}
@@ -62,7 +80,7 @@ public class CmProductArchiveContent extends DataEntity<CmProductArchiveContent>
 	public void setType(Integer type) {
 		this.type = type;
 	}
-	
+
 	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
 	public Date getAddTime() {
 		return addTime;
@@ -135,4 +153,4 @@ public class CmProductArchiveContent extends DataEntity<CmProductArchiveContent>
 	public void setWaterOssUrl(String waterOssUrl) {
 		this.waterOssUrl = waterOssUrl;
 	}
-}
+}

+ 115 - 0
src/main/java/com/caimei/modules/info/dao/CmRelatedMapper.java

@@ -0,0 +1,115 @@
+package com.caimei.modules.info.dao;
+
+import java.util.List;
+
+import com.caimei.modules.info.entity.InfoAd;
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+import org.apache.ibatis.annotations.Param;
+import com.caimei.modules.info.entity.CmRelated;
+
+/**
+ * 相关资源Mapper接口
+ *
+ * @author Kaick
+ * @date 2023-08-02
+ */
+@MyBatisDao
+public interface CmRelatedMapper extends CrudDao<CmRelated>
+{
+    /**
+     * 通过对象查询相关资源列表
+     *
+     * @param cmRelated 相关资源
+     * @return 相关资源集合
+     */
+    public List<CmRelated> getCmRelatedList(CmRelated cmRelated);
+
+    /**
+     * 通过Id查询相关资源对象
+     *
+     * @param id 相关资源主键
+     * @return 相关资源
+     */
+    public CmRelated getCmRelatedById(String id);
+
+    /**
+     * 通过对象查询相关资源对象
+     *
+     * @param cmRelated 相关资源
+     * @return 相关资源
+     */
+    public CmRelated getByCmRelated(CmRelated cmRelated);
+
+    /**
+     * 通过对象查询相关资源Id
+     *
+     * @param cmRelated 相关资源
+     * @return String
+     */
+    public String getById(CmRelated cmRelated);
+
+    /**
+     * 通过对象查询相关资源Ids
+     *
+     * @param cmRelated 相关资源
+     * @return List<String>
+     */
+    public List<String> getByIds(CmRelated cmRelated);
+
+    /**
+     * 通过对象查询相关资源记录总数
+     *
+     * @param cmRelated 相关资源
+     * @return 相关资源Integer
+     */
+    public int getCmRelatedCount(CmRelated cmRelated);
+
+    /**
+     * 新增相关资源
+     *
+     * @param cmRelated 相关资源
+     * @return 结果
+     */
+    public int addCmRelated(CmRelated cmRelated);
+
+    /**
+     * 修改相关资源
+     *
+     * @param cmRelated 相关资源
+     * @return 结果
+     */
+    public int updateCmRelated(CmRelated cmRelated);
+
+    /**
+     * 删除相关资源
+     *
+     * @param id 相关资源主键
+     * @return 结果
+     */
+    public int delCmRelatedByAuthorId( @Param("type")String type,@Param("authorId")String authorId);
+
+    /**
+     * 删除相关资源
+     *
+     * @param id 相关资源主键
+     * @return 结果
+     */
+    public int delCmRelatedById(String id);
+
+    /**
+     * 批量删除相关资源
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int delCmRelatedByIds(@Param("ids") String[] ids);
+
+    /**
+     * 修改批量删除相关资源
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int updateDelCmRelatedByIds(@Param("ids") String[] ids,@Param("delFlag") Integer delFlag);
+}

+ 20 - 1
src/main/java/com/caimei/modules/info/dao/InfoDao.java

@@ -37,4 +37,23 @@ public interface InfoDao extends CrudDao<Info> {
     String getSensitiveWords(@Param("checkPoint") Integer checkPoint);
 
     void deleteInfo(String id);
-}
+
+	/**
+	 * 通过对象查询信息基础列表
+	 *
+	 * @param info 信息基础
+	 * @return 信息基础集合
+	 */
+	public List<Info> getInfoList(Info info);
+
+	/**
+	 * 通过对象查询信息基础对象
+	 *
+	 * @param info 信息基础
+	 * @return 信息基础
+	 */
+	public Info getByInfo(Info info);
+
+	public int updateInfo(Info info);
+
+}

+ 9 - 2
src/main/java/com/caimei/modules/info/dao/InfoTypeDao.java

@@ -4,8 +4,11 @@ import com.thinkgem.jeesite.common.persistence.CrudDao;
 import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
 import com.caimei.modules.info.entity.InfoType;
 
+import java.util.List;
+
 /**
  * 信息分类DAO接口
+ *
  * @author LG
  * @version 2016-06-27
  */
@@ -13,5 +16,9 @@ import com.caimei.modules.info.entity.InfoType;
 public interface InfoTypeDao extends CrudDao<InfoType> {
 
 	int countEnabledStatus(String enabledStatus);
-	
-}
+
+	InfoType getByInfoType(InfoType infoType);
+
+	List<InfoType> getByInfoTypeList(InfoType infoType);
+
+}

+ 54 - 0
src/main/java/com/caimei/modules/info/entity/CmRelated.java

@@ -0,0 +1,54 @@
+package com.caimei.modules.info.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import java.io.Serializable;
+import java.util.Date;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+import org.apache.ibatis.type.Alias;
+
+/**
+ * 相关资源对象 cm_related
+ *
+ * @author Kaick
+ * @date 2023-08-02
+ */
+//@Accessors(chain  = true )
+@Data
+@Alias("CmRelated")
+public class CmRelated extends DataEntity<CmRelated> implements Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    private String id;
+
+    /** 分类: 1 (info)相关文章 */
+    private String type;
+
+    /** 归属者Id(type字段表Id) */
+    private String authorId;
+
+    /** 相关Id(type字段表Id) */
+    private String relatedId;
+
+    /** 删除状态 0正常,其他删除 */
+    private String delFlag;
+
+    /** 修改时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+    /** 添加时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+    /** 排序值  */
+    private Integer sort;
+    //相关文章
+    private Info info;
+}
+

+ 46 - 0
src/main/java/com/caimei/modules/info/entity/Info.java

@@ -1,6 +1,7 @@
 package com.caimei.modules.info.entity;
 
 import java.util.Date;
+import java.util.List;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.thinkgem.jeesite.common.persistence.DataEntity;
@@ -14,6 +15,9 @@ public class Info extends DataEntity<Info> {
 
 	private static final long serialVersionUID = 1L;
 	private InfoType infoType;		// 信息分类
+	private String typeId;		// 信息分类Id
+	private String typeName;		// 信息分类名称
+	private String cmRelatedType;		// 相关文章分类
 	private String title;		// 标题
 	private String label;		// 信息标签
 	private String publisher;		// 发布人
@@ -27,6 +31,7 @@ public class Info extends DataEntity<Info> {
 	private String homePageImage;		// 商城首页图
 	private Date pubdate;		// 发布时间
 	private String recommendStatus;		// 推荐状态
+	private String autoStatus;		// 推荐状态
 	private Long basePraise;		// 基础点赞
 	private Long realPraise;		// 实际点赞
 	private Long basePv;		// 基础阅读量
@@ -45,6 +50,39 @@ public class Info extends DataEntity<Info> {
 	private String relatedLabels; //关联标签库
 	private String labelIds;
 	private String isRelevance;
+	List<CmRelated> cmRelatedList;
+
+	public String getCmRelatedType() {
+		return cmRelatedType;
+	}
+
+	public void setCmRelatedType(String cmRelatedType) {
+		this.cmRelatedType = cmRelatedType;
+	}
+
+	public List<CmRelated> getCmRelatedList() {
+		return cmRelatedList;
+	}
+
+	public void setCmRelatedList(List<CmRelated> cmRelatedList) {
+		this.cmRelatedList = cmRelatedList;
+	}
+
+	public String getTypeName() {
+		return typeName;
+	}
+
+	public void setTypeName(String typeName) {
+		this.typeName = typeName;
+	}
+
+	public String getTypeId() {
+		return typeId;
+	}
+
+	public void setTypeId(String typeId) {
+		this.typeId = typeId;
+	}
 
 	public Info() {
 		super();
@@ -70,6 +108,14 @@ public class Info extends DataEntity<Info> {
 		this.relatedLabels = relatedLabels;
 	}
 
+	public String getAutoStatus() {
+		return autoStatus;
+	}
+
+	public void setAutoStatus(String autoStatus) {
+		this.autoStatus = autoStatus;
+	}
+
 	//	@Length(min=0, max=11, message="信息分类长度必须介于 0 和 11 之间")
 //	public String getTypeId() {
 //		return typeId;

+ 19 - 41
src/main/java/com/caimei/modules/info/entity/InfoType.java

@@ -1,56 +1,34 @@
 package com.caimei.modules.info.entity;
 
+import com.caimei.modules.landing.domain.CmBrandLanding;
+import lombok.Data;
 import org.hibernate.validator.constraints.Length;
 
 import com.thinkgem.jeesite.common.persistence.DataEntity;
 
+import java.util.List;
+
 /**
  * 信息分类Entity
  * @author LG
  * @version 2016-06-27
  */
+@Data
 public class InfoType extends DataEntity<InfoType> {
-	
+
 	private static final long serialVersionUID = 1L;
 	private String name;		// 分类名称
 	private Integer sort;		// 排序(升序)
-	private Integer shopUseFlag;	// 是否供应商可用:0否,1是
-	
-	public InfoType() {
-		super();
-	}
-
-	public InfoType(String id){
-		super(id);
-	}
-
-	public InfoType(String id,String enabledStatus){
-		super();
-		this.id=id;
-		this.enabledStatus=enabledStatus;
-	}
-
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-	}
-	
-	public Integer getSort() {
-		return sort;
-	}
-
-	public void setSort(Integer sort) {
-		this.sort = sort;
-	}
-
-	public Integer getShopUseFlag() {
-		return shopUseFlag;
-	}
-
-	public void setShopUseFlag(Integer shopUseFlag) {
-		this.shopUseFlag = shopUseFlag;
-	}
-}
+	private Integer shopUseFlag;	// 是否供应商可用:0否,
+	/** 分类: 1 信息中心导航栏 */
+	private String type;
+
+	/** 父级编号 */
+	private String parentId;
+
+	/** 所有父级编号 */
+	private String parentIds;
+	/** 图片资源type=4 */
+	private List<CmBrandLanding> cmBrandLandingList;
+
+}

+ 194 - 0
src/main/java/com/caimei/modules/info/service/CmRelatedService.java

@@ -0,0 +1,194 @@
+package com.caimei.modules.info.service;
+
+import java.util.Date;
+import java.util.List;
+
+import com.caimei.modules.info.dao.CmInfoDocSynDao;
+import com.caimei.modules.info.entity.CmInfoDocSyn;
+import com.caimei.modules.info.entity.Info;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.service.CrudService;
+import com.thinkgem.jeesite.common.utils.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.caimei.modules.info.dao.CmRelatedMapper;
+import com.caimei.modules.info.entity.CmRelated;
+import com.caimei.modules.info.service.CmRelatedService;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * 相关资源Service业务层处理
+ *
+ * @author Kaick
+ * @date 2023-08-02
+ */
+@Service
+public class CmRelatedService extends CrudService<CmRelatedMapper, CmRelated> {
+    @Autowired
+    private CmRelatedMapper cmRelatedMapper;
+    @Autowired
+    private InfoService infoService;
+
+    public Page<CmRelated> findPage(Page<CmRelated> page, CmRelated cmRelated) {
+        Page<CmRelated> cmRelatedPage = super.findPage(page, cmRelated);
+        cmRelatedPage.getList().forEach(cmRelated1 -> {
+            cmRelated1.setInfo(infoService.get(cmRelated1.getRelatedId()));
+        });
+        return cmRelatedPage;
+    }
+
+    public List<CmRelated> getCmRelatedList(CmRelated cmRelated) {
+        List<CmRelated> cmRelatedList = cmRelatedMapper.getCmRelatedList(cmRelated);
+        cmRelatedList.forEach(cmRelated1 -> {
+            cmRelated1.setInfo(infoService.get(cmRelated1.getRelatedId()));
+        });
+        return cmRelatedList;
+    }
+
+    /**
+     * 通过Id查询相关资源
+     *
+     * @param id 相关资源主键
+     * @return 相关资源
+     */
+
+    public CmRelated getCmRelatedById(String id) {
+        CmRelated cmRelated = cmRelatedMapper.getCmRelatedById(id);
+        cmRelated.setInfo(infoService.get(cmRelated.getRelatedId()));
+        return cmRelated;
+    }
+
+    /**
+     * 通过对象查询相关资源
+     *
+     * @param cmRelated 相关资源
+     * @return 相关资源
+     */
+
+    public CmRelated getByCmRelated(CmRelated cmRelated) {
+        CmRelated byCmRelated = cmRelatedMapper.getByCmRelated(cmRelated);
+        byCmRelated.setInfo(infoService.get(cmRelated.getRelatedId()));
+        return byCmRelated;
+    }
+
+    /**
+     * 通过对象查询相关资源Id
+     *
+     * @param cmRelated 相关资源
+     * @return String
+     */
+
+    public String getById(CmRelated cmRelated) {
+        return cmRelatedMapper.getById(cmRelated);
+    }
+
+    /**
+     * 通过对象查询相关资源Ids
+     *
+     * @param cmRelated 相关资源
+     * @return List<String>
+     */
+
+    public List<String> getByIds(CmRelated cmRelated) {
+        return cmRelatedMapper.getByIds(cmRelated);
+    }
+
+    /**
+     * 通过对象查询相关资源记录总数
+     *
+     * @param cmRelated 相关资源
+     * @return int
+     */
+
+    public int getCmRelatedCount(CmRelated cmRelated) {
+        return cmRelatedMapper.getCmRelatedCount(cmRelated);
+    }
+
+    /**
+     * 新增相关资源
+     *
+     * @param cmRelated 相关资源
+     * @return 结果
+     */
+    @Transactional(readOnly = false)
+    public int addCmRelated(CmRelated cmRelated) {
+        cmRelated.setCreateTime(new Date());
+        return cmRelatedMapper.addCmRelated(cmRelated);
+    }
+
+    /**
+     * 修改相关资源
+     *
+     * @param cmRelated 相关资源
+     * @return 结果
+     */
+    @Transactional(readOnly = false)
+    public int updateCmRelated(CmRelated cmRelated) {
+        cmRelated.setUpdateTime(new Date());
+        return cmRelatedMapper.updateCmRelated(cmRelated);
+    }
+
+    /**
+     * 删除相关资源信息
+     *
+     * @param id 相关资源主键
+     * @return 结果
+     */
+    @Transactional(readOnly = false)
+    public int delCmRelatedById(String id) {
+        CmRelated cmRelated = new CmRelated();
+        cmRelated.setId(id);
+        cmRelated.setDelFlag("1");
+        return cmRelatedMapper.updateCmRelated(cmRelated);
+        //return cmRelatedMapper.delCmRelatedById(id);
+    }
+
+    /**
+     * 删除相关资源信息
+     *
+     * @param authorId 相关资源主键
+     * @return 结果
+     */
+    @Transactional(readOnly = false)
+    public int delCmRelatedByAuthorId(String type, String authorId) {
+        return cmRelatedMapper.delCmRelatedByAuthorId(type, authorId);
+    }
+
+    /**
+     * 批量删除相关资源
+     *
+     * @param ids 需要删除的相关资源主键
+     * @return 结果
+     */
+    @Transactional(readOnly = false)
+    public int delCmRelatedByIds(String[] ids) {
+        return cmRelatedMapper.updateDelCmRelatedByIds(ids, 1);
+        //return cmRelatedMapper.delCmRelatedByIds(ids);
+    }
+
+    /**
+     * 批量新增相关资源
+     *
+     * @param cmRelatedList 相关资源列表
+     * @return 结果
+     */
+    @Transactional(readOnly = false)
+    public void batchAddCmRelated(List<CmRelated> cmRelatedList) {
+        for (CmRelated cmRelated : cmRelatedList) {
+            cmRelatedMapper.addCmRelated(cmRelated);
+        }
+    }
+
+    /**
+     * 批量修改相关资源
+     *
+     * @param cmRelatedList 相关资源列表
+     * @return 结果
+     */
+    @Transactional(readOnly = false)
+    public void batchUpdateCmRelated(List<CmRelated> cmRelatedList) {
+        for (CmRelated cmRelated : cmRelatedList) {
+            cmRelatedMapper.updateCmRelated(cmRelated);
+        }
+    }
+}

+ 35 - 1
src/main/java/com/caimei/modules/info/service/InfoService.java

@@ -6,6 +6,7 @@ import java.util.List;
 import javax.servlet.http.HttpServletRequest;
 
 import com.caimei.modules.basesetting.dao.KeywordDao;
+import com.caimei.modules.hehe.entity.cmHeHeUserActivity;
 import com.caimei.modules.live.entity.NewPageLive;
 import com.caimei.modules.sys.utils.UploadImageUtils;
 import com.caimei.modules.utils.RequestUtil;
@@ -13,6 +14,7 @@ import com.caimei.modules.utils.message.InsideMessage;
 import com.caimei.modules.utils.message.MessageModel;
 import com.caimei.modules.utils.message.MqInfo;
 import com.caimei.modules.utils.message.enums.MessageType;
+import com.caimei.utils.StringUtil;
 import org.apache.commons.collections.CollectionUtils;
 import org.jsoup.Jsoup;
 import org.jsoup.nodes.Document;
@@ -89,6 +91,38 @@ public class InfoService extends CrudService<InfoDao, Info> {
         });
         return infoPage;
     }
+    /**
+     * 通过对象查询信息基础列表
+     *
+     * @return 信息基础
+     */
+    public List<Info> getInfoList(Info info)
+    {
+        return infoDao.getInfoList(info);
+    }
+
+    /**
+     * 通过对象查询信息基础
+     *
+     * @param info 信息基础
+     * @return 信息基础
+     */
+    public Info getByInfo(Info info)
+    {
+        return infoDao.getByInfo(info);
+    }
+    /**
+     * 修改信息基础
+     *
+     * @param info 信息基础
+     * @return 结果
+     */
+    @Transactional(readOnly = false)
+    public int updateInfo(Info info)
+    {
+        info.setUpdateDate(new Date());
+        return infoDao.updateInfo(info);
+    }
 
     @Transactional(readOnly = false)
     public void save(Info info, HttpServletRequest request) {
@@ -336,4 +370,4 @@ public class InfoService extends CrudService<InfoDao, Info> {
     public void offlineInfo(Integer id) {
         infoDao.offlineInfo(id);
     }
-}
+}

+ 35 - 7
src/main/java/com/caimei/modules/info/service/InfoTypeService.java

@@ -1,7 +1,9 @@
 package com.caimei.modules.info.service;
 
+import java.util.Date;
 import java.util.List;
 
+import com.caimei.modules.landing.mapper.CmBrandLandingMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -22,27 +24,53 @@ public class InfoTypeService extends CrudService<InfoTypeDao, InfoType> {
 
 	@Autowired
 	private InfoTypeDao infoTypedao;
-	
+	@Autowired
+	private CmBrandLandingMapper cmBrandLandingMapper;
+
 	public InfoType get(String id) {
 		return super.get(id);
 	}
-	
+
 	public List<InfoType> findList(InfoType infoType) {
 		return super.findList(infoType);
 	}
-	
+
 	public Page<InfoType> findPage(Page<InfoType> page, InfoType infoType) {
 		return super.findPage(page, infoType);
 	}
-	
+
 	@Transactional(readOnly = false)
 	public void save(InfoType infoType) {
+		infoType.setEnabledStatus("1");
+		if ("0".equals(infoType.getParentId())) {
+			infoType.setParentIds("0");
+		} else {
+			InfoType infoType1 = infoTypedao.get(infoType.getParentId());
+			infoType.setParentIds(infoType1.getParentIds() + "," + infoType.getParentId());
+		}
 		super.save(infoType);
+		cmBrandLandingMapper.delCmBrandLandingByAuthorId(infoType.getId());
+		//封装数据
+		infoType.getCmBrandLandingList().forEach(cmBrandLanding -> {
+			cmBrandLanding.setType(4);
+			cmBrandLanding.setAuthorId(infoType.getId());
+			cmBrandLanding.setAddTime(new Date());
+			cmBrandLandingMapper.insertCmBrandLanding(cmBrandLanding);
+		});
+
 	}
-	
+
 	@Transactional(readOnly = false)
 	public void delete(InfoType infoType) {
 		super.delete(infoType);
+		cmBrandLandingMapper.delCmBrandLandingByAuthorId(infoType.getId());
+		InfoType infoType1 = new InfoType();
+		infoType1.setParentIds(infoType.getId());
+		List<InfoType> byInfoTypeIdList = infoTypedao.getByInfoTypeList(infoType1);
+		byInfoTypeIdList.forEach(byInfoTypeId->{
+			super.delete(byInfoTypeId);
+			cmBrandLandingMapper.delCmBrandLandingByAuthorId(byInfoTypeId.getId());
+		});
 	}
 
 	@Transactional(readOnly = false)
@@ -53,5 +81,5 @@ public class InfoTypeService extends CrudService<InfoTypeDao, InfoType> {
 	public int countEnabledStatus(String enabledStatus) {
 		return infoTypedao.countEnabledStatus(enabledStatus);
 	}
-	
-}
+
+}

+ 129 - 0
src/main/java/com/caimei/modules/info/web/InfoController.java

@@ -7,9 +7,12 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import com.alibaba.fastjson.JSONArray;
+import com.caimei.modules.hehe.entity.CmHeheProduct;
 import com.caimei.modules.info.dao.InfoDao;
 import com.caimei.modules.info.entity.CmInfoDocSyn;
+import com.caimei.modules.info.entity.CmRelated;
 import com.caimei.modules.info.service.CmInfoDocSynService;
+import com.caimei.modules.info.service.CmRelatedService;
 import com.caimei.modules.opensearch.GenerateUtils;
 import com.caimei.modules.opensearch.CoreServiceUitls;
 import com.caimei.modules.product.dao.KeywordFrequencyDao;
@@ -48,6 +51,8 @@ public class InfoController extends BaseController {
 
     @Autowired
     private InfoService infoService;
+    @Autowired
+    private CmRelatedService cmRelatedService;
 
     @Autowired
     private InfoTypeService infoTypeService;
@@ -100,6 +105,7 @@ public class InfoController extends BaseController {
             }
         }
         InfoType infoType = new InfoType();
+        infoType.setType("1");
         infoType.setEnabledStatus("1");
         List<InfoType> typeList = infoTypeService.findList(infoType);
         List<Info> topList = infoService.findTopList();
@@ -157,6 +163,120 @@ public class InfoController extends BaseController {
         return "modules/info/infoForm";
     }
 
+    @RequiresPermissions("info:info:view")
+    @RequestMapping(value = "relatedForm")
+    public String relatedForm(Info info, String ltype, Model model) {
+        CmRelated cmRelated = new CmRelated();
+        cmRelated.setAuthorId(info.getId());
+        cmRelated.setType("1");
+        info.setCmRelatedList(cmRelatedService.getCmRelatedList(cmRelated));
+        model.addAttribute("info", info);
+        model.addAttribute("ltype", ltype);
+        return "modules/info/infoRelatedForm";
+    }
+
+
+    /**
+     * 精选推荐,文章数据
+     */
+    @RequestMapping(value = "infoSelectedPage")
+    public String infoSelectedList(CmRelated cmRelated, Model model, HttpServletRequest request, HttpServletResponse response) {
+        cmRelated.setType("2");
+        Page<CmRelated> page = cmRelatedService.findPage(new Page<CmRelated>(request, response), cmRelated);
+        InfoType infoType = new InfoType();
+        infoType.setType("1");
+        infoType.setEnabledStatus("1");
+        List<InfoType> typeList = infoTypeService.findList(infoType);
+        model.addAttribute("typeList", typeList);
+        model.addAttribute("page", page);
+        return "modules/info/infoSelectedList";
+    }
+
+    /**
+     * 选择文章,文章数据
+     */
+    @RequestMapping(value = "findInfoPage")
+    public String findInfoPage(Info info, Model model, HttpServletRequest request, HttpServletResponse response) {
+        info.setEnabledStatus("1");
+        Page<Info> page = infoService.findPage(new Page<Info>(request, response), info);
+        InfoType infoType = new InfoType();
+        infoType.setType("1");
+        infoType.setEnabledStatus("1");
+        List<InfoType> typeList = infoTypeService.findList(infoType);
+        model.addAttribute("typeList", typeList);
+        model.addAttribute("page", page);
+        return "modules/info/addInfoForm";
+    }
+
+
+    /**
+     * 添加精选文章文章数据
+     */
+    @RequestMapping(value = "addSelectedInfos")
+    @ResponseBody
+    public Map<String, Object> addSelectedInfos(String infoIds) {
+        for (String relatedId : infoIds.split(",")) {
+            CmRelated cmRelated = new CmRelated();
+            cmRelated.setRelatedId(relatedId);
+            cmRelated.setType("2");
+            cmRelated.setSort(0);
+            cmRelated.setDelFlag("0");
+            cmRelated.setCreateTime(new Date());
+            cmRelatedService.addCmRelated(cmRelated);
+        }
+        HashMap<String, Object> map = new HashMap<>(2);
+        map.put("success", true);
+        map.put("info", "添加文章成功");
+        return map;
+    }
+
+    /**
+     * 添加文章数据
+     */
+    @RequestMapping(value = "addInfos")
+    @ResponseBody
+    public Map<String, Object> addInfos(String infoIds) {
+        Info info = new Info();
+        info.setId("IN=" + infoIds);
+        info.setEnabledStatus("1");
+        List<Info> infoList = infoService.getInfoList(info);
+        HashMap<String, Object> map = new HashMap<>(2);
+        map.put("infoList", infoList);
+        map.put("success", true);
+        map.put("info", "添加文章成功");
+        return map;
+    }
+
+    @RequestMapping(value = "relatedSave")
+    public String relatedSave(Info info, Model model, RedirectAttributes redirectAttributes, HttpServletRequest request) {
+        Info byInfo = new Info();
+        byInfo.setId(info.getId());
+        byInfo.setAutoStatus(info.getAutoStatus());
+        infoService.updateInfo(byInfo);
+        if ("1".equals(info.getAutoStatus())) {
+            cmRelatedService.delCmRelatedByAuthorId("1", info.getId());
+            info.getCmRelatedList().forEach(cmRelated -> {
+                cmRelated.setType("1");
+                cmRelated.setDelFlag("0");
+                cmRelated.setCreateTime(new Date());
+                cmRelatedService.addCmRelated(cmRelated);
+            });
+        }
+        addMessage(redirectAttributes, "保存信息成功");
+        // 更新索引
+        coreServiceUitls.updateArticleIndex(Integer.valueOf(info.getId()));
+        return "redirect:" + Global.getAdminPath() + "/info/info/list?repage&publishSource=" + info.getPublishSource();
+    }
+
+    @RequestMapping(value = "infoSelectedListSave")
+    public String infoSelectedListSave(Info info, Model model, RedirectAttributes redirectAttributes, HttpServletRequest request) {
+        info.getCmRelatedList().forEach(cmRelated -> {
+            cmRelatedService.updateCmRelated(cmRelated);
+        });
+        addMessage(redirectAttributes, "更新排序成功");
+        return "redirect:" + Global.getAdminPath() + "/info/info/infoSelectedPage";
+    }
+
     @RequiresPermissions("info:info:edit")
     @RequestMapping(value = "save")
     public String save(Info info, Model model, String ltype, RedirectAttributes redirectAttributes, HttpServletRequest request) {
@@ -201,6 +321,7 @@ public class InfoController extends BaseController {
         return "redirect:" + Global.getAdminPath() + "/info/info/list?repage&publishSource=" + info.getPublishSource();
     }
 
+
     @RequiresPermissions("info:info:delete")
     @RequestMapping(value = "delete")
     public String delete(Info info, RedirectAttributes redirectAttributes) {
@@ -217,6 +338,14 @@ public class InfoController extends BaseController {
         return "redirect:" + Global.getAdminPath() + "/info/info/?repage&publishSource=1";
     }
 
+    @RequiresPermissions("info:info:delete")
+    @RequestMapping(value = "delInfoSelected")
+    public String delete(CmRelated cmRelated, RedirectAttributes redirectAttributes) {
+        cmRelatedService.delCmRelatedById(cmRelated.getId());
+        addMessage(redirectAttributes, "删除文章成功");
+        return "redirect:" + Global.getAdminPath() + "/info/info/infoSelectedPage";
+    }
+
     /**
      * 批量修改启用、停用状态
      *

+ 14 - 7
src/main/java/com/caimei/modules/info/web/InfoTypeController.java

@@ -6,6 +6,8 @@ import java.util.Map;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import com.caimei.modules.landing.domain.CmBrandLanding;
+import com.caimei.modules.landing.service.CmBrandLandingService;
 import com.caimei.modules.opensearch.CoreServiceUitls;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -39,18 +41,23 @@ public class InfoTypeController extends BaseController {
 
 	@Autowired
 	private InfoTypeService infoTypeService;
-
+	@Autowired
+	private CmBrandLandingService cmBrandLandingService;
 	@Autowired
 	private InfoService infoService;
 
-    @Autowired
-    private CoreServiceUitls coreServiceUitls;
+	@Autowired
+	private CoreServiceUitls coreServiceUitls;
 
 	@ModelAttribute
-	public InfoType get(@RequestParam(required=false) String id) {
+	public InfoType get(@RequestParam(required = false) String id) {
 		InfoType entity = null;
-		if (StringUtils.isNotBlank(id)){
+		if (StringUtils.isNotBlank(id)) {
 			entity = infoTypeService.get(id);
+			CmBrandLanding cmBrandLanding = new CmBrandLanding();
+			cmBrandLanding.setType(4);
+			cmBrandLanding.setAuthorId(id);
+			entity.setCmBrandLandingList(cmBrandLandingService.selectCmBrandLandingList(cmBrandLanding));
 		}
 		if (entity == null){
 			entity = new InfoType();
@@ -83,7 +90,7 @@ public class InfoTypeController extends BaseController {
 		addMessage(redirectAttributes, "保存信息分类成功");
 		// 更新全部文章索引
 		coreServiceUitls.updateAllArticleIndex();
-		return "redirect:"+Global.getAdminPath()+"/info/infoType/?repage";
+		return "redirect:"+Global.getAdminPath()+"/info/infoType/?repage&type="+infoType.getType()+"&parentId="+infoType.getParentId();
 	}
 
 	@RequiresPermissions("info:infoType:delete")
@@ -101,7 +108,7 @@ public class InfoTypeController extends BaseController {
 			// 更新全部文章索引
 			coreServiceUitls.updateAllArticleIndex();
 		}
-		return "redirect:"+Global.getAdminPath()+"/info/infoType/?repage";
+		return "redirect:"+Global.getAdminPath()+"/info/infoType/?repage&type="+infoType.getType()+"&parentId="+infoType.getParentId();
 	}
 
 	/**

+ 9 - 197
src/main/java/com/caimei/modules/landing/domain/CmBrandLanding.java

@@ -3,6 +3,7 @@ package com.caimei.modules.landing.domain;
 import java.util.Date;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.thinkgem.jeesite.common.persistence.DataEntity;
+import lombok.Data;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import org.apache.ibatis.type.Alias;
@@ -12,10 +13,11 @@ import java.util.List;
 
 /**
  * 供应商落地页资源对象 cm_brand_landing
- * 
+ *
  * @author Kaick
  * @date 2023-05-24
  */
+@Data
 @Alias("CmBrandLanding")
 public class CmBrandLanding extends DataEntity<CmBrandLanding> implements Serializable
 {
@@ -23,13 +25,17 @@ public class CmBrandLanding extends DataEntity<CmBrandLanding> implements Serial
 
     /** id */
     private String id;
-
     /** 供应商id */
     private Integer authUserId;
 
-    /** 分类:1成功案例,2增长社区-视频列表,3增长社区-文章列表 */
+    /** 分类:1成功案例,2增长社区-视频列表,3增长社区-文章列表, 4信息中心导航栏(info_type) */
     private Integer type;
 
+    /** 子级分类: 信息中心导航栏(info_type):{1 大图,2小图} */
+    private Integer levelType;
+
+    /** 归属者Id(type字段表Id) */
+    private String authorId;
     /** pc端picture */
     private String headPcBanner;
 
@@ -72,8 +78,6 @@ public class CmBrandLanding extends DataEntity<CmBrandLanding> implements Serial
     private String delFlag;
     /** 文件名称*/
     private List<CmBrandFiles> cmBrandFiles;
-
-
     /** 修改时间 */
     @JsonFormat(pattern = "yyyy-MM-dd")
     private Date updateTime;
@@ -81,196 +85,4 @@ public class CmBrandLanding extends DataEntity<CmBrandLanding> implements Serial
     @JsonFormat(pattern = "yyyy-MM-dd")
     private Date addTime;
 
-    public List<CmBrandFiles> getCmBrandFiles() {
-        return cmBrandFiles;
-    }
-
-    public void setCmBrandFiles(List<CmBrandFiles> cmBrandFiles) {
-        this.cmBrandFiles = cmBrandFiles;
-    }
-
-    public Date getUpdateTime() {
-        return updateTime;
-    }
-
-    public void setUpdateTime(Date updateTime) {
-        this.updateTime = updateTime;
-    }
-    public void setId(String id)
-    {
-        this.id = id;
-    }
-
-    public String getId()
-    {
-        return id;
-    }
-    public void setAuthUserId(Integer authUserId) 
-    {
-        this.authUserId = authUserId;
-    }
-
-    public Integer getAuthUserId() 
-    {
-        return authUserId;
-    }
-    public void setType(Integer type) 
-    {
-        this.type = type;
-    }
-
-    public Integer getType() 
-    {
-        return type;
-    }
-    public void setHeadPcBanner(String headPcBanner) 
-    {
-        this.headPcBanner = headPcBanner;
-    }
-
-    public String getHeadPcBanner() 
-    {
-        return headPcBanner;
-    }
-    public void setHeadAppBanner(String headAppBanner) 
-    {
-        this.headAppBanner = headAppBanner;
-    }
-
-    public String getHeadAppBanner() 
-    {
-        return headAppBanner;
-    }
-    public void setJumpStatus(Integer jumpStatus) 
-    {
-        this.jumpStatus = jumpStatus;
-    }
-
-    public Integer getJumpStatus() 
-    {
-        return jumpStatus;
-    }
-    public void setJumpPcPicture(String jumpPcPicture) 
-    {
-        this.jumpPcPicture = jumpPcPicture;
-    }
-
-    public String getJumpPcPicture() 
-    {
-        return jumpPcPicture;
-    }
-    public void setJumpAppPicture(String jumpAppPicture) 
-    {
-        this.jumpAppPicture = jumpAppPicture;
-    }
-
-    public String getJumpAppPicture() 
-    {
-        return jumpAppPicture;
-    }
-    public void setJumpLink(String jumpLink) 
-    {
-        this.jumpLink = jumpLink;
-    }
-
-    public String getJumpLink() 
-    {
-        return jumpLink;
-    }
-    public void setTitle(String title) 
-    {
-        this.title = title;
-    }
-
-    public String getTitle() 
-    {
-        return title;
-    }
-    public void setContent(String content) 
-    {
-        this.content = content;
-    }
-
-    public String getContent() 
-    {
-        return content;
-    }
-    public void setVideo(String video) 
-    {
-        this.video = video;
-    }
-
-    public String getVideo() 
-    {
-        return video;
-    }
-    public void setSort(Integer sort) 
-    {
-        this.sort = sort;
-    }
-
-    public Integer getSort() 
-    {
-        return sort;
-    }
-    public void setPcStatus(Integer pcStatus) 
-    {
-        this.pcStatus = pcStatus;
-    }
-
-    public Integer getPcStatus() 
-    {
-        return pcStatus;
-    }
-    public void setAppStatus(Integer appStatus) 
-    {
-        this.appStatus = appStatus;
-    }
-
-    public Integer getAppStatus() 
-    {
-        return appStatus;
-    }
-    public void setDelFlag(String delFlag)
-    {
-        this.delFlag = delFlag;
-    }
-
-    public String getDelFlag()
-    {
-        return delFlag;
-    }
-    public void setAddTime(Date addTime) 
-    {
-        this.addTime = addTime;
-    }
-
-    public Date getAddTime() 
-    {
-        return addTime;
-    }
-
-    @Override
-    public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("id", getId())
-            .append("authUserId", getAuthUserId())
-            .append("type", getType())
-            .append("headPcBanner", getHeadPcBanner())
-            .append("headAppBanner", getHeadAppBanner())
-            .append("jumpStatus", getJumpStatus())
-            .append("jumpPcPicture", getJumpPcPicture())
-            .append("jumpAppPicture", getJumpAppPicture())
-            .append("jumpLink", getJumpLink())
-            .append("title", getTitle())
-            .append("content", getContent())
-            .append("video", getVideo())
-            .append("sort", getSort())
-            .append("pcStatus", getPcStatus())
-            .append("appStatus", getAppStatus())
-            .append("delFlag", getDelFlag())
-            .append("updateTime", getUpdateTime())
-            .append("addTime", getAddTime())
-            .toString();
-    }
 }

+ 23 - 7
src/main/java/com/caimei/modules/landing/mapper/CmBrandLandingMapper.java

@@ -11,7 +11,7 @@ import java.util.List;
 
 /**
  * 供应商落地页资源Mapper接口
- * 
+ *
  * @author Kaick
  * @date 2023-05-24
  */
@@ -24,7 +24,7 @@ public interface CmBrandLandingMapper  extends CrudDao<CmBrandLanding>
     public int updateSort(@Param("id") String id, @Param("sort") String sort);
     /**
      * 查询供应商落地页资源
-     * 
+     *
      * @param id 供应商落地页资源主键
      * @return 供应商落地页资源
      */
@@ -32,7 +32,15 @@ public interface CmBrandLandingMapper  extends CrudDao<CmBrandLanding>
 
     /**
      * 查询供应商落地页资源列表
-     * 
+     *
+     * @param cmBrandLanding 供应商落地页资源
+     * @return 供应商落地页资源集合
+     */
+    public String getById(CmBrandLanding cmBrandLanding);
+
+    /**
+     * 查询供应商落地页资源列表
+     *
      * @param cmBrandLanding 供应商落地页资源
      * @return 供应商落地页资源集合
      */
@@ -40,7 +48,7 @@ public interface CmBrandLandingMapper  extends CrudDao<CmBrandLanding>
 
     /**
      * 新增供应商落地页资源
-     * 
+     *
      * @param cmBrandLanding 供应商落地页资源
      * @return 结果
      */
@@ -48,7 +56,7 @@ public interface CmBrandLandingMapper  extends CrudDao<CmBrandLanding>
 
     /**
      * 修改供应商落地页资源
-     * 
+     *
      * @param cmBrandLanding 供应商落地页资源
      * @return 结果
      */
@@ -56,15 +64,23 @@ public interface CmBrandLandingMapper  extends CrudDao<CmBrandLanding>
 
     /**
      * 删除供应商落地页资源
-     * 
+     *
      * @param id 供应商落地页资源主键
      * @return 结果
      */
     public int deleteCmBrandLandingById(String id);
 
+    /**
+     * 删除供应商落地页资源
+     *
+     * @param authorId 供应商落地页资源主键
+     * @return 结果
+     */
+    public int delCmBrandLandingByAuthorId(String authorId);
+
     /**
      * 批量删除供应商落地页资源
-     * 
+     *
      * @param ids 需要删除的数据主键集合
      * @return 结果
      */

+ 8 - 7
src/main/java/com/thinkgem/jeesite/common/persistence/DataEntity.java

@@ -5,6 +5,7 @@ package com.thinkgem.jeesite.common.persistence;
 
 import java.util.Date;
 
+import com.thinkgem.jeesite.common.utils.IdGen;
 import org.apache.commons.lang3.StringUtils;
 import org.hibernate.validator.constraints.Length;
 
@@ -21,7 +22,7 @@ import com.thinkgem.jeesite.modules.sys.utils.UserUtils;
 public abstract class DataEntity<T> extends BaseEntity<T> {
 
 	private static final long serialVersionUID = 1L;
-	
+
 	protected String remarks;	// 备注
 	protected User createBy;	// 创建者
 	protected Date createDate;	// 创建日期
@@ -29,16 +30,16 @@ public abstract class DataEntity<T> extends BaseEntity<T> {
 	protected Date updateDate;	// 更新日期
 	protected String delFlag; 	// 删除标记(0:正常;1:删除;2:审核)
 	protected String enabledStatus;		// 启用/禁用状态
-	
+
 	public DataEntity() {
 		super();
 		this.delFlag = DEL_FLAG_NORMAL;
 	}
-	
+
 	public DataEntity(String id) {
 		super(id);
 	}
-	
+
 	/**
 	 * 插入之前执行方法,需要手动调用
 	 */
@@ -57,7 +58,7 @@ public abstract class DataEntity<T> extends BaseEntity<T> {
 		this.updateDate = new Date();
 		this.createDate = this.updateDate;
 	}
-	
+
 	/**
 	 * 更新之前执行方法,需要手动调用
 	 */
@@ -69,7 +70,7 @@ public abstract class DataEntity<T> extends BaseEntity<T> {
 		}
 		this.updateDate = new Date();
 	}
-	
+
 	@Length(min=0, max=255)
 	public String getRemarks() {
 		return remarks;
@@ -78,7 +79,7 @@ public abstract class DataEntity<T> extends BaseEntity<T> {
 	public void setRemarks(String remarks) {
 		this.remarks = remarks;
 	}
-	
+
 	@JsonIgnore
 	public User getCreateBy() {
 		return createBy;

+ 51 - 36
src/main/java/com/thinkgem/jeesite/common/persistence/Page.java

@@ -23,12 +23,12 @@ import com.thinkgem.jeesite.common.utils.CookieUtils;
  * @param <T>
  */
 public class Page<T> {
-	
+
 	private int pageNo = 1; // 当前页码
 	private int pageSize = Integer.valueOf(Global.getConfig("page.pageSize")); // 页面大小,设置为“-1”表示不进行分页(分页无效)
-	
+
 	private long count;// 总记录数,设置为“-1”表示不查询总数
-	
+
 	private int first;// 首页索引
 	private int last;// 尾页索引
 	private int prev;// 上一页索引
@@ -41,21 +41,21 @@ public class Page<T> {
 
 	private int length = 8;// 显示页面长度
 	private int slider = 1;// 前后显示页面长度
-	
+
 	private List<T> list = new ArrayList<T>();
-	
+
 	private String orderBy = ""; // 标准查询有效, 实例: updatedate desc, name asc
 
 	private String funcName = "page"; // 设置点击页码调用的js函数名称,默认为page,在一页有多个分页对象时使用。
-	
+
 	private String funcParam = ""; // 函数的附加参数,第三个参数值。
-	
+
 	private String message = ""; // 设置提示消息,显示在“共n条”之后
 
 	public Page() {
 		this.pageSize = -1;
 	}
-	
+
 	/**
 	 * 构造方法
 	 * @param request 传递 repage 参数,来记住页码
@@ -102,7 +102,7 @@ public class Page<T> {
 			this.setOrderBy(orderBy);
 		}
 	}
-	
+
 	/**
 	 * 构造方法
 	 * @param pageNo 当前页码
@@ -111,7 +111,7 @@ public class Page<T> {
 	public Page(int pageNo, int pageSize) {
 		this(pageNo, pageSize, 0);
 	}
-	
+
 	/**
 	 * 构造方法
 	 * @param pageNo 当前页码
@@ -121,7 +121,22 @@ public class Page<T> {
 	public Page(int pageNo, int pageSize, long count) {
 		this(pageNo, pageSize, count, new ArrayList<T>());
 	}
-	
+
+	/**
+	 * 构造方法
+	 * @param pageNo 当前页码
+	 * @param pageSize 分页大小
+	 * @param count 数据条数
+	 * @param list 本页数据对象列表
+	 */
+	public Page(HttpServletRequest request, HttpServletResponse response,int pageNo, int pageSize, long count, List<T> list) {
+		this(request, response, -2);
+		this.setCount(count);
+		this.setPageNo(pageNo);
+		this.pageSize = pageSize;
+		this.list = list;
+	}
+
 	/**
 	 * 构造方法
 	 * @param pageNo 当前页码
@@ -135,17 +150,17 @@ public class Page<T> {
 		this.pageSize = pageSize;
 		this.list = list;
 	}
-	
+
 	/**
 	 * 初始化参数
 	 */
 	public void initialize(){
-				
+
 		//1
 		this.first = 1;
-		
+
 		this.last = (int)(count / (this.pageSize < 1 ? 20 : this.pageSize) + first - 1);
-		
+
 		if (this.count % this.pageSize != 0 || this.last == 0) {
 			this.last++;
 		}
@@ -153,7 +168,7 @@ public class Page<T> {
 		if (this.last < this.first) {
 			this.last = this.first;
 		}
-		
+
 		if (this.pageNo <= 1) {
 			this.pageNo = this.first;
 			this.firstPage=true;
@@ -175,7 +190,7 @@ public class Page<T> {
 		} else {
 			this.prev = this.first;
 		}
-		
+
 		//2
 		if (this.pageNo < this.first) {// 如果当前页小于首页
 			this.pageNo = this.first;
@@ -184,18 +199,18 @@ public class Page<T> {
 		if (this.pageNo > this.last) {// 如果当前页大于尾页
 			this.pageNo = this.last;
 		}
-		
+
 	}
-	
+
 	/**
-	 * 默认输出当前分页标签 
+	 * 默认输出当前分页标签
 	 * <div class="page">${page}</div>
 	 */
 	@Override
 	public String toString() {
 
 		StringBuilder sb = new StringBuilder();
-		
+
 		if (pageNo == first) {// 如果是首页
 			sb.append("<li class=\"disabled\"><a href=\"javascript:\">&#171; 上一页</a></li>\n");
 		} else {
@@ -264,14 +279,14 @@ public class Page<T> {
 		sb.append("共 " + count + " 条"+(message!=null?message:"")+"</a></li>\n");
 
 		sb.insert(0,"<ul>\n").append("</ul>\n");
-		
+
 		sb.append("<div style=\"clear:both;\"></div>");
 
 //		sb.insert(0,"<div class=\"page\">\n").append("</div>\n");
-		
+
 		return sb.toString();
 	}
-	
+
 	/**
 	 * 获取分页HTML代码
 	 * @return
@@ -279,7 +294,7 @@ public class Page<T> {
 	public String getHtml(){
 		return toString();
 	}
-	
+
 //	public static void main(String[] args) {
 //		Page<String> p = new Page<String>(3, 3);
 //		System.out.println(p);
@@ -307,7 +322,7 @@ public class Page<T> {
 			pageNo = 1;
 		}
 	}
-	
+
 	/**
 	 * 获取当前页码
 	 * @return
@@ -315,7 +330,7 @@ public class Page<T> {
 	public int getPageNo() {
 		return pageNo;
 	}
-	
+
 	/**
 	 * 设置当前页码
 	 * @param pageNo
@@ -323,7 +338,7 @@ public class Page<T> {
 	public void setPageNo(int pageNo) {
 		this.pageNo = pageNo;
 	}
-	
+
 	/**
 	 * 获取页面大小
 	 * @return
@@ -357,7 +372,7 @@ public class Page<T> {
 	public int getLast() {
 		return last;
 	}
-	
+
 	/**
 	 * 获取页面总数
 	 * @return getLast();
@@ -384,7 +399,7 @@ public class Page<T> {
 	public boolean isLastPage() {
 		return lastPage;
 	}
-	
+
 	/**
 	 * 上一页索引值
 	 * @return
@@ -410,7 +425,7 @@ public class Page<T> {
 			return pageNo + 1;
 		}
 	}
-	
+
 	/**
 	 * 获取本页数据对象列表
 	 * @return List<T>
@@ -435,7 +450,7 @@ public class Page<T> {
 	 */
 	@JsonIgnore
 	public String getOrderBy() {
-		// SQL过滤,防止注入 
+		// SQL过滤,防止注入
 		String reg = "(?:')|(?:--)|(/\\*(?:.|[\\n\\r])*?\\*/)|"
 					+ "(\\b(select|update|and|or|delete|insert|trancate|char|into|substr|ascii|declare|exec|count|master|into|drop|execute)\\b)";
 		Pattern sqlPattern = Pattern.compile(reg, Pattern.CASE_INSENSITIVE);
@@ -494,7 +509,7 @@ public class Page<T> {
 	public void setMessage(String message) {
 		this.message = message;
 	}
-	
+
 	/**
 	 * 分页是否有效
 	 * @return this.pageSize==-1
@@ -503,7 +518,7 @@ public class Page<T> {
 	public boolean isDisabled() {
 		return this.pageSize==-1;
 	}
-	
+
 	/**
 	 * 是否进行总数统计
 	 * @return this.count==-1
@@ -512,7 +527,7 @@ public class Page<T> {
 	public boolean isNotCount() {
 		return this.count==-1;
 	}
-	
+
 	/**
 	 * 获取 Hibernate FirstResult
 	 */
@@ -551,7 +566,7 @@ public class Page<T> {
 //		}
 //		return new PageRequest(this.pageNo - 1, this.pageSize, new Sort(orders));
 //	}
-//	
+//
 //	/**
 //	 * 设置 Spring data JPA 分页对象,转换为本系统分页对象
 //	 */

+ 1 - 1
src/main/resources/config/dev/caimei.properties

@@ -16,7 +16,7 @@ jdbc.url=jdbc:mysql://120.79.25.27:3306/caimei?useUnicode=true&characterEncoding
 jdbc.username=developer
 jdbc.password=J5p3tgOVazNl4ydf
 
-
+#
 #jdbc.url=jdbc:mysql://192.168.2.100:3306/caimei?characterEncoding=UTF8&serverTimezone=Asia/Shanghai
 #jdbc.username=developer
 #jdbc.password=05bZ/OxTB:X+yd%1

+ 21 - 15
src/main/resources/mappings/modules/archive/CmProductArchiveContentMapper.xml

@@ -1,11 +1,13 @@
 <?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.caimei.modules.archive.dao.CmProductArchiveContentDao">
-    
+
 	<sql id="cmProductArchiveContentColumns">
 		a.id AS "id",
 		a.productArchiveId AS "productArchiveId",
 		a.title AS "title",
+		a.content AS "content",
+		IFNULL(c.pv, 0) AS "actualPv",
 		a.type AS "type",
 		a.addTime AS "addTime",
 		if(a.type=2,cf.ossName,ifnull(cf.waterOssName,cf.ossName)) as ossName,
@@ -13,28 +15,29 @@
 		cf.uploadTime,
 		if(a.type=2,cf.ossUrl,ifnull(cf.waterOssUrl,cf.ossUrl)) as ossUrl
 	</sql>
-	
+
 	<sql id="cmProductArchiveContentJoins">
 		left join cm_product_archive_file cf on a.id = cf.archiveContentId and a.type != 1
+		left join cm_praise_statistics c on a.id = c.authorId and c.type =1
 	</sql>
-    
+
 	<select id="get" resultType="CmProductArchiveContent">
-		SELECT 
+		SELECT
 			<include refid="cmProductArchiveContentColumns"/>
 		FROM cm_product_archive_content a
 		<include refid="cmProductArchiveContentJoins"/>
 		WHERE a.id = #{id}
 	</select>
-	
+
 	<select id="findList" resultType="CmProductArchiveContent">
-		SELECT 
+		SELECT
 			<include refid="cmProductArchiveContentColumns"/>
 		FROM cm_product_archive_content a
 		<include refid="cmProductArchiveContentJoins"/>
 		<where>
-			
+
 			<if test="title != null and title != ''">
-				AND a.title LIKE 
+				AND a.title LIKE
 					<if test="dbName == 'oracle'">'%'||#{title}||'%'</if>
 					<if test="dbName == 'mssql'">'%'+#{title}+'%'</if>
 					<if test="dbName == 'mysql'">concat('%',#{title},'%')</if>
@@ -48,15 +51,15 @@
 		</where>
 		order by a.addTime desc
 	</select>
-	
+
 	<select id="findAllList" resultType="CmProductArchiveContent">
-		SELECT 
+		SELECT
 			<include refid="cmProductArchiveContentColumns"/>
 		FROM cm_product_archive_content a
 		<include refid="cmProductArchiveContentJoins"/>
 		<where>
-			
-		</where>		
+
+		</where>
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
 				ORDER BY ${page.orderBy}
@@ -81,11 +84,13 @@
 		INSERT INTO cm_product_archive_content(
 			productArchiveId,
 			title,
+			content,
 			type,
 			addTime
 		) VALUES (
 			#{productArchiveId},
 			#{title},
+			#{content},
 			#{type},
 			now()
 		)
@@ -97,8 +102,9 @@
 	</insert>
 
 	<update id="update">
-		UPDATE cm_product_archive_content SET 	
-			title = #{title}
+		UPDATE cm_product_archive_content SET
+			title = #{title},
+			content = #{content}
 		WHERE id = #{id}
 	</update>
 	<update id="updateFile">
@@ -119,4 +125,4 @@
 		delete from cm_product_archive_file where archiveContentId = #{archiveContentId}
 	</delete>
 
-</mapper>
+</mapper>

+ 443 - 0
src/main/resources/mappings/modules/info/CmRelatedMapper.xml

@@ -0,0 +1,443 @@
+<?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.caimei.modules.info.dao.CmRelatedMapper">
+
+    <resultMap type="CmRelated" id="CmRelatedResult">
+        <result property="id"    column="id"    />
+        <result property="type"    column="type"    />
+        <result property="authorId"    column="authorId"    />
+        <result property="relatedId"    column="relatedId"    />
+        <result property="delFlag"    column="delFlag"    />
+        <result property="updateTime"    column="updateTime"    />
+        <result property="createTime"    column="createTime"    />
+        <result property="sort"    column="sort"    />
+    </resultMap>
+
+    <sql id="selectCmRelatedVo">
+        select
+            cm_related.id,
+            cm_related.type,
+            cm_related.authorId,
+            cm_related.relatedId,
+            cm_related.delFlag,
+            cm_related.updateTime,
+            cm_related.createTime,
+            cm_related.sort
+    </sql>
+
+    <select id="getByCmRelated" parameterType="CmRelated" resultMap="CmRelatedResult">
+        <include refid="selectCmRelatedVo"/>
+        from cm_related AS cm_related
+        <where>  cm_related.delFlag = 0
+            <if test="id != null  and id != ''">
+                and cm_related.id
+                <if test="id.toUpperCase().indexOf('=')==-1">
+                    = #{id}
+                </if>
+                <if test="id.toUpperCase().indexOf('=')!=-1">
+                    <if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{idIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="type != null  and type != ''">
+                and cm_related.type
+                <if test="type.toUpperCase().indexOf('=')==-1">
+                    = #{type}
+                </if>
+                <if test="type.toUpperCase().indexOf('=')!=-1">
+                    <if test="type.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="type.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="typeIn" collection="type.substring(type.toUpperCase().indexOf('=')+1,type.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{typeIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="authorId != null  and authorId != ''"> and cm_related.authorId = #{authorId}</if>
+            <if test="relatedId != null  and relatedId != ''"> and cm_related.relatedId = #{relatedId}</if>
+            <if test="delFlag != null "> and cm_related.delFlag = #{delFlag}</if>
+            <if test="updateTime != null "> and cm_related.updateTime = #{updateTime}</if>
+            <if test="createTime != null "> and cm_related.createTime = #{createTime}</if>
+            <if test="sort != null "> and cm_related.sort = #{sort}</if>
+        </where>
+        group by cm_related.id
+        order by cm_related.createTime desc
+        limit 0,1
+    </select>
+
+    <select id="findList" parameterType="CmRelated" resultMap="CmRelatedResult">
+        <include refid="selectCmRelatedVo"/>
+        from cm_related AS cm_related
+        <if test="info != null">
+            left join info AS info on cm_related.relatedId=info.id
+        </if>
+        <where>  cm_related.delFlag = 0
+            <if test="id != null  and id != ''">
+                and cm_related.id
+                <if test="id.toUpperCase().indexOf('=')==-1">
+                    = #{id}
+                </if>
+                <if test="id.toUpperCase().indexOf('=')!=-1">
+                    <if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{idIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="type != null  and type != ''">
+                and cm_related.type
+                <if test="type.toUpperCase().indexOf('=')==-1">
+                    = #{type}
+                </if>
+                <if test="type.toUpperCase().indexOf('=')!=-1">
+                    <if test="type.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="type.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="typeIn" collection="type.substring(type.toUpperCase().indexOf('=')+1,type.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{typeIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="authorId != null  and authorId != ''"> and cm_related.authorId = #{authorId}</if>
+            <if test="relatedId != null  and relatedId != ''"> and cm_related.relatedId = #{relatedId}</if>
+            <if test="delFlag != null "> and cm_related.delFlag = #{delFlag}</if>
+            <if test="updateTime != null "> and cm_related.updateTime = #{updateTime}</if>
+            <if test="createTime != null "> and cm_related.createTime = #{createTime}</if>
+            <if test="sort != null "> and cm_related.sort = #{sort}</if>
+            --           info
+            <if test="info != null ">
+                <if test="info.id != null  and info.id != ''">
+                    and info.id
+                    = #{info.id}
+                </if>
+                <if test="info.typeId != null  and info.typeId != ''">
+                    and info.typeId
+                    = #{info.typeId}
+                </if>
+                <if test="info.title != null  and info.title != ''"> and info.title = #{info.title}</if>
+                <if test="info.label != null  and info.label != ''"> and info.label = #{info.label}</if>
+                <if test="info.publisher != null  and info.publisher != ''"> and info.publisher = #{info.publisher}</if>
+                <if test="info.source != null  and info.source != ''"> and info.source = #{info.source}</if>
+                <if test="info.publishSource != null "> and info.publishSource = #{info.publishSource}</if>
+                <if test="info.shopId != null "> and info.shopId = #{info.shopId}</if>
+                <if test="info.keyword != null  and info.keyword != ''"> and info.keyword = #{info.keyword}</if>
+                <if test="info.recommendContent != null  and info.recommendContent != ''"> and info.recommendContent = #{info.recommendContent}</if>
+                <if test="info.infoContent != null  and info.infoContent != ''"> and info.infoContent = #{info.infoContent}</if>
+                <if test="info.guidanceImage != null  and info.guidanceImage != ''"> and info.guidanceImage = #{info.guidanceImage}</if>
+                <if test="info.homePageImage != null  and info.homePageImage != ''"> and info.homePageImage = #{info.homePageImage}</if>
+                <if test="info.pubdate != null "> and info.pubdate = #{info.pubdate}</if>
+                <if test="info.recommendStatus != null  and info.recommendStatus != ''"> and info.recommendStatus = #{info.recommendStatus}</if>
+                <if test="info.enabledStatus != null  and info.enabledStatus != ''"> and info.enabledStatus = #{info.enabledStatus}</if>
+                <if test="info.basePraise != null "> and info.basePraise = #{info.basePraise}</if>
+                <if test="info.basePv != null "> and info.basePv = #{info.basePv}</if>
+                <if test="info.priorityIndex != null "> and info.priorityIndex = #{info.priorityIndex}</if>
+                <if test="info.auditStatus != null "> and info.auditStatus = #{info.auditStatus}</if>
+                <if test="info.onlineStatus != null "> and info.onlineStatus = #{info.onlineStatus}</if>
+                <if test="info.failReason != null  and info.failReason != ''"> and info.failReason = #{info.failReason}</if>
+                <if test="info.createBy != null  and info.createBy != ''"> and info.createBy = #{info.createBy}</if>
+                <if test="info.createDate != null "> and info.createDate = #{info.createDate}</if>
+                <if test="info.updateBy != null  and info.updateBy != ''"> and info.updateBy = #{info.updateBy}</if>
+                <if test="info.updateDate != null "> and info.updateDate = #{info.updateDate}</if>
+                <if test="info.topPosition != null "> and info.topPosition = #{info.topPosition}</if>
+                <if test="info.labelIds != null  and info.labelIds != ''"> and info.labelIds = #{info.labelIds}</if>
+                <if test="info.relatedLabels != null  and info.relatedLabels != ''"> and info.relatedLabels = #{info.relatedLabels}</if>
+                <if test="info.delFlag != null "> and info.delFlag = #{info.delFlag}</if>
+                <if test="info.autoStatus != null "> and info.autoStatus = #{info.autoStatus}</if>
+                <if test="info.startPubDate != null and info.startPubDate != ''">
+                    AND info.pubdate <![CDATA[  >=  ]]> #{info.startPubDate}
+                </if>
+                <if test="info.endPubDate != null and info.endPubDate != ''">
+                    AND info.pubdate <![CDATA[   <=  ]]> #{info.endPubDate}
+                </if>
+            </if>
+
+        </where>
+        group by cm_related.id
+        order by cm_related.sort asc,cm_related.createTime desc
+    </select>
+
+    <select id="getCmRelatedList" parameterType="CmRelated" resultMap="CmRelatedResult">
+        <include refid="selectCmRelatedVo"/>
+        from cm_related AS cm_related
+        <if test="info != null">
+            left join info AS info on cm_related.relatedId=info.id
+        </if>
+        <where>  cm_related.delFlag = 0
+            <if test="id != null  and id != ''">
+                and cm_related.id
+                <if test="id.toUpperCase().indexOf('=')==-1">
+                    = #{id}
+                </if>
+                <if test="id.toUpperCase().indexOf('=')!=-1">
+                    <if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{idIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="type != null  and type != ''">
+                and cm_related.type
+                <if test="type.toUpperCase().indexOf('=')==-1">
+                    = #{type}
+                </if>
+                <if test="type.toUpperCase().indexOf('=')!=-1">
+                    <if test="type.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="type.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="typeIn" collection="type.substring(type.toUpperCase().indexOf('=')+1,type.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{typeIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="authorId != null  and authorId != ''"> and cm_related.authorId = #{authorId}</if>
+            <if test="relatedId != null  and relatedId != ''"> and cm_related.relatedId = #{relatedId}</if>
+            <if test="delFlag != null "> and cm_related.delFlag = #{delFlag}</if>
+            <if test="updateTime != null "> and cm_related.updateTime = #{updateTime}</if>
+            <if test="createTime != null "> and cm_related.createTime = #{createTime}</if>
+            <if test="sort != null "> and cm_related.sort = #{sort}</if>
+            --           info
+            <if test="info != null ">
+                <if test="info.id != null  and info.id != ''">
+                    and info.id
+                    = #{info.id}
+                </if>
+                <if test="info.typeId != null  and info.typeId != ''">
+                    and info.typeId
+                    = #{info.typeId}
+                </if>
+                <if test="info.title != null  and info.title != ''"> and info.title = #{info.title}</if>
+                <if test="info.label != null  and info.label != ''"> and info.label = #{info.label}</if>
+                <if test="info.publisher != null  and info.publisher != ''"> and info.publisher = #{info.publisher}</if>
+                <if test="info.source != null  and info.source != ''"> and info.source = #{info.source}</if>
+                <if test="info.publishSource != null "> and info.publishSource = #{info.publishSource}</if>
+                <if test="info.shopId != null "> and info.shopId = #{info.shopId}</if>
+                <if test="info.keyword != null  and info.keyword != ''"> and info.keyword = #{info.keyword}</if>
+                <if test="info.recommendContent != null  and info.recommendContent != ''"> and info.recommendContent = #{info.recommendContent}</if>
+                <if test="info.infoContent != null  and info.infoContent != ''"> and info.infoContent = #{info.infoContent}</if>
+                <if test="info.guidanceImage != null  and info.guidanceImage != ''"> and info.guidanceImage = #{info.guidanceImage}</if>
+                <if test="info.homePageImage != null  and info.homePageImage != ''"> and info.homePageImage = #{info.homePageImage}</if>
+                <if test="info.pubdate != null "> and info.pubdate = #{info.pubdate}</if>
+                <if test="info.recommendStatus != null  and info.recommendStatus != ''"> and info.recommendStatus = #{info.recommendStatus}</if>
+                <if test="info.enabledStatus != null  and info.enabledStatus != ''"> and info.enabledStatus = #{info.enabledStatus}</if>
+                <if test="info.basePraise != null "> and info.basePraise = #{info.basePraise}</if>
+                <if test="info.basePv != null "> and info.basePv = #{info.basePv}</if>
+                <if test="info.priorityIndex != null "> and info.priorityIndex = #{info.priorityIndex}</if>
+                <if test="info.auditStatus != null "> and info.auditStatus = #{info.auditStatus}</if>
+                <if test="info.onlineStatus != null "> and info.onlineStatus = #{info.onlineStatus}</if>
+                <if test="info.failReason != null  and info.failReason != ''"> and info.failReason = #{info.failReason}</if>
+                <if test="info.createBy != null  and info.createBy != ''"> and info.createBy = #{info.createBy}</if>
+                <if test="info.createDate != null "> and info.createDate = #{info.createDate}</if>
+                <if test="info.updateBy != null  and info.updateBy != ''"> and info.updateBy = #{info.updateBy}</if>
+                <if test="info.updateDate != null "> and info.updateDate = #{info.updateDate}</if>
+                <if test="info.topPosition != null "> and info.topPosition = #{info.topPosition}</if>
+                <if test="info.labelIds != null  and info.labelIds != ''"> and info.labelIds = #{info.labelIds}</if>
+                <if test="info.relatedLabels != null  and info.relatedLabels != ''"> and info.relatedLabels = #{info.relatedLabels}</if>
+                <if test="info.delFlag != null "> and info.delFlag = #{info.delFlag}</if>
+                <if test="info.autoStatus != null "> and info.autoStatus = #{info.autoStatus}</if>
+                <if test="info.startPubDate != null and info.startPubDate != ''">
+                    AND info.pubdate <![CDATA[  >=  ]]> #{info.startPubDate}
+                </if>
+                <if test="info.endPubDate != null and info.endPubDate != ''">
+                    AND info.pubdate <![CDATA[   <=  ]]> #{info.endPubDate}
+                </if>
+            </if>
+
+        </where>
+        group by cm_related.id
+        order by cm_related.sort asc,cm_related.createTime desc
+    </select>
+
+    <select id="getCmRelatedCount" parameterType="CmRelated" resultType="String">
+        select count(1)
+        from cm_related AS cm_related
+        <where>  cm_related.delFlag = 0
+            <if test="id != null  and  id != ''">
+                and cm_related.id
+                <if test="id.toUpperCase().indexOf('=')==-1">
+                    = #{id}
+                </if>
+                <if test="id.toUpperCase().indexOf('=')!=-1">
+                    <if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{idIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="type != null  and type != ''">
+                and cm_related.type
+                <if test="type.toUpperCase().indexOf('=')==-1">
+                    = #{type}
+                </if>
+                <if test="type.toUpperCase().indexOf('=')!=-1">
+                    <if test="type.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="type.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="typeIn" collection="type.substring(type.toUpperCase().indexOf('=')+1,type.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{typeIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="authorId != null  and authorId != ''"> and cm_related.authorId = #{authorId}</if>
+            <if test="relatedId != null  and relatedId != ''"> and cm_related.relatedId = #{relatedId}</if>
+            <if test="delFlag != null "> and cm_related.delFlag = #{delFlag}</if>
+            <if test="updateTime != null "> and cm_related.updateTime = #{updateTime}</if>
+            <if test="createTime != null "> and cm_related.createTime = #{createTime}</if>
+            <if test="sort != null "> and cm_related.sort = #{sort}</if>
+        </where>
+        group by cm_related.id
+    </select>
+
+    <select id="getCmRelatedById" parameterType="String" resultMap="CmRelatedResult">
+        <include refid="selectCmRelatedVo"/>
+        from cm_related AS cm_related
+        where  cm_related.delFlag = 0 and cm_related.id = #{id}
+    </select>
+
+    <select id="getByIds" parameterType="CmRelated" resultType="String">
+        select id
+        from cm_related AS cm_related
+        <where>  cm_related.delFlag = 0
+            <if test="id != null  and id != ''">
+                and cm_related.id
+                <if test="id.toUpperCase().indexOf('=')==-1">
+                    = #{id}
+                </if>
+                <if test="id.toUpperCase().indexOf('=')!=-1">
+                    <if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{idIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="type != null  and type != ''">
+                and cm_related.type
+                <if test="type.toUpperCase().indexOf('=')==-1">
+                    = #{type}
+                </if>
+                <if test="type.toUpperCase().indexOf('=')!=-1">
+                    <if test="type.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="type.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="typeIn" collection="type.substring(type.toUpperCase().indexOf('=')+1,type.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{typeIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="authorId != null  and authorId != ''"> and cm_related.authorId = #{authorId}</if>
+            <if test="relatedId != null  and relatedId != ''"> and cm_related.relatedId = #{relatedId}</if>
+            <if test="delFlag != null "> and cm_related.delFlag = #{delFlag}</if>
+            <if test="updateTime != null "> and cm_related.updateTime = #{updateTime}</if>
+            <if test="createTime != null "> and cm_related.createTime = #{createTime}</if>
+            <if test="sort != null "> and cm_related.sort = #{sort}</if>
+        </where>
+        group by cm_related.id
+    </select>
+
+    <select id="getById" parameterType="CmRelated" resultType="String">
+        select id
+        from cm_related AS cm_related
+        <where>  cm_related.delFlag = 0
+            <if test="id != null  and id != ''">
+                and cm_related.id
+                <if test="id.toString().toUpperCase().indexOf('=')==-1">
+                    = #{id}
+                </if>
+                <if test="id.toString().toUpperCase().indexOf('=')!=-1">
+                    <if test="id.toString().toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="id.toString().toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="idIn" collection="id.toString().substring(id.toString().toUpperCase().indexOf('=')+1,id.toString().length()).trim().split(',')" open="(" separator="," close=")">
+                        #{idIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="type != null  and type != ''">
+                and cm_related.type
+                <if test="type.toUpperCase().indexOf('=')==-1">
+                    = #{type}
+                </if>
+                <if test="type.toUpperCase().indexOf('=')!=-1">
+                    <if test="type.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="type.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="typeIn" collection="type.substring(type.toUpperCase().indexOf('=')+1,type.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{typeIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="authorId != null  and authorId != ''"> and cm_related.authorId = #{authorId}</if>
+            <if test="relatedId != null  and relatedId != ''"> and cm_related.relatedId = #{relatedId}</if>
+            <if test="delFlag != null "> and cm_related.delFlag = #{delFlag}</if>
+            <if test="updateTime != null "> and cm_related.updateTime = #{updateTime}</if>
+            <if test="createTime != null "> and cm_related.createTime = #{createTime}</if>
+            <if test="sort != null "> and cm_related.sort = #{sort}</if>
+        </where>
+        group by cm_related.id
+        limit 0,1
+    </select>
+
+    <insert id="addCmRelated" parameterType="CmRelated" useGeneratedKeys="true" keyProperty="id">
+        insert into cm_related
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null and id != ''">id,</if>
+            <if test="type != null and type != ''">type,</if>
+            <if test="authorId != null and authorId != ''">authorId,</if>
+            <if test="relatedId != null and relatedId != ''">relatedId,</if>
+            <if test="delFlag != null">delFlag,</if>
+            <if test="updateTime != null">updateTime,</if>
+            <if test="createTime != null">createTime,</if>
+            <if test="sort != null">sort,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null and id != ''">#{id},</if>
+            <if test="type != null and type != ''">#{type},</if>
+            <if test="authorId != null and authorId != ''">#{authorId},</if>
+            <if test="relatedId != null and relatedId != ''">#{relatedId},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="sort != null">#{sort},</if>
+        </trim>
+    </insert>
+
+    <update id="updateCmRelated" parameterType="CmRelated">
+        update cm_related
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="type != null and type != ''">type = #{type},</if>
+            <if test="authorId != null and authorId != ''">authorId = #{authorId},</if>
+            <if test="relatedId != null and relatedId != ''">relatedId = #{relatedId},</if>
+            <if test="delFlag != null">delFlag = #{delFlag},</if>
+            <if test="updateTime != null">updateTime = #{updateTime},</if>
+            <if test="createTime != null">createTime = #{createTime},</if>
+            <if test="sort != null">sort = #{sort},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <update id="updateDelCmRelatedByIds" parameterType="String">
+        update cm_related set delFlag=#{delFlag} where id in
+        <foreach item="id" collection="ids" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </update>
+
+    <delete id="delCmRelatedById" parameterType="String">
+        delete
+        from cm_related where id = #{id}
+    </delete>
+
+    <delete id="delCmRelatedByAuthorId" parameterType="String">
+        delete
+        from cm_related where type = #{type} and authorId = #{authorId}
+    </delete>
+
+    <delete id="delCmRelatedByIds" parameterType="String">
+        delete from cm_related where id in
+        <foreach item="id" collection="ids" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+</mapper>

+ 241 - 3
src/main/resources/mappings/modules/info/InfoMapper.xml

@@ -6,6 +6,7 @@
         a.id AS "id",
 		a.shopId AS "shopId",
 		a.typeId AS "infoType.id",
+        b.name as typeName,
 		a.title AS "title",
 		a.label AS "label",
 		a.publisher AS "publisher",
@@ -24,6 +25,7 @@
 		a.basePv AS "basePv",
 		a.priorityIndex AS "priorityIndex",
 		a.auditStatus,
+		a.autoStatus,
         a.onlineStatus,
 		a.failReason,
 		c.num AS "realPraise",
@@ -43,6 +45,226 @@
 		LEFT JOIN info_praise c ON a.id=c.infoId
 		left join shop s on a.shopId = s.shopID
     </sql>
+    <resultMap type="com.caimei.modules.info.entity.Info" id="InfoResult">
+        <result property="id"    column="id"    />
+        <result property="typeId"    column="typeId"    />
+        <result property="typeName"    column="typeName"    />
+        <result property="title"    column="title"    />
+        <result property="label"    column="label"    />
+        <result property="publisher"    column="publisher"    />
+        <result property="source"    column="source"    />
+        <result property="publishSource"    column="publishSource"    />
+        <result property="shopId"    column="shopId"    />
+        <result property="keyword"    column="keyword"    />
+        <result property="recommendContent"    column="recommendContent"    />
+        <result property="infoContent"    column="infoContent"    />
+        <result property="guidanceImage"    column="guidanceImage"    />
+        <result property="homePageImage"    column="homePageImage"    />
+        <result property="pubdate"    column="pubdate"    />
+        <result property="recommendStatus"    column="recommendStatus"    />
+        <result property="enabledStatus"    column="enabledStatus"    />
+        <result property="basePraise"    column="basePraise"    />
+        <result property="basePv"    column="basePv"    />
+        <result property="priorityIndex"    column="priorityIndex"    />
+        <result property="auditStatus"    column="auditStatus"    />
+        <result property="onlineStatus"    column="onlineStatus"    />
+        <result property="failReason"    column="failReason"    />
+        <result property="createBy.id"    column="createBy"    />
+        <result property="createDate"    column="createDate"    />
+        <result property="updateBy.id"    column="updateBy"    />
+        <result property="updateDate"    column="updateDate"    />
+        <result property="topPosition"    column="topPosition"    />
+        <result property="labelIds"    column="labelIds"    />
+        <result property="relatedLabels"    column="relatedLabels"    />
+        <result property="delFlag"    column="delFlag"    />
+        <result property="autoStatus"    column="autoStatus"    />
+    </resultMap>
+
+    <sql id="selectInfoVo">
+        select
+            info.id,
+            info.typeId,
+            info.title,
+            info.label,
+            info.publisher,
+            info.source,
+            info.publishSource,
+            info.shopId,
+            info.keyword,
+            info.recommendContent,
+            info.infoContent,
+            info.guidanceImage,
+            info.homePageImage,
+            info.pubdate,
+            info.recommendStatus,
+            info.enabledStatus,
+            info.basePraise,
+            info.basePv,
+            info.priorityIndex,
+            info.auditStatus,
+            info.onlineStatus,
+            info.failReason,
+            info.createBy,
+            info.createDate,
+            info.updateBy,
+            info.updateDate,
+            info.topPosition,
+            info.labelIds,
+            info.relatedLabels,
+            info.delFlag,
+            info.autoStatus
+    </sql>
+
+    <select id="getByInfo" parameterType="com.caimei.modules.info.entity.Info" resultMap="InfoResult">
+        <include refid="selectInfoVo"/>
+        from info AS info
+        LEFT JOIN info_type b ON info.typeId=b.id
+        <where>  info.delFlag = 0
+            <if test="id != null  and id != ''">
+                and info.id
+                <if test="id.toUpperCase().indexOf('=')==-1">
+                    = #{id}
+                </if>
+                <if test="id.toUpperCase().indexOf('=')!=-1">
+                    <if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{idIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="typeId != null  and typeId != ''">
+                and info.typeId
+                    = #{typeId}
+            </if>
+            <if test="title != null  and title != ''"> and info.title = #{title}</if>
+            <if test="label != null  and label != ''"> and info.label = #{label}</if>
+            <if test="publisher != null  and publisher != ''"> and info.publisher = #{publisher}</if>
+            <if test="source != null  and source != ''"> and info.source = #{source}</if>
+            <if test="publishSource != null "> and info.publishSource = #{publishSource}</if>
+            <if test="shopId != null "> and info.shopId = #{shopId}</if>
+            <if test="keyword != null  and keyword != ''"> and info.keyword = #{keyword}</if>
+            <if test="recommendContent != null  and recommendContent != ''"> and info.recommendContent = #{recommendContent}</if>
+            <if test="infoContent != null  and infoContent != ''"> and info.infoContent = #{infoContent}</if>
+            <if test="guidanceImage != null  and guidanceImage != ''"> and info.guidanceImage = #{guidanceImage}</if>
+            <if test="homePageImage != null  and homePageImage != ''"> and info.homePageImage = #{homePageImage}</if>
+            <if test="pubdate != null "> and info.pubdate = #{pubdate}</if>
+            <if test="recommendStatus != null  and recommendStatus != ''"> and info.recommendStatus = #{recommendStatus}</if>
+            <if test="enabledStatus != null  and enabledStatus != ''"> and info.enabledStatus = #{enabledStatus}</if>
+            <if test="basePraise != null "> and info.basePraise = #{basePraise}</if>
+            <if test="basePv != null "> and info.basePv = #{basePv}</if>
+            <if test="priorityIndex != null "> and info.priorityIndex = #{priorityIndex}</if>
+            <if test="auditStatus != null "> and info.auditStatus = #{auditStatus}</if>
+            <if test="onlineStatus != null "> and info.onlineStatus = #{onlineStatus}</if>
+            <if test="failReason != null  and failReason != ''"> and info.failReason = #{failReason}</if>
+            <if test="createBy != null  and createBy != ''"> and info.createBy = #{createBy}</if>
+            <if test="createDate != null "> and info.createDate = #{createDate}</if>
+            <if test="updateBy != null  and updateBy != ''"> and info.updateBy = #{updateBy}</if>
+            <if test="updateDate != null "> and info.updateDate = #{updateDate}</if>
+            <if test="topPosition != null "> and info.topPosition = #{topPosition}</if>
+            <if test="labelIds != null  and labelIds != ''"> and info.labelIds = #{labelIds}</if>
+            <if test="relatedLabels != null  and relatedLabels != ''"> and info.relatedLabels = #{relatedLabels}</if>
+            <if test="delFlag != null "> and info.delFlag = #{delFlag}</if>
+            <if test="autoStatus != null "> and info.autoStatus = #{autoStatus}</if>
+        </where>
+        group by info.id
+        order by info.createDate desc
+        limit 0,1
+    </select>
+
+    <update id="updateInfo" parameterType="Info">
+        update info
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="typeId != null and typeId != ''">typeId = #{typeId},</if>
+            <if test="title != null and title != ''">title = #{title},</if>
+            <if test="label != null and label != ''">label = #{label},</if>
+            <if test="publisher != null and publisher != ''">publisher = #{publisher},</if>
+            <if test="source != null and source != ''">source = #{source},</if>
+            <if test="publishSource != null">publishSource = #{publishSource},</if>
+            <if test="shopId != null">shopId = #{shopId},</if>
+            <if test="keyword != null and keyword != ''">keyword = #{keyword},</if>
+            <if test="recommendContent != null and recommendContent != ''">recommendContent = #{recommendContent},</if>
+            <if test="infoContent != null and infoContent != ''">infoContent = #{infoContent},</if>
+            <if test="guidanceImage != null and guidanceImage != ''">guidanceImage = #{guidanceImage},</if>
+            <if test="homePageImage != null and homePageImage != ''">homePageImage = #{homePageImage},</if>
+            <if test="pubdate != null">pubdate = #{pubdate},</if>
+            <if test="recommendStatus != null and recommendStatus != ''">recommendStatus = #{recommendStatus},</if>
+            <if test="enabledStatus != null and enabledStatus != ''">enabledStatus = #{enabledStatus},</if>
+            <if test="basePraise != null">basePraise = #{basePraise},</if>
+            <if test="basePv != null">basePv = #{basePv},</if>
+            <if test="priorityIndex != null">priorityIndex = #{priorityIndex},</if>
+            <if test="auditStatus != null">auditStatus = #{auditStatus},</if>
+            <if test="onlineStatus != null">onlineStatus = #{onlineStatus},</if>
+            <if test="failReason != null and failReason != ''">failReason = #{failReason},</if>
+            <if test="createBy != null and createBy != ''">createBy = #{createBy},</if>
+            <if test="createDate != null">createDate = #{createDate},</if>
+            <if test="updateBy != null and updateBy != ''">updateBy = #{updateBy},</if>
+            <if test="updateDate != null">updateDate = #{updateDate},</if>
+            <if test="topPosition != null">topPosition = #{topPosition},</if>
+            <if test="labelIds != null and labelIds != ''">labelIds = #{labelIds},</if>
+            <if test="relatedLabels != null and relatedLabels != ''">relatedLabels = #{relatedLabels},</if>
+            <if test="delFlag != null">delFlag = #{delFlag},</if>
+            <if test="autoStatus != null">autoStatus = #{autoStatus},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <select id="getInfoList" parameterType="com.caimei.modules.info.entity.Info" resultMap="InfoResult">
+        <include refid="selectInfoVo"/>
+        ,b.name as typeName
+        from info AS info
+        LEFT JOIN info_type b ON info.typeId=b.id
+        <where>  info.delFlag = 0
+            <if test="id != null  and id != ''">
+                and info.id
+                <if test="id.toUpperCase().indexOf('=')==-1">
+                    = #{id}
+                </if>
+                <if test="id.toUpperCase().indexOf('=')!=-1">
+                    <if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{idIn}
+                    </foreach>
+                </if>
+            </if>
+            <if test="typeId != null  and typeId != ''">
+                and info.typeId
+                    = #{typeId}
+            </if>
+            <if test="title != null  and title != ''"> and info.title = #{title}</if>
+            <if test="label != null  and label != ''"> and info.label = #{label}</if>
+            <if test="publisher != null  and publisher != ''"> and info.publisher = #{publisher}</if>
+            <if test="source != null  and source != ''"> and info.source = #{source}</if>
+            <if test="publishSource != null "> and info.publishSource = #{publishSource}</if>
+            <if test="shopId != null "> and info.shopId = #{shopId}</if>
+            <if test="keyword != null  and keyword != ''"> and info.keyword = #{keyword}</if>
+            <if test="recommendContent != null  and recommendContent != ''"> and info.recommendContent = #{recommendContent}</if>
+            <if test="infoContent != null  and infoContent != ''"> and info.infoContent = #{infoContent}</if>
+            <if test="guidanceImage != null  and guidanceImage != ''"> and info.guidanceImage = #{guidanceImage}</if>
+            <if test="homePageImage != null  and homePageImage != ''"> and info.homePageImage = #{homePageImage}</if>
+            <if test="pubdate != null "> and info.pubdate = #{pubdate}</if>
+            <if test="recommendStatus != null  and recommendStatus != ''"> and info.recommendStatus = #{recommendStatus}</if>
+            <if test="enabledStatus != null  and enabledStatus != ''"> and info.enabledStatus = #{enabledStatus}</if>
+            <if test="basePraise != null "> and info.basePraise = #{basePraise}</if>
+            <if test="basePv != null "> and info.basePv = #{basePv}</if>
+            <if test="priorityIndex != null "> and info.priorityIndex = #{priorityIndex}</if>
+            <if test="auditStatus != null "> and info.auditStatus = #{auditStatus}</if>
+            <if test="onlineStatus != null "> and info.onlineStatus = #{onlineStatus}</if>
+            <if test="failReason != null  and failReason != ''"> and info.failReason = #{failReason}</if>
+            <if test="createBy != null  and createBy != ''"> and info.createBy = #{createBy}</if>
+            <if test="createDate != null "> and info.createDate = #{createDate}</if>
+            <if test="updateBy != null  and updateBy != ''"> and info.updateBy = #{updateBy}</if>
+            <if test="updateDate != null "> and info.updateDate = #{updateDate}</if>
+            <if test="topPosition != null "> and info.topPosition = #{topPosition}</if>
+            <if test="labelIds != null  and labelIds != ''"> and info.labelIds = #{labelIds}</if>
+            <if test="relatedLabels != null  and relatedLabels != ''"> and info.relatedLabels = #{relatedLabels}</if>
+            <if test="delFlag != null "> and info.delFlag = #{delFlag}</if>
+            <if test="autoStatus != null "> and info.autoStatus = #{autoStatus}</if>
+        </where>
+        group by info.id
+        order by info.createDate desc
+    </select>
 
     <select id="get" resultType="Info">
         SELECT
@@ -56,17 +278,33 @@
         SELECT
         <include refid="infoColumns"/>
         FROM info a
+        <if test="null !=cmRelatedType and cmRelatedType != ''">
+            left join cm_related AS cm_related on  cm_related.relatedId=a.id and cm_related.delFlag = 0 AND cm_related.type = #{cmRelatedType}
+        </if>
         <include refid="infoJoins"/>
         <where>
-            delFlag = 0
-            <if test="id != null and id != ''">
-                AND a.id = #{id}
+            a.delFlag = 0
+            <if test="id != null  and id != ''">
+                and a.id
+                <if test="id.toUpperCase().indexOf('=')==-1">
+                    = #{id}
+                </if>
+                <if test="id.toUpperCase().indexOf('=')!=-1">
+                    <if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
+                    <if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
+                    <foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
+                        #{idIn}
+                    </foreach>
+                </if>
             </if>
             <if test="null !=infoType">
                 <if test="infoType.id != null and infoType.id != ''">
                     AND a.typeId = #{infoType.id}
                 </if>
             </if>
+            <if test="null !=cmRelatedType and cmRelatedType != ''">
+                  and cm_related.relatedId is null
+            </if>
             <if test="title != null and title != ''">
                 AND a.title LIKE concat('%',#{title},'%')
             </if>

+ 116 - 22
src/main/resources/mappings/modules/info/InfoTypeMapper.xml

@@ -1,7 +1,7 @@
 <?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.caimei.modules.info.dao.InfoTypeDao">
-    
+
 	<sql id="infoTypeColumns">
 		a.id AS "id",
 		a.name AS "name",
@@ -11,24 +11,49 @@
 		a.createBy AS "createBy.id",
 		a.createDate AS "createDate",
 		a.updateBy AS "updateBy.id",
-		a.updateDate AS "updateDate"
+		a.updateDate AS "updateDate",
+		a.delFlag AS "delFlag",
+		a.type AS "type",
+		a.parentId AS "parentId",
+		a.parentIds AS "parentIds"
+	</sql>
+	<sql id="selectInfoTypeVo">
+		select
+			info_type.id,
+			info_type.name,
+			info_type.sort,
+			info_type.shopUseFlag,
+			info_type.enabledStatus,
+			info_type.createBy,
+			info_type.createDate,
+			info_type.updateBy,
+			info_type.updateDate,
+			info_type.delFlag,
+			info_type.type,
+			info_type.parentId,
+			info_type.parentIds
 	</sql>
-
 	<select id="get" resultType="InfoType">
-		SELECT 
+		SELECT
 			<include refid="infoTypeColumns"/>
 		FROM info_type a
 		WHERE a.id = #{id}
 	</select>
-	
+
 	<select id="findList" resultType="InfoType">
-		SELECT 
+		SELECT
 			<include refid="infoTypeColumns"/>
 		FROM info_type a
 		<where>
 			<if test="id != null and id != ''">
 				AND a.id = #{id}
 			</if>
+			<if test="type != null and type != ''">
+				AND a.type = #{type}
+			</if>
+			<if test="parentId != null and parentId != ''">
+				AND a.parentId = #{parentId}
+			</if>
 			<if test="enabledStatus != null and enabledStatus != ''">
 				AND a.enabledStatus = #{enabledStatus}
 			</if>
@@ -42,14 +67,14 @@
 			</otherwise>
 		</choose>
 	</select>
-	
+
 	<select id="findAllList" resultType="InfoType">
-		SELECT 
+		SELECT
 			<include refid="infoTypeColumns"/>
 		FROM info_type a
 		<where>
-			
-		</where>		
+
+		</where>
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
 				ORDER BY ${page.orderBy}
@@ -59,52 +84,121 @@
 			</otherwise>
 		</choose>
 	</select>
-	
+
 	<insert id="insert" parameterType="InfoType"  keyProperty="id" useGeneratedKeys="true">
 		INSERT INTO info_type(
 			name,
 			sort,
 			shopUseFlag,
+			enabledStatus,
 			createBy,
 			createDate,
 			updateBy,
-			updateDate
+			updateDate,
+			delFlag,
+			type,
+			parentId,
+			parentIds
 		) VALUES (
 			#{name},
 			#{sort},
 			#{shopUseFlag},
+			#{enabledStatus},
 			#{createBy.id},
 			#{createDate},
 			#{updateBy.id},
-			#{updateDate}
+			#{updateDate},
+			#{delFlag},
+			#{type},
+			#{parentId},
+			#{parentIds}
 		)
 	</insert>
-	
+
 	<update id="update">
-		UPDATE info_type SET 	
+		UPDATE info_type SET
 			name = #{name},
 			sort = #{sort},
 			shopUseFlag = #{shopUseFlag},
 			enabledStatus = #{enabledStatus},
 			updateBy = #{updateBy.id},
-			updateDate = #{updateDate}
+			updateDate = #{updateDate},
+			delFlag =#{delFlag},
+			type =#{type},
+			parentId =#{parentId},
+			parentIds =#{parentIds}
 		WHERE id = #{id}
 	</update>
-	
+
 	<delete id="delete">
 		DELETE FROM info_type
 		WHERE id = #{id}
 	</delete>
-	
+
 	<update id="updateEnabledStatusByIds">
-		UPDATE info_type a SET a.enabledStatus = #{param1} 
+		UPDATE info_type a SET a.enabledStatus = #{param1}
 		WHERE  a.id IN
 	 	<foreach collection="param2" item="id" index="index" open="(" separator="," close=")" >
 	       #{id}
 	 	</foreach>
 	</update>
-	
+
 	<select id="countEnabledStatus" resultType="java.lang.Integer">
-		SELECT count(1) FROM  info_type a WHERE a.enabledStatus = #{param1}
+		SELECT count(1) FROM  info_type a WHERE a.enabledStatus = #{param1} and a.parentId=0
+	</select>
+
+	<select id="getByInfoType" parameterType="InfoType" resultType="InfoType">
+		<include refid="selectInfoTypeVo"/>
+		from info_type AS info_type
+		<where>  info_type.delFlag = 0
+			<if test="id != null  and id != ''">
+				and info_type.id= #{id}
+			</if>
+			<if test="name != null  and name != ''"> and info_type.name like concat('%', #{name}, '%')</if>
+			<if test="sort != null "> and info_type.sort = #{sort}</if>
+			<if test="shopUseFlag != null "> and info_type.shopUseFlag = #{shopUseFlag}</if>
+			<if test="enabledStatus != null  and enabledStatus != ''"> and info_type.enabledStatus = #{enabledStatus}</if>
+<!--			<if test="createBy != null "> and info_type.createBy = #{createBy}</if>-->
+			<if test="createDate != null "> and info_type.createDate = #{createDate}</if>
+<!--			<if test="updateBy != null "> and info_type.updateBy = #{updateBy}</if>-->
+			<if test="updateDate != null "> and info_type.updateDate = #{updateDate}</if>
+			<if test="delFlag != null "> and info_type.delFlag = #{delFlag}</if>
+			<if test="type != null  and type != ''">
+				and info_type.type
+					= #{type}
+			</if>
+			<if test="parentId != null  and parentId != ''"> and info_type.parentId = #{parentId}</if>
+			<if test="parentIds != null  and parentIds != ''"> and info_type.parentIds = #{parentIds}</if>
+		</where>
+		group by info_type.id
+		order by info_type.createDate desc
+		limit 0,1
+	</select>
+
+	<select id="getByInfoTypeList" parameterType="InfoType" resultType="InfoType">
+		<include refid="selectInfoTypeVo"/>
+		from info_type AS info_type
+		<where>  info_type.delFlag = 0
+			<if test="id != null  and id != ''">
+				and info_type.id= #{id}
+			</if>
+			<if test="name != null  and name != ''"> and info_type.name like concat('%', #{name}, '%')</if>
+			<if test="sort != null "> and info_type.sort = #{sort}</if>
+			<if test="shopUseFlag != null "> and info_type.shopUseFlag = #{shopUseFlag}</if>
+			<if test="enabledStatus != null  and enabledStatus != ''"> and info_type.enabledStatus = #{enabledStatus}</if>
+<!--			<if test="createBy != null "> and info_type.createBy = #{createBy}</if>-->
+			<if test="createDate != null "> and info_type.createDate = #{createDate}</if>
+<!--			<if test="updateBy != null "> and info_type.updateBy = #{updateBy}</if>-->
+			<if test="updateDate != null "> and info_type.updateDate = #{updateDate}</if>
+			<if test="delFlag != null "> and info_type.delFlag = #{delFlag}</if>
+			<if test="type != null  and type != ''">
+				and info_type.type
+					= #{type}
+			</if>
+			<if test="parentId != null  and parentId != ''"> and info_type.parentId = #{parentId}</if>
+			<if test="parentIds != null  and parentIds != ''"> and info_type.parentIds LIKE CONCAT('%',#{parentIds},'%')</if>
+		</where>
+		group by info_type.id
+		order by info_type.createDate desc
 	</select>
-</mapper>
+</mapper>

+ 76 - 1
src/main/resources/mappings/modules/landing/CmBrandLandingMapper.xml

@@ -8,6 +8,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="id"    column="id"    />
         <result property="authUserId"    column="authUserId"    />
         <result property="type"    column="type"    />
+        <result property="levelType"    column="levelType"    />
+        <result property="authorId"    column="authorId"    />
         <result property="headPcBanner"    column="headPcBanner"    />
         <result property="headAppBanner"    column="headAppBanner"    />
         <result property="jumpStatus"    column="jumpStatus"    />
@@ -27,7 +29,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 
     <sql id="selectCmBrandLandingVo">
-        select id, authUserId, type, headPcBanner, headAppBanner, jumpStatus, jumpPcPicture, jumpAppPicture, jumpLink, title, content, video, sort, pcStatus, appStatus, delFlag, updateTime, addTime from cm_brand_landing
+        select id,
+               authUserId,
+               type,
+               levelType,
+               authorId,
+               headPcBanner,
+               headAppBanner,
+               jumpStatus,
+               jumpPcPicture,
+               jumpAppPicture,
+               jumpLink,
+               title,
+               content,
+               video,
+               sort,
+               pcStatus,
+               appStatus,
+               delFlag,
+               updateTime,
+               addTime
+        from cm_brand_landing
     </sql>
 
     <select id="selectCmBrandLandingList" parameterType="CmBrandLanding" resultMap="CmBrandLandingResult">
@@ -36,6 +58,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="id != null  and id != ''"> and id = #{id}</if>
             <if test="authUserId != null "> and authUserId = #{authUserId}</if>
             <if test="type != null "> and type = #{type}</if>
+            <if test="levelType != null "> and levelType = #{levelType}</if>
+            <if test="authorId != null "> and authorId = #{authorId}</if>
             <if test="headPcBanner != null  and headPcBanner != ''"> and headPcBanner = #{headPcBanner}</if>
             <if test="headAppBanner != null  and headAppBanner != ''"> and headAppBanner = #{headAppBanner}</if>
             <if test="jumpStatus != null "> and jumpStatus = #{jumpStatus}</if>
@@ -60,6 +84,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="id != null  and id != ''"> and id = #{id}</if>
             <if test="authUserId != null "> and authUserId = #{authUserId}</if>
             <if test="type != null "> and type = #{type}</if>
+            <if test="levelType != null "> and levelType = #{levelType}</if>
+            <if test="authorId != null "> and authorId = #{authorId}</if>
             <if test="headPcBanner != null  and headPcBanner != ''"> and headPcBanner = #{headPcBanner}</if>
             <if test="headAppBanner != null  and headAppBanner != ''"> and headAppBanner = #{headAppBanner}</if>
             <if test="jumpStatus != null "> and jumpStatus = #{jumpStatus}</if>
@@ -84,6 +110,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where id = #{id}
     </select>
 
+    <select id="getById" parameterType="CmBrandLanding" resultType="String">
+        select id
+        from cm_brand_landing AS cm_brand_landing
+        <where>  cm_brand_landing.delFlag = 0
+            <if test="id != null  and id != ''">
+                and cm_brand_landing.id
+                    = #{id}
+            </if>
+            <if test="type != null  and type != ''">
+                and cm_brand_landing.type
+                    = #{type}
+            </if>
+            <if test="authUserId != null "> and cm_brand_landing.authUserId = #{authUserId}</if>
+            <if test="levelType != null  and levelType != ''">
+                and cm_brand_landing.levelType = #{levelType}
+            </if>
+            <if test="authorId != null  and authorId != ''"> and cm_brand_landing.authorId = #{authorId}</if>
+            <if test="headPcBanner != null  and headPcBanner != ''"> and cm_brand_landing.headPcBanner = #{headPcBanner}</if>
+            <if test="headAppBanner != null  and headAppBanner != ''"> and cm_brand_landing.headAppBanner = #{headAppBanner}</if>
+            <if test="jumpStatus != null "> and cm_brand_landing.jumpStatus = #{jumpStatus}</if>
+            <if test="jumpPcPicture != null  and jumpPcPicture != ''"> and cm_brand_landing.jumpPcPicture = #{jumpPcPicture}</if>
+            <if test="jumpAppPicture != null  and jumpAppPicture != ''"> and cm_brand_landing.jumpAppPicture = #{jumpAppPicture}</if>
+            <if test="jumpLink != null  and jumpLink != ''"> and cm_brand_landing.jumpLink = #{jumpLink}</if>
+            <if test="title != null  and title != ''"> and cm_brand_landing.title = #{title}</if>
+            <if test="content != null  and content != ''"> and cm_brand_landing.content = #{content}</if>
+            <if test="video != null  and video != ''"> and cm_brand_landing.video = #{video}</if>
+            <if test="sort != null "> and cm_brand_landing.sort = #{sort}</if>
+            <if test="pcStatus != null "> and cm_brand_landing.pcStatus = #{pcStatus}</if>
+            <if test="appStatus != null "> and cm_brand_landing.appStatus = #{appStatus}</if>
+            <if test="delFlag != null "> and cm_brand_landing.delFlag = #{delFlag}</if>
+            <if test="updateTime != null "> and cm_brand_landing.updateTime = #{updateTime}</if>
+            <if test="addTime != null "> and cm_brand_landing.addTime = #{addTime}</if>
+        </where>
+        group by cm_brand_landing.id
+        order by cm_brand_landing.addTime desc
+        limit 0,1
+    </select>
+
     <select id="findBigSort" resultType="java.lang.String">
         SELECT sort FROM cm_brand_landing ORDER BY sort DESC LIMIT 1
     </select>
@@ -96,6 +160,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="authUserId != null">authUserId,</if>
             <if test="type != null">type,</if>
+            <if test="levelType != null ">  levelType,</if>
+            <if test="authorId != null ">  authorId,</if>
             <if test="headPcBanner != null">headPcBanner,</if>
             <if test="headAppBanner != null">headAppBanner,</if>
             <if test="jumpStatus != null">jumpStatus,</if>
@@ -115,6 +181,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="authUserId != null">#{authUserId},</if>
             <if test="type != null">#{type},</if>
+            <if test="levelType != null ">  #{levelType},</if>
+            <if test="authorId != null "> #{authorId},</if>
             <if test="headPcBanner != null">#{headPcBanner},</if>
             <if test="headAppBanner != null">#{headAppBanner},</if>
             <if test="jumpStatus != null">#{jumpStatus},</if>
@@ -138,6 +206,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="SET" suffixOverrides=",">
             <if test="authUserId != null">authUserId = #{authUserId},</if>
             <if test="type != null">type = #{type},</if>
+            <if test="levelType != null ">  levelType = #{levelType},</if>
+            <if test="authorId != null ">  authorId = #{authorId},</if>
             <if test="headPcBanner != null">headPcBanner = #{headPcBanner},</if>
             <if test="headAppBanner != null">headAppBanner = #{headAppBanner},</if>
             <if test="jumpStatus != null">jumpStatus = #{jumpStatus},</if>
@@ -161,6 +231,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         delete from cm_brand_landing where id = #{id}
     </delete>
 
+
+    <delete id="delCmBrandLandingByAuthorId" parameterType="String">
+        delete from cm_brand_landing where authorId = #{authorId}
+    </delete>
+
     <delete id="deleteCmBrandLandingByIds" parameterType="String">
         delete from cm_brand_landing where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">

+ 11 - 0
src/main/webapp/WEB-INF/views/modules/archive/addFileForm.jsp

@@ -182,6 +182,16 @@
             <font color="red">标题输入不超过50个字</font>
         </div>
     </div>
+    <div class="control-group">
+        <label class="control-label"><font color="red">*</font>文件内容:</label>
+        <div class="controls">
+            <form:textarea path="content" rows="5"  htmlEscape="false" class="input-xlarge required"/>
+        </div>
+        <div style="margin:5px 0 0 180px">
+            <font color="red">注:提供给不满条件预览文件的用户。
+            </font>
+        </div>
+    </div>
     <div class="control-group">
         <label class="control-label"><font color="red">*</font>文件路径:</label>
         <input id="uploadFileName" type="text" style="display: inline;margin-left:20px" disabled="true" class="input-xlarge required" />
@@ -208,6 +218,7 @@
         items.push({
             id: $("#id").val(),
             title: $("#title").val(),
+            content: $("#content").val(),
             fileId: fileId
         })
         return items;

+ 2 - 0
src/main/webapp/WEB-INF/views/modules/archive/addVideoForm.jsp

@@ -172,6 +172,7 @@
 <form:form id="inputForm" modelAttribute="cmProductArchiveContent" action="${ctx}/archive/cmOrderArchiveContent/save" method="post" class="form-horizontal">
     <form:hidden path="id"/>
     <form:hidden path="type" value="2"/>
+    <form:hidden path="content"/>
     <sys:message content="${message}"/>
     <div class="control-group">
         <label class="control-label"><font color="red">*</font>标题:</label>
@@ -208,6 +209,7 @@
         items.push({
             id: $("#id").val(),
             title: $("#title").val(),
+            content: $("#content").val(),
             fileId: fileId
         })
         return items;

+ 11 - 2
src/main/webapp/WEB-INF/views/modules/archive/cmProductArchiveContentList.jsp

@@ -45,6 +45,7 @@
 			<tr>
 				<th>序号</th>
 				<th>标题</th>
+				<th>浏览量</th>
 				<th>添加时间</th>
 				<th>操作</th>
 			</tr>
@@ -56,6 +57,9 @@
 				<td>
 					${cmProductArchiveContent.title}
 				</td>
+				<td>
+					${cmProductArchiveContent.actualPv}
+				</td>
 				<td>
 					<fmt:formatDate value="${cmProductArchiveContent.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
 				</td>
@@ -88,7 +92,7 @@
 			top.$.jBox("iframe:" + url, {
 				iframeScrolling: 'yes',
 				width: 800,
-				height: 300,
+				height: type == 2?300:500,
 				persistent: true,
 				title: title,
 				buttons: {"保存": '1', "取消": '-1'},
@@ -102,16 +106,21 @@
 							console.log(items)
 							var archiveContentId = items[0].id;
 							var title = items[0].title;
+							var content = items[0].content;
 							var fileId = items[0].fileId;
 							if (title == '') {
 								top.$.jBox.tip("标题不能为空");
 								return false;
 							}
+							if (type==3&&content == '') {
+								top.$.jBox.tip("文件内容不能为空");
+								return false;
+							}
 							if (fileId == '') {
 								top.$.jBox.tip("请先上传文件");
 								return false;
 							}
-							$.post("${ctx}/archive/cmProductArchiveContent/save?type="+type+"&id=" + archiveContentId + "&title=" + title + "&fileId=" + fileId+"&productArchiveId=" + productArchiveId, function (data) {
+							$.post("${ctx}/archive/cmProductArchiveContent/save?type="+type+"&id=" + archiveContentId + "&title=" + title +"&content=" + content + "&fileId=" + fileId+"&productArchiveId=" + productArchiveId, function (data) {
 								top.$.jBox.tip("保存资料成功");
 								setTimeout(function () {
 									window.location.href = "${ctx}/archive/cmProductArchiveContent/?type="+type+"&productArchiveId=" + productArchiveId;

+ 148 - 0
src/main/webapp/WEB-INF/views/modules/info/addInfoForm.jsp

@@ -0,0 +1,148 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
+<html>
+<head>
+	<title>选择文章</title>
+	<meta name="decorator" content="default"/>
+	<style type="text/css">
+		.table td i {
+			margin: 0 2px;
+		}
+	</style>
+	<script type="text/javascript">
+		$(document).ready(function () {
+			//弹出框去滚动条
+			top.$('#jbox-content').css("overflow-y", "hidden");
+			show_title(30);
+
+			//			反选
+			$('body').on('click', 'input[name="info"]', function () {
+				var allInputLength = $('input[name="info"]').length - $('input[name="info"]:disabled').length,
+						allInputCheckedLength = $('input[name="info"]:checked').length,
+						checkAllEle = $('.check-all');
+//			    判断选中长度和总长度,如果相等就是全选否则取消全选
+				if (allInputLength === allInputCheckedLength) {
+					checkAllEle.attr('checked', true);
+				} else {
+					checkAllEle.attr('checked', false);
+				}
+			})
+		});
+
+		function page(n, s) {
+			$("#pageNo").val(n);
+			$("#pageSize").val(s);
+			$("#searchForm").submit();
+			return false;
+		}
+
+		function getCheckedItems() {
+			var items = new Array();
+			var $items = $('.check-item:checked');
+			$items.each(function () {
+				//通过拿到的商品ID组合键获取其它值
+				var productId = $(this).val();
+				items.push(productId);
+			});
+			return items;
+		}
+
+		function allCkbfun(ckb) {
+			var isChecked = ckb.checked;
+			$(".check-item").attr('checked', isChecked);
+		}
+
+		/**
+		 * @param obj
+		 * jquery控制input只能输入数字
+		 */
+		function onlynum(obj) {
+			obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
+		}
+
+		/**
+		 * @param obj
+		 * jquery控制input只能输入数字和两位小数(金额)
+		 */
+		function num(obj) {
+			obj.value = obj.value.replace(/[^\d.]/g, ""); //清除"数字"和"."以外的字符
+			obj.value = obj.value.replace(/^\./g, ""); //验证第一个字符是数字
+			obj.value = obj.value.replace(/\.{2,}/g, "."); //只保留第一个, 清除多余的
+			obj.value = obj.value.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
+			obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'); //只能输入两个小数
+		}
+
+	</script>
+</head>
+<body>
+<form:form id="searchForm" modelAttribute="info" action="${ctx}/info/info/findInfoPage" method="post"
+		   class="breadcrumb form-search">
+	<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
+	<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+	<div class="ul-form">
+		<br>
+		<input type="radio" name="publishSource"
+			   value="1" ${empty info.publishSource?'checked=checked':info.publishSource eq 1?'checked=checked':''} >采美文章
+		<input type="radio" name="publishSource" value="2" ${info.publishSource eq 2?'checked=checked':''}>供应商文章
+		<br>
+		<br>
+		<label>ID:</label>
+		<form:hidden path="cmRelatedType"/>
+		<form:input path="id" htmlEscape="false" maxlength="11" class="input-mini"/>
+		<label>标题:</label>
+		<form:input path="title" htmlEscape="false" maxlength="100" class="input-medium"/>
+		<label>发布人:</label>
+		<form:input path="publisher" htmlEscape="false" maxlength="50" class="input-medium"/>
+		<label>发布时间:</label>
+		<form:input path="startPubDate" type="text" maxlength="10" class="input-medium Wdate"
+					value="${startPubDate}"
+					onclick="WdatePicker({dateFmt:'yyyy-MM-dd ',isShowClear:false});"/>
+		至
+		<form:input path="endPubDate" type="text" maxlength="10" class="input-medium Wdate"
+					value="${startPubDate}"
+					onclick="WdatePicker({dateFmt:'yyyy-MM-dd ',isShowClear:false});"/>
+		<br> <br>
+		<label>文章分类:</label>
+		<form:select path="infoType.id" class="input-small">
+			<form:option value="" label=" "/>
+			<form:options items="${typeList}" itemLabel="name" itemValue="id" htmlEscape="false"/>
+		</form:select>
+		&nbsp;&nbsp<input id="btnSubmit" class="btn btn-primary" type="submit" value="搜索"/>
+		<div class="clearfix"></div>
+	</div>
+</form:form>
+<sys:message content="${message}"/>
+<table class="table table-striped table-bordered table-condensed table-hover">
+	<tr>
+		<th style="width:20px;"><input class="check-all" type="checkbox" onclick="allCkbfun(this);"/></th>
+		<th>文章ID</th>
+		<th>文章分类</th>
+		<th>引导图</th>
+		<th>发布人</th>
+		<th>文章标题</th>
+		<th>发布时间</th>
+	</tr>
+	<tbody>
+	<c:if test="${not empty page.list}">
+		<c:forEach items="${page.list}" var="item">
+			<tr id="${item.id}" class="itemtr">
+				<th>
+					<input class="check-item" type="checkbox" name="info" value='${item.id}'/>
+				</th>
+				<td>${item.id}</td>
+				<td>${item.infoType.name}</td>
+				<td><img src="${item.guidanceImage}" width="50px" height="50px"></td>
+				<td>${item.publisher}</td>
+				<td>${item.title}</td>
+				<td><fmt:formatDate value="${item.pubdate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
+			</tr>
+		</c:forEach>
+	</c:if>
+	</tbody>
+</table>
+<c:if test="${empty  page.list}">
+	<p style="text-align: center;"><font color="#1e90ff">暂无数据……</font></p>
+</c:if>
+<div class="pagination">${page}</div>
+</body>
+</html>

+ 20 - 19
src/main/webapp/WEB-INF/views/modules/info/infoList.jsp

@@ -61,9 +61,9 @@
 		function updateType(){
 			var tabmode='${cookie.tabmode.value}';
 			if(tabmode=='1'){
-				addTabPage('修改分类项', '${ctx}/info/infoType');
+				addTabPage('修改分类项', '${ctx}/info/infoType?type=1&parentId=0');
 			}else{
-				location.href="${ctx}/info/infoType";
+				location.href="${ctx}/info/infoType?type=1&parentId=0";
 			}
 		}
 /*        //更新所有索引
@@ -237,14 +237,14 @@
 				<th>文章标签</th>
 				<th>发布人</th>
 				<th>实际点赞</th>
-				<th>基础阅读量</th>
+<%--				<th>基础阅读量</th>--%>
 				<th>实际阅读量</th>
 				<th>首页置顶位</th>
 				<%--<th>优先级</th>--%>
 				<th>关联标签库</th>
 				<th>发布时间</th>
 				<th>添加时间</th>
-				<th>推荐状态</th>
+<%--				<th>推荐状态</th>--%>
 				<th>状态</th>
 				<shiro:hasPermission name="info:info:edit"><th>操作</th></shiro:hasPermission>
 			</tr>
@@ -267,7 +267,7 @@
 					${info.publisher}
 				</td>
 				<td>${empty info.realPraise?0:(info.realPraise)}</td>
-				<td>${empty info.basePv?0:(info.basePv)}</td>
+<%--				<td>${empty info.basePv?0:(info.basePv)}</td>--%>
 				<td>${empty info.pv?0:(info.pv)}</td>
 				<td>${info.topPosition}</td>
 				<%--<td>${empty info.priorityIndex?0:(info.priorityIndex)}</td>--%>
@@ -281,26 +281,26 @@
 				</td>
 				<td><fmt:formatDate value="${info.pubdate}" pattern="yyyy-MM-dd HH:mm"/></td>
 				<td><fmt:formatDate value="${info.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
-				<td>
-					<c:if test="${info.recommendStatus eq 1 }">
-						<a href="javascript:void(0);" onclick="updateStatus('0','${info.id}','recommendStatus','${info.enabledStatus}');" >
-							<img alt="启用" src="/static/images/yes.gif" width="15px" border="none" title="启用">
-						</a>
-					</c:if>
-					<c:if test="${info.recommendStatus ne 1 }">
-						<a href="javascript:void(0)" onclick="updateStatus('1','${info.id}','recommendStatus','${info.enabledStatus}');">
-							<img alt="停用" src="/static/images/no.gif" width="15px" border="none" title="停用">
-						</a>
-					</c:if>
-				</td>
+<%--				<td>--%>
+<%--					<c:if test="${info.recommendStatus eq 1 }">--%>
+<%--						<a href="javascript:void(0);" onclick="updateStatus('0','${info.id}','recommendStatus','${info.enabledStatus}');" >--%>
+<%--							<img alt="启用" src="/static/images/yes.gif" width="15px" border="none" title="启用">--%>
+<%--						</a>--%>
+<%--					</c:if>--%>
+<%--					<c:if test="${info.recommendStatus ne 1 }">--%>
+<%--						<a href="javascript:void(0)" onclick="updateStatus('1','${info.id}','recommendStatus','${info.enabledStatus}');">--%>
+<%--							<img alt="停用" src="/static/images/no.gif" width="15px" border="none" title="停用">--%>
+<%--						</a>--%>
+<%--					</c:if>--%>
+<%--				</td>--%>
 				<td>
 					<c:if test="${info.enabledStatus eq 1 }">
 						<font color="green">已发布</font>
-						<a href="javascript:void(0)" onclick="updateStatus('0','${info.id}','enabledStatus','${info.enabledStatus}');" style="cursor: pointer">暂不发布
+						<a href="javascript:void(0)" onclick="updateStatus('0','${info.id}','enabledStatus','${info.enabledStatus}');" style="cursor: pointer">存草稿
 						</a>
 					</c:if>
 					<c:if test="${info.enabledStatus ne 1 }">
-						<font color="red">暂不发布</font>
+						<font color="red">存草稿</font>
 						<a href="javascript:void(0)" onclick="updateStatus('1','${info.id}','enabledStatus','${info.enabledStatus}');" style="cursor: pointer">发布
 						</a>
 					</c:if>
@@ -319,6 +319,7 @@
 					<c:if test="${info.topPosition ne null}">
 						<a onclick="updateTopPosition('','${info.id}','clearTopPosition')" href="javascript:void(0)">清除置顶</a>
 					</c:if>
+					<a style="white-space: nowrap" href="${ctx}/info/info/relatedForm?id=${info.id}">相关阅读</a>
 					<div style="display: none" class="topSelect" id="topSelect${index.index}" onmouseleave="showTopSelect(${index.index},'close')">
 						<table style="border: 2px solid #000000;" cellpadding="0" cellspacing="0">
 							<tbody>

+ 213 - 0
src/main/webapp/WEB-INF/views/modules/info/infoRelatedForm.jsp

@@ -0,0 +1,213 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
+<html>
+<head>
+	<title>相关阅读管理</title>
+	<meta name="decorator" content="default"/>
+	<style>
+
+	</style>
+	<script type="text/javascript">
+		$(document).ready(function () {
+			//初始化
+			$("#infoListCount").text($("#contentTable").find("tr").length - 1)
+			if ($("input[type='radio']:checked").val()==1)
+			{
+				$("#infoList").show()
+			}
+
+			$("input[type='radio']").change(function (obj) {
+				var str = $(this).val();
+				if (str == 0) {
+					$("#infoList").hide()
+				} else if (str == 1) {
+					$("#infoList").show()
+				}
+			});
+			//$("#name").focus();
+			$("#inputForm").validate({
+				submitHandler: function (form) {
+					const infoCount=$("#infoListCount").text()
+					const radioVal=$("input[type='radio']:checked").val()
+					console.log(radioVal);
+					if (radioVal==1){
+						if(infoCount==0){
+							top.$.jBox.confirm("请选择需要推荐的文章?", '系统提示')
+							return false
+						}else if (infoCount<3){
+							top.$.jBox.confirm("请选择3篇文章?", '系统提示')
+							return false
+						}else if (infoCount>3){
+							top.$.jBox.confirm("最多只能添加3篇文章?", '系统提示')
+							return false
+						}
+					}
+					loading('正在提交,请稍等...');
+					form.submit();
+				},
+				errorContainer: "#messageBox",
+				errorPlacement: function (error, element) {
+					$("#messageBox").text("输入有误,请先更正。");
+					if (element.is(":checkbox") || element.is(":radio") || element.parent().is(".input-append")) {
+						error.appendTo(element.parent().parent());
+					} else {
+						error.insertAfter(element);
+					}
+				}
+			});
+		});
+	</script>
+</head>
+<body>
+<ul class="nav nav-tabs">
+	<li><a href="${ctx}/info/info/">文章列表</a></li>
+	<li class="active"><a href="${ctx}/info/info/relatedForm?id=${info.id}">相关阅读</a></li>
+</ul>
+<br/>
+<form:form id="inputForm" modelAttribute="info" action="${ctx}/info/info/relatedSave" method="post"
+		   class="form-horizontal">
+	<form:hidden path="id"/>
+	<sys:message content="${message}"/>
+	<div class="control-group">
+		<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>文章标题:</label>
+		<div class="controls">
+				${info.title}
+		</div>
+	</div>
+	<div class="control-group">
+		<label class="control-label">设置类型:</label>
+		<div class="controls">
+			<input type="radio" name="autoStatus"
+				   value="0" ${empty info.autoStatus?'checked=checked':info.autoStatus eq 0?'checked=checked':''}>自动推荐(设置自动推荐后,将根据文章相关联标签推荐最新的3偏文章)
+			<br>
+			<br>
+			<input type="radio" name="autoStatus" value="1" ${info.autoStatus eq 1?'checked=checked':''}>手动推荐
+		</div>
+	</div>
+	<div id="infoList" style="display: none">
+		<h4 style="line-height: 50px">
+			<span style="font-weight: bold;">推荐列表</span>(当前列表记录数 <span id="infoListCount">0</span>, 最多只能添加3条数据)
+			<input class="btn btn-primary" style="width: 80px" onclick="showSelect()" value="添加商品"/>
+		</h4>
+		<table id="contentTable" class="table table-striped table-bordered table-condensed" style="height: 300px">
+			<thead>
+			<tr>
+				<th>ID</th>
+				<th>文章分类</th>
+				<th>引导图</th>
+				<th>文章标题</th>
+				<th>文章标签</th>
+				<th>发布人</th>
+				<th>排序值</th>
+				<th>发布时间</th>
+				<th>添加时间</th>
+				<th>状态</th>
+				<th>操作</th>
+			</tr>
+			</thead>
+			<tbody id="infoTbody">
+			<c:forEach items="${info.cmRelatedList}" var="cmRelated" varStatus="index">
+				<tr style="height: 100px">
+					<input type="hidden" name="cmRelatedList[${index.index}].authorId" value="${cmRelated.authorId}"/>
+					<input type="hidden" name="cmRelatedList[${index.index}].relatedId" value="${cmRelated.relatedId}"/>
+					<td>${cmRelated.info.id}</td>
+					<td>${cmRelated.info.typeName}</td>
+					<td><img src="${cmRelated.info.guidanceImage}" width="100px;" height="100px;"
+							 style="width: 100px;height: 100px;"></td>
+					<td class="comitted">${cmRelated.info.title}</td>
+					<td>${cmRelated.info.label}</td>
+					<td>${cmRelated.info.publisher}</td>
+					<td><form:input path="cmRelatedList[${index.index}].sort" htmlEscape="false" maxlength="11"
+									class="input-mini"/></td>
+					<td><fmt:formatDate value="${cmRelated.info.pubdate}" pattern="yyyy-MM-dd HH:mm"/></td>
+					<td><fmt:formatDate value="${cmRelated.info.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
+					<td>${info.enabledStatus eq 1 ?'已发布':'存草稿'}</td>
+					<td style="width: 150px"><a href="#" onclick="delCmRelated(this)">删除</a></td>
+				</tr>
+			</c:forEach>
+			</tbody>
+		</table>
+	</div>
+	<div class="form-actions">
+		<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;
+		<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
+	</div>
+</form:form>
+<script>
+	//选择添加
+	function delCmRelated(target) {
+		top.$.jBox.confirm("确认要删除该文章列表吗", '系统提示', function (v, h, f) {
+			if (v == 'ok') {
+				$(target).parent().parent().remove()
+				$("#infoListCount").text($("#contentTable").find("tr").length - 1)
+			}
+			return;
+		}, {buttonsFocus: 1, persistent: true});
+	}
+
+	function showSelect() {
+		var url = '';
+		var title = '';
+		url = "${ctx}/info/info/findInfoPage?cmRelatedType=1";
+		title = "添加文章";
+		top.$.jBox("iframe:" + url + "", {
+			iframeScrolling: 'yes',
+			width: $(top.document).width() - 600,
+			height: $(top.document).height() - 160,
+			persistent: true,
+			title: title,
+			buttons: {"确定": '1', "关闭": '-1'},
+			submit: function (v, h, f) {
+				//确定
+				var $jboxFrame = top.$('#jbox-iframe');
+				var $mainFrame = top.$('#mainFrame');
+				if ('1' == v && 1 == $jboxFrame.size() && 1 == $mainFrame.size()) {
+					var items = $jboxFrame[0].contentWindow.getCheckedItems();
+					if (items.length > 0) {
+						$("#contentTable tr").find("td:eq(0)").each(function () {
+							items += "," + $(this).text();
+						})
+						console.log(items);
+						//添加数据
+						$.post("${ctx}/info/info/addInfos?infoIds=" + items, function (data) {
+							if (true == data.success) {
+								$.jBox.tip(data.info, 'info');
+								var infoList = data.infoList
+								var html = '';
+								for (let i = 0; i < infoList.length; i++) {
+									html += '<tr style="height: 100px">'
+									html += '<input type="hidden"  name="cmRelatedList[' + i + '].authorId" value="${info.id}"/>'
+									html += '<input type="hidden"  name="cmRelatedList[' + i + '].relatedId" value="' + infoList[i].id + '"/>'
+									html += '<td>' + infoList[i].id + '</td>'
+									html += '<td>' + infoList[i].typeName + '</td>'
+									html += '<td><img src="' + infoList[i].guidanceImage + '" width="100px;" height="100px;" style="width: 100px;height: 100px;"></td>'
+									html += '<td class="comitted">' + infoList[i].title + '</td>'
+									html += '<td>' + infoList[i].label + '</td>'
+									html += '<td>' + infoList[i].publisher + '</td>'
+									html += '<td><input type="text" name="cmRelatedList[' + i + '].sort" htmlEscape="false" maxlength="11"  value="0" class="input-mini"/></td>'
+									html += '<td>' + infoList[i].pubdate + '</td>'
+									html += '<td>' + infoList[i].createDate + '</td>'
+									html += '<td>' + (infoList[i].enabledStatus == 1 ? '已发布' : '存草稿') + '</td>'
+									html += '<td style="width: 150px"><a href="#' + infoList[i].id + '" onclick="delCmRelated(this)">删除</a></td>'
+									html += '</tr>'
+								}
+								$("#infoTbody").html(html);
+								$("#infoListCount").text($("#contentTable").find("tr").length - 1)
+								// $("#contentTable").append(html);
+							} else {
+								$.jBox.tip(data.info, 'error');
+							}
+						}, "JSON");//这里返回的类型有:json,html,xml,text
+						return true;
+					} else {
+						top.$.jBox.tip("请先勾选商品...");
+						return false;
+					}
+				}
+				return true;
+			}
+		});
+	}
+</script>
+</body>
+</html>

+ 167 - 0
src/main/webapp/WEB-INF/views/modules/info/infoSelectedList.jsp

@@ -0,0 +1,167 @@
+<%@ page import="com.thinkgem.jeesite.common.config.Global" %>
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
+<html>
+<head>
+	<title>精选推荐管理</title>
+	<meta name="decorator" content="default"/>
+	<style type="text/css">
+		.table th {
+			text-align: center;
+		}
+
+		.table td {
+			text-align: center;
+		}
+
+		.topSelect {
+			width: 80px;
+			position: absolute;
+			right: 50px;
+			background-color: white;
+		}
+	</style>
+
+	<% request.setAttribute("caimeiCore", Global.getConfig("caimei.core"));%>
+	<script type="text/javascript">
+		$(document).ready(function () {
+			show_title(16);
+		});
+
+		function page(n, s) {
+			$("#pageNo").val(n);
+			$("#pageSize").val(s);
+			$("#searchForm").submit();
+			return false;
+		}
+
+		function batchSaveSort() {
+			$("#searchTable").submit();
+		}
+
+		function showSelect() {
+			var url = '';
+			var title = '';
+			url = "${ctx}/info/info/findInfoPage?cmRelatedType=2";
+			title = "添加文章";
+			top.$.jBox("iframe:" + url + "", {
+				iframeScrolling: 'yes',
+				width: $(top.document).width() - 600,
+				height: $(top.document).height() - 160,
+				persistent: true,
+				title: title,
+				buttons: {"确定": '1', "关闭": '-1'},
+				submit: function (v, h, f) {
+					//确定
+					var $jboxFrame = top.$('#jbox-iframe');
+					var $mainFrame = top.$('#mainFrame');
+					if ('1' == v && 1 == $jboxFrame.size() && 1 == $mainFrame.size()) {
+						var items = $jboxFrame[0].contentWindow.getCheckedItems();
+						if (items.length > 0) {
+							console.log(items);
+							//添加数据
+							$.post("${ctx}/info/info/addSelectedInfos?infoIds=" + items, function (data) {
+								if (true == data.success) {
+									$.jBox.tip(data.info, 'info');
+									$("#searchForm").submit();
+								} else {
+									$.jBox.tip(data.info, 'error');
+								}
+							}, "JSON");//这里返回的类型有:json,html,xml,text
+							return true;
+						} else {
+							top.$.jBox.tip("请先勾选商品...");
+							return false;
+						}
+					}
+					return true;
+				}
+			});
+		}
+	</script>
+</head>
+<body>
+<ul class="nav nav-tabs">
+	<li class="active"><a href="${ctx}/info/info/infoSelectedPage">精选推荐</a></li>
+	<li><a href="javascript:void(0);" onclick="showSelect()">文章添加</a></li>
+</ul>
+<form:form id="searchForm" modelAttribute="cmRelated" action="${ctx}/info/info/infoSelectedPage" method="post"
+		   class="breadcrumb form-search">
+	<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
+	<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+	<div class="ul-form">
+		<label>ID:</label>
+		<form:input path="info.id" htmlEscape="false" maxlength="11" class="input-mini"/>
+		<label>标题:</label>
+		<form:input path="info.title" htmlEscape="false" maxlength="100" class="input-medium"/>
+		<label>发布人:</label>
+		<form:input path="info.publisher" htmlEscape="false" maxlength="50" class="input-medium"/>
+		<label>发布时间:</label>
+		<form:input path="info.startPubDate" type="text" maxlength="10" class="input-medium Wdate"
+					value="${cmRelated.info.startPubDate}"
+					onclick="WdatePicker({dateFmt:'yyyy-MM-dd ',isShowClear:false});"/>
+		至
+		<form:input path="info.endPubDate" type="text" maxlength="10" class="input-medium Wdate"
+					value="${cmRelated.info.startPubDate}"
+					onclick="WdatePicker({dateFmt:'yyyy-MM-dd ',isShowClear:false});"/>
+		<br> <br>
+		<label>文章分类:</label>
+		<form:select path="info.typeId" class="input-small">
+			<form:option value="" label=" "/>
+			<form:options items="${typeList}" itemLabel="name" itemValue="id" htmlEscape="false"/>
+		</form:select>
+		&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
+		<input type="button" class="btn btn-primary" onclick="batchSaveSort()" value="一键排序"/>
+		<div class="clearfix"></div>
+	</div>
+</form:form>
+<sys:message content="${message}"/>
+<form:form id="searchTable" modelAttribute="info" action="${ctx}/info/info/infoSelectedListSave" method="post"
+		   class="breadcrumb form-search">
+	<table id="contentTable" class="table table-striped table-bordered table-condensed">
+		<thead>
+		<tr>
+			<th>ID</th>
+			<th>文章分类</th>
+			<th>引导图</th>
+			<th>文章标题</th>
+			<th>文章标签</th>
+			<th>发布人</th>
+			<th>文章归属</th>
+			<th>排序</th>
+			<th>发布时间</th>
+			<th>添加时间</th>
+			<th>操作</th>
+		</tr>
+		</thead>
+		<tbody>
+		<c:forEach items="${page.list}" var="cmRelated" varStatus="index">
+			<tr style="height: 100px">
+				<form:hidden path="cmRelatedList[${index.index}].id" value="${cmRelated.id}"/>
+				<td>${cmRelated.info.id}</td>
+				<td>${cmRelated.info.typeName}</td>
+				<td><img src="${cmRelated.info.guidanceImage}" width="100px;" height="100px;"
+						 style="width: 100px;height: 100px;"></td>
+				<td class="comitted">${cmRelated.info.title}</td>
+				<td>${cmRelated.info.label}</td>
+				<td>${cmRelated.info.publisher}</td>
+				<td>${cmRelated.info.publishSource==1?"采美":"供应商"}</td>
+				<td><form:input path="cmRelatedList[${index.index}].sort" htmlEscape="false" maxlength="11"
+								class="input-mini" value="${cmRelated.sort}"/></td>
+				<td><fmt:formatDate value="${cmRelated.info.pubdate}" pattern="yyyy-MM-dd HH:mm"/></td>
+				<td><fmt:formatDate value="${cmRelated.info.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
+				<td style="width: 150px">
+					<a href="https://www.caimei365.com/info/detail-${cmRelated.info.id}-1.html" target="_blank">查看</a>
+					<a href="${ctx}/info/info/delInfoSelected?id=${cmRelated.id}"
+					   onclick="return confirmx('确认要删除该文章列表吗?', this.href)">删除</a></td>
+			</tr>
+		</c:forEach>
+		</tbody>
+	</table>
+</form:form>
+<div class="pagination">${page}</div>
+</body>
+<script>
+
+</script>
+</html>

+ 242 - 27
src/main/webapp/WEB-INF/views/modules/info/infoTypeForm.jsp

@@ -1,21 +1,53 @@
+<%@ page import="com.thinkgem.jeesite.common.config.Global" %>
 <%@ page contentType="text/html;charset=UTF-8" %>
-<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
 <html>
 <head>
 	<title>文章分类管理</title>
 	<meta name="decorator" content="default"/>
+	<style>
+
+		.control-label-text {
+			margin-left: 100px;
+		}
+
+
+	</style>
+	<% request.setAttribute("caimeiCore", Global.getConfig("caimei.core"));%>
 	<script type="text/javascript">
-		$(document).ready(function() {
+
+		$(document).ready(function () {
+			$("input[type='radio'][name!='shopUseFlag']").change(function (obj) {
+				var str = $(this).val();
+				var index = $(this).attr("name").match(/\[(\S*)\]/)[1]
+				if (str == 0) {
+					$("input[name='cmBrandLandingList["+index+"].jumpLink']").val("")
+					$("input[name='cmBrandLandingList["+index+"].jumpLink']").attr("disabled", true)
+					$("input[name='cmBrandLandingList["+index+"].jumpLink']").attr("class", "input-xlarge  digits")
+				} else if (str == 2) {
+					$("input[name='cmBrandLandingList["+index+"].jumpLink']").attr("disabled", false)
+					$("input[name='cmBrandLandingList["+index+"].jumpLink']").attr("class", "input-xlarge required digits")
+				}
+			});
 			//$("#name").focus();
 			$("#inputForm").validate({
-				submitHandler: function(form){
+				submitHandler: function (form) {
+					for (let i = 0; i < 3; i++) {
+						var headPcBanner = $("input[name='cmBrandLandingList["+i+"].headPcBanner']").val();
+						var headAppBanner = $("input[name='cmBrandLandingList["+i+"].headAppBanner']").val();
+						console.log(headAppBanner);
+						if (!(headPcBanner != undefined && headPcBanner.trim() != ""&&headAppBanner != undefined && headAppBanner.trim() != "")) {
+							alertx("请先选择广告图"+(i+1)+"!");
+							return false
+						}
+					}
 					loading('正在提交,请稍等...');
 					form.submit();
 				},
 				errorContainer: "#messageBox",
-				errorPlacement: function(error, element) {
+				errorPlacement: function (error, element) {
 					$("#messageBox").text("输入有误,请先更正。");
-					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+					if (element.is(":checkbox") || element.is(":radio") || element.parent().is(".input-append")) {
 						error.appendTo(element.parent().parent());
 					} else {
 						error.insertAfter(element);
@@ -26,38 +58,221 @@
 	</script>
 </head>
 <body>
-	<ul class="nav nav-tabs">
-		<li><a href="${ctx}/info/infoType/">文章分类列表</a></li>
-		<li class="active"><a href="${ctx}/info/infoType/form?id=${infoType.id}">文章分类<shiro:hasPermission name="info:infoType:edit">${not empty infoType.id?'编辑':'添加'}</shiro:hasPermission><shiro:lacksPermission name="info:infoType:edit">查看</shiro:lacksPermission></a></li>
-	</ul><br/>
-	<form:form id="inputForm" modelAttribute="infoType" action="${ctx}/info/infoType/save" method="post" class="form-horizontal">
-		<form:hidden path="id"/>
-		<sys:message content="${message}"/>		
+<ul class="nav nav-tabs">
+	<li><a href="${ctx}/info/infoType/?type=1&parentId=${infoType.parentId}">${infoType.parentId eq 0 ?'一':'二'}级分类列表</a>
+	</li>
+	<li class="active"><a
+			href="${ctx}/info/infoType/form?id=${infoType.id}&type=1&parentId=${infoType.parentId}"><shiro:hasPermission
+			name="info:infoType:edit">${not empty infoType.id?'编辑':'添加'}${infoType.parentId eq 0 ?'一':'二'}级分类</shiro:hasPermission><shiro:lacksPermission
+			name="info:infoType:edit">查看</shiro:lacksPermission></a></li>
+</ul>
+<br/>
+<form:form id="inputForm" modelAttribute="infoType" action="${ctx}/info/infoType/save" method="post"
+		   class="form-horizontal">
+	<form:hidden path="id"/>
+	<form:hidden path="type"/>
+	<form:hidden path="parentId"/>
+	<sys:message content="${message}"/>
+	<div class="control-group">
+		<label class="control-label">分类名称:</label>
+		<div class="controls">
+			<form:input path="name" htmlEscape="false" maxlength="10" class="input-xlarge required"/>
+			<span class="help-inline"><font color="red">*</font> </span>
+		</div>
+	</div>
+	<div class="control-group">
+		<label class="control-label">优先级(倒序):</label>
+		<div class="controls">
+			<form:input path="sort" htmlEscape="false" class="input-xlarge required digits"
+						value="${(empty infoType.sort)?'0':(infoType.sort) }"/>
+			<span class="help-inline"><font color="red">*</font> </span>
+		</div>
+	</div>
+	<div class="control-group">
+		<label class="control-label keyClass">是否供应商可用:</label>
+		<div class="controls">
+			<input type="radio" name="shopUseFlag"
+				   value="1" ${empty infoType.shopUseFlag?'checked=checked':infoType.shopUseFlag eq 1?'checked=checked':''}>
+			是
+			<input type="radio" name="shopUseFlag" value="0" ${infoType.shopUseFlag eq 0?'checked=checked':''}> 否
+		</div>
+	</div>
+	<div>
+		<form:hidden path="cmBrandLandingList[0].levelType" value="1"/>
 		<div class="control-group">
-			<label class="control-label">分类名称:</label>
-			<div class="controls">
-				<form:input path="name" htmlEscape="false" maxlength="10" class="input-xlarge required"/>
-				<span class="help-inline"><font color="red">*</font> </span>
+			<label class="control-label-text"><font color="red">*</font>广告图1:</label>
+			<br>
+			<div style="margin-left: 80px;">
+				<span style="float: left">
+				<label class="control-label">PC端图:</label>
+				<div class="controls">
+					<form:hidden id="cmBrandLandingList[0].headPcBanner" path="cmBrandLandingList[0].headPcBanner"
+								 htmlEscape="false" value="${cmBrandLandingList[0].headPcBanner}"
+								 maxlength="255" class="input-xlarge required"/>
+					<sys:ckfinder input="cmBrandLandingList[0].headPcBanner" type="images" uploadPath="/photo"
+								  selectMultiple="false"
+								  maxWidth="100"
+								  maxHeight="100"/>
+				</div>
+				<div class="controls" style="padding-top: 20px;">
+					<p style="color:#D0D0D0 ;">建议尺寸:1920 * 510 / PX</p>
+				</div>
+			</span>
+				<span style="float: left">
+				<label class="control-label">小程序端图:</label>
+				<div class="controls">
+					<form:hidden id="cmBrandLandingList[0].headAppBanner" path="cmBrandLandingList[0].headAppBanner"
+								 htmlEscape="false" value="${cmBrandLandingList[0].headAppBanner}"
+								 maxlength="255" class="input-xlarge"/>
+					<sys:ckfinder input="cmBrandLandingList[0].headAppBanner" type="images" uploadPath="/photo"
+								  selectMultiple="false"
+								  maxWidth="100"
+								  maxHeight="100"/>
+				</div>
+				<div class="controls" style="padding-top: 20px;">
+					<p style="color:#D0D0D0 ;">建议尺寸:750 * 366 / PX</p>
+				</div>
+			</span>
 			</div>
 		</div>
 		<div class="control-group">
-			<label class="control-label">优先级(倒序):</label>
+			<label class="control-label keyClass"><font
+					color="red">*</font>跳转方式:${cmBrandLandingList} ${cmBrandLandingList[0].jumpStatus}</label>
+			<br>
+			<div class="controls">
+				<input type="radio" name="cmBrandLandingList[0].jumpStatus"
+					   value="2" ${infoType.cmBrandLandingList[0].jumpStatus eq 2?'checked=checked':''}>
+				跳转链接:
+				<form:input path="cmBrandLandingList[0].jumpLink" htmlEscape="false" class="input-xlarge digits"
+							value="${cmBrandLandingList[0].jumpLink}" disabled="${infoType.cmBrandLandingList[0].jumpStatus eq 2?'false':'true'}"/>
+			</div>
+			<br>
 			<div class="controls">
-				<form:input path="sort" htmlEscape="false" class="input-xlarge required digits" value="${(empty infoType.sort)?'0':(infoType.sort) }"/>
-				<span class="help-inline"><font color="red">*</font> </span>
+				<input type="radio" name="cmBrandLandingList[0].jumpStatus"
+					   value="0" ${empty infoType.cmBrandLandingList[0].jumpStatus?'checked=checked':infoType.cmBrandLandingList[0].jumpStatus eq 0?'checked=checked':''}>
+				无
+			</div>
+		</div>
+	</div>
+	<div>
+		<form:hidden path="cmBrandLandingList[1].levelType" value="2"/>
+		<div class="control-group">
+			<label class="control-label-text"><font color="red">*</font>广告图2:</label>
+			<br>
+			<div style="margin-left: 80px;">
+				<span style="float: left">
+				<label class="control-label">PC端图:</label>
+				<div class="controls">
+					<form:hidden id="cmBrandLandingList[1].headPcBanner" path="cmBrandLandingList[1].headPcBanner"
+								 htmlEscape="false" value="${cmBrandLandingList[1].headPcBanner}"
+								 maxlength="255" class="input-xlarge required"/>
+					<sys:ckfinder input="cmBrandLandingList[1].headPcBanner" type="images" uploadPath="/photo"
+								  selectMultiple="false"
+								  maxWidth="100"
+								  maxHeight="100"/>
+				</div>
+				<div class="controls" style="padding-top: 20px;">
+					<p style="color:#D0D0D0 ;">建议尺寸:300 * 200 / PX</p>
+				</div>
+			</span>
+				<span style="float: left">
+				<label class="control-label">小程序端图:</label>
+				<div class="controls">
+					<form:hidden id="cmBrandLandingList[1].headAppBanner" path="cmBrandLandingList[1].headAppBanner"
+								 htmlEscape="false" value="${cmBrandLandingList[1].headAppBanner}"
+								 maxlength="255" class="input-xlarge"/>
+					<sys:ckfinder input="cmBrandLandingList[1].headAppBanner" type="images" uploadPath="/photo"
+								  selectMultiple="false"
+								  maxWidth="100"
+								  maxHeight="100"/>
+				</div>
+				<div class="controls" style="padding-top: 20px;">
+					<p style="color:#D0D0D0 ;">建议尺寸:300 * 200 / PX</p>
+				</div>
+			</span>
 			</div>
 		</div>
 		<div class="control-group">
-			<label class="control-label keyClass">是否供应商可用:</label>
+			<label class="control-label keyClass"><font
+					color="red">*</font>跳转方式:${cmBrandLandingList} ${cmBrandLandingList[1].jumpStatus}</label>
+			<br>
+			<div class="controls">
+				<input type="radio" name="cmBrandLandingList[1].jumpStatus"
+					   value="2" ${infoType.cmBrandLandingList[1].jumpStatus eq 2?'checked=checked':''}>
+				跳转链接:
+				<form:input path="cmBrandLandingList[1].jumpLink" htmlEscape="false" class="input-xlarge digits"
+							value="${cmBrandLandingList[1].jumpLink}" disabled="${infoType.cmBrandLandingList[1].jumpStatus eq 2?'false':'true'}"/>
+			</div>
+			<br>
 			<div class="controls">
-				<input type="radio" name="shopUseFlag" value="1" ${empty infoType.shopUseFlag?'checked=checked':infoType.shopUseFlag eq 1?'checked=checked':''}> 是
-				<input type="radio" name="shopUseFlag" value="0" ${infoType.shopUseFlag eq 0?'checked=checked':''}> 否
+				<input type="radio" name="cmBrandLandingList[1].jumpStatus"
+					   value="0" ${empty infoType.cmBrandLandingList[1].jumpStatus?'checked=checked':infoType.cmBrandLandingList[1].jumpStatus eq 0?'checked=checked':''}>
+				无
+			</div>
+		</div>
+	</div>
+	<div>
+		<form:hidden path="cmBrandLandingList[2].levelType" value="2"/>
+		<div class="control-group">
+			<label class="control-label-text"><font color="red">*</font>广告图3:</label>
+			<br>
+			<div style="margin-left: 80px;">
+				<span style="float: left">
+				<label class="control-label">PC端图:</label>
+				<div class="controls">
+					<form:hidden id="cmBrandLandingList[2].headPcBanner" path="cmBrandLandingList[2].headPcBanner"
+								 htmlEscape="false" value="${cmBrandLandingList[2].headPcBanner}"
+								 maxlength="255" class="input-xlarge required"/>
+					<sys:ckfinder input="cmBrandLandingList[2].headPcBanner" type="images" uploadPath="/photo"
+								  selectMultiple="false"
+								  maxWidth="100"
+								  maxHeight="100"/>
+				</div>
+				<div class="controls" style="padding-top: 20px;">
+					<p style="color:#D0D0D0 ;">建议尺寸:300 * 200 / PX</p>
+				</div>
+			</span>
+				<span style="float: left">
+				<label class="control-label">小程序端图:</label>
+				<div class="controls">
+					<form:hidden id="cmBrandLandingList[2].headAppBanner" path="cmBrandLandingList[2].headAppBanner"
+								 htmlEscape="false" value="${cmBrandLandingList[2].headAppBanner}"
+								 maxlength="255" class="input-xlarge"/>
+					<sys:ckfinder input="cmBrandLandingList[2].headAppBanner" type="images" uploadPath="/photo"
+								  selectMultiple="false"
+								  maxWidth="100"
+								  maxHeight="100"/>
+				</div>
+				<div class="controls" style="padding-top: 20px;">
+					<p style="color:#D0D0D0 ;">建议尺寸:300 * 200 / PX</p>
+				</div>
+			</span>
 			</div>
 		</div>
-		<div class="form-actions">
-			<shiro:hasPermission name="info:infoType:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
-			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
+		<div class="control-group">
+			<label class="control-label keyClass"><font
+					color="red">*</font>跳转方式:${cmBrandLandingList} ${cmBrandLandingList[2].jumpStatus}</label>
+			<br>
+			<div class="controls">
+				<input type="radio" name="cmBrandLandingList[2].jumpStatus"
+					   value="2" ${infoType.cmBrandLandingList[2].jumpStatus eq 2?'checked=checked':''}>
+				跳转链接:
+				<form:input path="cmBrandLandingList[2].jumpLink" htmlEscape="false" class="input-xlarge digits"
+							value="${cmBrandLandingList[2].jumpLink}" disabled="${infoType.cmBrandLandingList[2].jumpStatus eq 2?'false':'true'}"/>
+			</div>
+			<br>
+			<div class="controls">
+				<input type="radio" name="cmBrandLandingList[2].jumpStatus"
+					   value="0" ${empty infoType.cmBrandLandingList[2].jumpStatus?'checked=checked':infoType.cmBrandLandingList[2].jumpStatus eq 0?'checked=checked':''}>
+				无
+			</div>
 		</div>
-	</form:form>
+	</div>
+	<div class="form-actions">
+		<shiro:hasPermission name="info:infoType:edit"><input id="btnSubmit" class="btn btn-primary" type="submit"
+															  value="保 存"/>&nbsp;</shiro:hasPermission>
+		<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
+	</div>
+</form:form>
 </body>
-</html>
+</html>

+ 13 - 6
src/main/webapp/WEB-INF/views/modules/info/infoTypeList.jsp

@@ -46,7 +46,8 @@
 					} else {
 						$.jBox.tip(data.msg,'error');
 					}
-		 			$("#searchForm").submit();
+		 			// $("#searchForm").submit();
+					history.go(0)
 				},"JSON");//这里返回的类型有:json,html,xml,text
 			}
 				return;
@@ -68,9 +69,12 @@
 </head>
 <body>
 	<ul class="nav nav-tabs">
-		<li class="active"><a href="${ctx}/info/infoType/">文章分类列表</a></li>
+		<c:if test="${infoType.parentId ne 0}">
+			<li class="active"><a href="${ctx}/info/infoType/?type=1&parentId=0">返回一级分类列表</a></li>
+		</c:if>
+		<li class="active"><a href="${ctx}/info/infoType/?type=1&parentId=${infoType.parentId}">${ infoType.parentId eq 0 ?'一':'二'}级分类列表</a></li>
 		<%-- <shiro:hasPermission name="info:infoType:edit"><li><a href="javascript:void(0);" onclick="statusLimit()">文章分类添加</a></li></shiro:hasPermission> --%>
-		<shiro:hasPermission name="info:infoType:edit"><li><a href="${ctx}/info/infoType/form">文章分类添加</a></li></shiro:hasPermission>
+		<shiro:hasPermission name="info:infoType:edit"><li><a href="${ctx}/info/infoType/form?type=1&parentId=${infoType.parentId}">添加${ infoType.parentId eq 0 ?'一':'二'}级分类</a></li></shiro:hasPermission>
 	</ul>
 	<form:form id="searchForm" modelAttribute="infoType" action="${ctx}/info/infoType/" method="post" class="breadcrumb form-search">
 		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
@@ -85,7 +89,7 @@
 		<thead>
 			<tr>
 				<th>序号</th>
-				<th>分类名称</th>
+				<th>${infoType.parentId eq 0 ?'一':'二'}级分类</th>
 				<th>优先级</th>
 				<th>状态</th>
 				<shiro:hasPermission name="info:infoType:edit"><th>操作</th></shiro:hasPermission>
@@ -114,9 +118,12 @@
 					</c:if>
 				</td>
 				<shiro:hasPermission name="info:infoType:edit"><td>
-    				<a href="${ctx}/info/infoType/form?id=${infoType.id}">编辑</a>
+					<c:if test="${infoType.parentId eq 0 }" >
+					<a href="${ctx}/info/infoType/?type=1&parentId=${infoType.id}">二级分类</a>
+					</c:if>
+					<a href="${ctx}/info/infoType/form?id=${infoType.id}">编辑</a>
 				<shiro:hasPermission name="info:infoType:delete">
-					<a href="${ctx}/info/infoType/delete?id=${infoType.id}" onclick="return confirmx('确认要删除该文章分类吗?', this.href)">删除</a>
+					<a href="${ctx}/info/infoType/delete?id=${infoType.id}&type=1&parentId=${infoType.parentId}" onclick="return confirmx('确认要删除该文章分类吗?', this.href)">删除</a>
 				</shiro:hasPermission>
 				</td></shiro:hasPermission>
 			</tr>

+ 1 - 0
src/main/webapp/WEB-INF/views/modules/info/shopInfoList.jsp

@@ -187,6 +187,7 @@
                     <a href="${ctx}/info/info/toAuditPage?id=${info.id}"
 					   style="display: ${info.auditStatus eq 1 or info.auditStatus eq 3?'':'none'}">审核</a>
                     <a href="${ctx}/info/info/check?id=${info.id}&publishSource=2">查看</a>
+					<a style="white-space: nowrap" href="${ctx}/info/info/relatedForm?id=${info.id}">相关阅读</a>
 					<c:if test="${info.onlineStatus eq 2}">
 						<a href="javascript:;" onclick="offline(${info.id})">下线</a>
 					</c:if>

+ 9 - 13
src/main/webapp/WEB-INF/views/modules/user/newCmShopSetForm.jsp

@@ -11,19 +11,15 @@
 			//$("#name").focus();
 			$("#inputForm").validate({
 				submitHandler: function (form) {
-					// if ($('#bankAccount').val() == "" || $('#bankAccountName').val() == "" || $('#bankName').val() == "") {
-					// 	if (!confirm('您还没填写供应商的账号归属,确定不填写了吗?')) {
-					// 		$('#AccountOwnership').val("1")
-					// 		accountOwnershipCheck()
-					// 		return false
-					// 	}
-					// } else if ($('#cmBankAccount').val() == "" || $('#cmBankAccountName').val() == "" || $('#cmBankName').val() == "") {
-					// 	if (!confirm('您还没填写付采美的账号归属,确定不填写了吗?')) {
-					// 		$('#AccountOwnership').val("0")
-					// 		accountOwnershipCheck()
-					// 		return false
-					// 	}
-					// }
+					if ($('#AccountOwnership').val() == 1) {
+						$('#cmBankAccount').val("")
+						$('#cmBankAccountName').val("")
+						$('#cmBankName').val("")
+					} else {
+						$('#bankAccount').val("")
+						$('#bankAccountName').val("")
+						$('#bankName').val("")
+					}
 					loading('正在提交,请稍等...');
 					form.submit();
 				},