|
@ -67,7 +67,6 @@ public class BmsSupplierApplicationService { |
|
|
* @param newRegionId |
|
|
* @param newRegionId |
|
|
*/ |
|
|
*/ |
|
|
public void migrateRegion(String supplierId, String regionType, String orgRegionId, String newRegionId) { |
|
|
public void migrateRegion(String supplierId, String regionType, String orgRegionId, String newRegionId) { |
|
|
//if(1==1){return;}
|
|
|
|
|
|
LocalDateTime nowTime = LocalDateTime.now(); |
|
|
LocalDateTime nowTime = LocalDateTime.now(); |
|
|
String newRegionCode; |
|
|
String newRegionCode; |
|
|
String newRegionName; |
|
|
String newRegionName; |
|
@ -80,12 +79,42 @@ public class BmsSupplierApplicationService { |
|
|
newRegionCode = bmsRegion2.getCode(); |
|
|
newRegionCode = bmsRegion2.getCode(); |
|
|
newRegionName = bmsRegion2.getName(); |
|
|
newRegionName = bmsRegion2.getName(); |
|
|
} |
|
|
} |
|
|
|
|
|
this.migrateActivityBudget(supplierId, regionType, orgRegionId, newRegionId, nowTime, newRegionCode, newRegionName); |
|
|
|
|
|
this.migratePolicyBudget(supplierId, regionType, orgRegionId, newRegionId, nowTime, newRegionCode, newRegionName); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 调整政策预算 |
|
|
|
|
|
* @param supplierId |
|
|
|
|
|
* @param regionType |
|
|
|
|
|
* @param orgRegionId |
|
|
|
|
|
* @param newRegionId |
|
|
|
|
|
* @param nowTime |
|
|
|
|
|
* @param newRegionCode |
|
|
|
|
|
* @param newRegionName |
|
|
|
|
|
*/ |
|
|
|
|
|
private void migratePolicyBudget(String supplierId, String regionType, String orgRegionId, String newRegionId, LocalDateTime nowTime, String newRegionCode, String newRegionName) { |
|
|
|
|
|
//TODO 方案未落实
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 调整活动预算 |
|
|
|
|
|
* @param supplierId |
|
|
|
|
|
* @param regionType |
|
|
|
|
|
* @param orgRegionId |
|
|
|
|
|
* @param newRegionId |
|
|
|
|
|
* @param nowTime |
|
|
|
|
|
* @param newRegionCode |
|
|
|
|
|
* @param newRegionName |
|
|
|
|
|
*/ |
|
|
|
|
|
private void migrateActivityBudget(String supplierId, String regionType, String orgRegionId, String newRegionId, LocalDateTime nowTime, String newRegionCode, String newRegionName) { |
|
|
LambdaQueryWrapper<TbsBudgetLog> lqw4log = new LambdaQueryWrapper<>(); |
|
|
LambdaQueryWrapper<TbsBudgetLog> lqw4log = new LambdaQueryWrapper<>(); |
|
|
lqw4log.eq(TbsBudgetLog::getMigrateFlag,0); |
|
|
lqw4log.eq(TbsBudgetLog::getMigrateFlag,0); |
|
|
lqw4log.eq(TbsBudgetLog::getRollbackFlag,0); |
|
|
lqw4log.eq(TbsBudgetLog::getRollbackFlag,0); |
|
|
lqw4log.eq(TbsBudgetLog::getSupplierId, supplierId); |
|
|
lqw4log.eq(TbsBudgetLog::getSupplierId, supplierId); |
|
|
lqw4log.eq(TbsBudgetLog::getCenterType, regionType); |
|
|
lqw4log.eq(TbsBudgetLog::getCenterType, regionType); |
|
|
lqw4log.eq(TbsBudgetLog::getCenterId, orgRegionId); |
|
|
lqw4log.eq(TbsBudgetLog::getCenterId, orgRegionId); |
|
|
|
|
|
lqw4log.isNotNull(TbsBudgetLog::getActivityId); |
|
|
List<TbsBudgetLog> budgetLogList = budgetLogService.list(lqw4log); |
|
|
List<TbsBudgetLog> budgetLogList = budgetLogService.list(lqw4log); |
|
|
if(CollectionUtil.isNotEmpty(budgetLogList)){ |
|
|
if(CollectionUtil.isNotEmpty(budgetLogList)){ |
|
|
//查找符合条件的活动
|
|
|
//查找符合条件的活动
|
|
@ -96,7 +125,7 @@ public class BmsSupplierApplicationService { |
|
|
//查询符合条件的预算
|
|
|
//查询符合条件的预算
|
|
|
final List<Long> subjectIds = budgetLogList.stream().map(TbsBudgetLog::getSubjectId).distinct().collect(Collectors.toList()); |
|
|
final List<Long> subjectIds = budgetLogList.stream().map(TbsBudgetLog::getSubjectId).distinct().collect(Collectors.toList()); |
|
|
LambdaQueryWrapper<TbsBudget> lqwBudget = new LambdaQueryWrapper<>(); |
|
|
LambdaQueryWrapper<TbsBudget> lqwBudget = new LambdaQueryWrapper<>(); |
|
|
lqwBudget.eq(TbsBudget::getCenterType,regionType); |
|
|
lqwBudget.eq(TbsBudget::getCenterType, regionType); |
|
|
lqwBudget.eq(TbsBudget::getCenterId, newRegionId); |
|
|
lqwBudget.eq(TbsBudget::getCenterId, newRegionId); |
|
|
lqwBudget.eq(TbsBudget::getBudgetState,1); |
|
|
lqwBudget.eq(TbsBudget::getBudgetState,1); |
|
|
lqwBudget.and(wq->{ |
|
|
lqwBudget.and(wq->{ |
|
|