| | |
| | | @Transactional |
| | | public Boolean checkOrder(CheckBo bo) |
| | | { |
| | | if (StringUtils.isNotEmpty(bo.getIds())){ |
| | | throw new BaseException("请选择要审批的单据!"); |
| | | } |
| | | switch (bo.getCheckType()) |
| | | { |
| | | case 1: |
| | | SysCompany company = companyService.getById(bo.getId()); |
| | | for (Long id : bo.getIds()) { |
| | | SysCompany company = companyService.getById(id); |
| | | if (company==null) { |
| | | throw new BaseException("没有找到对应数据,请检查审核类型!"); |
| | | } |
| | |
| | | addCheckLog(company, bo); |
| | | company.setCheckReason(bo.getCheckReason()); |
| | | companyService.updStatus(companyBo); |
| | | return companyService.updateById(company); |
| | | companyService.updateById(company); |
| | | } |
| | | return true; |
| | | case 2: |
| | | EnforceOrder order = orderService.getById(bo.getId()); |
| | | for (Long id : bo.getIds()) { |
| | | EnforceOrder order = orderService.getById(id); |
| | | if (order==null) { |
| | | throw new BaseException("没有找到对应数据,请检查审核类型!"); |
| | | } |
| | |
| | | } |
| | | //审批等级加1 |
| | | order.setCheckLevel(order.getCheckLevel()+1); |
| | | } |
| | | order.setCheckReason(bo.getCheckReason()); |
| | | return orderService.updateById(order); |
| | | orderService.updateById(order); |
| | | } |
| | | |
| | | } |
| | | return true; |
| | | } |
| | | return false; |
| | | } |