|  |  | 
 |  |  | package com.matrix.system.hive.action; | 
 |  |  |  | 
 |  |  | import cn.hutool.core.util.StrUtil; | 
 |  |  | import com.matrix.core.constance.MatrixConstance; | 
 |  |  | import com.matrix.core.exception.GlobleException; | 
 |  |  | import com.matrix.core.pojo.AjaxResult; | 
 |  |  | import com.matrix.core.pojo.PaginationVO; | 
 |  |  | import com.matrix.core.tools.DateUtil; | 
 |  |  | import com.matrix.core.tools.LogUtil; | 
 |  |  | import com.matrix.core.tools.StringUtils; | 
 |  |  | import com.matrix.core.tools.WebUtil; | 
 |  |  | import com.matrix.core.tools.*; | 
 |  |  | import com.matrix.core.tools.excl.ExcelSheetPO; | 
 |  |  | import com.matrix.core.tools.excl.ExcelUtil; | 
 |  |  | import com.matrix.system.common.bean.SysUsers; | 
 |  |  | import com.matrix.system.common.constance.AppConstance; | 
 |  |  | import com.matrix.system.constance.Dictionary; | 
 |  |  | import com.matrix.system.hive.bean.*; | 
 |  |  | import com.matrix.system.hive.dao.MoneyCardUseDao; | 
 |  |  | 
 |  |  | import com.matrix.system.hive.service.MoneyCardUseService; | 
 |  |  | import com.matrix.system.hive.service.SysProjUseService; | 
 |  |  | import com.matrix.system.hive.service.SysProjuseFreezeService; | 
 |  |  | import jodd.util.StringUtil; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.beans.factory.annotation.Value; | 
 |  |  | import org.springframework.stereotype.Controller; | 
 |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     @Value("${file_storage_path}") | 
 |  |  |     private String fileStoragePath; | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  | 
 |  |  |     public AjaxResult importVipInfo(HttpServletResponse response, HttpServletRequest request, @RequestParam(value = "file", required = false) MultipartFile file) throws IOException { | 
 |  |  |  | 
 |  |  |         String fileName = file.getOriginalFilename(); | 
 |  |  |         String dirPath = "E:"; | 
 |  |  |         //PropertiesUtil.getString(AppConstance.FILES_TORAGE_PATH); | 
 |  |  | //       String dirPath = "E:"; | 
 |  |  |        String dirPath =  fileStoragePath; | 
 |  |  |  | 
 |  |  |         File saveFile = new File(dirPath + "/" + fileName); | 
 |  |  |         file.transferTo(saveFile); | 
 |  |  |         File saveFile =new File (new File(dirPath).getAbsolutePath() + File.separator + fileName); | 
 |  |  |         if (!saveFile.exists()) | 
 |  |  |         { | 
 |  |  |             if (!saveFile.getParentFile().exists()) | 
 |  |  |             { | 
 |  |  |                 saveFile.getParentFile().mkdirs(); | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         file.transferTo(saveFile.getAbsoluteFile()); | 
 |  |  |  | 
 |  |  |         SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); | 
 |  |  |  | 
 |  |  | 
 |  |  |                 List<Object> objects = taocanDataList.get(j); | 
 |  |  |                 LogUtil.info("导入套餐第" + j + "行" + objects); | 
 |  |  |                 Object vipName = objects.get(0); | 
 |  |  |                 String vipNameStr = vipName.toString(); | 
 |  |  |                 String vipNameStr = vipName==null?"":vipName.toString(); | 
 |  |  |                 if (taocan == null | 
 |  |  |                         || (taocan != null && StringUtils.isNotBlank(vipNameStr))) { | 
 |  |  |                     //切换下一个套餐 | 
 |  |  | 
 |  |  |         Object tel = objects.get(1); | 
 |  |  |         if (tel != null) { | 
 |  |  |             String telStr = tel.toString(); | 
 |  |  |             SysVipInfo vipInfo = vipInfoDao.selectByPhone(telStr,sysUsers.getCompanyId()); | 
 |  |  |             SysVipInfo vipInfo = vipInfoDao.selectByPhone(StrUtil.trim(telStr),sysUsers.getCompanyId()); | 
 |  |  |             if (vipInfo == null) { | 
 |  |  |                 vipInfo = new SysVipInfo(); | 
 |  |  |                 vipInfo.setShopId(sysUsers.getShopId()); | 
 |  |  | 
 |  |  |         Object tel = objects.get(1); | 
 |  |  |         if (tel != null) { | 
 |  |  |             String telStr = tel.toString(); | 
 |  |  |             SysVipInfo vipInfo = vipInfoDao.selectByPhone(telStr,sysUsers.getCompanyId()); | 
 |  |  |             SysVipInfo vipInfo = vipInfoDao.selectByPhone(StrUtil.trim(telStr),sysUsers.getCompanyId()); | 
 |  |  |             if (vipInfo == null) { | 
 |  |  |                 vipInfo = new SysVipInfo(); | 
 |  |  |                 vipInfo.setShopId(sysUsers.getShopId()); |