|
|
@ -680,15 +680,15 @@ public class TbsBudgetServiceImpl extends ServiceImpl<TbsBudgetMapper,TbsBudget> |
|
|
|
budgetConditions.addAll(buildCategoryCondition(budgetId, seriesIds, TbsGoodsType.series.name())); |
|
|
|
budgetConditions.addAll(buildCategoryCondition(budgetId, categoryIds, TbsGoodsType.category.name())); |
|
|
|
budgetConditions.addAll(buildCategoryCondition(budgetId, brandIds, TbsGoodsType.brand.name())); |
|
|
|
TbsBudget tbsBudget = new TbsBudget(); |
|
|
|
tbsBudget.setId(budgetId); |
|
|
|
if(CollectionUtil.isNotEmpty(budgetConditions)){ |
|
|
|
budgetConditionService.saveBatch(budgetConditions); |
|
|
|
tbsBudget.setConditionFlag(1); |
|
|
|
}else { |
|
|
|
tbsBudget.setConditionFlag(0); |
|
|
|
TbsBudget oriBudget = this.getById(budgetId); |
|
|
|
if (oriBudget.getBudgetState() != 1 |
|
|
|
|| oriBudget.getConditionFlag() != 1 |
|
|
|
|| CollectionUtil.isNotEmpty(budgetConditions)) { |
|
|
|
TbsBudget tbsBudget = new TbsBudget(); |
|
|
|
tbsBudget.setId(budgetId); |
|
|
|
tbsBudget.setConditionFlag(CollectionUtil.isNotEmpty(budgetConditions) ? 1 : 0); |
|
|
|
this.updateById(tbsBudget); |
|
|
|
} |
|
|
|
this.updateById(tbsBudget); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -932,5 +932,21 @@ public class TbsBudgetServiceImpl extends ServiceImpl<TbsBudgetMapper,TbsBudget> |
|
|
|
budgetLogService.saveBatch(budgetLogList); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void updateBudgetAfterStart(TbsBudgetBo param) { |
|
|
|
TbsBudget budget = this.getById(param.getId()); |
|
|
|
if(budget==null){ |
|
|
|
Assert.throwEx("不存在该预算!"); |
|
|
|
} |
|
|
|
if(!budget.getBudgetState().equals(1)){ |
|
|
|
Assert.throwEx("预算未开启,请直接编辑!"); |
|
|
|
} |
|
|
|
budget.setBudgetCode(param.getBudgetCode()); |
|
|
|
budget.setAttachIds(param.getAttachIds()); |
|
|
|
this.updateById(budget); |
|
|
|
buildCondition(budget.getId(),param.getBrandIds(),param.getCategoryIds(),param.getSeriesIds(),param.getSpuIds(),param.getSkuIds()); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|