|
@@ -1082,9 +1082,17 @@ public class ExpenseInfoServiceImpl extends ServiceImpl<ExpenseInfoMapper, Expen
|
|
coalPaymentInfo1.setCompId(expenseInfo1.getCompId());
|
|
coalPaymentInfo1.setCompId(expenseInfo1.getCompId());
|
|
coalPaymentInfo1.setWarehouseId(expenseInfo1.getWarehouseId());
|
|
coalPaymentInfo1.setWarehouseId(expenseInfo1.getWarehouseId());
|
|
coalPaymentInfo1.setWarehouseName(expenseInfo1.getWarehouseName());
|
|
coalPaymentInfo1.setWarehouseName(expenseInfo1.getWarehouseName());
|
|
- coalPaymentInfo1.setDistributableAmount(expenseInfo1.getAmountMoney());
|
|
|
|
- coalPaymentInfo1.setCurrentAverageAllocatedCost(expenseInfo1.getCoalPrice());
|
|
|
|
|
|
+ coalPaymentInfo1.setDistributableAmount(0d);
|
|
|
|
+ coalPaymentInfo1.setCurrentAverageAllocatedCost(0d);
|
|
coalPaymentInfoService.insert(coalPaymentInfo1);
|
|
coalPaymentInfoService.insert(coalPaymentInfo1);
|
|
|
|
+ //当前合计可分配金额
|
|
|
|
+ Double nowDisAmount = coalPaymentInfo1.getDistributableAmount();
|
|
|
|
+ //当前平均分配单价
|
|
|
|
+ Double nowCurCost = coalPaymentInfo1.getCurrentAverageAllocatedCost();
|
|
|
|
+ coalPaymentInfo1.setDistributableAmount(nowDisAmount + expenseInfo1.getAmountMoney());
|
|
|
|
+ coalPaymentInfo1.setCurrentAverageAllocatedCost((nowCurCost*13/550*nowDisAmount +
|
|
|
|
+ expenseInfo1.getCoalPrice()*13/550*expenseInfo1.getAmountMoney()) / (nowDisAmount + expenseInfo1.getAmountMoney()));
|
|
|
|
+ coalPaymentInfoService.updateById(coalPaymentInfo1);
|
|
}else {
|
|
}else {
|
|
//不为空, 编辑
|
|
//不为空, 编辑
|
|
//当前合计可分配金额
|
|
//当前合计可分配金额
|