| | |
| | | import com.fzzy.work.domain.WorkOrderConf; |
| | | import com.fzzy.work.domain.WorkOrderProcess; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | */ |
| | | public BaseResp todoByProcess(WorkOrderProcess process) { |
| | | |
| | | String action = process.getAction(); |
| | | if (StringUtils.isEmpty(action)) { |
| | | return BaseResp.error("没有识别到处理动作,请重新尝试"); |
| | | } |
| | | |
| | | log.info("-----工单处理-----{}", process); |
| | | //获取工单 |
| | | WorkOrder work = orderService.selectById(process.getOrderId()); |
| | | if (null == work) return BaseResp.error("当前工单已不存在"); |
| | | |
| | | if (work.getStatus().equals(WorkStatus.STATUS_50.getCode()) |
| | | || work.getStatus().equals(WorkStatus.STATUS_60.getCode())) { |
| | | return BaseResp.error("当前工单已处理,请刷新页面重试!!"); |
| | | } |
| | | |
| | | String curNode = process.getNode(); |
| | | //获取处理人 |
| | |
| | | WorkOrderConf conf = confService.selectById(work.getConfId()); |
| | | if (null == conf) return BaseResp.error("当前工单未配置流程"); |
| | | |
| | | |
| | | String action = process.getAction(); |
| | | //添加记录 |
| | | process.setId(ContextUtil.UUID()); |
| | | process.setCreateTime(new Date()); |
| | |
| | | //结束判断,如果是结束节点,则结束工单 |
| | | if(WorkNode.NODE_END.getCode().equals(process.getNode())){ |
| | | work.setStatus(WorkStatus.STATUS_50.getCode()); |
| | | |
| | | work.setAssigneeName(process.getAssigneeName()); |
| | | work.setAssigneeId(process.getAssigneeId()); |
| | | |
| | | orderService.complete(work); |
| | | } |
| | | } |