Commit f07c6394 authored by xixinzhao's avatar xixinzhao

Merge branch 'develop_tzs_register' of…

Merge branch 'develop_tzs_register' of http://36.40.66.175:5000/moa/amos-boot-biz into develop_tzs_register
parents d45967ad eda0d728
......@@ -11,20 +11,14 @@ import com.yeejoin.amos.boot.module.jg.api.enums.FlowStatusEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgRelationEquipMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService;
import com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeDto;
import com.yeejoin.amos.boot.module.tcm.api.enums.ApplicationFormTypeEnum;
import com.yeejoin.amos.boot.module.tcm.api.service.ICreateCodeService;
import com.yeejoin.amos.feign.workflow.Workflow;
import com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO;
import com.yeejoin.amos.feign.workflow.model.AjaxResult;
import com.yeejoin.amos.boot.module.jg.biz.service.ICommonService;
import com.yeejoin.amos.feign.workflow.Workflow;
import com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO;
import com.yeejoin.amos.feign.workflow.model.AjaxResult;
import com.yeejoin.amos.feign.workflow.model.TaskResultDTO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
......@@ -47,10 +41,13 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
public static final String SUBMIT_TYPE_FLOW = "1";
public static final String PROCESS_DEFINITION_KEY = "installationNotification";
public static final String TABLE_PAGE_ID = "1734141426742095873";
@Autowired
private JgRelationEquipMapper jgRelationEquipMapper;
@Autowired
private JgInstallationNoticeMapper jgInstallationNoticeMapper;
@Autowired
@SuppressWarnings("all")
private ICreateCodeService iCreateCodeService;
/**
* 根据sequenceNbr查询
......@@ -82,14 +79,21 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
*
* @param noticeDto 安装告知
*/
@SuppressWarnings("rawtypes")
@SuppressWarnings({"rawtypes", "Duplicates"})
public JgInstallationNoticeDto updateInstallationNotice(JgInstallationNoticeDto noticeDto, String op) {
if (Objects.isNull(noticeDto) || StringUtils.isEmpty(op)) {
throw new IllegalArgumentException("参数不能为空");
}
// 字段转换
this.convertField(noticeDto);
AjaxResult ajaxResult;
// 发起流程
if (!StringUtils.hasText(noticeDto.getInstanceId())) {
ActWorkflowStartDTO dto = new ActWorkflowStartDTO();
dto.setProcessDefinitionKey("installationNotification");
dto.setBusinessKey("1");
AjaxResult ajaxResult;
try {
ajaxResult = Workflow.taskClient.startByVariable(dto);
String instanceId = ((Map) ajaxResult.get("data")).get("id").toString();
......@@ -102,6 +106,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
} catch (Exception e) {
log.error("提交失败:{}", e);
}
}
ajaxResult = Workflow.taskClient.getTask(noticeDto.getInstanceId());
JSONObject dataObject = JSON.parseObject(JSON.toJSONString(ajaxResult.get("data")));
......@@ -121,7 +126,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
if (ObjectUtils.isEmpty(ajaxResult1)) {
noticeDto.setStatus(String.valueOf(FlowStatusEnum.REJECTED.getCode()));
JgInstallationNotice bean = new JgInstallationNotice();
BeanUtils.copyProperties(dto,bean);
BeanUtils.copyProperties(noticeDto, bean);
jgInstallationNoticeMapper.updateById(bean);
}
} catch (Exception e) {
......@@ -130,11 +135,6 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
return noticeDto;
}
@Autowired
private ICreateCodeService iCreateCodeService;
@Autowired
JgRelationEquipMapper jgRelationEquipMapper;
/**
* 分页查询
*
......@@ -194,6 +194,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
}
@Override
@SuppressWarnings({"Duplicates", "rawtypes"})
@Transactional(rollbackFor = Exception.class)
public void saveNotice(String submitType, Map<String, JgInstallationNoticeDto> jgInstallationNoticeDtoMap) {
JgInstallationNoticeDto model = jgInstallationNoticeDtoMap.get(TABLE_PAGE_ID);
......@@ -217,7 +218,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
if (SUBMIT_TYPE_FLOW.equals(submitType)) {
// 发起流程
ActWorkflowStartDTO dto = new ActWorkflowStartDTO();
for (int i = 0 ; i< deviceList.size(); i++) {
for (int i = 0; i < deviceList.size(); i++) {
dto.setProcessDefinitionKey(PROCESS_DEFINITION_KEY);
dto.setBusinessKey("1");
AjaxResult ajaxResult = null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment