|
@ -63,7 +63,8 @@ public class GoodsAccreditServiceImpl extends ServiceImpl<GoodsAccreditMapper,Go |
|
|
public GoodsAccreditBo tranGoodsAccreditBo(GoodsAccreditImportBo importBo) { |
|
|
public GoodsAccreditBo tranGoodsAccreditBo(GoodsAccreditImportBo importBo) { |
|
|
importBo.setSuccessFlag(true); |
|
|
importBo.setSuccessFlag(true); |
|
|
GoodsAccreditBo accreditBo = CopierUtil.copy(importBo,new GoodsAccreditBo()); |
|
|
GoodsAccreditBo accreditBo = CopierUtil.copy(importBo,new GoodsAccreditBo()); |
|
|
|
|
|
//导入使用局部更新
|
|
|
|
|
|
accreditBo.setOnlyPastUpdate(true); |
|
|
List<String> onlySaleRegionCodes = importBo.getOnlySaleRegionCodes(); |
|
|
List<String> onlySaleRegionCodes = importBo.getOnlySaleRegionCodes(); |
|
|
if(CollUtil.isNotEmpty(onlySaleRegionCodes)){ |
|
|
if(CollUtil.isNotEmpty(onlySaleRegionCodes)){ |
|
|
List<BmsRegion> saleRegionList = regionMapper.selectList( |
|
|
List<BmsRegion> saleRegionList = regionMapper.selectList( |
|
@ -430,8 +431,27 @@ public class GoodsAccreditServiceImpl extends ServiceImpl<GoodsAccreditMapper,Go |
|
|
boolean b6 = CollUtil.isNotEmpty(param.getNotInSupplierIds()); |
|
|
boolean b6 = CollUtil.isNotEmpty(param.getNotInSupplierIds()); |
|
|
|
|
|
|
|
|
//清空历史
|
|
|
//清空历史
|
|
|
goodsAccreditItemService.remove(new LambdaQueryWrapper<GoodsAccreditItem>() |
|
|
if(!param.isOnlyPastUpdate()){ |
|
|
.eq(GoodsAccreditItem::getAccId,goodsAccredit.getId())); |
|
|
goodsAccreditItemService.remove(new LambdaQueryWrapper<GoodsAccreditItem>() |
|
|
|
|
|
.eq(GoodsAccreditItem::getAccId,goodsAccredit.getId())); |
|
|
|
|
|
}else { |
|
|
|
|
|
// in 或者 not in
|
|
|
|
|
|
int accType = (b2||b4||b6)?1:0; |
|
|
|
|
|
String targetType; |
|
|
|
|
|
if(b3||b4){ |
|
|
|
|
|
targetType = "bizRegion"; |
|
|
|
|
|
}else if (b5 || b6){ |
|
|
|
|
|
targetType = "supplier"; |
|
|
|
|
|
}else { |
|
|
|
|
|
targetType = "saleRegion"; |
|
|
|
|
|
} |
|
|
|
|
|
goodsAccreditItemService.remove( |
|
|
|
|
|
new LambdaQueryWrapper<GoodsAccreditItem>() |
|
|
|
|
|
.eq(GoodsAccreditItem::getAccId,goodsAccredit.getId()) |
|
|
|
|
|
.eq(GoodsAccreditItem::getAccType,accType) |
|
|
|
|
|
.eq(GoodsAccreditItem::getTargetType,targetType) |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if(!b1 && !b2 && !b3 && !b4 && !b5 && !b6){ |
|
|
if(!b1 && !b2 && !b3 && !b4 && !b5 && !b6){ |
|
|
if(goodsAccredit.getId()!=null){ |
|
|
if(goodsAccredit.getId()!=null){ |
|
|