|
@@ -146,14 +146,27 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
throw new RRException(r.get("msg").toString());
|
|
|
}
|
|
|
}
|
|
|
+ ThirdMerchantBizEntity thirdMerchantBizEntity = thirdMerchantBizDao.getThirdMerchangByCode(goods.getThirdPartyMerchCode());
|
|
|
+ if(thirdMerchantBizEntity == null){
|
|
|
+ throw new RRException("第三方商户信息不存在");
|
|
|
+ }
|
|
|
|
|
|
+ if(Dict.orderBizType.item_00.getItem().equalsIgnoreCase(goods.getGoodsBizType())){
|
|
|
+ if(Dict.isStockShare.item_1.getItem().equalsIgnoreCase(thirdMerchantBizEntity.getIsStockShare())){
|
|
|
+ builder.put("goodsNumber", "商品库存");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ r = ValidatorUtil.isEmpty(builder.build(), valideDate);
|
|
|
+ if (Integer.valueOf(r.get("code").toString()) != 0) {
|
|
|
+ throw new RRException(r.get("msg").toString());
|
|
|
+ }
|
|
|
// 商品轮播图
|
|
|
List<GoodsGalleryEntity> galleryEntityList = goods.getGoodsImgList();
|
|
|
if (galleryEntityList == null || galleryEntityList.size() <= 0) {
|
|
|
throw new RRException("至少添加一张商品轮播图!");
|
|
|
}
|
|
|
- GoodsEntity prodbarGoods = goodsDao.queryObjectByProdBarcode(goods.getProdBarcode(),goods.getMerchSn(),null);
|
|
|
- if(prodbarGoods != null){
|
|
|
+ List<GoodsEntity> prodbarGoodsList = goodsDao.queryObjectByProdBarcode(goods.getProdBarcode(),goods.getMerchSn(),null);
|
|
|
+ if(prodbarGoodsList != null && prodbarGoodsList.size() > 0){
|
|
|
throw new RRException("不能有重复的产品条码信息!");
|
|
|
}
|
|
|
|
|
@@ -306,14 +319,28 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
throw new RRException(r.get("msg").toString());
|
|
|
}
|
|
|
}
|
|
|
+ GoodsEntity goodsEntity = goodsDao.queryObject(goods.getId());
|
|
|
+ if(goodsEntity != null){
|
|
|
+ if(Dict.orderBizType.item_00.getItem().equalsIgnoreCase(goods.getGoodsBizType())){
|
|
|
+ if(Dict.isStockShare.item_1.getItem().equalsIgnoreCase(goodsEntity.getIsStockShare())){
|
|
|
+ builder.put("goodsNumber", "商品库存");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ r = ValidatorUtil.isEmpty(builder.build(), valideDate);
|
|
|
+ if (Integer.valueOf(r.get("code").toString()) != 0) {
|
|
|
+ throw new RRException(r.get("msg").toString());
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ throw new RRException("商品不存在");
|
|
|
+ }
|
|
|
|
|
|
// 商品轮播图
|
|
|
List<GoodsGalleryEntity> galleryEntityList = goods.getGoodsImgList();
|
|
|
if (galleryEntityList == null || galleryEntityList.size() <= 0) {
|
|
|
throw new RRException("至少保留一张商品轮播图!");
|
|
|
}
|
|
|
- GoodsEntity prodbarGoods = goodsDao.queryObjectByProdBarcode(goods.getProdBarcode(),goods.getMerchSn(),goods.getId());
|
|
|
- if(prodbarGoods != null){
|
|
|
+ List<GoodsEntity> prodbarGoodsList = goodsDao.queryObjectByProdBarcode(goods.getProdBarcode(),goods.getMerchSn(),goods.getId());
|
|
|
+ if(prodbarGoodsList != null && prodbarGoodsList.size() > 0){
|
|
|
throw new RRException("不能有重复的产品条码信息!");
|
|
|
}
|
|
|
SysUserEntity user = ShiroUtils.getUserEntity();
|
|
@@ -353,8 +380,6 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
mngChangeEntity.setIsValid(0);
|
|
|
mngChangeEntity.setMerchSn(goods.getMerchSn());
|
|
|
|
|
|
-
|
|
|
- GoodsEntity goodsEntity = goodsDao.queryObject(goods.getId());
|
|
|
if(goodsEntity.getGoodsNumber() != goods.getGoodsNumber()) {
|
|
|
if (goodsEntity.getGoodsNumber() > goods.getGoodsNumber()) {
|
|
|
mngChangeEntity.setChangeNum(goodsEntity.getGoodsNumber() - goods.getGoodsNumber());//变化数
|
|
@@ -705,8 +730,8 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
failGoodsTypeList.add(goodsDto.getGoodsBizType());
|
|
|
}
|
|
|
//校验产品条码是否存在
|
|
|
- GoodsEntity prodbarGoods = goodsDao.queryObjectByProdBarcode(goodsDto.getProdBarcode(),merchSn,null);
|
|
|
- if(prodbarGoods != null){
|
|
|
+ List<GoodsEntity> prodbarGoods = goodsDao.queryObjectByProdBarcode(goodsDto.getProdBarcode(),merchSn,null);
|
|
|
+ if(prodbarGoods != null && prodbarGoods.size() > 0){
|
|
|
isSuccess = true;
|
|
|
failProdbarGoodsSnList.add(goodsDto.getGoodsSn());
|
|
|
}else{
|