diff --git a/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialReceivablesServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialReceivablesServiceImpl.java index 26a621a7..f3e75552 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialReceivablesServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialReceivablesServiceImpl.java @@ -249,9 +249,23 @@ public class FinancialReceivablesServiceImpl implements IFinancialReceivablesSer /* * 结案 * */ + @Transactional(rollbackFor = Exception.class) @Override public int closingFinancialReceivablesById(Long financialReceivablesId) { int result = financialReceivablesMapper.updateReceivablesClosingStatusById(financialReceivablesId); + FinancialReceivables financialReceivables = financialReceivablesMapper.selectFinancialReceivablesById(financialReceivablesId); + String salesOrderCode = financialReceivables.getSalesOrderCode(); + + SysSalesOrderVo sysSalesOrderVo = sysSalesOrderMapper.selectSysSalesOrderBySalesOrderCode(salesOrderCode); + //设置为已结案 + sysSalesOrderVo.setCloseStatus("3"); + if (sysSalesOrderVo == null){ + log.warn("销售单号不存在:{}", salesOrderCode); + } + int updateSysSalesOrderResult = sysSalesOrderMapper.updateSysSalesOrder(sysSalesOrderVo); + if (updateSysSalesOrderResult <= 0){ + throw new BusinessException("销售订单结案失败"); + } return result; }