|
|
@@ -10,10 +10,36 @@ import com.uas.platform.b2c.core.support.SystemSession;
|
|
|
import com.uas.platform.b2c.core.utils.NumberUtil;
|
|
|
import com.uas.platform.b2c.core.utils.RegexConstant;
|
|
|
import com.uas.platform.b2c.core.utils.StringUtilB2C;
|
|
|
-import com.uas.platform.b2c.prod.commodity.constant.*;
|
|
|
-import com.uas.platform.b2c.prod.commodity.dao.*;
|
|
|
-import com.uas.platform.b2c.prod.commodity.model.*;
|
|
|
-import com.uas.platform.b2c.prod.commodity.service.*;
|
|
|
+import com.uas.platform.b2c.prod.commodity.constant.DoubleConstant;
|
|
|
+import com.uas.platform.b2c.prod.commodity.constant.ErrorInfoConstant;
|
|
|
+import com.uas.platform.b2c.prod.commodity.constant.ModifyConstant;
|
|
|
+import com.uas.platform.b2c.prod.commodity.constant.ShortConstant;
|
|
|
+import com.uas.platform.b2c.prod.commodity.constant.StringConstant;
|
|
|
+import com.uas.platform.b2c.prod.commodity.constant.UploadConstant;
|
|
|
+import com.uas.platform.b2c.prod.commodity.dao.GoodsDao;
|
|
|
+import com.uas.platform.b2c.prod.commodity.dao.PCBDao;
|
|
|
+import com.uas.platform.b2c.prod.commodity.dao.PcbPropertyvalueDao;
|
|
|
+import com.uas.platform.b2c.prod.commodity.dao.ProductDao;
|
|
|
+import com.uas.platform.b2c.prod.commodity.dao.ProductPersonDao;
|
|
|
+import com.uas.platform.b2c.prod.commodity.dao.ReleaseProductByBatchDao;
|
|
|
+import com.uas.platform.b2c.prod.commodity.model.CommodityInOutbound;
|
|
|
+import com.uas.platform.b2c.prod.commodity.model.Goods;
|
|
|
+import com.uas.platform.b2c.prod.commodity.model.GoodsHistory;
|
|
|
+import com.uas.platform.b2c.prod.commodity.model.GoodsQtyPrice;
|
|
|
+import com.uas.platform.b2c.prod.commodity.model.InOutboundDetail;
|
|
|
+import com.uas.platform.b2c.prod.commodity.model.PCB;
|
|
|
+import com.uas.platform.b2c.prod.commodity.model.PCBPropertyValue;
|
|
|
+import com.uas.platform.b2c.prod.commodity.model.Product;
|
|
|
+import com.uas.platform.b2c.prod.commodity.model.ProductPerson;
|
|
|
+import com.uas.platform.b2c.prod.commodity.model.ProductPrivate;
|
|
|
+import com.uas.platform.b2c.prod.commodity.model.ReleaseProductByBatch;
|
|
|
+import com.uas.platform.b2c.prod.commodity.service.CommodityInOutboundService;
|
|
|
+import com.uas.platform.b2c.prod.commodity.service.GoodsHistoryService;
|
|
|
+import com.uas.platform.b2c.prod.commodity.service.GoodsService;
|
|
|
+import com.uas.platform.b2c.prod.commodity.service.InOutboundDetailService;
|
|
|
+import com.uas.platform.b2c.prod.commodity.service.ProductPrivateService;
|
|
|
+import com.uas.platform.b2c.prod.commodity.service.ProductService;
|
|
|
+import com.uas.platform.b2c.prod.commodity.service.ReleaseProductByBatchService;
|
|
|
import com.uas.platform.b2c.prod.commodity.util.GoodsUtil;
|
|
|
import com.uas.platform.b2c.prod.commodity.util.SheetUtil;
|
|
|
import com.uas.platform.b2c.prod.product.brand.dao.BrandInfoDao;
|
|
|
@@ -38,10 +64,13 @@ import com.uas.platform.core.persistence.criteria.PredicateUtils;
|
|
|
import com.uas.platform.core.persistence.criteria.SimpleExpression;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.commons.collections.map.HashedMap;
|
|
|
-import org.apache.log4j.Logger;
|
|
|
import org.apache.poi.hssf.usermodel.HSSFCell;
|
|
|
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
|
|
|
-import org.apache.poi.ss.usermodel.*;
|
|
|
+import org.apache.poi.ss.usermodel.Cell;
|
|
|
+import org.apache.poi.ss.usermodel.DateUtil;
|
|
|
+import org.apache.poi.ss.usermodel.Row;
|
|
|
+import org.apache.poi.ss.usermodel.Sheet;
|
|
|
+import org.apache.poi.ss.usermodel.Workbook;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.dao.DataAccessException;
|
|
|
@@ -109,9 +138,6 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
@Autowired
|
|
|
private RestTemplate restTemplate;
|
|
|
|
|
|
- @Autowired
|
|
|
- private ProductPrivateDao productPrivateDao;
|
|
|
-
|
|
|
@Autowired
|
|
|
private ProductPersonDao productPersonDao;
|
|
|
|
|
|
@@ -127,9 +153,6 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
@Autowired
|
|
|
private PcbPropertyvalueDao pcbPropertyvalueDao;
|
|
|
|
|
|
- @Autowired
|
|
|
- private V_ProductPrivateDao v_productPrivateDao;
|
|
|
-
|
|
|
@Autowired
|
|
|
private ProductService productService;
|
|
|
|
|
|
@@ -145,9 +168,6 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
@Autowired
|
|
|
private InOutboundDetailService inOutboundDetailService;
|
|
|
|
|
|
-
|
|
|
- private final Logger logger = Logger.getLogger(getClass());
|
|
|
-
|
|
|
/**
|
|
|
* 控制任务提交速度的线程池
|
|
|
*/
|
|
|
@@ -286,46 +306,60 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
} else {
|
|
|
strCount = productReleaseValid(enUU, batch);
|
|
|
}
|
|
|
- Integer filter = 0, failure = 0, success = 0;
|
|
|
if (!StringUtilB2C.isEmpty(strCount)) {
|
|
|
- String[] split = strCount.split(SplitChar.HYPHEN);
|
|
|
- if (split.length == 3) {
|
|
|
- filter = Integer.valueOf(split[0]);
|
|
|
- failure = Integer.valueOf(split[1]);
|
|
|
- success = Integer.valueOf(split[2]);
|
|
|
- } else {
|
|
|
- //上面的代码只能在正式上获取到返回值,为了在测试上执行,增加获取结果的代码
|
|
|
- Long userUU = SystemSession.getUser().getUserUU();
|
|
|
- filter = releaseProductByBatchDao.getCountOfImportFail(userUU, batch, failCode);
|
|
|
- failure = releaseProductByBatchDao.getCountPublisherUuAndBatchAndReleaseCode(userUU, batch, ReleaseStatus.failure.value());
|
|
|
- success = releaseProductByBatchDao.getCountPublisherUuAndBatchAndReleaseCode(userUU, batch, ReleaseStatus.success.value());
|
|
|
- }
|
|
|
+ checkReleaseCount(modelMap, strCount, batch);
|
|
|
}
|
|
|
if (!isAPerson && !isPcb) {
|
|
|
String publish = publishByBatch(batch, isPcb, ignoreImport);
|
|
|
modelMap.put("publish", publish);
|
|
|
}
|
|
|
modelMap.put("total", total);
|
|
|
- modelMap.put("success", success);
|
|
|
- modelMap.put("failure", failure);
|
|
|
- modelMap.put("filter", filter);
|
|
|
modelMap.put("batch", batch);
|
|
|
return modelMap;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 统计批量上传数据相关
|
|
|
+ *
|
|
|
+ * @param modelMap ModelMap
|
|
|
+ * @param strCount
|
|
|
+ * @param batch
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void checkReleaseCount(ModelMap modelMap, String strCount, String batch) {
|
|
|
+ Integer filter, failure, success;
|
|
|
+ String[] split = strCount.split(SplitChar.HYPHEN);
|
|
|
+ int splitIndex = 3;
|
|
|
+ if (split.length == splitIndex) {
|
|
|
+ filter = Integer.valueOf(split[0]);
|
|
|
+ failure = Integer.valueOf(split[1]);
|
|
|
+ success = Integer.valueOf(split[2]);
|
|
|
+ } else {
|
|
|
+ //上面的代码只能在正式上获取到返回值,为了在测试上执行,增加获取结果的代码
|
|
|
+ Long userUU = SystemSession.getUser().getUserUU();
|
|
|
+ filter = releaseProductByBatchDao.getCountOfImportFail(userUU, batch, failCode);
|
|
|
+ failure = releaseProductByBatchDao.getCountPublisherUuAndBatchAndReleaseCode(userUU, batch, ReleaseStatus.failure.value());
|
|
|
+ success = releaseProductByBatchDao.getCountPublisherUuAndBatchAndReleaseCode(userUU, batch, ReleaseStatus.success.value());
|
|
|
+ }
|
|
|
+ modelMap.put("success", success);
|
|
|
+ modelMap.put("failure", failure);
|
|
|
+ modelMap.put("filter", filter);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 判断是存在相同的信息
|
|
|
* @param releaseProductByBatchs
|
|
|
*/
|
|
|
- private void judgeSameReleaseProductByBatch(List<ReleaseProductByBatch> releaseProductByBatchs) {
|
|
|
+ @Override
|
|
|
+ public void judgeSameReleaseProductByBatch(List<ReleaseProductByBatch> releaseProductByBatchs) {
|
|
|
if (CollectionUtils.isEmpty(releaseProductByBatchs)) {
|
|
|
return ;
|
|
|
}
|
|
|
- for(int i = releaseProductByBatchs.size() - 1; i > -1; i--) {
|
|
|
+ for (int i = releaseProductByBatchs.size() - 1; i > -1; i--) {
|
|
|
ReleaseProductByBatch releaseProductByBatch = releaseProductByBatchs.get(i);
|
|
|
for (int j = i - 1; j > -1; j--) {
|
|
|
ReleaseProductByBatch byBatch = releaseProductByBatchs.get(j);
|
|
|
- if(releaseProductByBatch.compareSameProductTagInfo(byBatch)) {
|
|
|
+ if (releaseProductByBatch.compareSameProductTagInfo(byBatch)) {
|
|
|
releaseProductByBatch.setTag("");
|
|
|
releaseProductByBatch.setTagstr("");
|
|
|
releaseProductByBatch.addErrmsg(ErrorInfoConstant.REPEAT_IN_EXCEL.getInfo());
|
|
|
@@ -339,7 +373,6 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 根据上传的信息,查看是否在个人物料库已存在。
|
|
|
* @param releaseProductByBatchs
|
|
|
@@ -373,14 +406,14 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 调用存储过程
|
|
|
* @param enUU 企业的enUU
|
|
|
* @param batch 批次
|
|
|
* @return 验证结果
|
|
|
*/
|
|
|
- private String productReleaseValid(Long enUU, String batch) {
|
|
|
+ @Override
|
|
|
+ public String productReleaseValid(Long enUU, String batch) {
|
|
|
if (enUU == null || StringUtilB2C.isEmpty(batch)) {
|
|
|
return "0";
|
|
|
}
|
|
|
@@ -419,6 +452,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
throw new IllegalOperatorException("您上传的信息超过2000条,请拆分成2000以再在上传");
|
|
|
}
|
|
|
List<ReleaseProductByBatch> batchList = new ArrayList<>(rowNum);
|
|
|
+ List<ReleaseProductByBatch> repeatBatchList = new ArrayList<>(rowNum);
|
|
|
String batch = createNumberService.getTimeNumber("product$goods", 8, rowNum);
|
|
|
Row headerRow = sheet.getRow(1);
|
|
|
validateModifyExcel(headerRow);
|
|
|
@@ -433,7 +467,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
Object sellObj = readWorkBookCell(row.getCell(ModifyConstant.SALE_METHOD), Cell.CELL_TYPE_STRING,
|
|
|
r, ModifyConstant.SALE_METHOD);
|
|
|
aBatch.setSaleMethod(StringUtilB2C.getStr(sellObj).trim());
|
|
|
- StoreIn storeIn = getModifyStoreInfo(sellObj, self, consignment);
|
|
|
+ StoreIn storeIn = getModifyStoreInfo(sellObj, self, consignment, skuObj);
|
|
|
if (storeIn == null) {
|
|
|
aBatch.addErrmsg(ErrorInfoConstant.STORE_ERROR.getInfo());
|
|
|
aBatch.setErrmsg(aBatch.getErrmsg().substring(1));
|
|
|
@@ -454,13 +488,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
aBatch.setReleaseCode(ReleaseStatus.lack_info.value());
|
|
|
aBatch.setReleaseStatus(ReleaseStatus.lack_info.getPhrase());
|
|
|
} else {
|
|
|
- // 导入成功的需要判断自定义标签是否重复
|
|
|
-// if (CollectionUtils.isNotEmpty(batchList) && aBatch.getTag() != null) {
|
|
|
-// if (validateTagInfo(aBatch, batchList)) {
|
|
|
-// aBatch.setTag(null);
|
|
|
-// }
|
|
|
-// }
|
|
|
- validateRepeatInExcel(batchList, aBatch, true);
|
|
|
+ validateRepeatInExcel(batchList, aBatch, true, repeatBatchList);
|
|
|
}
|
|
|
batchList.add(aBatch);
|
|
|
total++;
|
|
|
@@ -471,10 +499,11 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
// resetRepeatData(batchList, true, false);
|
|
|
// setDefaultTag(batchList);
|
|
|
commonDao.save(batchList, ReleaseProductByBatch.class);
|
|
|
+ commonDao.save(repeatBatchList, ReleaseProductByBatch.class);
|
|
|
Integer filter = releaseProductByBatchDao.getCountOfImportFail(userUU, batch, failCode);
|
|
|
modelMap.put("total", total);
|
|
|
modelMap.put("success", success);
|
|
|
- modelMap.put("fail", batchList.size() - success);
|
|
|
+ modelMap.put("fail", batchList.size() - success + repeatBatchList.size());
|
|
|
modelMap.put("filter", filter);
|
|
|
modelMap.put("batch", batch);
|
|
|
return modelMap;
|
|
|
@@ -489,64 +518,125 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
if (CollectionUtils.isEmpty(batchList)) {
|
|
|
return result;
|
|
|
}
|
|
|
+ List<Long> productIds = new ArrayList<>(batchList.size());
|
|
|
List<String> batchCodes = new ArrayList<>();
|
|
|
for (ReleaseProductByBatch aBatch : batchList) {
|
|
|
- if (!StringUtilB2C.isEmpty(aBatch.getBatchCode())) {
|
|
|
+ if (!StringUtilB2C.isEmpty(aBatch.getBatchCode()) && RegexConstant.isNumber(aBatch.getBatchCode())
|
|
|
+ && StringUtilB2C.isEmpty(aBatch.getErrmsg())) {
|
|
|
+ productIds.add(Long.parseLong(aBatch.getBatchCode()));
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (!StringUtilB2C.isEmpty(aBatch.getBatchCode()) && StringUtilB2C.isEmpty(aBatch.getErrmsg())) {
|
|
|
batchCodes.add(aBatch.getBatchCode());
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ List<Product> products = new ArrayList<>();
|
|
|
+ if (CollectionUtils.isNotEmpty(productIds)) {
|
|
|
+ products = productDao.findProductInIds(productIds);
|
|
|
+ }
|
|
|
+ Product newProduct = null;
|
|
|
List<Goods> goodses = new ArrayList<>();
|
|
|
if (CollectionUtils.isNotEmpty(batchCodes)) {
|
|
|
goodses = goodsService.findGoodsByBatchCodes(batchCodes);
|
|
|
}
|
|
|
Goods newGoods = null;
|
|
|
List<GoodsHistory> goodsHistoryList = new ArrayList<>();
|
|
|
- for (ReleaseProductByBatch aBatch : batchList) {
|
|
|
+ for (ReleaseProductByBatch aBatch : batchList) {
|
|
|
newGoods = null;
|
|
|
- for (Goods goods : goodses) {
|
|
|
- if (goods.getBatchCode().equals(aBatch.getBatchCode())) {
|
|
|
- aBatch.setB2cBranden(goods.getBrandNameEn());
|
|
|
- aBatch.setBrandNameEn(goods.getBrandNameEn());
|
|
|
- aBatch.setKindName(goods.getKindNameCn());
|
|
|
- aBatch.setB2cCode(goods.getCode());
|
|
|
- aBatch.setCode(goods.getCode());
|
|
|
- aBatch.setCurrency(goods.getCurrencyName());
|
|
|
- if (goods.getUuid() == null) {
|
|
|
- aBatch.setReleaseCode(ReleaseStatus.failure.value());
|
|
|
- aBatch.setReleaseStatus(ReleaseStatus.failure.getPhrase());
|
|
|
+ if (!RegexConstant.isNumber(aBatch.getBatchCode())) {
|
|
|
+ for (Goods goods : goodses) {
|
|
|
+ if (goods.getBatchCode().equals(aBatch.getBatchCode())) {
|
|
|
+ aBatch.setB2cBranden(goods.getBrandNameEn());
|
|
|
+ aBatch.setBrandNameEn(goods.getBrandNameEn());
|
|
|
+ aBatch.setKindName(goods.getKindNameCn());
|
|
|
+ aBatch.setB2cCode(goods.getCode());
|
|
|
+ aBatch.setCode(goods.getCode());
|
|
|
+ aBatch.setCurrency(goods.getCurrencyName());
|
|
|
+ if (goods.getUuid() == null) {
|
|
|
+ aBatch.setReleaseCode(ReleaseStatus.failure.value());
|
|
|
+ aBatch.setReleaseStatus(ReleaseStatus.failure.getPhrase());
|
|
|
+ }
|
|
|
+ fillInGoods(goods, aBatch);
|
|
|
+ newGoods = goods;
|
|
|
+ break;
|
|
|
}
|
|
|
- fillInGoods(goods, aBatch);
|
|
|
- newGoods = goods;
|
|
|
- break;
|
|
|
}
|
|
|
- }
|
|
|
- if (newGoods == null) {
|
|
|
- newGoods = new Goods();
|
|
|
- TradeDeliveryDelayTime delayTime = getDelayTime(aBatch);
|
|
|
- newGoods.setGoodsByReleaseProductByBatch(aBatch, delayTime);
|
|
|
- goodsHistoryList.add(goodsHistoryService.converTGoodsHist(newGoods, GoodsHistory.OperateType.Publish.getPhrase(), false));
|
|
|
- }
|
|
|
- ResultMap resultMap = goodsService.updateGoods(newGoods);
|
|
|
- if (resultMap.isSuccess()) {
|
|
|
- Goods goods1 = (Goods) resultMap.getData();
|
|
|
- if (Status.REMOVED.value() == aBatch.getStatus() && Status.REMOVED.value() != goods1.getStatus()) {
|
|
|
- ResultMap offMap = goodsService.offShelfGoodsByProvider(newGoods.getBatchCode(), null, false);
|
|
|
- if (offMap.isSuccess()) {
|
|
|
- result++;
|
|
|
+ if (newGoods == null) {
|
|
|
+ newGoods = new Goods();
|
|
|
+ TradeDeliveryDelayTime delayTime = getDelayTime(aBatch);
|
|
|
+ newGoods.setGoodsByReleaseProductByBatch(aBatch, delayTime);
|
|
|
+ goodsHistoryList.add(goodsHistoryService.converTGoodsHist(newGoods, GoodsHistory.OperateType.Publish.getPhrase(), false));
|
|
|
+ }
|
|
|
+ ResultMap resultMap = goodsService.updateGoods(newGoods);
|
|
|
+ if (resultMap.isSuccess()) {
|
|
|
+ Goods goods1 = (Goods) resultMap.getData();
|
|
|
+ if (aBatch.getStatus() != null && goods1.getStatus() != null
|
|
|
+ && Status.REMOVED.value() == aBatch.getStatus() && Status.REMOVED.value() != goods1.getStatus()) {
|
|
|
+ ResultMap offMap = goodsService.offShelfGoodsByProvider(newGoods.getBatchCode(), null, false);
|
|
|
+ if (offMap.isSuccess()) {
|
|
|
+ result++;
|
|
|
+ } else {
|
|
|
+ aBatch.setErrmsg(offMap.getMessage());
|
|
|
+ aBatch.setReleaseCode(ReleaseStatus.lack_info.value());
|
|
|
+ aBatch.setReleaseStatus(ReleaseStatus.lack_info.getPhrase());
|
|
|
+ }
|
|
|
} else {
|
|
|
- aBatch.setErrmsg(offMap.getMessage());
|
|
|
- aBatch.setReleaseCode(ReleaseStatus.lack_info.value());
|
|
|
- aBatch.setReleaseStatus(ReleaseStatus.lack_info.getPhrase());
|
|
|
+ result++;
|
|
|
}
|
|
|
} else {
|
|
|
- result++;
|
|
|
+ aBatch.setErrmsg(resultMap.getMessage());
|
|
|
+ aBatch.setReleaseCode(ReleaseStatus.lack_info.value());
|
|
|
+ aBatch.setReleaseStatus(ReleaseStatus.lack_info.getPhrase());
|
|
|
}
|
|
|
} else {
|
|
|
- aBatch.setErrmsg(resultMap.getMessage());
|
|
|
- aBatch.setReleaseCode(ReleaseStatus.lack_info.value());
|
|
|
- aBatch.setReleaseStatus(ReleaseStatus.lack_info.getPhrase());
|
|
|
+ for (Product product : products) {
|
|
|
+ if (product.getId().equals(Long.parseLong(aBatch.getBatchCode()))) {
|
|
|
+ aBatch.setB2cCode(product.getPcmpcode());
|
|
|
+ aBatch.setProductNum(product.getProdNum());
|
|
|
+ aBatch.setBrandNameEn(product.getBrand());
|
|
|
+ aBatch.setKindName(product.getProdName());
|
|
|
+ aBatch.setCurrency(product.getCurrency());
|
|
|
+ aBatch.setProductNum(product.getProdNum());
|
|
|
+ newProduct = product;
|
|
|
+ InOutboundDetail inOutboundDetail = new InOutboundDetail(newProduct);
|
|
|
+ fillInProduct(newProduct, aBatch, inOutboundDetail);
|
|
|
+ Set<InOutboundDetail> set = new HashSet<>();
|
|
|
+ set.add(inOutboundDetail);
|
|
|
+ if (CollectionUtils.isNotEmpty(set)) {
|
|
|
+ Map<String, Set<InOutboundDetail>> inOutMap = inOutboundDetailService.initInOutboundDetailByQty(set);
|
|
|
+ Set<String> stringSet = inOutMap.keySet();
|
|
|
+ for (String type : stringSet) {
|
|
|
+ CommodityInOutbound commodityInOutbound = commodityInOutboundService.produceCommodityInOutbound(inOutMap.get(type), type);
|
|
|
+ if (commodityInOutbound != null) {
|
|
|
+ commodityInOutboundService.save(commodityInOutbound);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ productDao.save(newProduct);
|
|
|
+ result++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(newProduct)) {
|
|
|
+ aBatch.setErrmsg("物料SKU码有误");
|
|
|
+ aBatch.setReleaseCode(ReleaseStatus.lack_info.value());
|
|
|
+ aBatch.setReleaseStatus(ReleaseStatus.lack_info.getPhrase());
|
|
|
+ } else {
|
|
|
+ Goods needGoods = new Goods();
|
|
|
+ needGoods.setProductInfo(newProduct);
|
|
|
+ needGoods.setMinBuyQty(aBatch.getMinBuyQty() == null ? needGoods.getMinPackQty() : aBatch.getMinBuyQty());
|
|
|
+ if (StringUtils.isEmpty(needGoods.getSelfSale())) {
|
|
|
+ needGoods.setSelfSale("2");
|
|
|
+ }
|
|
|
+ goodsService.setGoodsDefault(needGoods);
|
|
|
+ needGoods.setStatus();
|
|
|
+ goodsDao.save(needGoods);
|
|
|
+ GoodsHistory history = goodsHistoryService.converTGoodsHist(needGoods,
|
|
|
+ GoodsHistory.OperateType.Update.getPhrase(), false);
|
|
|
+ // 修改上下架状态并产生上下架历史
|
|
|
+ goodsHistoryService.save(history);
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
@@ -664,11 +754,56 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
} else {
|
|
|
goods.setSelfSale("1");
|
|
|
}
|
|
|
+ if (null != aBatch.getCostPrice()) {
|
|
|
+ goods.setCostPrice(aBatch.getCostPrice());
|
|
|
+ }
|
|
|
goods.setSpec(aBatch.getSpec());
|
|
|
goods.setStatus(aBatch.getStatus());
|
|
|
}
|
|
|
|
|
|
- private StoreIn getModifyStoreInfo(Object value, StoreIn self, StoreIn consignment) {
|
|
|
+ private void fillInProduct(Product product, ReleaseProductByBatch aBatch, InOutboundDetail inOutboundDetail) {
|
|
|
+ if (!StringUtils.isEmpty(aBatch.getSpec())) {
|
|
|
+ product.setSpec(aBatch.getSpec());
|
|
|
+ }
|
|
|
+ if (!StringUtils.isEmpty(aBatch.getPackaging())) {
|
|
|
+ product.setPackaging(aBatch.getPackaging());
|
|
|
+ }
|
|
|
+ if (!StringUtils.isEmpty(aBatch.getSelfMinDelivery())) {
|
|
|
+ product.setMinDelivery(aBatch.getSelfMinDelivery());
|
|
|
+ }
|
|
|
+ if (!StringUtils.isEmpty(aBatch.getSelfMaxDelivery())) {
|
|
|
+ product.setMaxDelivery(aBatch.getSelfMaxDelivery());
|
|
|
+ }
|
|
|
+ if (!StringUtils.isEmpty(aBatch.getBreakUp())) {
|
|
|
+ product.setBreakUp(aBatch.getBreakUp());
|
|
|
+ }
|
|
|
+ if (!StringUtils.isEmpty(aBatch.getMinPackage())) {
|
|
|
+ product.setMinPackQty(aBatch.getMinPackage());
|
|
|
+ } else {
|
|
|
+ product.setMinPackQty(1d);
|
|
|
+ }
|
|
|
+ if (!StringUtils.isEmpty(aBatch.getCostPrice())) {
|
|
|
+ product.setPrice(aBatch.getCostPrice());
|
|
|
+ }
|
|
|
+ if (!StringUtils.isEmpty(aBatch.getReserve())) {
|
|
|
+ product.setErpReserve(aBatch.getReserve());
|
|
|
+ Double qty = NumberUtil.sub(aBatch.getReserve(), product.getErpReserve());
|
|
|
+ if (NumberUtil.compare(qty, DoubleConstant.zero) != 0) {
|
|
|
+ //做出入库记录
|
|
|
+ product.setErpReserve(aBatch.getReserve());
|
|
|
+ inOutboundDetail = new InOutboundDetail(product);
|
|
|
+ inOutboundDetail.setQty(qty);
|
|
|
+ inOutboundDetail.setPrice(aBatch.getCostPrice());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private StoreIn getModifyStoreInfo(Object value, StoreIn self, StoreIn consignment, Object bachCode) {
|
|
|
+ if (!StringUtils.isEmpty(bachCode)) {
|
|
|
+ if (RegexConstant.isNumber(bachCode.toString().trim())) {
|
|
|
+ return consignment;
|
|
|
+ }
|
|
|
+ }
|
|
|
List<String> sellList = Arrays.asList("自营", "寄售");
|
|
|
if (StringUtils.isEmpty(value) || !sellList.contains(StringUtilB2C.getStr(value))) {
|
|
|
return null;
|
|
|
@@ -754,6 +889,18 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
if (!StringUtils.isEmpty(statusValue)) {
|
|
|
aProduct.setCostPriceByExcel(statusValue);
|
|
|
}
|
|
|
+ Object status = readWorkBookCell(row.getCell(ModifyConstant.SALE_STATUS), Cell.CELL_TYPE_STRING,
|
|
|
+ rowNum, ModifyConstant.SALE_STATUS);
|
|
|
+ if (!StringUtils.isEmpty(status)) {
|
|
|
+ List<String> statuss = ReleaseProductByBatch.STATUS_LIST;
|
|
|
+ if (statuss.contains(status)) {
|
|
|
+ if (statuss.get(0).equals(status)) {
|
|
|
+ aProduct.setStatus(601);
|
|
|
+ } else {
|
|
|
+ aProduct.setStatus(612);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
// Object tagValue = readWorkBookCell(row.getCell(ModifyConstant.CUSTOM_LABEL), Cell.CELL_TYPE_STRING,
|
|
|
// rowNum, ModifyConstant.CUSTOM_LABEL);
|
|
|
@@ -782,29 +929,28 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
* @param aBatch
|
|
|
* @param isImport
|
|
|
*/
|
|
|
- private void validateRepeatInExcel(List<ReleaseProductByBatch> batchList, ReleaseProductByBatch aBatch, Boolean isImport) {
|
|
|
+ private void validateRepeatInExcel(List<ReleaseProductByBatch> batchList, ReleaseProductByBatch aBatch, Boolean isImport,
|
|
|
+ List<ReleaseProductByBatch> repeatBatchList) {
|
|
|
if (CollectionUtils.isEmpty(batchList) || !StringUtils.isEmpty(aBatch.getErrmsg()))
|
|
|
- return ;
|
|
|
- for (ReleaseProductByBatch each : batchList) {
|
|
|
- if (StringUtils.isEmpty(each.getErrmsg()) && each.equals(aBatch)) {
|
|
|
- aBatch.setErrmsg(ErrorInfoConstant.REPEAT_IN_EXCEL.getInfo());
|
|
|
- aBatch.setReleaseCode(ReleaseStatus.had_exists.value());
|
|
|
- aBatch.setReleaseStatus(ReleaseStatus.had_exists.getPhrase());
|
|
|
-// if (!isImport) {
|
|
|
-// aBatch.setErrmsg(ErrorInfoConstant.REPEAT_IN_EXCEL.getInfo());
|
|
|
-// aBatch.setReleaseCode(ReleaseStatus.had_exists.value());
|
|
|
-// aBatch.setReleaseStatus(ReleaseStatus.had_exists.getPhrase());
|
|
|
-// break;
|
|
|
-// } else {
|
|
|
-// if (GoodsUtil.compareWithQtyPrice(each.getPrices(), aBatch.getPrices(), each.getCurrency())) {
|
|
|
-// aBatch.setErrmsg(ErrorInfoConstant.REPEAT_IN_EXCEL.getInfo());
|
|
|
-// aBatch.setReleaseCode(ReleaseStatus.had_exists.value());
|
|
|
-// aBatch.setReleaseStatus(ReleaseStatus.had_exists.getPhrase());
|
|
|
-// break;
|
|
|
-// }
|
|
|
-// }
|
|
|
- }
|
|
|
- }
|
|
|
+ return;
|
|
|
+ Iterator<ReleaseProductByBatch> iterator = batchList.iterator();
|
|
|
+ while (iterator.hasNext()) {
|
|
|
+ ReleaseProductByBatch byBatch = iterator.next();
|
|
|
+ if (StringUtils.isEmpty(byBatch.getErrmsg()) && byBatch.equals(aBatch)) {
|
|
|
+ byBatch.setErrmsg(ErrorInfoConstant.REPEAT_IN_EXCEL.getInfo());
|
|
|
+ byBatch.setReleaseCode(ReleaseStatus.had_exists.value());
|
|
|
+ byBatch.setReleaseStatus(ReleaseStatus.had_exists.getPhrase());
|
|
|
+ repeatBatchList.add(byBatch);
|
|
|
+ iterator.remove();
|
|
|
+ }
|
|
|
+ }
|
|
|
+// for (ReleaseProductByBatch each : batchList) {
|
|
|
+// if (StringUtils.isEmpty(each.getErrmsg()) && each.equals(aBatch)) {
|
|
|
+// aBatch.setErrmsg(ErrorInfoConstant.REPEAT_IN_EXCEL.getInfo());
|
|
|
+// aBatch.setReleaseCode(ReleaseStatus.had_exists.value());
|
|
|
+// aBatch.setReleaseStatus(ReleaseStatus.had_exists.getPhrase());
|
|
|
+// }
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -857,21 +1003,6 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 验证该产品自定义标签是否重复
|
|
|
- * @param aProduct 单个产品
|
|
|
- * @param productSet 产品列表
|
|
|
- */
|
|
|
- private Boolean validateTagInfo(ReleaseProductByBatch aProduct, List<ReleaseProductByBatch> productSet) {
|
|
|
- for (ReleaseProductByBatch each : productSet) {
|
|
|
- if (aProduct.getBrandNameEn().equals(each.getBrandNameEn()) && aProduct.getCode().equals(each.getCode())
|
|
|
- && aProduct.getTag().equals(each.getTag())) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 验证该模板是否是商城模板
|
|
|
* @param headerRow 首行
|
|
|
@@ -879,7 +1010,8 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
* @param currency 币别
|
|
|
* @param isPcb 是否pcb模块
|
|
|
*/
|
|
|
- private void validateTemplate(Row headerRow, int colNum, String currency, boolean isAPerson, boolean isPcb) {
|
|
|
+ @Override
|
|
|
+ public void validateTemplate(Row headerRow, int colNum, String currency, boolean isAPerson, boolean isPcb) {
|
|
|
if (isAPerson) {
|
|
|
if (colNum == UploadConstant.MAX_TOTAL_COLUMN_PERSON) {
|
|
|
Cell errorCell = headerRow.getCell(UploadConstant.MAX_TOTAL_COLUMN_PERSON - 1);
|
|
|
@@ -939,11 +1071,17 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
* @param rowNum 行号
|
|
|
* @return
|
|
|
*/
|
|
|
- private boolean validateExcelData(Row row, int rowNum) {
|
|
|
+ @Override
|
|
|
+ public boolean validateExcelData(Row row, int rowNum) {
|
|
|
Object codeValue = readWorkBookCell(row.getCell(UploadConstant.PRODUCT_CODE), Cell.CELL_TYPE_STRING,
|
|
|
rowNum, UploadConstant.PRODUCT_CODE);
|
|
|
- if ("只能填数字、英文、英文特殊符号".equals(StringUtilB2C.getStr(codeValue)) || "SJ-S-112DMH(举例)".equals(StringUtilB2C.getStr(codeValue)))
|
|
|
- return false;
|
|
|
+ // 内容格式提示
|
|
|
+ String formatTip = "只能填数字、英文、英文特殊符号";
|
|
|
+ // 举例提示
|
|
|
+ String exampleTip = "SJ-S-112DMH(举例)";
|
|
|
+ if (formatTip.equals(StringUtilB2C.getStr(codeValue)) || exampleTip.equals(StringUtilB2C.getStr(codeValue))) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
@@ -982,52 +1120,13 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 分析分段的价格
|
|
|
- */
|
|
|
- private List<GoodsQtyPrice> setPricesQty(List<GoodsQtyPrice> prices, ReleaseProductByBatch productByBatch) {
|
|
|
- GoodsQtyPrice[] array = new GoodsQtyPrice[prices.size()];
|
|
|
- prices.toArray(array);
|
|
|
- Arrays.sort(array, new Comparator<GoodsQtyPrice>() {
|
|
|
- @Override
|
|
|
- public int compare(GoodsQtyPrice o1, GoodsQtyPrice o2) {
|
|
|
- return NumberUtil.compare(o1.getEnd(), o2.getEnd());
|
|
|
- }
|
|
|
- });
|
|
|
- List<GoodsQtyPrice> prices1 = Arrays.asList(array);
|
|
|
- List<GoodsQtyPrice> prices2 = new ArrayList<>();
|
|
|
- for (int j = 0; j < prices1.size(); j++) {
|
|
|
- GoodsQtyPrice price = prices1.get(j);
|
|
|
- if (j == 0) {
|
|
|
- if(NumberUtil.compare(price.getEnd(), DoubleConstant.minReserve) > -1) {
|
|
|
- price.setStart(DoubleConstant.minReserve);
|
|
|
- prices2.add(price);
|
|
|
- }
|
|
|
- } else if (j < prices1.size() - 1) {
|
|
|
- GoodsQtyPrice qtyPrice = prices1.get(j - 1);
|
|
|
- if(NumberUtil.compare(qtyPrice.getEnd(), price.getEnd()) < 0 ) {
|
|
|
- price.setStart(NumberUtil.add(qtyPrice.getEnd(), 1.0d));
|
|
|
- prices2.add(price);
|
|
|
- }
|
|
|
- } else if (j == prices1.size() - 1) {
|
|
|
- price.setEnd(DoubleConstant.maxMinPackageQty);
|
|
|
- if (prices1.size() == 1) {
|
|
|
- price.setStart(DoubleConstant.minReserve);
|
|
|
- } else {
|
|
|
- price.setStart(NumberUtil.add(prices1.get(j - 1).getEnd(), 1.0d));
|
|
|
- }
|
|
|
- prices2.add(price);
|
|
|
- }
|
|
|
- }
|
|
|
- return prices2;
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 获取店铺的信息
|
|
|
* @param selfSale
|
|
|
* @return
|
|
|
*/
|
|
|
- private StoreIn getStoreInfo(Boolean selfSale) {
|
|
|
+ @Override
|
|
|
+ public StoreIn getStoreInfo(Boolean selfSale) {
|
|
|
StoreIn storeIn = null;
|
|
|
if(selfSale) {
|
|
|
storeIn = storeInService.findByEnUU(SystemSession.getUser().getEnterprise().getUu());
|
|
|
@@ -1046,7 +1145,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
* @return
|
|
|
*/
|
|
|
private StoreIn getStoreIn(Boolean selfSale) {
|
|
|
- StoreIn storeIn = null;
|
|
|
+ StoreIn storeIn;
|
|
|
if (selfSale) {
|
|
|
storeIn = storeInService.findByEnUU(SystemSession.getUser().getEnterprise().getUu());
|
|
|
if((storeIn == null) || (storeIn.getStatus() != StoreStatus.OPENED)) {
|
|
|
@@ -1116,41 +1215,6 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 当分段价格为空时,设置默认分段价格
|
|
|
- * 其中分段1价格为必填项,这个是否还需要
|
|
|
- *
|
|
|
- * @param aProduct 单行数据
|
|
|
- * @param priceMaxMinPrice 最大和最小价格
|
|
|
- * @return
|
|
|
- */
|
|
|
- private GoodsQtyPrice getDefaultQtyPrice(ReleaseProductByBatch aProduct, Double[] priceMaxMinPrice) {
|
|
|
- GoodsQtyPrice qtyPrice = new GoodsQtyPrice();
|
|
|
- qtyPrice.setStart(aProduct.getMinBuyQty());
|
|
|
- if (Currency.USD.equals(aProduct.getCurrency())) {
|
|
|
- Double usdMinPackPrice = aProduct.getUsdMinPackPrice();
|
|
|
- if (usdMinPackPrice != null) {
|
|
|
- qtyPrice.setUSDPrice(usdMinPackPrice);
|
|
|
- qtyPrice.setUSDNTPrice(usdMinPackPrice);
|
|
|
- priceMaxMinPrice[0] = usdMinPackPrice;
|
|
|
- priceMaxMinPrice[1] = usdMinPackPrice;
|
|
|
- }
|
|
|
-
|
|
|
- } else {
|
|
|
- Double rmbMinPackPrice = aProduct.getRmbMinPackPrice();
|
|
|
- if (rmbMinPackPrice != null) {
|
|
|
- qtyPrice.setRMBPrice(rmbMinPackPrice);
|
|
|
- BigDecimal priceNum = new BigDecimal(rmbMinPackPrice);
|
|
|
- BigDecimal taxNum = new BigDecimal(aProduct.getRmbTaxRate() + 1);
|
|
|
- qtyPrice.setRMBNTPrice(priceNum.divide(taxNum, 6, BigDecimal.ROUND_HALF_UP).doubleValue());
|
|
|
- priceMaxMinPrice[0] = rmbMinPackPrice;
|
|
|
- priceMaxMinPrice[1] = rmbMinPackPrice;
|
|
|
- }
|
|
|
- }
|
|
|
- qtyPrice.setEnd(DoubleConstant.maxMinPackageQty);
|
|
|
- return qtyPrice;
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 初始化product信息,将excel内容转换为product字段值
|
|
|
* @param row 行对象
|
|
|
@@ -1158,7 +1222,8 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
* @param rowNum 行数
|
|
|
* @param isPcb 是否pcb模块
|
|
|
*/
|
|
|
- private int convertValueToProduct(Row row, ReleaseProductByBatch aProduct, int rowNum, boolean isAPerson, boolean isPcb) {
|
|
|
+ @Override
|
|
|
+ public int convertValueToProduct(Row row, ReleaseProductByBatch aProduct, int rowNum, boolean isAPerson, boolean isPcb) {
|
|
|
// 统计为空的个数
|
|
|
int result = 0;
|
|
|
aProduct.setNum(rowNum - 2);
|
|
|
@@ -1168,7 +1233,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
result += 1;
|
|
|
}
|
|
|
aProduct.setBrandEnByExcel(brandValue);
|
|
|
- // pcb模块判断类目是否为商城标准品牌
|
|
|
+ // pcb模块判断类目是否为商城标准品牌,是则补充标准品牌信息
|
|
|
if (isPcb && !StringUtils.isEmpty(aProduct.getBrandNameEn())) {
|
|
|
List<BrandInfo> brandInfos = brandInfoDao.findByName(aProduct.getBrandNameEn());
|
|
|
if (CollectionUtils.isNotEmpty(brandInfos)) {
|
|
|
@@ -1177,8 +1242,6 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
aProduct.setBranduuid(brandInfo.getUuid());
|
|
|
aProduct.setBrandId(brandInfo.getId());
|
|
|
}
|
|
|
- } else {
|
|
|
- aProduct.addErrmsg(ErrorInfoConstant.BRAND_UNSTANDARD.getInfo());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1266,10 +1329,6 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
aProduct.setMinBuyQtyByExcel(buyQtyValue);
|
|
|
|
|
|
aProduct.setTagByExcel("");
|
|
|
-// // 自定义标签不为null,则检查是否重复
|
|
|
-// if (aProduct.getCode() != null && aProduct.getBrandNameEn() != null && aProduct.getTag() != null) {
|
|
|
-// resetTag(aProduct);
|
|
|
-// }
|
|
|
|
|
|
// 如果是pcb模块,解析尺寸、颜色、铜厚、厚度
|
|
|
if (isPcb) {
|
|
|
@@ -1298,38 +1357,6 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 重新设置tag标签
|
|
|
- * @param aProduct
|
|
|
- */
|
|
|
- private void resetTag(ReleaseProductByBatch aProduct) {
|
|
|
- Long enuu = SystemSession.getUser().getEnterprise().getUu();
|
|
|
- int count = 0;
|
|
|
- List<Product> productList = productDao.findMatchStandard(enuu, aProduct.getBrandNameEn(), aProduct.getCode(), IntegerConstant.YES_SHORT);
|
|
|
- if (!CollectionUtils.isEmpty(productList)) {
|
|
|
- if (aProduct.getBatchCode() != null) {
|
|
|
- count = goodsDao.findCountByTagNotBatch(enuu, aProduct.getBatchCode(), productList.get(0).getPbranden(),
|
|
|
- productList.get(0).getPcmpcode(), aProduct.getTag());
|
|
|
- } else {
|
|
|
- count = goodsDao.findCountByTagInGoods(enuu, productList.get(0).getPbranden(),
|
|
|
- productList.get(0).getPcmpcode(), aProduct.getTag());
|
|
|
- }
|
|
|
-
|
|
|
- } else {
|
|
|
- if (aProduct.getBatchCode() != null) {
|
|
|
- count = goodsDao.findCountByTagNotBatch(enuu, aProduct.getBatchCode(), aProduct.getBrandNameEn(),
|
|
|
- aProduct.getCode(), aProduct.getTag());
|
|
|
- } else {
|
|
|
- count = goodsDao.findCountByTagInGoods(enuu, aProduct.getBrandNameEn(),
|
|
|
- aProduct.getCode(), aProduct.getTag());
|
|
|
- }
|
|
|
- }
|
|
|
- // 如果在该型号品牌已有重复,则忽略该自定义标签
|
|
|
- if (count != 0) {
|
|
|
- aProduct.setTag(null);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 初始化产品导入分段价格
|
|
|
* @param row 行对象
|
|
|
@@ -1549,7 +1576,8 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
* @throws @Description:
|
|
|
* 传入单元格,类型,返回值
|
|
|
*/
|
|
|
- private Object readWorkBookCell(Cell cell, int cellType, int r, int n) {
|
|
|
+ @Override
|
|
|
+ public Object readWorkBookCell(Cell cell, int cellType, int r, int n) {
|
|
|
Object obj = null;
|
|
|
try {
|
|
|
if (cell != null && cell.getCellType() != Cell.CELL_TYPE_BLANK) {
|
|
|
@@ -1561,9 +1589,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
throw new IllegalOperatorException("读取表格中"+ (r + 1)+"行"+ (n+1)+ "列的内容错误,需要文本格式的信息");
|
|
|
}
|
|
|
String str = cell.getStringCellValue().trim();
|
|
|
-// Object data = getCellData(cell);
|
|
|
-// String str = data == null ? "" : data.toString();
|
|
|
- if(str.indexOf("\u00A0") > -1){
|
|
|
+ if (str.indexOf("\u00A0") > -1){
|
|
|
str= str.replaceAll("\u00A0", "");
|
|
|
}
|
|
|
str = StringUtilB2C.replaceTabAndLineBreak(str);
|
|
|
@@ -2040,6 +2066,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
List<Product> productes = productService.findProductIdAndProdnumsByProdNums(proNums);
|
|
|
for (Product producte : productes) {
|
|
|
ProductPrivate productPrivate = new ProductPrivate(producte.getId());
|
|
|
+ productPrivate.setAttach(producte.getAttachment());
|
|
|
productPrivates.add(productPrivate);
|
|
|
|
|
|
prIds.add(producte.getId());
|