Commit d97ba13e by huluobin

update

parent fa86da2e
......@@ -342,6 +342,17 @@ public abstract class AbstractCostService implements CostService {
@Override
public void reject(String costNo) {
if (costNo.startsWith("S")) {
//费用计划
CostDomain costDomain = costDao.selectByCostNo(costNo);
//费用计划关联借支单
CostDomain supCost = costDao.selectByCostNo(costDomain.getSupCostNo());
supCost.setCompensate(supCost.getCompensate().subtract(costDomain.getAmount()));
costDao.updateById(supCost);
}
CostDomain costDomain = costDao.selectByCostNo(costNo);
costDomain.setCostStatus(CostDomain.STATUS_REJECT);
costDao.updateById(costDomain);
......
......@@ -136,6 +136,14 @@ public abstract class AbstractCostPlanService implements CostPlanService {
@Override
public void deleted(String costPlanNo) {
if (costPlanNo.startsWith("S")) {
//费用计划
CostPlanDomain costPlanDomain = costPlanDao.selectByNo(costPlanNo);
//费用计划关联借支单
CostDomain costDomain = costDao.selectByCostNo(costPlanDomain.getSupCostNo());
costDomain.setCompensate(costDomain.getCompensate().subtract(costPlanDomain.getPlanAmount()));
costDao.updateById(costDomain);
}
costPlanDao.deleteByNo(costPlanNo);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment