/** * 断电告警派单 * * @param oeDispatchTask OeDispatchTask 输入的断电告警派单信息 * @param userInfo UserInfo 当前登录用户信息 */ @Override public void save(OeDispatchTask oeDispatchTask, UserInfo userInfo) { String alarmId = saveOeOutageAlarm(oeDispatchTask); if (OeDispatchTask.IS_SUBMITED.equals(oeDispatchTask.getIsSubmited())) { oeDispatchTask.setState(OeDispatchTask.WAIT_SCHEDULED_STATE); } else { oeDispatchTask.setState(OeDispatchTask.WAIT_DISPATCHED_STATE); } if (StringUtils.isBlank(oeDispatchTask.getId())) { oeDispatchTask.setId(null); } oeDispatchTask.setAlarmId(alarmId); oeDispatchTask.setCreator(userInfo.getPersonId()); oeDispatchTask.setCreateDate(new Date()); oeDispatchTask.setCurrentProcessUserId(userInfo.getPersonId()); oeDispatchTask.setNextProcessOrgId(oeDispatchTask.getMaintenanceId()); String taskCode = super.commonOrderCodeService.generatorWorkOrderCode( userInfo.getRegionId(), SysConstant.DICTIONARY_FORMITEM_BUSINESSTYPE_C31, SysConstant.OE_DISPATCHTASK_FLOW_TYPE); if (StringUtils.isBlank(oeDispatchTask.getTaskCode())) { oeDispatchTask.setTaskCode(taskCode); } oeDispatchTaskDao.save(oeDispatchTask); if (OeDispatchTask.IS_SUBMITED.equals(oeDispatchTask.getIsSubmited())) { SmParameter smParameter = getSmParameter(oeDispatchTask); doWorkflowStart(oeDispatchTask, smParameter); } }
/** * 保存断电告警单信息 * * @param oeDispatchTask OeDispatchTask 输入的断电告警派单信息 * @return String 断电告警单编号 */ private String saveOeOutageAlarm(OeDispatchTask oeDispatchTask) { OeOutageAlarm oeOutageAlarm; if (StringUtils.isBlank(oeDispatchTask.getAlarmId())) { return ""; } oeOutageAlarm = oeOutageAlarmDao.get(oeDispatchTask.getAlarmId()); oeOutageAlarmDao.save(oeOutageAlarm); return oeOutageAlarm.getId(); }