Пример #1
0
 /**
  * 断电告警派单
  *
  * @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);
   }
 }
Пример #2
0
 /**
  * 执行供电保障派单工作流
  *
  * @param oeDispatchTask OeDispatchTask 输入的断电告警派单信息
  * @param smParameter SmParameter 短信发送参数
  */
 private void doWorkflowStart(OeDispatchTask oeDispatchTask, SmParameter smParameter) {
   ProMockPo taskPi = new ProMockPo();
   taskPi.setBzid(oeDispatchTask.getId());
   taskPi.setUserId(oeDispatchTask.getCurrentProcessUserId());
   String userName = super.getUserName(oeDispatchTask.getCurrentProcessUserId());
   taskPi.setUserName(userName);
   taskPi.setDealGroup(oeDispatchTask.getNextProcessOrgId());
   String orgName = super.getOrgName(oeDispatchTask.getNextProcessOrgId());
   taskPi.setDealGroupName(orgName);
   super.getElectricitySecurityWorkflowService().sendTaskTwoSteps(taskPi, smParameter);
 }
Пример #3
0
 /**
  * 获取派单短信发送参数
  *
  * @param oeDispatchTask OeDispatchTask 输入的断电告警派单信息
  * @return SmParameter 短信发送参数
  */
 private SmParameter getSmParameter(OeDispatchTask oeDispatchTask) {
   String simId = super.getOrgTel(oeDispatchTask.getNextProcessOrgId());
   String[] contentParameters = new String[] {oeDispatchTask.getTitle()};
   SmParameter parameter =
       SmParameter.getInstance(ELECTRICTITY_XML_FILE_ID, SEND_MSG_ID, simId, contentParameters);
   parameter.setWrittenDb(true);
   parameter.setBusinessType(SysConstant.DICTIONARY_FORMITEM_BUSINESSTYPE_C31);
   parameter.setHandleLimit(oeDispatchTask.getHandleLimit());
   parameter.setWorkorderId(oeDispatchTask.getId());
   parameter.setWorkorderTitle(oeDispatchTask.getTitle());
   parameter.setWorkorderType(SysConstant.OE_DISPATCHTASK_FLOW_TYPE);
   return parameter;
 }