|
@ -84,7 +84,13 @@ public class BirActivityCenterGoodsServiceImpl extends ServiceImpl<BirActivityCe |
|
|
LocalDate endDate = LocalDate.of(year,month,lastDayNum2); |
|
|
LocalDate endDate = LocalDate.of(year,month,lastDayNum2); |
|
|
//加载所有异动的数据
|
|
|
//加载所有异动的数据
|
|
|
List<TbsActivityCenterGoods> activityCenterGoodsAllList = this.baseMapper.selectChangeCenterGoods(startDate,endDate,null); |
|
|
List<TbsActivityCenterGoods> activityCenterGoodsAllList = this.baseMapper.selectChangeCenterGoods(startDate,endDate,null); |
|
|
// List<TbsActivityCenterGoods> activityCenterGoodsAllList = this.baseMapper.selectChangeCenterGoods(null,null,15840L);
|
|
|
|
|
|
|
|
|
//异常状态的费用申请,导致的Bir
|
|
|
|
|
|
List<BirActivityCenterGoods> removeErrorBirList = this.baseMapper.selectErrorBir(); |
|
|
|
|
|
List<Long> errorActIds = removeErrorBirList.stream().map(BirActivityCenterGoods::getActivityId).distinct().collect(Collectors.toList()); |
|
|
|
|
|
this.buildRemoveRecode(errorActIds); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(activityCenterGoodsAllList.size()<1){ |
|
|
if(activityCenterGoodsAllList.size()<1){ |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
@ -93,23 +99,7 @@ public class BirActivityCenterGoodsServiceImpl extends ServiceImpl<BirActivityCe |
|
|
// 删除历史数据
|
|
|
// 删除历史数据
|
|
|
List<Long> activityIds = activityCenterGoodsAllList.stream().filter(a->a.getId()!=null) |
|
|
List<Long> activityIds = activityCenterGoodsAllList.stream().filter(a->a.getId()!=null) |
|
|
.map(TbsActivityCenterGoods::getActivityId).collect(Collectors.toList()); |
|
|
.map(TbsActivityCenterGoods::getActivityId).collect(Collectors.toList()); |
|
|
LambdaQueryWrapper<BirActivityCenterGoods> birBaseActivityLqw = new LambdaQueryWrapper<>(); |
|
|
this.buildRemoveRecode(activityIds); |
|
|
birBaseActivityLqw.in(BirActivityCenterGoods::getActivityId,activityIds); |
|
|
|
|
|
|
|
|
|
|
|
List<BirActivityCenterGoods> removeBirList = this.list(birBaseActivityLqw); |
|
|
|
|
|
if(removeBirList.size()>0){ |
|
|
|
|
|
List<BirRemoveId> removeIds = removeBirList.stream().map(a-> { |
|
|
|
|
|
BirRemoveId birRemoveId = new BirRemoveId(); |
|
|
|
|
|
birRemoveId.setDeleteTime(LocalDateTime.now()); |
|
|
|
|
|
birRemoveId.setId(a.getId()); |
|
|
|
|
|
return birRemoveId; |
|
|
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
removeIds.forEach(a->{ |
|
|
|
|
|
birRemoveIdMapper.insert(a); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
this.remove(birBaseActivityLqw); |
|
|
|
|
|
|
|
|
|
|
|
List<BirActivityCenterGoods> noExist = this.baseMapper.selectNoExistCenterGoods(); |
|
|
List<BirActivityCenterGoods> noExist = this.baseMapper.selectNoExistCenterGoods(); |
|
|
if(noExist.size()>0){ |
|
|
if(noExist.size()>0){ |
|
@ -212,6 +202,26 @@ public class BirActivityCenterGoodsServiceImpl extends ServiceImpl<BirActivityCe |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void buildRemoveRecode(List<Long> activityIds) { |
|
|
|
|
|
LambdaQueryWrapper<BirActivityCenterGoods> birBaseActivityLqw = new LambdaQueryWrapper<>(); |
|
|
|
|
|
birBaseActivityLqw.in(BirActivityCenterGoods::getActivityId, activityIds); |
|
|
|
|
|
|
|
|
|
|
|
List<BirActivityCenterGoods> removeBirList = this.list(birBaseActivityLqw); |
|
|
|
|
|
if(removeBirList.size()>0){ |
|
|
|
|
|
List<BirRemoveId> removeIds = removeBirList.stream().map(a-> { |
|
|
|
|
|
BirRemoveId birRemoveId = new BirRemoveId(); |
|
|
|
|
|
birRemoveId.setDeleteTime(LocalDateTime.now()); |
|
|
|
|
|
birRemoveId.setId(a.getId()); |
|
|
|
|
|
return birRemoveId; |
|
|
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
removeIds.forEach(a->{ |
|
|
|
|
|
birRemoveIdMapper.insert(a); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
this.remove(birBaseActivityLqw); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 创建底表对象 |
|
|
* 创建底表对象 |
|
|
* @param costCenterList |
|
|
* @param costCenterList |
|
|