Commit 3b442286 authored by liufan's avatar liufan

Merge remote-tracking branch 'origin/develop_tzs_register' into develop_tzs_register

parents 060747df af234dc4
...@@ -9,6 +9,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -9,6 +9,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @author system_generator * @author system_generator
* @date 2023-12-18 * @date 2023-12-18
*/ */
public interface JgInstallationNoticeEqMapper extends BaseMapper<JgInstallationNoticeEq> { public interface JgInstallationNoticeEqMapper extends CustomBaseMapper<JgInstallationNoticeEq> {
} }
...@@ -79,8 +79,7 @@ public class JgInstallationByWorkFlowController { ...@@ -79,8 +79,7 @@ public class JgInstallationByWorkFlowController {
public ResponseModel<JgInstallationNoticeDto> accept(@RequestBody Map<String, Object> model, String op) { public ResponseModel<JgInstallationNoticeDto> accept(@RequestBody Map<String, Object> model, String op) {
// TODO 受理安装告知流程 // TODO 受理安装告知流程
LinkedHashMap model1 = (LinkedHashMap)model.get("model"); LinkedHashMap model1 = (LinkedHashMap)model.get("model");
LinkedHashMap form = (LinkedHashMap)model1.get("form"); LinkedHashMap installationInfo = (LinkedHashMap)model1.get("installationInfo");
LinkedHashMap installationInfo = (LinkedHashMap)form.get("installationInfo");
JgInstallationNoticeDto jgInstallationNoticeDto = JSON.parseObject(JSON.toJSONString(installationInfo), JgInstallationNoticeDto.class); JgInstallationNoticeDto jgInstallationNoticeDto = JSON.parseObject(JSON.toJSONString(installationInfo), JgInstallationNoticeDto.class);
jgInstallationNoticeServiceImpl.accept(jgInstallationNoticeDto,op); jgInstallationNoticeServiceImpl.accept(jgInstallationNoticeDto,op);
return ResponseHelper.buildResponse(null); return ResponseHelper.buildResponse(null);
......
...@@ -10,13 +10,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -10,13 +10,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jg.api.dto.ByteArrayMultipartFile; import com.yeejoin.amos.boot.module.jg.api.dto.ByteArrayMultipartFile;
import com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeDto; import com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice; import com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice;
import com.yeejoin.amos.boot.module.jg.api.entity.JgRelationEquip; import com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNoticeEq;
import com.yeejoin.amos.boot.module.jg.api.enums.FlowStatusEnum; import com.yeejoin.amos.boot.module.jg.api.enums.FlowStatusEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeEqMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeMapper; 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.service.IJgInstallationNoticeService;
import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient; import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient;
import com.yeejoin.amos.boot.module.jg.biz.utils.JsonUtils;
import com.yeejoin.amos.boot.module.ymt.api.entity.OtherInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.OtherInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.RegistrationInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.RegistrationInfo;
import com.yeejoin.amos.boot.module.jg.biz.utils.ImageUtils; import com.yeejoin.amos.boot.module.jg.biz.utils.ImageUtils;
...@@ -28,6 +27,7 @@ import com.yeejoin.amos.component.feign.model.FeignClientResult; ...@@ -28,6 +27,7 @@ import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.workflow.Workflow; import com.yeejoin.amos.feign.workflow.Workflow;
import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO;
import com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO; import com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO;
import com.yeejoin.amos.feign.workflow.model.AjaxResult; import com.yeejoin.amos.feign.workflow.model.AjaxResult;
import com.yeejoin.amos.boot.module.ymt.api.entity.TzsJgOtherInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.TzsJgOtherInfo;
...@@ -82,7 +82,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -82,7 +82,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
EquipmentCategoryMapper equipmentCategoryMapper; EquipmentCategoryMapper equipmentCategoryMapper;
@Autowired @Autowired
JgRelationEquipMapper jgRelationEquipMapper; JgInstallationNoticeEqMapper jgInstallationNoticeEqMapper;
@Autowired @Autowired
private JgInstallationNoticeMapper jgInstallationNoticeMapper; private JgInstallationNoticeMapper jgInstallationNoticeMapper;
...@@ -209,16 +209,6 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -209,16 +209,6 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
log.error("提交失败:{}", e); log.error("提交失败:{}", e);
} }
// 生成告知单
JgInstallationNotice jgInstallationNotice = this.getById(noticeDto.getSequenceNbr());
if (String.valueOf(FlowStatusEnum.SUBMITTED.getCode()).equals(jgInstallationNotice.getNoticeStatus())) {
String reportUrl = this.generateInstallationNoticeReport(jgInstallationNotice.getSequenceNbr());
if (StringUtils.hasText(reportUrl)) {
jgInstallationNotice.setNoticeReportUrl(reportUrl);
jgInstallationNoticeMapper.updateById(jgInstallationNotice);
}
}
return noticeDto; return noticeDto;
} }
...@@ -413,66 +403,44 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -413,66 +403,44 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
List<String> instanceIdList = new ArrayList<>(); List<String> instanceIdList = new ArrayList<>();
if (SUBMIT_TYPE_FLOW.equals(submitType)) { if (SUBMIT_TYPE_FLOW.equals(submitType)) {
// 发起流程 // 发起流程
ActWorkflowStartDTO dto = new ActWorkflowStartDTO(); // ActWorkflowStartDTO dto = new ActWorkflowStartDTO();
// String[] strIds = new String[deviceList.size()]; ActWorkflowBatchDTO actWorkflowBatchDTO = new ActWorkflowBatchDTO();
// String[] strKeys = new String[deviceList.size()]; List<ActWorkflowStartDTO> list = new ArrayList<>();
// for (int i = 0; i<deviceList.size() ; i++
// for (int i = 0; i<deviceList.size() ; i++ ) {
// ) { ActWorkflowStartDTO dto = new ActWorkflowStartDTO();
// strIds[i] = PROCESS_DEFINITION_KEY;
// strKeys[i] = String.valueOf(i);
// }
// dto.setProcessDefinitionIds(String.join(",", strIds));
// dto.setProcessDefinitionKeys(String.join(",", strKeys));
// dto.setCompleteFirstTask(true);
//
// try {
// FeignClientResult result = Workflow.taskV2Client.startByVariable(dto);
// } catch (Exception e) {
// e.printStackTrace();
// }
for (int i = 0; i < deviceList.size(); i++) {
dto.setProcessDefinitionKey(PROCESS_DEFINITION_KEY); dto.setProcessDefinitionKey(PROCESS_DEFINITION_KEY);
dto.setBusinessKey("1"); dto.setBusinessKey(String.valueOf(i));
AjaxResult ajaxResult = null; dto.setCompleteFirstTask(true);
try { list.add(dto);
ajaxResult = Workflow.taskClient.startByVariable(dto); }
String instanceId = ((Map) ajaxResult.get("data")).get("id").toString(); actWorkflowBatchDTO.setProcess(list);
instanceIdList.add(instanceId);
ajaxResult = Workflow.taskClient.getTask(instanceId); try {
// 执行一步 FeignClientResult result = Workflow.taskV2Client.startByVariableBatch(actWorkflowBatchDTO);
JSONObject dataObject = JSON.parseObject(JSON.toJSONString(ajaxResult.get("data"))); List<Object> returnList = (List<Object>) result.getResult();
String taskId = dataObject.getString("id"); for (Object obj :returnList
//组装信息 ) {
TaskResultDTO taskResultDTO = new TaskResultDTO(); JSONObject jsonObject = JSON.parseObject(JSONObject.toJSONString(obj));
taskResultDTO.setResultCode("approvalStatus"); instanceIdList.add(jsonObject.getString("id"));
taskResultDTO.setTaskId(taskId);
taskResultDTO.setComment("提交流程");
HashMap<String, Object> map = new HashMap<>();
map.put("approvalStatus", "0");
taskResultDTO.setVariable(map);
//执行流程
Workflow.taskClient.completeByTask(taskId, taskResultDTO);
} catch (Exception e) {
log.error("流程启动失败:{}", e);
} }
} catch (Exception e) {
e.printStackTrace();
} }
} }
List<JgInstallationNotice> list = new ArrayList<>(); List<JgInstallationNotice> list = new ArrayList<>();
List<JgRelationEquip> equipList = new ArrayList<>(); List<JgInstallationNoticeEq> equipList = new ArrayList<>();
deviceList.forEach(obj -> { deviceList.forEach(obj -> {
JgRelationEquip jgRelationEquip = new JgRelationEquip(); JgInstallationNoticeEq jgRelationEquip = new JgInstallationNoticeEq();
JgInstallationNotice dto = new JgInstallationNotice(); JgInstallationNotice dto = new JgInstallationNotice();
BeanUtils.copyProperties(model, dto); BeanUtils.copyProperties(model, dto);
int i = deviceList.indexOf(obj); int i = deviceList.indexOf(obj);
String applyNo = applyNoList.get(i); String applyNo = applyNoList.get(i);
dto.setApplyNo(applyNo); dto.setApplyNo(applyNo);
dto.setEquList(String.valueOf(obj.get("SEQUENCE_NBR"))); dto.setEquList(String.valueOf(obj.get("SEQUENCE_NBR")));
jgRelationEquip.setEquipId(String.valueOf(obj.get("SEQUENCE_NBR"))); jgRelationEquip.setEquId(String.valueOf(obj.get("SEQUENCE_NBR")));
jgRelationEquip.setApplyNo(applyNo);
jgRelationEquip.setBusinessType(ApplicationFormTypeEnum.AZGZ.getCode());
if (!CollectionUtils.isEmpty(instanceIdList)) { if (!CollectionUtils.isEmpty(instanceIdList)) {
dto.setInstanceId(instanceIdList.get(i)); dto.setInstanceId(instanceIdList.get(i));
dto.setNoticeStatus(String.valueOf(FlowStatusEnum.TO_BE_PROCESSED.getCode())); dto.setNoticeStatus(String.valueOf(FlowStatusEnum.TO_BE_PROCESSED.getCode()));
...@@ -485,13 +453,13 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -485,13 +453,13 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
jgInstallationNoticeMapper.insertBatchSomeColumn(list); jgInstallationNoticeMapper.insertBatchSomeColumn(list);
List<JgRelationEquip> jgRelationEquipList = equipList.stream().map(jgRelationEquip -> { List<JgInstallationNoticeEq> jgRelationEquipList = equipList.stream().map(jgRelationEquip -> {
List<JgInstallationNotice> collect = list.stream().filter(jgInstallationNotice -> jgRelationEquip.getApplyNo().equals(jgInstallationNotice.getApplyNo())).collect(Collectors.toList()); List<JgInstallationNotice> collect = list.stream().filter(jgInstallationNotice -> jgRelationEquip.getEquipTransferId().equals(jgInstallationNotice.getSequenceNbr())).collect(Collectors.toList());
Long sequenceNbr = collect.get(0).getSequenceNbr(); Long sequenceNbr = collect.get(0).getSequenceNbr();
return jgRelationEquip.setBusinessId(String.valueOf(sequenceNbr)); return jgRelationEquip.setEquipTransferId(String.valueOf(sequenceNbr));
}).collect(Collectors.toList()); }).collect(Collectors.toList());
jgRelationEquipMapper.insertBatchSomeColumn(jgRelationEquipList); jgInstallationNoticeEqMapper.insertBatchSomeColumn(jgRelationEquipList);
} }
...@@ -615,16 +583,16 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -615,16 +583,16 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
log.error("日期转换失败:{}", e); log.error("日期转换失败:{}", e);
} }
LambdaQueryWrapper<JgRelationEquip> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<JgInstallationNoticeEq> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(JgRelationEquip::getBusinessId,dto.getSequenceNbr()); queryWrapper.eq(JgInstallationNoticeEq::getEquipTransferId,dto.getSequenceNbr());
JgRelationEquip jgRelationEquip = jgRelationEquipMapper.selectOne(queryWrapper); JgInstallationNoticeEq jgRelationEquip = jgInstallationNoticeEqMapper.selectOne(queryWrapper);
LambdaQueryWrapper<OtherInfo> queryWrapper1 = new LambdaQueryWrapper<>(); LambdaQueryWrapper<OtherInfo> queryWrapper1 = new LambdaQueryWrapper<>();
queryWrapper1.eq(OtherInfo::getRecord,jgRelationEquip.getEquipId()); queryWrapper1.eq(OtherInfo::getRecord,jgRelationEquip.getEquId());
OtherInfo tzsJgOtherInfo = tzsJgOtherInfoMapper.selectOne(queryWrapper1); OtherInfo tzsJgOtherInfo = tzsJgOtherInfoMapper.selectOne(queryWrapper1);
LambdaQueryWrapper<RegistrationInfo> queryWrapper2 = new LambdaQueryWrapper<>(); LambdaQueryWrapper<RegistrationInfo> queryWrapper2 = new LambdaQueryWrapper<>();
queryWrapper2.eq(RegistrationInfo::getRecord,jgRelationEquip.getEquipId()); queryWrapper2.eq(RegistrationInfo::getRecord,jgRelationEquip.getEquId());
RegistrationInfo tzsJgRegistrationInfo = tzsJgRegistrationInfoMapper.selectOne(queryWrapper2); RegistrationInfo tzsJgRegistrationInfo = tzsJgRegistrationInfoMapper.selectOne(queryWrapper2);
stringBuffer.append(tzsJgRegistrationInfo.getEquCategory()).append(dto.getCity()).append(ym); stringBuffer.append(tzsJgRegistrationInfo.getEquCategory()).append(dto.getCity()).append(ym);
...@@ -644,6 +612,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -644,6 +612,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
if(submit) { if(submit) {
if("0".equals(op)) { if("0".equals(op)) {
dto.setNoticeStatus(String.valueOf(FlowStatusEnum.HAVE_PROCESSED.getCode())); dto.setNoticeStatus(String.valueOf(FlowStatusEnum.HAVE_PROCESSED.getCode()));
this.generateInstallationNoticeReport(dto.getSequenceNbr());
} else { } else {
dto.setNoticeStatus(String.valueOf(FlowStatusEnum.TO_BE_SUBMITTED.getCode())); dto.setNoticeStatus(String.valueOf(FlowStatusEnum.TO_BE_SUBMITTED.getCode()));
dto.setStatus(String.valueOf(FlowStatusEnum.REJECTED.getCode())); dto.setStatus(String.valueOf(FlowStatusEnum.REJECTED.getCode()));
......
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