| | |
| | | |
| | | import com.matrix.core.anotations.RemoveRequestToken; |
| | | import com.matrix.core.anotations.SaveRequestToken; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.core.tools.DateUtil; |
| | |
| | | import com.matrix.core.tools.excl.ExcelSheetPO; |
| | | import com.matrix.core.tools.excl.ExcelUtil; |
| | | import com.matrix.core.tools.excl.ExcelVersion; |
| | | import com.matrix.system.common.bean.SystemDictionary; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.service.SystemDictionaryService; |
| | | import com.matrix.system.common.bean.SystemDictionary; |
| | | import com.matrix.system.common.service.SysUsersService; |
| | | import com.matrix.system.common.service.SystemDictionaryService; |
| | | import com.matrix.system.common.tools.ResponseHeadUtil; |
| | | import com.matrix.system.constance.Dictionary; |
| | | import com.matrix.system.constance.SystemConstance; |
| | | import com.matrix.system.hive.action.BaseController; |
| | | import com.matrix.system.hive.action.util.QueryUtil; |
| | | import com.matrix.system.hive.bean.*; |
| | | import com.matrix.system.hive.bean.Question; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.bean.SysVipLevel; |
| | | import com.matrix.system.hive.bean.VipAnswer; |
| | | import com.matrix.system.hive.dao.MoneyCardUseDao; |
| | | import com.matrix.system.hive.dao.VipAnswerDao; |
| | | import com.matrix.core.tools.DateUtil; |
| | | import com.matrix.system.hive.pojo.RegisterInfo; |
| | | import com.matrix.system.hive.service.*; |
| | | import com.matrix.system.hive.service.MoneyCardUseService; |
| | | import com.matrix.system.hive.service.QuestionSerivce; |
| | | import com.matrix.system.hive.service.SysVipInfoService; |
| | | import com.matrix.system.hive.service.SysVipLevelService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.ModelMap; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | |
| | | import java.io.IOException; |
| | | import java.io.OutputStream; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.net.URLDecoder; |
| | | import java.net.URLEncoder; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.util.*; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Calendar; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | |
| | | @RequestMapping(value = "/showVipInfo") |
| | | public @ResponseBody |
| | | AjaxResult findByModel(String keyWord) { |
| | | LinkedList<SysVipInfo> userList = null; |
| | | // 获取最近查询客户 |
| | | if (WebUtil.getSession().getAttribute(SystemConstance.HISTORY_CUSTOMER) == null) { |
| | | userList = new LinkedList<SysVipInfo>(); |
| | | WebUtil.getSession().setAttribute(SystemConstance.HISTORY_CUSTOMER, userList); |
| | | } else { |
| | | userList = (LinkedList<SysVipInfo>) WebUtil.getSession().getAttribute(SystemConstance.HISTORY_CUSTOMER); |
| | | } |
| | | List<SysVipInfo> vips = vipInfoService.findByVipNoOrTel(keyWord); |
| | | if (vips.size() > 0) { |
| | | // 在session存放当前查询的客户 |
| | | MoneyCardUse cardUseInfo = cardUseService.findByVipId(vips.get(0).getId()); |
| | | if (cardUseInfo == null) { |
| | | cardUseInfo = new MoneyCardUse(); |
| | | cardUseInfo.setVipId(vips.get(0).getId()); |
| | | cardUseInfo.setCardName("储值卡"); |
| | | cardUseInfo.setIsVipCar(Dictionary.FLAG_YES_Y); |
| | | cardUseInfo.setRealMoney(0D); |
| | | cardUseInfo.setGiftMoney(0D); |
| | | cardUseInfo.setSource("-"); |
| | | cardUseInfo.setStatus(Dictionary.MONEYCARD_STATUS_YX); |
| | | cardUseInfo.setFailTime(DateUtil.stringToDate("2050-01-01 00:00",DateUtil.DATE_FORMAT_MM)); |
| | | moneyCardUseDao.insert(cardUseInfo); |
| | | } |
| | | vips.get(0).setLevelCard(cardUseInfo); |
| | | WebUtil.getSession().setAttribute(SystemConstance.CURRENT_CUSTOMER, vips.get(0)); |
| | | // 满20后删除一个 |
| | | if (userList.size() == 20) { |
| | | userList.poll(); |
| | | } |
| | | // 去重标志 |
| | | boolean isNoRepeat = true; |
| | | for (SysVipInfo sysVipInfo : userList) { |
| | | if (vips.get(0).getPhone().equals(sysVipInfo.getPhone())) { |
| | | isNoRepeat = false; |
| | | } |
| | | } |
| | | if (isNoRepeat) { |
| | | userList.add(vips.get(0)); |
| | | } |
| | | } |
| | | |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, vips, 0); |
| | | } |
| | | |
| | |
| | | public @ResponseBody |
| | | AjaxResult getVipQuestions(Long id, HttpServletRequest request) { |
| | | // 获取会员所有的答案,分类型 |
| | | List<Question> questions = questionSerivce.findByVipId(id); |
| | | SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); |
| | | List<Question> questions=questionSerivce.findByVipId(id,user.getCompanyId()); |
| | | request.setAttribute("questions", questions); |
| | | AjaxResult result = new AjaxResult(); |
| | | result.putInMap("questions", questions); |
| | |
| | | @RequestMapping(value = "/findUserByPhoneOrNo") |
| | | public @ResponseBody |
| | | AjaxResult findUserByPhoneOrNo(String keyWord) { |
| | | LinkedList<SysVipInfo> userList = null; |
| | | // 获取最近查询客户 |
| | | if (WebUtil.getSession().getAttribute(SystemConstance.HISTORY_CUSTOMER) == null) { |
| | | userList = new LinkedList<SysVipInfo>(); |
| | | WebUtil.getSession().setAttribute(SystemConstance.HISTORY_CUSTOMER, userList); |
| | | } else { |
| | | userList = (LinkedList<SysVipInfo>) WebUtil.getSession().getAttribute(SystemConstance.HISTORY_CUSTOMER); |
| | | } |
| | | List<SysVipInfo> vips = vipInfoService.findByVipNoOrTel(keyWord); |
| | | if (vips.size() > 0) { |
| | | // 在session存放当前查询的客户 |
| | | WebUtil.getSession().setAttribute(SystemConstance.CURRENT_CUSTOMER, vips.get(0)); |
| | | // 满20后删除一个 |
| | | if (userList.size() == 20) { |
| | | userList.poll(); |
| | | } |
| | | // 去重标志 |
| | | boolean isNoRepeat = true; |
| | | for (SysVipInfo sysVipInfo : userList) { |
| | | if (vips.get(0).getPhone().equals(sysVipInfo.getPhone())) { |
| | | isNoRepeat = false; |
| | | } |
| | | } |
| | | if (isNoRepeat) { |
| | | userList.add(vips.get(0)); |
| | | } |
| | | } |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, vips, 0); |
| | | |
| | | } |
| | | |
| | | @RequestMapping(value = "/getBirthday") |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/exportExcel") |
| | | public void report(ModelMap model, HttpServletRequest request, HttpServletResponse response, |
| | | public void report(HttpServletResponse response, |
| | | SysVipInfo vipInfo) |
| | | throws IOException { |
| | | |
| | | QueryUtil.setQueryLimitCom(vipInfo ); |
| | | if (vipInfo.getVipType() != null && !(vipInfo.getVipType().equals(""))) { |
| | | vipInfo.setVipType(URLDecoder.decode(vipInfo.getVipType(), "UTF-8")); |
| | | } |
| | | if (vipInfo.getVipName() != null && !"".equals(vipInfo.getVipName())) { |
| | | vipInfo.setVipName(URLDecoder.decode(vipInfo.getVipName(), "UTF-8")); |
| | | } |
| | | if (vipInfo.getArrivalWay() != null && !"".equals(vipInfo.getArrivalWay())) { |
| | | vipInfo.setArrivalWay(URLDecoder.decode(vipInfo.getArrivalWay(), "UTF-8")); |
| | | } |
| | | if (vipInfo.getVipState() != null && !"".equals(vipInfo.getVipState())) { |
| | | vipInfo.setVipState(URLDecoder.decode(vipInfo.getVipState(), "UTF-8")); |
| | | } |
| | | |
| | | |
| | | List<ExcelSheetPO> res = new ArrayList<>(); |
| | | ExcelSheetPO orderSheet = new ExcelSheetPO(); |
| | | String title = "每日单据明细"; |
| | | String title = "会员资料"; |
| | | orderSheet.setSheetName(title); |
| | | orderSheet.setTitle(title); |
| | | String[] header = {"会员编号", "姓名", "性别", "手机号码", "会员类型", "会员活跃度", "到店途径", "健康顾问", "所属门店"}; |