| package com.matrix.system.hive.action; | 
|   | 
| 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.*; | 
| 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.CustomerDataDictionary; | 
| import com.matrix.system.common.bean.SystemDictionary; | 
| import com.matrix.system.common.bean.SysUsers; | 
| import com.matrix.system.common.constance.AppConstance; | 
| import com.matrix.system.common.dao.CustomerDataDictionaryDao; | 
| import com.matrix.system.common.service.SystemDictionaryService; | 
| import com.matrix.system.common.service.SysUsersService; | 
| 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.util.QueryUtil; | 
| import com.matrix.system.hive.bean.*; | 
| 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 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.RequestParam; | 
| import org.springframework.web.bind.annotation.ResponseBody; | 
| import org.springframework.web.multipart.MultipartFile; | 
|   | 
| import javax.annotation.Resource; | 
| import javax.servlet.http.HttpServletRequest; | 
| import javax.servlet.http.HttpServletResponse; | 
| import java.io.File; | 
| 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.*; | 
|   | 
|   | 
| /** | 
|  * @author jyy | 
|  * @description 会员信息管理action | 
|  * @date 2016-07-12 | 
|  */ | 
| @Controller | 
| @RequestMapping(value = "admin/vipInfo") | 
| public class VipInfoController extends BaseController { | 
|     @Resource | 
|     private SysVipInfoService vipInfoService; | 
|   | 
|     @Resource | 
|     private SysVipLevelService vipLevelService; | 
|   | 
|     @Resource | 
|     private SysUsersService shopstaffInfoService; | 
|   | 
|     @Autowired | 
|     private VipAnswerDao vipAnswerDao; | 
|     @Resource | 
|     private QuestionSerivce questionSerivce; | 
|     @Resource | 
|     private MoneyCardUseService cardUseService; | 
|   | 
|     @Autowired | 
|     private MoneyCardUseDao moneyCardUseDao; | 
|   | 
|     @Autowired | 
|     private SystemDictionaryService dataDictionaryService; | 
|   | 
|     @Autowired | 
|     private CustomerDataDictionaryDao customerDataDictionaryDao; | 
|   | 
|   | 
|     @RequestMapping(value = "/showVipLevel") | 
|     public @ResponseBody | 
|     AjaxResult findVipLevel() { | 
|         // 会员卡等级信息 | 
|         List<SysVipLevel> vipLevels = vipLevelService.findByModel(null); | 
|         return new AjaxResult(AjaxResult.STATUS_SUCCESS, vipLevels, 0); | 
|     } | 
|   | 
|     /** | 
|      * 显示所有的会员信息 | 
|      */ | 
|     @RequestMapping(value = "/showVipInfoList") | 
|     public @ResponseBody | 
|     AjaxResult showList(PaginationVO pageVo, SysVipInfo vipInfo) { | 
|   | 
| //        if (!getMe().getShopRole().equals(Dictionary.FLAG_YES_Y)) { | 
|         vipInfo.setShopId(getMe().getShopId()); | 
| //        } | 
|         return showList(vipInfoService, vipInfo, pageVo); | 
|     } | 
|   | 
|     /** | 
|      * 门店查看会员信息 | 
|      * | 
|      * @author luoyuanhong | 
|      * @date 2016-06-24 | 
|      */ | 
|     @SuppressWarnings("unchecked") | 
|     @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存放当前查询的客户 | 
|             vips.get(0).setLevelCard(cardUseService.findByVipId(vips.get(0).getId())); | 
|             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)); | 
|             } | 
|             vips.get(0).setBalance(moneyCardUseDao.selectVipCardTotalMoney(vips.get(0).getId())); | 
|             AjaxResult result=  new AjaxResult(AjaxResult.STATUS_SUCCESS, vips, 0); | 
|             return result; | 
|         }else{ | 
|             return AjaxResult.buildFailInstance("未查到询客户信息"); | 
|         } | 
|   | 
|     } | 
|   | 
|   | 
|     /** | 
|      * 通过姓名或者电话号码 | 
|      */ | 
|     @RequestMapping(value = "/findUserByPhotoOrName") | 
|     public @ResponseBody | 
|     AjaxResult findUserByPhotoOrName(String keyWord) { | 
|         return new AjaxResult(AjaxResult.STATUS_SUCCESS, vipInfoService.findUserByKey(keyWord), 0); | 
|     } | 
|   | 
|   | 
|     /** | 
|      * 添加或修改会员信息 | 
|      */ | 
|     @RequestMapping(value = "/addOrModify") | 
|     @RemoveRequestToken | 
|     public @ResponseBody | 
|     AjaxResult addOrModify(SysVipInfo vipInfo) { | 
|         if (vipInfo.getId() != null) { | 
|   | 
|             try { | 
|                 if (vipInfo.getPassWord() != null) { | 
|                     vipInfo.setPassWord(EncrypUtil.getMD5(vipInfo.getPassWord())); | 
|                 } | 
|             } catch (UnsupportedEncodingException | NoSuchAlgorithmException e) { | 
|                 e.printStackTrace(); | 
|             } | 
|             return modify(vipInfoService, vipInfo, "会员信息"); | 
|         } else { | 
|   | 
|             try { | 
|                 if (StringUtils.isNotBlank(vipInfo.getPassWord())) { | 
|                     vipInfo.setPassWord(EncrypUtil.getMD5(vipInfo.getPassWord())); | 
|                 } | 
|                 vipInfo.setVipState(Dictionary.VIP_STATE_HY); | 
|             } catch (UnsupportedEncodingException | NoSuchAlgorithmException e) { | 
|                 e.printStackTrace(); | 
|             } | 
|             SysUsers users = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); | 
|             vipInfo.setShopId(users.getShopId()); | 
|             return add(vipInfoService, vipInfo, "会员信息"); | 
|         } | 
|     } | 
|   | 
|   | 
|     /** | 
|      * 保存客户的 | 
|      * | 
|      * @param vipInfo | 
|      * @return | 
|      */ | 
|     @RequestMapping(value = "/modifyVipArchives") | 
|     public @ResponseBody | 
|     AjaxResult modifyVipArchives(@RequestBody SysVipInfo vipInfo) { | 
|         VipAnswer delAnswer = new VipAnswer(); | 
|         delAnswer.setVipId(vipInfo.getId()); | 
|         vipAnswerDao.deleteByModel(delAnswer); | 
|         if (vipInfo.getVipAnswers() != null && vipInfo.getVipAnswers().size() > 0) { | 
|             vipAnswerDao.batchInsert(vipInfo.getVipAnswers()); | 
|         } | 
|         AjaxResult result = new AjaxResult(); | 
|         result.setStatus(AjaxResult.STATUS_SUCCESS); | 
|         result.setInfo("档案更新成功"); | 
|         return result; | 
|     } | 
|   | 
|   | 
|     /** | 
|      * 删除会员信息 | 
|      */ | 
|     @RequestMapping(value = "/del") | 
|     public @ResponseBody | 
|     AjaxResult del(String keys) { | 
|   | 
|         return remove(vipInfoService, keys); | 
|     } | 
|   | 
|     /** | 
|      * 弹出框,会员信息 | 
|      */ | 
|     @RequestMapping(value = "/editForm") | 
|     @SaveRequestToken | 
|     public String editForm(Long id, HttpServletRequest request) { | 
|         SysVipInfo vipInfo; | 
|         // 查询所有美疗师,由于是手动添加,因此不用框架中的下拉框方式 | 
|         List<SysUsers> mlslist = new ArrayList<SysUsers>(); | 
|   | 
|         if (!getMe().getShopRole().equals(Dictionary.FLAG_YES_Y)) { | 
|             mlslist = shopstaffInfoService.findByRoleName(true, Dictionary.STAFF_POST_MLS); | 
|         } else { | 
|             mlslist = shopstaffInfoService.findByRoleName(false, Dictionary.STAFF_POST_MLS); | 
|         } | 
|   | 
|   | 
|         request.setAttribute("mlslist", mlslist); | 
|   | 
|   | 
|         // vip信息 | 
|         if (id != null) { | 
|             vipInfo = vipInfoService.findById(id); | 
|             request.setAttribute("obj", vipInfo); | 
|         } | 
|         return "admin/hive/vip/vipInfo-form"; | 
|     } | 
|   | 
|   | 
|     @RequestMapping(value = "/getVipQuestions") | 
|     public @ResponseBody | 
|     AjaxResult getVipQuestions(Long id, HttpServletRequest request) { | 
|         // 获取会员所有的答案,分类型 | 
|         List<Question> questions = questionSerivce.findByVipId(id); | 
|         request.setAttribute("questions", questions); | 
|         AjaxResult result = new AjaxResult(); | 
|         result.putInMap("questions", questions); | 
|         result.setStatus(AjaxResult.STATUS_SUCCESS); | 
|         return result; | 
|     } | 
|   | 
|   | 
|     /** | 
|      * 编辑会员备注 | 
|      */ | 
|     @RequestMapping(value = "/editRemarkForm") | 
|     @SaveRequestToken | 
|     public String editRemarkForm(Long id, HttpServletRequest request) { | 
|         SysVipInfo vipInfo; | 
|         vipInfo = vipInfoService.findById(id); | 
|         request.setAttribute("obj", vipInfo); | 
|         return "admin/hive/vip/vipInfo-remark-form"; | 
|     } | 
|   | 
|   | 
|     /** | 
|      * 批量修改健康顾问 | 
|      */ | 
|     @RequestMapping(value = "/updateVipInfos") | 
|     public @ResponseBody | 
|     AjaxResult updateVipInfos(String ids, Long staffId) { | 
|   | 
|         int i = vipInfoService.updateStaffId(ids, staffId); | 
|         return new AjaxResult(AjaxResult.STATUS_SUCCESS, "成功修改" + i + "条数据!"); | 
|     } | 
|   | 
|     /** | 
|      * 客户到访录入 | 
|      */ | 
|     @RequestMapping(value = "/toVisitInfo") | 
|     public String toVisitInfo() { | 
|         Long shopId = getMe().getShopId(); | 
|   | 
|         SystemDictionary dataDictionary = new SystemDictionary(); | 
|         // 获取到店途径 | 
|         dataDictionary.setType("到店途径"); | 
|         WebUtil.getRequest().setAttribute("ddtj", dataDictionaryService.findByModel(dataDictionary)); | 
|         // 业务类型 | 
|         dataDictionary.setType("业务类型"); | 
|         WebUtil.getRequest().setAttribute("ywlx", dataDictionaryService.findByModel(dataDictionary)); | 
|         // 门店信息 | 
|         WebUtil.getRequest().setAttribute("shopNmae", getMe().getShopName()); | 
|         WebUtil.getRequest().setAttribute("staffName", getMe().getSuName()); | 
|         // 登录者门店的美疗师信息 | 
|         WebUtil.getRequest().setAttribute("mls", shopstaffInfoService.findByRoleName(true, Dictionary.STAFF_POST_MLS)); | 
|         return "admin/hive/mobile/CRM-visit"; | 
|     } | 
|   | 
|   | 
|     /** | 
|      * 钉钉点击注册 | 
|      */ | 
|     @RequestMapping(value = "/toRegister") | 
|     public String toRegister() { | 
|         SystemDictionary dataDictionary = new SystemDictionary(); | 
|         // 获取到店途径 | 
|         dataDictionary.setType("到店途径"); | 
|         WebUtil.getRequest().setAttribute("ddtj", customerDataDictionaryDao.selectByParentCode("DDTJ",getMe().getCompanyId())); | 
|         // 获取生肖 | 
|         dataDictionary.setType("生肖"); | 
|         WebUtil.getRequest().setAttribute("sx", dataDictionaryService.findByModel(dataDictionary)); | 
|         // 获取星座 | 
|         dataDictionary.setType("星座"); | 
|         WebUtil.getRequest().setAttribute("xz", dataDictionaryService.findByModel(dataDictionary)); | 
|         // 获取 | 
|         // 获取会员等级 | 
|         WebUtil.getRequest().setAttribute("level", vipLevelService.findByModel(null)); | 
|         return "admin/hive/mobile/CRM-vip"; | 
|     } | 
|   | 
|     /** | 
|      * 会员注册 | 
|      */ | 
|     @RequestMapping(value = "/registerVipInfo") | 
|     public @ResponseBody | 
|     AjaxResult register(RegisterInfo vipInfo) { | 
|   | 
|         vipInfo.setBirthday1(DateUtil.stringToDate(vipInfo.getVoBirthday(), "yyyy-MM-dd")); | 
|         vipInfo.setVipState(Dictionary.VIP_STATE_HY); | 
|         vipInfo.setStaffId(getMe().getSuId()); | 
|         vipInfo.setShopId(getMe().getShopId()); | 
|         vipInfo.setVipType(Dictionary.VIP_TYPE_NOCARD); | 
|         vipInfoService.add(vipInfo); | 
|         return new AjaxResult(AjaxResult.STATUS_SUCCESS, "会员信息注册成功"); | 
|     } | 
|   | 
|   | 
|     /** | 
|      * 修改会员信息 | 
|      */ | 
|     @RequestMapping(value = "/modifyVip") | 
|     public @ResponseBody | 
|     AjaxResult modifyVip(SysVipInfo vipInfo) { | 
|         return modify(vipInfoService, vipInfo, "会员"); | 
|     } | 
|   | 
|   | 
|     /** | 
|      * 通过电话号码模糊查询 | 
|      */ | 
|     @RequestMapping(value = "/findUserByPhoto") | 
|     public @ResponseBody | 
|     AjaxResult findUserByPhoto(String keyWord) { | 
|         return new AjaxResult(AjaxResult.STATUS_SUCCESS, vipInfoService.findUserByKey(keyWord), 0); | 
|     } | 
|   | 
|     /** | 
|      * 通过Id查询vip信息 | 
|      */ | 
|     @RequestMapping(value = "/findUserById") | 
|     public @ResponseBody | 
|     AjaxResult findUserById(Long id) { | 
|         SysVipInfo vipInfo = vipInfoService.findById(id); | 
|         vipInfo.setBalance(moneyCardUseDao.selectVipCardTotalMoney(id)); | 
|         vipInfo.setLevelCard(cardUseService.findByVipId(vipInfo.getId())); | 
|         return new AjaxResult(AjaxResult.STATUS_SUCCESS, Arrays.asList(vipInfo), 0); | 
|     } | 
|   | 
|   | 
|     /** | 
|      * 查询会员等级 | 
|      */ | 
|     @RequestMapping(value = "/findVipLevel") | 
|     public @ResponseBody | 
|     AjaxResult findVipLevel(SysVipLevel sysVipLevel) { | 
|         return new AjaxResult(AjaxResult.STATUS_SUCCESS, vipLevelService.findByModel(sysVipLevel), 0); | 
|     } | 
|   | 
|     /** | 
|      * 通过电话号码精确查询 | 
|      */ | 
|     @RequestMapping(value = "/findUserPho") | 
|     public @ResponseBody | 
|     AjaxResult findUserPho(SysVipInfo info) { | 
|         //System.out.println(info.getPhone()); | 
|         return new AjaxResult(AjaxResult.STATUS_SUCCESS, vipInfoService.findByModel1(info), 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") | 
|     public @ResponseBody | 
|     AjaxResult getBirthday(SysVipInfo info) { | 
|         Calendar c = Calendar.getInstance(); | 
|         c.setTime(info.getBirthday1()); | 
|         //获取年份 | 
|         int year = c.get(Calendar.YEAR); | 
|         //获取月份 | 
|         int month = c.get(Calendar.MONTH) + 1; | 
|         //获取日 | 
|         int day = c.get(Calendar.DATE); | 
|   | 
|         //星座 | 
|         String xz = DateUtil.getConstellation(month, day); | 
|   | 
|   | 
|         SysVipInfo vip = new SysVipInfo(); | 
|         vip.setConstell(xz); | 
|         List<SysVipInfo> vipList = new ArrayList<SysVipInfo>(); | 
|         vipList.add(vip); | 
|         return new AjaxResult(AjaxResult.STATUS_SUCCESS, vipList, 0); | 
|     } | 
|   | 
|     @RequestMapping(value = "/exportExcel") | 
|     public void report(ModelMap model, HttpServletRequest request, HttpServletResponse response, | 
|                        SysVipInfo vipInfo) throws IOException { | 
|   | 
|         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 = "每日单据明细"; | 
|         orderSheet.setSheetName(title); | 
|         orderSheet.setTitle(title); | 
|         String[] header = {"会员编号", "姓名", "性别", "手机号码", "会员类型", "会员活跃度", "到店途径", "健康顾问", "所属门店"}; | 
|         orderSheet.setHeaders(header); | 
|         QueryUtil.setQueryLimit(vipInfo); | 
|         List<SysVipInfo> dataList = vipInfoService.findInPage(vipInfo, null); | 
|         List<List<Object>> list = new ArrayList<>(); | 
|         if (dataList.size() > 0) { | 
|             for (SysVipInfo item : dataList) { | 
|                 List<Object> temp = new ArrayList<>(); | 
|                 temp.add(item.getVipNo()); | 
|                 temp.add(item.getVipName()); | 
|                 temp.add(item.getSex()); | 
|                 temp.add(item.getPhone()); | 
|                 temp.add(item.getVipType()); | 
|                 temp.add(item.getVipState()); | 
|                 temp.add(item.getArrivalWay()); | 
|                 temp.add(item.getStaffName()); | 
|                 temp.add(item.getShopName()); | 
|                 list.add(temp); | 
|             } | 
|         } | 
|         orderSheet.setDataList(list); | 
|         res.add(orderSheet); | 
|         response = ResponseHeadUtil.setExcelHead(response); | 
|         response.setHeader("Content-Disposition", | 
|                 "attachment;filename=" + URLEncoder.encode(title + DateUtil.getTimeMark() + ".xlsx".trim(), "UTF-8")); | 
|         OutputStream os = response.getOutputStream(); | 
|         ExcelUtil.createWorkbookAtOutStream(ExcelVersion.V2007, res, os, true); | 
|   | 
|     } | 
|   | 
|     @RequestMapping(value = "/findAllVipInfo") | 
|     @ResponseBody | 
|     public AjaxResult findAllVipInfo() { | 
|         return showList(vipInfoService, null, null); | 
|     } | 
|   | 
|     @RequestMapping(value = "/findAllVipInfoWithShop") | 
|     @ResponseBody | 
|     public AjaxResult findAllVipInfoWithShop() { | 
|         SysVipInfo info = new SysVipInfo(); | 
|         info.setShopId(getMe().getShopId()); | 
|         return showList(vipInfoService, info, null); | 
|     } | 
|   | 
|     @RequestMapping(value = "/importVipInfo") | 
|     @ResponseBody | 
|     public AjaxResult importVipInfo(HttpServletResponse response, HttpServletRequest request, @RequestParam(value = "file", required = false) MultipartFile file) throws IOException { | 
|   | 
|         String fileName = file.getOriginalFilename(); | 
|         String dirPath = PropertiesUtil.getString(AppConstance.FILES_TORAGE_PATH); | 
| //        String dirPath = "C:/Users/wzy19/Desktop/zq"; | 
|         File fileDir = new File(dirPath); | 
|         LogUtil.info("#----->{}#", fileDir.exists()); | 
|         if (!fileDir.exists()) { | 
|             fileDir.mkdirs(); | 
|         } | 
|   | 
|         File saveFile = new File(dirPath + "/" + fileName); | 
|         file.transferTo(saveFile); | 
|   | 
|         int i = vipInfoService.importVipInfo(saveFile); | 
|         if (i > 0) { | 
|             return new AjaxResult(AjaxResult.STATUS_SUCCESS, "导入成功"); | 
|         } else { | 
|             return new AjaxResult(AjaxResult.STATUS_FAIL, "导入失败"); | 
|         } | 
|     } | 
|   | 
|     @RequestMapping(value = "/toImportForm") | 
|     public String toImportForm() { | 
|         return "admin/hive/vip/vipImport-form"; | 
|     } | 
| } |