PLF 5 år sedan
förälder
incheckning
ad8ce3e20a
34 ändrade filer med 5578 tillägg och 1 borttagningar
  1. 7 0
      pom.xml
  2. 170 0
      src/main/java/com/caimei/modules/club/controller/CmOperationUserController.java
  3. 205 0
      src/main/java/com/caimei/modules/club/controller/CmUserOrganizeController.java
  4. 21 0
      src/main/java/com/caimei/modules/club/dao/CmOperationUserDao.java
  5. 18 0
      src/main/java/com/caimei/modules/club/dao/CmUserDao.java
  6. 19 0
      src/main/java/com/caimei/modules/club/dao/CmUserOrganizeDao.java
  7. 16 0
      src/main/java/com/caimei/modules/club/dao/NewCmClubDao.java
  8. 47 0
      src/main/java/com/caimei/modules/club/entity/City.java
  9. 201 0
      src/main/java/com/caimei/modules/club/entity/CmOperationUser.java
  10. 811 0
      src/main/java/com/caimei/modules/club/entity/CmUser.java
  11. 109 0
      src/main/java/com/caimei/modules/club/entity/CmUserOrganize.java
  12. 893 0
      src/main/java/com/caimei/modules/club/entity/NewCmClub.java
  13. 154 0
      src/main/java/com/caimei/modules/club/entity/Page.java
  14. 38 0
      src/main/java/com/caimei/modules/club/entity/Province.java
  15. 65 0
      src/main/java/com/caimei/modules/club/entity/Town.java
  16. 17 0
      src/main/java/com/caimei/modules/club/service/CmOperationUserService.java
  17. 15 0
      src/main/java/com/caimei/modules/club/service/CmUserOrganizeService.java
  18. 15 0
      src/main/java/com/caimei/modules/club/service/CmUserService.java
  19. 12 0
      src/main/java/com/caimei/modules/club/service/NewCmClubService.java
  20. 71 0
      src/main/java/com/caimei/modules/club/service/impl/CmOperationUserServiceImpl.java
  21. 39 0
      src/main/java/com/caimei/modules/club/service/impl/CmUserOrganizeServiceImpl.java
  22. 35 0
      src/main/java/com/caimei/modules/club/service/impl/CmUserServiceImpl.java
  23. 36 0
      src/main/java/com/caimei/modules/club/service/impl/NewCmClubServiceImpl.java
  24. 9 0
      src/main/java/com/caimei/modules/shiro/entity/CmMallAdminUser.java
  25. 0 1
      src/main/java/com/caimei/modules/shiro/service/impl/ShiroServiceImpl.java
  26. 441 0
      src/main/java/com/caimei/utils/AppKeys.java
  27. 99 0
      src/main/java/com/caimei/utils/DateTimeUtil.java
  28. 754 0
      src/main/java/com/caimei/utils/DateUtils.java
  29. 100 0
      src/main/java/com/caimei/utils/RandomCodeGenerator.java
  30. 21 0
      src/main/java/com/caimei/utils/SMSUtils.java
  31. 179 0
      src/main/resources/mapper/CmOperationUserMapper.xml
  32. 421 0
      src/main/resources/mapper/CmUserMapper.xml
  33. 66 0
      src/main/resources/mapper/CmUserOrganizeMapper
  34. 474 0
      src/main/resources/mapper/NewCmClubMapper.xml

+ 7 - 0
pom.xml

@@ -103,6 +103,13 @@
             <version>2.3</version>
         </dependency>
 
+        <!--短信-->
+        <dependency>
+            <groupId>caimei</groupId>
+            <artifactId>smsClient</artifactId>
+            <version>1.0</version>
+        </dependency>
+
     </dependencies>
 
     <profiles>

+ 170 - 0
src/main/java/com/caimei/modules/club/controller/CmOperationUserController.java

@@ -0,0 +1,170 @@
+package com.caimei.modules.club.controller;
+
+import com.caimei.modules.club.entity.CmOperationUser;
+import com.caimei.modules.club.entity.NewCmClub;
+import com.caimei.modules.club.entity.Page;
+import com.caimei.modules.club.service.CmOperationUserService;
+import com.caimei.modules.club.service.NewCmClubService;
+import com.caimei.utils.JsonModel;
+import com.caimei.utils.RandomCodeGenerator;
+import com.caimei.utils.SMSUtils;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.util.StringUtil;
+import org.apache.commons.collections.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+import org.thymeleaf.util.StringUtils;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Date;
+import java.util.List;
+import java.util.Random;
+
+/**
+ * 商城运营人员Controller
+ *
+ * @author lijun
+ * @version 2019-11-22
+ */
+@Controller
+@RequestMapping(value = "/user/cmOperationUser")
+public class CmOperationUserController {
+    @Autowired
+    private CmOperationUserService cmOperationUserService;
+    @Autowired
+    private NewCmClubService newCmClubService;
+
+    /**
+     * 查看运营人员
+     */
+    @ResponseBody
+    @RequestMapping("/list")
+    public JsonModel list(CmOperationUser cmOperationUser, Page page) {
+        PageHelper.startPage(page.getIndex(), page.getPageSize());
+        List<CmOperationUser> operationUserList = cmOperationUserService.findList(cmOperationUser);
+        Page<CmOperationUser> userPage = new Page<>(operationUserList);
+        return JsonModel.newInstance().success(userPage);
+    }
+
+    /**
+     * 添加运营人员
+     *
+     * @param cmOperationUser
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "save", method = RequestMethod.POST)
+    public JsonModel save(CmOperationUser cmOperationUser, Model model, RedirectAttributes redirectAttributes) {
+        JsonModel jsonModel = JsonModel.newInstance();
+        //判断该运营人手机号是否已存在
+        List<CmOperationUser> listBuyBindMobile1 = cmOperationUserService.findListBuyBindMobile(cmOperationUser);
+        if (CollectionUtils.isNotEmpty(listBuyBindMobile1) && listBuyBindMobile1.size() > 0) {
+            return jsonModel.error("该手机号码已被使用");
+        }
+        Date date = new Date();
+        String configFlag = cmOperationUser.getConfigFlag();
+        if (StringUtil.isNotEmpty(configFlag) && configFlag.length() != 2) {//保存生成邀请码
+            //生成随机码6位
+            Integer flag = getInvitationCode();
+            cmOperationUser.setInvitationCode(String.valueOf(flag));
+            cmOperationUser.setInvitationCodeTime(date);
+            cmOperationUser.setStatus("1");
+            //发送短信
+            String clubID = cmOperationUser.getClubID();
+            NewCmClub newCmClub = newCmClubService.findClubById(Integer.parseInt(clubID));
+            String clubName = "";
+            if (null != newCmClub) {
+                clubName = newCmClub.getName();
+            }
+            String mobile = cmOperationUser.getMobile();
+            if (StringUtil.isNotEmpty(mobile)) {
+                SMSUtils.sendSms(mobile, "欢迎加入" + clubName + ",您的邀请码为:" + flag + ",您可在微信搜索“星范采购商城”小程序,输入邀请码进行登录。");
+            }
+        }
+        if (cmOperationUser.getId() == null) {//新增
+            cmOperationUser.setAccount(cmOperationUser.getMobile() + RandomCodeGenerator.generateAccount(2));
+            cmOperationUser.setStatus("1");
+        }
+        cmOperationUser.setUpdateTime(date);
+        cmOperationUser.setDelFlag("0");
+        cmOperationUser.setAddTime(date);
+        cmOperationUserService.save(cmOperationUser);
+        return jsonModel.success();
+    }
+
+    /**
+     * 验证获取不重复的邀请码
+     *
+     * @return
+     */
+    public Integer getInvitationCode() {
+        int flag = new Random().nextInt(999999);
+        if (flag < 100000) {
+            flag += 100000;
+        }
+        //判断生成随机码是否和数据库有重复
+        CmOperationUser opUser = new CmOperationUser();
+        opUser.setInvitationCode(String.valueOf(flag));
+        List<CmOperationUser> listByInvitationCode = cmOperationUserService.getListByInvitationCode(opUser);
+        if (CollectionUtils.isNotEmpty(listByInvitationCode) && listByInvitationCode.size() > 0) {//存在邀请码重新获取
+            getInvitationCode();
+        }
+        return flag;
+    }
+
+    /**
+     * 更新邀请码
+     *
+     * @param cmOperationUser
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "updateInvitationCode")
+    public JsonModel updateInvitationCode(CmOperationUser cmOperationUser) {
+        if (!StringUtils.equals("2", cmOperationUser.getStatus())) {//如果已绑定则不更新
+            //生成随机码6位
+            int flag = getInvitationCode();
+            cmOperationUser.setInvitationCode(String.valueOf(flag));
+            cmOperationUser.setInvitationCodeTime(new Date());
+            cmOperationUser.setStatus("1");
+            //发送短信
+            String clubID = cmOperationUser.getClubID();
+            NewCmClub newCmClub = newCmClubService.findClubById(Integer.parseInt(clubID));
+            String clubName = "";
+            if (null != newCmClub) {
+                clubName = newCmClub.getName();
+            }
+            String mobile = cmOperationUser.getMobile();
+            if (StringUtil.isNotEmpty(mobile)) {
+                SMSUtils.sendSms(mobile, "欢迎加入" + clubName + ",您的邀请码为:" + flag + ",您可在微信搜索“星范采购商城”小程序,输入邀请码进行登录。");
+            }
+            cmOperationUserService.save(cmOperationUser);
+        }
+        return JsonModel.newInstance().success();
+    }
+
+    /**
+     * 解绑
+     *
+     * @param cmOperationUser
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "untiedOperationUser")
+    public JsonModel untiedOperationUser(CmOperationUser cmOperationUser) {
+        cmOperationUser.setOpenid("");
+        cmOperationUser.setNickName("");
+        cmOperationUser.setBindTime(null);
+        cmOperationUser.setUpdateTime(new Date());
+        cmOperationUser.setStatus("1");
+        cmOperationUser.setDelFlag("1");
+        cmOperationUserService.untiedOperationUser(cmOperationUser);
+        return JsonModel.newInstance().success();
+    }
+}

+ 205 - 0
src/main/java/com/caimei/modules/club/controller/CmUserOrganizeController.java

@@ -0,0 +1,205 @@
+package com.caimei.modules.club.controller;
+
+import com.caimei.modules.club.entity.*;
+import com.caimei.modules.club.service.CmUserOrganizeService;
+import com.caimei.modules.club.service.CmUserService;
+import com.caimei.modules.club.service.NewCmClubService;
+import com.caimei.utils.*;
+import com.github.pagehelper.PageHelper;
+import org.apache.commons.collections.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 组织管理
+ */
+@Controller
+@RequestMapping(value = "/user/cmUserOrganize")
+public class CmUserOrganizeController {
+    @Autowired
+    private CmUserOrganizeService cmUserOrganizeService;
+    @Autowired
+    private CmUserService cmUserService;
+    @Autowired
+    private NewCmClubService newCmClubService;
+
+    /**
+     * 组织列表
+     */
+    @ResponseBody
+    @RequestMapping(value = "/clubList")
+    public JsonModel toCmOrganizeClubList(CmUser cmUser, Page page) {
+        PageHelper.startPage(page.getIndex(), page.getPageSize());
+        List<CmUser> cmUserList = cmUserService.findListBuyUserInfo(cmUser);
+        Page<CmUser> cmUserPage = new Page<>(cmUserList);
+        return JsonModel.newInstance().success(cmUserPage);
+    }
+
+    /**
+     * 上线会所(添加,编辑)
+     *
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/toAddClubUser")
+    public JsonModel toAddClubUser(CmUserOrganize cmUserOrganize, NewCmClub newCmClub) {
+        if (null != newCmClub.getClubID()) {
+            newCmClub = newCmClubService.findClubById(newCmClub.getClubID());
+        }
+        Integer provinceID = newCmClub.getProvinceID();
+        Integer townID = newCmClub.getTownID();
+        Integer cityID = newCmClub.getCityID();
+        //控制编辑异常时候的会显地址下拉框
+        if (null != provinceID && provinceID > 0) {
+            Province province = cmUserOrganizeService.loadProvinceById(provinceID);
+            newCmClub.setProvince(province.getName());
+        }
+        if (null != cityID && cityID > 0) {
+            City city = cmUserOrganizeService.loadCityById(cityID);
+            newCmClub.setCity(city.getName());
+        }
+        if (null != townID && townID > 0) {
+            Town town = cmUserOrganizeService.loadTownByID(townID);
+            newCmClub.setTown(town.getName());
+        }
+        return JsonModel.newInstance().success(newCmClub);
+    }
+
+    /**
+     * 保存上线会所信息(添加,编辑)
+     *
+     * @param cmUserOrganize
+     * @param model
+     * @return
+     */
+    @RequestMapping(value = "saveAddClubUser")
+    @Transactional
+    public JsonModel saveAddClubUser(CmUserOrganize cmUserOrganize, Page page, NewCmClub newCmClub, CmUser cmUser, Model model) throws Exception {
+        JsonModel jsonModel = JsonModel.newInstance();
+        String contractMobile = newCmClub.getContractMobile();
+        Integer userID = newCmClub.getUserID();
+        Integer clubID = newCmClub.getClubID();
+        cmUser.setUserOrganizeID(cmUserOrganize.getId());
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String currentDate = sdf.format(new Date());
+        //判断该会所手机号是否已存在
+        cmUser.setBindMobile(contractMobile);
+        List<CmUser> listBuyBindMobile = cmUserService.findListBuyBindMobile(cmUser);
+        if (CollectionUtils.isNotEmpty(listBuyBindMobile) && listBuyBindMobile.size() > 0) {
+            return jsonModel.error("-1", model, "该手机号码已被使用");
+        }
+        //添加用户信息(新增或修改通用)
+        cmUser.setName(newCmClub.getName());
+        cmUser.setUserName(newCmClub.getName());
+        cmUser.setRealName(newCmClub.getName());
+        cmUser.setClubStatus(String.valueOf(newCmClub.getStatus()));
+        //添加用户新增信息
+        if (null == userID) {//新增
+            cmUser = initUser(cmUser, newCmClub);
+            cmUserService.insert(cmUser);//插入新的用户数据
+        }
+
+        //修改图片全路径
+        /*ImageUploadInfo saveImageSerivce = new ImageUploadInfo();
+        String photoServer = Global.getConfig("photoServer");
+        String businessLicenseImage = newCmClub.getBusinessLicenseImage();
+        String headpic = newCmClub.getHeadpic();
+        if (StringUtils.isNotBlank(businessLicenseImage) && !businessLicenseImage.startsWith("http:") && !businessLicenseImage.startsWith("https:")) {
+            businessLicenseImage = Encodes.urlDecode(businessLicenseImage);
+            String realPath = UploadImageUtils.getAbsolutePath(businessLicenseImage);
+            int pointerIndex = realPath.lastIndexOf(".");
+            try {
+                saveImageSerivce = UploadUtils.saveImageSerivce(realPath, pointerIndex, realPath);
+                newCmClub.setBusinessLicenseImage(photoServer + saveImageSerivce.getSource());
+            } catch (Exception e) {
+                logger.error("图片上传错误:" + e.toString(), e);
+            }
+        }
+        if (StringUtils.isNotBlank(headpic) && !headpic.startsWith("http:") && !headpic.startsWith("https:")) {
+            headpic = Encodes.urlDecode(headpic);
+            String realPath = UploadImageUtils.getAbsolutePath(headpic);
+            int pointerIndex = realPath.lastIndexOf(".");
+            try {
+                saveImageSerivce = UploadUtils.saveImageSerivce(realPath, pointerIndex, realPath);
+                newCmClub.setHeadpic(photoServer + saveImageSerivce.getSource());
+            } catch (Exception e) {
+                logger.error("图片上传错误:" + e.toString(), e);
+            }
+        }*/
+        //添加会所表信息
+        newCmClub.setSname(newCmClub.getName());
+        if (null == clubID) {
+            newCmClub.setUserID(cmUser.getUserID());
+            newCmClub.setDefaultServiceProviderID(AppKeys.DEFAULT_SPID);
+            newCmClub.setSpID(AppKeys.DEFAULT_SPID);
+            newCmClub.setMainServiceProviderID(AppKeys.DEFAULT_SPID);
+            newCmClub.setScanFlag("2");
+            newCmClub.setFlag("0");
+            newCmClub.setAddTime(currentDate);
+            newCmClub.setLinkMan1(newCmClub.getLinkMan());
+            newCmClub.setContractMobile1(newCmClub.getContractMobile());
+            newCmClub.setPayFlag1(AppKeys.FLAG_NO);
+            newCmClub.setLevel(0d);
+            newCmClub.setSubClubCount(0);
+            newCmClub.setFavoriteTimes(0);
+            newCmClub.setClubTypeID(1);
+            newCmClub.setDefaultServiceProviderUpdTime(DateTimeUtil.getCurrentDateTime());
+            newCmClubService.insert(newCmClub);
+
+            //更新用户绑定关系
+            cmUser.setClubID(String.valueOf(newCmClub.getClubID()));
+            String nick = cmUser.getUserID() + "_" + RandomCodeGenerator.generateCodeString(4).toLowerCase();
+            cmUser.setNick(nick);
+            cmUser.setCompanyUserID(cmUser.getUserID());
+
+            //更新会所绑定关系
+            newCmClub.setUserID(cmUser.getUserID());
+        }
+        cmUserService.update(cmUser);//更新用户表数据(编辑数据,或新增数据更新)
+        newCmClubService.update(newCmClub);//更新会所表数据(编辑数据,或新增数据更新)
+        return jsonModel.success("保存成功");
+    }
+
+
+    /**
+     * 初始化用户数据
+     */
+    public CmUser initUser(CmUser cmUser, NewCmClub newCmClub) throws Exception {
+        String curTime = DateUtils.getDateTime();
+        cmUser.setRegisterUserTypeID("3");//设置为会所
+        cmUser.setUserIdentity(2);
+        cmUser.setServiceProviderStatus("90");//设置默认协销状态
+        cmUser.setServiceProviderID("1342");
+        cmUser.setAuditTime(curTime);
+        cmUser.setAuditStatus("1");//审核通过
+        cmUser.setAuditNote("后台添加用户系统默认审核通过");
+        cmUser.setRegisterTime(curTime);
+        cmUser.setLoginTime(curTime);
+        cmUser.setAccount(newCmClub.getContractMobile() + RandomCodeGenerator.generateAccount(2));
+        cmUser.setPassword(MD5Util.MD5("caimei123"));
+        cmUser.setBindMobile(newCmClub.getContractMobile());
+        cmUser.setUserName(newCmClub.getName());
+        cmUser.setEmailCheckFlag("0");
+        cmUser.setMobileCheckFlag("0");
+        cmUser.setUserMoney(0d);
+        cmUser.setAbleUserMoney(0d);
+        cmUser.setPoint("0");
+        cmUser.setShopERPFlag("0");
+        cmUser.setUserBeans("0");
+        cmUser.setValidFlag("1");
+        cmUser.setAgreeFlag("1");
+        cmUser.setLoginFailTime("0");
+        cmUser.setUserLevelID("1");
+        cmUser.setScanFlag("2");
+        cmUser.setUserPermission(2);
+        return cmUser;
+    }
+}

+ 21 - 0
src/main/java/com/caimei/modules/club/dao/CmOperationUserDao.java

@@ -0,0 +1,21 @@
+package com.caimei.modules.club.dao;
+
+import com.caimei.modules.club.entity.CmOperationUser;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Mapper
+public interface CmOperationUserDao {
+    List<CmOperationUser> findList(CmOperationUser cmOperationUser);
+
+    List<CmOperationUser> findListBuyBindMobile(CmOperationUser cmOperationUser);
+
+    List<CmOperationUser> getListByInvitationCode(CmOperationUser opUser);
+
+    void insert(CmOperationUser cmOperationUser);
+
+    void update(CmOperationUser cmOperationUser);
+
+    void untiedOperationUser(CmOperationUser cmOperationUser);
+}

+ 18 - 0
src/main/java/com/caimei/modules/club/dao/CmUserDao.java

@@ -0,0 +1,18 @@
+package com.caimei.modules.club.dao;
+
+import com.caimei.modules.club.entity.CmUser;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Mapper
+public interface CmUserDao {
+
+    List<CmUser> findListBuyUserInfo(CmUser cmUser);
+
+    List<CmUser> findListBuyBindMobile(CmUser cmUser);
+
+    void insert(CmUser cmUser);
+
+    void update(CmUser cmUser);
+}

+ 19 - 0
src/main/java/com/caimei/modules/club/dao/CmUserOrganizeDao.java

@@ -0,0 +1,19 @@
+package com.caimei.modules.club.dao;
+
+import com.caimei.modules.club.entity.*;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+
+@Mapper
+public interface CmUserOrganizeDao {
+
+    List<CmUserOrganize> findList(CmUserOrganize cmUserOrganize);
+
+    Province loadProvinceById(Integer provinceID);
+
+    City loadCityById(Integer cityID);
+
+    Town loadTownByID(Integer townID);
+}

+ 16 - 0
src/main/java/com/caimei/modules/club/dao/NewCmClubDao.java

@@ -0,0 +1,16 @@
+package com.caimei.modules.club.dao;
+
+import com.caimei.modules.club.entity.NewCmClub;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Mapper
+public interface NewCmClubDao {
+
+    List<NewCmClub> findClubById(Integer clubID);
+
+    void insert(NewCmClub newCmClub);
+
+    void update(NewCmClub newCmClub);
+}

+ 47 - 0
src/main/java/com/caimei/modules/club/entity/City.java

@@ -0,0 +1,47 @@
+package com.caimei.modules.club.entity;
+
+public class City implements java.io.Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	private Integer id;
+	private Integer provinceId;
+	private String name;
+	private String validFlag;
+
+	public static long getSerialVersionUID() {
+		return serialVersionUID;
+	}
+
+	public Integer getId() {
+		return id;
+	}
+
+	public void setId(Integer id) {
+		this.id = id;
+	}
+
+	public Integer getProvinceId() {
+		return provinceId;
+	}
+
+	public void setProvinceId(Integer provinceId) {
+		this.provinceId = provinceId;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getValidFlag() {
+		return validFlag;
+	}
+
+	public void setValidFlag(String validFlag) {
+		this.validFlag = validFlag;
+	}
+}

+ 201 - 0
src/main/java/com/caimei/modules/club/entity/CmOperationUser.java

@@ -0,0 +1,201 @@
+package com.caimei.modules.club.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 商城运营人员Entity
+ *
+ * @author lijun
+ * @version 2019-11-22
+ */
+public class CmOperationUser implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+    private Integer id;
+    private String userOrganizeID;        // 用户组织ID,具体对应cm_mall_organize表ID
+    private String userID;        // 用户ID:隶属于哪个用户的运营人员
+    private String clubID;        // 会所ID:隶属于哪个会所的运营人员
+    private String account;        // 运营人账号名【产品预留字段暂时不启用】
+    private String mobile;        // 手机号码
+    private String linkName;        // 联系人
+    private String invitationCode;        // 邀请码
+    private String status;        // 1未绑定,2已绑定
+    private String nickName;        // 微信昵称
+    private String openid;        // 小程序openid
+    private Date invitationCodeTime;        // 邀请码生成时间(此时间起48小时有效)
+    private Date bindTime;        // 绑定时间
+    private Date updateTime;        // 更新时间
+    private Date addTime;        // 添加时间
+    private Date beginAddTime;        // 开始 添加时间
+    private Date endAddTime;        // 结束 添加时间
+    private String effectiveFlag;//邀请码是否有效 1有效,2已使用,3已失效
+    private String configFlag;//确认标志
+    private String delFlag; //0 有效 其它无效
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getUserOrganizeID() {
+        return userOrganizeID;
+    }
+
+    public void setUserOrganizeID(String userOrganizeID) {
+        this.userOrganizeID = userOrganizeID;
+    }
+
+    public String getUserID() {
+        return userID;
+    }
+
+    public void setUserID(String userID) {
+        this.userID = userID;
+    }
+
+    public String getClubID() {
+        return clubID;
+    }
+
+    public void setClubID(String clubID) {
+        this.clubID = clubID;
+    }
+
+    public String getAccount() {
+        return account;
+    }
+
+    public void setAccount(String account) {
+        this.account = account;
+    }
+
+    public String getMobile() {
+        return mobile;
+    }
+
+    public void setMobile(String mobile) {
+        this.mobile = mobile;
+    }
+
+    public String getLinkName() {
+        return linkName;
+    }
+
+    public void setLinkName(String linkName) {
+        this.linkName = linkName;
+    }
+
+    public String getInvitationCode() {
+        return invitationCode;
+    }
+
+    public void setInvitationCode(String invitationCode) {
+        this.invitationCode = invitationCode;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getNickName() {
+        return nickName;
+    }
+
+    public void setNickName(String nickName) {
+        this.nickName = nickName;
+    }
+
+    public String getOpenid() {
+        return openid;
+    }
+
+    public void setOpenid(String openid) {
+        this.openid = openid;
+    }
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    public Date getInvitationCodeTime() {
+        return invitationCodeTime;
+    }
+
+    public void setInvitationCodeTime(Date invitationCodeTime) {
+        this.invitationCodeTime = invitationCodeTime;
+    }
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    public Date getBindTime() {
+        return bindTime;
+    }
+
+    public void setBindTime(Date bindTime) {
+        this.bindTime = bindTime;
+    }
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    public Date getAddTime() {
+        return addTime;
+    }
+
+    public void setAddTime(Date addTime) {
+        this.addTime = addTime;
+    }
+
+    public Date getBeginAddTime() {
+        return beginAddTime;
+    }
+
+    public void setBeginAddTime(Date beginAddTime) {
+        this.beginAddTime = beginAddTime;
+    }
+
+    public Date getEndAddTime() {
+        return endAddTime;
+    }
+
+    public void setEndAddTime(Date endAddTime) {
+        this.endAddTime = endAddTime;
+    }
+
+    public String getEffectiveFlag() {
+        return effectiveFlag;
+    }
+
+    public void setEffectiveFlag(String effectiveFlag) {
+        this.effectiveFlag = effectiveFlag;
+    }
+
+    public String getConfigFlag() {
+        return configFlag;
+    }
+
+    public void setConfigFlag(String configFlag) {
+        this.configFlag = configFlag;
+    }
+
+    public String getDelFlag() {
+        return delFlag;
+    }
+
+    public void setDelFlag(String delFlag) {
+        this.delFlag = delFlag;
+    }
+}

+ 811 - 0
src/main/java/com/caimei/modules/club/entity/CmUser.java

@@ -0,0 +1,811 @@
+package com.caimei.modules.club.entity;
+
+import org.hibernate.validator.constraints.Length;
+
+import javax.validation.constraints.NotNull;
+import java.beans.Transient;
+import java.io.Serializable;
+
+/**
+ * 用户Entity
+ *
+ * @author ZCP
+ * @version 2017-10-10
+ */
+public class CmUser implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+    private Integer id;
+    private Integer userID;        // userID
+    private Integer userOrganizeID;//用户组织ID
+    private String mobile;        // 手机号码
+    private Integer userPermission;        // 用户权限
+    private String email;        // 邮箱
+    private String userName;        // 用户名
+    private String image;        // image
+    private String password;        // 密码
+    private String userLevelID;        // 用户会员等级,见表c_userlevel或枚举UserLevel
+    private String name;        // 组织名称
+    private String nick;        // 昵称
+    private String sex;        // 性别
+    private String registerUserTypeID;        // 用户类型,见表c_usertype或枚举UserType
+    private String manufacturerFlag;        // 已废弃 是否是供应商,1是 空或0否
+    private String manufacturerStatus;        // 供应商状态,见表c_shopstatus或枚举ShopStatus
+    private String shopID;        // 供应商Id
+    private String serviceProviderFlag;        // 已废弃  是否创客,1是 空或0否
+    private String clubFlag;        //已废弃  是否会所,1是 空或0否
+    private String masterFlag;        //已废弃  masterFlag
+    private String normalFlag;        //已废弃  normalFlag
+    private String auditStatus;        // auditStatus
+    private String auditTime;        // auditTime
+    private String auditNote;        // auditNote
+    private String registerTime;        // 注册时间
+    private String registerIP;        // 注册ip
+    private String loginTime;        // 登录时间
+    private String loginFailTime;        // 登录失败次数
+    private String loginIP;        // 登录ip
+    private String validFlag;        // 用户状态,1正常,0冻结
+    private String emailCheckFlag;        // emailCheckFlag
+    private String mobileCheckFlag;        // mobileCheckFlag
+    private String clubStatus;        // 会所状态,见表c_clubstatus或枚举ClubStatus
+    private String clubID;        // 会所Id
+    private String agreeFlag;        // agreeFlag
+    private String activationCode;        // activationCode
+    private String activationDate;        // activationDate
+    private String serviceProviderStatus;        // 创客状态
+    private String serviceProviderID;        // 创客Id
+    private String masterStatus;        // masterStatus
+    private String masterID;        // masterID
+    private Double userMoney;        // 账户余额
+    private Double ableUserMoney;        //账户可用余额
+    private String point;        // point
+    private String shopERPFlag;        // shopERPFlag
+    private String fromUserID;        // 邀请人Id
+    private String fromUserName;        // 邀请人名称
+    private String logoffTime;        // logoffTime
+    private String appKey;        // appKey
+    private String appSecret;        // appSecret
+    private String sampleFlag;        // sampleFlag
+    private String scanFlag;        // 扫描标志(4 CRM拉上来的会所)
+    private String sysroleid;        // sysroleid
+    private String gender;        // gender
+    private String age;        // 年龄
+    private String salerbuyer;        // salerbuyer
+    private String position;        // position
+    private String skill;        // skill
+    private String workage;        // workage
+    private String wechat;        // 微信号
+    private String qq;        // QQ号
+    private String smsFlag;        // 短信是否发送成功
+    private String userBeans;        // 采美豆数量
+    private String privateShopFlag;        // 平台商标志位  0非平台商 1平台商
+    private String privateClubFlag;        // 平台会所标志位  0非平台会所 1平台会所
+    private String isMeiDaoAuthorized;        // isMeiDaoAuthorized
+    private String guideFlag;        // 引导层弹出  0需要弹出  1不需要弹出
+    private String nickName;        // 微信昵称
+    private String startTime;     //注册时间开始 查询条件
+    private String endTime;        //注册时间结束  查询条件
+
+
+    /**
+     * 用户模块重构
+     */
+    private String account;//账号名: 企业账号登录使用
+    private Integer userIdentity;//用户身份
+    private String realName;//真实姓名
+    private Integer companyUserID;//企业用户id
+    private String openID;//微信openID
+    private String bindMobile;//企业绑定手机号
+    private String tipStatus;//弹窗提示状态
+    private String identityDisplay; //前台身份展示
+    private String linkMan;//联系人
+
+    //会所用户信息
+    private String town; // 区
+    private String city; // 市
+    private String province; //省
+    private String address;        // 详细地址
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    @NotNull(message = "userID不能为空")
+    public Integer getUserID() {
+        return userID;
+    }
+
+    public void setUserID(Integer userID) {
+        this.userID = userID;
+    }
+
+    public String getMobile() {
+        return mobile;
+    }
+
+    public void setMobile(String mobile) {
+        this.mobile = mobile;
+    }
+
+    public Integer getUserPermission() {
+        return userPermission;
+    }
+
+    public void setUserPermission(Integer userPermission) {
+        this.userPermission = userPermission;
+    }
+
+    public String getEmail() {
+        return email;
+    }
+
+    public void setEmail(String email) {
+        this.email = email;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getImage() {
+        return image;
+    }
+
+    public void setImage(String image) {
+        this.image = image;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public String getUserLevelID() {
+        return userLevelID;
+    }
+
+    public void setUserLevelID(String userLevelID) {
+        this.userLevelID = userLevelID;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getNick() {
+        return nick;
+    }
+
+    public void setNick(String nick) {
+        this.nick = nick;
+    }
+
+    public String getSex() {
+        return sex;
+    }
+
+    public void setSex(String sex) {
+        this.sex = sex;
+    }
+
+    public String getRegisterUserTypeID() {
+        return registerUserTypeID;
+    }
+
+    public void setRegisterUserTypeID(String registerUserTypeID) {
+        this.registerUserTypeID = registerUserTypeID;
+    }
+
+    @Length(min = 0, max = 1, message = "是否是供应商,1是 空或0否长度必须介于 0 和 1 之间")
+    public String getManufacturerFlag() {
+        return manufacturerFlag;
+    }
+
+    public void setManufacturerFlag(String manufacturerFlag) {
+        this.manufacturerFlag = manufacturerFlag;
+    }
+
+    @Length(min = 0, max = 11, message = "供应商状态,见表c_shopstatus或枚举ShopStatus长度必须介于 0 和 11 之间")
+    public String getManufacturerStatus() {
+        return manufacturerStatus;
+    }
+
+    public void setManufacturerStatus(String manufacturerStatus) {
+        this.manufacturerStatus = manufacturerStatus;
+    }
+
+    @Length(min = 0, max = 11, message = "供应商Id长度必须介于 0 和 11 之间")
+    public String getShopID() {
+        return shopID;
+    }
+
+    public void setShopID(String shopID) {
+        this.shopID = shopID;
+    }
+
+    @Length(min = 0, max = 1, message = "是否创客,1是 空或0否长度必须介于 0 和 1 之间")
+    public String getServiceProviderFlag() {
+        return serviceProviderFlag;
+    }
+
+    public void setServiceProviderFlag(String serviceProviderFlag) {
+        this.serviceProviderFlag = serviceProviderFlag;
+    }
+
+    @Length(min = 0, max = 1, message = "是否会所,1是 空或0否长度必须介于 0 和 1 之间")
+    public String getClubFlag() {
+        return clubFlag;
+    }
+
+    public void setClubFlag(String clubFlag) {
+        this.clubFlag = clubFlag;
+    }
+
+    @Length(min = 0, max = 1, message = "masterFlag长度必须介于 0 和 1 之间")
+    public String getMasterFlag() {
+        return masterFlag;
+    }
+
+    public void setMasterFlag(String masterFlag) {
+        this.masterFlag = masterFlag;
+    }
+
+    @Length(min = 0, max = 1, message = "normalFlag长度必须介于 0 和 1 之间")
+    public String getNormalFlag() {
+        return normalFlag;
+    }
+
+    public void setNormalFlag(String normalFlag) {
+        this.normalFlag = normalFlag;
+    }
+
+    @Length(min = 0, max = 1, message = "auditStatus长度必须介于 0 和 1 之间")
+    public String getAuditStatus() {
+        return auditStatus;
+    }
+
+    public void setAuditStatus(String auditStatus) {
+        this.auditStatus = auditStatus;
+    }
+
+    @Length(min = 0, max = 19, message = "auditTime长度必须介于 0 和 19 之间")
+    public String getAuditTime() {
+        return auditTime;
+    }
+
+    public void setAuditTime(String auditTime) {
+        this.auditTime = auditTime;
+    }
+
+    @Length(min = 0, max = 100, message = "auditNote长度必须介于 0 和 100 之间")
+    public String getAuditNote() {
+        return auditNote;
+    }
+
+    public void setAuditNote(String auditNote) {
+        this.auditNote = auditNote;
+    }
+
+    public String getRegisterTime() {
+        return registerTime;
+    }
+
+    public void setRegisterTime(String registerTime) {
+        this.registerTime = registerTime;
+    }
+
+    public String getRegisterIP() {
+        return registerIP;
+    }
+
+    public void setRegisterIP(String registerIP) {
+        this.registerIP = registerIP;
+    }
+
+    public String getLoginTime() {
+        return loginTime;
+    }
+
+    public void setLoginTime(String loginTime) {
+        this.loginTime = loginTime;
+    }
+
+    public String getLoginFailTime() {
+        return loginFailTime;
+    }
+
+    public void setLoginFailTime(String loginFailTime) {
+        this.loginFailTime = loginFailTime;
+    }
+
+    public String getLoginIP() {
+        return loginIP;
+    }
+
+    public void setLoginIP(String loginIP) {
+        this.loginIP = loginIP;
+    }
+
+    public String getValidFlag() {
+        return validFlag;
+    }
+
+    public void setValidFlag(String validFlag) {
+        this.validFlag = validFlag;
+    }
+
+    public String getEmailCheckFlag() {
+        return emailCheckFlag;
+    }
+
+    public void setEmailCheckFlag(String emailCheckFlag) {
+        this.emailCheckFlag = emailCheckFlag;
+    }
+
+    public String getMobileCheckFlag() {
+        return mobileCheckFlag;
+    }
+
+    public void setMobileCheckFlag(String mobileCheckFlag) {
+        this.mobileCheckFlag = mobileCheckFlag;
+    }
+
+    public String getClubStatus() {
+        return clubStatus;
+    }
+
+    public void setClubStatus(String clubStatus) {
+        this.clubStatus = clubStatus;
+    }
+
+    public String getClubID() {
+        return clubID;
+    }
+
+    public void setClubID(String clubID) {
+        this.clubID = clubID;
+    }
+
+    public String getAgreeFlag() {
+        return agreeFlag;
+    }
+
+    public void setAgreeFlag(String agreeFlag) {
+        this.agreeFlag = agreeFlag;
+    }
+
+    public String getActivationCode() {
+        return activationCode;
+    }
+
+    public void setActivationCode(String activationCode) {
+        this.activationCode = activationCode;
+    }
+
+    public String getActivationDate() {
+        return activationDate;
+    }
+
+    public void setActivationDate(String activationDate) {
+        this.activationDate = activationDate;
+    }
+
+    @Length(min = 0, max = 11, message = "创客状态长度必须介于 0 和 11 之间")
+    public String getServiceProviderStatus() {
+        return serviceProviderStatus;
+    }
+
+    public void setServiceProviderStatus(String serviceProviderStatus) {
+        this.serviceProviderStatus = serviceProviderStatus;
+    }
+
+    @Length(min = 0, max = 11, message = "创客Id长度必须介于 0 和 11 之间")
+    public String getServiceProviderID() {
+        return serviceProviderID;
+    }
+
+    public void setServiceProviderID(String serviceProviderID) {
+        this.serviceProviderID = serviceProviderID;
+    }
+
+    @Length(min = 0, max = 11, message = "masterStatus长度必须介于 0 和 11 之间")
+    public String getMasterStatus() {
+        return masterStatus;
+    }
+
+    public void setMasterStatus(String masterStatus) {
+        this.masterStatus = masterStatus;
+    }
+
+    @Length(min = 0, max = 11, message = "masterID长度必须介于 0 和 11 之间")
+    public String getMasterID() {
+        return masterID;
+    }
+
+    public void setMasterID(String masterID) {
+        this.masterID = masterID;
+    }
+
+    public Double getUserMoney() {
+        return userMoney;
+    }
+
+    public void setUserMoney(Double userMoney) {
+        this.userMoney = userMoney;
+    }
+
+    public Double getAbleUserMoney() {
+        return ableUserMoney;
+    }
+
+    public void setAbleUserMoney(Double ableUserMoney) {
+        this.ableUserMoney = ableUserMoney;
+    }
+
+    @Length(min = 0, max = 11, message = "point长度必须介于 0 和 11 之间")
+    public String getPoint() {
+        return point;
+    }
+
+    public void setPoint(String point) {
+        this.point = point;
+    }
+
+    @Length(min = 0, max = 1, message = "shopERPFlag长度必须介于 0 和 1 之间")
+    public String getShopERPFlag() {
+        return shopERPFlag;
+    }
+
+    public void setShopERPFlag(String shopERPFlag) {
+        this.shopERPFlag = shopERPFlag;
+    }
+
+    @Length(min = 0, max = 11, message = "邀请人Id长度必须介于 0 和 11 之间")
+    public String getFromUserID() {
+        return fromUserID;
+    }
+
+    public void setFromUserID(String fromUserID) {
+        this.fromUserID = fromUserID;
+    }
+
+    public String getFromUserName() {
+        return fromUserName;
+    }
+
+    public void setFromUserName(String fromUserName) {
+        this.fromUserName = fromUserName;
+    }
+
+    public String getLogoffTime() {
+        return logoffTime;
+    }
+
+    public void setLogoffTime(String logoffTime) {
+        this.logoffTime = logoffTime;
+    }
+
+    @Length(min = 0, max = 20, message = "appKey长度必须介于 0 和 20 之间")
+    public String getAppKey() {
+        return appKey;
+    }
+
+    public void setAppKey(String appKey) {
+        this.appKey = appKey;
+    }
+
+    @Length(min = 0, max = 25, message = "appSecret长度必须介于 0 和 25 之间")
+    public String getAppSecret() {
+        return appSecret;
+    }
+
+    public void setAppSecret(String appSecret) {
+        this.appSecret = appSecret;
+    }
+
+    @Length(min = 0, max = 1, message = "sampleFlag长度必须介于 0 和 1 之间")
+    public String getSampleFlag() {
+        return sampleFlag;
+    }
+
+    public void setSampleFlag(String sampleFlag) {
+        this.sampleFlag = sampleFlag;
+    }
+
+    @Length(min = 0, max = 11, message = "扫描标志(4 CRM拉上来的会所)长度必须介于 0 和 11 之间")
+    public String getScanFlag() {
+        return scanFlag;
+    }
+
+    public void setScanFlag(String scanFlag) {
+        this.scanFlag = scanFlag;
+    }
+
+    @Length(min = 0, max = 11, message = "sysroleid长度必须介于 0 和 11 之间")
+    public String getSysroleid() {
+        return sysroleid;
+    }
+
+    public void setSysroleid(String sysroleid) {
+        this.sysroleid = sysroleid;
+    }
+
+    @Length(min = 0, max = 2, message = "gender长度必须介于 0 和 2 之间")
+    public String getGender() {
+        return gender;
+    }
+
+    public void setGender(String gender) {
+        this.gender = gender;
+    }
+
+    @Length(min = 0, max = 11, message = "年龄长度必须介于 0 和 11 之间")
+    public String getAge() {
+        return age;
+    }
+
+    public void setAge(String age) {
+        this.age = age;
+    }
+
+    @Length(min = 0, max = 11, message = "salerbuyer长度必须介于 0 和 11 之间")
+    public String getSalerbuyer() {
+        return salerbuyer;
+    }
+
+    public void setSalerbuyer(String salerbuyer) {
+        this.salerbuyer = salerbuyer;
+    }
+
+    @Length(min = 0, max = 128, message = "position长度必须介于 0 和 128 之间")
+    public String getPosition() {
+        return position;
+    }
+
+    public void setPosition(String position) {
+        this.position = position;
+    }
+
+    @Length(min = 0, max = 128, message = "skill长度必须介于 0 和 128 之间")
+    public String getSkill() {
+        return skill;
+    }
+
+    public void setSkill(String skill) {
+        this.skill = skill;
+    }
+
+    public String getWorkage() {
+        return workage;
+    }
+
+    public void setWorkage(String workage) {
+        this.workage = workage;
+    }
+
+    @Length(min = 0, max = 64, message = "微信号长度必须介于 0 和 64 之间")
+    public String getWechat() {
+        return wechat;
+    }
+
+    public void setWechat(String wechat) {
+        this.wechat = wechat;
+    }
+
+    @Length(min = 0, max = 32, message = "QQ号长度必须介于 0 和 32 之间")
+    public String getQq() {
+        return qq;
+    }
+
+    public void setQq(String qq) {
+        this.qq = qq;
+    }
+
+    @Length(min = 0, max = 1, message = "短信是否发送成功长度必须介于 0 和 1 之间")
+    public String getSmsFlag() {
+        return smsFlag;
+    }
+
+    public void setSmsFlag(String smsFlag) {
+        this.smsFlag = smsFlag;
+    }
+
+    @Length(min = 0, max = 11, message = "采美豆数量长度必须介于 0 和 11 之间")
+    public String getUserBeans() {
+        return userBeans;
+    }
+
+    public void setUserBeans(String userBeans) {
+        this.userBeans = userBeans;
+    }
+
+    @Length(min = 0, max = 11, message = "平台商标志位  0非平台商 1平台商长度必须介于 0 和 11 之间")
+    public String getPrivateShopFlag() {
+        return privateShopFlag;
+    }
+
+    public void setPrivateShopFlag(String privateShopFlag) {
+        this.privateShopFlag = privateShopFlag;
+    }
+
+    @Length(min = 0, max = 11, message = "平台会所标志位  0非平台会所 1平台会所长度必须介于 0 和 11 之间")
+    public String getPrivateClubFlag() {
+        return privateClubFlag;
+    }
+
+    public void setPrivateClubFlag(String privateClubFlag) {
+        this.privateClubFlag = privateClubFlag;
+    }
+
+    @Length(min = 0, max = 11, message = "isMeiDaoAuthorized长度必须介于 0 和 11 之间")
+    public String getIsMeiDaoAuthorized() {
+        return isMeiDaoAuthorized;
+    }
+
+    public void setIsMeiDaoAuthorized(String isMeiDaoAuthorized) {
+        this.isMeiDaoAuthorized = isMeiDaoAuthorized;
+    }
+
+    @Length(min = 0, max = 1, message = "引导层弹出  0需要弹出  1不需要弹出长度必须介于 0 和 1 之间")
+    public String getGuideFlag() {
+        return guideFlag;
+    }
+
+    public void setGuideFlag(String guideFlag) {
+        this.guideFlag = guideFlag;
+    }
+
+    public String getNickName() {
+        return nickName;
+    }
+
+    public void setNickName(String nickName) {
+        this.nickName = nickName;
+    }
+
+    public String getAccount() {
+        return account;
+    }
+
+    public void setAccount(String account) {
+        this.account = account;
+    }
+
+    public Integer getUserIdentity() {
+        return userIdentity;
+    }
+
+    public void setUserIdentity(Integer userIdentity) {
+        this.userIdentity = userIdentity;
+    }
+
+    public String getRealName() {
+        return realName;
+    }
+
+    public void setRealName(String realName) {
+        this.realName = realName;
+    }
+
+    public Integer getCompanyUserID() {
+        return companyUserID;
+    }
+
+    public void setCompanyUserID(Integer companyUserID) {
+        this.companyUserID = companyUserID;
+    }
+
+    public String getOpenID() {
+        return openID;
+    }
+
+    public void setOpenID(String openID) {
+        this.openID = openID;
+    }
+
+    public String getBindMobile() {
+        return bindMobile;
+    }
+
+    public void setBindMobile(String bindMobile) {
+        this.bindMobile = bindMobile;
+    }
+
+    public String getTipStatus() {
+        return tipStatus;
+    }
+
+    public void setTipStatus(String tipStatus) {
+        this.tipStatus = tipStatus;
+    }
+
+    @Transient
+    public String getIdentityDisplay() {
+        return identityDisplay;
+    }
+
+    public void setIdentityDisplay(String identityDisplay) {
+        this.identityDisplay = identityDisplay;
+    }
+
+    @Transient
+    public String getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+
+    @Transient
+    public String getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+
+    public Integer getUserOrganizeID() {
+        return userOrganizeID;
+    }
+
+    public void setUserOrganizeID(Integer userOrganizeID) {
+        this.userOrganizeID = userOrganizeID;
+    }
+
+    public String getLinkMan() {
+        return linkMan;
+    }
+
+    public void setLinkMan(String linkMan) {
+        this.linkMan = linkMan;
+    }
+
+    public String getTown() {
+        return town;
+    }
+
+    public void setTown(String town) {
+        this.town = town;
+    }
+
+    public String getCity() {
+        return city;
+    }
+
+    public void setCity(String city) {
+        this.city = city;
+    }
+
+    public String getProvince() {
+        return province;
+    }
+
+    public void setProvince(String province) {
+        this.province = province;
+    }
+
+    public String getAddress() {
+        return address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+}

+ 109 - 0
src/main/java/com/caimei/modules/club/entity/CmUserOrganize.java

@@ -0,0 +1,109 @@
+package com.caimei.modules.club.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 采美商城组织Entity
+ *
+ * @author lijun
+ * @version 2019-11-19
+ */
+public class CmUserOrganize implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+    private Integer id;
+    private String organizeName;        // 组织名称
+    private String organizeLinkName;        // 组织联系人
+    private String mobile;        // 手机号码
+    private Date updateTime;        // 更新时间
+    private Date addTime;        // 添加时间
+    private String contactNumber;//联系我们,手机或者座机号码
+    private String introduction;//关于我们:组织介绍信息
+    private String afterSale;//售后无忧
+    private String shoppingNotes;//购物须知
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getOrganizeName() {
+        return organizeName;
+    }
+
+    public void setOrganizeName(String organizeName) {
+        this.organizeName = organizeName;
+    }
+
+    public String getOrganizeLinkName() {
+        return organizeLinkName;
+    }
+
+    public void setOrganizeLinkName(String organizeLinkName) {
+        this.organizeLinkName = organizeLinkName;
+    }
+
+    public String getMobile() {
+        return mobile;
+    }
+
+    public void setMobile(String mobile) {
+        this.mobile = mobile;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public Date getAddTime() {
+        return addTime;
+    }
+
+    public void setAddTime(Date addTime) {
+        this.addTime = addTime;
+    }
+
+    public String getContactNumber() {
+        return contactNumber;
+    }
+
+    public void setContactNumber(String contactNumber) {
+        this.contactNumber = contactNumber;
+    }
+
+    public String getIntroduction() {
+        return introduction;
+    }
+
+    public void setIntroduction(String introduction) {
+        this.introduction = introduction;
+    }
+
+    public String getAfterSale() {
+        return afterSale;
+    }
+
+    public void setAfterSale(String afterSale) {
+        this.afterSale = afterSale;
+    }
+
+    public String getShoppingNotes() {
+        return shoppingNotes;
+    }
+
+    public void setShoppingNotes(String shoppingNotes) {
+        this.shoppingNotes = shoppingNotes;
+    }
+}

+ 893 - 0
src/main/java/com/caimei/modules/club/entity/NewCmClub.java

@@ -0,0 +1,893 @@
+package com.caimei.modules.club.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.hibernate.validator.constraints.Length;
+
+import javax.validation.constraints.NotNull;
+import java.beans.Transient;
+import java.util.Date;
+
+/**
+ * 用户模块重构--会所管理Entity
+ *
+ * @author zcp
+ * @version 2018-05-21
+ */
+public class NewCmClub {
+
+    private static final long serialVersionUID = 1L;
+    private Integer id;
+    private Integer clubID;        // 会所ID
+    private Integer userID;        // 用户ID
+    private Integer userOrganizeID;//用户组织ID
+    private Integer clubTypeID;        // 【已废弃】会所类型
+    private String name;        // 会所名称
+    private String sname;        // 简称
+    private String nameEn;        // 会所英文名称
+    private String site;        // 网址
+    private String logo;        // logo
+    private Double level;        // 【已废弃】未知
+    private Double score;        // 【已废弃】未知
+    private Integer subClubCount;        // 【已废弃】子会所数量
+    private String legalPerson;        // 法人
+    private Integer provinceID;        // 省
+    private Integer cityID;        // 市
+    private Integer townID;        // 地址ID
+    private String agreement;        // 是否同意协议
+    private String flag;        // 拉会所上线的用户的cmBindId,以逗号结尾
+    private Integer inviterBindID;        // 邀请者cmBindId
+    private String inviterName;        // 邀请者名称
+    private Integer spID;        // 协销Id
+    private Integer mainServiceProviderID;        // 协销经理Id
+    private Date scanTime;        // 扫描时间
+    private Date checkTime;        // 上线时间
+    private String address;        // 详细地址
+    private Double registeredCapital;        // 注册资金
+    private Integer mainClubID;        // 集团会所ID
+    private Double turnover;        // 营业额
+    private String linkMan;        // 联系人
+    private String contractPhone;        // 联系电话
+    private String contractMobile;        // 联系手机
+    private String fax;        // 传真
+    private String zipCode;        // 邮编
+    private String linkMan1;        // 联系人
+    private String duty1;        // 职务
+    private String contractPhone1;        // 联系电话1
+    private String contractMobile1;        // 手机号1
+    private String contractQQ1;        // 联系QQ
+    private String wechat1;        // 微信号
+    private String contractEmail1;        // 联系邮箱
+    private String linkMan2;        // 联系人
+    private String duty2;        // 职务
+    private String contractPhone2;        // 联系电话
+    private String contractMobile2;        // 联系手机
+    private String contractQQ2;        // 联系QQ
+    private String wechat2;        // 微信号
+    private String contractEmail2;        // 联系邮箱
+    private String scope;        // 经营范围
+    private String info;        // 公司简介
+    private Double lng;        // 纬度
+    private Double lat;        // 经度
+    private String addTime;        // 注册时间
+    private Integer favoriteTimes;        // 收藏量
+    private String payFlag1;        // 支付
+    private String auditTime;        // 审核时间
+    private String auditNote;        // 审核备注
+    private Integer status;        // 状态
+    private String clubInvitationStatus;        // 集团会所邀请状态
+    private String recAddress;        // 收货地址
+    private String businessLicenseImage;        // 营业执照
+    private Integer sortIndex;        // 排序值
+    private Integer recTownID;        // 收货地址县级ID
+    private Integer defaultServiceProviderID;        // 默认的创客
+    private String defaultServiceProviderUpdTime;        // 创客更新时间
+    private String firstServiceProviderFlag;        // 第一次服务标志
+    private String scale;        // 规模
+    private Integer empnum;        // 员工数
+    private String mainpro;        // 主打项目
+    private String remark;        // 备注
+    private String scanFlag;        // 扫描状态 0待扫描 1 已扫描 2已上线
+    private String headpic;        // 门头照
+    private Date lastModify;        // 最后更新时间
+    private String firstClubType; // 一级分类为医美=1和生美=2
+    private String secondClubType; // 医美的二级分类为诊所=1、门诊=2、医院=3。  生美没有二级分类
+    private String department; // 若为医美分类下的门诊和医院则需要填写科室。
+    private String medicalPracticeLicenseImg; // 医美分类必须上传医疗执业许可证
+    private String socialCreditCode;//统一社会编码
+
+    /**
+     * 非持久化字段
+     */
+    private String spName; //创客名称
+    private String account;//企业会所用户账号
+    private String mobile;
+    private String fromUserName;
+    private Integer userLevelID;
+    private Date registerTime;
+    private String smsFlag;        // 短信是否发送成功
+    private String userScanFlag;        // 扫描标志(4 CRM拉上来的会所)
+    private String town; // 区
+    private String city; // 市
+    private String province; //省
+    private String startTime;     //注册时间开始 查询条件
+    private String endTime;        //注册时间结束  查询条件
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    @NotNull(message = "会所ID不能为空")
+    public Integer getClubID() {
+        return clubID;
+    }
+
+    public void setClubID(Integer clubID) {
+        this.clubID = clubID;
+    }
+
+    public Integer getUserID() {
+        return userID;
+    }
+
+    public void setUserID(Integer userID) {
+        this.userID = userID;
+    }
+
+    @NotNull(message = "【已废弃】会所类型不能为空")
+    public Integer getClubTypeID() {
+        return clubTypeID;
+    }
+
+    public void setClubTypeID(Integer clubTypeID) {
+        this.clubTypeID = clubTypeID;
+    }
+
+    @Length(min = 0, max = 50, message = "会所名称长度必须介于 0 和 50 之间")
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    @Length(min = 0, max = 20, message = "简称长度必须介于 0 和 20 之间")
+    public String getSname() {
+        return sname;
+    }
+
+    public void setSname(String sname) {
+        this.sname = sname;
+    }
+
+    @Length(min = 0, max = 100, message = "会所英文名称长度必须介于 0 和 100 之间")
+    public String getNameEn() {
+        return nameEn;
+    }
+
+    public void setNameEn(String nameEn) {
+        this.nameEn = nameEn;
+    }
+
+    @Length(min = 0, max = 200, message = "网址长度必须介于 0 和 200 之间")
+    public String getSite() {
+        return site;
+    }
+
+    public void setSite(String site) {
+        this.site = site;
+    }
+
+    @Length(min = 0, max = 200, message = "logo长度必须介于 0 和 200 之间")
+    public String getLogo() {
+        return logo;
+    }
+
+    public void setLogo(String logo) {
+        this.logo = logo;
+    }
+
+    public Double getLevel() {
+        return level;
+    }
+
+    public void setLevel(Double level) {
+        this.level = level;
+    }
+
+    public Double getScore() {
+        return score;
+    }
+
+    public void setScore(Double score) {
+        this.score = score;
+    }
+
+    public Integer getSubClubCount() {
+        return subClubCount;
+    }
+
+    public void setSubClubCount(Integer subClubCount) {
+        this.subClubCount = subClubCount;
+    }
+
+    @Length(min = 0, max = 20, message = "法人长度必须介于 0 和 20 之间")
+    public String getLegalPerson() {
+        return legalPerson;
+    }
+
+    public void setLegalPerson(String legalPerson) {
+        this.legalPerson = legalPerson;
+    }
+
+    public Integer getProvinceID() {
+        return provinceID;
+    }
+
+    public void setProvinceID(Integer provinceID) {
+        this.provinceID = provinceID;
+    }
+
+    public Integer getCityID() {
+        return cityID;
+    }
+
+    public void setCityID(Integer cityID) {
+        this.cityID = cityID;
+    }
+
+    public Integer getTownID() {
+        return townID;
+    }
+
+    public void setTownID(Integer townID) {
+        this.townID = townID;
+    }
+
+    @Length(min = 0, max = 1, message = "是否同意协议长度必须介于 0 和 1 之间")
+    public String getAgreement() {
+        return agreement;
+    }
+
+    public void setAgreement(String agreement) {
+        this.agreement = agreement;
+    }
+
+    @Length(min = 0, max = 100, message = "拉会所上线的用户的cmBindId,以逗号结尾长度必须介于 0 和 100 之间")
+    public String getFlag() {
+        return flag;
+    }
+
+    public void setFlag(String flag) {
+        this.flag = flag;
+    }
+
+    public Integer getInviterBindID() {
+        return inviterBindID;
+    }
+
+    public void setInviterBindID(Integer inviterBindID) {
+        this.inviterBindID = inviterBindID;
+    }
+
+    @Length(min = 0, max = 255, message = "邀请者名称长度必须介于 0 和 255 之间")
+    public String getInviterName() {
+        return inviterName;
+    }
+
+    public void setInviterName(String inviterName) {
+        this.inviterName = inviterName;
+    }
+
+    public Integer getSpID() {
+        return spID;
+    }
+
+    public void setSpID(Integer spID) {
+        this.spID = spID;
+    }
+
+    public Integer getMainServiceProviderID() {
+        return mainServiceProviderID;
+    }
+
+    public void setMainServiceProviderID(Integer mainServiceProviderID) {
+        this.mainServiceProviderID = mainServiceProviderID;
+    }
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    public Date getScanTime() {
+        return scanTime;
+    }
+
+    public void setScanTime(Date scanTime) {
+        this.scanTime = scanTime;
+    }
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    public Date getCheckTime() {
+        return checkTime;
+    }
+
+    public void setCheckTime(Date checkTime) {
+        this.checkTime = checkTime;
+    }
+
+    @Length(min = 0, max = 100, message = "详细地址长度必须介于 0 和 100 之间")
+    public String getAddress() {
+        return address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    public Double getRegisteredCapital() {
+        return registeredCapital;
+    }
+
+    public void setRegisteredCapital(Double registeredCapital) {
+        this.registeredCapital = registeredCapital;
+    }
+
+    public Integer getMainClubID() {
+        return mainClubID;
+    }
+
+    public void setMainClubID(Integer mainClubID) {
+        this.mainClubID = mainClubID;
+    }
+
+    public Double getTurnover() {
+        return turnover;
+    }
+
+    public void setTurnover(Double turnover) {
+        this.turnover = turnover;
+    }
+
+    @Length(min = 0, max = 50, message = "联系人长度必须介于 0 和 50 之间")
+    public String getLinkMan() {
+        return linkMan;
+    }
+
+    public void setLinkMan(String linkMan) {
+        this.linkMan = linkMan;
+    }
+
+    @Length(min = 0, max = 50, message = "联系电话长度必须介于 0 和 50 之间")
+    public String getContractPhone() {
+        return contractPhone;
+    }
+
+    public void setContractPhone(String contractPhone) {
+        this.contractPhone = contractPhone;
+    }
+
+    @Length(min = 0, max = 20, message = "联系手机长度必须介于 0 和 20 之间")
+    public String getContractMobile() {
+        return contractMobile;
+    }
+
+    public void setContractMobile(String contractMobile) {
+        this.contractMobile = contractMobile;
+    }
+
+    @Length(min = 0, max = 50, message = "传真长度必须介于 0 和 50 之间")
+    public String getFax() {
+        return fax;
+    }
+
+    public void setFax(String fax) {
+        this.fax = fax;
+    }
+
+    @Length(min = 0, max = 10, message = "邮编长度必须介于 0 和 10 之间")
+    public String getZipCode() {
+        return zipCode;
+    }
+
+    public void setZipCode(String zipCode) {
+        this.zipCode = zipCode;
+    }
+
+    @Length(min = 0, max = 50, message = "联系人长度必须介于 0 和 50 之间")
+    public String getLinkMan1() {
+        return linkMan1;
+    }
+
+    public void setLinkMan1(String linkMan1) {
+        this.linkMan1 = linkMan1;
+    }
+
+    @Length(min = 0, max = 50, message = "职务长度必须介于 0 和 50 之间")
+    public String getDuty1() {
+        return duty1;
+    }
+
+    public void setDuty1(String duty1) {
+        this.duty1 = duty1;
+    }
+
+    @Length(min = 0, max = 50, message = "联系电话1长度必须介于 0 和 50 之间")
+    public String getContractPhone1() {
+        return contractPhone1;
+    }
+
+    public void setContractPhone1(String contractPhone1) {
+        this.contractPhone1 = contractPhone1;
+    }
+
+    @Length(min = 0, max = 20, message = "手机号1长度必须介于 0 和 20 之间")
+    public String getContractMobile1() {
+        return contractMobile1;
+    }
+
+    public void setContractMobile1(String contractMobile1) {
+        this.contractMobile1 = contractMobile1;
+    }
+
+    @Length(min = 0, max = 20, message = "联系QQ长度必须介于 0 和 20 之间")
+    public String getContractQQ1() {
+        return contractQQ1;
+    }
+
+    public void setContractQQ1(String contractQQ1) {
+        this.contractQQ1 = contractQQ1;
+    }
+
+    @Length(min = 0, max = 50, message = "微信号长度必须介于 0 和 50 之间")
+    public String getWechat1() {
+        return wechat1;
+    }
+
+    public void setWechat1(String wechat1) {
+        this.wechat1 = wechat1;
+    }
+
+    @Length(min = 0, max = 50, message = "联系邮箱长度必须介于 0 和 50 之间")
+    public String getContractEmail1() {
+        return contractEmail1;
+    }
+
+    public void setContractEmail1(String contractEmail1) {
+        this.contractEmail1 = contractEmail1;
+    }
+
+    @Length(min = 0, max = 50, message = "联系人长度必须介于 0 和 50 之间")
+    public String getLinkMan2() {
+        return linkMan2;
+    }
+
+    public void setLinkMan2(String linkMan2) {
+        this.linkMan2 = linkMan2;
+    }
+
+    @Length(min = 0, max = 50, message = "职务长度必须介于 0 和 50 之间")
+    public String getDuty2() {
+        return duty2;
+    }
+
+    public void setDuty2(String duty2) {
+        this.duty2 = duty2;
+    }
+
+    @Length(min = 0, max = 50, message = "联系电话长度必须介于 0 和 50 之间")
+    public String getContractPhone2() {
+        return contractPhone2;
+    }
+
+    public void setContractPhone2(String contractPhone2) {
+        this.contractPhone2 = contractPhone2;
+    }
+
+    @Length(min = 0, max = 20, message = "联系手机长度必须介于 0 和 20 之间")
+    public String getContractMobile2() {
+        return contractMobile2;
+    }
+
+    public void setContractMobile2(String contractMobile2) {
+        this.contractMobile2 = contractMobile2;
+    }
+
+    @Length(min = 0, max = 20, message = "联系QQ长度必须介于 0 和 20 之间")
+    public String getContractQQ2() {
+        return contractQQ2;
+    }
+
+    public void setContractQQ2(String contractQQ2) {
+        this.contractQQ2 = contractQQ2;
+    }
+
+    @Length(min = 0, max = 50, message = "微信号长度必须介于 0 和 50 之间")
+    public String getWechat2() {
+        return wechat2;
+    }
+
+    public void setWechat2(String wechat2) {
+        this.wechat2 = wechat2;
+    }
+
+    @Length(min = 0, max = 50, message = "联系邮箱长度必须介于 0 和 50 之间")
+    public String getContractEmail2() {
+        return contractEmail2;
+    }
+
+    public void setContractEmail2(String contractEmail2) {
+        this.contractEmail2 = contractEmail2;
+    }
+
+    @Length(min = 0, max = 100, message = "经营范围长度必须介于 0 和 100 之间")
+    public String getScope() {
+        return scope;
+    }
+
+    public void setScope(String scope) {
+        this.scope = scope;
+    }
+
+    @Length(min = 0, max = 500, message = "公司简介长度必须介于 0 和 500 之间")
+    public String getInfo() {
+        return info;
+    }
+
+    public void setInfo(String info) {
+        this.info = info;
+    }
+
+    public Double getLng() {
+        return lng;
+    }
+
+    public void setLng(Double lng) {
+        this.lng = lng;
+    }
+
+    public Double getLat() {
+        return lat;
+    }
+
+    public void setLat(Double lat) {
+        this.lat = lat;
+    }
+
+    public String getAddTime() {
+        return addTime;
+    }
+
+    public void setAddTime(String addTime) {
+        this.addTime = addTime;
+    }
+
+    public Integer getFavoriteTimes() {
+        return favoriteTimes;
+    }
+
+    public void setFavoriteTimes(Integer favoriteTimes) {
+        this.favoriteTimes = favoriteTimes;
+    }
+
+    @Length(min = 0, max = 1, message = "支付长度必须介于 0 和 1 之间")
+    public String getPayFlag1() {
+        return payFlag1;
+    }
+
+    public void setPayFlag1(String payFlag1) {
+        this.payFlag1 = payFlag1;
+    }
+
+    @Length(min = 0, max = 19, message = "审核时间长度必须介于 0 和 19 之间")
+    public String getAuditTime() {
+        return auditTime;
+    }
+
+    public void setAuditTime(String auditTime) {
+        this.auditTime = auditTime;
+    }
+
+    @Length(min = 0, max = 100, message = "审核备注长度必须介于 0 和 100 之间")
+    public String getAuditNote() {
+        return auditNote;
+    }
+
+    public void setAuditNote(String auditNote) {
+        this.auditNote = auditNote;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    @Length(min = 0, max = 1, message = "集团会所邀请状态长度必须介于 0 和 1 之间")
+    public String getClubInvitationStatus() {
+        return clubInvitationStatus;
+    }
+
+    public void setClubInvitationStatus(String clubInvitationStatus) {
+        this.clubInvitationStatus = clubInvitationStatus;
+    }
+
+    @Length(min = 0, max = 100, message = "收货地址长度必须介于 0 和 100 之间")
+    public String getRecAddress() {
+        return recAddress;
+    }
+
+    public void setRecAddress(String recAddress) {
+        this.recAddress = recAddress;
+    }
+
+    @Length(min = 0, max = 200, message = "营业执照长度必须介于 0 和 200 之间")
+    public String getBusinessLicenseImage() {
+        return businessLicenseImage;
+    }
+
+    public void setBusinessLicenseImage(String businessLicenseImage) {
+        this.businessLicenseImage = businessLicenseImage;
+    }
+
+    public Integer getSortIndex() {
+        return sortIndex;
+    }
+
+    public void setSortIndex(Integer sortIndex) {
+        this.sortIndex = sortIndex;
+    }
+
+    public Integer getRecTownID() {
+        return recTownID;
+    }
+
+    public void setRecTownID(Integer recTownID) {
+        this.recTownID = recTownID;
+    }
+
+    public Integer getDefaultServiceProviderID() {
+        return defaultServiceProviderID;
+    }
+
+    public void setDefaultServiceProviderID(Integer defaultServiceProviderID) {
+        this.defaultServiceProviderID = defaultServiceProviderID;
+    }
+
+    @Length(min = 0, max = 19, message = "创客更新时间长度必须介于 0 和 19 之间")
+    public String getDefaultServiceProviderUpdTime() {
+        return defaultServiceProviderUpdTime;
+    }
+
+    public void setDefaultServiceProviderUpdTime(String defaultServiceProviderUpdTime) {
+        this.defaultServiceProviderUpdTime = defaultServiceProviderUpdTime;
+    }
+
+    @Length(min = 0, max = 1, message = "第一次服务标志长度必须介于 0 和 1 之间")
+    public String getFirstServiceProviderFlag() {
+        return firstServiceProviderFlag;
+    }
+
+    public void setFirstServiceProviderFlag(String firstServiceProviderFlag) {
+        this.firstServiceProviderFlag = firstServiceProviderFlag;
+    }
+
+    @Length(min = 0, max = 20, message = "规模长度必须介于 0 和 20 之间")
+    public String getScale() {
+        return scale;
+    }
+
+    public void setScale(String scale) {
+        this.scale = scale;
+    }
+
+    public Integer getEmpnum() {
+        return empnum;
+    }
+
+    public void setEmpnum(Integer empnum) {
+        this.empnum = empnum;
+    }
+
+    @Length(min = 0, max = 200, message = "主打项目长度必须介于 0 和 200 之间")
+    public String getMainpro() {
+        return mainpro;
+    }
+
+    public void setMainpro(String mainpro) {
+        this.mainpro = mainpro;
+    }
+
+    @Length(min = 0, max = 500, message = "备注长度必须介于 0 和 500 之间")
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Length(min = 1, max = 2, message = "扫描状态 0待扫描 1 已扫描 2已上线长度必须介于 1 和 2 之间")
+    public String getScanFlag() {
+        return scanFlag;
+    }
+
+    public void setScanFlag(String scanFlag) {
+        this.scanFlag = scanFlag;
+    }
+
+    @Length(min = 0, max = 200, message = "门头照长度必须介于 0 和 200 之间")
+    public String getHeadpic() {
+        return headpic;
+    }
+
+    public void setHeadpic(String headpic) {
+        this.headpic = headpic;
+    }
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    public Date getLastModify() {
+        return lastModify;
+    }
+
+    public void setLastModify(Date lastModify) {
+        this.lastModify = lastModify;
+    }
+
+    public String getSpName() {
+        return spName;
+    }
+
+    public void setSpName(String spName) {
+        this.spName = spName;
+    }
+
+    public String getAccount() {
+        return account;
+    }
+
+    public void setAccount(String account) {
+        this.account = account;
+    }
+
+    public String getMobile() {
+        return mobile;
+    }
+
+    public void setMobile(String mobile) {
+        this.mobile = mobile;
+    }
+
+    public String getFromUserName() {
+        return fromUserName;
+    }
+
+    public void setFromUserName(String fromUserName) {
+        this.fromUserName = fromUserName;
+    }
+
+    public Integer getUserLevelID() {
+        return userLevelID;
+    }
+
+    public void setUserLevelID(Integer userLevelID) {
+        this.userLevelID = userLevelID;
+    }
+
+    public Date getRegisterTime() {
+        return registerTime;
+    }
+
+    public void setRegisterTime(Date registerTime) {
+        this.registerTime = registerTime;
+    }
+
+    public String getSmsFlag() {
+        return smsFlag;
+    }
+
+    public void setSmsFlag(String smsFlag) {
+        this.smsFlag = smsFlag;
+    }
+
+    public String getUserScanFlag() {
+        return userScanFlag;
+    }
+
+    public void setUserScanFlag(String userScanFlag) {
+        this.userScanFlag = userScanFlag;
+    }
+
+    public String getTown() {
+        return town;
+    }
+
+    public void setTown(String town) {
+        this.town = town;
+    }
+
+    public String getCity() {
+        return city;
+    }
+
+    public void setCity(String city) {
+        this.city = city;
+    }
+
+    public String getProvince() {
+        return province;
+    }
+
+    public void setProvince(String province) {
+        this.province = province;
+    }
+
+    @Transient
+    public String getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+
+    @Transient
+    public String getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+
+    public String getFirstClubType() {
+        return firstClubType;
+    }
+
+    public void setFirstClubType(String firstClubType) {
+        this.firstClubType = firstClubType;
+    }
+
+    public String getSecondClubType() {
+        return secondClubType;
+    }
+
+    public void setSecondClubType(String secondClubType) {
+        this.secondClubType = secondClubType;
+    }
+
+    public String getDepartment() {
+        return department;
+    }
+
+    public void setDepartment(String department) {
+        this.department = department;
+    }
+
+    public String getMedicalPracticeLicenseImg() {
+        return medicalPracticeLicenseImg;
+    }
+
+    public void setMedicalPracticeLicenseImg(String medicalPracticeLicenseImg) {
+        this.medicalPracticeLicenseImg = medicalPracticeLicenseImg;
+    }
+
+    public String getSocialCreditCode() {
+        return socialCreditCode;
+    }
+
+    public void setSocialCreditCode(String socialCreditCode) {
+        this.socialCreditCode = socialCreditCode;
+    }
+
+    public Integer getUserOrganizeID() {
+        return userOrganizeID;
+    }
+
+    public void setUserOrganizeID(Integer userOrganizeID) {
+        this.userOrganizeID = userOrganizeID;
+    }
+}

+ 154 - 0
src/main/java/com/caimei/modules/club/entity/Page.java

@@ -0,0 +1,154 @@
+package com.caimei.modules.club.entity;
+
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.List;
+
+public class Page<T> implements Serializable {
+    private static final long serialVersionUID = 1L;
+    private int index;//当前页码
+    private int pageSize;//每页大小
+    private int totalRecord;//总记录数
+    private int totalPage;//总页数?
+    private boolean hasNextPage;//是否有后一页
+    private boolean hasPreviousPage;//是否有前一页
+    List<T> results;//查询结果
+
+    public Page(List<T> list) {
+        if (list instanceof com.github.pagehelper.Page) {
+            com.github.pagehelper.Page<T> page = (com.github.pagehelper.Page<T>) list;
+            this.index = page.getPageNum();
+            this.pageSize = page.getPageSize();
+            this.totalRecord = (int) page.getTotal();
+            this.totalPage = page.getPages();
+            setHasPreviousAndNext();
+            this.results = page;
+        } else if (list instanceof Collection) {
+            this.index = 1;
+            this.pageSize = list.size();
+            this.totalRecord = list.size();
+            this.totalPage = 1;
+            this.results = list;
+        }
+    }
+
+    public Page(int index, int pageSize, int totalRecord, List<T> results) {
+        super();
+        this.index = index;
+        this.pageSize = pageSize;
+        this.totalRecord = totalRecord;
+        this.totalPage = totalRecord % pageSize == 0 ? totalRecord / pageSize : totalRecord / pageSize + 1;
+        this.results = results;
+        if (this.index < 2) {
+            hasPreviousPage = false;
+        } else {
+            hasPreviousPage = true;
+        }
+        if (this.index < totalPage) {
+            hasNextPage = true;
+        } else {
+            hasNextPage = false;
+        }
+    }
+
+    public Page(int index, int maxSize, int totalRecord, int totalPage,
+                List<T> results) {
+        super();
+        this.index = index;
+        this.pageSize = maxSize;
+        this.totalRecord = totalRecord;
+        this.totalPage = totalPage;
+        this.results = results;
+        if (this.index < 2) {
+            hasPreviousPage = false;
+        } else {
+            hasPreviousPage = true;
+        }
+        if (this.index < totalPage) {
+            hasNextPage = true;
+        } else {
+            hasNextPage = false;
+        }
+    }
+
+    public void setHasPreviousAndNext() {
+        if (this.index < 2) {
+            hasPreviousPage = false;
+        } else {
+            hasPreviousPage = true;
+        }
+        if (this.index < totalPage) {
+            hasNextPage = true;
+        } else {
+            hasNextPage = false;
+        }
+    }
+
+    public Page() {
+        super();
+    }
+
+    public int getIndex() {
+        return index;
+    }
+
+    public void setIndex(int index) {
+        this.index = index;
+    }
+
+    public int getPageSize() {
+        return pageSize;
+    }
+
+    public void setPageSize(int maxSize) {
+        this.pageSize = maxSize;
+    }
+
+    public int getTotalRecord() {
+        return totalRecord;
+    }
+
+    public void setTotalRecord(int totalRecord) {
+        this.totalRecord = totalRecord;
+    }
+
+    public int getTotalPage() {
+        return totalPage;
+    }
+
+    public void setTotalPage(int totalPage) {
+        this.totalPage = totalPage;
+    }
+
+    public List<T> getResults() {
+        return results;
+    }
+
+    public void setResults(List<T> results) {
+        this.results = results;
+    }
+
+
+    public boolean isHasNextPage() {
+        return hasNextPage;
+    }
+
+    public void setHasNextPage(boolean hasNextPage) {
+        this.hasNextPage = hasNextPage;
+    }
+
+    public boolean isHasPreviousPage() {
+        return hasPreviousPage;
+    }
+
+    public void setHasPreviousPage(boolean hasPreviousPage) {
+        this.hasPreviousPage = hasPreviousPage;
+    }
+
+    public int countTotalPage() {
+        int total = totalRecord % pageSize == 0 ? totalRecord / pageSize : totalRecord / pageSize + 1;
+        this.setTotalPage(total);
+        return total;
+    }
+
+}

+ 38 - 0
src/main/java/com/caimei/modules/club/entity/Province.java

@@ -0,0 +1,38 @@
+package com.caimei.modules.club.entity;
+
+public class Province implements java.io.Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	private Integer id;
+	private String name;
+	private String validFlag;
+
+	public static long getSerialVersionUID() {
+		return serialVersionUID;
+	}
+
+	public Integer getId() {
+		return id;
+	}
+
+	public void setId(Integer id) {
+		this.id = id;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getValidFlag() {
+		return validFlag;
+	}
+
+	public void setValidFlag(String validFlag) {
+		this.validFlag = validFlag;
+	}
+}

+ 65 - 0
src/main/java/com/caimei/modules/club/entity/Town.java

@@ -0,0 +1,65 @@
+package com.caimei.modules.club.entity;
+
+public class Town implements java.io.Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    private Integer id;
+    private Integer cityId;
+    private String name;
+    private String zip;
+    private String telZip;
+    private String validFlag;
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getCityId() {
+        return cityId;
+    }
+
+    public void setCityId(Integer cityId) {
+        this.cityId = cityId;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getZip() {
+        return zip;
+    }
+
+    public void setZip(String zip) {
+        this.zip = zip;
+    }
+
+    public String getTelZip() {
+        return telZip;
+    }
+
+    public void setTelZip(String telZip) {
+        this.telZip = telZip;
+    }
+
+    public String getValidFlag() {
+        return validFlag;
+    }
+
+    public void setValidFlag(String validFlag) {
+        this.validFlag = validFlag;
+    }
+}

+ 17 - 0
src/main/java/com/caimei/modules/club/service/CmOperationUserService.java

@@ -0,0 +1,17 @@
+package com.caimei.modules.club.service;
+
+import com.caimei.modules.club.entity.CmOperationUser;
+
+import java.util.List;
+
+public interface CmOperationUserService {
+    List<CmOperationUser> findList(CmOperationUser cmOperationUser);
+
+    List<CmOperationUser> findListBuyBindMobile(CmOperationUser cmOperationUser);
+
+    List<CmOperationUser> getListByInvitationCode(CmOperationUser opUser);
+
+    void save(CmOperationUser cmOperationUser);
+
+    void untiedOperationUser(CmOperationUser cmOperationUser);
+}

+ 15 - 0
src/main/java/com/caimei/modules/club/service/CmUserOrganizeService.java

@@ -0,0 +1,15 @@
+package com.caimei.modules.club.service;
+
+import com.caimei.modules.club.entity.*;
+
+import java.util.List;
+
+public interface CmUserOrganizeService {
+    List<CmUserOrganize> findList(CmUserOrganize cmUserOrganize);
+
+    Province loadProvinceById(Integer provinceID);
+
+    City loadCityById(Integer cityID);
+
+    Town loadTownByID(Integer townID);
+}

+ 15 - 0
src/main/java/com/caimei/modules/club/service/CmUserService.java

@@ -0,0 +1,15 @@
+package com.caimei.modules.club.service;
+
+import com.caimei.modules.club.entity.CmUser;
+
+import java.util.List;
+
+public interface CmUserService {
+    List<CmUser> findListBuyUserInfo(CmUser cmUser);
+
+    List<CmUser> findListBuyBindMobile(CmUser cmUser);
+
+    void insert(CmUser cmUser);
+
+    void update(CmUser cmUser);
+}

+ 12 - 0
src/main/java/com/caimei/modules/club/service/NewCmClubService.java

@@ -0,0 +1,12 @@
+package com.caimei.modules.club.service;
+
+import com.caimei.modules.club.entity.NewCmClub;
+
+public interface NewCmClubService {
+
+    NewCmClub findClubById(Integer clubID);
+
+    void insert(NewCmClub newCmClub);
+
+    void update(NewCmClub newCmClub);
+}

+ 71 - 0
src/main/java/com/caimei/modules/club/service/impl/CmOperationUserServiceImpl.java

@@ -0,0 +1,71 @@
+package com.caimei.modules.club.service.impl;
+
+import com.caimei.modules.club.dao.CmOperationUserDao;
+import com.caimei.modules.club.entity.CmOperationUser;
+import com.caimei.modules.club.service.CmOperationUserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.thymeleaf.util.StringUtils;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.List;
+
+@Service
+public class CmOperationUserServiceImpl implements CmOperationUserService {
+    @Autowired
+    private CmOperationUserDao cmOperationUserDao;
+
+    @Override
+    public List<CmOperationUser> findList(CmOperationUser cmOperationUser) {
+        List<CmOperationUser> operationUserList = cmOperationUserDao.findList(cmOperationUser);
+        if (null != operationUserList) {
+            for (CmOperationUser user : operationUserList) {//判断邀请码是否有效
+                String status = user.getStatus();//1未绑定,2已绑定
+                if (StringUtils.equals("2", status)) {
+                    user.setEffectiveFlag("2");//邀请码是否有效 1有效,2已使用,3已失效
+                } else {
+                    Date invitationCodeTime = user.getInvitationCodeTime();
+                    if (null != invitationCodeTime) {
+                        Calendar calendar = new GregorianCalendar();
+                        calendar.setTime(invitationCodeTime);
+                        calendar.add(Calendar.DATE, 7);// num为增加的天数,可以改变的
+                        invitationCodeTime = calendar.getTime();
+                        boolean before = invitationCodeTime.before(new Date());
+                        if (before) {//如果验证码时间加上168小时小于当前时间则已过期
+                            user.setEffectiveFlag("3");
+                        } else {
+                            user.setEffectiveFlag("1");
+                        }
+                    }
+                }
+            }
+        }
+        return operationUserList;
+    }
+
+    @Override
+    public List<CmOperationUser> findListBuyBindMobile(CmOperationUser cmOperationUser) {
+        return cmOperationUserDao.findListBuyBindMobile(cmOperationUser);
+    }
+
+    @Override
+    public List<CmOperationUser> getListByInvitationCode(CmOperationUser opUser) {
+        return cmOperationUserDao.getListByInvitationCode(opUser);
+    }
+
+    @Override
+    public void save(CmOperationUser cmOperationUser) {
+        if (cmOperationUser.getId() == null) {
+            cmOperationUserDao.insert(cmOperationUser);
+        } else {
+            cmOperationUserDao.update(cmOperationUser);
+        }
+    }
+
+    @Override
+    public void untiedOperationUser(CmOperationUser cmOperationUser) {
+        cmOperationUserDao.untiedOperationUser(cmOperationUser);
+    }
+}

+ 39 - 0
src/main/java/com/caimei/modules/club/service/impl/CmUserOrganizeServiceImpl.java

@@ -0,0 +1,39 @@
+package com.caimei.modules.club.service.impl;
+
+import com.caimei.modules.club.dao.CmUserOrganizeDao;
+import com.caimei.modules.club.entity.City;
+import com.caimei.modules.club.entity.CmUserOrganize;
+import com.caimei.modules.club.entity.Province;
+import com.caimei.modules.club.entity.Town;
+import com.caimei.modules.club.service.CmUserOrganizeService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class CmUserOrganizeServiceImpl implements CmUserOrganizeService {
+    @Autowired
+    private CmUserOrganizeDao cmUserOrganizeDao;
+
+    @Override
+    public List<CmUserOrganize> findList(CmUserOrganize cmUserOrganize) {
+        List<CmUserOrganize> userOrganizeList = cmUserOrganizeDao.findList(cmUserOrganize);
+        return userOrganizeList;
+    }
+
+    @Override
+    public Province loadProvinceById(Integer provinceID) {
+        return cmUserOrganizeDao.loadProvinceById(provinceID);
+    }
+
+    @Override
+    public City loadCityById(Integer cityID) {
+        return cmUserOrganizeDao.loadCityById(cityID);
+    }
+
+    @Override
+    public Town loadTownByID(Integer townID) {
+        return cmUserOrganizeDao.loadTownByID(townID);
+    }
+}

+ 35 - 0
src/main/java/com/caimei/modules/club/service/impl/CmUserServiceImpl.java

@@ -0,0 +1,35 @@
+package com.caimei.modules.club.service.impl;
+
+import com.caimei.modules.club.dao.CmUserDao;
+import com.caimei.modules.club.entity.CmUser;
+import com.caimei.modules.club.service.CmUserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class CmUserServiceImpl implements CmUserService {
+    @Autowired
+    private CmUserDao cmUserDao;
+
+    @Override
+    public List<CmUser> findListBuyUserInfo(CmUser cmUser) {
+        return cmUserDao.findListBuyUserInfo(cmUser);
+    }
+
+    @Override
+    public List<CmUser> findListBuyBindMobile(CmUser cmUser) {
+        return cmUserDao.findListBuyBindMobile(cmUser);
+    }
+
+    @Override
+    public void insert(CmUser cmUser) {
+        cmUserDao.insert(cmUser);
+    }
+
+    @Override
+    public void update(CmUser cmUser) {
+        cmUserDao.update(cmUser);
+    }
+}

+ 36 - 0
src/main/java/com/caimei/modules/club/service/impl/NewCmClubServiceImpl.java

@@ -0,0 +1,36 @@
+package com.caimei.modules.club.service.impl;
+
+import com.caimei.modules.club.dao.NewCmClubDao;
+import com.caimei.modules.club.entity.NewCmClub;
+import com.caimei.modules.club.service.NewCmClubService;
+import org.apache.commons.collections.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class NewCmClubServiceImpl implements NewCmClubService {
+    @Autowired
+    private NewCmClubDao newCmClubDao;
+
+    @Override
+    public NewCmClub findClubById(Integer clubID) {
+        List<NewCmClub> newCmClubs = newCmClubDao.findClubById(clubID);
+        if (CollectionUtils.isNotEmpty(newCmClubs) && newCmClubs.size() > 0) {
+            return newCmClubs.get(0);
+        } else {
+            return null;
+        }
+    }
+
+    @Override
+    public void insert(NewCmClub newCmClub) {
+        newCmClubDao.insert(newCmClub);
+    }
+
+    @Override
+    public void update(NewCmClub newCmClub) {
+        newCmClubDao.update(newCmClub);
+    }
+}

+ 9 - 0
src/main/java/com/caimei/modules/shiro/entity/CmMallAdminUser.java

@@ -8,10 +8,19 @@ public class CmMallAdminUser {
     private String account;
     private String password;
     private Integer organizeID;
+    private String salt;
     private Date addTime;
     private Date updateTime;
     private Set<Role> roles;
 
+    public String getSalt() {
+        return salt;
+    }
+
+    public void setSalt(String salt) {
+        this.salt = salt;
+    }
+
     public Integer getId() {
         return id;
     }

+ 0 - 1
src/main/java/com/caimei/modules/shiro/service/impl/ShiroServiceImpl.java

@@ -3,7 +3,6 @@ package com.caimei.modules.shiro.service.impl;
 import com.caimei.modules.shiro.dao.UserMapper;
 import com.caimei.modules.shiro.entity.CmMallAdminUser;
 import com.caimei.modules.shiro.service.ShiroService;
-import com.caimei.utils.MD5Util;
 import com.caimei.utils.TokenEncryptUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;

+ 441 - 0
src/main/java/com/caimei/utils/AppKeys.java

@@ -0,0 +1,441 @@
+package com.caimei.utils;
+
+/*import simpleWebFrame.config.AppConfig;
+ import simpleWebFrame.log.AppLogger;*/
+
+public class AppKeys {
+
+	/*
+	* TODO 检查www的AppKeys考虑是否删除www的AppKeys
+	* */
+	/**********用户模块重构************/
+	public static final Integer VISITOR_PRICE = 0; // 游客价
+	public static final Integer NORMAL_PRICE = 1; // 普通价
+	public static final Integer VIP_PRICE = 2; //会员价
+	public static final String LOGIN_PERSON = "1";//个人登录
+	public static final String LOGIN_COMPANY = "0";//企业登录
+	public static final Integer PLATFORM_WWW_H5 = 0; //WWW/H5
+	public static final Integer PLATFORM_CRM = 1; //CRM
+	public static final Integer PLATFORM_MINIPROGRAM = 2; //小程序
+
+	public static final Integer DEFAULT_SPID=1342;//设置默认创客 采美官方账号
+
+	//用户申请成为企业员工
+	public static final String AUDIT_WAIT="0";//待审核
+	public static final String AUDIT_PASS="1";//审核通过
+	public static final String AUDIT_BACK="2";//审核不通过
+
+	// 当前登录用户
+	public static final String USER_SESSION = "user";
+	// 当前查看价格用户(代理用户)  会所用户
+	public static final String AGENCY_USER_SESSION = "agencyuser";
+
+	// 收款流程用户
+	public static final String RECEIPT_USER_SESSION = "ReceiptUser";
+	// 未绑定的用户的openid
+	public static final String UNBIND_USER_OPENID = "unBindUserOpenid";
+	// 当前登录用户
+	public static final String WXUNION_SESSION = "wxUnion";
+	// 重定向URL
+	public static final String REDIRECT_URL = "redirect";
+
+	/**订单重构***/
+	public static final Integer ORDER_TYPE_NORMAL = 1;//普通订单
+	public static final Integer ORDER_TYPE_SP = 0;//协销订单
+	/****end****/
+
+	// 首页滚动图片广告组ID
+	public static final Integer HOME_BANNER_GROUPID = 1;
+	// 首页轮播图右侧广告栏位ID
+	public static final Integer HOME_PAGE_TYPE_ID = 1;
+	// 首页中部宽屏广告图ID
+	public static final Integer HOME_PAGE_IMAGE_ID = 5;
+	// 首页广告类型--商品
+	public static final Integer HOME_AD_PRODUCT = 1001;
+	// 首页广告类型--供应商
+	public static final Integer HOME_AD_SP = 1002;
+	// 自定义类型的广告楼层每次显示个数
+	public static final Integer CUSTOM_HOME_PRODUCT_SIZE = 5;
+	// 商品分类的广告楼层之商品每次显示个数
+	public static final Integer TYPE_HOME_PRODUCT_SIZE = 4;
+	// 账号中心 今日推荐 商品每次显示个数
+	public static final Integer TUIJIAN_PRODUCT_SIZE = 4;
+	// 首页大图广告图片尺寸大小
+	public static int BRAND_IMAGE = 100;
+
+	// 游离员工
+	public static final Integer USER_OF_FREE_EMPLOYEE = 0;
+	// 供应商
+	public static final Integer USER_OF_SERVICEPROVIDER = 2;
+	// 会所员工
+	public static final Integer USER_OF_CLUBEMPLOYEE = 33;
+	public static final Integer USER_OF_SUPPLIER = 1;            //供应商
+	public static final Integer USER_OF_SP = 2;                  // 服务商/创客经理
+	public static final Integer USER_OF_CLUB = 3;                // 会所
+	public static final Integer USER_OF_SP_EMPLOYEE  = 32;       // 创客
+	public static final Integer USER_OF_CLUB_EMPLOYEE = 33;      // 会所员工
+	public static final Integer USER_OF_SUPPLIER_EMPLOYEE = 34;  // 供应商员工
+
+	// 已经支付的订单
+	public static final Integer UN_PAY = 0;
+	// 已经支付的订单
+	public static final Integer HAS_PAY = 1;
+
+//	public static final Integer PAGE_SIZE = 15;
+
+//	public static final String ORDER_PRODUCT_STATUS_CANCEL = "0";
+//	public static final String ORDER_PRODUCT_STATUS_NORMAL = "1";
+
+	//创客拉取会所的各种状态
+//	public static final Integer GCLUB_STATUS_ALL = 0;
+//	public static final Integer GCLUB_STATUS_CHECKBEFORE = 1;
+//	public static final Integer GCLUB_STATUS_WAITCHECK = 2;
+//	public static final Integer GCLUB_STATUS_ONLINE = 3;
+//	public static final Integer GCLUB_STATUS_OFFLINE = 4;
+	public static final Integer GCLUB_STATUS_CHECKFAIL = 5;
+
+	//最新动态
+	public static final Integer INFORMATION_TYPE_NEWS = 1;
+
+	//图表--销售
+	public static final Integer CHART_SALES = 1;
+	//图表--会所
+	public static final Integer CHART_CLUBS = 2;
+//
+//	public static Integer ORDER_STATUS_UNPAY = 0;
+//	public static Integer ORDER_STATUS_HASPAY = 2;
+//	public static Integer ORDER_STATUS_HASFAHUO = 3;
+//	public static Integer ORDER_STATUS_HASSHOUHUO = 4;
+//	public static Integer ORDER_STATUS_FINISH = 5;
+//	public static Integer ORDER_STATUS_CLOSE = 6;
+	public static Integer ORDER_STATUS_UNCOMMENT = 7;
+	public static Integer ORDER_STATUS_UNCONFIRM = 9;
+	public static Integer ORDER_STATUS_ALL = 1;
+	public static Integer ORDER_STATUS_DEL = -1;
+	public static Integer ORDER_PAGE_SIZE = 15;
+
+	public static Integer CMORDER_PAGE_SIZE = 10;
+
+	public static final Integer USERTYPE_NORMAL = 0;
+	public static final Integer USERTYPE_SHOP = 1;
+	public static final Integer USERTYPE_SERVICEPROVIDER = 2;
+	public static final Integer USERTYPE_CLUB = 3;
+	public static final Integer USERTYPE_MASTER = 4;
+	public static final Integer USERTYPE_CLUBEMPLOYEE = 33;
+	public static final Integer USERTYPE_SERVICEEMPLOYEE = 32;
+	public static final Integer USERTYPE_SHOPEMPLOYEE = 34;
+	public static final Long EXPIRTIME_ACTIVATECODE = (long) 1800;
+	public static final String ALLBUSINESSTYPE = "businessType_all";
+	public static final Integer SERVICEPROVIDERSTATUS_UNCHECKED = 1;
+//	public static final String PRODUCTFLAG_SLOTTING = "2";
+//	public static final Integer CARTSORT_MAX = 65535;
+	public static final Integer SHOPSTATUS_UNCHECKED = 3;
+	public static final Integer USER_OF_SUPPLIEREMPLOYEE = 34;
+	public static final String ACTCODE_REGISTER = "1"; // 个人用户注册验证码
+	public static final String ACTCODE_RESET = "2"; // 个人用户找回或修改密码验证码
+	public static final String ACTCODE_ENTERPRISE_REGISTER = "3"; // 企业用户注册验证码
+	public static final String ACTCODE_ENTERPRISE_RESET = "4"; // 企业用户找回或修改密码验证码
+//	public static final String VALID = "valid";
+	/** 授权码的已使用状态 */
+	public static final String INVITECODE_STATUS_USED = "0";
+	/** 授权码的未使用状态(数据库cm_inviteCode.validFlag默认值为1) */
+	public static final String INVITECODE_STATUS_UNUSED = "1";
+	/** 授权码的注销状态 */
+	public static final String INVITECODE_STATUS_CANCELLED = "2";
+
+	 /*
+	 ************************************************************************************
+	 */
+
+
+	public static final Integer NORMAL_ITEM = 1;
+	public static final Integer GROUPBUY_ITEM = 2;
+	public static final Integer WHOLESALE_ITEM = 3;
+	public static String AJAX_RESULT = "AJAX_RESULT";
+	public static String DISPATCH_LINK = "DISPATCH_LINK";
+	public static String DEFAULT_MODUEL = "index";
+	public static final Integer PAGE_SIZE = 15;
+	
+	public static String META_KEYWORDS = "META_KEYWORDS";
+	public static String META_DESCRIPTION = "META_DESCRIPTION";
+	public static String META_TITLE = "META_TITLE";
+
+	public static String SESSION_SHOP = "SESSION_SHOP";
+	public static boolean NOT_AUTO_CONFIRM = false;
+	public static boolean AUTO_CONFIRM = true;
+	public static int COLLECTION_MAX_NUMBER = 10;
+
+	public static String SEO_TITLE = "采美365网-全新概念云端美业线上交易合作平台";
+	public static String SEO_KEYWORDS = "采美365网-全新概念云端美业线上交易合作平台";
+	public static String SEO_DESCRIPTION = "采美365网-全新概念云端美业线上交易合作平台";
+
+	public static String CURRENT_PATH = "CURRENT_PATH";
+
+	public static String LOINGED_LINK = "LOINGED_LINK";
+
+	public static int ORIGINAL_PICTURE = 0;
+
+	public static int IMAGE_SIZE_MIDDEN = 220;
+	public static int IMAGE_SIZE_LARGE = 350;
+	public static int IMAGE_SIZE_SMALL = 55;
+
+	public static int USER_IMAGE_BIG = 140;
+	public static int USER_IMAGE_SMALL = 60;
+
+	public static int GROUPBUY_IMAGE_SIZE = 450;
+	
+	//创客拉取会所的各种状态
+	public static final Integer GCLUB_STATUS_ALL = 0;
+	public static final Integer GCLUB_STATUS_CHECKBEFORE = 1;
+	public static final Integer GCLUB_STATUS_WAITCHECK = 2;
+	public static final Integer GCLUB_STATUS_ONLINE = 3;
+	public static final Integer GCLUB_STATUS_OFFLINE = 4;
+
+	public static int CLUB_LOGO_SIZE = 220;
+	public static int CLUB_BUSINESSLICENSEIMAGE_SIZE = 100;
+
+	public static int CLUB_IMAGE_SIZE = 240;
+	public static int CLUB_IMAGE_LARGER_SIZE = 400;
+
+	public static int MASTER_LOGO_SIZE = 200;
+
+	public static int SHOPCERT_IMAGE_SMALL = 66;
+
+	public static int CLUBCERT_IMAGE_SMALL = 66;
+
+	public static String UPLOAD_FILE_PATH = "";
+
+	public static String DOMAIN_WWW = "";
+	public static String DOMAIN_ADMIND = "";
+
+	public static String CURRENT_DOMAIN = "CURRENT_DOMAIN";
+
+	public static String PWD_INPUT_TIMES = "PWD_INPUT_TIMES";
+	public static int PWD_INPUT_MAX_ERROR_TIMES = 3;
+
+	public static String VIEWED_PRODUCTS = "VIEWED_PRODUCTS";
+	public static int VIEWED_PRODUCTS_MAX_NUMBER = 10;
+
+	public static String NEWCHECKRESULT = "NEWCHECKRESULT";
+	public static String NEWCHECKLIST = "NEWCHECKLIST";
+
+	public static String MOBILE_CODE_HASH = "MOBILE_CODE_HASH";
+
+	public static String EMAIL_CODE_HASH = "EMAIL_CODE_HASH";
+
+	public static int MAX_PRODUCT_IMAGE = 8;
+
+	public static float PRICE_TIDU = 2.0f; // 梯度价格
+	public static int MAX_USER_LEVEL = 5;
+	public static int MIN_USER_LEVEL = 1;
+
+	public static int ADDRESS_MAX_NUMBER = 6; // 个人地址最多保存条数
+
+	public static int COMMENT_IMAGE_BIG = 100;
+
+	public static float SYSCONFIG_SUPPLIER_AUDITAMOUNT = 1000;
+	public static float SYSCONFIG_SUPPLIER_MANAGEAMOUNT = 5000;
+	public static float SYSCONFIG_SUPPLIER_GUARANTEEAMOUNT = 20000;
+	public static float SYSCONFIG_PROVIDER_LICENSESMOUNT_NORMAL = 10000;
+	public static float SYSCONFIG_PROVIDER_LICENSESMOUNT_JINPAI = 100000;
+
+	public static int SHOP_LOGO_BIG = 320;
+	public static int SHOP_LOGO_SMALL = 160;
+
+	public static int SHOP_IMAGE = 180;
+
+	public static String PAY_TYPE_ID_YEEPAY = "1010"; // 易宝支付ID
+	public static String PAY_TYPE_ID_ALIPAY = "1001"; // 支付宝支付ID
+	public static String PAY_TYPE_ID_99BILL = "1003"; // 快钱支付ID
+	public static String PAY_TYPE_ID_CHINAPAY_NOCARD = "1002"; // 银联支付无卡
+	public static String PAY_TYPE_ID_CHINAPAY_B2B = "1004"; // 银联支付b2b
+	public static String PAY_TYPE_ID_CHINAPAY = "1005"; // 银联支付
+
+	public static String PAY_TYPE_ID_WECHAT = "1007"; // 微信支付ID
+	public static String PAY_TYPE_ID_CMBEAN = "1008";//采美豆兑换
+	public static String PAY_TYPE_ID_COOSTAGE = "1009";//库分期支付
+
+	public static int MAX_USER_TAG_NUM = 10; // 用户最多可以添加的标签数量
+
+	public static String CHINAPAY_PRIVATEKEY_PATH = "";
+	public static String CHINAPAY_PUBLICKEY_PATH = "";
+
+	public static String ERP_TEST_SHOPID = "bjhetang";
+	public static String ERP_TEST_APPKEY = "bjhetang";
+	public static String ERP_TEST_APPKEY_INITUSER = "21535866";
+	public static String ERP_TEST_APPKEY_INITUSER_PWD = "111111";
+	public static String ERP_TEST_APPSECRET = "bjhetang";
+
+	public static Integer ORDER_STATUS_UNPAY = 0;
+	// public static String ORDER_STATUS_WAITAUDIT = "1";
+	public static Integer ORDER_STATUS_HASPAY = 2;
+	public static Integer ORDER_STATUS_HASFAHUO = 3;
+	public static Integer ORDER_STATUS_HASSHOUHUO = 4;
+	public static Integer ORDER_STATUS_FINISH = 5;
+	public static Integer ORDER_STATUS_CLOSE = 6;
+
+	// public static long AUTO_CLOSE_DAY = 24 * 60 * 60 * 1000;
+	// //订单自动由未付款到交易关闭状态的默认天数
+	// public static long AUTO_REVICEGOODS_DAY = 10 * 24 * 60 * 60 * 1000;
+	// //订单由发货状态自动变更为已签收状态的默认天数
+	// public static long AUTO_FINISH_DAY = 7 * 24 * 60 * 60 * 1000;
+	// //订单由已签收状态自动变更为已完成状态的默认天数
+
+	public static long AUTO_CLOSE_DAY = 24 * 60 * 60 * 1000; // 订单自动由未付款到交易关闭状态的默认天数
+	public static long AUTO_REVICEGOODS_DAY = 15 * 24 * 60 * 60 * 1000;  // 订单由发货状态自动变更为已签收状态的默认天数
+	public static long AUTO_FINISH_DAY = 15 * 24 * 60 * 60 * 1000;       // 订单由已签收状态自动变更为已完成状态的默认天数
+	public static long AUTO_COMMENT_DAY = 30 * 24 * 60 * 60 * 1000;      // 订单由可以评价到自动评价的默认天数
+
+	public static float POINT_TO_MONEY_RATE = 0.01f;
+
+	public static String WECHAT_URL = "http://testcaimei.chinacloudapp.cn/userImg.php";
+
+	public static String BANKID_BCOM_B2B = "1035";
+
+	public static String MAX_SERVICE_LEVEL = "2";
+
+	public static String caimei_Erp = "";
+
+	public static String Mr_Chen = "99";
+	public static String Mr_Liu = "97";
+	public static String Miss_Huang = "98";
+	public static String HIDE_CLUB_LIST_TYPE = "100";
+
+	public static String WEIXIN_LOGIN_USERDATA = "WEIXIN_LOGIN_USERDATA";
+
+	public static String EMPTY_COLOR_CODE = "00";
+	public static String EMPTY_NORMS_CODE = "00Q";
+	public static String EXTENDPRODUCTTYPE_WHOLESALE = "wholesaleProductID";
+	public static String EXTENDPRODUCTTYPE_NORMAL = "normalID";
+	public static String EXTENDPRODUCTTYPE_TUIJIAN = "tuijianID";
+	public static String EXTENDPRODUCTTYPE_SPECIAL = "specialProductID";
+	public static String EXTENDPRODUCTTYPE_PROMOTION = "promotionID";
+
+	public static final String USER_SESSION_KEY = "user";
+//	public static final String WECHAT_CMBIND_SESSION_KEY = "user";
+	public static final String WECHAT_CMBIND_SESSION_KEY = "wxcmbind";//微信端有user
+	public static final String WECHAT_USER_SESSION_KEY = "wxuser";
+
+	public static final String FROM_ORDER_MASTERORDERID_KEY = "masterorderid";
+	public static final String FROM_ORDER_KEY = "fromorder";
+	public static final String FROM_ORDER_AUTO_CONFIRM_FLAG_KEY = "autoconfirmflag";
+	public static final Integer CARTSORT_MAX = 65535;
+	public static final String SYS_ERROR_MESSAGE = "systemerrormessage";
+	public static final String SUCCESS = "success";
+	public static final String PRODUCTFLAG_SLOTTING = "2";
+	public static final String VALID = "valid";
+	public static final String FLAG_NO = "0";
+
+	public static final Integer SERVICE_COMMISSION = 4; // 服务佣金
+	public static final Integer PURCHASE_COMMISSION = 5; // 采购佣金
+	public static final Integer CLUB_DT = 6; // 地推结算
+	
+	public static final String CARTTYPE_NORMAL = "0";
+	public static final String CARTTYPE_BUYNOW = "1";
+	public static final String CARTTYPE_REBUY = "2";
+	public static final String CARTTYPE_SCAN = "3";
+	public static final String CARTTYPE_INVALID = "4";
+	public static final String USERCART_NEW = "9999";
+	public static final String ORDER_PRODUCT_STATUS_CANCEL = "0";
+	public static final String ORDER_PRODUCT_STATUS_NORMAL = "1";
+
+	public static final Integer LIMIT_OF_EMPLOYEE_INVITECODE = 50; // 会所员工邀请码的限制数量
+	
+	public static final Integer LIMIT_OF_MEIDAO_INVITECODE = 5000; // 服务商员工(美导)邀请码的限制数量
+	
+	
+
+	public static final String REDIRECT_LOGIN = "login";
+	/*
+	 * static { DOMAIN_WWW = AppConfig.getInstance().getParameterConfig()
+	 * .getParameter("wwwDomain"); DOMAIN_ADMIND =
+	 * AppConfig.getInstance().getParameterConfig()
+	 * .getParameter("adminDomain"); caimei_Erp =
+	 * AppConfig.getInstance().getParameterConfig() .getParameter("caimei_Erp");
+	 * }
+	 * 
+	 * public static final Integer USER_OF_SP = 2; // 服务商 public static final
+	 * Integer USER_OF_XIAOSHOU = 31;// 销售 public static final Integer
+	 * USER_OF_MEIDAO = 32; // 美导
+	 * 
+	 * public static final Integer SERVICE_COMMISSION = 4; // 服务佣金 public static
+	 * final Integer PURCHASE_COMMISSION = 5; // 采购佣金 public static final
+	 * Integer CLUB_DT = 6; // 地推结算 /* static { DOMAIN_WWW =
+	 * AppConfig.getInstance().getParameterConfig() .getParameter("wwwDomain");
+	 * DOMAIN_ADMIND = AppConfig.getInstance().getParameterConfig()
+	 * .getParameter("adminDomain"); caimei_Erp =
+	 * AppConfig.getInstance().getParameterConfig() .getParameter("caimei_Erp");
+	 * }
+	 * 
+	 * static void setUploadFilePath(String path) { UPLOAD_FILE_PATH = path; }
+	 * 
+	 * static void setSysConfig(Hashtable<String, String> sysConfigHash) {
+	 * 
+	 * try { SYSCONFIG_SUPPLIER_AUDITAMOUNT =
+	 * Float.parseFloat(sysConfigHash.get("supplier_auditAmount"));
+	 * SYSCONFIG_SUPPLIER_MANAGEAMOUNT =
+	 * Float.parseFloat(sysConfigHash.get("supplier_manageAmount"));
+	 * SYSCONFIG_SUPPLIER_GUARANTEEAMOUNT =
+	 * Float.parseFloat(sysConfigHash.get("supplier_guaranteeAmount"));
+	 * SYSCONFIG_PROVIDER_LICENSESMOUNT_NORMAL =
+	 * Float.parseFloat(sysConfigHash.get
+	 * ("serviceProvider_licenseAmount_normal"));
+	 * SYSCONFIG_PROVIDER_LICENSESMOUNT_JINPAI =
+	 * Float.parseFloat(sysConfigHash.get
+	 * ("serviceProvider_licenseAmount_jinapai"));
+	 * 
+	 * } catch (Exception e) {
+	 * AppLogger.getInstance().errorLog("初始化系统参数错误,系统暂时获取默认设置参数"); } }
+	 * 
+	 * static void setChinapayPublicKeyPath(String path) {
+	 * CHINAPAY_PUBLICKEY_PATH = path; }
+	 * 
+	 * static void setChinapayPrivateKeyPath(String path) {
+	 * CHINAPAY_PRIVATEKEY_PATH = path; }
+	 */
+	public static String CART = "CART";
+	public static String ORDER = "ORDER";
+	public static String AUTO_CART = "AUTO_CART"; // 立即购买的购物车
+	public static String AUTO_ORDER = "AUTO_ORDER"; // 立即购物的订单
+	public static String REBUY_CART = "REBUY_CART"; // 再次购买的购物车
+	public static String REBUY_ORDER = "REBUY_ORDER"; // 再次购买的订单
+	public static String WHOLESALEPRODUCT = "WHOLESALEPRODUCT";
+
+
+	public static final String USERCART_NORMAL = "userCart_Normal";
+	public static final String USERCART_BUYNOW = "userCart_BuyNow";
+	public static final String USERCART_REBUY = "userCart_Rebuy";
+	public static final String USERCART_SCAN = "userCart_scan";
+	public static final String USETCART_INVALID = "userCart_Invalid";
+
+	public static final Integer CLUB_TYPE_NORMAL = 1;
+	public static final String FLAG_YES = "1";
+	public static final Integer CLUB_STATUS_UNCHECKED = 1;
+	public static final Integer CLUB_STATUS_CHECKFAILED = 92;
+	public static final String REGSTATUS_UNCHECKED = "2";
+	public static final Integer HONGBAO_AOMOUNT_INVITE_CLUB = 1000;
+	@Deprecated
+	public static final Integer USER_OF_NORMAL = 0;
+	public static final Integer SCANTYPE_PROMOCODESCAN = 4;
+	
+	// 自动跳转的链接
+	public static final String SOURCE_URL = "sourceURL";
+	// 跳转信息
+	public static final String REDIRECT_INFO = "redirectInfo";
+	// wxUnion信息
+	public static final String WX_UNION = "wxUnion";
+	// unionid
+	public static final String UNIONID = "unionid";
+	// serviceProviderLevel
+	public static final String SERVICE_PROVIDER_LEVEL = "serviceProviderLevel";
+	//平台信息 0 pc端/h5端
+	public static final Integer PC_OR_H5_PLATFORM = 0;
+	// 1 crm端
+	public static final Integer WX_PLATFORM = 1;
+
+	/*
+	 ************************************************************************************
+	 */
+
+
+}

+ 99 - 0
src/main/java/com/caimei/utils/DateTimeUtil.java

@@ -0,0 +1,99 @@
+/**  
+ * Project Name:caiMeiCRM  
+ * File Name:DateTimeUtil.java  
+ * Package Name:com.caimei.web.utils  
+ * Date:2015-1-4下午3:40:45  
+ * Copyright (c) 2015, 1722948843@qq.com.com All Rights Reserved.  
+ *  
+ */
+
+package com.caimei.utils;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+
+/**
+ * ClassName:DateTimeUtil <br/>
+ * Function: TODO ADD FUNCTION. <br/>
+ * Reason: TODO ADD REASON. <br/>
+ * Date: 2015-1-4 下午3:40:45 <br/>
+ * 
+ * @author 822
+ * @version
+ * @since JDK 1.6
+ * @see
+ */
+public class DateTimeUtil {
+	// TODO 与WWW的DateTimeUtil是重复的,后续需要删除www的DateTimeUtil
+	
+	/** 30分钟(毫秒) */
+	public static Long HALF_AN_HOUR = 30 * 60 * 1000L;
+
+	public static String getCurrentDate() {
+		return getFormattedDate("yyyy-MM-dd");
+	}
+
+	public static String getCurrentDateTime() {
+		return getFormattedDate("yyyy-MM-dd HH:mm:ss");
+	}
+
+	private static String getFormattedDate(String s) {
+		SimpleDateFormat simpledateformat = new SimpleDateFormat();
+		simpledateformat.applyPattern(s);
+		return simpledateformat.format(Calendar.getInstance().getTime());
+	}
+
+	public static String getFormattedDate(Date date) {
+		SimpleDateFormat simpledateformat = new SimpleDateFormat();
+		simpledateformat.applyPattern("yyyy-MM-dd HH:mm:ss");
+		return simpledateformat.format(date);
+	}
+
+	public static String makeDateString(String s, String s1, String s2) {
+		return s + "-" + ((s1.length() != 1) ? "" : "0") + s1 + "-"
+				+ ((s2.length() != 1) ? "" : "0") + s2;
+	}
+
+	public static boolean isBetweenTime(Long startTimeMills, Long endTimeMills) {
+		if (Calendar.getInstance().getTimeInMillis() > startTimeMills
+				&& Calendar.getInstance().getTimeInMillis() < endTimeMills)
+			return true;
+		return false;
+	}
+
+	public static Date parseString2Date(String dateString)
+			throws ParseException {
+		SimpleDateFormat simpledateformat = new SimpleDateFormat();
+		simpledateformat.applyPattern("yyyy-MM-dd HH:mm:ss");
+		return simpledateformat.parse(dateString);
+	}
+
+	public static boolean isBetweenTime(String startTime, String endTime)
+			throws ParseException {
+		Calendar calendar = Calendar.getInstance();
+		calendar.setTime(parseString2Date(startTime));
+		long startTimeMillis = calendar.getTimeInMillis();
+		calendar.setTime(parseString2Date(endTime));
+		long endTimeMillis = calendar.getTimeInMillis();
+		return isBetweenTime(startTimeMillis, endTimeMillis);
+	}
+
+	public static Date getDateByAddHour(Date date, int hours) {
+		Calendar c = Calendar.getInstance();
+		c.setTime(date);
+		c.add(Calendar.HOUR, hours);
+		return c.getTime();
+	}
+
+	public static boolean isBetweenTime(Date beginTime, Date endTime) {
+		Calendar calendar = Calendar.getInstance();
+		calendar.setTime(beginTime);
+		long startTimeMillis = calendar.getTimeInMillis();
+		calendar.setTime(endTime);
+		long endTimeMillis = calendar.getTimeInMillis();
+		return isBetweenTime(startTimeMillis, endTimeMillis);
+	}
+	
+}

+ 754 - 0
src/main/java/com/caimei/utils/DateUtils.java

@@ -0,0 +1,754 @@
+package com.caimei.utils;
+
+import org.apache.commons.lang3.time.DateFormatUtils;
+
+import java.sql.Timestamp;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+
+/**
+ * 日期工具类, 继承org.apache.commons.lang3.time.DateUtils类
+ * @author LG
+ * @date  2016年3月22日
+ * @version 1.0
+ */
+public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
+
+
+	//fixme lwt  已经与www的 DateUtils 整合
+	/**
+	 * 英文简写(默认)如:2010-12-01
+	 */
+	public static String FORMAT_SHORT = "yyyy-MM-dd";
+	
+	/**
+	 * 得到当前日期字符串 格式(yyyy-MM-dd)
+	 */
+	public static String getDate() {
+		return getDate("yyyy-MM-dd");
+	}
+
+	private static String[] parsePatterns = {
+			"yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
+			"yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
+			"yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"};
+
+	/**
+	 * 得到当前日期字符串 格式(yyyy-MM-dd) pattern可以为:"yyyy-MM-dd" "HH:mm:ss" "E"
+	 */
+	public static String getDate(String pattern) {
+		return DateFormatUtils.format(new Date(), pattern);
+	}
+	
+	/**
+	 * 得到日期字符串 默认格式(yyyy-MM-dd) pattern可以为:"yyyy-MM-dd" "HH:mm:ss" "E"
+	 */
+	public static String formatDate(Date date, Object... pattern) {
+		String formatDate = null;
+		if (pattern != null && pattern.length > 0) {
+			formatDate = DateFormatUtils.format(date, pattern[0].toString());
+		} else {
+			formatDate = DateFormatUtils.format(date, "yyyy-MM-dd");
+		}
+		return formatDate;
+	}
+	
+	/**
+	 * 得到日期时间字符串,转换格式(yyyy-MM-dd HH:mm:ss)
+	 */
+	public static String formatDateTime(Date date) {
+		return formatDate(date, "yyyy-MM-dd HH:mm:ss");
+	}
+
+	/**
+	 * 得到当前时间字符串 格式(HH:mm:ss)
+	 */
+	public static String getTime() {
+		return formatDate(new Date(), "HH:mm:ss");
+	}
+
+	/**
+	 * 得到当前日期和时间字符串 格式(yyyy-MM-dd HH:mm:ss)
+	 */
+	public static String getDateTime() {
+		return formatDate(new Date(), "yyyy-MM-dd HH:mm:ss");
+	}
+
+	/**
+	 * 得到当前年份字符串 格式(yyyy)
+	 */
+	public static String getYear() {
+		return formatDate(new Date(), "yyyy");
+	}
+
+	/**
+	 * 得到当前月份字符串 格式(MM)
+	 */
+	public static String getMonth() {
+		return formatDate(new Date(), "MM");
+	}
+
+	/**
+	 * 得到当天字符串 格式(dd)
+	 */
+	public static String getDay() {
+		return formatDate(new Date(), "dd");
+	}
+
+	/**
+	 * 得到当前星期字符串 格式(E)星期几
+	 */
+	public static String getWeek() {
+		return formatDate(new Date(), "E");
+	}
+	
+	/**
+	 * 日期型字符串转化为日期 格式
+	 * { "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", 
+	 *   "yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm",
+	 *   "yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm" }
+	 */
+	public static Date parseDate(Object str) {
+		if (str == null){
+			return null;
+		}
+		try {
+			return parseDate(str.toString(), parsePatterns);
+		} catch (ParseException e) {
+			return null;
+		}
+	}
+
+	/**
+	 * 获取过去的天数
+	 * @param date
+	 * @return
+	 */
+	public static long pastDays(Date date) {
+		long t = new Date().getTime()-date.getTime();
+		return t/(24*60*60*1000);
+	}
+
+	/**
+	 * 获取过去的小时
+	 * @param date
+	 * @return
+	 */
+	public static long pastHour(Date date) {
+		long t = new Date().getTime()-date.getTime();
+		return t/(60*60*1000);
+	}
+	
+	/**
+	 * 获取过去的分钟
+	 * @param date
+	 * @return
+	 */
+	public static long pastMinutes(Date date) {
+		long t = new Date().getTime()-date.getTime();
+		return t/(60*1000);
+	}
+	
+	/**
+	 * 转换为时间(天,时:分:秒.毫秒)
+	 * @param timeMillis
+	 * @return
+	 */
+    public static String formatDateTime(long timeMillis){
+		long day = timeMillis/(24*60*60*1000);
+		long hour = (timeMillis/(60*60*1000)-day*24);
+		long min = ((timeMillis/(60*1000))-day*24*60-hour*60);
+		long s = (timeMillis/1000-day*24*60*60-hour*60*60-min*60);
+		long sss = (timeMillis-day*24*60*60*1000-hour*60*60*1000-min*60*1000-s*1000);
+		return (day>0?day+",":"")+hour+":"+min+":"+s+"."+sss;
+    }
+	
+	/**
+	 * 获取两个日期之间的天数
+	 * 
+	 * @param before
+	 * @param after
+	 * @return
+	 */
+	public static double getDistanceOfTwoDate(Date before, Date after) {
+		long beforeTime = before.getTime();
+		long afterTime = after.getTime();
+		return (afterTime - beforeTime) / (1000 * 60 * 60 * 24);
+	}
+
+	/**
+	 * 获取某个月的天数
+	 * @param date
+	 * @return
+	 */
+	public static int getDaysOfMonth(Date date) {
+		Calendar calendar = Calendar.getInstance();
+		calendar.setTime(date);
+		return calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
+	}
+
+	/**
+	 * 在日期上增加天数
+	 *
+	 * @param date
+	 *            日期
+	 * @param n
+	 *            要增加的天数
+	 * @return
+	 */
+	public static Date addDay(Date date, int n) {
+		Calendar cal = Calendar.getInstance();
+		cal.setTime(date);
+		cal.add(Calendar.DATE, n);
+		return cal.getTime();
+	}
+
+	/**
+	 * @param args
+	 * @throws ParseException
+	 */
+//	public static void main(String[] args) throws ParseException {
+//		System.out.println(formatDate(parseDate("2010/3/6")));
+//		System.out.println(getDate("yyyy年MM月dd日 E"));
+//		long time = new Date().getTime()-parseDate("2012-11-19").getTime();
+//		System.out.println(time/(24*60*60*1000));
+//	}
+
+	/**
+	 * 英文全称 如:2010-12-01 23:15:06
+	 */
+	public static String FORMAT_LONG = "yyyy-MM-dd HH:mm:ss";
+	/**
+	 * 精确到毫秒的完整时间 如:yyyy-MM-dd HH:mm:ss.S
+	 */
+	public static String FORMAT_FULL = "yyyy-MM-dd HH:mm:ss.S";
+	/**
+	 * 中文简写 如:2010年12月01日
+	 */
+	public static String FORMAT_SHORT_CN = "yyyy年MM月dd";
+	/**
+	 * 中文全称 如:2010年12月01日 23时15分06秒
+	 */
+	public static String FORMAT_LONG_CN = "yyyy年MM月dd日  HH时mm分ss秒";
+	/**
+	 * 精确到毫秒的完整中文时间
+	 */
+	public static String FORMAT_FULL_CN = "yyyy年MM月dd日  HH时mm分ss秒SSS毫秒";
+
+	/**
+	 * 获得默认的 date pattern
+	 */
+	public static String getDatePattern() {
+		return FORMAT_LONG;
+	}
+
+	/**
+	 * 根据预设格式返回当前日期
+	 *
+	 * @return
+	 */
+	public static String getNow() {
+		return format(new Date());
+	}
+
+	/**
+	 * 根据用户格式返回当前日期
+	 *
+	 * @param format
+	 * @return
+	 */
+	public static String getNow(String format) {
+		return format(new Date(), format);
+	}
+
+	/**
+	 * 使用预设格式格式化日期
+	 *
+	 * @param date
+	 * @return
+	 */
+	public static String format(Date date) {
+		return format(date, getDatePattern());
+	}
+
+	/**
+	 * 使用用户格式格式化日期
+	 *
+	 * @param date
+	 *            日期
+	 * @param pattern
+	 *            日期格式
+	 * @return
+	 */
+	public static String format(Date date, String pattern) {
+		String returnValue = "";
+		if (date != null) {
+			SimpleDateFormat df = new SimpleDateFormat(pattern);
+			returnValue = df.format(date);
+		}
+		return (returnValue);
+	}
+
+	/**
+	 * 使用预设格式提取字符串日期
+	 *
+	 * @param strDate
+	 *            日期字符串
+	 * @return
+	 */
+	public static Date parse(String strDate) {
+		return parse(strDate, getDatePattern());
+	}
+
+	/**
+	 * 使用用户格式提取字符串日期
+	 *
+	 * @param strDate
+	 *            日期字符串
+	 * @param pattern
+	 *            日期格式
+	 * @return
+	 */
+	public static Date parse(String strDate, String pattern) {
+		SimpleDateFormat df = new SimpleDateFormat(pattern);
+		try {
+			return df.parse(strDate);
+		} catch (ParseException e) {
+			e.printStackTrace();
+			return null;
+		}
+	}
+
+	/**
+	 * 在日期上增加数个整月
+	 *
+	 * @param date
+	 *            日期
+	 * @param n
+	 *            要增加的月数
+	 * @return
+	 */
+	public static Date addMonth(Date date, int n) {
+		Calendar cal = Calendar.getInstance();
+		cal.setTime(date);
+		cal.add(Calendar.MONTH, n);
+		return cal.getTime();
+	}
+
+	/**
+	 * 在日期上增加描述
+	 *
+	 * @param date
+	 *            日期
+	 * @param n
+	 *            要增加的天数
+	 * @return
+	 */
+	public static Date addSecond(Date date, int n) {
+		Calendar cal = Calendar.getInstance();
+		cal.setTime(date);
+		cal.add(Calendar.SECOND, n);
+		return cal.getTime();
+	}
+
+	/**
+	 * 获取时间戳
+	 */
+	public static String getTimeString() {
+		SimpleDateFormat df = new SimpleDateFormat(FORMAT_FULL);
+		Calendar calendar = Calendar.getInstance();
+		return df.format(calendar.getTime());
+	}
+
+	/**
+	 * 获取日期年份
+	 *
+	 * @param date
+	 *            日期
+	 * @return
+	 */
+	public static String getYear(Date date) {
+		return format(date).substring(0, 4);
+	}
+
+	/**
+	 * 按默认格式的字符串距离今天的天数
+	 *
+	 * @param date
+	 *            日期字符串
+	 * @return
+	 */
+	public static int countDays(String date) {
+		long t = Calendar.getInstance().getTime().getTime();
+		Calendar c = Calendar.getInstance();
+		c.setTime(parse(date));
+		long t1 = c.getTime().getTime();
+		return (int) (t / 1000 - t1 / 1000) / 3600 / 24;
+	}
+
+	/**
+	 * 按用户格式字符串距离今天的天数(超过24小时才可以使用)
+	 *
+	 * @param date
+	 *            日期字符串
+	 * @param format
+	 *            日期格式
+	 * @return
+	 */
+	public static int countDays(String date, String format) {
+		long t = Calendar.getInstance().getTime().getTime();
+		Calendar c = Calendar.getInstance();
+		c.setTime(parse(date, format));
+		long t1 = c.getTime().getTime();
+		return (int) (t / 1000 - t1 / 1000) / 3600 / 24;
+	}
+
+	public static String firstDayOfMonth(Date date){
+		Calendar calendar = Calendar.getInstance();
+		calendar.setTime(date);
+		calendar.set(Calendar.DAY_OF_MONTH, calendar
+				.getActualMinimum(Calendar.DAY_OF_MONTH));
+		calendar.set(Calendar.HOUR_OF_DAY, 0);
+		calendar.set(Calendar.SECOND,0);
+		calendar.set(Calendar.MINUTE,0);
+		return DateUtils.format(calendar.getTime());
+	}
+
+	public static String lastDayOfMonth(Date date){
+		Calendar calendar = Calendar.getInstance();
+		calendar.setTime(date);
+		calendar.set(Calendar.DAY_OF_MONTH, calendar
+				.getActualMaximum(Calendar.DAY_OF_MONTH));
+		calendar.set(Calendar.HOUR_OF_DAY, 23);
+		calendar.set(Calendar.SECOND,59);
+		calendar.set(Calendar.MINUTE,59);
+		return DateUtils.format(calendar.getTime());
+	}
+
+	public static int currentMonth(){
+		Calendar calendar = Calendar.getInstance();
+		return calendar.get(Calendar.MONTH)+1;
+	}
+
+	public static int currentYear(){
+		Calendar calendar = Calendar.getInstance();
+		return calendar.get(Calendar.YEAR);
+	}
+
+	public static int currentMonthLastDay(){
+		Calendar calendar = Calendar.getInstance();
+		calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
+		return calendar.get(Calendar.DAY_OF_MONTH);
+	}
+
+	public static int LastDayOfMonth(Date date){
+		Calendar calendar = Calendar.getInstance();
+		calendar.setTime(date);
+		calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
+		return calendar.get(Calendar.DAY_OF_MONTH);
+	}
+
+	public static int getDay4Date(Date date){
+		Calendar calendar = Calendar.getInstance();
+		calendar.setTime(date);
+		return calendar.get(Calendar.DAY_OF_MONTH);
+	}
+
+	public static boolean afterNow(Date date){
+		return new Date().before(date);
+	}
+
+	/**
+	 *
+	 * @param agrs
+	 * @throws ParseException
+	 */
+	public static void main(String[] agrs) throws ParseException {
+		//System.out.println(DateUtils.format(DateUtils.parse("2015-5-19 10:49:29"), "yyyy年MM月"));
+		System.out.println(DateUtils.firstDayOfMonth(parse("2015-02-01",FORMAT_SHORT)));
+		System.out.println(DateUtils.lastDayOfMonth(parse("2015-02-01",FORMAT_SHORT)));
+		System.out.println(currentYear());
+		System.out.println(currentMonthLastDay());
+	}
+
+	// 获取上周的开始时间
+	@SuppressWarnings("unused")
+	public static Date getBeginDayOfLastWeek() {
+		Date date = new Date();
+		if (date == null) {
+			return null;
+		}
+		Calendar cal = Calendar.getInstance();
+		cal.setTime(date);
+		int dayofweek = cal.get(Calendar.DAY_OF_WEEK);
+		if (dayofweek == 1) {
+			dayofweek += 7;
+		}
+		cal.add(Calendar.DATE, 2 - dayofweek - 7);
+		return getDayStartTime(cal.getTime());
+	}
+
+	// 获取上周的结束时间
+	public static Date getEndDayOfLastWeek() {
+		Calendar cal = Calendar.getInstance();
+		cal.setTime(getBeginDayOfLastWeek());
+		cal.add(Calendar.DAY_OF_WEEK, 6);
+		Date weekEndSta = cal.getTime();
+		return getDayEndTime(weekEndSta);
+	}
+
+	// 获取某个日期的开始时间
+	public static Timestamp getDayStartTime(Date d) {
+		Calendar calendar = Calendar.getInstance();
+		if (null != d)
+			calendar.setTime(d);
+		calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH),
+				calendar.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
+		calendar.set(Calendar.MILLISECOND, 0);
+		return new Timestamp(calendar.getTimeInMillis());
+	}
+
+	// 获取某个日期的结束时间
+	public static Timestamp getDayEndTime(Date d) {
+		Calendar calendar = Calendar.getInstance();
+		if (null != d)
+			calendar.setTime(d);
+		calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH),
+				calendar.get(Calendar.DAY_OF_MONTH), 23, 59, 59);
+		calendar.set(Calendar.MILLISECOND, 999);
+		return new Timestamp(calendar.getTimeInMillis());
+	}
+
+	// 获取上月的开始时间
+	public static Date getBeginDayOfLastMonth() {
+		Calendar calendar = Calendar.getInstance();
+		calendar.set(getNowYear(), getNowMonth() - 2, 1);
+		return getDayStartTime(calendar.getTime());
+	}
+
+	// 获取上月的结束时间
+	public static Date getEndDayOfLastMonth() {
+		Calendar calendar = Calendar.getInstance();
+		calendar.set(getNowYear(), getNowMonth() - 2, 1);
+		int day = calendar.getActualMaximum(5);
+		calendar.set(getNowYear(), getNowMonth() - 2, day);
+		return getDayEndTime(calendar.getTime());
+	}
+
+	// 获取今年是哪一年
+	public static Integer getNowYear() {
+		Date date = new Date();
+		GregorianCalendar gc = (GregorianCalendar) Calendar.getInstance();
+		gc.setTime(date);
+		return Integer.valueOf(gc.get(1));
+	}
+
+	// 获取本月是哪一月
+	public static int getNowMonth() {
+		Date date = new Date();
+		GregorianCalendar gc = (GregorianCalendar) Calendar.getInstance();
+		gc.setTime(date);
+		return gc.get(2) + 1;
+	}
+
+	// 获取昨天的开始时间
+	public static Date getBeginDayOfYesterday() {
+		Calendar cal = new GregorianCalendar();
+		cal.setTime(getDayBegin());
+		cal.add(Calendar.DAY_OF_MONTH, -1);
+		return cal.getTime();
+	}
+
+	// 获取昨天的结束时间
+	public static Date getEndDayOfYesterDay() {
+		Calendar cal = new GregorianCalendar();
+		cal.setTime(getDayEnd());
+		cal.add(Calendar.DAY_OF_MONTH, -1);
+		return cal.getTime();
+	}
+
+	// 获取当天的开始时间
+	public static Date getDayBegin() {
+		Calendar cal = new GregorianCalendar();
+		cal.set(Calendar.HOUR_OF_DAY, 0);
+		cal.set(Calendar.MINUTE, 0);
+		cal.set(Calendar.SECOND, 0);
+		cal.set(Calendar.MILLISECOND, 0);
+		return cal.getTime();
+	}
+
+	// 获取当天的结束时间
+	public static Date getDayEnd() {
+		Calendar cal = new GregorianCalendar();
+		cal.set(Calendar.HOUR_OF_DAY, 23);
+		cal.set(Calendar.MINUTE, 59);
+		cal.set(Calendar.SECOND, 59);
+		return cal.getTime();
+	}
+
+	/**
+	 * @Author ye.qin
+	 * @Description //TODO 返回两个时间字符串的时间差(秒)
+	 * @Date 2018\12\29 0029 15:56
+	 * @Param
+	 * @return
+	 */
+	public static int betweenDate(String endTime,String startTime,String YMDHMS){
+		Date time1 = DateUtils.parse(endTime,YMDHMS);
+		Date time2 = DateUtils.parse(startTime,YMDHMS);
+		int a = (int) (time1.getTime() / 1000);
+		int b = (int) (time2.getTime() / 1000);
+		System.out.print(a-b);
+		return a-b;
+	}
+
+	/**
+	 * @Author ye.qin
+	 * @Description //TODO 获取指定格式的时间
+	 * @Date 2018\12\29 0029 16:26
+	 * @Param 
+	 * @return 
+	 */
+	public static String getTargetTime(String time,String YMDHMS,String targetFormat){
+		Date a = parse(time,YMDHMS);
+		String b = format(a,targetFormat);
+		return b;
+	}
+
+    /**
+     * date2比date1多的天数
+     * @param date
+     * @return
+     */
+    public static int differentDays(String date)
+    {
+        Calendar cal1 = Calendar.getInstance();
+        cal1.setTime(parseDate(date));
+
+        Calendar cal2 = Calendar.getInstance();
+        cal2.setTime(new Date());
+        int day1= cal1.get(Calendar.DAY_OF_YEAR);
+        int day2 = cal2.get(Calendar.DAY_OF_YEAR);
+
+        int year1 = cal1.get(Calendar.YEAR);
+        int year2 = cal2.get(Calendar.YEAR);
+        if(year1 != year2)
+        {
+            int timeDistance = 0 ;
+            for(int i = year1 ; i < year2 ; i ++)
+            {
+                if(i%4==0 && i%100!=0 || i%400==0)    //闰年
+                {
+                    timeDistance += 366;
+                }
+                else    //不是闰年
+                {
+                    timeDistance += 365;
+                }
+            }
+
+            return timeDistance + (day2-day1) ;
+        }
+        else
+        {
+            return day2-day1;
+        }
+    }
+
+	/**
+	 * @Author ye.qin
+	 * @Description //TODO 格式化文章时间
+	 * @Date 2019\1\14 0014 15:48
+	 * @Param 
+	 * @return 
+	 */
+	public static String getArticleTime(String deployTime, String YMDHMS) {
+		final String TARGETTIME = "yyyy年MM月dd日";
+		final String HOURMINUTE = "HH:mm";
+		String time1 = "";
+		String currentTime = DateUtils.format(new Date(),YMDHMS);
+		int minuteFlag = DateUtils.betweenDate(currentTime,deployTime,YMDHMS);
+		int dayFlag = DateUtils.differentDays(deployTime);
+		if(minuteFlag > 0){
+			if(minuteFlag < 3*60){
+				time1 = "刚刚";
+			}else if(minuteFlag < 5*60){
+				time1= "3分钟前";
+			}else if(minuteFlag < 10*60){
+				time1 = "5分钟前";
+			}else if(minuteFlag < 20*60){
+				time1 = "10分钟前";
+			}else if(minuteFlag < 30*60){
+				time1 = "20分钟前";
+			}else if(minuteFlag < 60*60){
+				time1 = "30分钟前";
+			}else if(dayFlag == 0){
+				time1 = "今天 "+DateUtils.getTargetTime(deployTime,YMDHMS,HOURMINUTE);
+			}else if(dayFlag == 1){
+				time1 = "昨天 "+DateUtils.getTargetTime(deployTime,YMDHMS,HOURMINUTE);
+			}else{
+				time1 = DateUtils.getTargetTime(deployTime,YMDHMS,TARGETTIME);
+			}
+
+		}
+		return time1;
+	}
+
+	public static String getDatePoor(Date endDate, Date nowDate) {
+
+		long nd = 1000 * 24 * 60 * 60;
+		long nh = 1000 * 60 * 60;
+		long nm = 1000 * 60;
+		// long ns = 1000;
+		// 获得两个时间的毫秒时间差异
+		long diff = endDate.getTime() - nowDate.getTime();
+		// 计算差多少天
+		long day = diff / nd;
+		// 计算差多少小时
+		long hour = diff % nd / nh;
+		// 计算差多少分钟
+		long min = diff % nd % nh / nm;
+		// 计算差多少秒//输出结果
+		// long sec = diff % nd % nh % nm / ns;
+		return day + "天" + hour + "小时" + min + "分钟";
+	}
+
+	public static String getHourPoor(Date endDate, Date nowDate) {
+
+
+		long nh = 1000 * 60 * 60;
+		long nm = 1000 * 60;
+		// long ns = 1000;
+		// 获得两个时间的毫秒时间差异
+		long diff = endDate.getTime() - nowDate.getTime();
+
+		// 计算差多少小时
+		long hour = diff  / nh;
+		// 计算差多少分钟
+		long min = diff  % nh / nm;
+		// 计算差多少秒//输出结果
+		// long sec = diff % nd % nh % nm / ns;
+		return  hour + "小时" + min + "分钟";
+	}
+
+	public static String getGroupEndTime(Date endTime,String YMDHMS) {
+		final String HOURMINUTE = "HH:mm";
+		String time = formatDate(endTime,YMDHMS);
+		String time1 = "";
+		String currentTime = DateUtils.format(new Date(),YMDHMS);
+		int minuteFlag = DateUtils.betweenDate(time,currentTime,YMDHMS);
+		int dayFlag = DateUtils.differentDays(time);
+		if(minuteFlag > 0){
+
+			if(minuteFlag < 60*60*24*3){
+				time1 = getHourPoor(endTime,new Date());
+			}else{
+				time1 = "剩余"+(-dayFlag)+"天";
+			}
+		}
+		return time1;
+	}
+}

+ 100 - 0
src/main/java/com/caimei/utils/RandomCodeGenerator.java

@@ -0,0 +1,100 @@
+package com.caimei.utils;
+
+import org.apache.commons.lang3.RandomStringUtils;
+
+import java.util.Random;
+
+public class RandomCodeGenerator {
+
+	// TODO 与WWW的RandomCodeGenerator是重复的,后续需要删除www的RandomCodeGenerator
+	private static char codeSequence[] = {
+			'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', 
+			'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 
+			'W', 'X', 'Y', 'Z', '2', '3', '4', '5', '6', '7', 
+			'8', '9'
+		};
+	
+	private static char intSequence[] = {
+		'2', '3', '4', '5', '6', '7', 
+		'8', '9'
+	};
+	
+	private static char stringSequence[] = {
+		'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', 
+		'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 
+		'W', 'X', 'Y', 'Z'
+	};
+
+	private static char newStringSequence[] = {
+			'A','a', 'B','b', 'D','d', 'E' ,'e', 'F','f', 'G','g', 'H','h',
+			'L', 'N','n', 'Q','q', 'R','r', 'T','t', 'Y','y'
+	};
+//	C,i,j,k,M,O,P,S,U,V,W,X,Z,l
+
+	public static String generateCode(int length) {
+		StringBuffer sb = new StringBuffer();
+		Random random = new Random();
+		for (int i = 0; i < codeSequence.length && i < length; ++i) {
+			sb.append(codeSequence[random.nextInt(codeSequence.length)]);
+		}
+		
+		return sb.toString();
+	}
+	
+	public static String generateCodeInt(int length) {
+		StringBuffer sb = new StringBuffer();
+		Random random = new Random();
+		for (int i = 0; i < intSequence.length && i < length; ++i) {
+			sb.append(intSequence[random.nextInt(intSequence.length)]);
+		}
+		
+		return sb.toString();
+	}
+	
+	public static String generateCodeString(int length) {
+		StringBuffer sb = new StringBuffer();
+		Random random = new Random();
+		for (int i = 0; i < stringSequence.length && i < length; ++i) {
+			sb.append(stringSequence[random.nextInt(stringSequence.length)]);
+		}
+		
+		return sb.toString();
+	}
+	
+	/**
+	 * 随机生成指定位数字母与数字组成的字符串
+	 * @param length 长度
+	 * @return
+	 */
+	public static String generateRandomCode(int length) {
+		// 允许字母与数字的字符串
+		return RandomStringUtils.random(length, true, true);
+	}
+
+	public static String getRandomCharAndNumr(int length) {
+		String val = "";
+		Random random = new Random();
+		for (int i = 0; i < length; i++) {
+			// 输出字母还是数字
+			String charOrNum = random.nextInt(2) % 2 == 0 ? "char" : "num";
+			// 字符串
+			if ("char".equalsIgnoreCase(charOrNum)) {
+				// 取得大写字母还是小写字母
+				int choice = random.nextInt(2) % 2 == 0 ? 65 : 97;
+				val += (char) (choice + random.nextInt(26));
+			} else if ("num".equalsIgnoreCase(charOrNum)) { // 数字
+				val += String.valueOf(random.nextInt(10));
+			}
+		}
+		return val;
+	}
+
+	public static String generateAccount(int length){
+		StringBuffer sb = new StringBuffer();
+		Random random = new Random();
+		for (int i = 0; i < newStringSequence.length && i < length; ++i) {
+			sb.append(newStringSequence[random.nextInt(newStringSequence.length)]);
+		}
+		return sb.toString();
+	}
+}

+ 21 - 0
src/main/java/com/caimei/utils/SMSUtils.java

@@ -0,0 +1,21 @@
+package com.caimei.utils;
+
+import com.ruanwei.interfacej.SmsClientSend;
+
+public class SMSUtils {
+	private static String url = "http://47.96.109.82:9999/sms.aspx";
+	private static String userid = "321";
+	private static String account = "0755cmxx";
+	private static String password = "CaimeiSMS999";
+	
+	public static boolean sendSms(String mobile, String content){
+		String res = SmsClientSend.sendSms(url, userid, account, password, mobile, content);
+		return res.indexOf("Success") != -1;
+//		System.out.println("手机号:"+mobile +" -  内容:"+content);
+//		return true;
+	}
+	
+	public static void main(String[] args) {
+		System.out.println(sendSms("13631650502", "您登录亲朋棋牌的手机短 信验证码是:7895,祝您游戏愉快!请确认账号是由本人操作"));
+	}
+}

+ 179 - 0
src/main/resources/mapper/CmOperationUserMapper.xml

@@ -0,0 +1,179 @@
+<?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.club.dao.CmOperationUserDao">
+    <sql id="cmOperationUserColumns">
+		a.id AS "id",
+		a.userOrganizeID AS "userOrganizeID",
+		a.userID AS "userID",
+		a.clubID AS "clubID",
+		a.account AS "account",
+		a.mobile AS "mobile",
+		a.linkName AS "linkName",
+		a.invitationCode AS "invitationCode",
+		a.status AS "status",
+		a.nickName AS "nickName",
+		a.openid AS "openid",
+		a.invitationCodeTime AS "invitationCodeTime",
+		a.bindTime AS "bindTime",
+		a.updateTime AS "updateTime",
+		a.addTime AS "addTime",
+		a.delFlag AS "delFlag"
+	</sql>
+
+    <select id="findList" resultType="com.caimei.modules.club.entity.CmOperationUser">
+        SELECT
+        <include refid="cmOperationUserColumns"/>
+        FROM cm_mall_operation_user a
+        <where>
+
+            <if test="mobile != null and mobile != ''">
+                AND a.mobile LIKE
+                <if test="dbName == 'oracle'">'%'||#{mobile}||'%'</if>
+                <if test="dbName == 'mssql'">'%'+#{mobile}+'%'</if>
+                <if test="dbName == 'mysql'">concat('%',#{mobile},'%')</if>
+            </if>
+            <if test="linkName != null and linkName != ''">
+                AND a.linkName LIKE
+                <if test="dbName == 'oracle'">'%'||#{linkName}||'%'</if>
+                <if test="dbName == 'mssql'">'%'+#{linkName}+'%'</if>
+                <if test="dbName == 'mysql'">concat('%',#{linkName},'%')</if>
+            </if>
+            <if test="status != null and status != ''">
+                AND a.status = #{status}
+            </if>
+            <if test="beginAddTime != null and endAddTime != null and beginAddTime != '' and endAddTime != ''">
+                AND a.addTime BETWEEN #{beginAddTime} AND #{endAddTime}
+            </if>
+            <if test="userOrganizeID != null and userOrganizeID != ''">
+                AND a.userOrganizeID = #{userOrganizeID}
+            </if>
+            <if test="clubID != null and clubID != ''">
+                AND a.clubID = #{clubID}
+            </if>
+            AND a.delFlag = 0
+        </where>
+            ORDER BY a.addTime DESC
+    </select>
+
+    <!--适用于手机号码查询运营用户-->
+    <select id="findListBuyBindMobile" resultType="com.caimei.modules.club.entity.CmOperationUser">
+        SELECT
+        *
+        FROM cm_mall_operation_user a
+        <where>
+            a.mobile = #{mobile}
+            <if test="id != null and id != ''">
+                AND a.id != #{id}
+            </if>
+            AND a.delFlag = 0
+        </where>
+    </select>
+
+    <select id="getListByInvitationCode" resultType="com.caimei.modules.club.entity.CmOperationUser">
+		SELECT
+		a.*
+		FROM cm_mall_operation_user a
+		WHERE a.invitationCode = #{invitationCode}
+		AND a.delFlag = 0
+	</select>
+
+    <insert id="insert" parameterType="com.caimei.modules.club.entity.CmOperationUser"  keyProperty="id" useGeneratedKeys="true">
+		INSERT INTO cm_mall_operation_user(
+			userOrganizeID,
+			userID,
+			clubID,
+			account,
+			mobile,
+			linkName,
+			invitationCode,
+			status,
+			nickName,
+			openid,
+			invitationCodeTime,
+			bindTime,
+			updateTime,
+			addTime,
+			delFlag
+		) VALUES (
+			#{userOrganizeID},
+			#{userID},
+			#{clubID},
+			#{account},
+			#{mobile},
+			#{linkName},
+			#{invitationCode},
+			#{status},
+			#{nickName},
+			#{openid},
+			#{invitationCodeTime},
+			#{bindTime},
+			#{updateTime},
+			#{addTime},
+			#{delFlag}
+		)
+	</insert>
+
+    <update id="update">
+        UPDATE cm_mall_operation_user SET
+        <if test="userOrganizeID != null and userOrganizeID != ''">
+            userOrganizeID = #{userOrganizeID},
+        </if>
+        <if test="userID != null and userID != ''">
+            userID = #{userID},
+        </if>
+        <if test="clubID != null and clubID != ''">
+            clubID = #{clubID},
+        </if>
+        <if test="account != null and account != ''">
+            account = #{account},
+        </if>
+        <if test="mobile != null and mobile != ''">
+            mobile = #{mobile},
+        </if>
+        <if test="invitationCode != null and invitationCode != ''">
+            invitationCode = #{invitationCode},
+        </if>
+        <if test="status != null and status != ''">
+            status = #{status},
+        </if>
+        <if test="nickName != null and nickName != ''">
+            nickName = #{nickName},
+        </if>
+        <if test="openid != null and openid != ''">
+            openid = #{openid},
+        </if>
+        <if test="invitationCodeTime != null and invitationCodeTime != ''">
+            invitationCodeTime = #{invitationCodeTime},
+        </if>
+        <if test="bindTime != null and bindTime != ''">
+            bindTime = #{bindTime},
+        </if>
+        <if test="updateTime != null  and addTime != ''">
+            updateTime = #{updateTime},
+        </if>
+        <if test="addTime != null  and addTime != ''">
+            addTime = #{addTime},
+        </if>
+        <if test="linkName != null and linkName != ''">
+            linkName = #{linkName},
+        </if>
+        delFlag = 0
+        WHERE id = #{id}
+    </update>
+
+    <!--解绑运营人员用户-->
+    <update id="untiedOperationUser">
+		UPDATE cm_mall_operation_user SET
+			status = #{status},
+			nickName = #{nickName},
+			openid = #{openid},
+			bindTime = #{bindTime},
+			updateTime = #{updateTime},
+			delFlag = #{delFlag}
+		WHERE id = #{id}
+		AND  userOrganizeID = #{userOrganizeID}
+		and  userID = #{userID}
+	</update>
+</mapper>

+ 421 - 0
src/main/resources/mapper/CmUserMapper.xml

@@ -0,0 +1,421 @@
+<?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.club.dao.CmUserDao">
+    <select id="findListBuyUserInfo" resultType="com.caimei.modules.club.entity.CmUser"
+            parameterType="com.caimei.modules.club.entity.CmUser">
+        SELECT
+        a.*
+        ,c.linkMan AS "linkMan"
+        ,t.name as "town"
+        ,ci.name as "city"
+        ,p.name as "province"
+        ,c.address AS "address"
+        FROM user a
+        LEFT JOIN club c on c.userID = a.userID
+        LEFT JOIN town t on t.townID = c.townID
+        LEFT JOIN city ci ON ci.cityID = c.cityID
+        LEFT JOIN province p ON p.provinceID = c.provinceID
+        <where>
+            a.userOrganizeID = #{userOrganizeID}
+            <if test="bindMobile != null and bindMobile != ''">
+                AND a.bindMobile LIKE concat('%',#{bindMobile},'%')
+            </if>
+            <if test="userName != null and userName != ''">
+                AND a.userName LIKE concat('%',#{userName},'%')
+            </if>
+            <if test="linkMan != null and linkMan != ''">
+                AND c.linkMan LIKE concat('%',#{linkMan},'%')
+            </if>
+            <if test="startTime != null and startTime != ''">
+                AND a.registerTime <![CDATA[  >=  ]]> #{startTime}
+            </if>
+            <if test="endTime != null and endTime != ''">
+                AND a.registerTime <![CDATA[   <=  ]]> #{endTime}
+            </if>
+            <if test="clubStatus != null and clubStatus != ''">
+                AND a.clubStatus = #{clubStatus}
+            </if>
+        </where>
+        ORDER BY a.registerTime DESC
+    </select>
+
+    <!--适用于企业通过手机号码查询用户-->
+    <select id="findListBuyBindMobile" resultType="com.caimei.modules.club.entity.CmUser">
+        SELECT
+        *
+        FROM user a
+        <where>
+            a.bindMobile = #{bindMobile}
+            <if test="clubID != null and clubID != ''">
+                AND a.clubID != #{clubID}
+            </if>
+        </where>
+    </select>
+
+    <insert id="insert" parameterType="com.caimei.modules.club.entity.CmUser" keyProperty="userID" useGeneratedKeys="true">
+        INSERT INTO user(
+        userOrganizeID,
+        account,
+        realName,
+        userIdentity,
+        companyUserID,
+        openID,
+        mobile,
+        bindMobile,
+        userPermission,
+        email,
+        userName,
+        image,
+        password,
+        userLevelID,
+        name,
+        nick,
+        sex,
+        registerUserTypeID,
+        manufacturerFlag,
+        manufacturerStatus,
+        shopID,
+        serviceProviderFlag,
+        clubFlag,
+        masterFlag,
+        normalFlag,
+        auditStatus,
+        auditTime,
+        auditNote,
+        registerTime,
+        registerIP,
+        loginTime,
+        loginFailTime,
+        loginIP,
+        validFlag,
+        emailCheckFlag,
+        mobileCheckFlag,
+        clubStatus,
+        <if test="clubID != null and clubID != ''">
+            clubID,
+        </if>
+        agreeFlag,
+        activationCode,
+        activationDate,
+        serviceProviderStatus,
+        serviceProviderID,
+        masterStatus,
+        masterID,
+        userMoney,
+        ableUserMoney,
+        point,
+        shopERPFlag,
+        fromUserID,
+        fromUserName,
+        logoffTime,
+        appKey,
+        appSecret,
+        sampleFlag,
+        scanFlag,
+        sysroleid,
+        gender,
+        age,
+        salerbuyer,
+        position,
+        skill,
+        workage,
+        wechat,
+        qq,
+        smsFlag,
+        userBeans,
+        privateShopFlag,
+        privateClubFlag,
+        isMeiDaoAuthorized,
+        guideFlag
+        ) VALUES (
+        #{userOrganizeID},
+        #{account},
+        #{realName},
+        #{userIdentity},
+        #{companyUserID},
+        #{openID},
+        #{mobile},
+        #{bindMobile},
+        #{userPermission},
+        #{email},
+        #{userName},
+        #{image},
+        #{password},
+        #{userLevelID},
+        #{name},
+        #{nick},
+        #{sex},
+        #{registerUserTypeID},
+        #{manufacturerFlag},
+        #{manufacturerStatus},
+        #{shopID},
+        #{serviceProviderFlag},
+        #{clubFlag},
+        #{masterFlag},
+        #{normalFlag},
+        #{auditStatus},
+        #{auditTime},
+        #{auditNote},
+        #{registerTime},
+        #{registerIP},
+        #{loginTime},
+        #{loginFailTime},
+        #{loginIP},
+        #{validFlag},
+        #{emailCheckFlag},
+        #{mobileCheckFlag},
+        #{clubStatus},
+        <if test="clubID != null and clubID != ''">
+            #{clubID},
+        </if>
+        #{agreeFlag},
+        #{activationCode},
+        #{activationDate},
+        #{serviceProviderStatus},
+        #{serviceProviderID},
+        #{masterStatus},
+        #{masterID},
+        #{userMoney},
+        #{ableUserMoney},
+        #{point},
+        #{shopERPFlag},
+        #{fromUserID},
+        #{fromUserName},
+        #{logoffTime},
+        #{appKey},
+        #{appSecret},
+        #{sampleFlag},
+        #{scanFlag},
+        #{sysroleid},
+        #{gender},
+        #{age},
+        #{salerbuyer},
+        #{position},
+        #{skill},
+        #{workage},
+        #{wechat},
+        #{qq},
+        #{smsFlag},
+        #{userBeans},
+        #{privateShopFlag},
+        #{privateClubFlag},
+        #{isMeiDaoAuthorized},
+        #{guideFlag}
+        )
+    </insert>
+
+    <update id="update">
+        UPDATE user SET
+        <if test="account != null and account != ''">
+            account = #{account},
+        </if>
+        <if test="bindMobile != null and bindMobile != ''">
+            bindMobile = #{bindMobile},
+        </if>
+        <if test="realName != null and realName != ''">
+            realName = #{realName},
+        </if>
+        <if test="userIdentity != null and userIdentity != ''">
+            userIdentity = #{userIdentity},
+        </if>
+        <if test="companyUserID != null and companyUserID != ''">
+            companyUserID = #{companyUserID},
+        </if>
+        <if test="openID != null and openID != ''">
+            openID = #{openID},
+        </if>
+        <if test="mobile != null and mobile != ''">
+            mobile = #{mobile},
+        </if>
+        <if test="userPermission != null and userPermission != ''">
+            userPermission = #{userPermission},
+        </if>
+        <if test="email != null and email != ''">
+            email = #{email},
+        </if>
+        <if test="userName != null and userName != ''">
+            userName = #{userName},
+        </if>
+        <if test="image != null and image != ''">
+            image = #{image},
+        </if>
+        <if test="password != null and password != ''">
+            password = #{password},
+        </if>
+        <if test="userLevelID != null and userLevelID != ''">
+            userLevelID = #{userLevelID},
+        </if>
+        <if test="name != null and name != ''">
+            name = #{name},
+        </if>
+        <if test="nick != null and nick != ''">
+            nick = #{nick},
+        </if>
+        <if test="sex != null and sex != ''">
+            sex = #{sex},
+        </if>
+        <if test="registerUserTypeID != null and registerUserTypeID != ''">
+            registerUserTypeID = #{registerUserTypeID},
+        </if>
+        <if test="manufacturerFlag != null and manufacturerFlag != ''">
+            manufacturerFlag = #{manufacturerFlag},
+        </if>
+        <if test="manufacturerStatus != null and manufacturerStatus != ''">
+            manufacturerStatus = #{manufacturerStatus},
+        </if>
+        <if test="shopID != null and shopID != ''">
+            shopID = #{shopID},
+        </if>
+        <if test="serviceProviderFlag != null and serviceProviderFlag != ''">
+            serviceProviderFlag = #{serviceProviderFlag},
+        </if>
+        <if test="clubFlag != null and clubFlag != ''">
+            clubFlag = #{clubFlag},
+        </if>
+        <if test="masterFlag != null and masterFlag != ''">
+            masterFlag = #{masterFlag},
+        </if>
+        <if test="normalFlag != null and normalFlag != ''">
+            normalFlag = #{normalFlag},
+        </if>
+        <if test="auditStatus != null and auditStatus != ''">
+            auditStatus = #{auditStatus},
+        </if>
+        <if test="auditTime != null">
+            auditTime = #{auditTime},
+        </if>
+        <if test="auditNote != null and auditNote != ''">
+            auditNote = #{auditNote},
+        </if>
+        <if test="registerTime != null ">
+            registerTime = #{registerTime},
+        </if>
+        <if test="registerIP != null and registerIP != ''">
+            registerIP = #{registerIP},
+        </if>
+        <if test="loginTime != null and loginTime != ''">
+            loginTime = #{loginTime},
+        </if>
+        <if test="loginFailTime != null and loginFailTime != ''">
+            loginFailTime = #{loginFailTime},
+        </if>
+        <if test="loginIP != null and loginIP != ''">
+            loginIP = #{loginIP},
+        </if>
+        <if test="validFlag != null and validFlag != ''">
+            validFlag = #{validFlag},
+        </if>
+        <if test="emailCheckFlag != null and emailCheckFlag != ''">
+            emailCheckFlag = #{emailCheckFlag},
+        </if>
+        <if test="mobileCheckFlag != null and mobileCheckFlag != ''">
+            mobileCheckFlag = #{mobileCheckFlag},
+        </if>
+        <if test="clubStatus != null and clubStatus != ''">
+            clubStatus = #{clubStatus},
+        </if>
+        <if test="clubID != null and clubID != ''">
+            clubID = #{clubID},
+        </if>
+        <if test="agreeFlag != null and agreeFlag != ''">
+            agreeFlag = #{agreeFlag},
+        </if>
+        <if test="activationCode != null and activationCode != ''">
+            activationCode = #{activationCode},
+        </if>
+        <if test="activationDate != null ">
+            activationDate = #{activationDate},
+        </if>
+        <if test="serviceProviderStatus != null and serviceProviderStatus != ''">
+            serviceProviderStatus = #{serviceProviderStatus},
+        </if>
+        <if test="serviceProviderID != null and serviceProviderID != ''">
+            serviceProviderID = #{serviceProviderID},
+        </if>
+        <if test="masterStatus != null and masterStatus != ''">
+            masterStatus = #{masterStatus},
+        </if>
+        <if test="masterID != null and masterID != ''">
+            masterID = #{masterID},
+        </if>
+        <if test="userMoney != null and userMoney != ''">
+            userMoney = #{userMoney},
+        </if>
+        <if test="point != null and point != ''">
+            point = #{point},
+        </if>
+        <if test="shopERPFlag != null and shopERPFlag != ''">
+            shopERPFlag = #{shopERPFlag},
+        </if>
+        <if test="fromUserID != null and fromUserID != ''">
+            fromUserID = #{fromUserID},
+        </if>
+        <if test="fromUserName != null and fromUserName != ''">
+            fromUserName = #{fromUserName},
+        </if>
+        <if test="logoffTime != null and logoffTime != ''">
+            logoffTime = #{logoffTime},
+        </if>
+        <if test="appKey != null and appKey != ''">
+            appKey = #{appKey},
+        </if>
+        <if test="appSecret != null and appSecret != ''">
+            appSecret = #{appSecret},
+        </if>
+        <if test="sampleFlag != null and sampleFlag != ''">
+            sampleFlag = #{sampleFlag},
+        </if>
+        <if test="scanFlag != null and scanFlag != ''">
+            scanFlag = #{scanFlag},
+        </if>
+        <if test="sysroleid != null and sysroleid != ''">
+            sysroleid = #{sysroleid},
+        </if>
+        <if test="gender != null and gender != ''">
+            gender = #{gender},
+        </if>
+        <if test="age != null and age != ''">
+            age = #{age},
+        </if>
+        <if test="salerbuyer != null and salerbuyer != ''">
+            salerbuyer = #{salerbuyer},
+        </if>
+        <if test="position != null and position != ''">
+            position = #{position},
+        </if>
+        <if test="skill != null and skill != ''">
+            skill = #{skill},
+        </if>
+        <if test="workage != null and workage != ''">
+            workage = #{workage},
+        </if>
+        <if test="wechat != null and wechat != ''">
+            wechat = #{wechat},
+        </if>
+        <if test="qq != null and qq != ''">
+            qq = #{qq},
+        </if>
+        <if test="smsFlag != null and smsFlag != ''">
+            smsFlag = #{smsFlag},
+        </if>
+        <if test="userBeans != null and userBeans != ''">
+            userBeans = #{userBeans},
+        </if>
+        <if test="privateShopFlag != null and privateShopFlag != ''">
+            privateShopFlag = #{privateShopFlag},
+        </if>
+        <if test="privateClubFlag != null and privateClubFlag != ''">
+            privateClubFlag = #{privateClubFlag},
+        </if>
+        <if test="isMeiDaoAuthorized != null and isMeiDaoAuthorized != ''">
+            isMeiDaoAuthorized = #{isMeiDaoAuthorized},
+        </if>
+        <if test="guideFlag != null and guideFlag != ''">
+            guideFlag = #{guideFlag},
+        </if>
+        userID = #{userID}
+        WHERE userID = #{userID}
+    </update>
+</mapper>

+ 66 - 0
src/main/resources/mapper/CmUserOrganizeMapper

@@ -0,0 +1,66 @@
+<?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.club.dao.CmUserOrganizeDao">
+    <sql id="cmUserOrganizeColumns">
+		a.id AS "id",
+		a.organizeName AS "organizeName",
+		a.organizeLinkName AS "organizeLinkName",
+		a.mobile AS "mobile",
+		a.contactNumber AS "contactNumber",
+		a.introduction AS "introduction",
+		a.afterSale AS "afterSale",
+		a.shoppingNotes AS "shoppingNotes",
+		a.updateTime AS "updateTime",
+		a.addTime AS "addTime",
+		a.delFlag AS "delFlag"
+	</sql>
+
+    <select id="findList" parameterType="com.caimei.modules.club.entity.CmUserOrganize"
+            resultType="com.caimei.modules.club.entity.CmUserOrganize">
+        SELECT
+        <include refid="cmUserOrganizeColumns"/>
+        FROM cm_mall_organize a
+        <where>
+
+            <if test="organizeName != null and organizeName != ''">
+                AND a.organizeName LIKE concat('%',#{organizeName},'%')
+            </if>
+            <if test="organizeLinkName != null and organizeLinkName != ''">
+                AND a.organizeLinkName LIKE concat('%',#{organizeLinkName},'%')
+
+            </if>
+            <if test="mobile != null and mobile != ''">
+                AND a.mobile LIKE concat('%',#{mobile},'%')
+            </if>
+            and a.delFlag = 0
+        </where>
+        <choose>
+            <when test="page !=null and page.orderBy != null and page.orderBy != ''">
+                ORDER BY ${page.orderBy}
+            </when>
+            <otherwise>
+                ORDER BY a.addTime DESC
+            </otherwise>
+        </choose>
+    </select>
+
+	<select id="loadProvinceById" resultType="com.caimei.modules.club.entity.Province" parameterType="int">
+		SELECT *
+		FROM province
+		WHERE provinceID = #{provinceID}
+	</select>
+
+	<select id="loadCityById" resultType="com.caimei.modules.club.entity.City" parameterType="int">
+		SELECT *
+		FROM city
+		WHERE cityID = #{cityID}
+	</select>
+
+	<select id="loadTownByID" resultType="com.caimei.modules.club.entity.Town" parameterType="int">
+		SELECT *
+		FROM town
+		WHERE townID = #{townID}
+	</select>
+</mapper>

+ 474 - 0
src/main/resources/mapper/NewCmClubMapper.xml

@@ -0,0 +1,474 @@
+<?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.club.dao.NewCmClubDao">
+    <sql id="newCmClubColumns">
+		a.clubID AS "clubID",
+		a.userID AS "userID",
+		a.clubTypeID AS "clubTypeID",
+		a.name AS "name",
+		a.sname AS "sname",
+		a.nameEn AS "nameEn",
+		a.site AS "site",
+		a.logo AS "logo",
+		a.level AS "level",
+		a.score AS "score",
+		a.subClubCount AS "subClubCount",
+		a.legalPerson AS "legalPerson",
+		a.provinceID AS "provinceID",
+		a.cityID AS "cityID",
+		a.townID AS "townID",
+		a.agreement AS "agreement",
+		a.flag AS "flag",
+		a.inviterBindID AS "inviterBindID",
+		a.inviterName AS "inviterName",
+		a.spID AS "spID",
+		a.mainServiceProviderID AS "mainServiceProviderID",
+		a.scanTime AS "scanTime",
+		a.checkTime AS "checkTime",
+		a.address AS "address",
+		a.registeredCapital AS "registeredCapital",
+		a.mainClubID AS "mainClubID",
+		a.turnover AS "turnover",
+		a.linkMan AS "linkMan",
+		a.contractPhone AS "contractPhone",
+		a.contractMobile AS "contractMobile",
+		a.fax AS "fax",
+		a.zipCode AS "zipCode",
+		a.linkMan1 AS "linkMan1",
+		a.duty1 AS "duty1",
+		a.contractPhone1 AS "contractPhone1",
+		a.contractMobile1 AS "contractMobile1",
+		a.contractQQ1 AS "contractQQ1",
+		a.wechat1 AS "wechat1",
+		a.contractEmail1 AS "contractEmail1",
+		a.linkMan2 AS "linkMan2",
+		a.duty2 AS "duty2",
+		a.contractPhone2 AS "contractPhone2",
+		a.contractMobile2 AS "contractMobile2",
+		a.contractQQ2 AS "contractQQ2",
+		a.wechat2 AS "wechat2",
+		a.contractEmail2 AS "contractEmail2",
+		a.scope AS "scope",
+		a.info AS "info",
+		a.lng AS "lng",
+		a.lat AS "lat",
+		a.addTime AS "addTime",
+		a.favoriteTimes AS "favoriteTimes",
+		a.payFlag1 AS "payFlag1",
+		a.auditTime AS "auditTime",
+		a.auditNote AS "auditNote",
+		a.status AS "status",
+		a.clubInvitationStatus AS "clubInvitationStatus",
+		a.recAddress AS "recAddress",
+		a.businessLicenseImage AS "businessLicenseImage",
+		a.sortIndex AS "sortIndex",
+		a.recTownID AS "recTownID",
+		a.defaultServiceProviderID AS "defaultServiceProviderID",
+		a.defaultServiceProviderUpdTime AS "defaultServiceProviderUpdTime",
+		a.firstServiceProviderFlag AS "firstServiceProviderFlag",
+		a.scale AS "scale",
+		a.empnum AS "empnum",
+		a.mainpro AS "mainpro",
+		a.remark AS "remark",
+		a.scanFlag AS "scanFlag",
+		a.headpic AS "headpic",
+		a.socialCreditCode AS "socialCreditCode",
+		a.lastModify AS "lastModify",
+		a.firstClubType AS "firstClubType",
+        a.secondClubType AS "secondClubType",
+        a.department AS "department",
+        a.medicalPracticeLicenseImg AS "medicalPracticeLicenseImg"
+	</sql>
+
+    <select id="findClubById" parameterType="int" resultType="com.caimei.modules.club.entity.NewCmClub">
+        SELECT
+        <include refid="newCmClubColumns"/>
+        , CONCAT(d.name,c.name ,b.name ,a.`address` ) address
+        FROM club a
+        LEFT JOIN town b ON a.townID =b.townID
+        LEFT JOIN city c ON b.cityID=c.cityID
+        JOIN province d ON c.`provinceID` =d.`provinceID`
+        WHERE  a.clubID=#{clubID}
+    </select>
+
+	<insert id="insert" parameterType="com.caimei.modules.club.entity.NewCmClub"  keyProperty="clubID" useGeneratedKeys="true">
+		INSERT INTO club(
+			userID,
+			name,
+			sname,
+			nameEn,
+			site,
+			logo,
+			level,
+			score,
+			subClubCount,
+			legalPerson,
+			provinceID,
+			cityID,
+			townID,
+			agreement,
+			flag,
+			inviterBindID,
+			inviterName,
+			spID,
+			mainServiceProviderID,
+			scanTime,
+			checkTime,
+			address,
+			registeredCapital,
+			mainClubID,
+			turnover,
+			linkMan,
+			contractPhone,
+			contractMobile,
+			fax,
+			zipCode,
+			linkMan1,
+			duty1,
+			contractPhone1,
+			contractMobile1,
+			contractQQ1,
+			wechat1,
+			contractEmail1,
+			linkMan2,
+			duty2,
+			contractPhone2,
+			contractMobile2,
+			contractQQ2,
+			wechat2,
+			contractEmail2,
+			scope,
+			info,
+			lng,
+			lat,
+			addTime,
+			favoriteTimes,
+			payFlag1,
+			auditTime,
+			auditNote,
+			status,
+			clubInvitationStatus,
+			recAddress,
+			businessLicenseImage,
+			sortIndex,
+			recTownID,
+			defaultServiceProviderID,
+			defaultServiceProviderUpdTime,
+			firstServiceProviderFlag,
+			scale,
+			empnum,
+			mainpro,
+			remark,
+			scanFlag,
+			headpic,
+			lastModify,
+			firstClubType,
+			socialCreditCode,
+        secondClubType,
+        department,
+        medicalPracticeLicenseImg
+		) VALUES (
+			#{userID},
+			#{name},
+			#{sname},
+			#{nameEn},
+			#{site},
+			#{logo},
+			#{level},
+			#{score},
+			#{subClubCount},
+			#{legalPerson},
+			#{provinceID},
+			#{cityID},
+			#{townID},
+			#{agreement},
+			#{flag},
+			#{inviterBindID},
+			#{inviterName},
+			#{spID},
+			#{mainServiceProviderID},
+			#{scanTime},
+			#{checkTime},
+			#{address},
+			#{registeredCapital},
+			#{mainClubID},
+			#{turnover},
+			#{linkMan},
+			#{contractPhone},
+			#{contractMobile},
+			#{fax},
+			#{zipCode},
+			#{linkMan1},
+			#{duty1},
+			#{contractPhone1},
+			#{contractMobile1},
+			#{contractQQ1},
+			#{wechat1},
+			#{contractEmail1},
+			#{linkMan2},
+			#{duty2},
+			#{contractPhone2},
+			#{contractMobile2},
+			#{contractQQ2},
+			#{wechat2},
+			#{contractEmail2},
+			#{scope},
+			#{info},
+			#{lng},
+			#{lat},
+			#{addTime},
+			#{favoriteTimes},
+			#{payFlag1},
+			#{auditTime},
+			#{auditNote},
+			#{status},
+			#{clubInvitationStatus},
+			#{recAddress},
+			#{businessLicenseImage},
+			#{sortIndex},
+			#{recTownID},
+			#{defaultServiceProviderID},
+			#{defaultServiceProviderUpdTime},
+			#{firstServiceProviderFlag},
+			#{scale},
+			#{empnum},
+			#{mainpro},
+			#{remark},
+			#{scanFlag},
+			#{headpic},
+			#{lastModify},
+			#{firstClubType},
+			#{socialCreditCode},
+        #{secondClubType},
+        #{department},
+        #{medicalPracticeLicenseImg}
+		)
+	</insert>
+
+	<update id="update">
+		UPDATE club SET
+		<if test="name != null and name != ''">
+			name = #{name},
+		</if>
+		<if test="sname != null and sname != ''">
+			sname = #{sname},
+		</if>
+		<if test="nameEn != null and nameEn != ''">
+			nameEn = #{nameEn},
+		</if>
+		<if test="site != null and site != ''">
+			site = #{site},
+		</if>
+		<if test="logo != null and logo != ''">
+			logo = #{logo},
+		</if>
+		<if test="level != null and level != ''">
+			level = #{level},
+		</if>
+		<if test="score != null and score != ''">
+			score = #{score},
+		</if>
+		<if test="subClubCount != null and subClubCount != ''">
+			subClubCount = #{subClubCount},
+		</if>
+		<if test="legalPerson != null and legalPerson != ''">
+			legalPerson = #{legalPerson},
+		</if>
+		<if test="provinceID != null and provinceID != ''">
+			provinceID = #{provinceID},
+		</if>
+		<if test="cityID != null and cityID != ''">
+			cityID = #{cityID},
+		</if>
+		<if test="townID != null and townID != ''">
+			townID = #{townID},
+		</if>
+		<if test="agreement != null and agreement != ''">
+			agreement = #{agreement},
+		</if>
+		<if test="flag != null and flag != ''">
+			flag = #{flag},
+		</if>
+		<if test="inviterBindID != null and inviterBindID != ''">
+			inviterBindID = #{inviterBindID},
+		</if>
+		<if test="inviterName != null and inviterName != ''">
+			inviterName = #{inviterName},
+		</if>
+		<if test="spID != null and spID != ''">
+			spID = #{spID},
+		</if>
+		<if test="mainServiceProviderID != null and mainServiceProviderID != ''">
+			mainServiceProviderID = #{mainServiceProviderID},
+		</if>
+		<if test="scanTime != null">
+			scanTime = #{scanTime},
+		</if>
+		<if test="checkTime != null and checkTime != ''">
+			checkTime = #{checkTime},
+		</if>
+		<if test="address != null and address != ''">
+			address = #{address},
+		</if>
+		<if test="registeredCapital != null and registeredCapital != ''">
+			registeredCapital = #{registeredCapital},
+		</if>
+		<if test="mainClubID != null and mainClubID != ''">
+			mainClubID = #{mainClubID},
+		</if>
+		<if test="turnover != null and turnover != ''">
+			turnover = #{turnover},
+		</if>
+		<if test="linkMan != null and linkMan != ''">
+			linkMan = #{linkMan},
+		</if>
+		<if test="contractPhone != null and contractPhone != ''">
+			contractPhone = #{contractPhone},
+		</if>
+		<if test="contractMobile != null and contractMobile != ''">
+			contractMobile = #{contractMobile},
+		</if>
+		<if test="fax != null and fax != ''">
+			fax = #{fax},
+		</if>
+		<if test="zipCode != null and zipCode != ''">
+			zipCode = #{zipCode},
+		</if>
+		<if test="linkMan1 != null and linkMan1 != ''">
+			linkMan1 = #{linkMan1},
+		</if>
+		<if test="duty1 != null and duty1 != ''">
+			duty1 = #{duty1},
+		</if>
+		<if test="contractPhone1 != null and contractPhone1 != ''">
+			contractPhone1 = #{contractPhone1},
+		</if>
+		<if test="contractMobile1 != null and contractMobile1 != ''">
+			contractMobile1 = #{contractMobile1},
+		</if>
+		<if test="contractQQ1 != null and contractQQ1 != ''">
+			contractQQ1 = #{contractQQ1},
+		</if>
+		<if test="wechat1 != null and wechat1 != ''">
+			wechat1 = #{wechat1},
+		</if>
+		<if test="contractEmail1 != null and contractEmail1 != ''">
+			contractEmail1 = #{contractEmail1},
+		</if>
+		<if test="linkMan2 != null and linkMan2 != ''">
+			linkMan2 = #{linkMan2},
+		</if>
+		<if test="duty2 != null and duty2 != ''">
+			duty2 = #{duty2},
+		</if>
+		<if test="contractPhone2 != null and contractPhone2 != ''">
+			contractPhone2 = #{contractPhone2},
+		</if>
+		<if test="contractMobile2 != null and contractMobile2 != ''">
+			contractMobile2 = #{contractMobile2},
+		</if>
+		<if test="contractQQ2 != null and contractQQ2 != ''">
+			contractQQ2 = #{contractQQ2},
+		</if>
+		<if test="wechat2 != null and wechat2 != ''">
+			wechat2 = #{wechat2},
+		</if>
+		<if test="contractEmail2 != null and contractEmail2 != ''">
+			contractEmail2 = #{contractEmail2},
+		</if>
+		<if test="scope != null and scope != ''">
+			scope = #{scope},
+		</if>
+		<if test="info != null and info != ''">
+			info = #{info},
+		</if>
+		<if test="lng != null and lng != ''">
+			lng = #{lng},
+		</if>
+		<if test="lat != null and lat != ''">
+			lat = #{lat},
+		</if>
+		<if test="addTime != null">
+			addTime = #{addTime},
+		</if>
+		<if test="favoriteTimes != null">
+			favoriteTimes = #{favoriteTimes},
+		</if>
+		<if test="payFlag1 != null and payFlag1 != ''">
+			payFlag1 = #{payFlag1},
+		</if>
+		<if test="auditTime != null">
+			auditTime = #{auditTime},
+		</if>
+		<if test="auditNote != null and auditNote != ''">
+			auditNote = #{auditNote},
+		</if>
+		<if test="status != null and status != ''">
+			status = #{status},
+		</if>
+		<if test="clubInvitationStatus != null and clubInvitationStatus != ''">
+			clubInvitationStatus = #{clubInvitationStatus},
+		</if>
+		<if test="recAddress != null and recAddress != ''">
+			recAddress = #{recAddress},
+		</if>
+		<if test="businessLicenseImage != null">
+			businessLicenseImage = #{businessLicenseImage},
+		</if>
+		<if test="socialCreditCode != null and socialCreditCode != ''">
+			socialCreditCode = #{socialCreditCode},
+		</if>
+		<if test="sortIndex != null and sortIndex != ''">
+			sortIndex = #{sortIndex},
+		</if>
+		<if test="recTownID != null and recTownID != ''">
+			recTownID = #{recTownID},
+		</if>
+		<if test="defaultServiceProviderID != null and defaultServiceProviderID != ''">
+			defaultServiceProviderID = #{defaultServiceProviderID},
+		</if>
+		<if test="defaultServiceProviderUpdTime != null and defaultServiceProviderUpdTime != ''">
+			defaultServiceProviderUpdTime = #{defaultServiceProviderUpdTime},
+		</if>
+		<if test="firstServiceProviderFlag != null and firstServiceProviderFlag != ''">
+			firstServiceProviderFlag = #{firstServiceProviderFlag},
+		</if>
+		<if test="scale != null and scale != ''">
+			scale = #{scale},
+		</if>
+		<if test="empnum != null and empnum != ''">
+			empnum = #{empnum},
+		</if>
+		<if test="mainpro != null and mainpro != ''">
+			mainpro = #{mainpro},
+		</if>
+		<if test="remark != null and remark != ''">
+			remark = #{remark},
+		</if>
+		<if test="scanFlag != null and scanFlag != ''">
+			scanFlag = #{scanFlag},
+		</if>
+		<if test="headpic != null">
+			headpic = #{headpic},
+		</if>
+		<if test="lastModify != null and lastModify != ''">
+			lastModify = #{lastModify},
+		</if>
+		<if test="firstClubType != null and firstClubType != ''">
+			firstClubType=#{firstClubType},
+		</if>
+		<if test="secondClubType != null and secondClubType != ''">
+			secondClubType=#{secondClubType},
+		</if>
+		<if test="department != null and department != ''">
+			department=#{department},
+		</if>
+		<if test="medicalPracticeLicenseImg != null and medicalPracticeLicenseImg != ''">
+			medicalPracticeLicenseImg=#{medicalPracticeLicenseImg},
+		</if>
+		userID = #{userID}
+		WHERE clubID = #{clubID}
+	</update>
+</mapper>