|
|
|
@ -1,22 +1,22 @@
|
|
|
|
|
package com.docus.server.controller;
|
|
|
|
|
|
|
|
|
|
import com.docus.core.util.ParamsUtils;
|
|
|
|
|
import com.docus.core.util.json.JSON;
|
|
|
|
|
import com.docus.infrastructure.web.request.SearchDTO;
|
|
|
|
|
import com.docus.infrastructure.web.response.PageResult;
|
|
|
|
|
import com.docus.log.annotation.TrackGroup;
|
|
|
|
|
import com.docus.server.api.scheduling.management.SchCollectRecordApi;
|
|
|
|
|
import com.docus.server.common.MsgConstants;
|
|
|
|
|
import com.docus.server.common.SchedulerTask;
|
|
|
|
|
import com.docus.server.common.process.ChannelProcessor;
|
|
|
|
|
import com.docus.server.dto.scheduling.management.schcollector.task.SchCollectorTaskDTO;
|
|
|
|
|
import com.docus.server.dto.scheduling.management.schcollector.task.ReportDownTwoDTO;
|
|
|
|
|
import com.docus.server.dto.scheduling.management.schcollectrecord.AddSchCollectRecordDTO;
|
|
|
|
|
import com.docus.server.dto.scheduling.management.schcollectrecord.DeleteSchCollectRecordDTO;
|
|
|
|
|
import com.docus.server.dto.scheduling.management.schcollectrecord.EditSchCollectRecordDTO;
|
|
|
|
|
import com.docus.server.dto.scheduling.management.schterminator.CommMsgDTO;
|
|
|
|
|
import com.docus.server.dto.scheduling.management.schcollectrecord.RetrySchCollectRecordDTO;
|
|
|
|
|
import com.docus.server.entity.scheduling.management.SchCollectRecord;
|
|
|
|
|
import com.docus.server.service.ICommMsgService;
|
|
|
|
|
import com.docus.server.enums.RetryTaskEnum;
|
|
|
|
|
import com.docus.server.service.ISchCollectRecordService;
|
|
|
|
|
import com.docus.server.vo.scheduling.management.schcollectrecord.SchCollectRecordVO;
|
|
|
|
|
import com.fasterxml.jackson.core.type.TypeReference;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
@ -32,7 +32,7 @@ public class SchCollectRecordController implements SchCollectRecordApi {
|
|
|
|
|
@Resource
|
|
|
|
|
private ISchCollectRecordService iSchCollectRecordService;
|
|
|
|
|
@Resource
|
|
|
|
|
private ICommMsgService iCommMsgService;
|
|
|
|
|
private SchedulerTask schedulerTask;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 按主键查询
|
|
|
|
@ -42,44 +42,6 @@ public class SchCollectRecordController implements SchCollectRecordApi {
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public SchCollectRecordVO findById(String id) {
|
|
|
|
|
String s = "{\n" +
|
|
|
|
|
"\t\"taskInfo\": {\n" +
|
|
|
|
|
"\t\t\"createTime\": \"2022-12-03 12:39:30\",\n" +
|
|
|
|
|
"\t\t\"hospitals\": [{\n" +
|
|
|
|
|
"\t\t\t\"admissDate\": \"2023-12-31 01:01:01\",\n" +
|
|
|
|
|
"\t\t\t\"admissId\": \"amid_999901\",\n" +
|
|
|
|
|
"\t\t\t\"admissTimes\": 1,\n" +
|
|
|
|
|
"\t\t\t\"disDate\": \"2023-12-31 01:01:01\",\n" +
|
|
|
|
|
"\t\t\t\"disDeptName\": \"22222\",\n" +
|
|
|
|
|
"\t\t\t\"patientId\": \"758878610105573376\"\n" +
|
|
|
|
|
"\t\t}],\n" +
|
|
|
|
|
"\t\t\"jzh\": \"jzh_999901\",\n" +
|
|
|
|
|
"\t\t\"patient\": {\n" +
|
|
|
|
|
"\t\t\t\"inpatientNo\": \"999901\",\n" +
|
|
|
|
|
"\t\t\t\"name\": \"ceshi\",\n" +
|
|
|
|
|
"\t\t\t\"patientId\": \"758878610105573376\"\n" +
|
|
|
|
|
"\t\t},\n" +
|
|
|
|
|
"\t\t\"patientId\": \"758878610105573376\",\n" +
|
|
|
|
|
"\t\t\"recordType\": \"1\",\n" +
|
|
|
|
|
"\t\t\"tasks\": [{\n" +
|
|
|
|
|
"\t\t\t\"collectorId\": \"1\",\n" +
|
|
|
|
|
"\t\t\t\"patientId\": \"758878610105573376\",\n" +
|
|
|
|
|
"\t\t\t\"taskId\": \"834292710565826560\"\n" +
|
|
|
|
|
"\t\t}]\n" +
|
|
|
|
|
"\t},\n" +
|
|
|
|
|
"\t\"collectorRecordId\": \"123\",\n" +
|
|
|
|
|
"\t\"isRetry\": 0\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"}";
|
|
|
|
|
SchCollectorTaskDTO schCollectorTaskDTO = JSON.fromJSONWithGeneric(s, new TypeReference<SchCollectorTaskDTO>() {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
CommMsgDTO commMsgDTO = CommMsgDTO.builder()
|
|
|
|
|
.content(JSON.toJSON(schCollectorTaskDTO))
|
|
|
|
|
.messageType(MsgConstants.SCH_DISTRIBUTE_TASKS)
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
|
|
iCommMsgService.clientsCommand(commMsgDTO);
|
|
|
|
|
return iSchCollectRecordService.findById(id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -127,4 +89,15 @@ public class SchCollectRecordController implements SchCollectRecordApi {
|
|
|
|
|
public int delete(DeleteSchCollectRecordDTO deleteSchCollectRecordDTO) {
|
|
|
|
|
return iSchCollectRecordService.delete(deleteSchCollectRecordDTO);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void retryTask(RetrySchCollectRecordDTO retrySchCollectRecordDTO) {
|
|
|
|
|
ReportDownTwoDTO report = JSON.fromJSON(retrySchCollectRecordDTO.getTaskOriginJson(), ReportDownTwoDTO.class);
|
|
|
|
|
|
|
|
|
|
report.setParams(ParamsUtils
|
|
|
|
|
.addParam("collectRecordId", retrySchCollectRecordDTO.getId())
|
|
|
|
|
.addParam("isRetryTask", RetryTaskEnum.RETRY_TASK.getValue())
|
|
|
|
|
.param());
|
|
|
|
|
schedulerTask.addRetryTask(report);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|