Browse Source

代码整理

Aslee 4 years ago
parent
commit
c9e37fc3b8

+ 0 - 4
src/main/java/com/caimei/modules/hehe/dao/CmHeheFloorDao.java

@@ -1,13 +1,10 @@
 package com.caimei.modules.hehe.dao;
 
 import com.caimei.modules.hehe.entity.CmHeheFloor;
-import com.caimei.modules.hehe.entity.CmHeheFloorProduct1;
 import com.thinkgem.jeesite.common.persistence.CrudDao;
 import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
 import org.apache.ibatis.annotations.Param;
 
-import java.util.List;
-
 /**
  * 呵呵商品商品楼层DAO接口
  * @author Aslee
@@ -20,5 +17,4 @@ public interface CmHeheFloorDao extends CrudDao<CmHeheFloor> {
 
     void saveSort(@Param("sort") String sort, @Param("floorId") String id);
 
-    List<CmHeheFloorProduct1> getProductList(CmHeheFloorProduct1 floorProduct);
 }

+ 0 - 88
src/main/java/com/caimei/modules/hehe/entity/CmHeheFloorProduct1.java

@@ -1,88 +0,0 @@
-package com.caimei.modules.hehe.entity;
-
-import com.thinkgem.jeesite.common.persistence.DataEntity;
-
-import java.util.Date;
-
-/**
- * 呵呵商品商品楼层Entity
- * @author Aslee
- * @version 2021-06-17
- */
-public class CmHeheFloorProduct1 extends DataEntity<CmHeheFloorProduct1> {
-
-	private static final long serialVersionUID = 1L;
-	private Integer floorId;		// 楼层id
-	private Integer productId;		// 商品id
-	private Integer validFlag;		// 上架状态,0下架,1上架
-	private Integer recommend;		// 是否为推荐商品(0 没推荐,1 推荐商品)
-	private String sort;		// 排序
-	private Date addTime;		// 添加时间
-
-	private String productName;		//商品名称
-	private String mainImage;		//商品图片
-
-	public Integer getFloorId() {
-		return floorId;
-	}
-
-	public void setFloorId(Integer floorId) {
-		this.floorId = floorId;
-	}
-
-	public Integer getProductId() {
-		return productId;
-	}
-
-	public void setProductId(Integer productId) {
-		this.productId = productId;
-	}
-
-	public Integer getValidFlag() {
-		return validFlag;
-	}
-
-	public void setValidFlag(Integer validFlag) {
-		this.validFlag = validFlag;
-	}
-
-	public Integer getRecommend() {
-		return recommend;
-	}
-
-	public void setRecommend(Integer recommend) {
-		this.recommend = recommend;
-	}
-
-	public String getSort() {
-		return sort;
-	}
-
-	public void setSort(String sort) {
-		this.sort = sort;
-	}
-
-	public Date getAddTime() {
-		return addTime;
-	}
-
-	public void setAddTime(Date addTime) {
-		this.addTime = addTime;
-	}
-
-	public String getProductName() {
-		return productName;
-	}
-
-	public void setProductName(String productName) {
-		this.productName = productName;
-	}
-
-	public String getMainImage() {
-		return mainImage;
-	}
-
-	public void setMainImage(String mainImage) {
-		this.mainImage = mainImage;
-	}
-}

+ 0 - 16
src/main/java/com/caimei/modules/hehe/service/CmHeheFloorService.java

@@ -3,10 +3,6 @@ package com.caimei.modules.hehe.service;
 import java.util.List;
 
 import com.caimei.modules.hehe.entity.CmHeheFloor;
-import com.caimei.modules.hehe.entity.CmHeheFloorProduct1;
-import com.caimei.utils.AppUtils;
-import com.caimei.utils.StringUtil;
-import com.thinkgem.jeesite.common.config.Global;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -49,16 +45,4 @@ public class CmHeheFloorService extends CrudService<CmHeheFloorDao, CmHeheFloor>
 		super.delete(cmHeheFloor);
 	}
 
-	public Page<CmHeheFloorProduct1> findProductPage(Page<CmHeheFloorProduct1> page, CmHeheFloorProduct1 floorProduct) {
-		floorProduct.setPage(page);
-		List<CmHeheFloorProduct1> productList = cmHeheFloorDao.getProductList(floorProduct);
-		String wwwServer = Global.getConfig("wwwServer");
-		productList.forEach(item -> {
-			if (StringUtil.isNotBlank(item.getMainImage())) {
-				item.setMainImage(AppUtils.getImageURL("product", item.getMainImage(), 0, wwwServer));
-			}
-		});
-		page.setList(productList);
-		return page;
-	}
 }

+ 0 - 20
src/main/java/com/caimei/modules/hehe/web/CmHeheFloorController.java

@@ -6,7 +6,6 @@ import javax.servlet.http.HttpServletResponse;
 
 import com.caimei.modules.hehe.dao.CmHeheFloorDao;
 import com.caimei.modules.hehe.entity.CmHeheFloor;
-import com.caimei.modules.hehe.entity.CmHeheFloorProduct1;
 import com.google.common.collect.Maps;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
@@ -142,23 +141,4 @@ public class CmHeheFloorController extends BaseController {
 		}
 	}
 
-	/**
-	 * 楼层商品列表
-	 */
-	@RequestMapping(value = "productList")
-	public String productList(CmHeheFloorProduct1 floorProduct, HttpServletRequest request, HttpServletResponse response, Model model) {
-		Page<CmHeheFloorProduct1> page = cmHeheFloorService.findProductPage(new Page<CmHeheFloorProduct1>(request, response), floorProduct);
-		model.addAttribute("floorProduct", floorProduct);
-		model.addAttribute("page", page);
-		return "modules/hehe/cmHeheFloorProductList";
-	}
-
-	/**
-	 * 添加楼层商品
-	 */
-	@RequestMapping(value = "addProduct")
-	public void addProduct(Integer floorId, Integer productId) {
-
-	}
-
 }

+ 0 - 23
src/main/resources/mappings/modules/hehe/CmHeheFloorMapper.xml

@@ -57,29 +57,6 @@
 		</choose>
 	</select>
 
-	<select id="getProductList" resultType="com.caimei.modules.hehe.entity.CmHeheFloorProduct1">
-		select fp.id,fp.productId,p.mainImage, p.name as productName,fp.sort,fp.recommend,fp.addTime,fp.validFlag
-		from cm_hehe_floor_product fp
-		left join cm_hehe_product cp on fp.productId = cp.id
-		left join cm_hehe_floor cf on fp.floorId = cf.id
-		left join product p on cp.productId = p.productID
-		<where>
-			fp.floorId = #{floorId}
-			<if test="productId != null">
-				and cp.id = #{productId}
-			</if>
-			<if test="productName != null and productName != ''">
-				and p.productName like concat('%',#{productName},'%')
-			</if>
-			<if test="validFlag != null">
-				and fp.validFlag = #{validFlag}
-			</if>
-			<if test="recommend != null">
-				and fp.recommend = #{recommend}
-			</if>
-		</where>
-	</select>
-
 	<insert id="insert" parameterType="cmHeheFloor"  keyProperty="id" useGeneratedKeys="true">
 		INSERT INTO cm_hehe_floor(
 			title,