|
@ -22,6 +22,7 @@ import com.qs.serve.modules.tbs.service.TbsBudgetCostItemService; |
|
|
import com.qs.serve.modules.tbs.service.TbsBudgetLogService; |
|
|
import com.qs.serve.modules.tbs.service.TbsBudgetLogService; |
|
|
import lombok.AllArgsConstructor; |
|
|
import lombok.AllArgsConstructor; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
|
import org.jetbrains.annotations.NotNull; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
import com.qs.serve.modules.tbs.entity.TbsCostApply; |
|
|
import com.qs.serve.modules.tbs.entity.TbsCostApply; |
|
|
import com.qs.serve.modules.tbs.service.TbsCostApplyService; |
|
|
import com.qs.serve.modules.tbs.service.TbsCostApplyService; |
|
@ -101,18 +102,17 @@ public class TbsCostApplyServiceImpl extends ServiceImpl<TbsCostApplyMapper,TbsC |
|
|
allBudgetItem.addAll(result.getBudgetUnMatchList()); |
|
|
allBudgetItem.addAll(result.getBudgetUnMatchList()); |
|
|
budgetCostItemService.saveBatch(allBudgetItem); |
|
|
budgetCostItemService.saveBatch(allBudgetItem); |
|
|
//保存预算使用日志
|
|
|
//保存预算使用日志
|
|
|
saveBudgetLog(supplier, result, sysUser, costApply, allBudgetItem); |
|
|
saveBudgetLog(result, sysUser, costApply, allBudgetItem); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 保存预算使用日志 |
|
|
* 保存预算使用日志 |
|
|
* @param supplier |
|
|
|
|
|
* @param result |
|
|
* @param result |
|
|
* @param sysUser |
|
|
* @param sysUser |
|
|
* @param costApply |
|
|
* @param costApply |
|
|
* @param allBudgetItem |
|
|
* @param allBudgetItem |
|
|
*/ |
|
|
*/ |
|
|
private void saveBudgetLog(BmsSupplier supplier, TbsBudgetCostResult result, SysUser sysUser, TbsCostApply costApply, List<TbsBudgetCostItem> allBudgetItem) { |
|
|
private void saveBudgetLog(TbsBudgetCostResult result, SysUser sysUser, TbsCostApply costApply, List<TbsBudgetCostItem> allBudgetItem) { |
|
|
List<TbsBudgetLog> budgetLogList = new ArrayList<>(); |
|
|
List<TbsBudgetLog> budgetLogList = new ArrayList<>(); |
|
|
List<TbsBudget> budgetList = result.getBudgetList(); |
|
|
List<TbsBudget> budgetList = result.getBudgetList(); |
|
|
for (TbsBudgetCostItem item : allBudgetItem) { |
|
|
for (TbsBudgetCostItem item : allBudgetItem) { |
|
@ -130,39 +130,7 @@ public class TbsCostApplyServiceImpl extends ServiceImpl<TbsCostApplyMapper,TbsC |
|
|
if(budget==null){ |
|
|
if(budget==null){ |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
TbsBudgetLog budgetLog = new TbsBudgetLog(); |
|
|
TbsBudgetLog budgetLog = budgetLogService.buildTbsBudgetLog(0,sysUser, costApply, item, budget,item.getCenterGoodsAmount().negate()); |
|
|
budgetLog.setBudgetId(item.getBudgetId()); |
|
|
|
|
|
budgetLog.setBudgetCode(budget.getBudgetCode()); |
|
|
|
|
|
budgetLog.setOptType(2); |
|
|
|
|
|
budgetLog.setOptUserId(sysUser.getId()); |
|
|
|
|
|
budgetLog.setOptUserCode(sysUser.getCode()); |
|
|
|
|
|
budgetLog.setOptUserName(sysUser.getName()); |
|
|
|
|
|
budgetLog.setAmount(item.getCenterGoodsAmount().negate()); |
|
|
|
|
|
budgetLog.setScheduleId(item.getScheduleId()); |
|
|
|
|
|
budgetLog.setScheduleItemId(item.getScheduleItemId()); |
|
|
|
|
|
//budgetLog.setItemName();
|
|
|
|
|
|
budgetLog.setStartDate(item.getActStartDate().atStartOfDay()); |
|
|
|
|
|
budgetLog.setEndDate(item.getActEndDate().atStartOfDay()); |
|
|
|
|
|
budgetLog.setSubjectId(item.getSubjectId()); |
|
|
|
|
|
budgetLog.setSubjectCode(item.getSubjectCode()); |
|
|
|
|
|
budgetLog.setSubjectName(item.getSubjectName()); |
|
|
|
|
|
budgetLog.setCenterId(item.getCenterId()); |
|
|
|
|
|
budgetLog.setCenterCode(item.getCenterCode()); |
|
|
|
|
|
budgetLog.setCenterName(item.getCenterName()); |
|
|
|
|
|
budgetLog.setSupplierId(Long.parseLong(supplier.getId())); |
|
|
|
|
|
budgetLog.setSupplierCode(supplier.getCode()); |
|
|
|
|
|
budgetLog.setSupplierName(supplier.getName()); |
|
|
|
|
|
budgetLog.setActivityId(item.getActivityId()); |
|
|
|
|
|
budgetLog.setActivityCode(item.getActivityCode()); |
|
|
|
|
|
budgetLog.setCostApplyId(costApply.getId()); |
|
|
|
|
|
budgetLog.setCostApplyCode(costApply.getCode()); |
|
|
|
|
|
budgetLog.setCostApplyTheme(costApply.getChargeTheme()); |
|
|
|
|
|
budgetLog.setTargetType(item.getTargetType()); |
|
|
|
|
|
budgetLog.setTargetId(item.getTargetId()); |
|
|
|
|
|
budgetLog.setTargetCode(item.getTargetCode()); |
|
|
|
|
|
budgetLog.setTargetName(item.getTargetName()); |
|
|
|
|
|
budgetLog.setTargetLevelPathIds(item.getTargetLevelPathIds()); |
|
|
|
|
|
budgetLog.setTargetLevelPathNames(item.getTargetLevelPathNames()); |
|
|
|
|
|
budgetLogList.add(budgetLog); |
|
|
budgetLogList.add(budgetLog); |
|
|
} |
|
|
} |
|
|
if(CollectionUtil.isNotEmpty(budgetLogList)){ |
|
|
if(CollectionUtil.isNotEmpty(budgetLogList)){ |
|
@ -170,6 +138,8 @@ public class TbsCostApplyServiceImpl extends ServiceImpl<TbsCostApplyMapper,TbsC |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void releaseCost(Long costApplyId,Integer invalidFlag) { |
|
|
public void releaseCost(Long costApplyId,Integer invalidFlag) { |
|
|
LambdaQueryWrapper<TbsBudgetCostItem> lqw = new LambdaQueryWrapper<>(); |
|
|
LambdaQueryWrapper<TbsBudgetCostItem> lqw = new LambdaQueryWrapper<>(); |
|
|