|
@ -1,6 +1,7 @@ |
|
|
package com.qs.serve.modules.tbs.service.impl; |
|
|
package com.qs.serve.modules.tbs.service.impl; |
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
import com.qs.serve.common.model.enums.BudgetLogOptFlag; |
|
|
import com.qs.serve.common.model.enums.BudgetLogOptFlag; |
|
|
import com.qs.serve.common.util.Assert; |
|
|
import com.qs.serve.common.util.Assert; |
|
@ -18,6 +19,7 @@ import com.qs.serve.modules.goods.service.GoodsSkuService; |
|
|
import com.qs.serve.modules.goods.service.GoodsSpuService; |
|
|
import com.qs.serve.modules.goods.service.GoodsSpuService; |
|
|
import com.qs.serve.modules.sys.entity.SysUser; |
|
|
import com.qs.serve.modules.sys.entity.SysUser; |
|
|
import com.qs.serve.modules.sys.service.SysUserService; |
|
|
import com.qs.serve.modules.sys.service.SysUserService; |
|
|
|
|
|
import com.qs.serve.modules.tbs.common.TbsCenterType; |
|
|
import com.qs.serve.modules.tbs.common.TbsGoodsType; |
|
|
import com.qs.serve.modules.tbs.common.TbsGoodsType; |
|
|
import com.qs.serve.modules.tbs.common.consts.ConditionMapEnum; |
|
|
import com.qs.serve.modules.tbs.common.consts.ConditionMapEnum; |
|
|
import com.qs.serve.modules.tbs.common.util.TbsBudgetLogBuildUtil; |
|
|
import com.qs.serve.modules.tbs.common.util.TbsBudgetLogBuildUtil; |
|
@ -27,6 +29,10 @@ import com.qs.serve.modules.tbs.entity.bo.TbsBudgetExcelBo; |
|
|
import com.qs.serve.modules.tbs.entity.vo.TbsBudgetVo; |
|
|
import com.qs.serve.modules.tbs.entity.vo.TbsBudgetVo; |
|
|
import com.qs.serve.modules.tbs.mapper.TbsBudgetMapper; |
|
|
import com.qs.serve.modules.tbs.mapper.TbsBudgetMapper; |
|
|
import com.qs.serve.modules.tbs.service.*; |
|
|
import com.qs.serve.modules.tbs.service.*; |
|
|
|
|
|
import com.qs.serve.modules.tzc.entity.TzcPolicyItem; |
|
|
|
|
|
import com.qs.serve.modules.tzc.service.TzcPolicyItemService; |
|
|
|
|
|
import com.qs.serve.modules.vtb.entity.VtbFundFlow; |
|
|
|
|
|
import com.qs.serve.modules.vtb.service.VtbFundFlowService; |
|
|
import lombok.AllArgsConstructor; |
|
|
import lombok.AllArgsConstructor; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.jetbrains.annotations.NotNull; |
|
|
import org.jetbrains.annotations.NotNull; |
|
@ -35,6 +41,7 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
import java.math.BigDecimal; |
|
|
import java.util.ArrayList; |
|
|
import java.util.ArrayList; |
|
|
|
|
|
import java.util.HashMap; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
import java.util.Map; |
|
|
import java.util.Map; |
|
|
import java.util.stream.Collectors; |
|
|
import java.util.stream.Collectors; |
|
@ -57,14 +64,18 @@ public class TbsBudgetServiceImpl extends ServiceImpl<TbsBudgetMapper,TbsBudget> |
|
|
private final TbsScheduleItemService scheduleItemService; |
|
|
private final TbsScheduleItemService scheduleItemService; |
|
|
private final TbsCenterDtoService tbsCenterDtoService; |
|
|
private final TbsCenterDtoService tbsCenterDtoService; |
|
|
|
|
|
|
|
|
private TbsBudgetConditionService tbsBudgetConditionService; |
|
|
|
|
|
private TbsScheduleItemBudgetService tbsScheduleItemBudgetService; |
|
|
|
|
|
|
|
|
|
|
|
private final GoodsSkuService goodsSkuService; |
|
|
private final GoodsSkuService goodsSkuService; |
|
|
private final GoodsSpuService goodsSpuService; |
|
|
private final GoodsSpuService goodsSpuService; |
|
|
private final GoodsCategoryService goodsCategoryService; |
|
|
private final GoodsCategoryService goodsCategoryService; |
|
|
private final SysUserService sysUserService; |
|
|
private final SysUserService sysUserService; |
|
|
|
|
|
|
|
|
|
|
|
private final TbsActivityCenterService tbsActivityCenterService; |
|
|
|
|
|
private final TbsActivityCenterGoodsService tbsActivityCenterGoodsService; |
|
|
|
|
|
private final TbsBudgetCostItemService tbsBudgetCostItemService; |
|
|
|
|
|
private final TzcPolicyItemService tzcPolicyItemService; |
|
|
|
|
|
private final TbsBudgetCostItemPolicyService tbsBudgetCostItemPolicyService; |
|
|
|
|
|
private final VtbFundFlowService vtbFundFlowService; |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public void modify(TbsBudgetBo budgetBo) { |
|
|
public void modify(TbsBudgetBo budgetBo) { |
|
@ -83,7 +94,7 @@ public class TbsBudgetServiceImpl extends ServiceImpl<TbsBudgetMapper,TbsBudget> |
|
|
//移除旧的条件数据
|
|
|
//移除旧的条件数据
|
|
|
LambdaQueryWrapper<TbsBudgetCondition> lqw = new LambdaQueryWrapper<>(); |
|
|
LambdaQueryWrapper<TbsBudgetCondition> lqw = new LambdaQueryWrapper<>(); |
|
|
lqw.eq(TbsBudgetCondition::getBudgetId,budget.getId()); |
|
|
lqw.eq(TbsBudgetCondition::getBudgetId,budget.getId()); |
|
|
tbsBudgetConditionService.remove(lqw); |
|
|
budgetConditionService.remove(lqw); |
|
|
}else { |
|
|
}else { |
|
|
budget = CopierUtil.copy(budgetBo,new TbsBudget()); |
|
|
budget = CopierUtil.copy(budgetBo,new TbsBudget()); |
|
|
} |
|
|
} |
|
@ -206,7 +217,7 @@ public class TbsBudgetServiceImpl extends ServiceImpl<TbsBudgetMapper,TbsBudget> |
|
|
lqw.eq(TbsBudgetCondition::getTargetType,targetType); |
|
|
lqw.eq(TbsBudgetCondition::getTargetType,targetType); |
|
|
lqw.in(TbsBudgetCondition::getTargetId, targetIds); |
|
|
lqw.in(TbsBudgetCondition::getTargetId, targetIds); |
|
|
lqw.in(TbsBudgetCondition::getBudgetId,budgetIds); |
|
|
lqw.in(TbsBudgetCondition::getBudgetId,budgetIds); |
|
|
List<TbsBudgetCondition> conditions = tbsBudgetConditionService.list(lqw); |
|
|
List<TbsBudgetCondition> conditions = budgetConditionService.list(lqw); |
|
|
if(conditions.size()<1){ |
|
|
if(conditions.size()<1){ |
|
|
return new ArrayList<>(); |
|
|
return new ArrayList<>(); |
|
|
} |
|
|
} |
|
@ -215,7 +226,7 @@ public class TbsBudgetServiceImpl extends ServiceImpl<TbsBudgetMapper,TbsBudget> |
|
|
LambdaQueryWrapper<TbsBudgetCondition> lqw2 = new LambdaQueryWrapper<>(); |
|
|
LambdaQueryWrapper<TbsBudgetCondition> lqw2 = new LambdaQueryWrapper<>(); |
|
|
lqw2.eq(TbsBudgetCondition::getTargetType,targetType); |
|
|
lqw2.eq(TbsBudgetCondition::getTargetType,targetType); |
|
|
lqw2.in(TbsBudgetCondition::getBudgetId,budgetIds); |
|
|
lqw2.in(TbsBudgetCondition::getBudgetId,budgetIds); |
|
|
List<TbsBudgetCondition> conditions2 = tbsBudgetConditionService.list(lqw2); |
|
|
List<TbsBudgetCondition> conditions2 = budgetConditionService.list(lqw2); |
|
|
Map<Long,List<TbsBudgetCondition>> conditions2Map = conditions2.stream() |
|
|
Map<Long,List<TbsBudgetCondition>> conditions2Map = conditions2.stream() |
|
|
.collect(Collectors.groupingBy(TbsBudgetCondition::getBudgetId)); |
|
|
.collect(Collectors.groupingBy(TbsBudgetCondition::getBudgetId)); |
|
|
List<Long> selectBudgetIds = new ArrayList<>(); |
|
|
List<Long> selectBudgetIds = new ArrayList<>(); |
|
@ -278,12 +289,12 @@ public class TbsBudgetServiceImpl extends ServiceImpl<TbsBudgetMapper,TbsBudget> |
|
|
} |
|
|
} |
|
|
LambdaQueryWrapper<TbsScheduleItemBudget> lqw2 = new LambdaQueryWrapper<>(); |
|
|
LambdaQueryWrapper<TbsScheduleItemBudget> lqw2 = new LambdaQueryWrapper<>(); |
|
|
lqw2.in(TbsScheduleItemBudget::getBudgetId,budgetIds); |
|
|
lqw2.in(TbsScheduleItemBudget::getBudgetId,budgetIds); |
|
|
List<TbsScheduleItemBudget> scheduleItemBudgets = tbsScheduleItemBudgetService.list(lqw2); |
|
|
List<TbsScheduleItemBudget> scheduleItemBudgets = scheduleItemBudgetService.list(lqw2); |
|
|
Map<Long,List<TbsScheduleItemBudget>> listScheduleMapByBudgetId = scheduleItemBudgets.stream().collect(Collectors.groupingBy(TbsScheduleItemBudget::getBudgetId)); |
|
|
Map<Long,List<TbsScheduleItemBudget>> listScheduleMapByBudgetId = scheduleItemBudgets.stream().collect(Collectors.groupingBy(TbsScheduleItemBudget::getBudgetId)); |
|
|
//加载条件
|
|
|
//加载条件
|
|
|
LambdaQueryWrapper<TbsBudgetCondition> lqw = new LambdaQueryWrapper<>(); |
|
|
LambdaQueryWrapper<TbsBudgetCondition> lqw = new LambdaQueryWrapper<>(); |
|
|
lqw.in(TbsBudgetCondition::getBudgetId,budgetIds); |
|
|
lqw.in(TbsBudgetCondition::getBudgetId,budgetIds); |
|
|
List<TbsBudgetCondition> budgetConditions = tbsBudgetConditionService.list(lqw); |
|
|
List<TbsBudgetCondition> budgetConditions = budgetConditionService.list(lqw); |
|
|
Map<Long,List<TbsBudgetCondition>> listConditionMapByBudgetId = budgetConditions.stream().collect(Collectors.groupingBy(TbsBudgetCondition::getBudgetId)); |
|
|
Map<Long,List<TbsBudgetCondition>> listConditionMapByBudgetId = budgetConditions.stream().collect(Collectors.groupingBy(TbsBudgetCondition::getBudgetId)); |
|
|
//拼装
|
|
|
//拼装
|
|
|
return budgetList.stream().map(budget->{ |
|
|
return budgetList.stream().map(budget->{ |
|
@ -394,7 +405,7 @@ public class TbsBudgetServiceImpl extends ServiceImpl<TbsBudgetMapper,TbsBudget> |
|
|
public TbsBudgetVo toVoEntity(TbsBudget budget) { |
|
|
public TbsBudgetVo toVoEntity(TbsBudget budget) { |
|
|
LambdaQueryWrapper<TbsBudgetCondition> lqw = new LambdaQueryWrapper<>(); |
|
|
LambdaQueryWrapper<TbsBudgetCondition> lqw = new LambdaQueryWrapper<>(); |
|
|
lqw.eq(TbsBudgetCondition::getBudgetId,budget.getId()); |
|
|
lqw.eq(TbsBudgetCondition::getBudgetId,budget.getId()); |
|
|
List<TbsBudgetCondition> budgetConditions = tbsBudgetConditionService.list(lqw); |
|
|
List<TbsBudgetCondition> budgetConditions = budgetConditionService.list(lqw); |
|
|
Map<String,List<TbsBudgetCondition>> listMap = budgetConditions.stream().collect(Collectors.groupingBy(TbsBudgetCondition::getTargetType)); |
|
|
Map<String,List<TbsBudgetCondition>> listMap = budgetConditions.stream().collect(Collectors.groupingBy(TbsBudgetCondition::getTargetType)); |
|
|
TbsBudgetVo budgetVo = CopierUtil.copy(budget,new TbsBudgetVo()); |
|
|
TbsBudgetVo budgetVo = CopierUtil.copy(budget,new TbsBudgetVo()); |
|
|
budgetVo.setBrandConditions(listMap.get(TbsGoodsType.brand.name())); |
|
|
budgetVo.setBrandConditions(listMap.get(TbsGoodsType.brand.name())); |
|
@ -416,7 +427,7 @@ public class TbsBudgetServiceImpl extends ServiceImpl<TbsBudgetMapper,TbsBudget> |
|
|
budgetVo.setSpuConditions(listMap.get(TbsGoodsType.spu.name())); |
|
|
budgetVo.setSpuConditions(listMap.get(TbsGoodsType.spu.name())); |
|
|
LambdaQueryWrapper<TbsScheduleItemBudget> lqw2 = new LambdaQueryWrapper<>(); |
|
|
LambdaQueryWrapper<TbsScheduleItemBudget> lqw2 = new LambdaQueryWrapper<>(); |
|
|
lqw2.eq(TbsScheduleItemBudget::getBudgetId,budget.getId()); |
|
|
lqw2.eq(TbsScheduleItemBudget::getBudgetId,budget.getId()); |
|
|
List<TbsScheduleItemBudget> scheduleItemBudgets = tbsScheduleItemBudgetService.list(lqw2); |
|
|
List<TbsScheduleItemBudget> scheduleItemBudgets = scheduleItemBudgetService.list(lqw2); |
|
|
budgetVo.setScheduleItem(scheduleItemBudgets); |
|
|
budgetVo.setScheduleItem(scheduleItemBudgets); |
|
|
return budgetVo; |
|
|
return budgetVo; |
|
|
} |
|
|
} |
|
@ -669,7 +680,7 @@ public class TbsBudgetServiceImpl extends ServiceImpl<TbsBudgetMapper,TbsBudget> |
|
|
TbsBudgetVo budgetVo = CopierUtil.copy(budget,new TbsBudgetVo()); |
|
|
TbsBudgetVo budgetVo = CopierUtil.copy(budget,new TbsBudgetVo()); |
|
|
LambdaQueryWrapper<TbsScheduleItemBudget> lqw = new LambdaQueryWrapper<>(); |
|
|
LambdaQueryWrapper<TbsScheduleItemBudget> lqw = new LambdaQueryWrapper<>(); |
|
|
lqw.eq(TbsScheduleItemBudget::getBudgetId,budget.getId()); |
|
|
lqw.eq(TbsScheduleItemBudget::getBudgetId,budget.getId()); |
|
|
List<TbsScheduleItemBudget> tbsScheduleItemBudgetList = tbsScheduleItemBudgetService.list(lqw); |
|
|
List<TbsScheduleItemBudget> tbsScheduleItemBudgetList = scheduleItemBudgetService.list(lqw); |
|
|
tbsScheduleItemBudgetList.forEach(a->{ |
|
|
tbsScheduleItemBudgetList.forEach(a->{ |
|
|
LambdaQueryWrapper<TbsBudgetLog> lqwLog = new LambdaQueryWrapper<>(); |
|
|
LambdaQueryWrapper<TbsBudgetLog> lqwLog = new LambdaQueryWrapper<>(); |
|
|
lqwLog.eq(TbsBudgetLog::getScheduleItemBudgetId,a.getId()); |
|
|
lqwLog.eq(TbsBudgetLog::getScheduleItemBudgetId,a.getId()); |
|
@ -693,5 +704,168 @@ public class TbsBudgetServiceImpl extends ServiceImpl<TbsBudgetMapper,TbsBudget> |
|
|
budgetVo.setScheduleItemBudgets(tbsScheduleItemBudgetList); |
|
|
budgetVo.setScheduleItemBudgets(tbsScheduleItemBudgetList); |
|
|
return budgetVo; |
|
|
return budgetVo; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public void moveCenterBudgetAndCostAmount(String sourceId,String sourceType,String targetId,String targetType){ |
|
|
|
|
|
SysUser sysUser = sysUserService.getById(AuthContextUtils.getSysUserId()); |
|
|
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<TbsBudget> budgetLqw = new LambdaQueryWrapper<>(); |
|
|
|
|
|
budgetLqw.eq(TbsBudget::getCenterType,sourceType); |
|
|
|
|
|
budgetLqw.eq(TbsBudget::getCenterId,sourceId); |
|
|
|
|
|
List<TbsBudget> tbsBudgetSourceList = this.list(budgetLqw); |
|
|
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<TbsBudget> budgetTargetLqw = new LambdaQueryWrapper<>(); |
|
|
|
|
|
budgetTargetLqw.eq(TbsBudget::getCenterType,targetType); |
|
|
|
|
|
budgetTargetLqw.eq(TbsBudget::getCenterId,targetId); |
|
|
|
|
|
List<TbsBudget> tbsBudgetTargetList = this.list(budgetTargetLqw); |
|
|
|
|
|
|
|
|
|
|
|
Map<TbsBudget,TbsBudget> mapSourceTargetTbsbudget = new HashMap<>(); |
|
|
|
|
|
for(TbsBudget tbsBudgetSouce:tbsBudgetSourceList){ |
|
|
|
|
|
TbsBudget tbsBudgetTargetMatch = null; |
|
|
|
|
|
for(TbsBudget tbsBudgetTarget:tbsBudgetTargetList){ |
|
|
|
|
|
Long unMatchCountCondition = budgetConditionService.findUnMatchConditionBySourceBudgetIdAndTargetBudgetId(tbsBudgetSouce.getId(),tbsBudgetTarget.getId()); |
|
|
|
|
|
Long unMatchCountScheduleItem = scheduleItemBudgetService.findUnMatchScheduleItemBySourceBudgetIdAndTargetBudgetId(tbsBudgetSouce.getId(),tbsBudgetTarget.getId()); |
|
|
|
|
|
if(unMatchCountCondition==0 && unMatchCountScheduleItem==0){ |
|
|
|
|
|
tbsBudgetTargetMatch = tbsBudgetTarget; |
|
|
|
|
|
mapSourceTargetTbsbudget.put(tbsBudgetSouce,tbsBudgetTarget); |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if(tbsBudgetTargetMatch==null){ |
|
|
|
|
|
Assert.throwEx("存在不匹配条件或周期的预算!"+tbsBudgetSouce.getBudgetCode()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for(TbsBudget tbsBudgetSouce:tbsBudgetSourceList) { |
|
|
|
|
|
TbsBudget tartgetBudget = mapSourceTargetTbsbudget.get(tbsBudgetSouce); |
|
|
|
|
|
LambdaQueryWrapper<TbsScheduleItemBudget> tsibLqw = new LambdaQueryWrapper<>(); |
|
|
|
|
|
tsibLqw.eq(TbsScheduleItemBudget::getBudgetId,tbsBudgetSouce.getId()); |
|
|
|
|
|
List<TbsScheduleItemBudget> scheduleItemBudgetList = scheduleItemBudgetService.list(tsibLqw); |
|
|
|
|
|
//源预算周期
|
|
|
|
|
|
for(TbsScheduleItemBudget tsib:scheduleItemBudgetList){ |
|
|
|
|
|
LambdaQueryWrapper<TbsScheduleItemBudget> tsibTargetLqw = new LambdaQueryWrapper<>(); |
|
|
|
|
|
tsibTargetLqw.eq(TbsScheduleItemBudget::getBudgetId,tartgetBudget.getId()); |
|
|
|
|
|
tsibTargetLqw.ge(TbsScheduleItemBudget::getEndDate,tsib.getEndDate()); |
|
|
|
|
|
tsibTargetLqw.le(TbsScheduleItemBudget::getStartDate,tsib.getStartDate()); |
|
|
|
|
|
TbsScheduleItemBudget tsibTarget = scheduleItemBudgetService.getOne(tsibTargetLqw,false); |
|
|
|
|
|
|
|
|
|
|
|
//调增Log
|
|
|
|
|
|
TbsBudgetLog budgetLog = TbsBudgetLogBuildUtil.toTbsBudgetLog(sysUser,tartgetBudget,tsibTarget,BudgetLogOptFlag.State_2, tsib.getBudgetAmount()); |
|
|
|
|
|
budgetLogService.save(budgetLog); |
|
|
|
|
|
LambdaQueryWrapper<TbsBudgetLog> tsibRemoveLqw = new LambdaQueryWrapper<>(); |
|
|
|
|
|
tsibRemoveLqw.eq(TbsBudgetLog::getScheduleItemBudgetId,tsib.getId()); |
|
|
|
|
|
tsibRemoveLqw.eq(TbsBudgetLog::getOptType,BudgetLogOptFlag.State_0.getCode()); |
|
|
|
|
|
budgetLogService.remove(tsibRemoveLqw); |
|
|
|
|
|
|
|
|
|
|
|
//更新发货目标
|
|
|
|
|
|
BigDecimal preDispatchAmount = tsibTarget.getPreDispatchAmount()==null?BigDecimal.ZERO:tsibTarget.getPreDispatchAmount(); |
|
|
|
|
|
preDispatchAmount = preDispatchAmount.add(tsib.getPreDispatchAmount()==null?BigDecimal.ZERO:tsib.getPreDispatchAmount()); |
|
|
|
|
|
tsibTarget.setPreDispatchAmount(preDispatchAmount); |
|
|
|
|
|
scheduleItemBudgetService.updateById(tsibTarget); |
|
|
|
|
|
|
|
|
|
|
|
//tbs_activity_center
|
|
|
|
|
|
LambdaUpdateWrapper<TbsActivityCenter> tacLuw = new LambdaUpdateWrapper<>(); |
|
|
|
|
|
tacLuw.set(TbsActivityCenter::getCenterType,targetType); |
|
|
|
|
|
tacLuw.set(TbsActivityCenter::getCenterId,targetId); |
|
|
|
|
|
tacLuw.set(TbsActivityCenter::getCenterName,tartgetBudget.getCenterName()); |
|
|
|
|
|
tacLuw.eq(TbsActivityCenter::getCenterType,sourceType); |
|
|
|
|
|
tacLuw.eq(TbsActivityCenter::getCenterId,sourceId); |
|
|
|
|
|
tacLuw.eq(TbsActivityCenter::getCenterName,tbsBudgetSouce.getCenterName()); |
|
|
|
|
|
tbsActivityCenterService.update(tacLuw); |
|
|
|
|
|
|
|
|
|
|
|
//tbs_activity_center_goods
|
|
|
|
|
|
LambdaUpdateWrapper<TbsActivityCenterGoods> tacgLuw = new LambdaUpdateWrapper<>(); |
|
|
|
|
|
tacgLuw.set(TbsActivityCenterGoods::getCenterType,targetType); |
|
|
|
|
|
tacgLuw.set(TbsActivityCenterGoods::getCenterId,targetId); |
|
|
|
|
|
tacgLuw.set(TbsActivityCenterGoods::getCenterName,tartgetBudget.getCenterName()); |
|
|
|
|
|
tacgLuw.eq(TbsActivityCenterGoods::getCenterType,sourceType); |
|
|
|
|
|
tacgLuw.eq(TbsActivityCenterGoods::getCenterId,sourceId); |
|
|
|
|
|
tacgLuw.eq(TbsActivityCenterGoods::getCenterName,tbsBudgetSouce.getCenterName()); |
|
|
|
|
|
tbsActivityCenterGoodsService.update(tacgLuw); |
|
|
|
|
|
|
|
|
|
|
|
//tbs_budget_cost_item
|
|
|
|
|
|
LambdaUpdateWrapper<TbsBudgetCostItem> tbciLuw = new LambdaUpdateWrapper<>(); |
|
|
|
|
|
tbciLuw.set(TbsBudgetCostItem::getCenterType,targetType); |
|
|
|
|
|
tbciLuw.set(TbsBudgetCostItem::getCenterId,targetId); |
|
|
|
|
|
tbciLuw.set(TbsBudgetCostItem::getCenterName,tartgetBudget.getCenterName()); |
|
|
|
|
|
tbciLuw.set(TbsBudgetCostItem::getBudgetId,tsibTarget.getBudgetId()); |
|
|
|
|
|
tbciLuw.set(TbsBudgetCostItem::getScheduleId,tsibTarget.getScheduleId()); |
|
|
|
|
|
tbciLuw.set(TbsBudgetCostItem::getScheduleItemName,tsibTarget.getItemName()); |
|
|
|
|
|
tbciLuw.set(TbsBudgetCostItem::getScheduleItemId,tsibTarget.getScheduleItemId()); |
|
|
|
|
|
tbciLuw.set(TbsBudgetCostItem::getScheduleItemBudgetId,tsibTarget.getId()); |
|
|
|
|
|
tbciLuw.eq(TbsBudgetCostItem::getCenterType,sourceType); |
|
|
|
|
|
tbciLuw.eq(TbsBudgetCostItem::getCenterId,sourceId); |
|
|
|
|
|
tbciLuw.eq(TbsBudgetCostItem::getCenterName,tbsBudgetSouce.getCenterName()); |
|
|
|
|
|
tbciLuw.eq(TbsBudgetCostItem::getScheduleItemBudgetId,tsib.getId()); |
|
|
|
|
|
tbsBudgetCostItemService.update(tbciLuw); |
|
|
|
|
|
|
|
|
|
|
|
//tbs_budget_cost_item_policy
|
|
|
|
|
|
LambdaUpdateWrapper<TbsBudgetCostItemPolicy> tbcipLuw = new LambdaUpdateWrapper<>(); |
|
|
|
|
|
tbcipLuw.set(TbsBudgetCostItemPolicy::getCenterType,targetType); |
|
|
|
|
|
tbcipLuw.set(TbsBudgetCostItemPolicy::getCenterId,targetId); |
|
|
|
|
|
tbcipLuw.set(TbsBudgetCostItemPolicy::getCenterName,tartgetBudget.getCenterName()); |
|
|
|
|
|
tbcipLuw.set(TbsBudgetCostItemPolicy::getBudgetId,tsibTarget.getBudgetId()); |
|
|
|
|
|
tbcipLuw.set(TbsBudgetCostItemPolicy::getScheduleId,tsibTarget.getScheduleId()); |
|
|
|
|
|
tbcipLuw.set(TbsBudgetCostItemPolicy::getScheduleItemName,tsibTarget.getItemName()); |
|
|
|
|
|
tbcipLuw.set(TbsBudgetCostItemPolicy::getScheduleItemId,tsibTarget.getScheduleItemId()); |
|
|
|
|
|
tbcipLuw.set(TbsBudgetCostItemPolicy::getScheduleItemBudgetId,tsibTarget.getId()); |
|
|
|
|
|
tbcipLuw.eq(TbsBudgetCostItemPolicy::getCenterType,sourceType); |
|
|
|
|
|
tbcipLuw.eq(TbsBudgetCostItemPolicy::getCenterId,sourceId); |
|
|
|
|
|
tbcipLuw.eq(TbsBudgetCostItemPolicy::getCenterName,tbsBudgetSouce.getCenterName()); |
|
|
|
|
|
tbcipLuw.eq(TbsBudgetCostItemPolicy::getScheduleItemBudgetId,tsib.getId()); |
|
|
|
|
|
tbsBudgetCostItemPolicyService.update(tbcipLuw); |
|
|
|
|
|
|
|
|
|
|
|
//tzc_policy_item
|
|
|
|
|
|
LambdaUpdateWrapper<TzcPolicyItem> tzpiLuw = new LambdaUpdateWrapper<>(); |
|
|
|
|
|
tzpiLuw.set(TzcPolicyItem::getCenterType,targetType); |
|
|
|
|
|
tzpiLuw.set(TzcPolicyItem::getCenterId,targetId); |
|
|
|
|
|
tzpiLuw.set(TzcPolicyItem::getCenterName,tartgetBudget.getCenterName()); |
|
|
|
|
|
tzpiLuw.eq(TzcPolicyItem::getCenterType,sourceType); |
|
|
|
|
|
tzpiLuw.eq(TzcPolicyItem::getCenterId,sourceId); |
|
|
|
|
|
tzpiLuw.eq(TzcPolicyItem::getCenterName,tbsBudgetSouce.getCenterName()); |
|
|
|
|
|
tzcPolicyItemService.update(tzpiLuw); |
|
|
|
|
|
|
|
|
|
|
|
//BudgetLog
|
|
|
|
|
|
LambdaUpdateWrapper<TbsBudgetLog> tblLuw = new LambdaUpdateWrapper<>(); |
|
|
|
|
|
tblLuw.set(TbsBudgetLog::getCenterType,targetType); |
|
|
|
|
|
tblLuw.set(TbsBudgetLog::getCenterId,targetId); |
|
|
|
|
|
tblLuw.set(TbsBudgetLog::getCenterName,tartgetBudget.getCenterName()); |
|
|
|
|
|
tblLuw.set(TbsBudgetLog::getBudgetId,tsibTarget.getBudgetId()); |
|
|
|
|
|
tblLuw.set(TbsBudgetLog::getBudgetCode,tartgetBudget.getBudgetCode()); |
|
|
|
|
|
tblLuw.set(TbsBudgetLog::getScheduleId,tsibTarget.getScheduleId()); |
|
|
|
|
|
tblLuw.set(TbsBudgetLog::getItemName,tsibTarget.getItemName()); |
|
|
|
|
|
tblLuw.set(TbsBudgetLog::getScheduleItemId,tsibTarget.getScheduleItemId()); |
|
|
|
|
|
tblLuw.set(TbsBudgetLog::getScheduleItemBudgetId,tsibTarget.getId()); |
|
|
|
|
|
tblLuw.eq(TbsBudgetLog::getCenterType,sourceType); |
|
|
|
|
|
tblLuw.eq(TbsBudgetLog::getCenterId,sourceId); |
|
|
|
|
|
tblLuw.eq(TbsBudgetLog::getCenterName,tbsBudgetSouce.getCenterName()); |
|
|
|
|
|
tblLuw.eq(TbsBudgetLog::getScheduleItemBudgetId,tsib.getId()); |
|
|
|
|
|
budgetLogService.update(tblLuw); |
|
|
|
|
|
|
|
|
|
|
|
//vtb_fund_flow
|
|
|
|
|
|
LambdaUpdateWrapper<VtbFundFlow> vffLuw = new LambdaUpdateWrapper<>(); |
|
|
|
|
|
vffLuw.set(VtbFundFlow::getCenterType,targetType); |
|
|
|
|
|
vffLuw.set(VtbFundFlow::getCenterId,targetId); |
|
|
|
|
|
vffLuw.set(VtbFundFlow::getCenterName,tartgetBudget.getCenterName()); |
|
|
|
|
|
vffLuw.eq(VtbFundFlow::getCenterType,sourceType); |
|
|
|
|
|
vffLuw.eq(VtbFundFlow::getCenterId,sourceId); |
|
|
|
|
|
vffLuw.eq(VtbFundFlow::getCenterName,tbsBudgetSouce.getCenterName()); |
|
|
|
|
|
vtbFundFlowService.update(vffLuw); |
|
|
|
|
|
|
|
|
|
|
|
scheduleItemBudgetService.removeById(tsib); |
|
|
|
|
|
} |
|
|
|
|
|
LambdaQueryWrapper<TbsBudgetCondition> tbcLqw = new LambdaQueryWrapper<>(); |
|
|
|
|
|
tbcLqw.eq(TbsBudgetCondition::getBudgetId,tbsBudgetSouce.getId()); |
|
|
|
|
|
budgetConditionService.remove(tbcLqw); |
|
|
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<TbsBudgetLog> tbllLqw = new LambdaQueryWrapper<>(); |
|
|
|
|
|
tbllLqw.eq(TbsBudgetLog::getBudgetId,tbsBudgetSouce.getId()); |
|
|
|
|
|
budgetLogService.remove(tbllLqw); |
|
|
|
|
|
|
|
|
|
|
|
this.removeById(tbsBudgetSouce.getId()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|