| | |
| | | import com.project.system.domain.bo.editBo.CheckBo; |
| | | import com.project.system.domain.bo.editBo.SysCompanyBo; |
| | | import com.project.system.service.ISysCompanyService; |
| | | import com.project.system.service.ISysUserService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | private final ISysCompanyService companyService; |
| | | private final IEnforceOrderService orderService; |
| | | private final IEnforceCheckLogService checkLogService; |
| | | private final ISysUserService userService; |
| | | private final YPSmsService smsService; |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | addCheckLog(order, bo); |
| | | if (bo.getCheckStatus()==-1){ |
| | | order.setCheckStatus(-1); |
| | | //审批拒绝,给申请人发送短信,如果通知企业也给企业发送短信 |
| | | smsService.sendCheckMsg(order.getApplyPhone(), order.getCheckStatus()); |
| | | } else { |
| | | String roleKey = "check_enforce_" + (order.getCheckLevel() + 1); |
| | | List<Long> ids = userService.getNumByRoleKey(roleKey, order.getCheckDeptId()); |
| | | if (StringUtils.isNotEmpty(ids)){ |
| | | List<String> phones = orderService.getCheckPhones(order.getCheckLevel(), order.getApplyDeptId()); |
| | | if (StringUtils.isNotEmpty(phones)){ |
| | | order.setCheckStatus(1); |
| | | //给下一级审批人发送短信 |
| | | smsService.sendApplyMsg(phones, order.getApplyUser()); |
| | | } else { |
| | | order.setCheckStatus(2); |
| | | order.setOrderStatus(2); |
| | | //审批通过,给申请人发送短信,如果通知企业也给企业发送短信 |
| | | smsService.sendCheckMsg(order.getApplyPhone(), order.getCheckStatus()); |
| | | if (order.getIsNoticeCompany()==1){ |
| | | smsService.sendCompanyMsg(order.getCompanyPhone(), order.getApplyDeptName(), order.getPlanTime()); |
| | | } |
| | | } |
| | | //审批登记加1 |
| | | //审批等级加1 |
| | | order.setCheckLevel(order.getCheckLevel()+1); |
| | | } |
| | | order.setCheckReason(bo.getCheckReason()); |