瀏覽代碼

呵呵改版

Aslee 3 年之前
父節點
當前提交
a7e1a6159e

+ 2 - 2
src/main/java/com/caimei/modules/cmpage/dao/CmPageCentreDao.java

@@ -28,9 +28,9 @@ public interface CmPageCentreDao extends CrudDao<CmPageCentre> {
 
     void saveSort(@Param("sort") String sort, @Param("id") String id);
 
-    NewPageFloorContent findFloorContentByCentreId(Integer centreId);
+    NewPageFloorContent findFloorContentByCentreId(@Param("centreId") Integer centreId);
 
-    List<NewPageFloorImage> findFloorImage(Integer centreId);
+    List<NewPageFloorImage> findFloorImage(@Param("centreId") Integer centreId, @Param("type") String type);
 
     void deletePageImage(String centreId);
 

+ 2 - 2
src/main/java/com/caimei/modules/cmpage/service/CmPageCentreService.java

@@ -110,9 +110,9 @@ public class CmPageCentreService extends CrudService<CmPageCentreDao, CmPageCent
         cmPageCentreDao.saveSort(sort, id);
     }
 
-    public NewPageFloorContent findFloorContent(Integer centreId) {
+    public NewPageFloorContent findFloorContent(Integer centreId, String type) {
         NewPageFloorContent floorContent = cmPageCentreDao.findFloorContentByCentreId(centreId);
-        List<NewPageFloorImage> floorImageList = cmPageCentreDao.findFloorImage(centreId);
+        List<NewPageFloorImage> floorImageList = cmPageCentreDao.findFloorImage(centreId, type);
         floorImageList.forEach(image -> {
             if (image.getProductId() != null) {
                 Product product = productDao.get(image.getProductId().toString());

+ 5 - 3
src/main/java/com/caimei/modules/cmpage/web/CmPageCentreController.java

@@ -119,8 +119,10 @@ public class CmPageCentreController extends BaseController {
         }
         cmPageCentreService.save(cmPageCentre);
         addMessage(redirectAttributes, "保存成功");
-        //清除产品仪器缓存
-        cleanRedisCache();
+        if (!"8".equals(cmPageCentre.getType())) {
+            //清除产品仪器缓存
+            cleanRedisCache();
+        }
         return "redirect:" + Global.getAdminPath() + "/cmpage/cmPageCentre/?pageId=" + cmPageCentre.getPageId() + "&type=" + cmPageCentre.getType();
     }
 
@@ -226,7 +228,7 @@ public class CmPageCentreController extends BaseController {
 
     @RequestMapping(value = "goContentPage")
     public String goContentPage(NewPageFloorContent newPageFloorContent, Model model) {
-        NewPageFloorContent floorContent = cmPageCentreService.findFloorContent(newPageFloorContent.getCentreId());
+        NewPageFloorContent floorContent = cmPageCentreService.findFloorContent(newPageFloorContent.getCentreId(), newPageFloorContent.getType());
         floorContent.setPageId(newPageFloorContent.getPageId());
         floorContent.setType(newPageFloorContent.getType());
         floorContent.setRedirectFlag(1);

+ 4 - 4
src/main/java/com/caimei/modules/hehe/service/CmHeheActivityProductService.java

@@ -30,7 +30,7 @@ public class CmHeheActivityProductService extends CrudService<CmHeheActivityProd
     private CmHeheActivityProductDao activityProductDao;
 
     @Autowired
-    private CmHeheProductDao heheProductDao;
+    private CmHeheProductDao cmHeheProductDao;
 
     public CmHeheActivityProduct get(String id) {
         CmHeheActivityProduct activityProduct = super.get(id);
@@ -65,11 +65,11 @@ public class CmHeheActivityProductService extends CrudService<CmHeheActivityProd
     }
 
     public Page<CmHeheProduct> findProductPage(Page<CmHeheProduct> productPage, CmHeheProduct product) {
-        List<Integer> productIds = heheProductDao.findActivityProductIds();
+        List<Integer> productIds = cmHeheProductDao.findActivityProductIds();
         // 已参与拼团商品id
-        List<Integer> collageProductIds = heheProductDao.findCollageProductIds();
+        List<Integer> collageProductIds = cmHeheProductDao.findCollageProductIds();
         // 已参与限时特价的商品id
-        List<Integer> discountProductIds = heheProductDao.findDiscountProductIds();
+        List<Integer> discountProductIds = cmHeheProductDao.findDiscountProductIds();
         productIds.addAll(collageProductIds);
         productIds.addAll(discountProductIds);
         product.setIds(productIds);

+ 4 - 4
src/main/java/com/caimei/modules/hehe/service/CmHeheCollageProductService.java

@@ -35,7 +35,7 @@ public class CmHeheCollageProductService extends CrudService<CmHeheCollageProduc
 	private CmHeheCollageProductDao cmHeheCollageProductDao;
 
 	@Resource
-	private CmHeheProductDao heheProductDao;
+	private CmHeheProductDao cmHeheProductDao;
 
 	public CmHeheCollageProduct get(String id) {
 		return super.get(id);
@@ -72,11 +72,11 @@ public class CmHeheCollageProductService extends CrudService<CmHeheCollageProduc
 		product.setPage(productPage);
 		product.setSearchType(2);
 		// 已参与拼团商品id
-		List<Integer> productIds = heheProductDao.findCollageProductIds();
+		List<Integer> productIds = cmHeheProductDao.findCollageProductIds();
 		// 已参与商品活动商品id
-		List<Integer> actProductIds = heheProductDao.findActivityProductIds();
+		List<Integer> actProductIds = cmHeheProductDao.findActivityProductIds();
 		// 已参与限时特价活动商品id
-		List<Integer> discountProductIds = heheProductDao.findDiscountProductIds();
+		List<Integer> discountProductIds = cmHeheProductDao.findDiscountProductIds();
 		productIds.addAll(actProductIds);
         productIds.addAll(discountProductIds);
 		product.setIds(productIds);

+ 4 - 4
src/main/java/com/caimei/modules/hehe/service/HeheDiscountActivityProductService.java

@@ -31,7 +31,7 @@ public class HeheDiscountActivityProductService extends CrudService<HeheDiscount
 	@Autowired
 	private CmHeheActivityProductDao activityProductDao;
 	@Autowired
-	private CmHeheProductDao heheProductDao;
+	private CmHeheProductDao cmHeheProductDao;
 
 	public HeheDiscountActivityProduct get(String id) {
 		return super.get(id);
@@ -62,11 +62,11 @@ public class HeheDiscountActivityProductService extends CrudService<HeheDiscount
 
     public Page<CmHeheProduct> findProductPage(Page<CmHeheProduct> productPage, CmHeheProduct product) {
 		// 已参与拼团商品id
-		List<Integer> productIds = heheProductDao.findCollageProductIds();
+		List<Integer> productIds = cmHeheProductDao.findCollageProductIds();
 		// 已参与商品活动商品id
-		List<Integer> actProductIds = heheProductDao.findActivityProductIds();
+		List<Integer> actProductIds = cmHeheProductDao.findActivityProductIds();
 		// 已参与限时特价活动商品id
-		List<Integer> discountProductIds = heheProductDao.findDiscountProductIds();
+		List<Integer> discountProductIds = cmHeheProductDao.findDiscountProductIds();
 		productIds.addAll(actProductIds);
 		productIds.addAll(discountProductIds);
         product.setIds(productIds);

+ 4 - 0
src/main/java/com/caimei/modules/hehe/service/HeheHomeTypeService.java

@@ -2,6 +2,7 @@ package com.caimei.modules.hehe.service;
 
 import java.util.List;
 
+import com.caimei.modules.miniprogram.utils.UploadPicUtils;
 import com.caimei.modules.product.entity.CmBigtype;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -39,6 +40,9 @@ public class HeheHomeTypeService extends CrudService<HeheHomeTypeDao, HeheHomeTy
 	
 	@Transactional(readOnly = false)
 	public void save(HeheHomeType heheHomeType) {
+		if (!heheHomeType.getIcon().contains("http")) {
+			heheHomeType.setIcon(UploadPicUtils.saveImageToServer(heheHomeType.getIcon()));
+		}
 		super.save(heheHomeType);
 	}
 	

+ 4 - 12
src/main/java/com/caimei/modules/product/web/CmBigtypeController.java

@@ -106,9 +106,7 @@ public class CmBigtypeController extends BaseController {
 			cmBigtype.setTypeSort(null);
 		}
 		cmBigtypeService.save(cmBigtype);
-		if (1 == cmBigtype.getMallType()) {
-			cleanRedisCache();
-		}
+		cleanRedisCache();
 //		if (flag){
 //			cmBigtypeService.mutiUpdateCode(cmBigtype.getBigTypeID());
 //		}
@@ -183,9 +181,7 @@ public class CmBigtypeController extends BaseController {
 				cmBigtype.setSortIndex(Integer.parseInt(status));
 			}
 			cmBigtypeService.update(cmBigtype);
-			if (1 == cmBigtype.getMallType()) {
-				cleanRedisCache();
-			}
+			cleanRedisCache();
 			map.put("success",true);
 			map.put("msg", "修改成功");
 		} catch (Exception e) {
@@ -206,9 +202,7 @@ public class CmBigtypeController extends BaseController {
 	public String delete(CmBigtype cmBigtype, RedirectAttributes redirectAttributes) {
 		cmBigtype.setMallType(null == cmBigtype.getMallType() ? 1 : cmBigtype.getMallType());
 		cmBigtypeService.delete(cmBigtype);
-		if (1 == cmBigtype.getMallType()) {
-			cleanRedisCache();
-		}
+		cleanRedisCache();
 		addMessage(redirectAttributes, "删除大分类成功");
 		return "redirect:" + Global.getAdminPath() + "/product/cmBigtype/?repage&mallType=" + cmBigtype.getMallType();
 	}
@@ -234,9 +228,7 @@ public class CmBigtypeController extends BaseController {
 	public JsonModel updateSortIndex(String bigTypeIdSortIndexs,Integer mallType){
 		JsonModel jsonModel = JsonModel.newInstance();
 		cmBigtypeService.updateSortIndex(bigTypeIdSortIndexs);
-		if (null == mallType) {
-			cleanRedisCache();
-		}
+		cleanRedisCache();
 		return jsonModel.success("批量更新排序成功");
 	}
 	/**

+ 3 - 9
src/main/java/com/caimei/modules/product/web/CmSmalltypeController.java

@@ -106,9 +106,7 @@ public class CmSmalltypeController extends BaseController {
 			cmSmalltype.setAddTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
 		}
 		cmSmalltypeService.save(cmSmalltype);
-		if (1 == cmSmalltype.getMallType()) {
-			cleanRedisCache();
-		}
+		cleanRedisCache();
 //		if (flag){
 //			cmSmalltypeService.mutiUpdateCode(cmSmalltype.getSmallTypeID());
 //		}
@@ -197,9 +195,7 @@ public class CmSmalltypeController extends BaseController {
 	@RequestMapping(value = "delete")
 	public String delete(CmSmalltype cmSmalltype, RedirectAttributes redirectAttributes) {
 		cmSmalltypeService.delete(cmSmalltype);
-		if (1 == cmSmalltype.getMallType()) {
-			cleanRedisCache();
-		}
+		cleanRedisCache();
 		addMessage(redirectAttributes, "删除小分类成功");
 		return "redirect:" + Global.getAdminPath() + "/product/cmSmalltype/?repage&bigTypeID=" + cmSmalltype.getBigTypeID() + "&mallType=" + cmSmalltype.getMallType();
 	}
@@ -242,9 +238,7 @@ public class CmSmalltypeController extends BaseController {
 	public JsonModel updateSortIndex(String smallTypeIdSortIndexs,Integer mallType){
 		JsonModel jsonModel = JsonModel.newInstance();
 		cmSmalltypeService.updateSortIndex(smallTypeIdSortIndexs);
-		if (null == mallType) {
-			cleanRedisCache();
-		}
+		cleanRedisCache();
 		return jsonModel.success("批量更新排序成功");
 	}
 }

+ 2 - 2
src/main/resources/config/dev/dfs_client.conf

@@ -11,8 +11,8 @@ base_path=/home/yuqing/fastdfs
 
 # tracker_server can ocur more than once, and tracker_server format is
 #  "host:port", host can be hostname or ip address
-# tracker_server=192.168.2.100:22122
-tracker_server=172.31.165.28:22122
+tracker_server=192.168.2.100:22122
+# tracker_server=172.31.165.28:22122
 
 #standard log level as syslog, case insensitive, value list:
 ### emerg for emergency

+ 4 - 0
src/main/resources/mappings/modules/cmpage/CmPageCentreMapper.xml

@@ -199,8 +199,12 @@
 		  new_page_floor_image a
 		  LEFT JOIN product p ON a.productId = p.productID
 		  LEFT JOIN shop s on p.shopID = s.shopID
+		  left join cm_hehe_product chp on a.productId = chp.productId
 		WHERE
 		  a.centreId = #{centreId}
+          <if test="type != null and type == '8'">
+              and chp.id is not null
+          </if>
 	</select>
 
 	<select id="findPageTitle" resultType="java.lang.String">

+ 1 - 0
src/main/resources/mappings/modules/hehe/CmHeheActivityProductMapper.xml

@@ -37,6 +37,7 @@
 		<where>
 			a.delFlag = 0
 			AND a.activityId = #{activityId}
+			and chp.id is not null
 			<if test="name != null and name != ''">
 				AND p.name LIKE CONCAT('%',#{name},'%')
 			</if>

+ 2 - 1
src/main/resources/mappings/modules/hehe/CmHeheCollageProductMapper.xml

@@ -18,7 +18,7 @@
 	
 	<sql id="cmHeheCollageProductJoins">
 		left join product p on a.productId = p.productID
-		left join cm_hehe_product hp on p.productID = hp.productId
+		left join cm_hehe_product chp on p.productID = chp.productId
 		left join shop s on p.shopID = s.shopID
 	</sql>
     
@@ -36,6 +36,7 @@
 		FROM cm_hehe_collage_product a
 		<include refid="cmHeheCollageProductJoins"/>
 		<where>
+			chp.id is not null
 			<if test="id != null and id != ''">
 				AND a.id = #{id}
 			</if>

+ 2 - 1
src/main/resources/mappings/modules/hehe/HeheDiscountActivityProductMapper.xml

@@ -15,6 +15,7 @@
 	</sql>
 	
 	<sql id="heheDiscountActivityProductJoins">
+		LEFT JOIN cm_hehe_product chp ON a.productId = chp.productId
 		LEFT JOIN product p ON a.productId = p.productID
 		LEFT JOIN shop s ON s.shopID = p.shopID
 	</sql>
@@ -33,7 +34,7 @@
 		FROM hehe_discount_activity_product a
 		<include refid="heheDiscountActivityProductJoins"/>
 		<where>
-
+			chp.id is not null
 			<if test="activityId != null">
 				and a.activityId = #{activityId}
 			</if>

+ 2 - 2
src/main/webapp/WEB-INF/views/modules/hehe/cmHeheFloorContentForm.jsp

@@ -180,7 +180,7 @@
                     var appletsIcon4 = $("#appletsIcon4").val();
                     var appletsIcon5 = $("#appletsIcon5").val();
                     debugger
-                    if (templateType == 1 || templateType == 2 || templateType == 3 || templateType == 6 || templateType == 7) {
+                    if (templateType == 1 || templateType == 2 || templateType == 3 || templateType == 6 || templateType == 7 || templateType == 8) {
                         if (appletsIcon1 == '') {
                             alertx("请上传广告图1");
                             return;
@@ -612,7 +612,7 @@
             $("#displayDateDiv").css('display', 'none');
             $("#productImageTable").hide();
             //广告图
-            if (templateType === 1 || templateType === 2 || templateType === 3 || templateType === 6 || templateType === 7) {
+            if (templateType === 1 || templateType === 2 || templateType === 3 || templateType === 6 || templateType === 7 || templateType == 8) {
                 $('.Image1').show();
             }
             if (templateType === 2 || templateType === 3 || templateType === 6 || templateType === 7) {