|
|
@@ -41,6 +41,7 @@ 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.type.ReleaseConstant;
|
|
|
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;
|
|
|
@@ -871,21 +872,15 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
|
|
|
Object breakValue = readWorkBookCell(row.getCell(ModifyConstant.BREAK_UP), Cell.CELL_TYPE_STRING,
|
|
|
rowNum, ModifyConstant.BREAK_UP);
|
|
|
- if (!StringUtils.isEmpty(breakValue)) {
|
|
|
- aProduct.setBreakUpByExcel(breakValue);
|
|
|
- }
|
|
|
+ aProduct.setBreakUpByExcel(breakValue);
|
|
|
|
|
|
Object packageNumValue = readWorkBookCell(row.getCell(ModifyConstant.PACKAGE_NUMBER), Cell.CELL_TYPE_STRING,
|
|
|
rowNum, ModifyConstant.PACKAGE_NUMBER);
|
|
|
- if (!StringUtils.isEmpty(packageNumValue)) {
|
|
|
- aProduct.setMinPackageByExcel(packageNumValue);
|
|
|
- }
|
|
|
+ aProduct.setMinPackageByExcel(packageNumValue);
|
|
|
|
|
|
Object buyQtyValue = readWorkBookCell(row.getCell(ModifyConstant.BUY_MIN_QTY), Cell.CELL_TYPE_STRING,
|
|
|
rowNum, ModifyConstant.BUY_MIN_QTY);
|
|
|
- if (!StringUtils.isEmpty(buyQtyValue)) {
|
|
|
- aProduct.setMinBuyQtyByExcel(buyQtyValue);
|
|
|
- }
|
|
|
+ aProduct.setMinBuyQtyByExcel(buyQtyValue);
|
|
|
|
|
|
Object reserveValue = readWorkBookCell(row.getCell(ModifyConstant.RESERVE_NUMBER), Cell.CELL_TYPE_STRING,
|
|
|
rowNum, ModifyConstant.RESERVE_NUMBER);
|
|
|
@@ -1193,10 +1188,11 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
|
|
|
/**
|
|
|
* 设置交期的信息
|
|
|
+ * @param releaseProductByBatch 批量导入临时表对象
|
|
|
+ * @param minDelivery 最短交期
|
|
|
+ * @param maxDelivery 最长交期
|
|
|
*/
|
|
|
private void setDeliveryTime(ReleaseProductByBatch releaseProductByBatch, Object minDelivery, Object maxDelivery) {
|
|
|
- minDelivery = minDelivery == null ? maxDelivery : minDelivery;
|
|
|
- maxDelivery = maxDelivery == null ? minDelivery : maxDelivery;
|
|
|
Short min = getDeliveryTime(minDelivery);
|
|
|
Short max = getDeliveryTime(maxDelivery);
|
|
|
if ((min != null) || (max != null)) {
|
|
|
@@ -1221,6 +1217,10 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
}
|
|
|
releaseProductByBatch.setSelfMinDelivery(min);
|
|
|
releaseProductByBatch.setSelfMaxDelivery(max);
|
|
|
+ } else {
|
|
|
+ // 设置默认值
|
|
|
+ releaseProductByBatch.setSelfMinDelivery(ReleaseConstant.DEFAULT_MIN_DELIVERY);
|
|
|
+ releaseProductByBatch.setSelfMaxDelivery(ReleaseConstant.DEFAULT_MAX_DELIVERY);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1318,16 +1318,14 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
|
|
|
Object packageMethodValue = readWorkBookCell(row.getCell(UploadConstant.PACKAGE_METHOD), Cell.CELL_TYPE_STRING,
|
|
|
rowNum, UploadConstant.PACKAGE_METHOD);
|
|
|
- aProduct.setPackagingByExcel(packageMethodValue , isAPerson);
|
|
|
+ aProduct.setPackagingByExcel(packageMethodValue, isAPerson);
|
|
|
|
|
|
Object minValue = readWorkBookCell(row.getCell(UploadConstant.MIN_DELIVERY), Cell.CELL_TYPE_STRING,
|
|
|
- rowNum, UploadConstant.MIN_DELIVERY);
|
|
|
+ rowNum, UploadConstant.MIN_DELIVERY);
|
|
|
Object maxValue = readWorkBookCell(row.getCell(UploadConstant.MAX_DELIVERY), Cell.CELL_TYPE_STRING,
|
|
|
rowNum, UploadConstant.MAX_DELIVERY);
|
|
|
aProduct.setDeliveryByExcel(minValue, maxValue);
|
|
|
- if (!StringUtils.isEmpty(minValue) || !StringUtils.isEmpty(maxValue)) {
|
|
|
- setDeliveryTime(aProduct, minValue, maxValue);
|
|
|
- }
|
|
|
+ setDeliveryTime(aProduct, minValue, maxValue);
|
|
|
|
|
|
Object packageNumValue = readWorkBookCell(row.getCell(UploadConstant.PACKAGE_NUMBER), Cell.CELL_TYPE_STRING,
|
|
|
rowNum, UploadConstant.PACKAGE_NUMBER);
|
|
|
@@ -1361,7 +1359,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
} else {
|
|
|
Object packageMethodValue = readWorkBookCell(row.getCell(UploadConstant.SPECIFICATION), Cell.CELL_TYPE_STRING,
|
|
|
rowNum, UploadConstant.SPECIFICATION);
|
|
|
- aProduct.setPackagingByExcel(packageMethodValue , isAPerson);
|
|
|
+ aProduct.setPackagingByExcel(packageMethodValue, isAPerson);
|
|
|
}
|
|
|
return result;
|
|
|
}
|