|
@@ -635,7 +635,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
public int uploadExcel(List<GoodsDto> goodsEntityList,int exportDataType) {
|
|
|
SysUserEntity user = ShiroUtils.getUserEntity();
|
|
|
String merchSn = user.getMerchSn();
|
|
|
- boolean isSuccess = false;
|
|
|
+ boolean isFail = false;
|
|
|
List<String> failSameSkuList = new ArrayList<>(), failHotGoodsSnList = new ArrayList<>(),
|
|
|
failSuppGoodsSnList = new ArrayList<>(),
|
|
|
failUnitGoodsSnList = new ArrayList<>(), failNationGoodsSnList = new ArrayList<>(),failProdbarGoodsSnList = new ArrayList<>(),
|
|
@@ -694,7 +694,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
if(!(Dict.orderBizType.item_02.getItem().equalsIgnoreCase(goodsDto.getGoodsBizType())
|
|
|
|| Dict.orderBizType.item_10.getItem().equalsIgnoreCase(goodsDto.getGoodsBizType())
|
|
|
|| Dict.orderBizType.item_00.getItem().equalsIgnoreCase(goodsDto.getGoodsBizType()))){
|
|
|
- isSuccess = true;
|
|
|
+ isFail = true;
|
|
|
failTypeGoodsSnList.add(goodsDto.getSku());
|
|
|
}
|
|
|
}
|
|
@@ -705,12 +705,12 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
|
|
|
if(!user.getRoleType().equalsIgnoreCase(Dict.roleType.item_1.getItem())) {
|
|
|
if (!merchSn.equalsIgnoreCase(thirdMerchantBizEntity.getMerchSn())) {
|
|
|
- isSuccess = true;
|
|
|
+ isFail = true;
|
|
|
failMerchUserGoodsSnList.add(goodsDto.getGoodsSn());
|
|
|
}
|
|
|
}
|
|
|
}else{//商户不存在
|
|
|
- isSuccess = true;
|
|
|
+ isFail = true;
|
|
|
failMerchGoodsSnList.add(goodsDto.getGoodsSn());
|
|
|
}
|
|
|
|
|
@@ -722,7 +722,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
map.put("goodsBizType", goodsDto.getGoodsBizType());
|
|
|
List<GoodsEntity> list = querySame(map);
|
|
|
if (list != null && list.size() != 0) {
|
|
|
- isSuccess = true;
|
|
|
+ isFail = true;
|
|
|
if(goodsDto.getSku()!=null) {
|
|
|
failSameSkuList.add(goodsDto.getSku());
|
|
|
}
|
|
@@ -732,7 +732,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
//校验产品条码是否存在
|
|
|
List<GoodsEntity> prodbarGoods = goodsDao.queryObjectByProdBarcode(goodsDto.getProdBarcode(),merchSn,null);
|
|
|
if(prodbarGoods != null && prodbarGoods.size() > 0){
|
|
|
- isSuccess = true;
|
|
|
+ isFail = true;
|
|
|
failProdbarGoodsSnList.add(goodsDto.getGoodsSn());
|
|
|
}else{
|
|
|
goodsEntity.setProdBarcode(goodsDto.getProdBarcode());
|
|
@@ -741,14 +741,14 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
if (Dict.orderBizType.item_02.getItem().equals(goodsDto.getGoodsBizType())
|
|
|
|| Dict.orderBizType.item_10.getItem().equals(goodsDto.getGoodsBizType())) {
|
|
|
if(goodsDto.getIsHotStr().equalsIgnoreCase("1")){
|
|
|
- isSuccess = true;
|
|
|
+ isFail = true;
|
|
|
failHotGoodsSnList.add(goodsDto.getGoodsSn());
|
|
|
}
|
|
|
}
|
|
|
if(thirdMerchantBizEntity != null) {
|
|
|
SupplierEntity supplierEntity = supplierDao.queryObjectByName(goodsDto.getSupplierName(), thirdMerchantBizEntity.getMerchSn());
|
|
|
if (supplierEntity == null) {
|
|
|
- isSuccess = true;
|
|
|
+ isFail = true;
|
|
|
failSuppGoodsSnList.add(goodsDto.getGoodsSn());
|
|
|
} else {
|
|
|
goodsEntity.setSupplierId(supplierEntity.getId());
|
|
@@ -757,20 +757,20 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
//商品配置校验
|
|
|
/*CategoryEntity categoryEntity = categoryDao.queryObjectByName(goodsDto.getCategoryName(),goodsDto.getMerchSn());
|
|
|
if(categoryEntity==null){
|
|
|
- isSuccess = true;
|
|
|
+ isFail = true;
|
|
|
failCateGoodsSnList.add(goodsDto.getGoodsSn());
|
|
|
}else{
|
|
|
if(categoryEntity.getLevel().equalsIgnoreCase("L2")) {
|
|
|
goodsEntity.setCategoryId(categoryEntity.getId());
|
|
|
goodsEntity.setAttributeCategory(categoryEntity.getParentId());
|
|
|
}else{
|
|
|
- isSuccess = true;
|
|
|
+ isFail = true;
|
|
|
failCateL2GoodsSnList.add(goodsDto.getGoodsSn());
|
|
|
}
|
|
|
}
|
|
|
BrandEntity brandEntity = brandDao.queryObjectByName(goodsDto.getBrandName(),goodsDto.getMerchSn());
|
|
|
if (brandEntity == null) {
|
|
|
- isSuccess = true;
|
|
|
+ isFail = true;
|
|
|
failBrandGoodsSnList.add(goodsDto.getGoodsSn());
|
|
|
} else {
|
|
|
goodsEntity.setBrandId(brandEntity.getId());
|
|
@@ -778,7 +778,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
//运费
|
|
|
FreightEntity freightEntity = freightDao.queryObjectByName(goodsDto.getDefaultFreight(),goodsDto.getMerchSn());
|
|
|
if(freightEntity==null){
|
|
|
- isSuccess = true;
|
|
|
+ isFail = true;
|
|
|
failFreightGoodsSnList.add(goodsDto.getGoodsSn());
|
|
|
failFreightList.add(goodsDto.getDefaultFreight());
|
|
|
}else {
|
|
@@ -787,7 +787,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
if (!Dict.orderBizType.item_11.getItem().equals(goodsDto.getGoodsBizType())) {
|
|
|
SysCusUnitCodeEntity sysCusUnitCodeEntity = sysCusUnitCodeDao.queryObjectByName(goodsDto.getUnitName());
|
|
|
if (sysCusUnitCodeEntity == null) {
|
|
|
- isSuccess = true;
|
|
|
+ isFail = true;
|
|
|
failUnitGoodsSnList.add(goodsDto.getGoodsSn());
|
|
|
} else {
|
|
|
goodsEntity.setUnitCode(sysCusUnitCodeEntity.getCode());
|
|
@@ -795,7 +795,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
//原产国
|
|
|
SysCusNationCodeEntity sysCusNationCodeEntity = sysCusNationCodeDao.queryObjectByName(goodsDto.getOriCntName());
|
|
|
if (sysCusNationCodeEntity == null) {
|
|
|
- isSuccess = true;
|
|
|
+ isFail = true;
|
|
|
failNationGoodsSnList.add(goodsDto.getGoodsSn());
|
|
|
} else {
|
|
|
goodsEntity.setOriCntCode(sysCusNationCodeEntity.getCode());
|
|
@@ -824,7 +824,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
goodsEntity.setUpdateTime(new Date());
|
|
|
goodsEntity.setModTime(new Date());
|
|
|
|
|
|
- if(!isSuccess){
|
|
|
+ if(!isFail){
|
|
|
GoodsEntity goods = goodsDao.queryObjectBySn(goodsDto.getGoodsSn());
|
|
|
if(goods!=null) {// 修改商品
|
|
|
goodsEntity.setId(goods.getId());
|