Browse Source

呵呵商城后台配置

plf 4 years ago
parent
commit
4b1afb47dd
23 changed files with 2634 additions and 0 deletions
  1. 26 0
      src/main/java/com/caimei/modules/hehe/dao/CmHeheImageDao.java
  2. 42 0
      src/main/java/com/caimei/modules/hehe/dao/CmHeheProductDao.java
  3. 23 0
      src/main/java/com/caimei/modules/hehe/dao/CmHeheUserDao.java
  4. 74 0
      src/main/java/com/caimei/modules/hehe/entity/CmHeheImage.java
  5. 177 0
      src/main/java/com/caimei/modules/hehe/entity/CmHeheProduct.java
  6. 86 0
      src/main/java/com/caimei/modules/hehe/entity/CmHeheUser.java
  7. 78 0
      src/main/java/com/caimei/modules/hehe/service/CmHeheImageService.java
  8. 103 0
      src/main/java/com/caimei/modules/hehe/service/CmHeheProductService.java
  9. 52 0
      src/main/java/com/caimei/modules/hehe/service/CmHeheUserService.java
  10. 143 0
      src/main/java/com/caimei/modules/hehe/web/CmHeheImageController.java
  11. 154 0
      src/main/java/com/caimei/modules/hehe/web/CmHeheProductController.java
  12. 86 0
      src/main/java/com/caimei/modules/hehe/web/CmHeheUserController.java
  13. 108 0
      src/main/resources/mappings/modules/hehe/CmHeheImageMapper.xml
  14. 181 0
      src/main/resources/mappings/modules/hehe/CmHeheProductMapper.xml
  15. 116 0
      src/main/resources/mappings/modules/hehe/CmHeheUserMapper.xml
  16. 196 0
      src/main/webapp/WEB-INF/views/modules/hehe/cmHeheImageForm.jsp
  17. 151 0
      src/main/webapp/WEB-INF/views/modules/hehe/cmHeheImageList.jsp
  18. 291 0
      src/main/webapp/WEB-INF/views/modules/hehe/cmHeheProductForm.jsp
  19. 179 0
      src/main/webapp/WEB-INF/views/modules/hehe/cmHeheProductList.jsp
  20. 80 0
      src/main/webapp/WEB-INF/views/modules/hehe/cmHeheUserAllList.jsp
  21. 68 0
      src/main/webapp/WEB-INF/views/modules/hehe/cmHeheUserForm.jsp
  22. 80 0
      src/main/webapp/WEB-INF/views/modules/hehe/cmHeheUserList.jsp
  23. 140 0
      src/main/webapp/WEB-INF/views/modules/hehe/heheAddProduct.jsp

+ 26 - 0
src/main/java/com/caimei/modules/hehe/dao/CmHeheImageDao.java

@@ -0,0 +1,26 @@
+package com.caimei.modules.hehe.dao;
+
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+import com.caimei.modules.hehe.entity.CmHeheImage;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 呵呵轮播图DAO接口
+ *
+ * @author plf
+ * @version 2021-04-15
+ */
+@MyBatisDao
+public interface CmHeheImageDao extends CrudDao<CmHeheImage> {
+
+    /**
+     * 修改小程序状态
+     *
+     * @param status
+     * @param id
+     */
+    void updateStatusById(@Param("status") String status, @Param("id") Integer id);
+
+    void saveSort(@Param("sort") String sort, @Param("id") String id);
+}

+ 42 - 0
src/main/java/com/caimei/modules/hehe/dao/CmHeheProductDao.java

@@ -0,0 +1,42 @@
+package com.caimei.modules.hehe.dao;
+
+import com.caimei.modules.product.entity.Product;
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+import com.caimei.modules.hehe.entity.CmHeheProduct;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 呵呵商品DAO接口
+ *
+ * @author plf
+ * @version 2021-04-14
+ */
+@MyBatisDao
+public interface CmHeheProductDao extends CrudDao<CmHeheProduct> {
+
+    /**
+     * 查询呵呵商城商品所有商品id
+     *
+     * @return
+     */
+    List<Integer> findHeHeProductId();
+
+    /**
+     * 查询采美所有商品
+     *
+     * @param product
+     * @return
+     */
+    List<Product> findAllProduct(Product product);
+
+    /**
+     * 保存排序值
+     *
+     * @param sort
+     * @param id
+     */
+    void saveSort(@Param("sort") String sort, @Param("id") String id);
+}

+ 23 - 0
src/main/java/com/caimei/modules/hehe/dao/CmHeheUserDao.java

@@ -0,0 +1,23 @@
+package com.caimei.modules.hehe.dao;
+
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+import com.caimei.modules.hehe.entity.CmHeheUser;
+
+/**
+ * 呵呵用户DAO接口
+ *
+ * @author plf
+ * @version 2021-04-14
+ */
+@MyBatisDao
+public interface CmHeheUserDao extends CrudDao<CmHeheUser> {
+
+    /**
+     * 查询手机号唯一
+     *
+     * @param cmHeheUser
+     * @return
+     */
+    Integer findMobileOnly(CmHeheUser cmHeheUser);
+}

+ 74 - 0
src/main/java/com/caimei/modules/hehe/entity/CmHeheImage.java

@@ -0,0 +1,74 @@
+package com.caimei.modules.hehe.entity;
+
+import org.hibernate.validator.constraints.Length;
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+
+/**
+ * 呵呵轮播图Entity
+ * @author plf
+ * @version 2021-04-15
+ */
+public class CmHeheImage extends DataEntity<CmHeheImage> {
+	
+	private static final long serialVersionUID = 1L;
+	private String topic;		// 主题
+	private String image;		// 图片
+	private String sort;		// 排序值
+	private String status;		// 小程序状态:1启用,2停用
+	private Date addTime;		// 添加时间
+	
+	public CmHeheImage() {
+		super();
+	}
+
+	public CmHeheImage(String id){
+		super(id);
+	}
+
+	@Length(min=0, max=50, message="主题长度必须介于 0 和 50 之间")
+	public String getTopic() {
+		return topic;
+	}
+
+	public void setTopic(String topic) {
+		this.topic = topic;
+	}
+	
+	public String getImage() {
+		return image;
+	}
+
+	public void setImage(String image) {
+		this.image = image;
+	}
+	
+	public String getSort() {
+		return sort;
+	}
+
+	public void setSort(String sort) {
+		this.sort = sort;
+	}
+	
+	@Length(min=0, max=1, message="小程序状态:1启用,2停用长度必须介于 0 和 1 之间")
+	public String getStatus() {
+		return status;
+	}
+
+	public void setStatus(String status) {
+		this.status = status;
+	}
+	
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	public Date getAddTime() {
+		return addTime;
+	}
+
+	public void setAddTime(Date addTime) {
+		this.addTime = addTime;
+	}
+	
+}

+ 177 - 0
src/main/java/com/caimei/modules/hehe/entity/CmHeheProduct.java

@@ -0,0 +1,177 @@
+package com.caimei.modules.hehe.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+import org.hibernate.validator.constraints.Length;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 呵呵商品Entity
+ *
+ * @author plf
+ * @version 2021-04-14
+ */
+public class CmHeheProduct extends DataEntity<CmHeheProduct> {
+
+    private static final long serialVersionUID = 1L;
+    private Integer productId;        // 对应采美商品id
+    private Integer sort;        // 排序值
+    private String recommend;        // 是否为推荐商品(0 没推荐,1 推荐商品)
+    private String validFlag;        // 上架状态:1上架,2下架
+    private BigDecimal price;        // 售价
+    private String includedTax;        // 是否含税 0不含税,1含税
+    private String invoiceType;        // 发票类型(基于是否含税基础) 1增值税专用发票,2增值税普通发票, 3不能开票
+    private BigDecimal clubTaxPoint;        // 机构税率 :增值税默认13%,普通票6%取值范围[0-100]
+    private BigDecimal shopTaxPoint;        // 供应商税率:增值专用发票默认13%,增值税普通发票6%取值范围[0-100]
+    private String costType;        // 成本价类型:1固定成本 2比例成本
+    private BigDecimal costPrice;        // 成本价
+    private BigDecimal costProportional;        // 比例成本百分比
+    private Date addTime;        // 添加时间
+    private String name;         //商品名称
+    private String mainImage;       //商品图片
+    private String shopName;        //供应商名称
+
+    public CmHeheProduct() {
+        super();
+    }
+
+    public CmHeheProduct(String id) {
+        super(id);
+    }
+
+    public Integer getProductId() {
+        return productId;
+    }
+
+    public void setProductId(Integer productId) {
+        this.productId = productId;
+    }
+
+    public Integer getSort() {
+        return sort;
+    }
+
+    public void setSort(Integer sort) {
+        this.sort = sort;
+    }
+
+    @Length(min = 0, max = 2, message = "是否为推荐商品(0 没推荐,1 推荐商品)长度必须介于 0 和 2 之间")
+    public String getRecommend() {
+        return recommend;
+    }
+
+    public void setRecommend(String recommend) {
+        this.recommend = recommend;
+    }
+
+    @Length(min = 0, max = 2, message = "上架状态:1上架,2下架长度必须介于 0 和 2 之间")
+    public String getValidFlag() {
+        return validFlag;
+    }
+
+    public void setValidFlag(String validFlag) {
+        this.validFlag = validFlag;
+    }
+
+    public BigDecimal getPrice() {
+        return price;
+    }
+
+    public void setPrice(BigDecimal price) {
+        this.price = price;
+    }
+
+    @Length(min = 0, max = 2, message = "是否含税 0不含税,1含税长度必须介于 0 和 2 之间")
+    public String getIncludedTax() {
+        return includedTax;
+    }
+
+    public void setIncludedTax(String includedTax) {
+        this.includedTax = includedTax;
+    }
+
+    @Length(min = 0, max = 2, message = "发票类型(基于是否含税基础) 1增值税专用发票,2增值税普通发票, 3不能开票长度必须介于 0 和 2 之间")
+    public String getInvoiceType() {
+        return invoiceType;
+    }
+
+    public void setInvoiceType(String invoiceType) {
+        this.invoiceType = invoiceType;
+    }
+
+    public BigDecimal getClubTaxPoint() {
+        return clubTaxPoint;
+    }
+
+    public void setClubTaxPoint(BigDecimal clubTaxPoint) {
+        this.clubTaxPoint = clubTaxPoint;
+    }
+
+    public BigDecimal getShopTaxPoint() {
+        return shopTaxPoint;
+    }
+
+    public void setShopTaxPoint(BigDecimal shopTaxPoint) {
+        this.shopTaxPoint = shopTaxPoint;
+    }
+
+    @Length(min = 0, max = 2, message = "成本价类型:1固定成本 2比例成本长度必须介于 0 和 2 之间")
+    public String getCostType() {
+        return costType;
+    }
+
+    public void setCostType(String costType) {
+        this.costType = costType;
+    }
+
+    public BigDecimal getCostPrice() {
+        return costPrice;
+    }
+
+    public void setCostPrice(BigDecimal costPrice) {
+        this.costPrice = costPrice;
+    }
+
+    public BigDecimal getCostProportional() {
+        return costProportional;
+    }
+
+    public void setCostProportional(BigDecimal costProportional) {
+        this.costProportional = costProportional;
+    }
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    public Date getAddTime() {
+        return addTime;
+    }
+
+    public void setAddTime(Date addTime) {
+        this.addTime = addTime;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getMainImage() {
+        return mainImage;
+    }
+
+    public void setMainImage(String mainImage) {
+        this.mainImage = mainImage;
+    }
+
+    public String getShopName() {
+        return shopName;
+    }
+
+    public void setShopName(String shopName) {
+        this.shopName = shopName;
+    }
+}

+ 86 - 0
src/main/java/com/caimei/modules/hehe/entity/CmHeheUser.java

@@ -0,0 +1,86 @@
+package com.caimei.modules.hehe.entity;
+
+import org.hibernate.validator.constraints.Length;
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+
+/**
+ * 呵呵用户Entity
+ * @author plf
+ * @version 2021-04-14
+ */
+public class CmHeheUser extends DataEntity<CmHeheUser> {
+	
+	private static final long serialVersionUID = 1L;
+	private String name;		// 姓名
+	private String mobile;		// 手机号
+	private String userIdentity;		// 用户身份:1普通用户,2分销者
+	private String nickName;		// 微信昵称
+	private String openId;		// 微信openid
+	private Date addTime;		// 添加时间
+	
+	public CmHeheUser() {
+		super();
+	}
+
+	public CmHeheUser(String id){
+		super(id);
+	}
+
+	@Length(min=0, max=30, message="姓名长度必须介于 0 和 30 之间")
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+	
+	@Length(min=0, max=20, message="手机号长度必须介于 0 和 20 之间")
+	public String getMobile() {
+		return mobile;
+	}
+
+	public void setMobile(String mobile) {
+		this.mobile = mobile;
+	}
+	
+	@Length(min=0, max=2, message="用户身份:1普通用户,2分销者长度必须介于 0 和 2 之间")
+	public String getUserIdentity() {
+		return userIdentity;
+	}
+
+	public void setUserIdentity(String userIdentity) {
+		this.userIdentity = userIdentity;
+	}
+	
+	@Length(min=0, max=32, message="微信昵称长度必须介于 0 和 32 之间")
+	public String getNickName() {
+		return nickName;
+	}
+
+	public void setNickName(String nickName) {
+		this.nickName = nickName;
+	}
+	
+	@Length(min=0, max=32, message="微信openid长度必须介于 0 和 32 之间")
+	public String getOpenId() {
+		return openId;
+	}
+
+	public void setOpenId(String openId) {
+		this.openId = openId;
+	}
+	
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	public Date getAddTime() {
+		return addTime;
+	}
+
+	public void setAddTime(Date addTime) {
+		this.addTime = addTime;
+	}
+	
+}

+ 78 - 0
src/main/java/com/caimei/modules/hehe/service/CmHeheImageService.java

@@ -0,0 +1,78 @@
+package com.caimei.modules.hehe.service;
+
+import java.util.List;
+
+import com.caimei.dfs.image.beens.ImageUploadInfo;
+import com.caimei.modules.brand.utils.ImagePathUtils;
+import com.caimei.modules.sys.utils.UploadImageUtils;
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.utils.Encodes;
+import com.thinkgem.jeesite.common.utils.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+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.hehe.entity.CmHeheImage;
+import com.caimei.modules.hehe.dao.CmHeheImageDao;
+
+/**
+ * 呵呵轮播图Service
+ *
+ * @author plf
+ * @version 2021-04-15
+ */
+@Service
+@Transactional(readOnly = true)
+public class CmHeheImageService extends CrudService<CmHeheImageDao, CmHeheImage> {
+    @Autowired
+    private CmHeheImageDao cmHeheImageDao;
+
+    public CmHeheImage get(String id) {
+        return super.get(id);
+    }
+
+    public List<CmHeheImage> findList(CmHeheImage cmHeheImage) {
+        return super.findList(cmHeheImage);
+    }
+
+    public Page<CmHeheImage> findPage(Page<CmHeheImage> page, CmHeheImage cmHeheImage) {
+        return super.findPage(page, cmHeheImage);
+    }
+
+    @Transactional(readOnly = false)
+    public void save(CmHeheImage cmHeheImage) {
+        //保存图片
+        String image = cmHeheImage.getImage();
+        if (StringUtils.isNotBlank(image) && !image.startsWith("http")) {
+            String photoServer = Global.getConfig("photoServer");//获取文件服务器地址
+            image = Encodes.urlDecode(image);
+            String realPath = UploadImageUtils.getAbsolutePath(image);
+            int pointerIndex = realPath.lastIndexOf(".");
+            ImageUploadInfo saveImageSerivce = new ImageUploadInfo();
+            try {
+                saveImageSerivce = ImagePathUtils.saveImageSerivce(realPath, pointerIndex, realPath);
+                cmHeheImage.setImage(photoServer + saveImageSerivce.getSource());
+            } catch (Exception e) {
+                logger.error("图片上传错误:" + e.toString(), e);
+            }
+        }
+        super.save(cmHeheImage);
+    }
+
+    @Transactional(readOnly = false)
+    public void delete(CmHeheImage cmHeheImage) {
+        super.delete(cmHeheImage);
+    }
+
+    @Transactional(readOnly = false)
+    public void updateStatusById(String status, Integer id) {
+        cmHeheImageDao.updateStatusById(status, id);
+    }
+
+    @Transactional(readOnly = false)
+    public void saveSort(String sort, String id) {
+        cmHeheImageDao.saveSort(sort, id);
+    }
+}

+ 103 - 0
src/main/java/com/caimei/modules/hehe/service/CmHeheProductService.java

@@ -0,0 +1,103 @@
+package com.caimei.modules.hehe.service;
+
+import com.caimei.modules.hehe.dao.CmHeheProductDao;
+import com.caimei.modules.hehe.entity.CmHeheProduct;
+import com.caimei.modules.product.entity.Product;
+import com.caimei.utils.AppUtils;
+import com.caimei.utils.MathUtil;
+import com.caimei.utils.StringUtil;
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.service.CrudService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * 呵呵商品Service
+ *
+ * @author plf
+ * @version 2021-04-14
+ */
+@Service
+@Transactional(readOnly = true)
+public class CmHeheProductService extends CrudService<CmHeheProductDao, CmHeheProduct> {
+    @Autowired
+    private CmHeheProductDao cmHeheProductDao;
+
+    public CmHeheProduct get(String id) {
+        return super.get(id);
+    }
+
+    public List<CmHeheProduct> findList(CmHeheProduct cmHeheProduct) {
+        return super.findList(cmHeheProduct);
+    }
+
+    public Page<CmHeheProduct> findPage(Page<CmHeheProduct> page, CmHeheProduct cmHeheProduct) {
+        Page<CmHeheProduct> productPage = super.findPage(page, cmHeheProduct);
+        List<CmHeheProduct> list = productPage.getList();
+        String wwwServer = Global.getConfig("wwwServer");
+        list.forEach(p -> {
+            //比例成本
+            if ("2".equals(p.getCostType())) {
+                BigDecimal costPrice = MathUtil.div(MathUtil.mul(p.getPrice(), p.getCostProportional()), 100, 2);
+                p.setCostPrice(costPrice);
+            }
+            p.setMainImage(AppUtils.getImageURL("product", p.getMainImage(), 0, wwwServer));
+        });
+        return productPage;
+    }
+
+    @Transactional(readOnly = false)
+    public void save(CmHeheProduct cmHeheProduct) {
+        super.save(cmHeheProduct);
+    }
+
+    @Transactional(readOnly = false)
+    public void delete(CmHeheProduct cmHeheProduct) {
+        super.delete(cmHeheProduct);
+    }
+
+    public Page<Product> findProductPage(Page<Product> productPage, Product product) {
+        List<Integer> ids = cmHeheProductDao.findHeHeProductId();
+        product.setIds(ids);
+        product.setPage(productPage);
+        List<Product> productList = cmHeheProductDao.findAllProduct(product);
+        String wwwServer = Global.getConfig("wwwServer");
+        productList.forEach(item -> {
+            if (StringUtil.isNotBlank(item.getMainImage())) {
+                item.setMainImage(AppUtils.getImageURL("product", item.getMainImage(), 0, "https://www.caimei365.com/"));
+            }
+        });
+        productPage.setList(productList);
+        return productPage;
+    }
+
+    @Transactional(readOnly = false)
+    public void saveSort(String sort, String id) {
+        cmHeheProductDao.saveSort(sort, id);
+    }
+
+    @Transactional(readOnly = false)
+    public void updateValidFlag(CmHeheProduct cmHeheProduct) {
+        if ("1".equals(cmHeheProduct.getValidFlag())){
+            cmHeheProduct.setValidFlag("2");
+        }else {
+            cmHeheProduct.setValidFlag("1");
+        }
+        cmHeheProductDao.update(cmHeheProduct);
+    }
+
+    @Transactional(readOnly = false)
+    public void updateRecommend(CmHeheProduct cmHeheProduct) {
+        if ("0".equals(cmHeheProduct.getRecommend())){
+            cmHeheProduct.setRecommend("1");
+        }else {
+            cmHeheProduct.setRecommend("0");
+        }
+        cmHeheProductDao.update(cmHeheProduct);
+    }
+}

+ 52 - 0
src/main/java/com/caimei/modules/hehe/service/CmHeheUserService.java

@@ -0,0 +1,52 @@
+package com.caimei.modules.hehe.service;
+
+import com.caimei.modules.hehe.dao.CmHeheUserDao;
+import com.caimei.modules.hehe.entity.CmHeheUser;
+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 org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 呵呵用户Service
+ *
+ * @author plf
+ * @version 2021-04-14
+ */
+@Service
+@Transactional(readOnly = true)
+public class CmHeheUserService extends CrudService<CmHeheUserDao, CmHeheUser> {
+    @Autowired
+    private CmHeheUserDao cmHeheUserDao;
+
+    public CmHeheUser get(String id) {
+        return super.get(id);
+    }
+
+    public List<CmHeheUser> findList(CmHeheUser cmHeheUser) {
+        return super.findList(cmHeheUser);
+    }
+
+    public Page<CmHeheUser> findPage(Page<CmHeheUser> page, CmHeheUser cmHeheUser) {
+        return super.findPage(page, cmHeheUser);
+    }
+
+    @Transactional(readOnly = false)
+    public void save(CmHeheUser cmHeheUser) {
+        if (StringUtils.isBlank(cmHeheUser.getId())) {
+            cmHeheUser.setUserIdentity("2");
+            cmHeheUser.setAddTime(new Date());
+        }
+        super.save(cmHeheUser);
+    }
+
+    public Integer findMobileOnly(CmHeheUser cmHeheUser) {
+        return cmHeheUserDao.findMobileOnly(cmHeheUser);
+    }
+}

+ 143 - 0
src/main/java/com/caimei/modules/hehe/web/CmHeheImageController.java

@@ -0,0 +1,143 @@
+package com.caimei.modules.hehe.web;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import com.google.common.collect.Maps;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+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.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.hehe.entity.CmHeheImage;
+import com.caimei.modules.hehe.service.CmHeheImageService;
+
+import java.util.Map;
+
+import static com.caimei.modules.newhome.web.NewPageQualitySupplierController.isInteger;
+
+/**
+ * 呵呵轮播图Controller
+ *
+ * @author plf
+ * @version 2021-04-15
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/hehe/cmHeheImage")
+public class CmHeheImageController extends BaseController {
+
+    @Autowired
+    private CmHeheImageService cmHeheImageService;
+
+    @ModelAttribute
+    public CmHeheImage get(@RequestParam(required = false) String id) {
+        CmHeheImage entity = null;
+        if (StringUtils.isNotBlank(id)) {
+            entity = cmHeheImageService.get(id);
+        }
+        if (entity == null) {
+            entity = new CmHeheImage();
+        }
+        return entity;
+    }
+
+    @RequestMapping(value = {"list", ""})
+    public String list(CmHeheImage cmHeheImage, HttpServletRequest request, HttpServletResponse response, Model model) {
+        Page<CmHeheImage> page = cmHeheImageService.findPage(new Page<CmHeheImage>(request, response), cmHeheImage);
+        model.addAttribute("page", page);
+        return "modules/hehe/cmHeheImageList";
+    }
+
+    @RequestMapping(value = "form")
+    public String form(CmHeheImage cmHeheImage, Model model) {
+        model.addAttribute("cmHeheImage", cmHeheImage);
+        return "modules/hehe/cmHeheImageForm";
+    }
+
+    @RequestMapping(value = "save")
+    public String save(CmHeheImage cmHeheImage, Model model, RedirectAttributes redirectAttributes) {
+        if (!beanValidator(model, cmHeheImage)) {
+            return form(cmHeheImage, model);
+        }
+        cmHeheImageService.save(cmHeheImage);
+        addMessage(redirectAttributes, "保存呵呵轮播图成功");
+        return "redirect:" + Global.getAdminPath() + "/hehe/cmHeheImage/?repage";
+    }
+
+    @RequestMapping(value = "delete")
+    public String delete(CmHeheImage cmHeheImage, RedirectAttributes redirectAttributes) {
+        cmHeheImageService.delete(cmHeheImage);
+        addMessage(redirectAttributes, "删除呵呵轮播图成功");
+        return "redirect:" + Global.getAdminPath() + "/hehe/cmHeheImage/?repage";
+    }
+
+    /**
+     * 启用、停用状态
+     */
+    @ResponseBody
+    @RequestMapping(value="updateStatus")
+    public Map<String, Object> updateStatus(String status, Integer id){
+        Map<String, Object> map = Maps.newLinkedHashMap();
+        try {
+            cmHeheImageService.updateStatusById(status,id);
+            map.put("success",true);
+            map.put("msg", "修改成功");
+        } catch (Exception e) {
+            logger.debug(e.toString(),e);
+            map.put("success",false);
+            map.put("msg", "修改失败");
+        }
+        return map;
+    }
+
+    /**
+     * 批量更新排序值
+     */
+    @RequestMapping(value = "batchSaveSort")
+    @ResponseBody
+    public Map<String, Object> batchSaveSort(String sortList) {
+        Map<String, Object> map = Maps.newLinkedHashMap();
+        try {
+            String[] newPageLists = sortList.split(",");
+            for (String list : newPageLists) {
+                String[] split = list.split("-");
+                if (split.length == 1 || split.length < 1) {
+                    String id = split[0];
+                    String sort = null;
+                    cmHeheImageService.saveSort(sort, id);
+                } else {
+                    String id = split[0];
+                    String sort = split[1];
+                    if (isInteger(sort)) {
+                        if (StringUtils.equals("0", sort)) {
+                            map.put("success", false);
+                            map.put("msg", "排序值只能填写大于等于1的整数");
+                            return map;
+                        }
+                        cmHeheImageService.saveSort(sort, id);
+                    } else {
+                        map.put("success", false);
+                        map.put("msg", "排序值只能为数字");
+                        return map;
+                    }
+                }
+            }
+            map.put("success", true);
+            map.put("msg", "更新排序成功");
+            return map;
+        } catch (Exception e) {
+            map.put("success", false);
+            map.put("msg", "更新排序失败");
+            return map;
+        }
+    }
+}

+ 154 - 0
src/main/java/com/caimei/modules/hehe/web/CmHeheProductController.java

@@ -0,0 +1,154 @@
+package com.caimei.modules.hehe.web;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import com.caimei.modules.product.entity.Product;
+import com.google.common.collect.Maps;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+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.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.hehe.entity.CmHeheProduct;
+import com.caimei.modules.hehe.service.CmHeheProductService;
+
+import java.util.Map;
+
+import static com.caimei.modules.newhome.web.NewPageQualitySupplierController.isInteger;
+
+/**
+ * 呵呵商品Controller
+ *
+ * @author plf
+ * @version 2021-04-14
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/hehe/cmHeheProduct")
+public class CmHeheProductController extends BaseController {
+
+    @Autowired
+    private CmHeheProductService cmHeheProductService;
+
+    @ModelAttribute
+    public CmHeheProduct get(@RequestParam(required = false) String id) {
+        CmHeheProduct entity = null;
+        if (StringUtils.isNotBlank(id)) {
+            entity = cmHeheProductService.get(id);
+        }
+        if (entity == null) {
+            entity = new CmHeheProduct();
+        }
+        return entity;
+    }
+
+    @RequestMapping(value = {"list", ""})
+    public String list(CmHeheProduct cmHeheProduct, HttpServletRequest request, HttpServletResponse response, Model model) {
+        Page<CmHeheProduct> page = cmHeheProductService.findPage(new Page<CmHeheProduct>(request, response), cmHeheProduct);
+        model.addAttribute("page", page);
+        return "modules/hehe/cmHeheProductList";
+    }
+
+    @RequestMapping(value = "form")
+    public String form(CmHeheProduct cmHeheProduct, Model model) {
+        model.addAttribute("cmHeheProduct", cmHeheProduct);
+        return "modules/hehe/cmHeheProductForm";
+    }
+
+    @RequestMapping(value = "save")
+    public String save(CmHeheProduct cmHeheProduct, Model model, RedirectAttributes redirectAttributes) {
+        if (!beanValidator(model, cmHeheProduct)) {
+            return form(cmHeheProduct, model);
+        }
+        cmHeheProductService.save(cmHeheProduct);
+        addMessage(redirectAttributes, "保存商品成功");
+        return "redirect:" + Global.getAdminPath() + "/hehe/cmHeheProduct/?repage";
+    }
+
+    @RequestMapping(value = "delete")
+    public String delete(CmHeheProduct cmHeheProduct, RedirectAttributes redirectAttributes) {
+        cmHeheProductService.delete(cmHeheProduct);
+        addMessage(redirectAttributes, "删除商品成功");
+        return "redirect:" + Global.getAdminPath() + "/hehe/cmHeheProduct/?repage";
+    }
+
+    @RequestMapping(value = "findProductPage")
+    public String findProductPage(Product product, Model model, HttpServletRequest request, HttpServletResponse response) {
+        Page<Product> page = cmHeheProductService.findProductPage(new Page<Product>(request, response), product);
+        model.addAttribute("page", page);
+        model.addAttribute("ids", product.getIds());
+        model.addAttribute("delProductIds", product.getDelProductIds());
+        return "modules/hehe/heheAddProduct";
+    }
+
+    /**
+     * 批量更新排序值
+     */
+    @RequestMapping(value = "batchSaveSort")
+    @ResponseBody
+    public Map<String, Object> batchSaveSort(String sortList) {
+        Map<String, Object> map = Maps.newLinkedHashMap();
+        try {
+            String[] newPageLists = sortList.split(",");
+            for (String list : newPageLists) {
+                String[] split = list.split("-");
+                if (split.length == 1 || split.length < 1) {
+                    String id = split[0];
+                    String sort = null;
+                    cmHeheProductService.saveSort(sort, id);
+                } else {
+                    String id = split[0];
+                    String sort = split[1];
+                    if (isInteger(sort)) {
+                        if (StringUtils.equals("0", sort)) {
+                            map.put("success", false);
+                            map.put("msg", "排序值只能填写大于等于1的整数");
+                            return map;
+                        }
+                        cmHeheProductService.saveSort(sort, id);
+                    } else {
+                        map.put("success", false);
+                        map.put("msg", "排序值只能为数字");
+                        return map;
+                    }
+                }
+            }
+            map.put("success", true);
+            map.put("msg", "更新排序成功");
+            return map;
+        } catch (Exception e) {
+            map.put("success", false);
+            map.put("msg", "更新排序失败");
+            return map;
+        }
+    }
+
+    /**
+     * 商品上下架
+     */
+    @RequestMapping(value = "updateValidFlag")
+    public String updateValidFlag(CmHeheProduct cmHeheProduct) {
+        cmHeheProductService.updateValidFlag(cmHeheProduct);
+        return "redirect:" + Global.getAdminPath() + "/hehe/cmHeheProduct/?repage";
+    }
+
+    /**
+     * 商品修改推荐
+     */
+    @RequestMapping(value = "updateRecommend")
+    public String updateRecommend(CmHeheProduct cmHeheProduct) {
+        cmHeheProductService.updateRecommend(cmHeheProduct);
+        return "redirect:" + Global.getAdminPath() + "/hehe/cmHeheProduct/?repage";
+    }
+
+
+}

+ 86 - 0
src/main/java/com/caimei/modules/hehe/web/CmHeheUserController.java

@@ -0,0 +1,86 @@
+package com.caimei.modules.hehe.web;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+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.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.hehe.entity.CmHeheUser;
+import com.caimei.modules.hehe.service.CmHeheUserService;
+
+/**
+ * 呵呵用户Controller
+ *
+ * @author plf
+ * @version 2021-04-14
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/hehe/cmHeheUser")
+public class CmHeheUserController extends BaseController {
+
+    @Autowired
+    private CmHeheUserService cmHeheUserService;
+
+    @ModelAttribute
+    public CmHeheUser get(@RequestParam(required = false) String id) {
+        CmHeheUser entity = null;
+        if (StringUtils.isNotBlank(id)) {
+            entity = cmHeheUserService.get(id);
+        }
+        if (entity == null) {
+            entity = new CmHeheUser();
+        }
+        return entity;
+    }
+
+    @RequestMapping(value = {"list", ""})
+    public String list(CmHeheUser cmHeheUser, HttpServletRequest request, HttpServletResponse response, Model model) {
+        cmHeheUser.setUserIdentity("2");
+        Page<CmHeheUser> page = cmHeheUserService.findPage(new Page<CmHeheUser>(request, response), cmHeheUser);
+        model.addAttribute("page", page);
+        return "modules/hehe/cmHeheUserList";
+    }
+
+    @RequestMapping(value = "form")
+    public String form(CmHeheUser cmHeheUser, Model model) {
+        model.addAttribute("cmHeheUser", cmHeheUser);
+        return "modules/hehe/cmHeheUserForm";
+    }
+
+    @RequestMapping(value = "save")
+    public String save(CmHeheUser cmHeheUser, Model model, RedirectAttributes redirectAttributes) {
+        if (!beanValidator(model, cmHeheUser)) {
+            return form(cmHeheUser, model);
+        }
+        Integer userId = cmHeheUserService.findMobileOnly(cmHeheUser);
+        if (userId != null && userId > 0) {
+            addMessage(model, "手机号重复,请更换手机号");
+            return form(cmHeheUser, model);
+        }
+        cmHeheUserService.save(cmHeheUser);
+        addMessage(redirectAttributes, "保存呵呵用户成功");
+        return "redirect:" + Global.getAdminPath() + "/hehe/cmHeheUser/?repage";
+    }
+
+    /**
+     * 呵呵商城所有用户列表
+     */
+    @RequestMapping("/userList")
+    public String userList(CmHeheUser cmHeheUser, HttpServletRequest request, HttpServletResponse response, Model model){
+        Page<CmHeheUser> page = cmHeheUserService.findPage(new Page<CmHeheUser>(request, response), cmHeheUser);
+        model.addAttribute("page", page);
+        return "modules/hehe/cmHeheUserAllList";
+    }
+
+}

+ 108 - 0
src/main/resources/mappings/modules/hehe/CmHeheImageMapper.xml

@@ -0,0 +1,108 @@
+<?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.hehe.dao.CmHeheImageDao">
+    
+	<sql id="cmHeheImageColumns">
+		a.id AS "id",
+		a.topic AS "topic",
+		a.image AS "image",
+		a.sort AS "sort",
+		a.status AS "status",
+		a.addTime AS "addTime"
+	</sql>
+	
+	<sql id="cmHeheImageJoins">
+	</sql>
+    
+	<select id="get" resultType="CmHeheImage">
+		SELECT 
+			<include refid="cmHeheImageColumns"/>
+		FROM cm_hehe_image a
+		<include refid="cmHeheImageJoins"/>
+		WHERE a.id = #{id}
+	</select>
+	
+	<select id="findList" resultType="CmHeheImage">
+		SELECT 
+			<include refid="cmHeheImageColumns"/>
+		FROM cm_hehe_image a
+		<include refid="cmHeheImageJoins"/>
+		<where>
+			
+			<if test="topic != null and topic != ''">
+				AND a.topic LIKE 
+					<if test="dbName == 'oracle'">'%'||#{topic}||'%'</if>
+					<if test="dbName == 'mssql'">'%'+#{topic}+'%'</if>
+					<if test="dbName == 'mysql'">concat('%',#{topic},'%')</if>
+			</if>
+			<if test="status != null and status != ''">
+				AND a.status = #{status}
+			</if>
+		</where>
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY -sort DESC
+			</otherwise>
+		</choose>
+	</select>
+	
+	<select id="findAllList" resultType="CmHeheImage">
+		SELECT 
+			<include refid="cmHeheImageColumns"/>
+		FROM cm_hehe_image a
+		<include refid="cmHeheImageJoins"/>
+		<where>
+			
+		</where>		
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+			</otherwise>
+		</choose>
+	</select>
+	
+	<insert id="insert" parameterType="CmHeheImage"  keyProperty="id" useGeneratedKeys="true">
+		INSERT INTO cm_hehe_image(
+			topic,
+			image,
+			sort,
+			status,
+			addTime
+		) VALUES (
+			#{topic},
+			#{image},
+			#{sort},
+			#{status},
+			NOW()
+		)
+	</insert>
+	
+	<update id="update">
+		UPDATE cm_hehe_image SET 	
+			topic = #{topic},
+			image = #{image},
+			sort = #{sort},
+			status = #{status},
+			addTime = #{addTime}
+		WHERE id = #{id}
+	</update>
+	
+	<delete id="delete">
+		DELETE FROM cm_hehe_image
+		WHERE id = #{id}
+	</delete>
+
+	<update id="updateStatusById">
+		UPDATE cm_hehe_image SET status = #{status} WHERE id = #{id}
+	</update>
+
+	<update id="saveSort">
+		UPDATE cm_hehe_image SET sort = #{sort} WHERE id = #{id}
+	</update>
+	
+</mapper>

+ 181 - 0
src/main/resources/mappings/modules/hehe/CmHeheProductMapper.xml

@@ -0,0 +1,181 @@
+<?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.hehe.dao.CmHeheProductDao">
+    
+	<sql id="cmHeheProductColumns">
+		a.id AS "id",
+		a.productId AS "productId",
+		a.sort AS "sort",
+		a.recommend AS "recommend",
+		a.validFlag AS "validFlag",
+		a.price AS "price",
+		a.includedTax AS "includedTax",
+		a.invoiceType AS "invoiceType",
+		a.clubTaxPoint AS "clubTaxPoint",
+		a.shopTaxPoint AS "shopTaxPoint",
+		p.costCheckFlag AS "costType",
+		p.costPrice AS "costPrice",
+		p.costProportional AS "costProportional",
+		a.addTime AS "addTime",
+		p.name AS "name",
+		p.mainImage AS "mainImage",
+		s.name AS "shopName"
+	</sql>
+	
+	<sql id="cmHeheProductJoins">
+		LEFT JOIN product p ON  a.productId = p.productID
+		LEFT JOIN shop s ON s.shopID = p.shopID
+	</sql>
+    
+	<select id="get" resultType="CmHeheProduct">
+		SELECT 
+			<include refid="cmHeheProductColumns"/>
+		FROM cm_hehe_product a
+		<include refid="cmHeheProductJoins"/>
+		WHERE a.id = #{id}
+	</select>
+	
+	<select id="findList" resultType="CmHeheProduct">
+		SELECT 
+			<include refid="cmHeheProductColumns"/>
+		FROM cm_hehe_product a
+		<include refid="cmHeheProductJoins"/>
+		<where>
+			<if test="productId != null and productId != ''">
+				AND a.productId = #{productId}
+			</if>
+			<if test="validFlag != null and validFlag != ''">
+				AND a.validFlag = #{validFlag}
+			</if>
+			<if test="includedTax != null and includedTax != ''">
+				AND a.includedTax = #{includedTax}
+			</if>
+			<if test="invoiceType != null and invoiceType != ''">
+				AND a.invoiceType = #{invoiceType}
+			</if>
+			<if test="id != null and id != ''">
+				AND a.id = #{id}
+			</if>
+			<if test="name != null and name != ''">
+				AND p.name LIKE CONCAT('%',#{name},'%')
+			</if>
+			<if test="shopName != null and shopName != ''">
+				AND s.shopName LIKE CONCAT('%',#{shopName},'%')
+			</if>
+			<if test="recommend != null and recommend != ''">
+				AND a.recommend = #{recommend}
+			</if>
+		</where>
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY -sort DESC
+			</otherwise>
+		</choose>
+	</select>
+	
+	<select id="findAllList" resultType="CmHeheProduct">
+		SELECT 
+			<include refid="cmHeheProductColumns"/>
+		FROM cm_hehe_product a
+		<include refid="cmHeheProductJoins"/>
+		<where>
+			
+		</where>		
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+			</otherwise>
+		</choose>
+	</select>
+	
+	<insert id="insert" parameterType="CmHeheProduct"  keyProperty="id" useGeneratedKeys="true">
+		INSERT INTO cm_hehe_product(
+			productId,
+			sort,
+			recommend,
+			validFlag,
+			price,
+			includedTax,
+			invoiceType,
+			clubTaxPoint,
+			shopTaxPoint,
+			addTime
+		) VALUES (
+			#{productId},
+			#{sort},
+			#{recommend},
+			#{validFlag},
+			#{price},
+			#{includedTax},
+			#{invoiceType},
+			#{clubTaxPoint},
+			#{shopTaxPoint},
+			NOW()
+		)
+	</insert>
+	
+	<update id="update">
+		UPDATE cm_hehe_product SET 	
+			productId = #{productId},
+			sort = #{sort},
+			recommend = #{recommend},
+			validFlag = #{validFlag},
+			price = #{price},
+			includedTax = #{includedTax},
+			invoiceType = #{invoiceType},
+			clubTaxPoint = #{clubTaxPoint},
+			shopTaxPoint = #{shopTaxPoint}
+		WHERE id = #{id}
+	</update>
+	
+	<delete id="delete">
+		DELETE FROM cm_hehe_product
+		WHERE id = #{id}
+	</delete>
+
+	<select id="findHeHeProductId" resultType="integer">
+		SELECT productId FROM cm_hehe_product
+	</select>
+
+	<select id="findAllProduct" resultType="com.caimei.modules.product.entity.Product">
+		SELECT
+		a.*,s.name AS "shopName"
+		FROM product a
+		LEFT JOIN shop s on s.shopID = a.shopID
+		<where>
+			<if test="productID != null" >
+				AND a.productID = #{productID}
+			</if>
+			<if test="name != null and name != ''">
+				AND a.name LIKE concat('%',#{name},'%')
+			</if>
+			<if test="shopName != null and shopName != ''">
+				AND s.name LIKE concat('%',#{shopName},'%')
+			</if>
+			<if test="ids != null and ids.size() > 0 ">
+				AND a.productID NOT IN
+				<foreach collection="ids" open="(" close=")" item="id" separator=",">
+					#{id}
+				</foreach>
+			</if>
+		</where>
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				order by a.productID
+			</otherwise>
+		</choose>
+	</select>
+
+	<update id="saveSort">
+		UPDATE cm_hehe_product SET sort = #{sort} WHERE id = #{id}
+	</update>
+	
+</mapper>

+ 116 - 0
src/main/resources/mappings/modules/hehe/CmHeheUserMapper.xml

@@ -0,0 +1,116 @@
+<?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.hehe.dao.CmHeheUserDao">
+    
+	<sql id="cmHeheUserColumns">
+		a.id AS "id",
+		a.name AS "name",
+		a.mobile AS "mobile",
+		a.userIdentity AS "userIdentity",
+		a.nickName AS "nickName",
+		a.openId AS "openId",
+		a.addTime AS "addTime"
+	</sql>
+	
+	<sql id="cmHeheUserJoins">
+	</sql>
+    
+	<select id="get" resultType="CmHeheUser">
+		SELECT 
+			<include refid="cmHeheUserColumns"/>
+		FROM cm_hehe_user a
+		<include refid="cmHeheUserJoins"/>
+		WHERE a.id = #{id}
+	</select>
+	
+	<select id="findList" resultType="CmHeheUser">
+		SELECT 
+			<include refid="cmHeheUserColumns"/>
+		FROM cm_hehe_user a
+		<include refid="cmHeheUserJoins"/>
+		<where>
+			<if test="name != null and name != ''">
+				AND a.name LIKE 
+					<if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
+					<if test="dbName == 'mssql'">'%'+#{name}+'%'</if>
+					<if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
+			</if>
+			<if test="mobile != null and mobile != ''">
+				AND a.mobile = #{mobile}
+			</if>
+			<if test="userIdentity != null and userIdentity != ''">
+				AND a.userIdentity = #{userIdentity}
+			</if>
+			<if test="nickName != null and nickName != ''">
+				AND a.nickName LIKE concat('%',#{nickName},'%')
+			</if>
+		</where>
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY addTime DESC
+			</otherwise>
+		</choose>
+	</select>
+	
+	<select id="findAllList" resultType="CmHeheUser">
+		SELECT 
+			<include refid="cmHeheUserColumns"/>
+		FROM cm_hehe_user a
+		<include refid="cmHeheUserJoins"/>
+		<where>
+			
+		</where>		
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+			</otherwise>
+		</choose>
+	</select>
+	
+	<insert id="insert" parameterType="CmHeheUser"  keyProperty="id" useGeneratedKeys="true">
+		INSERT INTO cm_hehe_user(
+			name,
+			mobile,
+			userIdentity,
+			nickName,
+			openId,
+			addTime
+		) VALUES (
+			#{name},
+			#{mobile},
+			#{userIdentity},
+			#{nickName},
+			#{openId},
+			#{addTime}
+		)
+	</insert>
+	
+	<update id="update">
+		UPDATE cm_hehe_user SET 	
+			name = #{name},
+			mobile = #{mobile},
+			userIdentity = #{userIdentity},
+			nickName = #{nickName},
+			openId = #{openId},
+			addTime = #{addTime}
+		WHERE id = #{id}
+	</update>
+
+	<select id="findMobileOnly" resultType="integer">
+		SELECT
+		  id
+		FROM
+		  cm_hehe_user
+		WHERE
+		  mobile = #{mobile}
+		  <if test="id != null and id != ''">
+			  AND id != #{id}
+		  </if>
+	</select>
+	
+</mapper>

+ 196 - 0
src/main/webapp/WEB-INF/views/modules/hehe/cmHeheImageForm.jsp

@@ -0,0 +1,196 @@
+<%@ 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>
+		.iconBox{
+			font-size: 0;
+		}
+		.controls .conList{
+			display: inline-block;
+			margin-right: 15px;
+		}
+		.conList .btn:nth-of-type(1){
+			margin-left: 25px;
+		}
+		.upload-content {
+			margin-top: -70px;
+		}
+		.upload-content .conList .btn:nth-of-type(1) {
+			width: 90px;
+			height: 100px;
+			border: 2px solid #eee;
+			background: #fff;
+			position: relative;
+		}
+		.upload-content .conList .btn:nth-of-type(1)>div {
+			position: absolute;
+			top: 50%;
+			left: 50%;
+			transform: translate(-50%, -50%);
+			color: #666;
+		}
+		.upload-content .conList .btn:nth-of-type(1) span {
+			font-size: 35px;
+		}
+		.upload-content .conList .btn:nth-of-type(1) h5 {
+			color: #666;
+		}
+		.cancel-upload {
+			background: transparent;
+			border: none;
+			box-shadow: none;
+			position: relative;
+			top: -38px;
+			left: -25px;
+			cursor: pointer;
+			z-index: 100;
+		}
+		.upload-content .conList ol li {
+			width: 114px;
+			min-height: 80px;
+			text-align: center;
+			background: #fff;
+			position: relative;
+			top: 120px;
+			margin-left: 2px;
+		}
+		.hide-pic {
+			display: none !important;
+		}
+	</style>
+	<script type="text/javascript">
+		$(document).ready(function() {
+			//$("#name").focus();
+			$("#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><a href="${ctx}/hehe/cmHeheImage/">轮播图列表</a></li>
+		<li class="active"><a href="${ctx}/hehe/cmHeheImage/form?id=${cmHeheImage.id}">${not empty cmHeheImage.id?'编辑':'添加'}</a></li>
+	</ul><br/>
+	<form:form id="inputForm" modelAttribute="cmHeheImage" action="${ctx}/hehe/cmHeheImage/save" method="post" class="form-horizontal">
+		<form:hidden path="id"/>
+		<sys:message content="${message}"/>		
+		<div class="control-group">
+			<label class="control-label"><font color="red">*</font>主题:</label>
+			<div class="controls">
+				<form:input path="topic" htmlEscape="false" placeholder="最多输入30个汉字" style="position:relative" maxlength="30" class="input-xlarge required"/>
+			</div>
+		</div>
+		<div class="control-group iconBox">
+			<label class="control-label"><font color="red">*</font>图片:</label>
+			<div class="controls upload-content" id="imageBox">
+				<div class="conList">
+					<form:hidden id="image" path="image" htmlEscape="false" maxlength="255" class="input-xlarge"/>
+					<sys:ckfinder input="image" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+					<br>
+					<label style="margin-left: 20px">建议图片分辨率750px*366px</label>
+				</div>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label"><font color="red">*</font>排序:</label>
+			<div class="controls">
+				<form:input path="sort" onkeyup="onlynum(this)" htmlEscape="false" class="input-xlarge required"/>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label"><font color="red">*</font>状态:</label>
+			<div class="controls">
+				<form:select path="status" class="input-xlarge required">
+					<form:option value="1" label="启用"/>
+					<form:option value="2" label="停用"/>
+				</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>
+
+<script>
+	$(function () {
+		$('.upload-content .conList .btn:nth-of-type(1)').html('<div><span>+</span><h5>选择图片</h5></div>');
+		$('.upload-content .conList .btn:nth-of-type(2)').after('<img class="cancel-upload" src="/static/images/close-btn1.png">').remove();
+		$('.upload-content .conList').find('.cancel-upload').hide();
+		var observeEle = document.getElementsByClassName('upload-content')[0];
+		var MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
+		var MutationObserverConfig = {
+			childList: true,
+			subtree: true,
+			characterData: true
+		};
+		var observer = new MutationObserver(function (mutations) {
+			$.each(mutations, function (index, item) {
+				if (item.type === 'childList') {
+					// 在创建新的 element 时调用
+					var target = $(item.target),
+							thisWrapper = target.closest('.conList'),
+							nextEle = thisWrapper.next();
+					thisWrapper.find('li').css('z-index', 99);
+					thisWrapper.find('.cancel-upload').show();
+					if (nextEle.hasClass('hide-pic')) {
+						nextEle.removeClass('hide-pic');
+					}
+				}
+			})
+		});
+		observer.observe(observeEle, MutationObserverConfig);
+
+		$('body').on('click', '.cancel-upload', function () {
+			var wrapper = $(this).closest('.conList');
+			wrapper.find('li').css('z-index', '-1');
+			wrapper.find('input').val('');
+			$(this).hide();
+			wrapper.removeClass("hide-pic");
+			wrapper.parent().append(wrapper.clone());
+			wrapper.remove();
+			$(".conList").each(function (i, ele) {
+				if ($(ele).find("input.input-xlarge").val()) {
+					$(ele).next().removeClass("hide-pic")
+				}
+			})
+		});
+		$(window).on("load", function () {
+			setTimeout(function () {
+				$("#imageBox").find("input.input-xlarge").each(function (i, ele) {
+					if ($(ele).val()) {
+						$(ele).next().find("li").css("z-index", "99");
+						$(ele).parents(".conList").find(".cancel-upload").show();
+						$(ele).parents(".conList").next().removeClass("hide-pic")
+					}
+				})
+			}, 200);
+		});
+	});
+
+	/**
+	 * @param obj
+	 * jquery控制input只能输入数字
+	 */
+	function onlynum(obj) {
+		obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
+	}
+</script>
+</body>
+</html>

+ 151 - 0
src/main/webapp/WEB-INF/views/modules/hehe/cmHeheImageList.jsp

@@ -0,0 +1,151 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
+<html>
+<head>
+	<title>呵呵轮播图管理</title>
+	<meta name="decorator" content="default"/>
+	<style type="text/css">
+		.table th{text-align: center;}
+		.table td{text-align: center;}
+	</style>
+	<script type="text/javascript">
+		$(document).ready(function() {
+			
+		});
+		function page(n,s){
+			$("#pageNo").val(n);
+			$("#pageSize").val(s);
+			$("#searchForm").submit();
+        	return false;
+        }
+	</script>
+</head>
+<body>
+	<ul class="nav nav-tabs">
+		<li class="active"><a href="${ctx}/hehe/cmHeheImage/">轮播图列表</a></li>
+	</ul>
+	<form:form id="searchForm" modelAttribute="cmHeheImage" action="${ctx}/hehe/cmHeheImage/" method="post" class="breadcrumb form-search">
+		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
+		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+		<div class="ul-form">
+			 <label>主题:</label>
+				<form:input path="topic" 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="2" label="停用"/>
+				</form:select>
+			&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
+			<input class="btn btn-primary" type="button" value="一键排序" onclick="batchSaveSort()" style="margin-left: 15px"/>
+			&nbsp;&nbsp;<input class="btn btn-primary" style="width: 80px" onclick="window.location='${ctx}/hehe/cmHeheImage/form'" value="添加轮播图"/>
+			<div class="clearfix"></div>
+		</div>
+	</form:form>
+	<sys:message content="${message}"/>
+	<table id="contentTable" class="table table-striped table-bordered table-condensed">
+		<thead>
+			<tr>
+				<th>主题</th>
+				<th>图片</th>
+				<th>排序值</th>
+				<th>小程序状态</th>
+				<th>添加时间</th>
+				<th>操作</th>
+			</tr>
+		</thead>
+		<tbody>
+		<c:forEach items="${page.list}" var="cmHeheImage">
+			<tr>
+				<input class="check-item" type="hidden" id="preferredProductSort${cmHeheImage.id}" value='${cmHeheImage.id}-${cmHeheImage.sort}'/>
+				<td>
+					${cmHeheImage.topic}
+				</td>
+				<td>
+					<img src="${cmHeheImage.image}" width="50px" height="50px">
+				</td>
+				<td>
+					<input id="sort" name="sort" style="width:50px;" value="${cmHeheImage.sort}" onkeyup="onlynum(this)" onchange="changeSort(${cmHeheImage.id},this)">
+				</td>
+				<td>
+					<c:if test="${cmHeheImage.status eq 1 }">
+						<font color="green">已启用</font>
+						<a href="javascript:void(0);" onclick="updateStatus('2','${cmHeheImage.id}');" >
+							停用
+						</a>
+					</c:if>
+					<c:if test="${cmHeheImage.status ne 1 }">
+						<font color="red">已停用</font>
+						<a href="javascript:void(0)" onclick="updateStatus('1','${cmHeheImage.id}');">
+							启用
+						</a>
+					</c:if>
+				</td>
+				<td>
+					<fmt:formatDate value="${cmHeheImage.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
+				</td>
+				<td>
+    				<a href="${ctx}/hehe/cmHeheImage/form?id=${cmHeheImage.id}">编辑</a>
+					<a href="${ctx}/hehe/cmHeheImage/delete?id=${cmHeheImage.id}" onclick="return confirmx('确定删除该轮播图吗?删除后需要重新添加', this.href)">删除</a>
+				</td>
+			</tr>
+		</c:forEach>
+		</tbody>
+	</table>
+	<div class="pagination">${page}</div>
+<script>
+	//状态修改
+	function updateStatus(status,id){
+		var msg='确定启用该轮播图吗?';
+		if('2'==status){
+			msg='确定停用该轮播图吗?';
+		}
+		top.$.jBox.confirm(msg,'系统提示',function(v,h,f){
+			if(v=='ok'){
+				$.post("${ctx}/hehe/cmHeheImage/updateStatus",{'status':status,'id':id}, 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});
+	}
+
+	//修改排序值
+	function changeSort(id, sortThis) {
+		var value = sortThis.value;
+		$("#preferredProductSort" + id).val(id + "-" + value);
+	}
+
+	//批量保存排序
+	function batchSaveSort() {
+		var items = new Array();
+		var $items = $('.check-item');
+		$items.each(function(){
+			items.push($(this).val());
+		});
+		//保存批量排序
+		$.post("${ctx}/hehe/cmHeheImage/batchSaveSort?sortList="+items, function(data) {
+			if(true==data.success){
+				$.jBox.tip(data.msg, 'info');
+				window.location.href = "${ctx}/hehe/cmHeheImage";
+			} else {
+				$.jBox.tip(data.msg,'error');
+			}
+		},"JSON");//这里返回的类型有:json,html,xml,text
+	}
+
+	/**
+	 * @param obj
+	 * jquery控制input只能输入数字
+	 */
+	function onlynum(obj) {
+		obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
+	}
+</script>
+</body>
+</html>

+ 291 - 0
src/main/webapp/WEB-INF/views/modules/hehe/cmHeheProductForm.jsp

@@ -0,0 +1,291 @@
+<%@ 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() {
+			//$("#name").focus();
+			$("#inputForm").validate({
+				submitHandler: function (form) {
+					var productId = $('#productId').val();
+					if (productId.length == 0) {
+						alertx("请选择商品");
+						return false;
+					}
+					loading('正在提交,请稍等...');
+					form.submit();
+				},
+				errorContainer: "#messageBox",
+				errorPlacement: function (error, element) {
+					$("#messageBox").text("输入有误,请先更正。");
+					if (element.is(":checkbox") || element.is(":radio") || element.parent().is(".input-append")) {
+						error.appendTo(element.parent().parent());
+					} else {
+						error.insertAfter(element);
+					}
+				}
+			});
+		});
+	</script>
+</head>
+<body>
+	<ul class="nav nav-tabs">
+		<li><a href="${ctx}/hehe/cmHeheProduct/">商品列表</a></li>
+		<li class="active"><a href="${ctx}/hehe/cmHeheProduct/form?id=${cmHeheProduct.id}">${not empty cmHeheProduct.id?'编辑':'添加'}</a></li>
+	</ul><br/>
+	<form:form id="inputForm" modelAttribute="cmHeheProduct" action="${ctx}/hehe/cmHeheProduct/save" method="post" class="form-horizontal">
+		<form:hidden path="id"/>
+		<form:hidden path="productId" id="productId"/>
+		<sys:message content="${message}"/>
+		<div class="control-group">
+			<label class="control-label"><font color="red">*</font>商品:</label>
+			<div class="controls" id="addProduct">
+				<a href="JavaScript:;" onclick="showSelect()">请选择加入呵呵商城的商品</a>
+			</div>
+			<table id="contentTable" class="table table-striped table-bordered table-condensed" hidden="hidden">
+				<thead>
+					<tr>
+						<th>图片</th>
+						<th>商品名称</th>
+						<th>供应商</th>
+						<th>操作</th>
+					</tr>
+				</thead>
+				<tbody>
+					<tr>
+						<td><img id="mainImage" src="${cmHeheProduct.mainImage}" width="50px" height="50px"></td>
+						<td style="text-align: center" id="name">${cmHeheProduct.name}</td>
+						<td id="shopName">${cmHeheProduct.shopName}</td>
+						<td><a href="javascript:void(0);" onclick="deleteProduct()">删除</a></td>
+					</tr>
+				</tbody>
+			</table>
+		</div>
+		<div id="productInfo" hidden="hidden">
+			<div class="control-group">
+				<label class="control-label"><font color="red">*</font>售价:</label>
+				<div class="controls">
+					<input type="number" style="width:100px;" id="price" name="price" value="${cmHeheProduct.price}" required>
+				</div>
+			</div>
+			<div class="control-group">
+				<label class="control-label"><font color="red">*</font>是否含税:</label>
+				<div class="controls">
+					<form:radiobutton id="includedTax1" path="includedTax" value="1" label="含税" onclick="chageIncludedTax()"/>&nbsp;&nbsp;&nbsp;&nbsp;
+					<form:radiobutton id="includedTax0" path="includedTax" value="0" label="不含税" onclick="chageIncludedTax()"/>
+				</div>
+				<br>
+				<div class="controls">
+					<form:radiobutton id="invoiceType1" path="invoiceType" value="1" label="增值税专用发票" onclick="showTaxPoint()"/>&nbsp;&nbsp;&nbsp;&nbsp;
+					<form:radiobutton id="invoiceType2" path="invoiceType" value="2" label="增值税普通发票" onclick="showTaxPoint()"/>&nbsp;&nbsp;&nbsp;&nbsp;
+					<span id="invoiceTypeShow"><form:radiobutton id="invoiceType3" path="invoiceType" value="3" label="不能开票" onclick="showTaxPoint()"/></span>
+				</div>
+			</div>
+			<div class="control-group taxPointShow">
+				<label class="control-label"><font color="red">*</font>机构税率:</label>
+				<div class="controls">
+					<input type="number" style="width:100px;" id="clubTaxPoint" name="clubTaxPoint" value="${cmHeheProduct.clubTaxPoint}" required>%
+				</div>
+			</div>
+			<div class="control-group taxPointShow">
+				<label class="control-label"><font color="red">*</font>供应商税率:</label>
+				<div class="controls">
+					<input type="number" style="width:100px;" id="shopTaxPoint" name="shopTaxPoint" value="${cmHeheProduct.shopTaxPoint}" required>%
+				</div>
+			</div>
+			<div class="control-group">
+				<label class="control-label"><font color="red">*</font>成本价类型:</label>
+				<div class="controls" id="costType">
+						${cmHeheProduct.costType eq 1 ? '固定成本' : '比例成本'}
+				</div>
+			</div>
+			<div class="control-group" id="costPriceShow">
+				<label class="control-label"><font color="red">*</font>成本价:</label>
+				<div class="controls" id="costPrice">
+					${cmHeheProduct.costPrice}
+				</div>
+			</div>
+			<div class="control-group" id="costProportionalShow">
+				<label class="control-label"><font color="red">*</font>比例成本百分比:</label>
+				<div class="controls" id="costProportional">
+					${cmHeheProduct.costProportional}%
+				</div>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label"><font color="red">*</font>排序:</label>
+			<div class="controls">
+				<form:input path="sort" htmlEscape="false" class="input-xlarge required" onkeyup="onlynum(this)"/>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label"><font color="red">*</font>推荐状态:</label>
+			<div class="controls">
+				<form:select path="recommend" class="input-small required">
+					<form:option value="" label="请选择"/>
+					<form:option value="0" label="不推荐"/>
+					<form:option value="1" label="推荐"/>
+				</form:select>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label"><font color="red">*</font>商品状态:</label>
+			<div class="controls">
+				<form:select path="validFlag" class="input-small required">
+					<form:option value="" label="请选择"/>
+					<form:option value="1" label="已上架"/>
+					<form:option value="2" label="已下架"/>
+				</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>
+
+<script>
+	$(function () {
+		//初始化商品信息
+		if (${not empty cmHeheProduct.id}){
+			$('#contentTable').show();
+			$('#productInfo').show();
+			$('#addProduct').hide();
+			chageIncludedTax();
+			changeCostPriceShow(${cmHeheProduct.costType});
+			showTaxPoint();
+		}
+	});
+
+
+	//选择添加商品
+	function showSelect() {
+		var url = '';
+		var title = '';
+		url = "${ctx}/hehe/cmHeheProduct/findProductPage";
+		title = "选择商品";
+		top.$.jBox("iframe:" + url, {
+			iframeScrolling: 'yes',
+			width: $(top.document).width() - 600,
+			height: $(top.document).height() - 160,
+			persistent: true,
+			title: title,
+			buttons: {"确定": '1', "关闭": '-1'},
+			submit: function (v, h, f) {
+				//确定
+				var $jboxFrame = top.$('#jbox-iframe');
+				var $mainFrame = top.$('#mainFrame');
+				if ('1' == v && 1 == $jboxFrame.size() && 1 == $mainFrame.size()) {
+					var items = $jboxFrame[0].contentWindow.getCheckedItems(0);
+					if (items.length > 0) {
+						console.log(items);
+						$('#contentTable').show();
+						$('#productInfo').show();
+						$('#addProduct').hide();
+						var productId = items[0].productId;
+						var mainImage = items[0].mainImage;
+						var name = items[0].name;
+						var shopName = items[0].shopName;
+						var price = items[0].price;
+						var includedTax = items[0].includedTax;
+						var invoiceType = items[0].invoiceType;
+						var clubTaxPoint = items[0].clubTaxPoint;
+						var shopTaxPoint = items[0].shopTaxPoint;
+						var costType = items[0].costType;
+						var costPrice = items[0].costPrice;
+						var costProportional = items[0].costProportional;
+						$("#mainImage").attr("src", mainImage);
+						$("#shopName").text(shopName);
+						$("#productId").val(productId);
+						$("#name").text(name);
+						$("#price").val(price);
+						if (includedTax == 1) {
+							$('#includedTax1').attr('checked', true);
+						} else {
+							$('#includedTax0').attr('checked', true);
+						}
+						if (invoiceType == 1) {
+							$('#invoiceType1').attr('checked', true);
+						} else if (invoiceType == 2) {
+							$('#invoiceType2').attr('checked', true);
+						} else {
+							$('#invoiceType3').attr('checked', true);
+						}
+						$("#clubTaxPoint").val(clubTaxPoint);
+						$("#shopTaxPoint").val(shopTaxPoint);
+						if (costType == 1) {
+							$('#costType').text('固定成本');
+						} else {
+							$('#costType').text('比例成本');
+						}
+						$("#costPrice").text(costPrice);
+						$("#costProportional").text(costProportional + '%');
+						chageIncludedTax();
+						changeCostPriceShow(costType);
+						showTaxPoint();
+					} else {
+						top.$.jBox.tip("请先勾选商品...");
+						return false;
+					}
+				}
+				return true;
+			}
+		});
+	}
+
+	//是否含税显示
+	function chageIncludedTax() {
+		var includedTax = $("input[name='includedTax']:checked").val();
+		if (includedTax == 1) {
+			$('#invoiceTypeShow').hide();
+			var invoiceType = $("input[name='invoiceType']:checked").val();
+			if (invoiceType == 3) {
+				$('#invoiceType1').attr('checked', true);
+				showTaxPoint();
+			}
+		} else {
+			$('#invoiceTypeShow').show();
+		}
+	}
+
+	// 是否固定成本
+	function changeCostPriceShow(costType) {
+		if (costType == 1) {
+			$("#costPriceShow").show();
+			$("#costProportionalShow").hide();
+		} else {
+			$("#costPriceShow").hide();
+			$("#costProportionalShow").show();
+		}
+	}
+
+	//税率显示
+	function showTaxPoint() {
+		var invoiceType = $("input[name='invoiceType']:checked").val();
+		if (invoiceType == 3) {
+			$('.taxPointShow').hide();
+		} else {
+			$('.taxPointShow').show();
+		}
+	}
+
+	//删除商品
+	function deleteProduct() {
+		$('#contentTable').hide();
+		$('#productInfo').hide();
+		$('#addProduct').show();
+		$('#productId').val('');
+	}
+
+	/**
+	 * @param obj
+	 * jquery控制input只能输入数字
+	 */
+	function onlynum(obj) {
+		obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
+	}
+</script>
+</body>
+</html>

+ 179 - 0
src/main/webapp/WEB-INF/views/modules/hehe/cmHeheProductList.jsp

@@ -0,0 +1,179 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
+<html>
+<head>
+	<title>呵呵商品管理</title>
+	<meta name="decorator" content="default"/>
+	<style type="text/css">
+		.table th{text-align: center;}
+		.table td{text-align: center;}
+	</style>
+	<script type="text/javascript">
+		$(document).ready(function() {
+			
+		});
+		function page(n,s){
+			$("#pageNo").val(n);
+			$("#pageSize").val(s);
+			$("#searchForm").submit();
+        	return false;
+        }
+	</script>
+</head>
+<body>
+	<ul class="nav nav-tabs">
+		<li class="active"><a href="${ctx}/hehe/cmHeheProduct/">商品列表</a></li>
+	</ul>
+	<form:form id="searchForm" modelAttribute="cmHeheProduct" action="${ctx}/hehe/cmHeheProduct/" method="post" class="breadcrumb form-search">
+		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
+		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+		<div class="ul-form">
+			 <label>商品ID:</label>
+				<form:input path="id" htmlEscape="false" class="input-medium"/>
+			<label>商品名称:</label>
+				<form:input path="name" htmlEscape="false" class="input-medium"/>
+			<label>供应商名称:</label>
+				<form:input path="shopName" htmlEscape="false" class="input-medium"/>
+			 <label>商品状态:</label>
+				<form:select path="validFlag" class="input-small">
+					<form:option value="" label="请选择"/>
+					<form:option value="1" label="已上架"/>
+					<form:option value="2" label="已下架"/>
+				</form:select>
+			 <label>是否含税:</label>
+				<form:select path="includedTax" class="input-small">
+					<form:option value="" label="请选择"/>
+					<form:option value="0" label="不含税"/>
+					<form:option value="1" label="含税"/>
+				</form:select>
+			 <label>发票:</label>
+				<form:select path="invoiceType" class="input-small">
+					<form:option value="" label="请选择"/>
+					<form:option value="1" label="增值税专用发票"/>
+					<form:option value="2" label="增值税普通发票"/>
+					<form:option value="3" label="不能开票"/>
+				</form:select>
+			<br><br>
+			<label>推荐状态:</label>
+			<form:select path="recommend" class="input-small">
+				<form:option value="" label="请选择"/>
+				<form:option value="0" label="不推荐"/>
+				<form:option value="1" label="推荐"/>
+			</form:select>
+			&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
+			<input class="btn btn-primary" type="button" value="一键排序" onclick="batchSaveSort()" style="margin-left: 15px"/>
+			&nbsp;&nbsp;<input class="btn btn-primary" style="width: 80px" onclick="window.location='${ctx}/hehe/cmHeheProduct/form'" value="上线商品"/>
+			<div class="clearfix"></div>
+		</div>
+		<div style="margin-top: 10px">
+			<label><font color="#a9a9a9">注:排序值越小越靠前</font></label>
+		</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>
+				<th>是否含税</th>
+				<th>商品状态</th>
+				<th>排序值</th>
+				<th>推荐状态</th>
+				<th>添加时间</th>
+				<th>操作</th>
+			</tr>
+		</thead>
+		<tbody>
+		<c:forEach items="${page.list}" var="cmHeheProduct">
+			<tr>
+				<input class="check-item" type="hidden" id="preferredProductSort${cmHeheProduct.id}" value='${cmHeheProduct.id}-${cmHeheProduct.sort}'/>
+				<td>
+					${cmHeheProduct.id}
+				</td>
+				<td>
+					<img src="${cmHeheProduct.mainImage}" width="50px" height="50px">
+				</td>
+				<td>
+						${cmHeheProduct.name}
+				</td>
+				<td>
+						${cmHeheProduct.shopName}
+				</td>
+				<td>
+						${cmHeheProduct.price}
+				</td>
+				<td>
+						${cmHeheProduct.costPrice}
+				</td>
+				<td>
+					${cmHeheProduct.includedTax eq 0 ? "不含税" : "含税"}-
+					${cmHeheProduct.includedTax eq 1 ? "增值税专用发票" : cmHeheProduct.includedTax eq 1 ? "增值税普通发票" : "不能开票"}
+				</td>
+				<td>
+					<c:if test="${cmHeheProduct.validFlag eq 1}">
+						<font color="green"><b>已上架</b></font>
+					</c:if>
+					<c:if test="${cmHeheProduct.validFlag eq 2}">
+						<font color="red"><b>已下架</b></font>
+					</c:if>
+				</td>
+				<td>
+						<input id="sort" name="sort" style="width:50px;" value="${cmHeheProduct.sort}" onkeyup="onlynum(this)" onchange="changeSort(${cmHeheProduct.id},this)">
+				</td>
+				<td>
+					<img src="/static/images/${cmHeheProduct.recommend eq "1" ? "yes" : "no"}.gif" width="15px" border="none"/>
+				</td>
+				<td>
+					<fmt:formatDate value="${cmHeheProduct.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
+				</td>
+				<td>
+    				<a href="${ctx}/hehe/cmHeheProduct/form?id=${cmHeheProduct.id}">编辑</a>
+					<a href="${ctx}/hehe/cmHeheProduct/updateValidFlag?id=${cmHeheProduct.id}" onclick="return confirmx('确认要${cmHeheProduct.validFlag eq 1 ? "下架":"上架"}该商品吗?', this.href)">${cmHeheProduct.validFlag eq 1 ? '下架':'上架'}</a>
+					<a href="${ctx}/hehe/cmHeheProduct/updateRecommend?id=${cmHeheProduct.id}" onclick="return confirmx('${cmHeheProduct.recommend eq 0 ? "确定将该商品设为推荐商品吗?":"确定取消推荐吗?"}', this.href)">${cmHeheProduct.recommend eq 0 ? '设为':'取消'}推荐</a>
+					<a href="${ctx}/hehe/cmHeheProduct/delete?id=${cmHeheProduct.id}" onclick="return confirmx('确认要删除该商品吗?', this.href)">删除</a>
+				</td>
+			</tr>
+		</c:forEach>
+		</tbody>
+	</table>
+	<div class="pagination">${page}</div>
+
+<script>
+	//修改排序值
+	function changeSort(id, sortThis) {
+		var value = sortThis.value;
+		$("#preferredProductSort" + id).val(id + "-" + value);
+	}
+
+	//批量保存排序
+	function batchSaveSort() {
+		var items = new Array();
+		var $items = $('.check-item');
+		$items.each(function(){
+			items.push($(this).val());
+		});
+		//保存批量排序
+		$.post("${ctx}/hehe/cmHeheProduct/batchSaveSort?sortList="+items, function(data) {
+			if(true==data.success){
+				$.jBox.tip(data.msg, 'info');
+				window.location.href = "${ctx}/hehe/cmHeheProduct";
+			} else {
+				$.jBox.tip(data.msg,'error');
+			}
+		},"JSON");//这里返回的类型有:json,html,xml,text
+	}
+
+	/**
+	 * @param obj
+	 * jquery控制input只能输入数字
+	 */
+	function onlynum(obj) {
+		obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
+	}
+</script>
+</body>
+</html>

+ 80 - 0
src/main/webapp/WEB-INF/views/modules/hehe/cmHeheUserAllList.jsp

@@ -0,0 +1,80 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
+<html>
+<head>
+    <title>呵呵用户管理</title>
+    <meta name="decorator" content="default"/>
+    <style type="text/css">
+        .table th{text-align: center;}
+        .table td{text-align: center;}
+    </style>
+    <script type="text/javascript">
+        $(document).ready(function() {
+
+        });
+        function page(n,s){
+            $("#pageNo").val(n);
+            $("#pageSize").val(s);
+            $("#searchForm").submit();
+            return false;
+        }
+    </script>
+</head>
+<body>
+<ul class="nav nav-tabs">
+    <li class="active"><a href="${ctx}/hehe/cmHeheUser/userList">用户列表</a></li>
+</ul>
+<form:form id="searchForm" modelAttribute="cmHeheUser" action="${ctx}/hehe/cmHeheUser/userList" method="post" class="breadcrumb form-search">
+    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
+    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+    <div class="ul-form">
+        <label>微信昵称:</label>
+        <form:input path="nickName" htmlEscape="false" maxlength="32" class="input-medium"/>
+        <label>手机号:</label>
+        <form:input path="mobile" htmlEscape="false" maxlength="20" class="input-medium"/>
+        <label>身份:</label>
+        <form:select path="userIdentity" class="input-small">
+            <form:option value="" label="请选择"/>
+            <form:option value="1" label="普通用户"/>
+            <form:option value="2" label="分销者"/>
+        </form:select>
+        &nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
+        <div class="clearfix"></div>
+    </div>
+</form:form>
+<sys:message content="${message}"/>
+<table id="contentTable" class="table table-striped table-bordered table-condensed">
+    <thead>
+    <tr>
+        <th>微信昵称</th>
+        <th>手机号</th>
+        <th>身份</th>
+        <th>openID</th>
+        <th>注册时间</th>
+    </tr>
+    </thead>
+    <tbody>
+    <c:forEach items="${page.list}" var="cmHeheUser">
+        <tr>
+            <td>
+                    ${cmHeheUser.nickName}
+            </td>
+            <td>
+                    ${cmHeheUser.mobile}
+            </td>
+            <td>
+                    ${cmHeheUser.userIdentity eq 1 ? "普通用户" : "分销者"}
+            </td>
+            <td>
+                    ${cmHeheUser.openId}
+            </td>
+            <td>
+                <fmt:formatDate value="${cmHeheUser.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
+            </td>
+        </tr>
+    </c:forEach>
+    </tbody>
+</table>
+<div class="pagination">${page}</div>
+</body>
+</html>

+ 68 - 0
src/main/webapp/WEB-INF/views/modules/hehe/cmHeheUserForm.jsp

@@ -0,0 +1,68 @@
+<%@ 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() {
+			//$("#name").focus();
+			$("#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><a href="${ctx}/hehe/cmHeheUser/">分销者列表</a></li>
+		<li class="active"><a href="${ctx}/hehe/cmHeheUser/form?id=${cmHeheUser.id}">${not empty cmHeheUser.id?'编辑':'添加'}分销者</a></li>
+	</ul><br/>
+	<form:form id="inputForm" modelAttribute="cmHeheUser" action="${ctx}/hehe/cmHeheUser/save" method="post" class="form-horizontal">
+		<form:hidden path="id"/>
+		<sys:message content="${message}"/>		
+		<div class="control-group">
+			<label class="control-label"><font color="red">*</font>姓名:</label>
+			<div class="controls">
+				<form:input path="name" htmlEscape="false" placeholder="最多输入15个汉字" maxlength="15" class="input-xlarge required"/>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label"><font color="red">*</font>手机号:</label>
+			<div class="controls">
+				<form:input path="mobile" htmlEscape="false" maxlength="20" class="input-xlarge required"/>
+			</div>
+		</div>
+		<c:if test="${not empty cmHeheUser.openId}">
+			<div class="control-group">
+				<label class="control-label">微信昵称:</label>
+				<div class="controls">
+					${cmHeheUser.nickName}
+				</div>
+			</div>
+			<div class="control-group">
+				<label class="control-label">openID:</label>
+				<div class="controls">
+						${cmHeheUser.openId}
+				</div>
+			</div>
+		</c:if>
+		<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>

+ 80 - 0
src/main/webapp/WEB-INF/views/modules/hehe/cmHeheUserList.jsp

@@ -0,0 +1,80 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
+<html>
+<head>
+	<title>呵呵用户管理</title>
+	<meta name="decorator" content="default"/>
+	<style type="text/css">
+		.table th{text-align: center;}
+		.table td{text-align: center;}
+	</style>
+	<script type="text/javascript">
+		$(document).ready(function() {
+			
+		});
+		function page(n,s){
+			$("#pageNo").val(n);
+			$("#pageSize").val(s);
+			$("#searchForm").submit();
+        	return false;
+        }
+	</script>
+</head>
+<body>
+	<ul class="nav nav-tabs">
+		<li class="active"><a href="${ctx}/hehe/cmHeheUser/">分销者列表</a></li>
+	</ul>
+	<form:form id="searchForm" modelAttribute="cmHeheUser" action="${ctx}/hehe/cmHeheUser/" method="post" class="breadcrumb form-search">
+		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
+		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+		<div class="ul-form">
+			 <label>姓名:</label>
+				<form:input path="name" htmlEscape="false" maxlength="30" class="input-medium"/>
+			 <label>手机号:</label>
+				<form:input path="mobile" htmlEscape="false" maxlength="20" class="input-medium"/>
+			&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
+			&nbsp;&nbsp;<input class="btn btn-primary" style="width: 80px" onclick="window.location='${ctx}/hehe/cmHeheUser/form'" value="添加分销者"/>
+			<div class="clearfix"></div>
+		</div>
+	</form:form>
+	<sys:message content="${message}"/>
+	<table id="contentTable" class="table table-striped table-bordered table-condensed">
+		<thead>
+			<tr>
+				<th>姓名</th>
+				<th>手机号</th>
+				<th>微信昵称</th>
+				<th>openID</th>
+				<th>添加时间</th>
+				<th>操作</th>
+			</tr>
+		</thead>
+		<tbody>
+		<c:forEach items="${page.list}" var="cmHeheUser">
+			<tr>
+				<td>
+					${cmHeheUser.name}
+				</td>
+				<td>
+					${cmHeheUser.mobile}
+				</td>
+				<td>
+					${cmHeheUser.nickName}
+				</td>
+				<td>
+					${cmHeheUser.openId}
+				</td>
+				<td>
+					<fmt:formatDate value="${cmHeheUser.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
+				</td>
+				<td>
+    				<a href="${ctx}/hehe/cmHeheUser/form?id=${cmHeheUser.id}">编辑</a>
+					<a href="">活动列表</a>
+				</td>
+			</tr>
+		</c:forEach>
+		</tbody>
+	</table>
+	<div class="pagination">${page}</div>
+</body>
+</html>

+ 140 - 0
src/main/webapp/WEB-INF/views/modules/hehe/heheAddProduct.jsp

@@ -0,0 +1,140 @@
+<%@ 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 () {
+            $("#searchForm").validate({
+                submitHandler: function (form) {
+                    var isSubMitFlag = true;
+                    var productID = $("#productID").val();
+                    if (isNaN(productID) || productID.indexOf('0') == 0 ) {
+                        alertx("请输入正确的商品ID");
+                        isSubMitFlag = false;
+                        return false;
+                    }
+                    if (isSubMitFlag) {
+                        form.submit();
+                    }
+                }
+            })
+        });
+    </script>
+</head>
+<body>
+<form:form id="searchForm" modelAttribute="product" action="${ctx}/hehe/cmHeheProduct/findProductPage" 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="productIds"/>
+    <form:hidden path="promotionType"/>
+    <form:hidden path="ids"/>
+    <form:hidden path="delProductIds"/>
+    <div class="ul-form">
+        <label>商品ID:</label>
+        <form:input path="productID" id="productID" htmlEscape="false" maxlength="8" class="input-mini" onkeyup="onlynum(this)"/>
+        <label>商品名称:</label>
+        <form:input path="name" htmlEscape="false" class="input-medium" maxlength="20"/>
+        <label>供应商名称:</label>
+        <form:input path="shopName" htmlEscape="false" class="input-medium" maxlength="20"/>
+        &nbsp;&nbsp;  <input id="btnSubmit" class="btn btn-primary" type="submit" value="搜索"/>
+        <div class="clearfix"></div>
+    </div>
+</form:form>
+<sys:message content="${message}"/>
+<table class="table table-striped table-bordered table-condensed table-hover">
+    <tr>
+        <th style="width:20px;"></th>
+        <th>商品ID</th>
+        <th>商品图片</th>
+        <th>商品名称</th>
+        <th>供应商名称</th>
+    </tr>
+    <tbody>
+    <c:if test="${not empty page.list}">
+        <c:forEach items="${page.list}" var="item">
+            <tr id="${item.productID}" class="itemtr">
+                <th>
+                    <input class="check-item" type="radio" name="info" value='${item.productID}'/>
+                </th>
+                <td>${item.productID}</td>
+                <td><img class="mainImage" src="${item.mainImage}" width="50px" height="50px"></td>
+                <td class="name">${item.name}</td>
+                <td id="shopName">${item.shopName}</td>
+                <input type="hidden" value="${item.price1}" id="price">
+                <input type="hidden" value="${item.includedTax}" id="includedTax">
+                <input type="hidden" value="${item.invoiceType}" id="invoiceType">
+                <input type="hidden" value="${item.taxPoint}" id="clubTaxPoint">
+                <input type="hidden" value="${item.supplierTaxPoint}" id="shopTaxPoint">
+                <input type="hidden" value="${item.costCheckFlag}" id="costType">
+                <input type="hidden" value="${item.costPrice}" id="costPrice">
+                <input type="hidden" value="${item.costProportional}" id="costProportional">
+            </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>
+<script type="text/javascript">
+    $(document).ready(function () {
+        //弹出框去滚动条
+        top.$('#jbox-content').css("overflow-y", "hidden");
+        show_title(30);
+    });
+
+    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 () {
+            items.push({
+                productId: $(this).val(),
+                mainImage: $(this).parents(".itemtr").find(".mainImage").attr("src"),
+                name: $(this).parents(".itemtr").find(".name").text(),
+                shopName: $(this).parents(".itemtr").find("#shopName").text(),
+                price: $(this).parents(".itemtr").find("#price").val(),
+                includedTax: $(this).parents(".itemtr").find("#includedTax").val(),
+                invoiceType: $(this).parents(".itemtr").find("#invoiceType").val(),
+                clubTaxPoint: $(this).parents(".itemtr").find("#clubTaxPoint").val(),
+                shopTaxPoint: $(this).parents(".itemtr").find("#shopTaxPoint").val(),
+                costType: $(this).parents(".itemtr").find("#costType").val(),
+                costPrice: $(this).parents(".itemtr").find("#costPrice").val(),
+                costProportional: $(this).parents(".itemtr").find("#costProportional").val()
+            })
+        });
+        return items;
+    }
+
+    function clickAllSelect(ckb) {
+        var isChecked = ckb.checked;
+        $(".check-item").attr('checked', isChecked);
+    }
+
+    /**
+     * @param obj
+     * jquery控制input只能输入数字
+     */
+    function onlynum(obj) {
+        obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
+    }
+</script>
+</body>
+</html>
+