| | |
| | | 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 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); |
| | | } |
| | | |
| | |
| | | @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") |