From 6c235963d6fc46b38ea59d9b19c6519b892e080b Mon Sep 17 00:00:00 2001 From: xiaoyong931011 <15274802129@163.com> Date: Mon, 16 May 2022 09:42:06 +0800 Subject: [PATCH] 20220516 逻辑删除,更新字段IS_Delete字段为已删除,默认为空,删除后其余信息从查询中过滤了 --- zq-erp/src/main/java/com/matrix/system/hive/action/ProjUseController.java | 43 ++++++++++++++++++++++++++----------------- 1 files changed, 26 insertions(+), 17 deletions(-) diff --git a/zq-erp/src/main/java/com/matrix/system/hive/action/ProjUseController.java b/zq-erp/src/main/java/com/matrix/system/hive/action/ProjUseController.java index 29c757c..a3883d9 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/action/ProjUseController.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/action/ProjUseController.java @@ -4,20 +4,17 @@ 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.dao.ShoppingGoodsDao; import com.matrix.system.hive.dao.SysProjUseDao; import com.matrix.system.hive.dao.SysVipInfoDao; -import com.matrix.system.hive.plugin.message.StringUtil; import com.matrix.system.hive.plugin.util.CollectionUtils; import com.matrix.system.hive.service.MoneyCardUseService; import com.matrix.system.hive.service.SysProjUseService; @@ -237,6 +234,8 @@ } + @Value("${file_storage_path}") + private String fileStoragePath; @@ -246,17 +245,24 @@ 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<ExcelSheetPO> excelSheetPOList = ExcelUtil.readExcel(saveFile, null, null); -/* + //项目资料导入 List<List<Object>> dataList = excelSheetPOList.get(0).getDataList(); List<SysProjUse> projUseList = new ArrayList<>(); @@ -281,7 +287,7 @@ 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))) { //切换下一个套餐 @@ -300,7 +306,6 @@ //套餐资料导入=======end=== -*/ //充值卡资料导入 List<List<Object>> cardList = excelSheetPOList.get(2).getDataList(); List<MoneyCardUse> cardUseArrayList = new ArrayList<>(); @@ -323,7 +328,7 @@ Object tel = objects.get(1); if (tel != null) { String telStr = tel.toString(); - SysVipInfo vipInfo = vipInfoDao.selectByPhone(telStr); + SysVipInfo vipInfo = vipInfoDao.selectByPhone(telStr,sysUsers.getCompanyId()); if (vipInfo == null) { vipInfo = new SysVipInfo(); vipInfo.setShopId(sysUsers.getShopId()); @@ -380,7 +385,7 @@ Object tel = objects.get(1); if (tel != null) { String telStr = tel.toString(); - SysVipInfo vipInfo = vipInfoDao.selectByPhone(telStr); + SysVipInfo vipInfo = vipInfoDao.selectByPhone(telStr,sysUsers.getCompanyId()); if (vipInfo == null) { vipInfo = new SysVipInfo(); vipInfo.setShopId(sysUsers.getShopId()); @@ -390,10 +395,14 @@ 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()); -- Gitblit v1.9.1