|  |  |  | 
|---|
|  |  |  | 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; | 
|---|
|  |  |  | 
|---|
|  |  |  | 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 =  PropertiesUtil.getString(AppConstance.FILES_TORAGE_PATH); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | File saveFile = new File(dirPath + "/" + fileName); | 
|---|
|  |  |  | file.transferTo(saveFile); | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<ExcelSheetPO> excelSheetPOList = ExcelUtil.readExcel(saveFile, null, null); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /* | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //项目资料导入 | 
|---|
|  |  |  | List<List<Object>> dataList = excelSheetPOList.get(0).getDataList(); | 
|---|
|  |  |  | List<SysProjUse> projUseList = new ArrayList<>(); | 
|---|
|  |  |  | 
|---|
|  |  |  | 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))) { | 
|---|
|  |  |  | //切换下一个套餐 | 
|---|
|  |  |  | 
|---|
|  |  |  | //套餐资料导入=======end=== | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | //充值卡资料导入 | 
|---|
|  |  |  | List<List<Object>> cardList = excelSheetPOList.get(2).getDataList(); | 
|---|
|  |  |  | List<MoneyCardUse> cardUseArrayList = new ArrayList<>(); | 
|---|
|  |  |  | 
|---|
|  |  |  | vipInfoDao.insert(vipInfo); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | String goodNo = String.valueOf(objects.get(3)); | 
|---|
|  |  |  | String goodName = String.valueOf(objects.get(2)).trim(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ShoppingGoods goods = shoppingGoodsDao.findByCode(goodNo); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | String goodName = String.valueOf(objects.get(2)).trim(); | 
|---|
|  |  |  | if("储值卡".equals(goodName)){ | 
|---|
|  |  |  | goods= shoppingGoodsDao.selectVipCzGoods(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (goods != null || "储值卡".equals(goodName)) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | moneyCardUse.setVipId(vipInfo.getId()); | 
|---|