Sfoglia il codice sorgente

小需求优化V1.3.14

kaick 1 anno fa
parent
commit
18114d4a8f
53 ha cambiato i file con 2910 aggiunte e 462 eliminazioni
  1. 3 1
      src/main/java/com/caimei/modules/baike/dao/CmBaikeProductDao.java
  2. 56 18
      src/main/java/com/caimei/modules/baike/entity/CmBaikeProduct.java
  3. 4 1
      src/main/java/com/caimei/modules/baike/service/CmBaikeProductService.java
  4. 78 24
      src/main/java/com/caimei/modules/baike/web/CmBaikeProductController.java
  5. 3 0
      src/main/java/com/caimei/modules/info/entity/CmRelated.java
  6. 9 0
      src/main/java/com/caimei/modules/info/entity/Info.java
  7. 14 11
      src/main/java/com/caimei/modules/info/service/CmRelatedService.java
  8. 31 4
      src/main/java/com/caimei/modules/info/web/InfoTypeController.java
  9. 95 4
      src/main/java/com/caimei/modules/landing/domain/CmBrandLanding.java
  10. 3 2
      src/main/java/com/caimei/modules/landing/mapper/CmBrandLandingMapper.java
  11. 7 6
      src/main/java/com/caimei/modules/landing/service/CmBrandLandingService.java
  12. 8 2
      src/main/java/com/caimei/modules/landing/web/CmBrandLandingController.java
  13. 2 2
      src/main/java/com/caimei/modules/newhome/dao/CmInstrumentMaintenanceLinksDao.java
  14. 74 0
      src/main/java/com/caimei/modules/newhome/dao/CmQualityShopTypeMapper.java
  15. 2 0
      src/main/java/com/caimei/modules/newhome/dao/NewPageHomeimageDao.java
  16. 126 0
      src/main/java/com/caimei/modules/newhome/entity/CmQualityShopType.java
  17. 110 4
      src/main/java/com/caimei/modules/newhome/entity/NewPageHomeimage.java
  18. 68 10
      src/main/java/com/caimei/modules/newhome/entity/NewPageQualitySupplier.java
  19. 94 0
      src/main/java/com/caimei/modules/newhome/service/CmQualityShopTypeService.java
  20. 11 8
      src/main/java/com/caimei/modules/newhome/service/NewPageHomeimageService.java
  21. 38 13
      src/main/java/com/caimei/modules/newhome/service/NewPageQualitySupplierService.java
  22. 115 0
      src/main/java/com/caimei/modules/newhome/web/CmQualityShopTypeController.java
  23. 39 21
      src/main/java/com/caimei/modules/newhome/web/NewPageHomeimageController.java
  24. 29 26
      src/main/java/com/caimei/modules/newhome/web/NewPageQualitySupplierController.java
  25. 81 0
      src/main/java/com/caimei/modules/user/dao/CmUserPowerMapper.java
  26. 61 19
      src/main/java/com/caimei/modules/user/entity/CmRelatedImage.java
  27. 109 0
      src/main/java/com/caimei/modules/user/entity/CmUserPower.java
  28. 109 0
      src/main/java/com/caimei/modules/user/service/CmUserPowerService.java
  29. 42 3
      src/main/java/com/caimei/modules/user/web/NewCmShopController.java
  30. 46 48
      src/main/java/com/caimei/modules/utils/MessageUtil.java
  31. 35 3
      src/main/resources/mappings/modules/baike/CmBaikeProductMapper.xml
  32. 10 0
      src/main/resources/mappings/modules/info/InfoMapper.xml
  33. 45 2
      src/main/resources/mappings/modules/landing/CmBrandLandingMapper.xml
  34. 140 0
      src/main/resources/mappings/modules/newhome/CmQualityShopTypeMapper.xml
  35. 59 2
      src/main/resources/mappings/modules/newhome/NewPageHomeimageMapper.xml
  36. 19 12
      src/main/resources/mappings/modules/newhome/NewPageQualitySupplierMapper.xml
  37. 7 0
      src/main/resources/mappings/modules/user/CmRelatedImageMapper.xml
  38. 117 0
      src/main/resources/mappings/modules/user/CmUserPowerMapper.xml
  39. 135 0
      src/main/webapp/WEB-INF/views/modules/baikePage/addBaikeForm.jsp
  40. 13 3
      src/main/webapp/WEB-INF/views/modules/baikePage/cmBaikeProductList.jsp
  41. 8 0
      src/main/webapp/WEB-INF/views/modules/baikePage/shopBaikeProductList.jsp
  42. 9 1
      src/main/webapp/WEB-INF/views/modules/info/infoList.jsp
  43. 97 52
      src/main/webapp/WEB-INF/views/modules/info/infoRelatedForm.jsp
  44. 118 39
      src/main/webapp/WEB-INF/views/modules/info/infoTypeLandingList.jsp
  45. 8 0
      src/main/webapp/WEB-INF/views/modules/info/shopInfoList.jsp
  46. 78 23
      src/main/webapp/WEB-INF/views/modules/landing/newPageCmbrandLandingForm.jsp
  47. 80 11
      src/main/webapp/WEB-INF/views/modules/newhome/newPageHomeimageForm.jsp
  48. 135 73
      src/main/webapp/WEB-INF/views/modules/newhome/newPageHomeimageList.jsp
  49. 37 2
      src/main/webapp/WEB-INF/views/modules/newhome/newPageQualitySupplierForm.jsp
  50. 27 8
      src/main/webapp/WEB-INF/views/modules/newhome/newPageQualitySupplierList.jsp
  51. 67 0
      src/main/webapp/WEB-INF/views/modules/newhome/qualityShopTypeFrom.jsp
  52. 106 0
      src/main/webapp/WEB-INF/views/modules/newhome/qualityShopTypeList.jsp
  53. 93 4
      src/main/webapp/WEB-INF/views/modules/user/newCmShopList.jsp

+ 3 - 1
src/main/java/com/caimei/modules/baike/dao/CmBaikeProductDao.java

@@ -21,6 +21,8 @@ public interface CmBaikeProductDao extends CrudDao<CmBaikeProduct> {
 
     void updateTopPosition(CmBaikeProduct cmBaikeProduct);
 
+    void updateAutoStatus(CmBaikeProduct cmBaikeProduct);
+
     List<CmBaikeProductParam> findParamList(String id);
 
     /**
@@ -92,4 +94,4 @@ public interface CmBaikeProductDao extends CrudDao<CmBaikeProduct> {
     CmBaikeReferenceInfo getMaterialinfo(CmBaikeReferenceInfo cmBaikeReferenceInfo);
 
 
-}
+}

+ 56 - 18
src/main/java/com/caimei/modules/baike/entity/CmBaikeProduct.java

@@ -1,5 +1,6 @@
 package com.caimei.modules.baike.entity;
 
+import com.caimei.modules.info.entity.CmRelated;
 import com.caimei.modules.user.entity.NewCmShop;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.thinkgem.jeesite.common.persistence.DataEntity;
@@ -9,22 +10,24 @@ import java.util.List;
 
 /**
  * 采美百科产品/仪器Entity
+ *
  * @author Aslee
  * @version 2021-11-19
  */
 public class CmBaikeProduct extends DataEntity<CmBaikeProduct> {
 
 	private static final long serialVersionUID = 1L;
-	private Integer commodityType;		// 分类:1产品,2仪器
-	private Integer publishSource;		// 百科发布来源:1采美,2供应商
-	private Integer shopId;		// 供应商id,publishSource为2时才有值
-	private String productLink;		// 产品链接
-	private String name;		// 名称
-	private String alias;		// 别名
-	private String discription;		// 描述
-	private String seoKeyword;		// seo关键词
-	private String banner;		// banner
-	private String image;		// 图片
+	private Integer includedStatus;        // 百度收录状态:1已收录,0审核中
+	private Integer commodityType;        // 分类:1产品,2仪器
+	private Integer publishSource;        // 百科发布来源:1采美,2供应商
+	private Integer shopId;        // 供应商id,publishSource为2时才有值
+	private String productLink;        // 产品链接
+	private String name;        // 名称
+	private String alias;        // 别名
+	private String discription;        // 描述
+	private String seoKeyword;        // seo关键词
+	private String banner;        // banner
+	private String image;        // 图片
     private String authLink;    // 认证链接
     private String authQrCode;  // 认证二维码
 	private String advantage;		// 优点
@@ -43,16 +46,51 @@ public class CmBaikeProduct extends DataEntity<CmBaikeProduct> {
 	private Integer actualPv;		// 实际浏览量
 	private Integer typeId;		// 分类id
 	private Integer topPosition;		// 置顶位
-	private Integer status;		// 状态:0停用,1启用
-	private Integer auditStatus;	//百科审核状态:1待审核,2审核通过,3审核失败
-	private Integer onlineStatus;	//百科上线状态:1待上线,2已上线,3已下线
-	private String failReason;	//审核失败理由
-	private Integer recommendType;	//推荐类型:1手动推荐,2自动推荐
-	private Integer emptyNum;	//空数据条数
-	private Date addTime;		// 添加时间
+	private Integer status;        // 状态:0停用,1启用
+	private Integer auditStatus;    //百科审核状态:1待审核,2审核通过,3审核失败
+	private Integer onlineStatus;    //百科上线状态:1待上线,2已上线,3已下线
+	private String failReason;    //审核失败理由
+	private Integer recommendType;    //推荐类型:1手动推荐,2自动推荐
+	private Integer emptyNum;    //空数据条数
+	private Date addTime;        // 添加时间
 	private String labelIds;  //关联标签库ids
 	private String labelStr; //关联标签库
-	private String  referenceImgUrl;
+	private String referenceImgUrl;
+	private Integer autoStatus;
+	private Integer cmRelatedType;
+	private List<CmRelated> cmRelatedList;
+
+	public Integer getCmRelatedType() {
+		return cmRelatedType;
+	}
+
+	public void setCmRelatedType(Integer cmRelatedType) {
+		this.cmRelatedType = cmRelatedType;
+	}
+
+	public Integer getAutoStatus() {
+		return autoStatus;
+	}
+
+	public void setAutoStatus(Integer autoStatus) {
+		this.autoStatus = autoStatus;
+	}
+
+	public List<CmRelated> getCmRelatedList() {
+		return cmRelatedList;
+	}
+
+	public void setCmRelatedList(List<CmRelated> cmRelatedList) {
+		this.cmRelatedList = cmRelatedList;
+	}
+
+	public Integer getIncludedStatus() {
+		return includedStatus;
+	}
+
+	public void setIncludedStatus(Integer includedStatus) {
+		this.includedStatus = includedStatus;
+	}
 
 	public String getBanner() {
 		return banner;

+ 4 - 1
src/main/java/com/caimei/modules/baike/service/CmBaikeProductService.java

@@ -113,7 +113,6 @@ public class CmBaikeProductService extends CrudService<CmBaikeProductDao, CmBaik
     @Transactional(readOnly = false)
     public CmBaikeReferenceInfo getMaterialinfo(CmBaikeReferenceInfo cmBaikeReferenceInfo) {
         return cmBaikeProductDao.getMaterialinfo(cmBaikeReferenceInfo);
-
     }
 
 
@@ -344,6 +343,10 @@ public class CmBaikeProductService extends CrudService<CmBaikeProductDao, CmBaik
     public void updateTopPosition(CmBaikeProduct cmBaikeProduct) {
         cmBaikeProductDao.updateTopPosition(cmBaikeProduct);
     }
+    @Transactional(readOnly = false)
+    public void updateAutoStatus(CmBaikeProduct cmBaikeProduct) {
+        cmBaikeProductDao.updateAutoStatus(cmBaikeProduct);
+    }
 
     /**
      * 清除置顶,将后面置顶位的数据往前移

+ 78 - 24
src/main/java/com/caimei/modules/baike/web/CmBaikeProductController.java

@@ -1,49 +1,41 @@
 package com.caimei.modules.baike.web;
 
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
 import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
 import com.caimei.modules.baike.dao.CmBaikeProductDao;
 import com.caimei.modules.baike.dao.CmBaikeProductRecommendDao;
 import com.caimei.modules.baike.dao.CmBaikeTypeDao;
 import com.caimei.modules.baike.entity.*;
+import com.caimei.modules.baike.service.CmBaikeProductService;
 import com.caimei.modules.baike.service.CmBaikeTypeService;
 import com.caimei.modules.info.dao.InfoDao;
-import com.caimei.modules.opensearch.GenerateUtils;
+import com.caimei.modules.info.entity.CmRelated;
+import com.caimei.modules.info.service.CmRelatedService;
 import com.caimei.modules.order.utils.OSSUtils;
 import com.caimei.modules.product.dao.KeywordFrequencyDao;
-import com.caimei.modules.product.entity.CmProductRecommend;
-import com.caimei.modules.product.entity.Product;
 import com.caimei.modules.product.entity.SearchFrequencyVo;
 import com.caimei.modules.user.entity.NewCmShop;
 import com.caimei.redis.RedisService;
-import com.caimei.utils.AppUtils;
 import com.google.common.collect.Maps;
 import com.google.gson.Gson;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.utils.StringUtils;
+import com.thinkgem.jeesite.common.web.BaseController;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
-import com.thinkgem.jeesite.common.config.Global;
-import com.thinkgem.jeesite.common.persistence.Page;
-import com.thinkgem.jeesite.common.web.BaseController;
-import com.thinkgem.jeesite.common.utils.StringUtils;
-import com.caimei.modules.baike.service.CmBaikeProductService;
-
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
+import java.util.*;
 
 /**
  * 采美百科产品/仪器Controller
@@ -78,6 +70,8 @@ public class CmBaikeProductController extends BaseController {
 
     @Autowired
     private KeywordFrequencyDao keywordFrequencyDao;
+    @Resource
+    private CmRelatedService cmRelatedService;
 
     @ModelAttribute
     public CmBaikeProduct get(@RequestParam(required = false) String id) {
@@ -707,4 +701,64 @@ public class CmBaikeProductController extends BaseController {
         return "modules/baikePage/addProductRecommend";
     }
 
-}
+    @RequestMapping(value = "relatedForm")
+    public String relatedForm(CmBaikeProduct cmBaikeProduct, String ltype, Model model) {
+        CmRelated cmRelated = new CmRelated();
+        cmRelated.setAuthorId(cmBaikeProduct.getId());
+        cmRelated.setType("3");
+        cmBaikeProduct.setCmRelatedList(cmRelatedService.getCmRelatedList(cmRelated));
+        model.addAttribute("info", cmBaikeProduct);
+        model.addAttribute("ltype", ltype);
+        return "modules/info/infoRelatedForm";
+    }
+    /**
+     * 选择词条数据
+     */
+    @RequestMapping(value = "findBaikePage")
+    public String findBaikePage(CmBaikeProduct cmBaikeProduct, Model model, HttpServletRequest request, HttpServletResponse response) {
+        cmBaikeProduct.setStatus(1);
+        Page<CmBaikeProduct> page = cmBaikeProductService.findPage(new Page<CmBaikeProduct>(request, response), cmBaikeProduct);
+        model.addAttribute("page", page);
+        // 分类列表
+        CmBaikeType cmBaikeType = new CmBaikeType();
+        cmBaikeType.setTypeSort(cmBaikeProduct.getCommodityType());
+        List<CmBaikeType> typeList = cmBaikeTypeDao.findList(cmBaikeType);
+        model.addAttribute("typeList", typeList);
+        return "modules/baikePage/addBaikeForm";
+    }
+
+    /**
+     * 添加文章数据
+     */
+    @RequestMapping(value = "addBaikes")
+    @ResponseBody
+    public Map<String, Object> addBaikes(String infoIds) {
+        CmBaikeProduct cmBaikeProduct = new CmBaikeProduct();
+        cmBaikeProduct.setId("IN=" + infoIds);
+        HashMap<String, Object> map = new HashMap<>(2);
+        map.put("infoList", cmBaikeProductService.findList(cmBaikeProduct));
+        map.put("success", true);
+        map.put("info", "添加文章成功");
+        return map;
+    }
+
+    @RequestMapping(value = "relatedSave")
+    public String relatedSave(CmBaikeProduct cmBaikeProduct, Model model, RedirectAttributes redirectAttributes, HttpServletRequest request) {
+        CmBaikeProduct baikeProduct = new CmBaikeProduct();
+        baikeProduct.setId(cmBaikeProduct.getId());
+        baikeProduct.setAutoStatus(cmBaikeProduct.getAutoStatus());
+        cmBaikeProductService.updateAutoStatus(baikeProduct);
+        if (1==cmBaikeProduct.getAutoStatus()) {
+            cmRelatedService.delCmRelatedByAuthorId("3", cmBaikeProduct.getId());
+            cmBaikeProduct.getCmRelatedList().forEach(cmRelated -> {
+                cmRelated.setType("3");
+                cmRelated.setCreateTime(new Date());
+                cmRelatedService.addCmRelated(cmRelated);
+            });
+        }
+        addMessage(redirectAttributes, "保存信息成功");
+        return "redirect:" + Global.getAdminPath() + "/baike/cmBaikeProduct/list?commodityType=1&publishSource=" + cmBaikeProduct.getPublishSource();
+    }
+
+
+}

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

@@ -1,5 +1,6 @@
 package com.caimei.modules.info.entity;
 
+import com.caimei.modules.baike.entity.CmBaikeProduct;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.thinkgem.jeesite.common.persistence.DataEntity;
 import org.apache.commons.lang3.builder.ToStringBuilder;
@@ -50,5 +51,7 @@ public class CmRelated extends DataEntity<CmRelated> implements Serializable
     private Integer sort;
     //相关文章
     private Info info;
+    //相关文章
+    private CmBaikeProduct cmBaikeProduct;
 }
 

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

@@ -14,6 +14,7 @@ import com.thinkgem.jeesite.common.persistence.DataEntity;
 public class Info extends DataEntity<Info> {
 
 	private static final long serialVersionUID = 1L;
+	private Integer includedStatus;		// 百度收录状态:1已收录,0审核中
 	private InfoType infoType;		// 信息分类
 	private String typeId;		// 信息分类Id
 	private String typeName;		// 信息分类名称
@@ -52,6 +53,14 @@ public class Info extends DataEntity<Info> {
 	private String isRelevance;
 	List<CmRelated> cmRelatedList;
 
+	public Integer getIncludedStatus() {
+		return includedStatus;
+	}
+
+	public void setIncludedStatus(Integer includedStatus) {
+		this.includedStatus = includedStatus;
+	}
+
 	public String getCmRelatedType() {
 		return cmRelatedType;
 	}

+ 14 - 11
src/main/java/com/caimei/modules/info/service/CmRelatedService.java

@@ -1,21 +1,17 @@
 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.caimei.modules.baike.dao.CmBaikeProductDao;
+import com.caimei.modules.info.dao.CmRelatedMapper;
+import com.caimei.modules.info.entity.CmRelated;
 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;
 
+import java.util.Date;
+import java.util.List;
+
 /**
  * 相关资源Service业务层处理
  *
@@ -28,6 +24,8 @@ public class CmRelatedService extends CrudService<CmRelatedMapper, CmRelated> {
     private CmRelatedMapper cmRelatedMapper;
     @Autowired
     private InfoService infoService;
+    @Autowired
+    private CmBaikeProductDao cmBaikeProductDao;
 
     public Page<CmRelated> findPage(Page<CmRelated> page, CmRelated cmRelated) {
         Page<CmRelated> cmRelatedPage = super.findPage(page, cmRelated);
@@ -40,7 +38,12 @@ public class CmRelatedService extends CrudService<CmRelatedMapper, CmRelated> {
     public List<CmRelated> getCmRelatedList(CmRelated cmRelated) {
         List<CmRelated> cmRelatedList = cmRelatedMapper.getCmRelatedList(cmRelated);
         cmRelatedList.forEach(cmRelated1 -> {
-            cmRelated1.setInfo(infoService.get(cmRelated1.getRelatedId()));
+            if("1".equals(cmRelated1.getType())){
+                cmRelated1.setInfo(infoService.get(cmRelated1.getRelatedId()));
+            }
+            if("3".equals(cmRelated1.getType())){
+                cmRelated1.setCmBaikeProduct(cmBaikeProductDao.get(cmRelated1.getRelatedId()));
+            }
         });
         return cmRelatedList;
     }

+ 31 - 4
src/main/java/com/caimei/modules/info/web/InfoTypeController.java

@@ -26,6 +26,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -190,6 +191,7 @@ public class InfoTypeController extends BaseController {
 		Page<CmBrandLanding> page = cmBrandLandingService.findPage(new Page<CmBrandLanding>(request, response), cmBrandLanding);
 		model.addAttribute("cmBrandLanding", cmBrandLanding);
 		model.addAttribute("page", page);
+		model.addAttribute("publishSource", cmBrandLanding.getPublishSource());
 		return "modules/info/infoTypeLandingList";
 	}
 
@@ -198,12 +200,20 @@ public class InfoTypeController extends BaseController {
 	public Map<String, Object> updateLanDingStatus(CmBrandLanding cmBrandLanding,HttpServletRequest request,HttpServletResponse response){
 		Map<String, Object> map =Maps.newLinkedHashMap();
 		try {
-			cmBrandLandingService.updateCmBrandLanding(new CmBrandLanding()
+			if(null!=cmBrandLanding.pcStatus()){
+				cmBrandLanding.pcStatus(2 == cmBrandLanding.bookStatus() ? 2: cmBrandLanding.pcStatus());
+			}
+			CmBrandLanding landing = new CmBrandLanding()
 					.id(cmBrandLanding.id())
-					.appStatus(cmBrandLanding.appStatus())
+					.appStatus(cmBrandLanding.pcStatus())
 					.pcStatus(cmBrandLanding.pcStatus())
-					.sort(cmBrandLanding.sort())
-			);
+					.sort(cmBrandLanding.sort());
+			if (null!=cmBrandLanding.pcStatus()&&0!=cmBrandLanding.pcStatus()) {
+				landing.setBookStatus(cmBrandLanding.bookStatus());
+				landing.setBookStartDate(cmBrandLanding.bookStatus() == 1 ? new Date() : cmBrandLanding.bookStartDate());
+				landing.setBookEndDate(cmBrandLanding.bookEndDate());
+			}
+			cmBrandLandingService.updateCmBrandLanding(landing);
 			map.put("success",true);
 			map.put("msg", "修改成功");
 		} catch (Exception e) {
@@ -213,4 +223,21 @@ public class InfoTypeController extends BaseController {
 		}
 		return map;
 	}
+
+	@ResponseBody
+	@RequestMapping(value = "isLandingtatus")
+	public Map<String, Object> isHomeimageStatus(Integer id, Integer publishSource, String bookStartDate, String bookEndDate) {
+		Map<String, Object> map = Maps.newLinkedHashMap();
+		try {
+			int landingCount = cmBrandLandingService.getLandingCount(id,5, StringUtils.isBlank(bookStartDate) ? cn.hutool.core.date.DateUtil.formatDate(new Date()) : bookStartDate, bookEndDate);
+			map.put("success", true);
+			map.put("isHomeimageStatus", publishSource == 1 ? landingCount < 11 : landingCount < 10);
+			map.put("msg", "修改成功");
+		} catch (Exception e) {
+			logger.debug(e.toString(), e);
+			map.put("success", false);
+			map.put("msg", "修改失败");
+		}
+		return map;
+	}
 }

+ 95 - 4
src/main/java/com/caimei/modules/landing/domain/CmBrandLanding.java

@@ -72,13 +72,13 @@ public class CmBrandLanding extends DataEntity<CmBrandLanding> implements Serial
     /** 排序 */
     private Integer sort;
 
-    /** pc端status 0启用,1停用 */
+    /** pc端status  1启用,0停用 */
     private Integer pcStatus;
 
-    /** 移动端status 0启用,1停用 */
+    /** 移动端status 1启用,0停用 */
     private Integer appStatus;
 
-    /** 移动端status 0启用,1停用 */
+    /** 点击量 */
     private Integer pv;
 
     /** 删除状态 0正常,1删除 */
@@ -92,6 +92,33 @@ public class CmBrandLanding extends DataEntity<CmBrandLanding> implements Serial
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date addTime;
 
+    /** 商品Id */
+    private Integer productId;
+
+    /** 上架方式:1立即上架,2预约上架 */
+    private Integer bookStatus;
+
+    /** 预约上架时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date bookStartDate;
+
+    /** 预约下架时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date bookEndDate;
+
+    /** 审核状态:1待审核,2审核通过,3审核失败 */
+    private Integer auditStatus;
+
+    /** 审核时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date auditTime;
+
+    /** 审核失败理由 */
+    private String failReason;
+
+    /** 文章发布来源:1采美365网,2供应商 */
+    private Integer publishSource;
+
 
     //点击量统计
     /** 开始点击量时间 */
@@ -120,10 +147,74 @@ public class CmBrandLanding extends DataEntity<CmBrandLanding> implements Serial
     }
 
     public Date getEndPvCreateTime() {
-        
+
         return endPvCreateTime;
     }
 
+    public Integer getProductId() {
+        return productId;
+    }
+
+    public void setProductId(Integer productId) {
+        this.productId = productId;
+    }
+
+    public Integer getBookStatus() {
+        return bookStatus;
+    }
+
+    public void setBookStatus(Integer bookStatus) {
+        this.bookStatus = bookStatus;
+    }
+
+    public Date getBookStartDate() {
+        return bookStartDate;
+    }
+
+    public void setBookStartDate(Date bookStartDate) {
+        this.bookStartDate = bookStartDate;
+    }
+
+    public Date getBookEndDate() {
+        return bookEndDate;
+    }
+
+    public void setBookEndDate(Date bookEndDate) {
+        this.bookEndDate = bookEndDate;
+    }
+
+    public Integer getAuditStatus() {
+        return auditStatus;
+    }
+
+    public void setAuditStatus(Integer auditStatus) {
+        this.auditStatus = auditStatus;
+    }
+
+    public Date getAuditTime() {
+        return auditTime;
+    }
+
+    public void setAuditTime(Date auditTime) {
+        this.auditTime = auditTime;
+    }
+
+    public String getFailReason() {
+        return failReason;
+    }
+
+    public void setFailReason(String failReason) {
+        this.failReason = failReason;
+    }
+
+    public Integer getPublishSource() {
+        return publishSource;
+    }
+
+    public void setPublishSource(Integer publishSource) {
+        this.publishSource = publishSource;
+    }
+
     public void setEndPvCreateTime(Date endPvCreateTime) {
         this.endPvCreateTime = endPvCreateTime;
     }

+ 3 - 2
src/main/java/com/caimei/modules/landing/mapper/CmBrandLandingMapper.java

@@ -1,7 +1,5 @@
 package com.caimei.modules.landing.mapper;
 
-import com.caimei.modules.landing.domain.CmBrandBanner;
-import com.caimei.modules.landing.domain.CmBrandFiles;
 import com.caimei.modules.landing.domain.CmBrandLanding;
 import com.thinkgem.jeesite.common.persistence.CrudDao;
 import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
@@ -21,6 +19,9 @@ public interface CmBrandLandingMapper  extends CrudDao<CmBrandLanding>
 
     public String findBigSort();
 
+    int getLandingCount(@Param("id")Integer id,@Param("type")Integer type,@Param("bookStartDate")String bookStartDate,@Param("bookEndDate")String bookEndDate);
+
+
     public int updateSort(@Param("id") String id, @Param("sort") String sort);
     /**
      * 查询供应商落地页资源

+ 7 - 6
src/main/java/com/caimei/modules/landing/service/CmBrandLandingService.java

@@ -1,15 +1,9 @@
 package com.caimei.modules.landing.service;
 
-import java.io.File;
-import java.util.*;
-
-import com.caimei.modules.archive.entity.CmProductArchiveFile;
 import com.caimei.modules.archive.utils.OssArchiveUtil;
 import com.caimei.modules.archive.utils.WaterMarkUtils;
-import com.caimei.modules.landing.domain.CmBrandBanner;
 import com.caimei.modules.landing.domain.CmBrandFiles;
 import com.caimei.modules.landing.domain.CmBrandLanding;
-import com.caimei.modules.landing.mapper.CmBrandBannerMapper;
 import com.caimei.modules.landing.mapper.CmBrandFilesMapper;
 import com.caimei.modules.landing.mapper.CmBrandLandingMapper;
 import com.thinkgem.jeesite.common.config.Global;
@@ -19,6 +13,9 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.multipart.MultipartFile;
 
+import java.io.File;
+import java.util.*;
+
 /**
  * 供应商落地页资源Service业务层处理
  *
@@ -123,6 +120,10 @@ public class CmBrandLandingService extends CrudService<CmBrandLandingMapper, CmB
         return cmBrandLandingMapper.findBigSort();
     }
 
+    public int getLandingCount(Integer id,Integer type,String bookStartDate,String bookEndDate) {
+        return cmBrandLandingMapper.getLandingCount( id,  type,bookStartDate, bookEndDate);
+    }
+
     @Transactional(readOnly = false)
     public void updateSorts(String sortNums) {
         if (sortNums.contains(",")) {

+ 8 - 2
src/main/java/com/caimei/modules/landing/web/CmBrandLandingController.java

@@ -89,6 +89,12 @@ public class CmBrandLandingController extends BaseController {
             String img = saveImageToServer(cmBrandLanding.getHeadAppBanner(), request);
             cmBrandLanding.setHeadAppBanner(img);
         }
+        if(null!=cmBrandLanding.bookStatus()){
+            cmBrandLanding.pcStatus(2 == cmBrandLanding.bookStatus() ? 2: cmBrandLanding.pcStatus());
+        }
+        if (null!=cmBrandLanding.bookStatus()&&0!=cmBrandLanding.pcStatus()) {
+            cmBrandLanding.setBookStartDate(cmBrandLanding.bookStatus() == 1 ? new Date() : cmBrandLanding.bookStartDate());
+        }
         if (cmBrandLanding.getId() == null || cmBrandLanding.getId() == "") {
             cmBrandLanding.setAddTime(new Date());
             cmBrandLandingService.insertCmBrandLanding(cmBrandLanding);
@@ -103,7 +109,7 @@ public class CmBrandLandingController extends BaseController {
             }
             if(cmBrandLanding.getType()==5){
                 addMessage(redirectAttributes, "保存广告图成功");
-                return "redirect:" + Global.getAdminPath() + "/info/infoType/infoTypeLandingList?levelType="+cmBrandLanding.getLevelType();
+                return "redirect:" + Global.getAdminPath() + "/info/infoType/infoTypeLandingList?levelType="+cmBrandLanding.getLevelType()+"&publishSource=" + cmBrandLanding.getPublishSource();
             }
         } else {
             cmBrandLanding.setUpdateTime(new Date());
@@ -119,7 +125,7 @@ public class CmBrandLandingController extends BaseController {
             }
             if(cmBrandLanding.getType()==5){
                 addMessage(redirectAttributes, "修改广告图成功");
-                return "redirect:" + Global.getAdminPath() + "/info/infoType/infoTypeLandingList?levelType="+cmBrandLanding.getLevelType();
+                return "redirect:" + Global.getAdminPath() + "/info/infoType/infoTypeLandingList?levelType="+cmBrandLanding.getLevelType()+"&publishSource=" + cmBrandLanding.getPublishSource();
             }
         }
 

+ 2 - 2
src/main/java/com/caimei/modules/newhome/dao/CmInstrumentMaintenanceLinksDao.java

@@ -1,8 +1,8 @@
 package com.caimei.modules.newhome.dao;
 
+import com.caimei.modules.newhome.entity.CmInstrumentMaintenanceLinks;
 import com.thinkgem.jeesite.common.persistence.CrudDao;
 import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
-import com.caimei.modules.newhome.entity.CmInstrumentMaintenanceLinks;
 import org.apache.ibatis.annotations.Param;
 
 /**
@@ -14,4 +14,4 @@ import org.apache.ibatis.annotations.Param;
 public interface CmInstrumentMaintenanceLinksDao extends CrudDao<CmInstrumentMaintenanceLinks> {
 
     CmInstrumentMaintenanceLinks getShareLinkCode(@Param("id") String id, @Param("type") String type);
-}
+}

+ 74 - 0
src/main/java/com/caimei/modules/newhome/dao/CmQualityShopTypeMapper.java

@@ -0,0 +1,74 @@
+package com.caimei.modules.newhome.dao;
+
+import com.caimei.modules.newhome.entity.CmQualityShopType;
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+
+import java.util.List;
+
+/**
+ * Mapper接口
+ *
+ * @author Kaick
+ * @date 2024-01-25
+ */
+@MyBatisDao
+public interface CmQualityShopTypeMapper extends CrudDao<CmQualityShopType>
+{
+    /**
+     * 查询列表
+     *
+     * @param cmQualityShopType
+     * @return 集合
+     */
+    List<CmQualityShopType> getCmQualityShopTypeList(CmQualityShopType cmQualityShopType);
+
+    /**
+     * 通过Id查询
+     *
+     * @param id 主键
+     * @return
+     */
+    CmQualityShopType getCmQualityShopTypeById(String id);
+
+    /**
+     * 查询
+     *
+     * @param cmQualityShopType
+     * @return
+     */
+    CmQualityShopType getByCmQualityShopType(CmQualityShopType cmQualityShopType);
+
+                                                            /**
+     * 新增
+     *
+     * @param cmQualityShopType
+     * @return 结果
+     */
+    int addCmQualityShopType(CmQualityShopType cmQualityShopType);
+
+    /**
+     * 修改
+     *
+     * @param cmQualityShopType
+     * @return 结果
+     */
+    int updateCmQualityShopType(CmQualityShopType cmQualityShopType);
+
+    /**
+     * 删除
+     *
+     * @param id 主键
+     * @return 结果
+     */
+    int delCmQualityShopTypeById(String id);
+
+    /**
+     * 批量删除
+     *
+     * @param 需要删除的数据主键集合
+     * @return 结果
+     */
+    int delCmQualityShopType(CmQualityShopType cmQualityShopType);
+
+}

+ 2 - 0
src/main/java/com/caimei/modules/newhome/dao/NewPageHomeimageDao.java

@@ -24,4 +24,6 @@ public interface NewPageHomeimageDao extends CrudDao<NewPageHomeimage> {
     List<cmStatisticsType> getBannerStatistics(@Param("startPvCreateTime") Date startPvCreateTime, @Param("endPvCreateTime")Date endPvCreateTime);
 
     String findBigSort();
+
+    int getHomeimageCount(@Param("id")Integer id,@Param("bookStartDate")String bookStartDate,@Param("bookEndDate")String bookEndDate);
 }

+ 126 - 0
src/main/java/com/caimei/modules/newhome/entity/CmQualityShopType.java

@@ -0,0 +1,126 @@
+package com.caimei.modules.newhome.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+import lombok.Data;
+import lombok.experimental.Accessors;
+import org.apache.ibatis.type.Alias;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * cm_quality_shop_type
+ *
+ * @author Kaick
+ * @date 2024-01-25
+ */
+@Accessors(fluent = true )
+@Data
+@Alias("CmQualityShopType")
+public class CmQualityShopType extends DataEntity<CmQualityShopType> implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * id
+     */
+    private String id;
+
+    /**
+     * 分类名称
+     */
+    private String typeName;
+
+    /**
+     * 状态:
+     * 1上架,
+     * 0下架
+     */
+    private Integer status;
+
+    /**
+     * 排序
+     */
+    private Integer sort;
+
+    /**
+     * 删除状态 0正常,其他删除
+     */
+    private String delFlag;
+
+    /**
+     * 修改时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date updateTime;
+
+    /**
+     * 添加时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date createTime;
+
+    @Override
+    public String getId() {
+        return id;
+    }
+
+    @Override
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    @Override
+    public String getDelFlag() {
+        return delFlag;
+    }
+
+    @Override
+    public void setDelFlag(String delFlag) {
+        this.delFlag = delFlag;
+    }
+
+    public String getTypeName() {
+        return typeName;
+    }
+
+    public void setTypeName(String typeName) {
+        this.typeName = typeName;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Integer getSort() {
+        return sort;
+    }
+
+    public void setSort(Integer sort) {
+        this.sort = sort;
+    }
+
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+}
+
+
+

+ 110 - 4
src/main/java/com/caimei/modules/newhome/entity/NewPageHomeimage.java

@@ -1,10 +1,8 @@
 package com.caimei.modules.newhome.entity;
 
-import cn.hutool.core.date.DateUtil;
 import com.fasterxml.jackson.annotation.JsonFormat;
-import org.hibernate.validator.constraints.Length;
-
 import com.thinkgem.jeesite.common.persistence.DataEntity;
+import org.hibernate.validator.constraints.Length;
 
 import java.util.Date;
 
@@ -27,6 +25,36 @@ public class NewPageHomeimage extends DataEntity<NewPageHomeimage> {
 	private String crmEnabledStatus;		// CRM端状态 0停用 1启用
 	private Integer count;	// 点击次数
 
+	/** 商品Id */
+	private Integer productId;
+
+	/** 上架方式:1立即上架,2预约上架 */
+	private Integer bookStatus;
+
+	/** 预约上架时间 */
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+	private Date bookStartDate;
+
+	/** 预约下架时间 */
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+	private Date bookEndDate;
+
+	/** 审核状态:1待审核,2审核通过,3审核失败 */
+	private Integer auditStatus;
+
+	/** 审核时间 */
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+	private Date auditTime;
+
+	/** 审核失败理由 */
+	private String failReason;
+
+	/** 文章发布来源:1采美365网,2供应商 */
+	private Integer publishSource;
+	/** 供应商Id */
+	private Integer shopId;
+	/** 供应商名称 */
+	private String shopName;
 
 	//点击量统计
 	/** 开始点击量时间 */
@@ -45,7 +73,7 @@ public class NewPageHomeimage extends DataEntity<NewPageHomeimage> {
 	}
 
 	public Date getEndPvCreateTime() {
-		
+
 		return endPvCreateTime;
 	}
 
@@ -53,7 +81,85 @@ public class NewPageHomeimage extends DataEntity<NewPageHomeimage> {
 		this.endPvCreateTime = endPvCreateTime;
 	}
 
+	public Integer getShopId() {
+		return shopId;
+	}
+
+	public void setShopId(Integer shopId) {
+		this.shopId = shopId;
+	}
+
+	public String getShopName() {
+		return shopName;
+	}
+
+	public void setShopName(String shopName) {
+		this.shopName = shopName;
+	}
+
+	public Integer getProductId() {
+		return productId;
+	}
+
+	public void setProductId(Integer productId) {
+		this.productId = productId;
+	}
+
+	public Integer getBookStatus() {
+		return bookStatus;
+	}
+
+	public void setBookStatus(Integer bookStatus) {
+		this.bookStatus = bookStatus;
+	}
+
+	public Date getBookStartDate() {
+		return bookStartDate;
+	}
+
+	public void setBookStartDate(Date bookStartDate) {
+		this.bookStartDate = bookStartDate;
+	}
+
+	public Date getBookEndDate() {
+		return bookEndDate;
+	}
+
+	public void setBookEndDate(Date bookEndDate) {
+		this.bookEndDate = bookEndDate;
+	}
+
+	public Integer getAuditStatus() {
+		return auditStatus;
+	}
 
+	public void setAuditStatus(Integer auditStatus) {
+		this.auditStatus = auditStatus;
+	}
+
+	public Date getAuditTime() {
+		return auditTime;
+	}
+
+	public void setAuditTime(Date auditTime) {
+		this.auditTime = auditTime;
+	}
+
+	public String getFailReason() {
+		return failReason;
+	}
+
+	public void setFailReason(String failReason) {
+		this.failReason = failReason;
+	}
+
+	public Integer getPublishSource() {
+		return publishSource;
+	}
+
+	public void setPublishSource(Integer publishSource) {
+		this.publishSource = publishSource;
+	}
 
 	public NewPageHomeimage() {
 		super();

+ 68 - 10
src/main/java/com/caimei/modules/newhome/entity/NewPageQualitySupplier.java

@@ -1,8 +1,12 @@
 package com.caimei.modules.newhome.entity;
 
+import com.caimei.modules.user.entity.CmRelatedImage;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.thinkgem.jeesite.common.persistence.DataEntity;
 import org.hibernate.validator.constraints.Length;
 
-import com.thinkgem.jeesite.common.persistence.DataEntity;
+import java.util.Date;
+import java.util.List;
 
 /**
  * 优质供应商Entity
@@ -10,7 +14,7 @@ import com.thinkgem.jeesite.common.persistence.DataEntity;
  * @version 2019-03-18
  */
 public class NewPageQualitySupplier extends DataEntity<NewPageQualitySupplier> {
-	
+
 	private static final long serialVersionUID = 1L;
 	private String supplierName;		// 供应商名称
 	private String image;		// 供应商图片
@@ -18,7 +22,61 @@ public class NewPageQualitySupplier extends DataEntity<NewPageQualitySupplier> {
 	private String sort;		// 排序
 	private String wwwEnabledStatus;		// Pc端状态 0停用 1启用
 	private String crmEnabledStatus;		// CRM端状态 0停用 1启用
-	
+	private Integer shopTypeId;		//供应商分类Id
+
+	private List<CmRelatedImage> relatedImages;		//供应商分类Id
+
+
+	//点击量统计
+	/** 开始点击量时间 */
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+	private Date startPvCreateTime;
+	/** 结束点击量时间 */
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+	private Date endPvCreateTime;
+	/** 点击量*/
+	private Integer pv;
+
+	public List<CmRelatedImage> getRelatedImages() {
+		return relatedImages;
+	}
+
+	public void setRelatedImages(List<CmRelatedImage> relatedImages) {
+		this.relatedImages = relatedImages;
+	}
+
+	public Date getStartPvCreateTime() {
+		return startPvCreateTime;
+	}
+
+	public void setStartPvCreateTime(Date startPvCreateTime) {
+		this.startPvCreateTime = startPvCreateTime;
+	}
+
+	public Date getEndPvCreateTime() {
+		return endPvCreateTime;
+	}
+
+	public void setEndPvCreateTime(Date endPvCreateTime) {
+		this.endPvCreateTime = endPvCreateTime;
+	}
+
+	public Integer getPv() {
+		return pv;
+	}
+
+	public void setPv(Integer pv) {
+		this.pv = pv;
+	}
+
+	public Integer getShopTypeId() {
+		return shopTypeId;
+	}
+
+	public void setShopTypeId(Integer shopTypeId) {
+		this.shopTypeId = shopTypeId;
+	}
+
 	public NewPageQualitySupplier() {
 		super();
 	}
@@ -35,7 +93,7 @@ public class NewPageQualitySupplier extends DataEntity<NewPageQualitySupplier> {
 	public void setSupplierName(String supplierName) {
 		this.supplierName = supplierName;
 	}
-	
+
 	public String getImage() {
 		return image;
 	}
@@ -43,7 +101,7 @@ public class NewPageQualitySupplier extends DataEntity<NewPageQualitySupplier> {
 	public void setImage(String image) {
 		this.image = image;
 	}
-	
+
 	@Length(min=0, max=255, message="链接长度必须介于 0 和 255 之间")
 	public String getLink() {
 		return link;
@@ -52,7 +110,7 @@ public class NewPageQualitySupplier extends DataEntity<NewPageQualitySupplier> {
 	public void setLink(String link) {
 		this.link = link;
 	}
-	
+
 	@Length(min=0, max=11, message="排序长度必须介于 0 和 11 之间")
 	public String getSort() {
 		return sort;
@@ -61,7 +119,7 @@ public class NewPageQualitySupplier extends DataEntity<NewPageQualitySupplier> {
 	public void setSort(String sort) {
 		this.sort = sort;
 	}
-	
+
 	@Length(min=0, max=1, message="Pc端状态 0停用 1启用长度必须介于 0 和 1 之间")
 	public String getWwwEnabledStatus() {
 		return wwwEnabledStatus;
@@ -70,7 +128,7 @@ public class NewPageQualitySupplier extends DataEntity<NewPageQualitySupplier> {
 	public void setWwwEnabledStatus(String wwwEnabledStatus) {
 		this.wwwEnabledStatus = wwwEnabledStatus;
 	}
-	
+
 	@Length(min=0, max=1, message="CRM端状态 0停用 1启用长度必须介于 0 和 1 之间")
 	public String getCrmEnabledStatus() {
 		return crmEnabledStatus;
@@ -79,5 +137,5 @@ public class NewPageQualitySupplier extends DataEntity<NewPageQualitySupplier> {
 	public void setCrmEnabledStatus(String crmEnabledStatus) {
 		this.crmEnabledStatus = crmEnabledStatus;
 	}
-	
-}
+
+}

+ 94 - 0
src/main/java/com/caimei/modules/newhome/service/CmQualityShopTypeService.java

@@ -0,0 +1,94 @@
+package com.caimei.modules.newhome.service;
+
+import com.caimei.modules.newhome.dao.CmQualityShopTypeMapper;
+import com.caimei.modules.newhome.entity.CmQualityShopType;
+import com.thinkgem.jeesite.common.service.CrudService;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Service业务层处理
+ *
+ * @author Kaick
+ * @date 2024-01-25
+ */
+@Service
+public class CmQualityShopTypeService extends CrudService<CmQualityShopTypeMapper, CmQualityShopType> {
+    @Resource
+    private CmQualityShopTypeMapper cmQualityShopTypeMapper;
+
+    /**
+     * 查询列表
+     *
+     * @param cmQualityShopType
+     * @return
+     */
+
+    public List<CmQualityShopType> getCmQualityShopTypeList(CmQualityShopType cmQualityShopType) {
+        return cmQualityShopTypeMapper.getCmQualityShopTypeList(cmQualityShopType);
+    }
+
+    /**
+     * 通过Id查询
+     *
+     * @param id 主键
+     * @return
+     */
+
+    public CmQualityShopType getCmQualityShopTypeById(String id) {
+        return cmQualityShopTypeMapper.getCmQualityShopTypeById(id);
+    }
+
+    /**
+     * 查询
+     *
+     * @param cmQualityShopType
+     * @return
+     */
+
+    public CmQualityShopType getByCmQualityShopType(CmQualityShopType cmQualityShopType) {
+        return cmQualityShopTypeMapper.getByCmQualityShopType(cmQualityShopType);
+    }
+
+    /**
+     * 新增
+     *
+     * @param cmQualityShopType
+     * @return 结果
+     */
+    @Transactional(readOnly = false)
+    public int addCmQualityShopType(CmQualityShopType cmQualityShopType) {
+        cmQualityShopType.createTime(new Date());
+        return cmQualityShopTypeMapper.addCmQualityShopType(cmQualityShopType);
+    }
+
+    /**
+     * 修改
+     *
+     * @param cmQualityShopType
+     * @return 结果
+     */
+    @Transactional(readOnly = false)
+    public int updateCmQualityShopType(CmQualityShopType cmQualityShopType) {
+        cmQualityShopType.updateTime(new Date());
+        return cmQualityShopTypeMapper.updateCmQualityShopType(cmQualityShopType);
+    }
+
+
+    /**
+     * 删除信息
+     *
+     * @param id 主键
+     * @return 结果
+     */
+    @Transactional(readOnly = false)
+    public int delCmQualityShopTypeById(String id) {
+        return cmQualityShopTypeMapper.updateCmQualityShopType(new CmQualityShopType().id(id).delFlag("1"));
+    }
+
+}
+

+ 11 - 8
src/main/java/com/caimei/modules/newhome/service/NewPageHomeimageService.java

@@ -1,23 +1,21 @@
 package com.caimei.modules.newhome.service;
 
-import java.util.List;
-
 import com.caimei.dfs.image.beens.ImageUploadInfo;
 import com.caimei.modules.common.utils.UploadUtils;
+import com.caimei.modules.newhome.dao.NewPageHomeimageDao;
+import com.caimei.modules.newhome.entity.NewPageHomeimage;
 import com.caimei.modules.sys.utils.UploadImageUtils;
 import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.service.CrudService;
 import com.thinkgem.jeesite.common.utils.Encodes;
 import com.thinkgem.jeesite.common.utils.StringUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import com.thinkgem.jeesite.common.persistence.Page;
-import com.thinkgem.jeesite.common.service.CrudService;
-import com.caimei.modules.newhome.entity.NewPageHomeimage;
-import com.caimei.modules.newhome.dao.NewPageHomeimageDao;
-
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
+import java.util.List;
 
 /**
  * 新首页轮播图Service
@@ -60,12 +58,17 @@ public class NewPageHomeimageService extends CrudService<NewPageHomeimageDao, Ne
         super.save(newPageHomeimage);
     }
 
+    public int getHomeimageCount(Integer id,String bookStartDate,String bookEndDate) {
+       return newPageHomeimageDao.getHomeimageCount( id, bookStartDate, bookEndDate);
+    }
+
     @Transactional(readOnly = false)
     public void delete(NewPageHomeimage newPageHomeimage) {
         super.delete(newPageHomeimage);
     }
 
 
+
     public String saveImageToServer(String imagesHead, HttpServletRequest request) {
         String photoServer = Global.getConfig("photoServer");//获取文件服务器地址
         String res = "";
@@ -111,4 +114,4 @@ public class NewPageHomeimageService extends CrudService<NewPageHomeimageDao, Ne
     public String findBigSort() {
         return newPageHomeimageDao.findBigSort();
     }
-}
+}

+ 38 - 13
src/main/java/com/caimei/modules/newhome/service/NewPageQualitySupplierService.java

@@ -1,20 +1,21 @@
 package com.caimei.modules.newhome.service;
 
-import java.util.List;
-
 import com.caimei.modules.hehe.util.UploadPicUtils;
+import com.caimei.modules.newhome.dao.NewPageQualitySupplierDao;
+import com.caimei.modules.newhome.entity.NewPageQualitySupplier;
 import com.caimei.modules.newhome.entity.NewPageQualitySupplierImage;
+import com.caimei.modules.user.dao.CmRelatedImageMapper;
+import com.caimei.modules.user.entity.CmRelatedImage;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.service.CrudService;
 import com.thinkgem.jeesite.common.utils.StringUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
-
-import com.thinkgem.jeesite.common.persistence.Page;
-import com.thinkgem.jeesite.common.service.CrudService;
-import com.caimei.modules.newhome.entity.NewPageQualitySupplier;
-import com.caimei.modules.newhome.dao.NewPageQualitySupplierDao;
+import org.springframework.util.CollectionUtils;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
+import java.util.List;
 
 /**
  * 优质供应商Service
@@ -27,6 +28,8 @@ public class NewPageQualitySupplierService extends CrudService<NewPageQualitySup
 
 	@Resource
 	private NewPageQualitySupplierDao newPageQualitySupplierDao;
+	@Resource
+	private CmRelatedImageMapper cmRelatedImageMapper;
 
 
 	public NewPageQualitySupplier get(String id) {
@@ -40,19 +43,37 @@ public class NewPageQualitySupplierService extends CrudService<NewPageQualitySup
 	public List<NewPageQualitySupplier> findList(NewPageQualitySupplier newPageQualitySupplier) {
 		return super.findList(newPageQualitySupplier);
 	}
-	
+
 	public Page<NewPageQualitySupplier> findPage(Page<NewPageQualitySupplier> page, NewPageQualitySupplier newPageQualitySupplier) {
 		page.setOrderBy("sort");
 		return super.findPage(page, newPageQualitySupplier);
 	}
-	
+
 	@Transactional(readOnly = false)
 	public void save(NewPageQualitySupplier newPageQualitySupplier, HttpServletRequest request) {
-		if(null != newPageQualitySupplier.getImage() && !"".equals(newPageQualitySupplier.getImage())){
+		if (null != newPageQualitySupplier.getImage() && !"".equals(newPageQualitySupplier.getImage())) {
 			String img = UploadPicUtils.saveImageToServer(newPageQualitySupplier.getImage());
 			newPageQualitySupplier.setImage(img);
 		}
+		if (StringUtils.isNotBlank(newPageQualitySupplier.getId())) {
+			cmRelatedImageMapper.delCmRelatedImage(new CmRelatedImage()
+					.type("5")
+					.authorId(newPageQualitySupplier.getId())
+			);
+		}
 		super.save(newPageQualitySupplier);
+		List<CmRelatedImage> relatedImages = newPageQualitySupplier.getRelatedImages();
+		if (!CollectionUtils.isEmpty(relatedImages)) {
+			for (CmRelatedImage s : relatedImages) {
+				if (StringUtils.isBlank(s.getImage())) {
+					continue;
+				}
+				s.setType("5");
+				s.setAuthorId(newPageQualitySupplier.getId());
+				s.image(UploadPicUtils.saveImageToServer(s.image()));
+				cmRelatedImageMapper.addCmRelatedImage(s);
+			}
+		}
 	}
 
 	@Transactional(readOnly = false)
@@ -79,10 +100,14 @@ public class NewPageQualitySupplierService extends CrudService<NewPageQualitySup
 		}
 
 	}
-	
+
 	@Transactional(readOnly = false)
 	public void delete(NewPageQualitySupplier newPageQualitySupplier) {
 		super.delete(newPageQualitySupplier);
+		cmRelatedImageMapper.delCmRelatedImage(new CmRelatedImage()
+				.type("5")
+				.authorId(newPageQualitySupplier.getId())
+		);
 	}
-	
-}
+
+}

+ 115 - 0
src/main/java/com/caimei/modules/newhome/web/CmQualityShopTypeController.java

@@ -0,0 +1,115 @@
+package com.caimei.modules.newhome.web;
+
+import com.caimei.modules.newhome.entity.CmQualityShopType;
+import com.caimei.modules.newhome.service.CmQualityShopTypeService;
+import com.google.common.collect.Maps;
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.utils.StringUtils;
+import com.thinkgem.jeesite.common.web.BaseController;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Date;
+import java.util.Map;
+
+/**
+ * 功能描述: 优质供应商
+ *
+ * @auther: Kaick
+ * @date: 2023/7/13 16:15
+ */
+
+@Controller
+@RequestMapping("${adminPath}/qualityShopType")
+public class CmQualityShopTypeController extends BaseController {
+
+    @Resource
+    private CmQualityShopTypeService cmQualityShopTypeService;
+
+    /**
+     * 查询供应商分类列表
+     */
+    @RequestMapping(value = {"list", ""})
+    public String list(CmQualityShopType cmQualityShopType, HttpServletRequest request, HttpServletResponse response, Model model) {
+        Page<CmQualityShopType> page = cmQualityShopTypeService.findPage(new Page<CmQualityShopType>(request, response), cmQualityShopType);
+        model.addAttribute("page", page);
+        return "modules/newhome/qualityShopTypeList";
+    }
+
+
+    /**
+     * 获取供应商分类详细信息
+     */
+    @RequestMapping(value = "form")
+    public String form(CmQualityShopType cmQualityShopType, Model model) {
+        CmQualityShopType cmQualityShopTypeById = cmQualityShopTypeService.getCmQualityShopTypeById(cmQualityShopType.getId());
+        model.addAttribute("cmQualityShopType",cmQualityShopTypeById==null?new CmQualityShopType():cmQualityShopTypeById );
+        return "modules/newhome/qualityShopTypeFrom";
+    }
+
+    /**
+     * 新增修改供应商分类
+     */
+    @RequestMapping(value = "save")
+    public String save(CmQualityShopType cmQualityShopType, Model model, RedirectAttributes redirectAttributes, HttpServletRequest request) {
+        if (StringUtils.isBlank(cmQualityShopType.getId())) {
+            cmQualityShopType.createTime(new Date());
+            cmQualityShopTypeService.addCmQualityShopType(cmQualityShopType);
+            addMessage(redirectAttributes, "保存供应商分类成功");
+        } else {
+            cmQualityShopType.updateTime(new Date());
+            cmQualityShopTypeService.updateCmQualityShopType(cmQualityShopType);
+            addMessage(redirectAttributes, "修改供应商分类成功");
+        }
+        return "redirect:" + Global.getAdminPath() + "/qualityShopType/list";
+    }
+
+    /**
+     * 删除供应商分类
+     */
+    @RequestMapping(value = "del/{id}")
+    public String delete(@PathVariable String id, RedirectAttributes redirectAttributes) {
+        cmQualityShopTypeService.delCmQualityShopTypeById(id);
+        addMessage(redirectAttributes, "删除供应商分类成功");
+        return "redirect:" + Global.getAdminPath() + "/qualityShopType/list" ;
+    }
+
+    /**
+     * 功能描述:修改供应商分类状态
+     *
+     * @param cmQualityShopType
+     * @param request
+     * @param response
+     * @return [cmQualityShopType, request, response]
+     * @auther: Kaick
+     * @date: 2023/7/13 16:14
+     */
+    @ResponseBody
+    @RequestMapping(value = "updateStatus")
+    public Map<String, Object> updateEnabledStatus(CmQualityShopType cmQualityShopType, HttpServletRequest request, HttpServletResponse response) {
+        Map<String, Object> map = Maps.newLinkedHashMap();
+        try {
+            //封装数据
+            cmQualityShopTypeService.updateCmQualityShopType(new CmQualityShopType()
+                    .id(cmQualityShopType.id())
+                    .status(cmQualityShopType.status())
+                    .sort(cmQualityShopType.sort())
+            );
+            map.put("success", true);
+            map.put("msg", "修改成功");
+        } catch (Exception e) {
+            logger.debug(e.toString(), e);
+            map.put("success", false);
+            map.put("msg", "修改失败");
+        }
+        return map;
+    }
+
+
+}

+ 39 - 21
src/main/java/com/caimei/modules/newhome/web/NewPageHomeimageController.java

@@ -26,6 +26,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
@@ -49,9 +50,6 @@ public class NewPageHomeimageController extends BaseController {
     @Resource
     private GenerateUtils generateUtils;
 
-
-
-
     @ModelAttribute
     public NewPageHomeimage get(@RequestParam(required = false) String id) {
         NewPageHomeimage entity = null;
@@ -83,6 +81,7 @@ public class NewPageHomeimageController extends BaseController {
             }
         }
         model.addAttribute("page", page);
+        model.addAttribute("publishSource", newPageHomeimage.getPublishSource());
         return "modules/newhome/newPageHomeimageList";
     }
 
@@ -108,21 +107,42 @@ public class NewPageHomeimageController extends BaseController {
         if (!beanValidator(model, newPageHomeimage)) {
             return form(newPageHomeimage, model);
         }
+        if (null != newPageHomeimage.getBookStatus()) {
+            if (1 == newPageHomeimage.getBookStatus()) {
+                newPageHomeimage.setBookStartDate(new Date());
+            } else {
+                newPageHomeimage.setWwwEnabledStatus("2");
+                newPageHomeimage.setCrmEnabledStatus("2");
+            }
+        }
+        if (null != newPageHomeimage.getAuditStatus() && 2 == newPageHomeimage.getAuditStatus()) {
+            newPageHomeimage.setAuditTime(new Date());
+        }
         newPageHomeimageService.save(newPageHomeimage, request);
         cleanRedisCache(null);
         //清除首页轮播图缓存
         redisService.remove("getHomeBanners::www");
         addMessage(redirectAttributes, "保存新首页轮播图成功");
-        return "redirect:" + Global.getAdminPath() + "/newhome/newPageHomeimage/?repage";
+        return "redirect:" + Global.getAdminPath() + "/newhome/newPageHomeimage/?publishSource=" + newPageHomeimage.getPublishSource();
     }
 
     @RequiresPermissions("newhome:newPageHomeimage:edit")
     @ResponseBody
     @RequestMapping(value = "updateEnabledStatus")
-    public Map<String, Object> updateEnabledStatus(String enabledStatus, String[] ids, String[] supplierIDs, HttpServletRequest request, HttpServletResponse response) {
+    public Map<String, Object> updateEnabledStatus(String enabledStatus, String id, Integer bookStatus, Date bookStartDate, Date bookEndDate, HttpServletRequest request, HttpServletResponse response) {
         Map<String, Object> map = Maps.newLinkedHashMap();
         try {
-            newPageHomeimageService.updateEnabledStatusByIds(enabledStatus, ids);
+            enabledStatus = 2 == bookStatus ? "2" : enabledStatus;
+            NewPageHomeimage newPageHomeimage = new NewPageHomeimage();
+            newPageHomeimage.setId(id);
+            newPageHomeimage.setWwwEnabledStatus(enabledStatus);
+            newPageHomeimage.setCrmEnabledStatus(enabledStatus);
+            if (!"0".equals(enabledStatus)) {
+                newPageHomeimage.setBookStatus(bookStatus);
+                newPageHomeimage.setBookStartDate(bookStatus == 1 ? new Date() : bookStartDate);
+                newPageHomeimage.setBookEndDate(bookEndDate);
+            }
+            newPageHomeimageService.updateStatusByIds(newPageHomeimage);
             cleanRedisCache(null);
             map.put("success", true);
             map.put("msg", "修改成功");
@@ -136,34 +156,32 @@ public class NewPageHomeimageController extends BaseController {
         return map;
     }
 
-    @RequiresPermissions("newhome:newPageHomeimage:edit")
+
+    @RequiresPermissions("newhome:newPageHomeimage:delete")
+    @RequestMapping(value = "delete")
+    public String delete(NewPageHomeimage newPageHomeimage, RedirectAttributes redirectAttributes) {
+        newPageHomeimageService.delete(newPageHomeimage);
+        addMessage(redirectAttributes, "删除新首页轮播图成功");
+        return "redirect:" + Global.getAdminPath() + "/newhome/newPageHomeimage/?publishSource=" + newPageHomeimage.getPublishSource();
+    }
+
     @ResponseBody
-    @RequestMapping(value = "updateCrmEnabledStatusByIds")
-    public Map<String, Object> updateCrmEnabledStatusByIds(String crmEnabledStatus, String[] ids, String[] supplierIDs, HttpServletRequest request, HttpServletResponse response) {
+    @RequestMapping(value = "isHomeimageStatus")
+    public Map<String, Object> isHomeimageStatus(Integer id, Integer publishSource, String bookStartDate, String bookEndDate) {
         Map<String, Object> map = Maps.newLinkedHashMap();
         try {
-            newPageHomeimageService.updateCrmEnabledStatusByIds(crmEnabledStatus, ids);
-            cleanRedisCache(null);
+            int homeimageCount = newPageHomeimageService.getHomeimageCount(id, StringUtils.isBlank(bookStartDate) ? cn.hutool.core.date.DateUtil.formatDate(new Date()) : bookStartDate, bookEndDate);
             map.put("success", true);
+            map.put("isHomeimageStatus", publishSource == 1 ? homeimageCount < 11 : homeimageCount < 10);
             map.put("msg", "修改成功");
         } catch (Exception e) {
             logger.debug(e.toString(), e);
             map.put("success", false);
             map.put("msg", "修改失败");
         }
-		//清除首页轮播图缓存
-		redisService.remove("getHomeBanners::www");
         return map;
     }
 
-    @RequiresPermissions("newhome:newPageHomeimage:delete")
-    @RequestMapping(value = "delete")
-    public String delete(NewPageHomeimage newPageHomeimage, RedirectAttributes redirectAttributes) {
-        newPageHomeimageService.delete(newPageHomeimage);
-        addMessage(redirectAttributes, "删除新首页轮播图成功");
-        return "redirect:" + Global.getAdminPath() + "/newhome/newPageHomeimage/?repage";
-    }
-
     /**
      * 有数据变动时需要清除缓存
      */

+ 29 - 26
src/main/java/com/caimei/modules/newhome/web/NewPageQualitySupplierController.java

@@ -1,16 +1,17 @@
 package com.caimei.modules.newhome.web;
 
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import com.caimei.constants.common.RedisKeyUtil;
+import com.caimei.modules.newhome.entity.NewPageQualitySupplier;
 import com.caimei.modules.newhome.entity.NewPageQualitySupplierImage;
+import com.caimei.modules.newhome.service.NewPageQualitySupplierService;
 import com.caimei.modules.opensearch.GenerateUtils;
-import com.caimei.modules.product.entity.CmBigtype;
+import com.caimei.modules.user.dao.CmRelatedImageMapper;
+import com.caimei.modules.user.entity.CmRelatedImage;
 import com.caimei.redis.RedisService;
 import com.google.common.collect.Maps;
-import org.apache.commons.collections.CollectionUtils;
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.utils.StringUtils;
+import com.thinkgem.jeesite.common.web.BaseController;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
@@ -20,14 +21,9 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
-import com.thinkgem.jeesite.common.config.Global;
-import com.thinkgem.jeesite.common.persistence.Page;
-import com.thinkgem.jeesite.common.web.BaseController;
-import com.thinkgem.jeesite.common.utils.StringUtils;
-import com.caimei.modules.newhome.entity.NewPageQualitySupplier;
-import com.caimei.modules.newhome.service.NewPageQualitySupplierService;
-
-import java.util.List;
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import java.util.Map;
 import java.util.regex.Pattern;
 
@@ -43,17 +39,24 @@ public class NewPageQualitySupplierController extends BaseController {
 	@Resource
 	private NewPageQualitySupplierService newPageQualitySupplierService;
 	@Resource
+	private CmRelatedImageMapper cmRelatedImageMapper;
+	@Resource
 	private RedisService redisService;
-    @Resource
-    private GenerateUtils generateUtils;
-	
-	
-	
+	@Resource
+	private GenerateUtils generateUtils;
+
+
 	@ModelAttribute
-	public NewPageQualitySupplier get(@RequestParam(required=false) String id) {
+	public NewPageQualitySupplier get(@RequestParam(required = false) String id) {
 		NewPageQualitySupplier entity = null;
-		if (StringUtils.isNotBlank(id)){
+		if (StringUtils.isNotBlank(id)) {
 			entity = newPageQualitySupplierService.get(id);
+			if (entity != null) {
+				entity.setRelatedImages(cmRelatedImageMapper.getCmRelatedImageList(new CmRelatedImage()
+						.type("5")
+						.authorId(id)
+				));
+			}
 		}
 		if (entity == null){
 			entity = new NewPageQualitySupplier();
@@ -163,13 +166,13 @@ public class NewPageQualitySupplierController extends BaseController {
 	@RequiresPermissions("newhome:newPageQualitySupplier:edit")
 	@RequestMapping(value = "save")
 	public String save(NewPageQualitySupplier newPageQualitySupplier,HttpServletRequest request, Model model, RedirectAttributes redirectAttributes) {
-		if (!beanValidator(model, newPageQualitySupplier)){
+		if (!beanValidator(model, newPageQualitySupplier)) {
 			return form(newPageQualitySupplier, model);
 		}
-		newPageQualitySupplierService.save(newPageQualitySupplier,request);
+		newPageQualitySupplierService.save(newPageQualitySupplier, request);
 		cleanRedisCache();
 		addMessage(redirectAttributes, "保存优质供应商成功");
-		return "redirect:"+Global.getAdminPath()+"/newhome/newPageQualitySupplier/?repage";
+		return "redirect:" + Global.getAdminPath() + "/newhome/newPageQualitySupplier/?shopTypeId=" + newPageQualitySupplier.getShopTypeId();
 	}
 
 	@RequiresPermissions("newhome:newPageQualitySupplier:delete")
@@ -178,7 +181,7 @@ public class NewPageQualitySupplierController extends BaseController {
 		newPageQualitySupplierService.delete(newPageQualitySupplier);
 		cleanRedisCache();
 		addMessage(redirectAttributes, "删除优质供应商成功");
-		return "redirect:"+Global.getAdminPath()+"/newhome/newPageQualitySupplier/?repage";
+		return "redirect:" + Global.getAdminPath() + "/newhome/newPageQualitySupplier/?shopTypeId=" + newPageQualitySupplier.getShopTypeId();
 	}
 	@RequiresPermissions("newhome:newPageHomeimage:edit")
 	@ResponseBody

+ 81 - 0
src/main/java/com/caimei/modules/user/dao/CmUserPowerMapper.java

@@ -0,0 +1,81 @@
+package com.caimei.modules.user.dao;
+
+import com.caimei.modules.user.entity.CmUserPower;
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+
+import java.util.List;
+
+/**
+ * 用户权限Mapper接口
+ *
+ * @author Kaick
+ * @date 2024-01-26
+ */
+@MyBatisDao
+public interface CmUserPowerMapper extends CrudDao<CmUserPower>
+{
+    /**
+     * 查询用户权限列表
+     *
+     * @param cmUserPower 用户权限
+     * @return 用户权限集合
+     */
+    List<CmUserPower> getCmUserPowerList(CmUserPower cmUserPower);
+    /**
+     * 查询用户权限列表
+     *
+     * @param cmUserPower 用户权限
+     * @return 用户权限集合
+     */
+    List<Integer> getUserPowers(CmUserPower cmUserPower);
+
+    /**
+     * 通过Id查询用户权限
+     *
+     * @param id 用户权限主键
+     * @return 用户权限
+     */
+    CmUserPower getCmUserPowerById(String id);
+
+    /**
+     * 查询用户权限
+     *
+     * @param cmUserPower 用户权限
+     * @return 用户权限
+     */
+    CmUserPower getByCmUserPower(CmUserPower cmUserPower);
+
+                                                            /**
+     * 新增用户权限
+     *
+     * @param cmUserPower 用户权限
+     * @return 结果
+     */
+    int addCmUserPower(CmUserPower cmUserPower);
+
+    /**
+     * 修改用户权限
+     *
+     * @param cmUserPower 用户权限
+     * @return 结果
+     */
+    int updateCmUserPower(CmUserPower cmUserPower);
+
+    /**
+     * 删除用户权限
+     *
+     * @param id 用户权限主键
+     * @return 结果
+     */
+    int delCmUserPowerById(String id);
+
+    /**
+     * 批量删除用户权限
+     *
+     * @param 需要删除的数据主键集合
+     * @return 结果
+     */
+    int delCmUserPower(CmUserPower cmUserPower);
+
+}

+ 61 - 19
src/main/java/com/caimei/modules/user/entity/CmRelatedImage.java

@@ -1,12 +1,12 @@
 package com.caimei.modules.user.entity;
 
-import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
-import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.thinkgem.jeesite.common.persistence.DataEntity;
 import lombok.Data;
 import lombok.experimental.Accessors;
 import org.apache.ibatis.type.Alias;
-import com.fasterxml.jackson.annotation.JsonFormat;
+
+import java.io.Serializable;
 import java.util.Date;
 
 /**
@@ -15,36 +15,62 @@ import java.util.Date;
  * @author Kaick
  * @date 2023-09-20
  */
-@Accessors(fluent  = true )
+@Accessors(fluent = true)
 @Data
 @Alias("CmRelatedImage")
-public class CmRelatedImage implements Serializable
-{
+public class CmRelatedImage extends DataEntity<CmRelatedImage> implements Serializable {
     private static final long serialVersionUID = 1L;
 
-    /** id */
+    /**
+     * id
+     */
     private String id;
 
-    /** 分类:1分销报备凭证图片(cm_reporting_member) */
+    /**
+     * 分类:1分销报备凭证图片(cm_reporting_member)
+     * ,2 (cm_providers)服务商相关简介图
+     * ,3 (cm_providers)服务商相关资料文件
+     * ,4 (cm_providers_contract)服务商相关合同文件
+     */
     private String type;
 
-    /** 归属者Id(type字段表Id) */
+    /**
+     * 归属者Id(type字段表Id)
+     */
     private String authorId;
 
-    /** 图片 */
+    /**
+     * 原文件名
+     */
+    private String fileName;
+
+    /**
+     * 图片
+     */
     private String image;
 
-    /** 删除状态 0正常,其他删除 */
-    private Integer delFlag;
+    /**
+     * 删除状态 0正常,其他删除
+     */
+    private String delFlag;
 
-    /** 修改时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    /**
+     * 修改时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date updateTime;
 
-    /** 添加时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    /**
+     * 添加时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date createTime;
 
+    /**
+     * 图片跳转链接
+     */
+    private String jumpLink;
+
     public String getId() {
         return id;
     }
@@ -69,6 +95,14 @@ public class CmRelatedImage implements Serializable
         this.authorId = authorId;
     }
 
+    public String getFileName() {
+        return fileName;
+    }
+
+    public void setFileName(String fileName) {
+        this.fileName = fileName;
+    }
+
     public String getImage() {
         return image;
     }
@@ -77,11 +111,11 @@ public class CmRelatedImage implements Serializable
         this.image = image;
     }
 
-    public Integer getDelFlag() {
+    public String getDelFlag() {
         return delFlag;
     }
 
-    public void setDelFlag(Integer delFlag) {
+    public void setDelFlag(String delFlag) {
         this.delFlag = delFlag;
     }
 
@@ -100,5 +134,13 @@ public class CmRelatedImage implements Serializable
     public void setCreateTime(Date createTime) {
         this.createTime = createTime;
     }
+
+    public String getJumpLink() {
+        return jumpLink;
+    }
+
+    public void setJumpLink(String jumpLink) {
+        this.jumpLink = jumpLink;
+    }
 }
 

+ 109 - 0
src/main/java/com/caimei/modules/user/entity/CmUserPower.java

@@ -0,0 +1,109 @@
+package com.caimei.modules.user.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+import lombok.Data;
+import lombok.experimental.Accessors;
+import org.apache.ibatis.type.Alias;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 用户权限 cm_user_power
+ *
+ * @author Kaick
+ * @date 2024-01-26
+ */
+@Accessors(fluent = true)
+@Data
+@Alias("CmUserPower")
+public class CmUserPower extends DataEntity<CmUserPower> implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * id
+     */
+    private String id;
+
+    /**
+     * 用户Id
+     */
+    private Integer userId;
+
+    /**
+     * 用户权限:1 首页广告
+     * ,2 信息中心左侧广告
+     * ,3 信息中心右上广告
+     * ,4 信息中心右下广告
+     */
+    private Integer power;
+
+    /**
+     * 删除状态 0正常,其他删除
+     */
+    private String delFlag;
+
+    /**
+     * 修改时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date updateTime;
+
+    /**
+     * 添加时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date createTime;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public Integer getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
+    public Integer getPower() {
+        return power;
+    }
+
+    public void setPower(Integer power) {
+        this.power = power;
+    }
+
+    public String getDelFlag() {
+        return delFlag;
+    }
+
+    public void setDelFlag(String delFlag) {
+        this.delFlag = delFlag;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+}
+
+
+

+ 109 - 0
src/main/java/com/caimei/modules/user/service/CmUserPowerService.java

@@ -0,0 +1,109 @@
+package com.caimei.modules.user.service;
+
+import com.caimei.modules.user.dao.CmUserPowerMapper;
+import com.caimei.modules.user.entity.CmUserPower;
+import com.thinkgem.jeesite.common.service.CrudService;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 用户权限Service业务层处理
+ *
+ * @author Kaick
+ * @date 2024-01-26
+ */
+@Service
+public class CmUserPowerService extends CrudService<CmUserPowerMapper, CmUserPower> {
+    @Resource
+    private CmUserPowerMapper cmUserPowerMapper;
+
+    /**
+     * 查询用户权限列表
+     *
+     * @param cmUserPower 用户权限
+     * @return 用户权限
+     */
+
+    public List<CmUserPower> getCmUserPowerList(CmUserPower cmUserPower) {
+        return cmUserPowerMapper.getCmUserPowerList(cmUserPower);
+    }
+
+    public List<Integer> getUserPowers(CmUserPower cmUserPower) {
+        return cmUserPowerMapper.getUserPowers(cmUserPower);
+    }
+
+    /**
+     * 通过Id查询用户权限
+     *
+     * @param id 用户权限主键
+     * @return 用户权限
+     */
+
+    public CmUserPower getCmUserPowerById(String id) {
+        return cmUserPowerMapper.getCmUserPowerById(id);
+    }
+
+    /**
+     * 查询用户权限
+     *
+     * @param cmUserPower 用户权限
+     * @return 用户权限
+     */
+
+    public CmUserPower getByCmUserPower(CmUserPower cmUserPower) {
+        return cmUserPowerMapper.getByCmUserPower(cmUserPower);
+    }
+
+    /**
+     * 新增用户权限
+     *
+     * @param cmUserPower 用户权限
+     * @return 结果
+     */
+    @Transactional(readOnly = false )
+    public int addCmUserPower(CmUserPower cmUserPower) {
+        cmUserPower.setCreateTime(new Date());
+        return cmUserPowerMapper.addCmUserPower(cmUserPower);
+    }
+
+    /**
+     * 修改用户权限
+     *
+     * @param cmUserPower 用户权限
+     * @return 结果
+     */
+    @Transactional(readOnly = false)
+    public int updateCmUserPower(CmUserPower cmUserPower) {
+        cmUserPower.setUpdateTime(new Date());
+        return cmUserPowerMapper.updateCmUserPower(cmUserPower);
+    }
+
+
+    /**
+     * 删除用户权限信息
+     *
+     * @param id 用户权限主键
+     * @return 结果
+     */
+    @Transactional(readOnly = false)
+    public int delCmUserPowerById(String id) {
+        return cmUserPowerMapper.updateCmUserPower(new CmUserPower().id(id).delFlag("1"));
+        //return cmUserPowerMapper.delCmUserPowerById(id);
+    }
+
+    /**
+     * 删除用户权限信息
+     *
+     * @return 结果
+     */
+    @Transactional(readOnly = false)
+    public int delCmUserPower(CmUserPower cmUserPower) {
+        return cmUserPowerMapper.delCmUserPower(cmUserPower);
+    }
+
+}
+

+ 42 - 3
src/main/java/com/caimei/modules/user/web/NewCmShopController.java

@@ -1,6 +1,6 @@
 package com.caimei.modules.user.web;
 
-import com.caimei.constants.ShopStatus;
+import com.alibaba.fastjson.JSON;
 import com.caimei.modules.opensearch.CoreServiceUitls;
 import com.caimei.modules.order.dao.NewShopOrderDao;
 import com.caimei.modules.order.entity.CmDiscernReceipt;
@@ -13,8 +13,6 @@ import com.caimei.modules.user.dao.MessageCenterDao;
 import com.caimei.modules.user.dao.NewCmShopDao;
 import com.caimei.modules.user.entity.*;
 import com.caimei.modules.user.service.*;
-import com.caimei.utils.AppKeys;
-import com.caimei.utils.DateUtils;
 import com.caimei.utils.MD5Util;
 import com.caimei.vo.JsonModel;
 import com.google.common.collect.Maps;
@@ -77,6 +75,8 @@ public class NewCmShopController extends BaseController {
     @Resource
     private NewShopOrderDao newShopOrderDao;
     @Resource
+    private CmUserPowerService cmUserPowerService;
+    @Resource
     private WeChatService weChatService;
 
     @ModelAttribute
@@ -899,4 +899,43 @@ public class NewCmShopController extends BaseController {
         return jsonModel.success(Global.getAdminPath() + "/user/newCmShop/?repage");
     }
 
+    @ResponseBody
+    @RequestMapping(value = "updateUserPower")
+    public Map<String, Object> updateCrmEnabledStatusByIds(Integer userId,Integer[] powers) {
+        Map<String, Object> map = Maps.newLinkedHashMap();
+        try {
+            if (null == userId || null == powers) {
+                throw new NullPointerException("参数异常!");
+            }
+            cmUserPowerService.delCmUserPower(new CmUserPower().userId(userId));
+            for (Integer power : powers) {
+                if (null != power) {
+                    cmUserPowerService.addCmUserPower(new CmUserPower().userId(userId).power(power));
+                }
+            }
+            map.put("success", true);
+            map.put("msg", "修改成功");
+        } catch (Exception e) {
+            logger.debug(e.toString(), e);
+            map.put("success", false);
+            map.put("msg", "修改失败");
+        }
+        return map;
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "getUserPower")
+    public Map<String, Object> updateCrmEnabledStatusByIds(Integer userId) {
+        Map<String, Object> map = Maps.newLinkedHashMap();
+        try {
+            map.put("success", true);
+            map.put("data", cmUserPowerService.getUserPowers(new CmUserPower().userId(userId)));
+            map.put("msg", "修改成功");
+        } catch (Exception e) {
+            logger.debug(e.toString(), e);
+            map.put("success", false);
+            map.put("msg", "修改失败");
+        }
+        return map;
+    }
 }

+ 46 - 48
src/main/java/com/caimei/modules/utils/MessageUtil.java

@@ -7,12 +7,10 @@ import com.caimei.modules.utils.message.WechatTemplateMessage;
 import com.caimei.modules.utils.message.enums.MessageType;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.thinkgem.jeesite.common.config.Global;
-import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.HashMap;
-import java.util.Map;
+import java.util.ArrayList;
 
 public class MessageUtil {
     protected static Logger logger = LoggerFactory.getLogger(MessageUtil.class);
@@ -42,55 +40,55 @@ public class MessageUtil {
         // keyWords.add("2023-06-10");
         // keyWords.add("2023-06-10");
         // keyWords.add("2023-06-10");
-        Map<String,Object> keyWords = new HashMap<>();
-        keyWords.put("character_string3","2023-06-10");
-        keyWords.put("time10","2023-06-10");
-        keyWords.put("thing9","2023-06-10");
-        keyWords.put("character_string8","2023-06-10");
+        // Map<String,Object> keyWords = new HashMap<>();
+        // keyWords.put("character_string3","2023-06-10");
+        // keyWords.put("time10","2023-06-10");
+        // keyWords.put("thing9","2023-06-10");
+        // keyWords.put("character_string8","2023-06-10");
+        // MessageModel<WechatTemplateMessage> wechatTemplateMessageMessageModel = new MessageModel<WechatTemplateMessage>()
+        //         .code(MessageType.WECHAT_TEMPLATE_MESSAGE)
+        //         .mqInfo(new MqInfo().topic("MessageLine").delay(3).async(1))
+        //         .info(new WechatTemplateMessage()
+        //                 .type("2")
+        //                 .templateType("2")
+        //                 .first("hgfhfgh")
+        //                 .openId("oIsyY5njDnjzjR8nghD0axsw34t8")
+        //                 .appid("wx2c3b0a7f343235b1")
+        //                 .templateId("0Ruf-Ypu0Eahk0vY9orVN0-QqE0auk2N89LqjtGq4p8")
+        //                 // .keyWords(keyWords)
+        //                 .mapKeyWords(keyWords)
+        //                 .remark("个地方刚发的")
+        //                 .pagePath("pages/views/order/order-detail?orderId="+18691)
+        //         );
+        // String join = StringUtils.join(wechatTemplateMessageMessageModel.getInfo().getKeyWords(), ",");
+        // if(join.contains("},{")){
+        //     join = join.replace("},{", ",");
+        // }
+        // JSONObject jsonObject = JSONObject.parseObject(join);
+        //         System.out.println(jsonObject);
+        // sendMessage(wechatTemplateMessageMessageModel);
+
+        //微信模板消息
+        ArrayList<String> keyWords = new ArrayList<>();
+        keyWords.add("name"+"...等"+7+"家机构客户");
+        keyWords.add("pageLabel");
+        keyWords.add("2023-09-18");
         MessageModel<WechatTemplateMessage> wechatTemplateMessageMessageModel = new MessageModel<WechatTemplateMessage>()
                 .code(MessageType.WECHAT_TEMPLATE_MESSAGE)
-                .mqInfo(new MqInfo().topic("MessageLine").delay(3).async(1))
+                .mqInfo(new MqInfo().topic("MessageLine").delay(3).async(0))
                 .info(new WechatTemplateMessage()
-                        .type("2")
-                        .templateType("2")
-                        .first("hgfhfgh")
-                        .openId("oIsyY5njDnjzjR8nghD0axsw34t8")
-                        .appid("wx2c3b0a7f343235b1")
-                        .templateId("0Ruf-Ypu0Eahk0vY9orVN0-QqE0auk2N89LqjtGq4p8")
-                        // .keyWords(keyWords)
-                        .mapKeyWords(keyWords)
-                        .remark("个地方刚发的")
-                        .pagePath("pages/views/order/order-detail?orderId="+18691)
-                );
-        String join = StringUtils.join(wechatTemplateMessageMessageModel.getInfo().getKeyWords(), ",");
-        if(join.contains("},{")){
-            join = join.replace("},{", ",");
-        }
-        JSONObject jsonObject = JSONObject.parseObject(join);
-                System.out.println(jsonObject);
+                        // .type("2")
+                        .first("ewrwerwer")
+                       .openId("o9nzn5yD6IOcFuhG4b3OG1droVJw")
+//                        .openId("o9nzn51aTKY5u26FDoD5zf0wU6UM")
+//                         .openId("o9nzn581OysHNNsDwJJlzKpWoQ4o")
+                        .appid("wxf3cd4ae0cdd11c36")
+                        .templateId("Zd7ewJw9-bN-gIgra9flKW96W3YehikRPPkDXPfhmQ0")
+                        .keyWords(keyWords)
+                        .remark("为了更好给您服务,请及时联系采美客服!")
+                        .pagePath("pages/seller/notice/service/Institutional_visits?spId="+1340+"&accDateTime="+"2023-09-18"));
+//                        .pagePath("pages/seller/notice/service/visits_details?spId="+1340+"&clubId="+"99930"+"&accessTime="+"2023-09-18"));
         sendMessage(wechatTemplateMessageMessageModel);
-
-//         //微信模板消息
-//         ArrayList<String> keyWords = new ArrayList<>();
-//         keyWords.add("name"+"...等"+7+"家机构客户");
-//         keyWords.add("pageLabel");
-//         keyWords.add("2023-09-18");
-//         MessageModel<WechatTemplateMessage> wechatTemplateMessageMessageModel = new MessageModel<WechatTemplateMessage>()
-//                 .code(MessageType.WECHAT_TEMPLATE_MESSAGE)
-//                 .mqInfo(new MqInfo().topic("MessageLine").delay(3).async(0))
-//                 .info(new WechatTemplateMessage()
-//                         // .type("2")
-//                         .first("")
-//                        .openId("o9nzn5yD6IOcFuhG4b3OG1droVJw")
-// //                        .openId("o9nzn51aTKY5u26FDoD5zf0wU6UM")
-// //                         .openId("o9nzn581OysHNNsDwJJlzKpWoQ4o")
-//                         .appid("wxf3cd4ae0cdd11c36")
-//                         .templateId("Zd7ewJw9-bN-gIgra9flKW96W3YehikRPPkDXPfhmQ0")
-//                         .keyWords(keyWords)
-//                         .remark("为了更好给您服务,请及时联系采美客服!")
-//                         .pagePath("pages/seller/notice/service/Institutional_visits?spId="+1340+"&accDateTime="+"2023-09-18"));
-// //                        .pagePath("pages/seller/notice/service/visits_details?spId="+1340+"&clubId="+"99930"+"&accessTime="+"2023-09-18"));
-//         sendMessage(wechatTemplateMessageMessageModel);
 //        //站内信
 //        MessageModel<InsideMessage> insideMessageMessageModel = new MessageModel<>();
 //        insideMessageMessageModel.code(MessageType.WEB_INSIDE_MESSAGE)

+ 35 - 3
src/main/resources/mappings/modules/baike/CmBaikeProductMapper.xml

@@ -39,6 +39,7 @@
 		a.failReason,
 		a.addTime AS "addTime",
 		a.recommendType,
+		a.autoStatus,
 		cbt.name as "typeName",
 		a.labelIds as "labelIds",
 		a.relatedLabels as "labelStr"
@@ -60,12 +61,30 @@
     <select id="findList" resultType="CmBaikeProduct">
         SELECT
         <include refid="cmBaikeProductColumns"/>
+        ,ifnull(ii.type,0) as includedStatus
         FROM cm_baike_product 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="cmBaikeProductJoins"/>
+        left join info_included ii on ii.infoId = a.id and ii.type = 2
         <where>
-            delFlag = 0
-            <if test="id != null and id != ''">
-                AND a.id = #{id}
+            a.delFlag = 0
+            <if test="null !=cmRelatedType and cmRelatedType != ''">
+                and cm_related.relatedId is null
+            </if>
+            <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="name != null and name != ''">
                 AND a.name LIKE
@@ -76,6 +95,14 @@
             <if test="typeId != null and typeId != ''">
                 AND a.typeId = #{typeId}
             </if>
+            <if test="includedStatus != null ">
+                <if test="includedStatus != 0 ">
+                    AND ii.infoId is not null
+                </if>
+                <if test="includedStatus == 0 ">
+                    AND ii.infoId is null
+                </if>
+            </if>
             <if test="topFlag != null">
                 <choose>
                     <when test='topFlag == 1'>
@@ -336,6 +363,11 @@
         set topPosition = #{topPosition}
         where id = #{id}
     </update>
+    <update id="updateAutoStatus">
+        update cm_baike_product
+        set autoStatus = #{autoStatus}
+        where id = #{id}
+    </update>
     <update id="auditBaike">
         update cm_baike_product
         set auditStatus = #{auditStatus},

+ 10 - 0
src/main/resources/mappings/modules/info/InfoMapper.xml

@@ -278,11 +278,13 @@
     <select id="findList" resultType="Info">
         SELECT
         <include refid="infoColumns"/>
+        ,ifnull(ii.type,0) as includedStatus
         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"/>
+        left join info_included ii on ii.infoId = a.id and ii.type = 1
         <where>
             a.delFlag = 0
             <if test="id != null  and id != ''">
@@ -306,6 +308,14 @@
             <if test="null !=cmRelatedType and cmRelatedType != ''">
                   and cm_related.relatedId is null
             </if>
+            <if test="includedStatus != null ">
+                <if test="includedStatus != 0 ">
+                    AND ii.infoId is not null
+                </if>
+                <if test="includedStatus == 0 ">
+                    AND ii.infoId is null
+                </if>
+            </if>
             <if test="title != null and title != ''">
                 AND a.title LIKE concat('%',#{title},'%')
             </if>

+ 45 - 2
src/main/resources/mappings/modules/landing/CmBrandLandingMapper.xml

@@ -50,8 +50,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                a.appStatus,
                a.delFlag,
                a.updateTime,
-               a.addTime
-
+               a.addTime,
+               a.productId,
+               a.bookStatus,
+               a.bookStartDate,
+               a.bookEndDate,
+               a.auditStatus,
+               a.auditTime,
+               a.failReason,
+               a.publishSource
     </sql>
 
     <select id="selectCmBrandLandingList" parameterType="CmBrandLanding" resultMap="CmBrandLandingResult">
@@ -81,6 +88,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="delFlag != null "> and delFlag = #{delFlag}</if>
             <if test="updateTime != null "> and updateTime = #{updateTime}</if>
             <if test="addTime != null "> and addTime = #{addTime}</if>
+            <if test="publishSource != null "> and publishSource = #{publishSource}</if>
+
         </where>
         order by sort desc
     </select>
@@ -111,6 +120,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="delFlag != null "> and delFlag = #{delFlag}</if>
             <if test="updateTime != null "> and updateTime = #{updateTime}</if>
             <if test="addTime != null "> and addTime = #{addTime}</if>
+            <if test="publishSource != null "> and publishSource = #{publishSource}</if>
         </where>
         order by pcStatus desc, sort desc ,addTime desc
     </select>
@@ -162,6 +172,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="findBigSort" resultType="java.lang.String">
         SELECT sort FROM cm_brand_landing ORDER BY sort DESC LIMIT 1
     </select>
+
+    <select id="getLandingCount" resultType="int">
+        SELECT count(1)
+        FROM cm_brand_landing
+        where auditStatus=2 and pcStatus!=0 and appStatus!=0
+        AND bookStartDate <![CDATA[ >= ]]> #{bookStartDate}  AND bookEndDate <![CDATA[ <= ]]> #{bookEndDate}
+        <if test="type != null"> and type =#{type}</if>
+        <if test="id != null"> and id !=#{id}</if>
+    </select>
     <update id="updateSort">
         update cm_brand_landing set sort=#{sort}
         where id= #{id}
@@ -189,6 +208,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="delFlag != null">delFlag,</if>
             <if test="updateTime != null">updateTime,</if>
             <if test="addTime != null">addTime,</if>
+            <if test="productId != null">productId,</if>
+            <if test="bookStatus != null">bookStatus,</if>
+            <if test="bookStartDate != null">bookStartDate,</if>
+            <if test="bookEndDate != null">bookEndDate,</if>
+            <if test="auditStatus != null">auditStatus,</if>
+            <if test="auditTime != null">auditTime,</if>
+            <if test="failReason != null and failReason != ''">failReason,</if>
+            <if test="publishSource != null">publishSource,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="authUserId != null">#{authUserId},</if>
@@ -211,6 +238,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="delFlag != null">#{delFlag},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="addTime != null">#{addTime},</if>
+            <if test="productId != null">#{productId},</if>
+            <if test="bookStatus != null">#{bookStatus},</if>
+            <if test="bookStartDate != null">#{bookStartDate},</if>
+            <if test="bookEndDate != null">#{bookEndDate},</if>
+            <if test="auditStatus != null">#{auditStatus},</if>
+            <if test="auditTime != null">#{auditTime},</if>
+            <if test="failReason != null and failReason != ''">#{failReason},</if>
+            <if test="publishSource != null">#{publishSource},</if>
          </trim>
     </insert>
 
@@ -237,6 +272,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="delFlag != null">delFlag = #{delFlag},</if>
             <if test="updateTime != null">updateTime = #{updateTime},</if>
             <if test="addTime != null">addTime = #{addTime},</if>
+            <if test="productId != null">productId = #{productId},</if>
+            <if test="bookStatus != null">bookStatus = #{bookStatus},</if>
+            <if test="bookStartDate != null">bookStartDate = #{bookStartDate},</if>
+            <if test="bookEndDate != null">bookEndDate = #{bookEndDate},</if>
+            <if test="auditStatus != null">auditStatus = #{auditStatus},</if>
+            <if test="auditTime != null">auditTime = #{auditTime},</if>
+            <if test="failReason != null and failReason != ''">failReason = #{failReason},</if>
+            <if test="publishSource != null">publishSource = #{publishSource},</if>
         </trim>
         where id = #{id}
     </update>

+ 140 - 0
src/main/resources/mappings/modules/newhome/CmQualityShopTypeMapper.xml

@@ -0,0 +1,140 @@
+<?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.newhome.dao.CmQualityShopTypeMapper">
+
+    <resultMap type="CmQualityShopType" id="CmQualityShopTypeResult">
+        <result property="id"    column="id"    />
+        <result property="typeName"    column="typeName"    />
+        <result property="status"    column="status"    />
+        <result property="sort"    column="sort"    />
+        <result property="delFlag"    column="delFlag"    />
+        <result property="updateTime"    column="updateTime"    />
+        <result property="createTime"    column="createTime"    />
+    </resultMap>
+
+    <sql id="selectCmQualityShopTypeVo">
+        select
+            cm_quality_shop_type.id,
+            cm_quality_shop_type.typeName,
+            cm_quality_shop_type.status,
+            cm_quality_shop_type.sort,
+            cm_quality_shop_type.delFlag,
+            cm_quality_shop_type.updateTime,
+            cm_quality_shop_type.createTime
+    </sql>
+
+    <select id="get" parameterType="CmQualityShopType" resultMap="CmQualityShopTypeResult">
+        <include refid="selectCmQualityShopTypeVo"/>
+        from cm_quality_shop_type AS cm_quality_shop_type
+        <where>  cm_quality_shop_type.delFlag = 0
+            <if test="id != null  and id != ''"> and cm_quality_shop_type.id = #{id}</if>
+            <if test="typeName != null  and typeName != ''"> and cm_quality_shop_type.typeName like concat('%', #{typeName}, '%')</if>
+            <if test="status != null "> and cm_quality_shop_type.status = #{status}</if>
+            <if test="sort != null "> and cm_quality_shop_type.sort = #{sort}</if>
+        </where>
+        group by cm_quality_shop_type.id
+        limit 0,1
+    </select>
+
+    <select id="getByCmQualityShopType" parameterType="CmQualityShopType" resultMap="CmQualityShopTypeResult">
+        <include refid="selectCmQualityShopTypeVo"/>
+        from cm_quality_shop_type AS cm_quality_shop_type
+        <where>  cm_quality_shop_type.delFlag = 0
+            <if test="id != null  and id != ''"> and cm_quality_shop_type.id = #{id}</if>
+            <if test="typeName != null  and typeName != ''"> and cm_quality_shop_type.typeName like concat('%', #{typeName}, '%')</if>
+            <if test="status != null "> and cm_quality_shop_type.status = #{status}</if>
+            <if test="sort != null "> and cm_quality_shop_type.sort = #{sort}</if>
+        </where>
+        group by cm_quality_shop_type.id
+        limit 0,1
+    </select>
+
+    <select id="getCmQualityShopTypeList" parameterType="CmQualityShopType" resultMap="CmQualityShopTypeResult">
+        <include refid="selectCmQualityShopTypeVo"/>
+        from cm_quality_shop_type AS cm_quality_shop_type
+        <where>  cm_quality_shop_type.delFlag = 0
+            <if test="id != null  and id != ''"> and cm_quality_shop_type.id = #{id}</if>
+            <if test="typeName != null  and typeName != ''"> and cm_quality_shop_type.typeName like concat('%', #{typeName}, '%')</if>
+            <if test="status != null "> and cm_quality_shop_type.status = #{status}</if>
+            <if test="sort != null "> and cm_quality_shop_type.sort = #{sort}</if>
+        </where>
+        group by cm_quality_shop_type.id
+        order by cm_quality_shop_type.createTime desc
+    </select>
+
+    <select id="findList" parameterType="CmQualityShopType" resultMap="CmQualityShopTypeResult">
+        <include refid="selectCmQualityShopTypeVo"/>
+        from cm_quality_shop_type AS cm_quality_shop_type
+        <where>  cm_quality_shop_type.delFlag = 0
+            <if test="id != null  and id != ''"> and cm_quality_shop_type.id = #{id}</if>
+            <if test="typeName != null  and typeName != ''"> and cm_quality_shop_type.typeName like concat('%', #{typeName}, '%')</if>
+            <if test="status != null "> and cm_quality_shop_type.status = #{status}</if>
+            <if test="sort != null "> and cm_quality_shop_type.sort = #{sort}</if>
+        </where>
+        group by cm_quality_shop_type.id
+        order by cm_quality_shop_type.createTime desc
+    </select>
+
+
+    <select id="getCmQualityShopTypeById" parameterType="String" resultMap="CmQualityShopTypeResult">
+        <include refid="selectCmQualityShopTypeVo"/>
+        from cm_quality_shop_type AS cm_quality_shop_type
+        where  cm_quality_shop_type.delFlag = 0 and cm_quality_shop_type.id = #{id}
+    </select>
+
+
+
+    <insert id="addCmQualityShopType" parameterType="CmQualityShopType" useGeneratedKeys="true" keyProperty="id">
+        insert into cm_quality_shop_type
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null and id != ''">id,</if>
+            <if test="typeName != null and typeName != ''">typeName,</if>
+            <if test="status != null">status,</if>
+            <if test="sort != null">sort,</if>
+            <if test="delFlag != null">delFlag,</if>
+            <if test="updateTime != null">updateTime,</if>
+            <if test="createTime != null">createTime,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null and id != ''">#{id},</if>
+            <if test="typeName != null and typeName != ''">#{typeName},</if>
+            <if test="status != null">#{status},</if>
+            <if test="sort != null">#{sort},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="createTime != null">#{createTime},</if>
+        </trim>
+    </insert>
+
+    <update id="updateCmQualityShopType" parameterType="CmQualityShopType">
+        update cm_quality_shop_type
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="typeName != null and typeName != ''">typeName = #{typeName},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="sort != null">sort = #{sort},</if>
+            <if test="delFlag != null">delFlag = #{delFlag},</if>
+            <if test="updateTime != null">updateTime = #{updateTime},</if>
+            <if test="createTime != null">createTime = #{createTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="delCmQualityShopTypeById" parameterType="String">
+        delete
+        from cm_quality_shop_type where id = #{id}
+    </delete>
+
+    <delete id="delCmQualityShopType" parameterType="CmQualityShopType">
+        delete
+        from cm_quality_shop_type AS cm_quality_shop_type
+        <where>
+            <if test="id != null  and id != ''"> and cm_quality_shop_type.id = #{id}</if>
+            <if test="typeName != null  and typeName != ''"> and cm_quality_shop_type.typeName like concat('%', #{typeName}, '%')</if>
+            <if test="status != null "> and cm_quality_shop_type.status = #{status}</if>
+            <if test="sort != null "> and cm_quality_shop_type.sort = #{sort}</if>
+        </where>
+    </delete>
+
+</mapper>

+ 59 - 2
src/main/resources/mappings/modules/newhome/NewPageHomeimageMapper.xml

@@ -16,7 +16,16 @@
 		a.createBy AS "createBy.id",
 		a.createDate AS "createDate",
 		a.updateBy AS "updateBy.id",
-		a.updateDate AS "updateDate"
+		a.updateDate AS "updateDate",
+        a.productId,
+        a.bookStatus,
+        a.bookStartDate,
+        a.bookEndDate,
+        a.auditStatus,
+        a.auditTime,
+        a.failReason,
+        a.shopId,
+        a.publishSource
     </sql>
 
     <select id="get" resultType="NewPageHomeimage">
@@ -28,8 +37,9 @@
 
     <select id="findList" resultType="NewPageHomeimage">
         SELECT
-        <include refid="newPageHomeimageColumns"/>
+        <include refid="newPageHomeimageColumns"/>,s.name as shopName
         FROM new_page_homeimage a
+        left join shop s on s.shopID=a.shopId
         <where>
             <if test="id != null and id != ''">
                 AND a.id = #{id}
@@ -46,6 +56,9 @@
             <if test="crmEnabledStatus != null and crmEnabledStatus != ''">
                 AND a.crmEnabledStatus = #{crmEnabledStatus}
             </if>
+            <if test="publishSource != null and publishSource != ''">
+                AND a.publishSource = #{publishSource}
+            </if>
         </where>
         ORDER BY a.sort desc,a.createDate desc
     </select>
@@ -79,6 +92,14 @@
         LIMIT 1
     </select>
 
+    <select id="getHomeimageCount" resultType="int">
+        SELECT count(1)
+        FROM new_page_homeimage
+        where auditStatus=2 and wwwEnabledStatus!=0 and crmEnabledStatus!=0
+        AND bookStartDate <![CDATA[ >= ]]> #{bookStartDate}  AND bookEndDate <![CDATA[ <= ]]> #{bookEndDate}
+        <if test="id != null"> and id !=#{id}</if>
+    </select>
+
     <insert id="insert" parameterType="NewPageHomeimage" keyProperty="id" useGeneratedKeys="true">
         INSERT INTO new_page_homeimage(
         title,
@@ -94,6 +115,14 @@
         crmEnabledStatus,
         createBy,
         createDate,
+        <if test="productId != null">productId,</if>
+        <if test="bookStatus != null">bookStatus,</if>
+        <if test="bookStartDate != null">bookStartDate,</if>
+        <if test="bookEndDate != null">bookEndDate,</if>
+        <if test="auditStatus != null">auditStatus,</if>
+        <if test="auditTime != null">auditTime,</if>
+        <if test="failReason != null and failReason != ''">failReason,</if>
+        <if test="publishSource != null">publishSource,</if>
         updateBy,
         updateDate
         ) VALUES (
@@ -110,6 +139,14 @@
         #{crmEnabledStatus},
         #{createBy.id},
         #{createDate},
+        <if test="productId != null">#{productId},</if>
+        <if test="bookStatus != null">#{bookStatus},</if>
+        <if test="bookStartDate != null">#{bookStartDate},</if>
+        <if test="bookEndDate != null">#{bookEndDate},</if>
+        <if test="auditStatus != null">#{auditStatus},</if>
+        <if test="auditTime != null">#{auditTime},</if>
+        <if test="failReason != null and failReason != ''">#{failReason},</if>
+        <if test="publishSource != null">#{publishSource},</if>
         #{updateBy.id},
         #{updateDate}
         )
@@ -129,6 +166,14 @@
             createBy         = #{createBy.id},
             createDate       = #{createDate},
             updateBy         = #{updateBy.id},
+        <if test="productId != null">productId = #{productId},</if>
+        <if test="bookStatus != null">bookStatus = #{bookStatus},</if>
+        <if test="bookStartDate != null">bookStartDate = #{bookStartDate},</if>
+        <if test="bookEndDate != null">bookEndDate = #{bookEndDate},</if>
+        <if test="auditStatus != null">auditStatus = #{auditStatus},</if>
+        <if test="auditTime != null">auditTime = #{auditTime},</if>
+        <if test="failReason != null and failReason != ''">failReason = #{failReason},</if>
+        <if test="publishSource != null">publishSource = #{publishSource},</if>
             updateDate       = #{updateDate}
         WHERE id = #{id}
     </update>
@@ -160,4 +205,16 @@
         set sort=#{sort}
         where id = #{id}
     </update>
+    <update id="updateStatusByIds">
+        update new_page_homeimage
+        set
+            <if test="wwwEnabledStatus != 0">
+            bookStartDate = #{bookStartDate},
+            bookEndDate = #{bookEndDate},
+            bookStatus = #{bookStatus},
+            </if>
+            wwwEnabledStatus=#{wwwEnabledStatus},
+            crmEnabledStatus=#{crmEnabledStatus}
+        where id = #{id}
+    </update>
 </mapper>

+ 19 - 12
src/main/resources/mappings/modules/newhome/NewPageQualitySupplierMapper.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.newhome.dao.NewPageQualitySupplierDao">
-    
+
 	<sql id="newPageQualitySupplierColumns">
 		a.id AS "id",
 		a.supplierName AS "supplierName",
@@ -15,6 +15,7 @@
 		a.updateBy AS "updateBy.id",
 		a.updateDate AS "updateDate",
 		a.delFlag AS "delFlag"
+		,a.shopTypeId
 	</sql>
 
 	<select id="getImage" resultType="NewPageQualitySupplierImage">
@@ -24,18 +25,22 @@
 	</select>
 
 	<select id="get" resultType="NewPageQualitySupplier">
-		SELECT 
+		SELECT
 			<include refid="newPageQualitySupplierColumns"/>
 		FROM new_page_quality_supplier a
 		WHERE a.id = #{id}
 	</select>
-	
+
 	<select id="findList" resultType="NewPageQualitySupplier">
-		SELECT 
+		SELECT
 			<include refid="newPageQualitySupplierColumns"/>
+		,IFNULL((select sum(c.pv) from cm_praise_statistics c where  c.delFlag = 0 and c.type = 7 and a.id = c.authorId  <if test="startPvCreateTime != null ">AND c.createTime >= #{startPvCreateTime} </if><if test="endPvCreateTime != null ">AND c.createTime <![CDATA[ <= ]]> #{endPvCreateTime} </if>), 0) as pv
+
 		FROM new_page_quality_supplier a
 		<where>
 			and a.delFlag = 0
+			<if test="shopTypeId != null "> and a.shopTypeId = #{shopTypeId}</if>
+
 		</where>
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
@@ -45,14 +50,14 @@
 			</otherwise>
 		</choose>
 	</select>
-	
+
 	<select id="findAllList" resultType="NewPageQualitySupplier">
-		SELECT 
+		SELECT
 			<include refid="newPageQualitySupplierColumns"/>
 		FROM new_page_quality_supplier a
 		<where>
-			
-		</where>		
+
+		</where>
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
 				ORDER BY ${page.orderBy}
@@ -61,7 +66,7 @@
 			</otherwise>
 		</choose>
 	</select>
-	
+
 	<insert id="insert" parameterType="NewPageQualitySupplier"  keyProperty="id" useGeneratedKeys="true">
 		INSERT INTO new_page_quality_supplier(
 			supplierName,
@@ -77,6 +82,7 @@
 			updateBy,
 			updateDate,
 			delFlag
+		    ,shopTypeId
 		) VALUES (
 			#{supplierName},
 			#{image},
@@ -91,6 +97,7 @@
 			#{updateBy.id},
 			#{updateDate},
 			#{delFlag}
+			,#{shopTypeId}
 		)
 	</insert>
 
@@ -119,9 +126,9 @@
 		WHERE id = #{id}
 	</update>
 
-	
+
 	<update id="update">
-		UPDATE new_page_quality_supplier SET 	
+		UPDATE new_page_quality_supplier SET
 			supplierName = #{supplierName},
 			image = #{image},
 			link = #{link},
@@ -164,4 +171,4 @@
             #{id}
         </foreach>
     </update>
-</mapper>
+</mapper>

+ 7 - 0
src/main/resources/mappings/modules/user/CmRelatedImageMapper.xml

@@ -23,6 +23,7 @@
 			cm_related_image.delFlag,
 			cm_related_image.updateTime,
 			cm_related_image.createTime
+			,cm_related_image.jumpLink
 	</sql>
 
 	<select id="getByCmRelatedImage" parameterType="com.caimei.modules.user.entity.CmRelatedImage" resultMap="CmRelatedImageResult">
@@ -231,19 +232,23 @@
 			<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="fileName != null and fileName != ''">fileName,</if>
 			<if test="image != null and image != ''">image,</if>
 			<if test="delFlag != null">delFlag,</if>
 			<if test="updateTime != null">updateTime,</if>
 			<if test="createTime != null">createTime,</if>
+			<if test="jumpLink != null and jumpLink != ''">jumpLink,</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="fileName != null and fileName != ''">#{fileName},</if>
 			<if test="image != null and image != ''">#{image},</if>
 			<if test="delFlag != null">#{delFlag},</if>
 			<if test="updateTime != null">#{updateTime},</if>
 			<if test="createTime != null">#{createTime},</if>
+			<if test="jumpLink != null and jumpLink != ''">#{jumpLink},</if>
 		</trim>
 	</insert>
 
@@ -252,10 +257,12 @@
 		<trim prefix="SET" suffixOverrides=",">
 			<if test="type != null and type != ''">type = #{type},</if>
 			<if test="authorId != null and authorId != ''">authorId = #{authorId},</if>
+			<if test="fileName != null and fileName != ''">fileName = #{fileName},</if>
 			<if test="image != null and image != ''">image = #{image},</if>
 			<if test="delFlag != null">delFlag = #{delFlag},</if>
 			<if test="updateTime != null">updateTime = #{updateTime},</if>
 			<if test="createTime != null">createTime = #{createTime},</if>
+			<if test="jumpLink != null and jumpLink != ''">jumpLink = #{jumpLink},</if>
 		</trim>
 		where id = #{id}
 	</update>

+ 117 - 0
src/main/resources/mappings/modules/user/CmUserPowerMapper.xml

@@ -0,0 +1,117 @@
+<?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.user.dao.CmUserPowerMapper">
+
+	<resultMap type="CmUserPower" id="CmUserPowerResult">
+		<result property="id"    column="id"    />
+		<result property="userId"    column="userId"    />
+		<result property="power"    column="power"    />
+		<result property="delFlag"    column="delFlag"    />
+		<result property="updateTime"    column="updateTime"    />
+		<result property="createTime"    column="createTime"    />
+	</resultMap>
+
+	<sql id="selectCmUserPowerVo">
+		select
+			cm_user_power.id,
+			cm_user_power.userId,
+			cm_user_power.power,
+			cm_user_power.delFlag,
+			cm_user_power.updateTime,
+			cm_user_power.createTime
+	</sql>
+
+	<select id="getByCmUserPower" parameterType="CmUserPower" resultMap="CmUserPowerResult">
+		<include refid="selectCmUserPowerVo"/>
+		from cm_user_power AS cm_user_power
+		<where>  cm_user_power.delFlag = 0
+			<if test="id != null  and id != ''"> and cm_user_power.id = #{id}</if>
+			<if test="userId != null "> and cm_user_power.userId = #{userId}</if>
+			<if test="power != null "> and cm_user_power.power = #{power}</if>
+		</where>
+
+		limit 0,1
+	</select>
+
+	<select id="getCmUserPowerList" parameterType="CmUserPower" resultMap="CmUserPowerResult">
+		<include refid="selectCmUserPowerVo"/>
+		from cm_user_power AS cm_user_power
+		<where>  cm_user_power.delFlag = 0
+			<if test="id != null  and id != ''"> and cm_user_power.id = #{id}</if>
+			<if test="userId != null "> and cm_user_power.userId = #{userId}</if>
+			<if test="power != null "> and cm_user_power.power = #{power}</if>
+		</where>
+
+		order by cm_user_power.createTime desc
+	</select>
+	<select id="getUserPowers" parameterType="CmUserPower" resultType="int">
+		select   cm_user_power.power
+		from cm_user_power AS cm_user_power
+		<where>  cm_user_power.delFlag = 0
+			<if test="id != null  and id != ''"> and cm_user_power.id = #{id}</if>
+			<if test="userId != null "> and cm_user_power.userId = #{userId}</if>
+			<if test="power != null "> and cm_user_power.power = #{power}</if>
+		</where>
+
+		order by cm_user_power.createTime desc
+	</select>
+
+
+	<select id="getCmUserPowerById" parameterType="String" resultMap="CmUserPowerResult">
+		<include refid="selectCmUserPowerVo"/>
+		from cm_user_power AS cm_user_power
+		where  cm_user_power.delFlag = 0 and cm_user_power.id = #{id}
+	</select>
+
+
+
+	<insert id="addCmUserPower" parameterType="CmUserPower" useGeneratedKeys="true" keyProperty="id">
+		insert into cm_user_power
+		<trim prefix="(" suffix=")" suffixOverrides=",">
+			<if test="id != null and id != ''">id,</if>
+			<if test="userId != null">userId,</if>
+			<if test="power != null">power,</if>
+			<if test="delFlag != null">delFlag,</if>
+			<if test="updateTime != null">updateTime,</if>
+			<if test="createTime != null">createTime,</if>
+		</trim>
+		<trim prefix="values (" suffix=")" suffixOverrides=",">
+			<if test="id != null and id != ''">#{id},</if>
+			<if test="userId != null">#{userId},</if>
+			<if test="power != null">#{power},</if>
+			<if test="delFlag != null">#{delFlag},</if>
+			<if test="updateTime != null">#{updateTime},</if>
+			<if test="createTime != null">#{createTime},</if>
+		</trim>
+	</insert>
+
+	<update id="updateCmUserPower" parameterType="CmUserPower">
+		update cm_user_power
+		<trim prefix="SET" suffixOverrides=",">
+			<if test="userId != null">userId = #{userId},</if>
+			<if test="power != null">power = #{power},</if>
+			<if test="delFlag != null">delFlag = #{delFlag},</if>
+			<if test="updateTime != null">updateTime = #{updateTime},</if>
+			<if test="createTime != null">createTime = #{createTime},</if>
+		</trim>
+		where id = #{id}
+	</update>
+
+	<delete id="delCmUserPowerById" parameterType="String">
+		delete
+		from cm_user_power where id = #{id}
+	</delete>
+
+	<delete id="delCmUserPower" parameterType="CmUserPower">
+		delete
+		from cm_user_power AS cm_user_power
+		<where>
+			<if test="id != null  and id != ''"> and cm_user_power.id = #{id}</if>
+			<if test="userId != null "> and cm_user_power.userId = #{userId}</if>
+			<if test="power != null "> and cm_user_power.power = #{power}</if>
+		</where>
+	</delete>
+
+</mapper>

+ 135 - 0
src/main/webapp/WEB-INF/views/modules/baikePage/addBaikeForm.jsp

@@ -0,0 +1,135 @@
+<%@ 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'); //只能输入两个小数
+		}
+
+
+
+		$(document).ready(function () {
+		})
+
+	</script>
+</head>
+<body>
+<form:form id="searchForm" modelAttribute="cmBaikeProduct" action="${ctx}/baike/cmBaikeProduct/findBaikePage" 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}"/>
+	<form:hidden path="cmRelatedType"/>
+	<div class="ul-form">
+		<br>
+		<input type="radio" name="publishSource"
+			   value="1" ${empty cmBaikeProduct.publishSource?'checked=checked':cmBaikeProduct.publishSource eq 1?'checked=checked':''} >采美词条
+		<input type="radio" name="publishSource" value="2" ${cmBaikeProduct.publishSource eq 2?'checked=checked':''}>供应商词条
+		<br>
+		<br>
+		<label>ID:</label>
+		<form:input path="id" htmlEscape="false" maxlength="11" class="input-mini"/>
+		<label>标题:</label>
+		<form:input path="name" htmlEscape="false" maxlength="100" class="input-medium"/>
+		<label>发布人:</label>
+		<label>产品分类:</label>
+		<form:select path="typeId" class="input-medium">
+			<form:option value="" label="全部"/>
+			<form:options items="${typeList}" itemLabel="name" itemValue="id" htmlEscape="false"/>
+		</form:select>
+		<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>
+	</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.name}</td>
+				<td>${item.typeName}</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>

+ 13 - 3
src/main/webapp/WEB-INF/views/modules/baikePage/cmBaikeProductList.jsp

@@ -16,7 +16,7 @@
 	</style>
 	<script type="text/javascript">
 		$(document).ready(function() {
-			
+
 		});
 		function page(n,s){
 			$("#pageNo").val(n);
@@ -52,6 +52,12 @@
 					<form:option value="" label="全部"/>
 					<form:options items="${typeList}" itemLabel="name" itemValue="id" htmlEscape="false"/>
 				</form:select>
+			 <label>百度收录状态:</label>
+				<form:select path="includedStatus" class="input-medium">
+					<form:option value="" label="全部"/>
+					<form:option value="1" label="已收录"/>
+					<form:option value="0" label="审核中"/>
+				</form:select>
 			 <label>状态:</label>
 				<form:select path="status" class="input-medium">
 					<form:option value="" label="全部"/>
@@ -75,6 +81,7 @@
 <%--				<th>首页置顶位</th>--%>
 				<th>发布时间</th>
 				<th>添加时间</th>
+				<th>百度收录状态</th>
 				<th>状态</th>
 				<th>操作</th>
 			</tr>
@@ -106,6 +113,7 @@
 				<td>
 					<fmt:formatDate value="${cmBaikeProduct.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
 				</td>
+				<td>${cmBaikeProduct.includedStatus==0?"审核中":'<font color="green">已收录</font>'}</td>
 				<td>
 					<c:if test="${cmBaikeProduct.status eq 1 }">
 						<font color="green">已发布</font>
@@ -124,7 +132,9 @@
 					<a target="_blank" href="${fns:getConfig('wwwServer')}encyclopedia/detail-${cmBaikeProduct.id}.html">查看</a>
     				<a href="${ctx}/baike/cmBaikeProduct/form?id=${cmBaikeProduct.id}&entryId=2">编辑</a>
 					<a href="${ctx}/baike/cmBaikeProduct/delete?id=${cmBaikeProduct.id}" onclick="return confirmx('确认要删除该产品吗?', this.href)">删除</a>
-<%--					<a onclick="showTopSelect(${index.index},'open')" href="javascript:void(0)">首页置顶</a>--%>
+					<a style="white-space: nowrap" href="${ctx}/baike/cmBaikeProduct/relatedForm?id=${cmBaikeProduct.id}&ltype=3">相关阅读</a>
+
+				<%--					<a onclick="showTopSelect(${index.index},'open')" href="javascript:void(0)">首页置顶</a>--%>
 <%--					<c:if test="${cmBaikeProduct.topPosition ne null}">--%>
 <%--						<a onclick="updateTopPosition('','${cmBaikeProduct.id}','clearTopPosition')" href="javascript:void(0)">清除置顶</a>--%>
 <%--					</c:if>--%>
@@ -233,4 +243,4 @@
 	}
 </script>
 </body>
-</html>
+</html>

+ 8 - 0
src/main/webapp/WEB-INF/views/modules/baikePage/shopBaikeProductList.jsp

@@ -62,6 +62,12 @@
 					<form:option value="2" label="已上线"/>
 					<form:option value="3" label="已下线"/>
 				</form:select>
+			<label>百度收录状态:</label>
+			<form:select path="includedStatus" class="input-medium">
+				<form:option value="" label="全部"/>
+				<form:option value="1" label="已收录"/>
+				<form:option value="0" label="审核中"/>
+			</form:select>
 			&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
 			<div class="clearfix"></div>
 		</div>
@@ -78,6 +84,7 @@
 				<th>上线状态</th>
 				<th>发布时间</th>
 				<th>供应商</th>
+				<th>百度收录状态</th>
 				<th>添加时间</th>
 				<th>供应商状态</th>
 				<th>操作</th>
@@ -115,6 +122,7 @@
 				<td>
 					${cmBaikeProduct.shopName}
 				</td>
+				<td>${cmBaikeProduct.includedStatus==0?"审核中":'<font color="green">已收录</font>'}</td>
 				<td>
 					<fmt:formatDate value="${cmBaikeProduct.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
 				</td>

+ 9 - 1
src/main/webapp/WEB-INF/views/modules/info/infoList.jsp

@@ -260,6 +260,12 @@
 			<form:options items="${fns:getDictList('enabled_status')}" itemLabel="label" itemValue="value"
 						  htmlEscape="false"/>
 		</form:select>
+		<label>百度收录状态:</label>
+		<form:select path="includedStatus" class="input-medium">
+			<form:option value="" label="全部"/>
+			<form:option value="1" label="已收录"/>
+			<form:option value="0" label="审核中"/>
+		</form:select>
 		<label>状态:</label>
 		<form:select path="enabledStatus" class="input-mini">
 			<form:option value="" label=" "/>
@@ -300,7 +306,8 @@
 				<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>
@@ -337,6 +344,7 @@
 				</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>${info.includedStatus==0?"审核中":'<font color="green">已收录</font>'}</td>
 <%--				<td>--%>
 <%--					<c:if test="${info.recommendStatus eq 1 }">--%>
 <%--						<a href="javascript:void(0);" onclick="updateStatus('0','${info.id}','recommendStatus','${info.enabledStatus}');" >--%>

+ 97 - 52
src/main/webapp/WEB-INF/views/modules/info/infoRelatedForm.jsp

@@ -60,25 +60,30 @@
 </head>
 <body>
 <ul class="nav nav-tabs">
-	<li><a href="${ctx}/info/info/">文章列表</a></li>
+	<c:if test="${ltype eq 1 }">
+		<li><a href="${ctx}/info/info/">文章列表</a></li>
+	</c:if>
+	<c:if test="${ltype eq 3 }">
+		<li><a href="${ctx}/baike/cmBaikeProduct/?commodityType=1&publishSource=1">采美词条</a></li>
+	</c:if>
 	<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"
+<form:form id="inputForm" modelAttribute="${ltype==3?'cmBaikeProduct':'info'}" action="${ctx}${ltype==3?'/baike/cmBaikeProduct':'/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>
+		<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>${ltype==3?'词条名称':'文章标题'}:</label>
 		<div class="controls">
-				${info.title}
+				${ltype==3?info.name: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偏文章
+				   value="0" ${empty info.autoStatus?'checked=checked':info.autoStatus eq 0?'checked=checked':''}>自动推荐(设置自动推荐后,${ltype==3?'将根据词条相关联标签推荐最新的3个词条':'将根据文章相关联标签推荐最新的3篇文章'}
 			<br>
 			<br>
 			<input type="radio" name="autoStatus" value="1" ${info.autoStatus eq 1?'checked=checked':''}>手动推荐
@@ -87,43 +92,70 @@
 	<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="添加文章"/>
+			<input class="btn btn-primary" style="width: 80px" onclick="showSelect()" value="添加${ltype eq 3?'词条':'文章' }"/>
 		</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>
+				<c:if test="${ltype eq 1 }">
+					<th>ID</th>
+					<th>文章分类</th>
+					<th>引导图</th>
+					<th>文章标题</th>
+					<th>文章标签</th>
+					<th>发布人</th>
+					<th>排序值</th>
+					<th>发布时间</th>
+					<th>添加时间</th>
+					<th>状态</th>
+					<th>操作</th>
+				</c:if>
+				<c:if test="${ltype eq 3 }">
+					<th>ID</th>
+					<th>分类</th>
+					<th>词条名称</th>
+					<th>排序值</th>
+					<th>添加时间</th>
+					<th>操作</th>
+				</c:if>
+
 			</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:if test="${ltype eq 1 }">
+					<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:if>
+				<c:if test="${ltype eq 3 }">
+					<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.cmBaikeProduct.id}</td>
+						<td>${cmRelated.cmBaikeProduct.typeName}</td>
+						<td class="comitted">${cmRelated.cmBaikeProduct.name}</td>
+						<td><form:input path="cmRelatedList[${index.index}].sort" htmlEscape="false" maxlength="11"
+										class="input-mini"/></td>
+						<td><fmt:formatDate value="${cmRelated.cmBaikeProduct.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
+						<td style="width: 150px"><a href="#" onclick="delCmRelated(this)">删除</a></td>
+					</tr>
+				</c:if>
+
 			</c:forEach>
 			</tbody>
 		</table>
@@ -148,8 +180,8 @@
 	function showSelect() {
 		var url = '';
 		var title = '';
-		url = "${ctx}/info/info/findInfoPage?cmRelatedType=1";
-		title = "添加文章";
+		url = "${ctx}${ltype==3?'/baike/cmBaikeProduct/findBaikePage?cmRelatedType=3':'/info/info/findInfoPage?cmRelatedType=1'}&publishSource=1";
+		title = "添加${ltype==3?'词条':'文章'}";
 		top.$.jBox("iframe:" + url + "", {
 			iframeScrolling: 'yes',
 			width: $(top.document).width() - 600,
@@ -169,27 +201,40 @@
 						})
 						console.log(items);
 						//添加数据
-						$.post("${ctx}/info/info/addInfos?infoIds=" + items, function (data) {
+						$.post("${ctx}${ltype==3?'/baike/cmBaikeProduct/addBaikes':'/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>'
+									if (${ltype==3}){
+										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 class="comitted">' + infoList[i].name + '</td>'
+										html += '<td><input type="text" name="cmRelatedList[' + i + '].sort" htmlEscape="false" maxlength="11"  value="0" class="input-mini"/></td>'
+										html += '<td>' + infoList[i].addTime + '</td>'
+										html += '<td style="width: 150px"><a href="#' + infoList[i].id + '" onclick="delCmRelated(this)">删除</a></td>'
+										html += '</tr>'
+									}else {
+										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)

+ 118 - 39
src/main/webapp/WEB-INF/views/modules/info/infoTypeLandingList.jsp

@@ -10,6 +10,19 @@
 	#soft{
 		width: 80px;
 	}
+	.setHomeImageStatus {
+		width: 400px;
+		height: 210px;
+		border: 1px #000000 solid;
+		background: white;
+		position: fixed;
+		top: 0;
+		right: 0;
+		bottom: 0;
+		left: 0;
+		margin: auto;
+		display: none;
+	}
 	</style>
 	<script type="text/javascript">
 		//失焦修改排序值
@@ -34,15 +47,40 @@
 			$("#searchForm").submit();
         	return false;
         }
-		//状态修改
-		function updateLanDingStatus(pcStatus,appStatus,id){
-			var msg='确定启用?';
-			if(pcStatus==-1?'0'==appStatus:'0'==pcStatus){
-				msg='确定停用?';
+		//PC端状态修改
+		function updateEnabledStatus(status, id) {
+			var msg = '确定开启?';
+			if ('0' == status) {
+				msg = '确定下架吗?下架后商城不再显示该商品';
+			}else if ('3' == status) {
+				$(".setHomeImageStatus").show()
+				$('#homeImgaeId').val(id)
+				return false
+			}else {
+				let isHomeimageStatus=true;
+				$.ajax({
+					async: false,
+					type : "post",
+					url : "${ctx}/info/infoType/isLandingtatus",
+					data:{'id':id,'publishSource':$("#publishSource").val(),'bookStartDate':$("#bookStartDate").val(),'bookEndDate':$("#bookEndDate").val()},
+					datatype : 'json',
+					success : function (result) {
+						isHomeimageStatus=result.isHomeimageStatus
+					}
+				})
+				console.log(isHomeimageStatus)
+				if (!isHomeimageStatus){
+					$.jBox.tip('该时段广告已满,无法进行设置', 'info');
+					return false
+				}
 			}
 			top.$.jBox.confirm(msg,'系统提示',function(v,h,f){
 				if(v=='ok'){
-					$.post("${ctx}/info/infoType/updateLanDingStatus",pcStatus==-1?{'appStatus':appStatus,'id':id}:{'pcStatus':pcStatus,'id':id}, function(data) {
+					$.post("${ctx}/info/infoType/updateLanDingStatus",{
+						'pcStatus': status,
+						'id': id,
+						'bookStatus': $("input[name='bookStatus']:checked").val(),
+						'bookStartDate':$("#bookStartDate").val(),'bookEndDate':$("#bookEndDate").val()}, function(data) {
 						if(true==data.success){
 							$.jBox.tip(data.msg, 'info');
 						} else {
@@ -58,29 +96,39 @@
 </head>
 <body>
 	<ul class="nav nav-tabs">
-		<li class="${cmBrandLanding.levelType==1?'active':''}"><a href="${ctx}/info/infoType/infoTypeLandingList?levelType=1">广告图1</a></li>
-		<li class="${cmBrandLanding.levelType==2?'active':''}"><a href="${ctx}/info/infoType/infoTypeLandingList?levelType=2">广告图2</a></li>
-		<li class="${cmBrandLanding.levelType==3?'active':''}"><a href="${ctx}/info/infoType/infoTypeLandingList?levelType=3">广告图3</a></li>
+		<li class="${cmBrandLanding.publishSource==1&&cmBrandLanding.levelType==1?'active':''}"><a href="${ctx}/info/infoType/infoTypeLandingList?publishSource=1&levelType=1">左侧广告</a></li>
+		<li class="${cmBrandLanding.publishSource==1&&cmBrandLanding.levelType==2?'active':''}"><a href="${ctx}/info/infoType/infoTypeLandingList?publishSource=1&levelType=2">右上广告</a></li>
+		<li class="${cmBrandLanding.publishSource==1&&cmBrandLanding.levelType==3?'active':''}"><a href="${ctx}/info/infoType/infoTypeLandingList?publishSource=1&levelType=3">右下广告</a></li>
+		<li class="${cmBrandLanding.publishSource==2&&cmBrandLanding.levelType==1?'active':''}"><a href="${ctx}/info/infoType/infoTypeLandingList?publishSource=2&levelType=1">供应商左侧广告</a></li>
+		<li class="${cmBrandLanding.publishSource==2&&cmBrandLanding.levelType==2?'active':''}"><a href="${ctx}/info/infoType/infoTypeLandingList?publishSource=2&levelType=2">供应商右上广告</a></li>
+		<li class="${cmBrandLanding.publishSource==2&&cmBrandLanding.levelType==3?'active':''}"><a href="${ctx}/info/infoType/infoTypeLandingList?publishSource=2&levelType=3">供应商右下广告</a></li>
 	</ul>
 	<form:form id="searchForm" modelAttribute="cmBrandLanding" action="${ctx}/info/infoType/infoTypeLandingList" 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}"/>
 		<input id="levelType" name="levelType" type="hidden" value="${cmBrandLanding.levelType}"/>
 		<div class="ul-form">
+			 <form:hidden path="publishSource" value="${publishSource}"/>
 			 <label>ID:</label>
 				<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:select path="appStatus" class="input-medium">
-					<form:option value="" label=" "/>
-					<form:options items="${fns:getDictList('enabled_status')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
-				</form:select>
-			 <label>PC端状态:</label>
+			 <label>状态:</label>
 				<form:select path="pcStatus" class="input-medium">
-					<form:option value="" label=" "/>
-					<form:options items="${fns:getDictList('enabled_status')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+					<form:option value="" label="全部"/>
+					<form:option value="2" label="待上架"/>
+					<form:option value="1" label="已上架"/>
+					<form:option value="0" label="已下架"/>
+				</form:select>
+			<c:if test="${publishSource eq 2 }">
+				<label>审核状态:</label>
+				<form:select path="auditStatus" class="input-small">
+					<form:option value="" label="全部"/>
+					<form:option value="1" label="待审核"/>
+					<form:option value="2" label="审核通过"/>
+					<form:option value="3" label="审核失败"/>
 				</form:select>
+			</c:if>
 			<label>点击时间:</label>
 			<form:input path="startPvCreateTime" type="text" maxlength="20" class="input-mini Wdate" htmlEscape="false" value="${fns:setDate(cmBrandLanding.startPvCreateTime,'yyyy-MM-dd')}"
 						onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
@@ -89,7 +137,9 @@
 						onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
 			&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
 			&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="一键排序"/>
-			&nbsp;&nbsp;<input  class="btn btn-primary" type="button" value="添加" onclick="location.href='${ctx}/cmBrandLanding/form?type=5&levelType=${cmBrandLanding.levelType}'"/>
+			<c:if test="${publishSource eq 1 }">
+			&nbsp;&nbsp;<input  class="btn btn-primary" type="button" value="添加" onclick="location.href='${ctx}/cmBrandLanding/form?type=5&publishSource=${publishSource}&levelType=${cmBrandLanding.levelType}'"/>
+			</c:if>
 			<div class="clearfix"></div>
 		</div>
 	</form:form>
@@ -103,8 +153,12 @@
 				<th>链接</th>
 				<th>排序</th>
 				<th>点击量</th>
-				<th>小程序端状态</th>
-				<th>PC端状态</th>
+				<th>状态</th>
+				<c:if test="${publishSource eq 2 }">
+					<th>审核状态</th>
+				</c:if>
+				<th>上架时间</th>
+				<th>下架时间</th>
 				<th>添加时间</th>
 				<th>操作</th>
 			</tr>
@@ -120,32 +174,37 @@
 					<input id="sort" type="number" value="${item.sort}" maxlength="11" style="width:50px;" onblur="upSoft(${item.id},this)">
 				</td>
 				<td>${item.pv}</td>
-				<td>
-					<c:if test="${item.appStatus eq 1 }">
-						<a href="javascript:void(0);" onclick="updateLanDingStatus('-1','0','${item.id}');" >
-							<img alt="启用" src="/static/images/yes.gif" width="15px" border="none" title="启用">
-						</a>
-					</c:if>
-					<c:if test="${item.appStatus ne 1 }">
-						<a href="javascript:void(0)" onclick="updateLanDingStatus('-1','1','${item.id}');">
-							<img alt="停用" src="/static/images/no.gif" width="15px" border="none" title="停用">
-						</a>
-					</c:if>
-				</td>
 				<td>
 					<c:if test="${item.pcStatus eq 1 }">
-						<a href="javascript:void(0);" onclick="updateLanDingStatus('0','-1','${item.id}');" >
-							<img alt="启用" src="/static/images/yes.gif" width="15px" border="none" title="启用">
-						</a>
+						<span style="color: #5bb75b">已上架</span>
+					</c:if>
+					<c:if test="${item.pcStatus eq 0 }">
+						<span style="color: red">已下架</span>
 					</c:if>
-					<c:if test="${item.pcStatus ne 1 }">
-						<a href="javascript:void(0)" onclick="updateLanDingStatus('1','-1','${item.id}');">
-							<img alt="停用" src="/static/images/no.gif" width="15px" border="none" title="停用">
-						</a>
+					<c:if test="${item.pcStatus eq 2 }">
+						待上架
 					</c:if>
 				</td>
+				<c:if test="${item.publishSource eq 2 }">
+					<td>
+						<c:if test="${item.auditStatus eq 2}">
+							<span style="color: #5bb75b">审核通过</span>
+						</c:if>
+						<c:if test="${item.auditStatus eq 3 }">
+							<span style="color: red">审核失败</span>
+						</c:if>
+						<c:if test="${item.auditStatus eq 1 }">
+							待审核
+						</c:if>
+					</td>
+				</c:if>
+				<td><fmt:formatDate value="${item.bookStartDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
+				<td><fmt:formatDate value="${item.bookEndDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
 				<td><fmt:formatDate value="${item.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
 				<td>
+					<c:if test="${item.pcStatus ne 2 }">
+						<a href="#" onclick="updateEnabledStatus('${item.pcStatus eq 1?0:3}','${item.id}')">${item.pcStatus eq 1?"下架":"上架" }</a>
+					</c:if>
     				<a href="${ctx}/cmBrandLanding/form?type=5&levelType=${item.levelType}&id=${item.id}">编辑</a>
 					<a href="${ctx}/cmBrandLanding/del/${item.type}/${item.id}?levelType=${item.levelType}"
 					   onclick="return confirmx('是否删除该数据?', this.href)">删除</a>
@@ -154,6 +213,26 @@
 		</c:forEach>
 		</tbody>
 	</table>
+	<div class="setHomeImageStatus">
+		<h3 style="border-bottom: 1px #000 solid">上架提示</h3>
+		<input type="hidden" name="homeImgaeId" id="homeImgaeId">
+		<div style="padding: 10px 20px">
+			<label class="control-label">上架时间:</label>
+			<input type="radio" name="bookStatus" value="1" checked>立即上架
+			<input type="radio" name="bookStatus" value="2">预约上架
+			<input id="bookStartDate" type="text" maxlength="40" class="input-mini Wdate "
+				   onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
+		</div>
+		<div style="padding: 10px 20px">
+			<label class="control-label">下架时间:</label>
+			<input id="bookEndDate" type="text" maxlength="40" class="input-mini Wdate required"
+				   onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
+		</div>
+		<div style="position: relative; float: right ;left: -20px">
+			<button onclick="$('.setHomeImageStatus').hide()">取消</button>
+			<button onclick="updateEnabledStatus('1',$('#homeImgaeId').val())">确认</button>
+		</div>
+	</div>
 	<div class="pagination">${page}</div>
 </body>
 </html>

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

@@ -181,6 +181,12 @@
 					<form:option value="1" label="已发布"/>
 					<form:option value="0" label="暂不发布"/>
 				</form:select>
+			<label>百度收录状态:</label>
+			<form:select path="includedStatus" class="input-medium">
+				<form:option value="" label="全部"/>
+				<form:option value="1" label="已收录"/>
+				<form:option value="0" label="审核中"/>
+			</form:select>
 			&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
 			<div class="clearfix"></div>
 		</div>
@@ -200,6 +206,7 @@
 				<th>发布时间</th>
 				<th>发布人</th>
 				<th>供应商</th>
+				<th>百度收录状态</th>
 				<th>添加时间</th>
 				<th>供应商状态</th>
 				<shiro:hasPermission name="info:info:edit"><th>操作</th></shiro:hasPermission>
@@ -234,6 +241,7 @@
                 <td>
                     ${info.shopName}
                 </td>
+				<td>${info.includedStatus==0?"审核中":'<font color="green">已收录</font>'}</td>
 				<td><fmt:formatDate value="${info.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
 				<td><font color="${info.enabledStatus eq 1?'#2FA4E7':'red'}"> ${info.enabledStatus eq 1?'已发布':'暂不发布'}</font></td>
 				<td hidden>

+ 78 - 23
src/main/webapp/WEB-INF/views/modules/landing/newPageCmbrandLandingForm.jsp

@@ -238,12 +238,12 @@
 </c:if>
 <c:if test="${type==5}">
 	<ul class="nav nav-tabs">
-		<li ><a href="${ctx}/info/infoType/infoTypeLandingList?levelType=1">广告图1</a></li>
-		<c:if test="${cmBrandLanding.levelType==1}"><li class="active"><a href="${ctx}/cmBrandLanding/form?id=${cmBrandLanding.id}&type=${type}">${not empty cmBrandLanding.id?'编辑':'添加'}</a></li></c:if>
-		<li ><a href="${ctx}/info/infoType/infoTypeLandingList?levelType=2">广告图2</a></li>
-		<c:if test="${cmBrandLanding.levelType==2}"><li class="active"><a href="${ctx}/cmBrandLanding/form?id=${cmBrandLanding.id}&type=${type}">${not empty cmBrandLanding.id?'编辑':'添加'}</a></li></c:if>
-		<li ><a href="${ctx}/info/infoType/infoTypeLandingList?levelType=3">广告图3</a></li>
-		<c:if test="${cmBrandLanding.levelType==3}"><li class="active"><a href="${ctx}/cmBrandLanding/form?id=${cmBrandLanding.id}&type=${type}">${not empty cmBrandLanding.id?'编辑':'添加'}</a></li></c:if>
+		<li ><a href="${ctx}/info/infoType/infoTypeLandingList?levelType=1&publishSource=${cmBrandLanding.publishSource}">${cmBrandLanding.publishSource==2?'供应商':''}左侧广告</a></li>
+		<c:if test="${cmBrandLanding.levelType==1}"><li class="active"><a href="${ctx}/cmBrandLanding/form?id=${cmBrandLanding.id}&publishSource=${cmBrandLanding.publishSource}&type=${type}">${not empty cmBrandLanding.id?'编辑':'添加'}</a></li></c:if>
+		<li ><a href="${ctx}/info/infoType/infoTypeLandingList?levelType=2&publishSource=${cmBrandLanding.publishSource}">${cmBrandLanding.publishSource==2?'供应商':''}右上广告</a></li>
+		<c:if test="${cmBrandLanding.levelType==2}"><li class="active"><a href="${ctx}/cmBrandLanding/form?id=${cmBrandLanding.id}&publishSource=${cmBrandLanding.publishSource}&type=${type}">${not empty cmBrandLanding.id?'编辑':'添加'}</a></li></c:if>
+		<li ><a href="${ctx}/info/infoType/infoTypeLandingList?levelType=3&publishSource=${cmBrandLanding.publishSource}">${cmBrandLanding.publishSource==2?'供应商':''}右下广告</a></li>
+		<c:if test="${cmBrandLanding.levelType==3}"><li class="active"><a href="${ctx}/cmBrandLanding/form?id=${cmBrandLanding.id}&publishSource=${cmBrandLanding.publishSource}&type=${type}">${not empty cmBrandLanding.id?'编辑':'添加'}</a></li></c:if>
 	</ul>
 </c:if>
 <br/>
@@ -252,6 +252,7 @@
 	<form:hidden path="id"/>
 	<form:hidden path="type" value="${type}"/>
 	<form:hidden path="levelType" />
+	<form:hidden path="publishSource" />
 	<form:hidden path="video"/>
 	<sys:message content="${message}"/>
 	<div class="control-group">
@@ -336,7 +337,20 @@
 			</div>
 		</div>
 	</c:if>
-		<div class="control-group">
+	<c:if test="${type==5}">
+	<div class="control-group crmstatus" style="" >
+		<label class="control-label"><font color="red">*</font>广告跳转:</label>
+		<div class="controls">
+			<div><input type="radio" name="productId" value="" ${empty newPageHomeimage.productId ?'checked':''} >店铺首页</div>
+			<br>
+			<div><input type="radio" name="productId" value="${newPageHomeimage.productId}" ${null != newPageHomeimage.productId ?'checked':''} >商品详情
+				<div>
+					<img style="margin:20px;width:50px;height: 50px" src="${newPageHomeimage.image}"/>${newPageHomeimage.title}</div>
+			</div>
+		</div>
+	</div>
+	</c:if>
+	<div class="control-group">
 			<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>排序:</label>
 			<div class="controls">
 				<c:if test="${empty cmBrandLanding.id}">
@@ -349,24 +363,65 @@
 				</c:if>
 			</div>
 		</div>
-	<div class="control-group crmstatus" style="">
-		<label class="control-label">小程序状态:</label>
-		<div class="controls">
-			<form:select path="appStatus" class="input-xlarge ">
-				<form:options items="${fns:getDictList('enabled_status')}" itemLabel="label" itemValue="value"
-							  htmlEscape="false"/>
-			</form:select>
+
+	<c:if test="${type!=5}">
+		<div class="control-group crmstatus" style="">
+			<label class="control-label">小程序状态:</label>
+			<div class="controls">
+				<form:select path="appStatus" class="input-xlarge ">
+					<form:options items="${fns:getDictList('enabled_status')}" itemLabel="label" itemValue="value"
+								  htmlEscape="false"/>
+				</form:select>
+			</div>
 		</div>
-	</div>
-	<div class="control-group crmstatus" style="">
-		<label class="control-label">PC端状态:</label>
-		<div class="controls">
-			<form:select path="pcStatus" class="input-xlarge ">
-				<form:options items="${fns:getDictList('enabled_status')}" itemLabel="label" itemValue="value"
-							  htmlEscape="false"/>
-			</form:select>
+		<div class="control-group crmstatus" style="">
+			<label class="control-label">PC端状态:</label>
+			<div class="controls">
+				<form:select path="pcStatus" class="input-xlarge ">
+					<form:options items="${fns:getDictList('enabled_status')}" itemLabel="label" itemValue="value"
+								  htmlEscape="false"/>
+				</form:select>
+			</div>
 		</div>
-	</div>
+	</c:if>
+	<c:if test="${type==5}">
+		<form:hidden path="pcStatus" value="1"/>
+		<form:hidden path="appStatus" value="1"/>
+		<c:if test="${cmBrandLanding.pcStatus ne 1}">
+			<div class="control-group crmstatus" style="" >
+				<label class="control-label"><font color="red">*</font>上架时间:</label>
+				<div class="controls">
+					<input type="radio" name="bookStatus" value="1" ${empty cmBrandLanding.bookStatus ||cmBrandLanding.bookStatus == 1?'checked':''} >立即上架
+					<input type="radio" name="bookStatus" value="2" ${cmBrandLanding.bookStatus == 2?'checked':''} >预约上架
+					<form:input path="bookStartDate" type="text" maxlength="40" class="input-mini Wdate " value="${fns:setDate(cmBrandLanding.bookStartDate,'yyyy-MM-dd')}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
+				</div>
+			</div>
+		</c:if>
+		<div class="control-group crmstatus" style="" >
+			<label class="control-label"><font color="red">*</font>下架时间:</label>
+			<div class="controls">
+				<form:input path="bookEndDate" type="text" maxlength="40" class="input-mini Wdate required" value="${fns:setDate(cmBrandLanding.bookEndDate,'yyyy-MM-dd')}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
+			</div>
+		</div>
+		<c:if test="${cmBrandLanding.publishSource eq 2 &&cmBrandLanding.auditStatus eq 1}">
+			<div class="control-group">
+				<label class="control-label keyClass"><font color="red">*</font>审核:</label>
+				<div class="controls">
+					<input type="radio" name="auditStatus" value="2" onclick="updateAuditStatus(2)" ${cmBrandLanding.auditStatus != 3?'checked':''}>审核通过
+					<input type="radio" name="auditStatus" value="3" onclick="updateAuditStatus(3)" ${cmBrandLanding.auditStatus == 3?'checked':''}> 审核失败
+				</div>
+			</div>
+			<div class="control-group" id="failReasonDiv" style="${cmBrandLanding.auditStatus != 3?'display: none':''}">
+				<label class="control-label"><font color="red">*</font>失败原因</label>
+				<div class="controls">
+					<textarea type="text" id="failReason" name="failReason" required style="width: 400px;height: 90px">${cmBrandLanding.failReason}</textarea>
+				</div>
+			</div>
+		</c:if>
+		<c:if test="${cmBrandLanding.publishSource eq 1}">
+			<form:hidden path="auditStatus" value="2"/>
+		</c:if>
+	</c:if>
 	<div class="form-actions">
 		<shiro:hasPermission name="newhome:newPageHomeimage:edit"><input id="btnSubmit" class="btn btn-primary"
 																		 type="submit"

+ 80 - 11
src/main/webapp/WEB-INF/views/modules/newhome/newPageHomeimageForm.jsp

@@ -11,6 +11,22 @@
 				submitHandler: function(form){
                     var image = $("#image").val();
                     if(image != undefined && image.trim() != ""){
+						let isHomeimageStatus=true;
+						$.ajax({
+							async: false,
+							type : "post",
+							url : "${ctx}/newhome/newPageHomeimage/isHomeimageStatus",
+						    data:{'id':$("#id").val(),'publishSource': ${newPageHomeimage.publishSource},'bookStartDate':$("#bookStartDate").val(),'bookEndDate':$("#bookEndDate").val()},
+							datatype : 'json',
+							success : function (result) {
+							isHomeimageStatus=result.isHomeimageStatus
+							}
+						})
+						console.log(isHomeimageStatus)
+						if (!isHomeimageStatus){
+							$.jBox.tip('该时段广告已满,无法进行设置', 'info');
+							return false
+						}
                         loading('正在提交,请稍等...');
                         form.submit();
                     }else {
@@ -33,6 +49,14 @@
             obj.value = obj.value.replace(",", "");
             obj.value = obj.value.replace(",", "");
         };
+		function updateAuditStatus(auditStatus) {
+			var elementById = document.getElementById("failReasonDiv");
+			if (auditStatus === 2) {
+				elementById.style.cssText = "display:none";
+			} else {
+				elementById.style.cssText = "";
+			}
+		}
 	</script>
 </head>
 <body>
@@ -42,10 +66,10 @@
 	</ul><br/>
 	<form:form id="inputForm" modelAttribute="newPageHomeimage" action="${ctx}/newhome/newPageHomeimage/save" method="post" class="form-horizontal">
 		<form:hidden path="id"/>
+		<form:hidden path="publishSource"/>
+		<form:hidden path="wwwEnabledStatus" value="1"/>
+		<form:hidden path="crmEnabledStatus" value="1"/>
 		<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">
@@ -90,6 +114,17 @@
 				<form:input path="crmTitle" placeholder="最多输入15个汉字" htmlEscape="false" maxlength="15" class="input-xlarge"/>
 			</div>
 		</div>
+		<div class="control-group crmstatus" style="" >
+			<label class="control-label"><font color="red">*</font>广告跳转:</label>
+			<div class="controls">
+				<div><input type="radio" name="productId" value="" ${empty newPageHomeimage.productId ?'checked':''} >店铺首页</div>
+				<br>
+				<div><input type="radio" name="productId" value="${newPageHomeimage.productId}" ${null != newPageHomeimage.productId ?'checked':''} >商品详情
+					<div>
+						<img style="margin:20px;width:50px;height: 50px" src="${newPageHomeimage.image}"/>${newPageHomeimage.title}</div>
+				</div>
+			</div>
+		</div>
 		<div class="control-group">
 			<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>排序:</label>
 			<div class="controls">
@@ -101,22 +136,56 @@
                 </c:if>
 			</div>
 		</div>
+<%--		<div class="control-group crmstatus" style="" >--%>
+<%--			<label class="control-label">小程序状态:</label>--%>
+<%--			<div class="controls">--%>
+<%--				<form:select path="crmEnabledStatus" class="input-xlarge ">--%>
+<%--					<form:options items="${fns:getDictList('enabled_status')}" itemLabel="label" itemValue="value" htmlEscape="false" />--%>
+<%--				</form:select>--%>
+<%--			</div>--%>
+<%--		</div>--%>
+<%--		<div class="control-group crmstatus" style="" >--%>
+<%--			<label class="control-label">PC端状态:</label>--%>
+<%--			<div class="controls">--%>
+<%--				<form:select path="wwwEnabledStatus" class="input-xlarge ">--%>
+<%--					<form:options items="${fns:getDictList('enabled_status')}" itemLabel="label" itemValue="value" htmlEscape="false" />--%>
+<%--				</form:select>--%>
+<%--			</div>--%>
+<%--		</div>--%>
+		<c:if test="${newPageHomeimage.wwwEnabledStatus ne 1}">
 		<div class="control-group crmstatus" style="" >
-			<label class="control-label">小程序状态:</label>
+			<label class="control-label"><font color="red">*</font>上架时间:</label>
 			<div class="controls">
-				<form:select path="crmEnabledStatus" class="input-xlarge ">
-					<form:options items="${fns:getDictList('enabled_status')}" itemLabel="label" itemValue="value" htmlEscape="false" />
-				</form:select>
+				<input type="radio" name="bookStatus" value="1" ${empty newPageHomeimage.bookStatus ||newPageHomeimage.bookStatus == 1?'checked':''} >立即上架
+				<input type="radio" name="bookStatus" value="2" ${newPageHomeimage.bookStatus == 2?'checked':''} >预约上架
+				<form:input path="bookStartDate" type="text" maxlength="40" class="input-mini Wdate " value="${fns:setDate(newPageHomeimage.bookStartDate,'yyyy-MM-dd')}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
 			</div>
 		</div>
+		</c:if>
 		<div class="control-group crmstatus" style="" >
-			<label class="control-label">PC端状态:</label>
+			<label class="control-label"><font color="red">*</font>下架时间:</label>
+			<div class="controls">
+				<form:input path="bookEndDate" type="text" maxlength="40" class="input-mini Wdate required" value="${fns:setDate(newPageHomeimage.bookEndDate,'yyyy-MM-dd')}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
+			</div>
+		</div>
+		<c:if test="${newPageHomeimage.publishSource eq 2 &&newPageHomeimage.auditStatus eq 1}">
+		<div class="control-group">
+			<label class="control-label keyClass"><font color="red">*</font>审核:</label>
+			<div class="controls">
+				<input type="radio" name="auditStatus" value="2" onclick="updateAuditStatus(2)" ${newPageHomeimage.auditStatus != 3?'checked':''}>审核通过
+				<input type="radio" name="auditStatus" value="3" onclick="updateAuditStatus(3)" ${newPageHomeimage.auditStatus == 3?'checked':''}> 审核失败
+			</div>
+		</div>
+		<div class="control-group" id="failReasonDiv" style="${newPageHomeimage.auditStatus != 3?'display: none':''}">
+			<label class="control-label"><font color="red">*</font>失败原因</label>
 			<div class="controls">
-				<form:select path="wwwEnabledStatus" class="input-xlarge ">
-					<form:options items="${fns:getDictList('enabled_status')}" itemLabel="label" itemValue="value" htmlEscape="false" />
-				</form:select>
+				<textarea type="text" id="failReason" name="failReason" required style="width: 400px;height: 90px">${newPageHomeimage.failReason}</textarea>
 			</div>
 		</div>
+		</c:if>
+		<c:if test="${newPageHomeimage.publishSource eq 1}">
+			<form:hidden path="auditStatus" value="2"/>
+		</c:if>
 		<div class="form-actions">
 			<shiro:hasPermission name="newhome:newPageHomeimage: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)"/>

+ 135 - 73
src/main/webapp/WEB-INF/views/modules/newhome/newPageHomeimageList.jsp

@@ -12,6 +12,19 @@
         .table td {
             text-align: center;
         }
+        .setHomeImageStatus {
+            width: 400px;
+            height: 210px;
+            border: 1px #000000 solid;
+            background: white;
+            position: fixed;
+            top: 0;
+            right: 0;
+            bottom: 0;
+            left: 0;
+            margin: auto;
+            display: none;
+        }
     </style>
     <script type="text/javascript">
         $(document).ready(function () {
@@ -50,16 +63,39 @@
         }
 
         //PC端状态修改
-        function updateEnabledStatus(status, ids) {
+        function updateEnabledStatus(status, id) {
             var msg = '确定开启?';
             if ('0' == status) {
-                msg = '确定停用?';
+                msg = '确定下架吗?下架后商城不再显示该商品';
+            }else if ('3' == status) {
+                $(".setHomeImageStatus").show()
+                $('#homeImgaeId').val(id)
+                return false
+            }else {
+                let isHomeimageStatus=true;
+                $.ajax({
+                    async: false,
+                    type : "post",
+                    url : "${ctx}/newhome/newPageHomeimage/isHomeimageStatus",
+                    data:{'id':id,'publishSource':$("#publishSource").val(),'bookStartDate':$("#bookStartDate").val(),'bookEndDate':$("#bookEndDate").val()},
+                    datatype : 'json',
+                    success : function (result) {
+                        isHomeimageStatus=result.isHomeimageStatus
+                    }
+                })
+                console.log(isHomeimageStatus)
+                if (!isHomeimageStatus){
+                    $.jBox.tip('该时段广告已满,无法进行设置', 'info');
+                    return false
+                }
             }
             top.$.jBox.confirm(msg, '系统提示', function (v, h, f) {
                 if (v == 'ok') {
                     $.post("${ctx}/newhome/newPageHomeimage/updateEnabledStatus", {
                         'enabledStatus': status,
-                        'ids': ids
+                        'id': id,
+                        'bookStatus': $("input[name='bookStatus']:checked").val(),
+                        'bookStartDate':$("#bookStartDate").val(),'bookEndDate':$("#bookEndDate").val()
                     }, function (data) {
                         if (true == data.success) {
                             $.jBox.tip(data.msg, 'info');
@@ -68,6 +104,7 @@
                         }
                         $("#searchForm").submit();
                     }, "JSON");//这里返回的类型有:json,html,xml,text
+
                 }
                 return;
             }, {buttonsFocus: 1, persistent: true});
@@ -77,65 +114,46 @@
             obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
         }
 
-        //CRM端状态修改
-        function updateCrmEnabledStatusByIds(status, ids) {
-            var msg = '确定开启?';
-            if ('0' == status) {
-                msg = '确定停用?';
-            }
-            top.$.jBox.confirm(msg, '系统提示', function (v, h, f) {
-                if (v == 'ok') {
-                    $.post("${ctx}/newhome/newPageHomeimage/updateCrmEnabledStatusByIds", {
-                        'crmEnabledStatus': status,
-                        'ids': ids
-                    }, function (data) {
-                        if (true == data.success) {
-                            $.jBox.tip(data.msg, 'info');
-                        } else {
-                            $.jBox.tip(data.msg, 'error');
-                        }
-                        $("#searchForm").submit();
-                    }, "JSON");//这里返回的类型有:json,html,xml,text
-                }
-                return;
-            }, {buttonsFocus: 1, persistent: true});
-        }
     </script>
 </head>
 <body>
 <ul class="nav nav-tabs">
-    <li class="active"><a href="${ctx}/newhome/newPageHomeimage/">新首页轮播图列表</a></li>
-    <shiro:hasPermission name="newhome:newPageHomeimage:edit">
-        <li><a href="${ctx}/newhome/newPageHomeimage/form">新首页轮播图添加</a></li>
-    </shiro:hasPermission>
+    <li class="${publishSource==1?'active':''}"><a href="${ctx}/newhome/newPageHomeimage/?publishSource=1">新首页轮播(平台)</a></li>
+    <li class="${publishSource==2?'active':''}"><a href="${ctx}/newhome/newPageHomeimage/?publishSource=2">新首页轮播(供应商)</a></li>
 </ul>
 <form:form id="searchForm" modelAttribute="newPageHomeimage" action="${ctx}/newhome/newPageHomeimage/" 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">
+        <form:hidden path="publishSource" value="${publishSource}"/>
         <label>ID:</label>
         <form:input path="id" htmlEscape="false" maxlength="11" class="input-mini"/>
         <label>标题:</label>
         <form:input path="title" htmlEscape="false" maxlength="40" class="input-small"/>
-
-        <label>小程序端状态:</label>
-        <form:select path="crmEnabledStatus" class="input-small">
-            <form:option value="" label=" "/>
-            <form:options items="${fns:getDictList('enabled_status')}" itemLabel="label" itemValue="value"
-                          htmlEscape="false"/>
-        </form:select>
-        <label>PC端状态:</label>
+        <label>状态:</label>
         <form:select path="wwwEnabledStatus" class="input-small">
-            <form:option value="" label=" "/>
-            <form:options items="${fns:getDictList('enabled_status')}" itemLabel="label" itemValue="value"
-                          htmlEscape="false"/>
+            <form:option value="" label="全部"/>
+            <form:option value="2" label="待上架"/>
+            <form:option value="1" label="已上架"/>
+            <form:option value="0" label="已下架"/>
         </form:select>
+        <c:if test="${publishSource eq 2 }">
+        <label>审核状态:</label>
+        <form:select path="auditStatus" class="input-small">
+            <form:option value="" label="全部"/>
+            <form:option value="1" label="待审核"/>
+            <form:option value="2" label="审核通过"/>
+            <form:option value="3" label="审核失败"/>
+        </form:select>
+        </c:if>
+
         <label>点击时间:</label>
         <form:input path="startPvCreateTime" type="text" maxlength="20" class="input-mini Wdate" value="${fns:setDate(newPageHomeimage.startPvCreateTime,'yyyy-MM-dd')}"
                     onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
         -
-        <form:input path="endPvCreateTime" type="text" maxlength="20" class="input-mini Wdate" value="${fns:setDate(newPageHomeimage.endPvCreateTime,'yyyy-MM-dd')}"
+        <form:input path="endPvCreateTime" type="text" maxlength="20" class="input-mini Wdate"
+                    value="${fns:setDate(newPageHomeimage.endPvCreateTime,'yyyy-MM-dd')}"
                     onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
         &nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
         <c:if test="${cmImage.flag eq 4}">
@@ -144,6 +162,11 @@
         </c:if>
         <input class="btn btn-primary" type="button" value="一键排序" onclick="updateSortIndex()"
                style="margin-left: 15px"/>
+        <c:if test="${publishSource eq 1 }">
+        <input class="btn btn-primary" type="button" value="添加"
+               onclick="location.href='${ctx}/newhome/newPageHomeimage/form?publishSource=${publishSource}'"
+               style="margin-left: 15px"/>
+        </c:if>
         <div class="clearfix"></div>
     </div>
 </form:form>
@@ -157,9 +180,17 @@
         <th>链接</th>
         <th>排序</th>
         <th>点击量</th>
-        <th>小程序端状态</th>
-        <th>PC端状态</th>
+        <th>状态</th>
+        <c:if test="${publishSource eq 2 }">
+            <th>审核状态</th>
+        </c:if>
+        <th>上架时间</th>
+        <th>下架时间</th>
         <th>创建时间</th>
+        <c:if test="${publishSource eq 2 }">
+            <th>供应商</th>
+        </c:if>
+        <th>创建人</th>
         <shiro:hasPermission name="newhome:newPageHomeimage:edit">
             <th>操作</th>
         </shiro:hasPermission>
@@ -179,44 +210,75 @@
                        onchange="changeSort(${newPageHomeimage.id})"/>
             </td>
             <td>${newPageHomeimage.count}</td>
-            <td><shiro:hasPermission name="newhome:newPageHomeimage:edit">
-                <c:if test="${newPageHomeimage.crmEnabledStatus eq 1 }">
-                    <a href="javascript:void(0);" onclick="updateCrmEnabledStatusByIds('0','${newPageHomeimage.id}');">
-                        <img alt="启用" src="/static/images/yes.gif" width="15px" border="none" title="启用">
-                    </a>
+            <td>
+                <c:if test="${newPageHomeimage.wwwEnabledStatus eq 1 }">
+                    <span style="color: #5bb75b">已上架</span>
                 </c:if>
-                <c:if test="${newPageHomeimage.crmEnabledStatus ne 1 }">
-                    <a href="javascript:void(0)" onclick="updateCrmEnabledStatusByIds('1','${newPageHomeimage.id}');">
-                        <img alt="停用" src="/static/images/no.gif" width="15px" border="none" title="停用">
-                    </a>
+                <c:if test="${newPageHomeimage.wwwEnabledStatus eq 0 }">
+                    <span style="color: red">已下架</span>
                 </c:if>
-            </shiro:hasPermission></td>
-            <td><shiro:hasPermission name="newhome:newPageHomeimage:edit">
-                <c:if test="${newPageHomeimage.wwwEnabledStatus eq 1 }">
-                    <a href="javascript:void(0);" onclick="updateEnabledStatus('0','${newPageHomeimage.id}');">
-                        <img alt="启用" src="/static/images/yes.gif" width="15px" border="none" title="启用">
-                    </a>
+                <c:if test="${newPageHomeimage.wwwEnabledStatus eq 2 }">
+                    待上架
+                </c:if>
+            </td>
+            <c:if test="${newPageHomeimage.publishSource eq 2 }">
+            <td>
+                <c:if test="${newPageHomeimage.auditStatus eq 2}">
+                    <span style="color: #5bb75b">审核通过</span>
+                </c:if>
+                <c:if test="${newPageHomeimage.auditStatus eq 3 }">
+                    <span style="color: red">审核失败</span>
                 </c:if>
-                <c:if test="${newPageHomeimage.wwwEnabledStatus ne 1 }">
-                    <a href="javascript:void(0)" onclick="updateEnabledStatus('1','${newPageHomeimage.id}');">
-                        <img alt="停用" src="/static/images/no.gif" width="15px" border="none" title="停用">
-                    </a>
+                <c:if test="${newPageHomeimage.auditStatus eq 1 }">
+                    待审核
                 </c:if>
-            </shiro:hasPermission></td>
+            </td>
+            </c:if>
+            <td><fmt:formatDate value="${newPageHomeimage.bookStartDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
+            <td><fmt:formatDate value="${newPageHomeimage.bookEndDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
             <td><fmt:formatDate value="${newPageHomeimage.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
-            <shiro:hasPermission name="newhome:newPageHomeimage:edit">
-                <td>
-                    <a href="${ctx}/newhome/newPageHomeimage/form?id=${newPageHomeimage.id}">编辑</a>
-                    <shiro:hasPermission name="newhome:newPageHomeimage:delete">
-                        <a href="${ctx}/newhome/newPageHomeimage/delete?id=${newPageHomeimage.id}"
-                           onclick="return confirmx('确认要删除该新首页轮播图吗?', this.href)">删除</a>
-                    </shiro:hasPermission>
-                </td>
-            </shiro:hasPermission>
+            <c:if test="${newPageHomeimage.publishSource eq 2 }">
+                <td>${newPageHomeimage.shopName}</td>
+            </c:if>
+            <td>${fns:getUserById(newPageHomeimage.createBy).name}</td>
+            <td>
+                <c:if test="${newPageHomeimage.auditStatus eq 1 }">
+                    <a href="${ctx}/newhome/newPageHomeimage/form?id=${newPageHomeimage.id}&publishSource=${publishSource}">审核</a>
+                </c:if>
+                <c:if test="${newPageHomeimage.auditStatus ne 1 }">
+                    <c:if test="${newPageHomeimage.wwwEnabledStatus ne 2 }">
+                        <a href="#" onclick="updateEnabledStatus('${newPageHomeimage.wwwEnabledStatus eq 1?0:3}','${newPageHomeimage.id}')">${newPageHomeimage.wwwEnabledStatus eq 1?"下架":"上架" }</a>
+                    </c:if>
+                    <a href="${ctx}/newhome/newPageHomeimage/form?id=${newPageHomeimage.id}&publishSource=${publishSource}">编辑</a>
+                    <c:if test="${newPageHomeimage.publishSource eq 1}">
+                    <a href="${ctx}/newhome/newPageHomeimage/delete?id=${newPageHomeimage.id}" onclick="return confirmx('确认要删除该新首页轮播图吗?', this.href)">删除</a>
+                    </c:if>
+                </c:if>
+            </td>
         </tr>
     </c:forEach>
     </tbody>
 </table>
+<div class="setHomeImageStatus">
+    <h3 style="border-bottom: 1px #000 solid">上架提示</h3>
+    <input type="hidden" name="homeImgaeId" id="homeImgaeId">
+    <div style="padding: 10px 20px">
+        <label class="control-label">上架时间:</label>
+        <input type="radio" name="bookStatus" value="1" checked>立即上架
+        <input type="radio" name="bookStatus" value="2">预约上架
+        <input id="bookStartDate" type="text" maxlength="40" class="input-mini Wdate "
+               onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
+    </div>
+    <div style="padding: 10px 20px">
+        <label class="control-label">下架时间:</label>
+        <input id="bookEndDate" type="text" maxlength="40" class="input-mini Wdate required"
+               onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
+    </div>
+    <div style="position: relative; float: right ;left: -20px">
+        <button onclick="$('.setHomeImageStatus').hide()">取消</button>
+        <button onclick="updateEnabledStatus('1',$('#homeImgaeId').val())">确认</button>
+    </div>
+</div>
 <div class="pagination">${page}</div>
 </body>
 </html>

+ 37 - 2
src/main/webapp/WEB-INF/views/modules/newhome/newPageQualitySupplierForm.jsp

@@ -32,12 +32,13 @@
 </head>
 <body>
 	<ul class="nav nav-tabs">
-		<li><a href="${ctx}/newhome/newPageQualitySupplier/">优质供应商列表</a></li>
-		<li class="active"><a href="${ctx}/newhome/newPageQualitySupplier/form?id=${newPageQualitySupplier.id}">优质供应商<shiro:hasPermission name="newhome:newPageQualitySupplier:edit">${not empty newPageQualitySupplier.id?'编辑':'添加'}</shiro:hasPermission><shiro:lacksPermission name="newhome:newPageQualitySupplier:edit">查看</shiro:lacksPermission></a></li>
+		<li><a href="${ctx}/newhome/newPageQualitySupplier/list?shopTypeId=${newPageQualitySupplier.shopTypeId}">优质供应商列表</a></li>
+		<li class="active"><a href="${ctx}/newhome/newPageQualitySupplier/form?id=${newPageQualitySupplier.id}&shopTypeId=${newPageQualitySupplier.shopTypeId}">优质供应商<shiro:hasPermission name="newhome:newPageQualitySupplier:edit">${not empty newPageQualitySupplier.id?'编辑':'添加'}</shiro:hasPermission><shiro:lacksPermission name="newhome:newPageQualitySupplier:edit">查看</shiro:lacksPermission></a></li>
 		<shiro:hasPermission name="newhome:newPageQualitySupplier:edit"><li><a href="${ctx}/newhome/newPageQualitySupplier/formImage?id=1">供应商广告图添加</a></li></shiro:hasPermission>
 	</ul><br/>
 	<form:form id="inputForm" modelAttribute="newPageQualitySupplier" action="${ctx}/newhome/newPageQualitySupplier/save" method="post" class="form-horizontal">
 		<form:hidden path="id"/>
+		<form:hidden path="shopTypeId" value="${newPageQualitySupplier.shopTypeId}"/>
 		<sys:message content="${message}"/>
 		<div class="control-group">
 			<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>供应商名称:</label>
@@ -83,6 +84,40 @@
 					<form:options items="${fns:getDictList('enabled_status')}" itemLabel="label" itemValue="value" htmlEscape="false" />
 				</form:select>
 			</div>
+		</div>
+			<span class="help-inline" style="margin-left: 90px"></span>展示商品:
+		<div class="control-group">
+			<label class="control-label">商品图1:</label>
+			<div class="controls">
+				<form:hidden  id="relatedImages0" path="relatedImages[0].image" htmlEscape="false" maxlength="255" class="input-xlarge"/>
+				<sys:ckfinder input="relatedImages0" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+				<form:input path="relatedImages[0].jumpLink" htmlEscape="false" maxlength="255" class="input-xlarge " placeholder="请输入商品图1链接"/>
+			</div>
+			<div class="controls" style="padding-top: 20px;">
+				<p style="color:#D0D0D0 ;">建议尺寸:134px*134px</p>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label">商品图2:</label>
+			<div class="controls">
+				<form:hidden  id="relatedImages1" path="relatedImages[1].image" htmlEscape="false" maxlength="255" class="input-xlarge"/>
+				<sys:ckfinder input="relatedImages1" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+				<form:input path="relatedImages[1].jumpLink" htmlEscape="false" maxlength="255" class="input-xlarge " placeholder="请输入商品图2链接"/>
+			</div>
+			<div class="controls" style="padding-top: 20px;">
+				<p style="color:#D0D0D0 ;">建议尺寸:134px*134px</p>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label">商品图3:</label>
+			<div class="controls">
+				<form:hidden  id="relatedImages2" path="relatedImages[2].image" htmlEscape="false" maxlength="255" class="input-xlarge"/>
+				<sys:ckfinder input="relatedImages2" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+				<form:input path="relatedImages[2].jumpLink" htmlEscape="false" maxlength="255" class="input-xlarge " placeholder="请输入商品图3链接"/>
+			</div>
+			<div class="controls" style="padding-top: 20px;">
+				<p style="color:#D0D0D0 ;">建议尺寸:134px*134px</p>
+			</div>
 		</div>
 		<div class="form-actions">
 			<shiro:hasPermission name="newhome:newPageQualitySupplier:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>

+ 27 - 8
src/main/webapp/WEB-INF/views/modules/newhome/newPageQualitySupplierList.jsp

@@ -10,7 +10,7 @@
 	</style>
 	<script type="text/javascript">
 		$(document).ready(function() {
-			
+
 		});
 		function page(n,s){
 			$("#pageNo").val(n);
@@ -81,7 +81,7 @@
 
         function g()
         {
-            window.location.href="${ctx}/newhome/newPageQualitySupplier/";//刷新页面
+            window.location.href="${ctx}/newhome/newPageQualitySupplier/?shopTypeId=${newPageQualitySupplier.shopTypeId}";//刷新页面
         }
 
         //修改排序值
@@ -93,23 +93,41 @@
 </head>
 <body>
 	<ul class="nav nav-tabs">
+		<li class=""><a href="${ctx}/qualityShopType/list">供应商分类列表</a></li>
 		<li class="active"><a href="${ctx}/newhome/newPageQualitySupplier/">优质供应商列表</a></li>
-		<shiro:hasPermission name="newhome:newPageQualitySupplier:edit"><li><a href="${ctx}/newhome/newPageQualitySupplier/form">优质供应商添加</a></li></shiro:hasPermission>
 		<shiro:hasPermission name="newhome:newPageQualitySupplier:edit"><li><a href="${ctx}/newhome/newPageQualitySupplier/formImage">供应商广告图添加</a></li></shiro:hasPermission>
 	</ul>
 	<sys:message content="${message}"/>
-	&nbsp;&nbsp;<input id="batchConfirm" class="btn btn-primary" type="submit"  onclick="batchSaveSort()" value="保存排序"/>
-	<form:form id="searchForm" modelAttribute="newPageQualitySupplier" action="${ctx}/newhome/newPageQualitySupplier/" method="post" class="breadcrumb form-search">
+	<form:form id="searchForm" modelAttribute="newPageQualitySupplier" action="${ctx}/newhome/newPageQualitySupplier/?shopTypeId=${newPageQualitySupplier.shopTypeId}" 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}"/>
+		<label>分类名称:</label>
+		<form:input path="supplierName" htmlEscape="false" maxlength="50" class="input-medium"/>
+		<label>状态:</label>
+		<form:select path="wwwEnabledStatus" class="input-medium">
+			<form:option value="" label="全部"/>
+			<form:option value="1" label="已上架"/>
+			<form:option value="0" label="已下架"/>
+		</form:select>
+		<label>点击时间:</label>
+		<form:input path="startPvCreateTime" type="text" maxlength="20" class="input-mini Wdate" value="${fns:setDate(newPageQualitySupplier.startPvCreateTime,'yyyy-MM-dd')}"
+					onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
+		-
+		<form:input path="endPvCreateTime" type="text" maxlength="20" class="input-mini Wdate" value="${fns:setDate(newPageQualitySupplier.endPvCreateTime,'yyyy-MM-dd')}"
+					onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
+		<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
+		&nbsp;&nbsp;<input id="batchConfirm" class="btn btn-primary" type="submit"  onclick="batchSaveSort()" value="一键排序"/>
+		<input class="btn btn-primary"  type="button" onclick="location='${ctx}/newhome/newPageQualitySupplier/form?shopTypeId=${newPageQualitySupplier.shopTypeId}'" value="添加" />
+		<div class="clearfix"></div>
 	</form:form>
 	<table id="contentTable" class="table table-striped table-bordered table-condensed">
 		<thead>
 			<tr>
 				<th>ID</th>
-				<th>供应商</th>
-				<th>图片</th>
+				<th>供应商名称</th>
+				<th>供应商logo</th>
 				<th>链接</th>
+				<th>点击量</th>
 				<th>排序</th>
 				<th>小程序端状态</th>
 				<th>PC端状态</th>
@@ -125,6 +143,7 @@
 				<td>${newPageQualitySupplier.supplierName}</td>
 				<td ><img style="width:120px;height: 80px;" src="${newPageQualitySupplier.image}"></td>
 				<td><a href="${newPageQualitySupplier.link}" target="_blank">${newPageQualitySupplier.link}</a></td>
+				<td>${newPageQualitySupplier.pv}</td>
 				<td><input  id="sort" name="sort" style="width:50px;" value="${newPageQualitySupplier.sort}"  onkeyup="this.value=this.value.replace(/\D/g,'0')"  onchange="changeSort(${newPageQualitySupplier.id},this)"></td>
 				<td><shiro:hasPermission name="newhome:newPageQualitySupplier:edit">
 					<c:if test="${newPageQualitySupplier.crmEnabledStatus eq 1 }">
@@ -164,4 +183,4 @@
 	</table>
 	<div class="pagination">${page}</div>
 </body>
-</html>
+</html>

+ 67 - 0
src/main/webapp/WEB-INF/views/modules/newhome/qualityShopTypeFrom.jsp

@@ -0,0 +1,67 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
+<html>
+<head>
+	<title>优质供应商分类管理</title>
+	<meta name="decorator" content="default"/>
+	<script type="text/javascript">
+		$(document).ready(function () {
+			$("#inputForm").validate({
+				submitHandler: function (form) {
+					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 class=""><a href="${ctx}/qualityShopType/list">供应商分类列表</a></li>
+	<li class="active"><a
+			href="${ctx}/qualityShopType/form?id=${cmQualityShopType.id}">${not empty cmQualityShopType.id?'编辑':'添加'}</a>
+	</li>
+</ul>
+<br/>
+<form:form id="inputForm" modelAttribute="cmQualityShopType" action="${ctx}/qualityShopType/save" 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">
+			<form:input path="typeName" htmlEscape="false" maxlength="20" class="input-xlarge required"/>
+		</div>
+	</div>
+	<div class="control-group">
+		<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>排序:</label>
+		<div class="controls">
+			<form:input path="sort" htmlEscape="false" type="numder" maxlength="20" class="input-xlarge required"/>
+		</div>
+	</div>
+
+	<div class="control-group crmstatus" style="">
+		<label class="control-label">状态:</label>
+		<div class="controls">
+			<form:select path="status" class="input-xlarge ">
+				<form:options items="${fns:getDictList('enabled_status')}" itemLabel="label" itemValue="value"
+							  htmlEscape="false"/>
+			</form:select>
+		</div>
+	</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>
+</body>
+</html>

+ 106 - 0
src/main/webapp/WEB-INF/views/modules/newhome/qualityShopTypeList.jsp

@@ -0,0 +1,106 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
+<html>
+<head>
+    <title>优质供应商分类管理</title>
+    <meta name="decorator" content="default"/>
+    <script type="text/javascript">
+        $(document).ready(function () {
+
+        });
+
+        function page(n, s) {
+            $("#pageNo").val(n);
+            $("#pageSize").val(s);
+            $("#searchForm").submit();
+            return false;
+        }
+
+        function updateStatus(status, sort, id) {
+            $.post("${ctx}/qualityShopType/updateStatus", {
+                'sort': sort,
+                'status': status,
+                'id': id
+            }, function (data) {
+                if (sort == null) {
+                    if (true == data.success) {
+                        $.jBox.tip(data.msg, 'info');
+                    } else {
+                        $.jBox.tip(data.msg, 'error');
+                    }
+                }
+            }, "JSON");//这里返回的类型有:json,html,xml,text
+        }
+
+        function updateEnabledStatus(status, sort, id) {
+            var msg = '确定上架吗?';
+            if ('0' == status) {
+                msg = '确定下架吗?下架后商城不再显示';
+            }
+            top.$.jBox.confirm(msg, '系统提示', function (v, h, f) {
+                if (v == 'ok') {
+                    updateStatus(status, sort, id)
+                    history.go(0)
+                }
+                return;
+            }, {buttonsFocus: 1, persistent: true});
+        }
+
+    </script>
+</head>
+<body>
+<ul class="nav nav-tabs">
+    <li class="active"><a href="${ctx}/qualityShopType/list">供应商分类列表</a></li>
+</ul>
+<form:form id="searchForm" modelAttribute="cmQualityShopType" action="${ctx}/qualityShopType/list" 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}"/>
+    <label>分类名称:</label>
+    <form:input path="typeName" htmlEscape="false" maxlength="50" class="input-medium"/>
+    <label>状态:</label>
+    <form:select path="status" class="input-medium">
+        <form:option value="" label="全部"/>
+        <form:option value="1" label="已上架"/>
+        <form:option value="0" label="已下架"/>
+    </form:select>
+    <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
+    <input class="btn btn-primary" type="submit" value="一键排序"/>
+    <input class="btn btn-primary" type="button" onclick="location='${ctx}/qualityShopType/form'" value="添加"/>
+    <div class="clearfix"></div>
+</form:form>
+<sys:message content="${message}"/>
+<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>
+    </tr>
+    </thead>
+    <tbody>
+    <c:forEach items="${page.list}" var="item" varStatus="status">
+        <tr>
+            <td>${item.id}</td>
+            <td>${item.typeName}</td>
+            <td><input type="number" style="width:50px;" value="${item.sort}"
+                       onfocusout="updateStatus(null,this.value,${item.id})"></td>
+            <td>${item.status==1?'<font color="blue">已上架</font>':'<font color="red">已下架</font>'}</td>
+            <td><fmt:formatDate value="${item.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
+            <td>
+                <a href="#"
+                   onclick="updateEnabledStatus(${item.status==1?0:1},null,${item.id})">${item.status==0?'<font color="blue">已上架</font>':'<font color="red">已下架</font>'}</a>
+                <a href="${ctx}/qualityShopType/form?id=${item.id}">编辑</a>
+                <a href="${ctx}/qualityShopType/del/${item.id}" onclick="return confirmx('确定删除吗?删除后不可恢复!', this.href)">删除</a>
+                <a href="${ctx}/newhome/newPageQualitySupplier/?shopTypeId=${item.id}">供应商列表</a>
+            </td>
+        </tr>
+    </c:forEach>
+    </tbody>
+</table>
+<div class="pagination">${page}</div>
+</body>
+</html>

+ 93 - 4
src/main/webapp/WEB-INF/views/modules/user/newCmShopList.jsp

@@ -145,20 +145,41 @@
 			border: 1px solid #666;
 			border-radius: 5px;
 		}
-		.auditNote{
+
+		.auditNote {
 			width: 250px;
 			height: 50px;
 			margin: 0 auto;
 		}
+
 		#auditBox .auditCheckBox input:checked + span {
 			background-color: #E6633A
 		}
+
+		.setPower {
+			width: 300px;
+			height: 240px;
+			border: 1px #000000 solid;
+			background: white;
+			position: fixed;
+			top: 0;
+			right: 0;
+			bottom: 0;
+			left: 0;
+			margin: auto;
+			display: none;
+		}
+
+		.setPower div {
+			padding: 10px 10px 10px 20px;
+		}
 	</style>
 	<script type="text/javascript">
-		$(document).ready(function() {
+		$(document).ready(function () {
 
 		});
-		function page(n,s){
+
+		function page(n, s) {
 			$("#pageNo").val(n);
 			$("#pageSize").val(s);
 			$("#searchForm").submit();
@@ -305,7 +326,9 @@
 					<a href="${ctx}/user/newCmShop/form?id=${newCmShop.shopID}&editStatus=1">编辑</a>
 					<c:if test="${newCmShop.status eq 3 || newCmShop.status eq 92}">
 						<%--						<a href="${ctx}/user/newCmShop/form?id=${newCmShop.shopID}&editStatus=2">审核</a>--%>
-						<a href="javascript:void(0)"  onclick="auditShop(${newCmShop.shopID},${newCmShop.userID},'${newCmShop.townID}','${newCmShop.address}','${newCmShop.name}','${newCmShop.linkMan}','${newCmShop.contractMobile}')"> 审核</a>
+						<a href="javascript:void(0)"
+						   onclick="auditShop(${newCmShop.shopID},${newCmShop.userID},'${newCmShop.townID}','${newCmShop.address}','${newCmShop.name}','${newCmShop.linkMan}','${newCmShop.contractMobile}')">
+							审核</a>
 					</c:if>
 					<c:if test="${newCmShop.status eq 90 || newCmShop.status eq 91 }">
 						<a href="javascript:void(0);" onclick="updatePwd(${newCmShop.userID})">重置密码</a>
@@ -314,6 +337,7 @@
 					<a href="${ctx}/user/newCmShop/maintenanceList?shopID=${newCmShop.shopID}&shopName=${newCmShop.name}">上架费记录</a>
 					<a href="${ctx}/user/newCmShop/formShop?shopID=${newCmShop.shopID}">线下转账信息</a>
 					<a href="javascript:void(0)" onclick="empowerLogin(${newCmShop.userID})">授权登录</a>
+					<a href="javascript:void(0)" onclick="setPower(1,${newCmShop.userID})">广告权限设置</a>
 				</td>
 			</shiro:hasPermission>
 		</tr>
@@ -321,6 +345,25 @@
 	</tbody>
 </table>
 <div class="pagination">${page}</div>
+
+
+<div class="setPower">
+	<div style="border-bottom:1px #000000 solid"><b>广告权限设置</b></div>
+	<input type="hidden" name="userId">
+	<div><input type="checkbox" name="power" value="1">首页广告</div>
+	<div value=" "><input type="checkbox" name="power" value=" ">信息中心广告
+		<div>
+			<span style="display: inline-block; width: 80px"><input type="checkbox" name="power" value="2">左侧广告</span>
+			<span style="display: inline-block; width: 80px"><input type="checkbox" name="power" value="3">右上广告</span>
+			<span style="display: inline-block; width: 80px ;padding-top: 10px;"><input type="checkbox" name="power"
+																						value="4">右下广告</span>
+		</div>
+	</div>
+	<div style="position: relative; float: right">
+		<button onclick="setPower(0,null)">取消</button>
+		<button onclick="setPower(0,$('input[name=\'userId\']').val())">确认</button>
+	</div>
+</div>
 <!-- 模态框(Modal)供应商暂存 -->
 <div class="modal fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
 	<div class="modal-dialog">
@@ -605,6 +648,14 @@
 </script>
 <script>
 	$(document).ready(function() {
+		$('input[name="power"]').change(function (){
+			if(1<$(this).val()){
+				if (!$('input[name="power"][value=" "]').get(0).checked){
+					top.$.jBox.tip("请先勾选信息中心广告...");
+					$(this).attr('checked', false);
+				}
+			}
+		})
 		$('.shopType').on('click',function () {
 			$('#confirm').attr('data-id',$(this).attr('data-shopID'))
 			$('#confirm').attr('data-flag',$(this).attr('data-flag'))
@@ -848,6 +899,44 @@
 		console.log(userId);
 		window.open(wwwServer + "login-fast.html?userId=" + userId, "_blank");
 	}
+
+	// 广告权限设置
+	function setPower(hideType, userId) {
+		if (hideType == 1) {
+			$('.setPower').show()
+			$('input[name=\'userId\']').val(userId)
+			$.post("${ctx}/user/newCmShop/getUserPower", {'userId': userId}, function (data) {
+				if (true == data.success) {
+					for (let i = 0; i <data.data.length ; i++) {
+						let value=data.data[i]
+						$('input[name="power"][value="'+value+'"]').attr('checked', true);
+						if (1<value){
+							$('input[name="power"][value=" "]').attr('checked', true);
+						}
+					}
+				} else {
+					$.jBox.tip(data.msg, 'error');
+				}
+			}, "JSON");//这里返回的类型有:json,html,xml,text
+		} else {
+			$('.setPower').hide()
+			let checkList = [];
+			$('input[name="power"]:checked').each(function () {
+				checkList.push($(this).val());
+				$(this).attr('checked', false);
+			});
+			if (null!=userId){
+				$.post("${ctx}/user/newCmShop/updateUserPower", {'userId': userId,"powers":checkList.toString()}, function (data) {
+					if (true == data.success) {
+						$.jBox.tip(data.msg, 'info');
+					} else {
+						$.jBox.tip(data.msg, 'error');
+					}
+				}, "JSON");//这里返回的类型有:json,html,xml,text
+			}
+		}
+	}
+
 </script>
 </body>
 </html>