...
|
...
|
@@ -70,7 +70,7 @@ public class SizePoolService implements ISizePoolService{ |
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
checkIsExistBrand(bo);
|
|
|
checkIsExistBrand(bo, null);
|
|
|
List<SizePoolImage> imageList = JSONArray.parseArray(bo.getImageInfoList(), SizePoolImage.class);
|
|
|
|
|
|
SizePool sizePool = new SizePool();
|
...
|
...
|
@@ -115,7 +115,7 @@ public class SizePoolService implements ISizePoolService{ |
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
checkIsExistBrand(bo);
|
|
|
checkIsExistBrand(bo, bo.getId());
|
|
|
|
|
|
List<SizePoolImage> imageList = JSONArray.parseArray(bo.getImageInfoList(), SizePoolImage.class);
|
|
|
|
...
|
...
|
@@ -131,7 +131,9 @@ public class SizePoolService implements ISizePoolService{ |
|
|
if(result == 0) {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
|
|
|
saveSizePoolImage(imageList, sizePool.getId());
|
|
|
|
|
|
//删除已存在的
|
|
|
batchDeleteSizePoolDetailByPoolId(bo.getId());
|
|
|
|
...
|
...
|
@@ -327,13 +329,18 @@ public class SizePoolService implements ISizePoolService{ |
|
|
return sizePoolDetailMapper.deleteBySizePoolId(sizePoolId);
|
|
|
}
|
|
|
|
|
|
private void checkIsExistBrand(SizePoolRequest bo) throws PlatformException {
|
|
|
private void checkIsExistBrand(SizePoolRequest bo, Integer sizePoolId) throws PlatformException {
|
|
|
if(!bo.getRangeType().equals(RANGE_TYPE_BRAND)) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
List<SizePoolDetail> list = sizePoolDetailMapper.queryByBrandId(bo.getIncludeBrandId());
|
|
|
if(CollectionUtils.isNotEmpty(list)) {
|
|
|
|
|
|
if (null != sizePoolId && list.size() == 1 && sizePoolId.equals(list.get(0).getSizePoolId())) { // 如果是修改场景,则如果是当前的修改的记录;则需要过滤掉
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
Brand brand = brandMapper.selectOneById(list.get(0).getItemId());
|
|
|
throw new PlatformException(brand.getBrandName() + "品牌已维护尺码表,请勿重复维护", 400);
|
|
|
}
|
...
|
...
|
|