|
|
|
|
@ -6,6 +6,7 @@ import com.example.duplicate.controller.param.ArchiveOtherExtDto;
|
|
|
|
|
import com.example.duplicate.controller.param.PrintParam;
|
|
|
|
|
import com.example.duplicate.controller.vo.ArchiveMasterVo;
|
|
|
|
|
import com.example.duplicate.controller.vo.ArchiveOtherExtVo;
|
|
|
|
|
import com.example.duplicate.controller.vo.medicalCompensateVo;
|
|
|
|
|
import com.example.duplicate.infrastructure.dao.ArchiveMasterMapper;
|
|
|
|
|
import com.example.duplicate.infrastructure.dao.ArchiveOtherExtMapper;
|
|
|
|
|
import com.example.duplicate.service.MedicalAdviceService;
|
|
|
|
|
@ -49,7 +50,7 @@ public class MedicalAdviceServiceImpl implements MedicalAdviceService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public CommonResult<?> pollingAddTask() {
|
|
|
|
|
//获取当前30分钟前出院病历生成医嘱任务
|
|
|
|
|
//获取当前30分钟前出院病历生成任务
|
|
|
|
|
List<ArchiveMasterVo> medicalAdviceTask = ArchiveMasterMapper.getMedicalAdviceTask();
|
|
|
|
|
if (CollectionUtils.isEmpty(medicalAdviceTask)) {
|
|
|
|
|
log.info("当前没有需要生成任务的病历");
|
|
|
|
|
@ -111,6 +112,23 @@ public class MedicalAdviceServiceImpl implements MedicalAdviceService {
|
|
|
|
|
return CommonResult.success("轮询完成已经增加任务");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public CommonResult<?> medicalCompensate() {
|
|
|
|
|
//查询未完成的首页任务
|
|
|
|
|
List<medicalCompensateVo> medicalCompensateVos = archiveOtherExtMapper.medicalCompensate(9);
|
|
|
|
|
if (CollectionUtils.isEmpty(medicalCompensateVos)) {
|
|
|
|
|
log.info("当前没有需要生成的首页任务");
|
|
|
|
|
return CommonResult.failed("当前没有需要生成的首页任务");
|
|
|
|
|
}
|
|
|
|
|
PrintParam printParam = new PrintParam();
|
|
|
|
|
//补偿任务
|
|
|
|
|
for (medicalCompensateVo tasks : medicalCompensateVos){
|
|
|
|
|
//存放队列消息
|
|
|
|
|
GenerateQueueCompensate(tasks, printParam, 1, tasks.getSysFlag());
|
|
|
|
|
}
|
|
|
|
|
return CommonResult.success("补偿任务完成");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//生成队列消息
|
|
|
|
|
private void GenerateQueue(ArchiveMasterVo task, PrintParam data, Integer ispriority, String collectid) {
|
|
|
|
|
@ -125,4 +143,20 @@ public class MedicalAdviceServiceImpl implements MedicalAdviceService {
|
|
|
|
|
String key = String.format(redisKey, collectid, ispriority);
|
|
|
|
|
redisMq.push(key, JSON.toJSONString(data, SerializerFeature.WriteDateUseDateFormat, SerializerFeature.WriteMapNullValue));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//生成队列消息
|
|
|
|
|
private void GenerateQueueCompensate(medicalCompensateVo task, PrintParam data, Integer ispriority, String collectid) {
|
|
|
|
|
data.setId(task.getId());
|
|
|
|
|
data.setInpNo(task.getInpNo());
|
|
|
|
|
data.setVisitId(task.getVisitId());
|
|
|
|
|
data.setJzh(task.getPatientId());
|
|
|
|
|
data.setDeptName(task.getDeptName());
|
|
|
|
|
data.setDischargeDateTime(task.getDischargeDateTime());
|
|
|
|
|
data.setName(task.getName());
|
|
|
|
|
data.setAdmissionDateTime(task.getAdmissionDateTime());
|
|
|
|
|
String key = String.format(redisKey, collectid, ispriority);
|
|
|
|
|
redisMq.push(key, JSON.toJSONString(data, SerializerFeature.WriteDateUseDateFormat, SerializerFeature.WriteMapNullValue));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|