Bläddra i källkod

呵呵老后台列表

zhijiezhao 1 år sedan
förälder
incheckning
176bd3eb4e
22 ändrade filer med 519 tillägg och 30 borttagningar
  1. 26 1
      src/main/java/com/caimei365/manager/controller/hehe/floor/HomeApi.java
  2. 16 0
      src/main/java/com/caimei365/manager/controller/hehe/order/OrderApi.java
  3. 61 9
      src/main/java/com/caimei365/manager/controller/hehe/product/ProductApi.java
  4. 5 0
      src/main/java/com/caimei365/manager/dao/hehe/HeHeHomeDao.java
  5. 10 0
      src/main/java/com/caimei365/manager/dao/hehe/HeHeOrderDao.java
  6. 7 3
      src/main/java/com/caimei365/manager/dao/hehe/HeHeProductDao.java
  7. 33 0
      src/main/java/com/caimei365/manager/entity/hehe/product/DiscountActivity.java
  8. 5 5
      src/main/java/com/caimei365/manager/entity/hehe/product/HeHeActivity.java
  9. 2 2
      src/main/java/com/caimei365/manager/entity/hehe/product/HeHeBigType.java
  10. 52 0
      src/main/java/com/caimei365/manager/entity/hehe/product/HeHeImage.java
  11. 4 4
      src/main/java/com/caimei365/manager/entity/hehe/product/HeHeProduct.java
  12. 44 0
      src/main/java/com/caimei365/manager/entity/hehe/product/InsideDiscount.java
  13. 48 0
      src/main/java/com/caimei365/manager/entity/hehe/product/ShareReduction.java
  14. 5 0
      src/main/java/com/caimei365/manager/service/hehe/floor/HeHeHomeService.java
  15. 14 0
      src/main/java/com/caimei365/manager/service/hehe/floor/impl/HeHeHomeServiceImpl.java
  16. 4 0
      src/main/java/com/caimei365/manager/service/hehe/order/HeHeOrderService.java
  17. 12 0
      src/main/java/com/caimei365/manager/service/hehe/order/impl/HeHeOrderServiceImpl.java
  18. 7 3
      src/main/java/com/caimei365/manager/service/hehe/product/HeHeProductService.java
  19. 54 3
      src/main/java/com/caimei365/manager/service/hehe/product/impl/HeHeProductServiceImpl.java
  20. 30 0
      src/main/resources/mapper/hehe/HeHeHomeDao.xml
  21. 6 0
      src/main/resources/mapper/hehe/HeHeOrderDao.xml
  22. 74 0
      src/main/resources/mapper/hehe/HeHeProductDao.xml

+ 26 - 1
src/main/java/com/caimei365/manager/controller/hehe/floor/HomeApi.java

@@ -4,6 +4,7 @@ import com.caimei365.manager.entity.PaginationVo;
 import com.caimei365.manager.entity.ResponseJson;
 import com.caimei365.manager.entity.hehe.floor.HeHeHomeType;
 import com.caimei365.manager.entity.hehe.floor.ProductFloor;
+import com.caimei365.manager.entity.hehe.product.HeHeImage;
 import com.caimei365.manager.service.hehe.floor.HeHeHomeService;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -20,6 +21,7 @@ public class HomeApi {
 
     /**
      * 首页分类导航
+     *
      * @param pageNum
      * @param pageSize
      * @return
@@ -31,7 +33,8 @@ public class HomeApi {
     }
 
     /**
-     * 商品楼层列表
+     * 首页楼层-商品楼层列表
+     *
      * @param pageNum
      * @param pageSize
      * @return
@@ -42,5 +45,27 @@ public class HomeApi {
         return homeService.productFloor(pageNum, pageSize);
     }
 
+    /**
+     * 首页二维码
+     *
+     * @return
+     */
+    @GetMapping("/qrCode/images")
+    public ResponseJson<String> getQrCode() {
+        return homeService.getQrCode();
+    }
 
+    /**
+     * 轮播图列表
+     * @param image
+     * @param pageNum
+     * @param pageSize
+     * @return
+     */
+    @GetMapping("/image/list")
+    public ResponseJson<PaginationVo<HeHeImage>> productFloor(HeHeImage image,
+                                                              @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
+                                                              @RequestParam(value = "pageSize", defaultValue = "20") int pageSize) {
+        return homeService.imageList(image, pageNum, pageSize);
+    }
 }

+ 16 - 0
src/main/java/com/caimei365/manager/controller/hehe/order/OrderApi.java

@@ -0,0 +1,16 @@
+package com.caimei365.manager.controller.hehe.order;
+
+
+import com.caimei365.manager.service.hehe.order.HeHeOrderService;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+
+@RestController
+@RequestMapping("/HeHe")
+public class OrderApi {
+
+    @Resource
+    private HeHeOrderService orderService;
+}

+ 61 - 9
src/main/java/com/caimei365/manager/controller/hehe/product/ProductApi.java

@@ -3,9 +3,7 @@ package com.caimei365.manager.controller.hehe.product;
 
 import com.caimei365.manager.entity.PaginationVo;
 import com.caimei365.manager.entity.ResponseJson;
-import com.caimei365.manager.entity.hehe.product.HeHeActivity;
-import com.caimei365.manager.entity.hehe.product.HeHeBigType;
-import com.caimei365.manager.entity.hehe.product.HeHeProduct;
+import com.caimei365.manager.entity.hehe.product.*;
 import com.caimei365.manager.service.hehe.product.HeHeProductService;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -23,6 +21,7 @@ public class ProductApi {
 
     /**
      * 商品管理
+     *
      * @param product
      * @param pageNum
      * @param pageSize
@@ -37,6 +36,7 @@ public class ProductApi {
 
     /**
      * 商品分类管理
+     *
      * @param type
      * @param pageNum
      * @param pageSize
@@ -44,16 +44,68 @@ public class ProductApi {
      */
     @GetMapping("/product/bigType")
     public ResponseJson<PaginationVo<HeHeBigType>> getBigType(HeHeBigType type,
-                                   @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
-                                   @RequestParam(value = "pageSize", defaultValue = "20") int pageSize) {
+                                                              @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
+                                                              @RequestParam(value = "pageSize", defaultValue = "20") int pageSize) {
         return productService.bigTypeList(type, pageNum, pageSize);
     }
 
-
+    /**
+     * 商城活动列表
+     *
+     * @param activity
+     * @param pageNum
+     * @param pageSize
+     * @return
+     */
     @GetMapping("/product/active")
-    public ResponseJson<PaginationVo<HeHeActivity>> getActive(HeHeActivity activity,
-                                                              @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
-                                                              @RequestParam(value = "pageSize", defaultValue = "20") int pageSize) {
+    public ResponseJson<PaginationVo<HeHeActivity>> getActiveList(HeHeActivity activity,
+                                                                  @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
+                                                                  @RequestParam(value = "pageSize", defaultValue = "20") int pageSize) {
         return productService.activeList(activity, pageNum, pageSize);
     }
+
+    /**
+     * 限时特价活动列表
+     *
+     * @param activity
+     * @param pageNum
+     * @param pageSize
+     * @return
+     */
+    @GetMapping("/discount/activity")
+    public ResponseJson<PaginationVo<DiscountActivity>> getActive(DiscountActivity activity,
+                                                                  @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
+                                                                  @RequestParam(value = "pageSize", defaultValue = "20") int pageSize) {
+        return productService.discountActiveList(activity, pageNum, pageSize);
+    }
+
+    /**
+     * 分享减免活动列表
+     *
+     * @param reduction
+     * @param pageNum
+     * @param pageSize
+     * @return
+     */
+    @GetMapping("/reduction/list")
+    public ResponseJson<PaginationVo<ShareReduction>> getReduction(ShareReduction reduction,
+                                                                   @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
+                                                                   @RequestParam(value = "pageSize", defaultValue = "20") int pageSize) {
+        return productService.shareReductionList(reduction, pageNum, pageSize);
+    }
+
+    /**
+     * 内部优惠列表
+     *
+     * @param discount
+     * @param pageNum
+     * @param pageSize
+     * @return
+     */
+    @GetMapping("/inside/discount")
+    public ResponseJson<PaginationVo<InsideDiscount>> insideDiscount(InsideDiscount discount,
+                                                                     @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
+                                                                     @RequestParam(value = "pageSize", defaultValue = "20") int pageSize) {
+        return productService.insideDiscountList(discount, pageNum, pageSize);
+    }
 }

+ 5 - 0
src/main/java/com/caimei365/manager/dao/hehe/HeHeHomeDao.java

@@ -2,6 +2,7 @@ package com.caimei365.manager.dao.hehe;
 
 import com.caimei365.manager.entity.hehe.floor.HeHeHomeType;
 import com.caimei365.manager.entity.hehe.floor.ProductFloor;
+import com.caimei365.manager.entity.hehe.product.HeHeImage;
 import org.apache.ibatis.annotations.Mapper;
 
 import java.util.List;
@@ -12,4 +13,8 @@ public interface HeHeHomeDao {
     List<HeHeHomeType> findHomeTypeList();
 
     List<ProductFloor> findProductFloor();
+
+    String findQrCode();
+
+    List<HeHeImage> findImageList(HeHeImage image);
 }

+ 10 - 0
src/main/java/com/caimei365/manager/dao/hehe/HeHeOrderDao.java

@@ -0,0 +1,10 @@
+package com.caimei365.manager.dao.hehe;
+
+
+import org.apache.ibatis.annotations.Mapper;
+
+
+@Mapper
+public interface HeHeOrderDao {
+
+}

+ 7 - 3
src/main/java/com/caimei365/manager/dao/hehe/HeHeProductDao.java

@@ -1,8 +1,6 @@
 package com.caimei365.manager.dao.hehe;
 
-import com.caimei365.manager.entity.hehe.product.HeHeActivity;
-import com.caimei365.manager.entity.hehe.product.HeHeBigType;
-import com.caimei365.manager.entity.hehe.product.HeHeProduct;
+import com.caimei365.manager.entity.hehe.product.*;
 import org.apache.ibatis.annotations.Mapper;
 
 import java.util.List;
@@ -17,4 +15,10 @@ public interface HeHeProductDao {
     List<HeHeBigType> findBigTypeList(HeHeBigType type);
 
     List<HeHeActivity> findActivityList(HeHeActivity activity);
+
+    List<DiscountActivity> findDiscountActivityList(DiscountActivity activity);
+
+    List<ShareReduction> findShareReductionList(ShareReduction reduction);
+
+    List<InsideDiscount> findInsideDiscountList(InsideDiscount discount);
 }

+ 33 - 0
src/main/java/com/caimei365/manager/entity/hehe/product/DiscountActivity.java

@@ -0,0 +1,33 @@
+package com.caimei365.manager.entity.hehe.product;
+
+import lombok.Data;
+import java.util.Date;
+
+/**
+ * @author zzj
+ * 限时特价活动
+ */
+@Data
+public class DiscountActivity {
+	/**
+	 * 活动名称
+	 */
+	private String name;
+	/**
+	 * 上架时间
+	 */
+	private Date onlineTime;
+	/**
+	 * 下架时间
+	 */
+	private Date offlineTime;
+	/**
+	 * 创建时间
+	 */
+	private Date addTime;
+	/**
+	 * 状态:1待上架,2已上架,3已下架
+	 */
+	private Integer status;
+
+}

+ 5 - 5
src/main/java/com/caimei365/manager/entity/hehe/product/HeHeActivity.java

@@ -18,7 +18,7 @@ public class HeHeActivity  {
 	/**
 	 * 小程序状态:1启用,2停用
 	 */
-	private String status;
+	private Integer status;
 	/**
 	 * 小程序列表缩略图
 	 */
@@ -39,10 +39,10 @@ public class HeHeActivity  {
 	 * 创建时间
 	 */
 	private Date addTime;
-//	/**
-//	 * 活动状态:1未开始,2进行中,3已结束
-//	 */
-//	private Integer activityStatus;
+	/**
+	 * 活动状态:1未开始,2进行中,3已结束
+	 */
+	private Integer activityStatus;
 	/**
 	 * 是否被选中
 	 */

+ 2 - 2
src/main/java/com/caimei365/manager/entity/hehe/product/HeHeBigType.java

@@ -5,7 +5,7 @@ import lombok.Data;
 @Data
 public class HeHeBigType {
 
-    private String bigTypeId;
+    private Integer bigTypeId;
     /**
      * 分类类型,1产品,2仪器
      */
@@ -29,7 +29,7 @@ public class HeHeBigType {
     /**
      * 小程序启用标识,0停用,1启用
      */
-    private String crmValidFlag;
+    private Integer crmValidFlag;
     /**
      * www图标
      */

+ 52 - 0
src/main/java/com/caimei365/manager/entity/hehe/product/HeHeImage.java

@@ -0,0 +1,52 @@
+package com.caimei365.manager.entity.hehe.product;
+
+
+import lombok.Data;
+
+import java.util.Date;
+
+
+/**
+ * @author 呵呵轮播图
+ */
+@Data
+public class HeHeImage {
+
+	/**
+	 * 主题
+	 */
+	private String topic;
+	/**
+	 * 图片
+	 */
+	private String image;
+	/**
+	 * 跳转类型:1链接,2商品,3图片
+	 */
+	private Integer jumpType;
+	/**
+	 * 跳转链接
+	 */
+	private String jumpLink;
+	/**
+	 * 跳转链接
+	 */
+	private Integer jumpProductId;
+	/**
+	 * 跳转链接
+	 */
+	private String jumpImage;
+	/**
+	 * 排序值
+	 */
+	private Integer sort;
+	/**
+	 * 小程序状态:1启用,2停用
+	 */
+	private Integer status;
+	/**
+	 * 添加时间
+	 */
+	private Date addTime;
+
+}

+ 4 - 4
src/main/java/com/caimei365/manager/entity/hehe/product/HeHeProduct.java

@@ -16,7 +16,7 @@ public class HeHeProduct {
     /**
      * 上架状态:1上架,2下架
      */
-    private String validFlag;
+    private Integer validFlag;
     /**
      * 售价
      */
@@ -24,11 +24,11 @@ public class HeHeProduct {
     /**
      * 是否含税 0不含税,1含税
      */
-    private String includedTax;
+    private Integer includedTax;
     /**
      * 发票类型(基于是否含税基础) 1增值税专用发票,2增值税普通发票, 3不能开票
      */
-    private String invoiceType;
+    private Integer invoiceType;
     /**
      * 机构税率 :增值税默认13%,普通票6%取值范围[0-100]
      */
@@ -40,7 +40,7 @@ public class HeHeProduct {
     /**
      * 成本价类型:1固定成本 2比例成本
      */
-    private String costType;
+    private Integer costType;
     /**
      * 成本价
      */

+ 44 - 0
src/main/java/com/caimei365/manager/entity/hehe/product/InsideDiscount.java

@@ -0,0 +1,44 @@
+package com.caimei365.manager.entity.hehe.product;
+
+import lombok.Data;
+
+import java.util.Date;
+
+
+/**
+ * 呵呵商城内部优惠Entity
+ * @author zzj
+ */
+@Data
+public class InsideDiscount {
+
+	/**
+	 * 标题
+	 */
+	private String title;
+	/**
+	 * 折扣率
+	 */
+	private Integer discount;
+	/**
+	 * 状态
+	 */
+	private Integer status;
+	/**
+	 * 优惠商品
+	 */
+	private Integer productType;
+	/**
+	 * 创建时间
+	 */
+	private Date addTime;
+	/**
+	 * 商品json数据
+	 */
+	private String productInfo;
+	/**
+	 * 用户json数据
+	 */
+	private String userInfo;
+
+}

+ 48 - 0
src/main/java/com/caimei365/manager/entity/hehe/product/ShareReduction.java

@@ -0,0 +1,48 @@
+package com.caimei365.manager.entity.hehe.product;
+
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 呵呵商城分享减免Entity
+ * @author zzj
+ */
+@Data
+public class ShareReduction {
+
+	/**
+	 * 活动名称
+	 */
+	private String name;
+	/**
+	 * 减免金额
+	 */
+	private Double reducedAmount;
+	/**
+	 * 减免条件
+	 */
+	private Double touchPrice;
+	/**
+	 * 分享次数
+	 */
+	private Integer shareNum;
+	/**
+	 * 上架时间
+	 */
+	private Date startTime;
+	/**
+	 * 下架时间
+	 */
+	private Date endTime;
+	/**
+	 * 添加时间
+	 */
+	private Date addTime;
+	/**
+	 * 状态:1待上架,2已上架,3已下架
+	 */
+	private Integer status;
+
+}

+ 5 - 0
src/main/java/com/caimei365/manager/service/hehe/floor/HeHeHomeService.java

@@ -4,10 +4,15 @@ import com.caimei365.manager.entity.PaginationVo;
 import com.caimei365.manager.entity.ResponseJson;
 import com.caimei365.manager.entity.hehe.floor.HeHeHomeType;
 import com.caimei365.manager.entity.hehe.floor.ProductFloor;
+import com.caimei365.manager.entity.hehe.product.HeHeImage;
 
 public interface HeHeHomeService {
 
     ResponseJson<PaginationVo<HeHeHomeType>> homeTypeList(int pageNum, int pageSize);
 
     ResponseJson<PaginationVo<ProductFloor>> productFloor(int pageNum, int pageSize);
+
+    ResponseJson<String> getQrCode();
+
+    ResponseJson<PaginationVo<HeHeImage>> imageList(HeHeImage image, int pageNum, int pageSize);
 }

+ 14 - 0
src/main/java/com/caimei365/manager/service/hehe/floor/impl/HeHeHomeServiceImpl.java

@@ -6,6 +6,7 @@ import com.caimei365.manager.entity.PaginationVo;
 import com.caimei365.manager.entity.ResponseJson;
 import com.caimei365.manager.entity.hehe.floor.HeHeHomeType;
 import com.caimei365.manager.entity.hehe.floor.ProductFloor;
+import com.caimei365.manager.entity.hehe.product.HeHeImage;
 import com.caimei365.manager.service.hehe.floor.HeHeHomeService;
 import com.github.pagehelper.PageHelper;
 import org.springframework.stereotype.Service;
@@ -34,4 +35,17 @@ public class HeHeHomeServiceImpl implements HeHeHomeService {
         PaginationVo<ProductFloor> page = new PaginationVo<>(list);
         return ResponseJson.success(page);
     }
+
+    @Override
+    public ResponseJson<String> getQrCode() {
+        return ResponseJson.success(homeDao.findQrCode());
+    }
+
+    @Override
+    public ResponseJson<PaginationVo<HeHeImage>> imageList(HeHeImage image, int pageNum, int pageSize) {
+        PageHelper.startPage(pageNum, pageSize);
+        List<HeHeImage> list = homeDao.findImageList(image);
+        PaginationVo<HeHeImage> page = new PaginationVo<>(list);
+        return ResponseJson.success(page);
+    }
 }

+ 4 - 0
src/main/java/com/caimei365/manager/service/hehe/order/HeHeOrderService.java

@@ -0,0 +1,4 @@
+package com.caimei365.manager.service.hehe.order;
+
+public interface HeHeOrderService {
+}

+ 12 - 0
src/main/java/com/caimei365/manager/service/hehe/order/impl/HeHeOrderServiceImpl.java

@@ -0,0 +1,12 @@
+package com.caimei365.manager.service.hehe.order.impl;
+
+import com.caimei365.manager.service.hehe.order.HeHeOrderService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+@Service
+public class HeHeOrderServiceImpl implements HeHeOrderService {
+    @Resource
+    private HeHeOrderDao orderDao;
+}

+ 7 - 3
src/main/java/com/caimei365/manager/service/hehe/product/HeHeProductService.java

@@ -2,9 +2,7 @@ package com.caimei365.manager.service.hehe.product;
 
 import com.caimei365.manager.entity.PaginationVo;
 import com.caimei365.manager.entity.ResponseJson;
-import com.caimei365.manager.entity.hehe.product.HeHeActivity;
-import com.caimei365.manager.entity.hehe.product.HeHeBigType;
-import com.caimei365.manager.entity.hehe.product.HeHeProduct;
+import com.caimei365.manager.entity.hehe.product.*;
 
 public interface HeHeProductService {
     ResponseJson<PaginationVo<HeHeProduct>> productList(HeHeProduct product, int pageNum, int pageSize);
@@ -12,4 +10,10 @@ public interface HeHeProductService {
     ResponseJson<PaginationVo<HeHeBigType>>  bigTypeList(HeHeBigType type, int pageNum, int pageSize);
 
     ResponseJson<PaginationVo<HeHeActivity>> activeList(HeHeActivity activity, int pageNum, int pageSize);
+
+    ResponseJson<PaginationVo<DiscountActivity>> discountActiveList(DiscountActivity activity, int pageNum, int pageSize);
+
+    ResponseJson<PaginationVo<ShareReduction>> shareReductionList(ShareReduction reduction, int pageNum, int pageSize);
+
+    ResponseJson<PaginationVo<InsideDiscount>> insideDiscountList(InsideDiscount discount, int pageNum, int pageSize);
 }

+ 54 - 3
src/main/java/com/caimei365/manager/service/hehe/product/impl/HeHeProductServiceImpl.java

@@ -7,9 +7,7 @@ import com.caimei365.manager.config.thinkgem.Global;
 import com.caimei365.manager.dao.hehe.HeHeProductDao;
 import com.caimei365.manager.entity.PaginationVo;
 import com.caimei365.manager.entity.ResponseJson;
-import com.caimei365.manager.entity.hehe.product.HeHeActivity;
-import com.caimei365.manager.entity.hehe.product.HeHeBigType;
-import com.caimei365.manager.entity.hehe.product.HeHeProduct;
+import com.caimei365.manager.entity.hehe.product.*;
 import com.caimei365.manager.service.hehe.product.HeHeProductService;
 import com.github.pagehelper.PageHelper;
 import lombok.extern.slf4j.Slf4j;
@@ -17,6 +15,7 @@ import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.math.BigDecimal;
+import java.util.Date;
 import java.util.List;
 
 @Service
@@ -63,4 +62,56 @@ public class HeHeProductServiceImpl implements HeHeProductService {
         PaginationVo<HeHeActivity> page = new PaginationVo<>(list);
         return ResponseJson.success(page);
     }
+
+    @Override
+    public ResponseJson<PaginationVo<DiscountActivity>> discountActiveList(DiscountActivity activity, int pageNum, int pageSize) {
+        PageHelper.startPage(pageNum, pageSize);
+        List<DiscountActivity> list = productDao.findDiscountActivityList(activity);
+        list.forEach(this::setActivityStatus);
+        PaginationVo<DiscountActivity> page = new PaginationVo<>(list);
+        return ResponseJson.success(page);
+    }
+
+    @Override
+    public ResponseJson<PaginationVo<ShareReduction>> shareReductionList(ShareReduction reduction, int pageNum, int pageSize) {
+        PageHelper.startPage(pageNum, pageSize);
+        List<ShareReduction> list = productDao.findShareReductionList(reduction);
+        list.forEach(this::setShareReductionStatus);
+        PaginationVo<ShareReduction> page = new PaginationVo<>(list);
+        return ResponseJson.success(page);
+    }
+
+    @Override
+    public ResponseJson<PaginationVo<InsideDiscount>> insideDiscountList(InsideDiscount discount, int pageNum, int pageSize) {
+        PageHelper.startPage(pageNum, pageSize);
+        List<InsideDiscount> list = productDao.findInsideDiscountList(discount);
+        PaginationVo<InsideDiscount> page = new PaginationVo<>(list);
+        return ResponseJson.success(page);
+    }
+
+    public void setShareReductionStatus(ShareReduction reduction) {
+        Date date = new Date();
+        if (reduction != null) {
+            if (date.compareTo(reduction.getStartTime()) < 0) {
+                reduction.setStatus(1);
+            } else if (date.compareTo(reduction.getEndTime()) > 0) {
+                reduction.setStatus(3);
+            } else {
+                reduction.setStatus(2);
+            }
+        }
+    }
+
+    public void setActivityStatus(DiscountActivity activity) {
+        Date date = new Date();
+        if (activity != null) {
+            if (date.compareTo(activity.getOnlineTime()) < 0) {
+                activity.setStatus(1);
+            } else if (date.compareTo(activity.getOfflineTime()) > 0) {
+                activity.setStatus(3);
+            } else {
+                activity.setStatus(2);
+            }
+        }
+    }
 }

+ 30 - 0
src/main/resources/mapper/hehe/HeHeHomeDao.xml

@@ -39,4 +39,34 @@
         </where>
         ORDER BY -a.sort DESC,a.createDate DESC
     </select>
+
+    <select id="findQrCode" resultType="java.lang.String">
+        select image
+        from cm_hehe_related_images
+        limit 1
+    </select>
+
+    <select id="findImageList" resultType="com.caimei365.manager.entity.hehe.product.HeHeImage">
+        SELECT
+        a.id AS "id",
+        a.topic AS "topic",
+        a.image AS "image",
+        a.jumpType,
+        a.jumpLink,
+        a.jumpProductId,
+        a.jumpImage,
+        a.sort AS "sort",
+        a.status AS "status",
+        a.addTime AS "addTime"
+        FROM cm_hehe_image a
+        <where>
+            <if test="topic != null and topic != ''">
+                AND a.topic LIKE concat('%',#{topic},'%')
+            </if>
+            <if test="status != null and status != ''">
+                AND a.status = #{status}
+            </if>
+        </where>
+        ORDER BY -sort DESC
+    </select>
 </mapper>

+ 6 - 0
src/main/resources/mapper/hehe/HeHeOrderDao.xml

@@ -0,0 +1,6 @@
+<?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.caimei365.manager.dao.hehe.HeHeOrderDao">
+
+
+</mapper>

+ 74 - 0
src/main/resources/mapper/hehe/HeHeProductDao.xml

@@ -145,4 +145,78 @@
         ORDER BY addTime DESC
     </select>
 
+    <select id="findDiscountActivityList" resultType="com.caimei365.manager.entity.hehe.product.DiscountActivity">
+        SELECT a.id AS "id",
+        a.name AS "name",
+        a.onlineTime AS "onlineTime",
+        a.offlineTime AS "offlineTime",
+        a.addTime AS "addTime"
+        FROM cm_hehe_discount_activity a
+        <where>
+            <if test="name != null and name != ''">
+                AND a.name LIKE concat('%',#{name},'%')
+            </if>
+            <if test="status != null">
+                <if test="status == 1">
+                    and NOW() <![CDATA[ < ]]> a.onlineTime
+                </if>
+                <if test="status == 2">
+                    and NOW() <![CDATA[ >= ]]> a.onlineTime and NOW() <![CDATA[ <= ]]> a.offlineTime
+                </if>
+                <if test="status == 3">
+                    and NOW() <![CDATA[ > ]]> a.offlineTime
+                </if>
+            </if>
+        </where>
+        order by a.addTime desc
+    </select>
+
+    <select id="findShareReductionList" resultType="com.caimei365.manager.entity.hehe.product.ShareReduction">
+        SELECT
+        a.id AS "id",
+        a.name AS "name",
+        a.reducedAmount AS "reducedAmount",
+        a.touchPrice AS "touchPrice",
+        a.shareNum AS "shareNum",
+        a.startTime AS "startTime",
+        a.endTime AS "endTime",
+        a.addTime AS "addTime"
+        FROM cm_hehe_reduction a
+        <where>
+            <if test="name != null and name != ''">
+            AND a.name LIKE concat('%',#{name},'%')
+            <if test="status != null">
+                <if test="status == 1">
+                    and NOW() <![CDATA[ < ]]> a.startTime
+                </if>
+                <if test="status == 2">
+                    and NOW() <![CDATA[ >= ]]> a.startTime and NOW() <![CDATA[ <= ]]> a.endTime
+                </if>
+                <if test="status == 3">
+                    and NOW() <![CDATA[ > ]]> a.endTime
+                </if>
+            </if>
+        </where>
+        order by a.addTime desc
+    </select>
+
+    <select id="findInsideDiscountList" resultType="com.caimei365.manager.entity.hehe.product.InsideDiscount">
+        SELECT
+        a.id AS "id",
+        a.title AS "title",
+        a.discount AS "discount",
+        a.status AS "status",
+        a.productType AS "productType",
+        a.addTime AS "addTime"
+        FROM cm_hehe_discount a
+        <where>
+            <if test="title != null and title != ''">
+            AND a.title LIKE concat('%',#{title},'%')
+            <if test="status != null and status != ''">
+                AND a.status = #{status}
+            </if>
+        </where>
+        order by addTime desc
+    </select>
+
 </mapper>