|
@@ -850,19 +850,20 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
|
|
|
}else{
|
|
|
throw new RRException("商品[" + storeGoodsDto.getGoodsSn() + "]未录入系统");
|
|
|
}
|
|
|
- CategoryEntity categoryEntity = categoryDao.queryObjectByName(storeGoodsDto.getAttributeCategory(), store.getMerchSn());
|
|
|
- if (categoryEntity != null) {
|
|
|
- storeRelaEntity.setAttributeCategory(categoryEntity.getId());
|
|
|
- }else{
|
|
|
- throw new RRException("商品[" + storeGoodsDto.getGoodsSn() + "]的二级类别输入有误");
|
|
|
- }
|
|
|
- CategoryEntity parentCategoryEntity = categoryDao.queryObjectByName(storeGoodsDto.getCategoryName(), store.getMerchSn());
|
|
|
- if (parentCategoryEntity != null && categoryEntity.getParentId().intValue()==parentCategoryEntity.getId().intValue()) {
|
|
|
+ CategoryEntity parentCategoryEntity = categoryDao.queryObjectByName(storeGoodsDto.getCategoryName(), store.getMerchSn(),0);
|
|
|
+ if (parentCategoryEntity != null) {
|
|
|
storeRelaEntity.setCategoryId(parentCategoryEntity.getId());
|
|
|
+ CategoryEntity categoryEntity = categoryDao.queryObjectByName(storeGoodsDto.getAttributeCategory(), store.getMerchSn(),parentCategoryEntity.getId());
|
|
|
+ if (categoryEntity != null) {
|
|
|
+ storeRelaEntity.setAttributeCategory(categoryEntity.getId());
|
|
|
+ }else{
|
|
|
+ throw new RRException("商品[" + storeGoodsDto.getGoodsSn() + "]的二级类别输入有误");
|
|
|
+ }
|
|
|
}else{
|
|
|
throw new RRException("商品[" + storeGoodsDto.getGoodsSn() + "]的一级类别输入有误");
|
|
|
}
|
|
|
- BrandEntity brandEntity = brandDao.queryObjectByName(storeGoodsDto.getBrandName(), store.getMerchSn());
|
|
|
+
|
|
|
+ BrandEntity brandEntity = brandDao.queryObjectByName(storeGoodsDto.getBrandName(), store.getMerchSn(),storeRelaEntity.getAttributeCategory());
|
|
|
if (brandEntity != null) {
|
|
|
storeRelaEntity.setBrandId(brandEntity.getId());
|
|
|
}else{
|
|
@@ -879,15 +880,15 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
|
|
|
throw new RRException("商品[" + storeGoodsDto.getGoodsSn() + "]的底线价不可以大于零售价");
|
|
|
}
|
|
|
// 查询批次号是否存在
|
|
|
- GoodsBatchEntity goodsBatchEntity = goodsBatchDao.queryByBatchSnAndSku(storeGoodsDto.getBatchSn(), goodsEntity.getSku());
|
|
|
- if (goodsBatchEntity!=null){
|
|
|
- storeRelaEntity.setBatchSn(goodsBatchEntity.getBatchSn());
|
|
|
- Date batchExpireDate = goodsBatchEntity.getBatchExpireDate();
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
- storeRelaEntity.setBatchExpireDate(sdf.format(batchExpireDate));
|
|
|
- }else{
|
|
|
-// throw new RRException("商品[" + storeGoodsDto.getGoodsSn() + "]的批次号不存在");
|
|
|
- }
|
|
|
+// GoodsBatchEntity goodsBatchEntity = goodsBatchDao.queryByBatchSnAndSku(storeGoodsDto.getBatchSn(), goodsEntity.getSku());
|
|
|
+// if (goodsBatchEntity!=null){
|
|
|
+// storeRelaEntity.setBatchSn(goodsBatchEntity.getBatchSn());
|
|
|
+// Date batchExpireDate = goodsBatchEntity.getBatchExpireDate();
|
|
|
+// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+// storeRelaEntity.setBatchExpireDate(sdf.format(batchExpireDate));
|
|
|
+// }else{
|
|
|
+//// throw new RRException("商品[" + storeGoodsDto.getGoodsSn() + "]的批次号不存在");
|
|
|
+// }
|
|
|
storeRelaEntity.setMarketPrice(new BigDecimal(storeGoodsDto.getMarketPrice()));
|
|
|
storeRelaEntity.setRetailPrice(new BigDecimal(storeGoodsDto.getRetailPrice()));
|
|
|
storeRelaEntity.setBottomLinePrice(storeGoodsDto.getBottomLinePrice());
|