|
|
@ -115,6 +115,7 @@ public class TaskServiceImpl implements TaskService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
archiveOtherExtMapper.addOther(dto);
|
|
|
|
archiveOtherExtMapper.addOther(dto);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
archiveOtherExtMapper.updateStatic(masterId, collectId);
|
|
|
|
GenerateQueue(archiveMasters.get(0), printParam, 10, collectId);
|
|
|
|
GenerateQueue(archiveMasters.get(0), printParam, 10, collectId);
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
log.error("masterId为:" + masterId + "的患者补偿所有采集器失败", e.getMessage(), e);
|
|
|
|
log.error("masterId为:" + masterId + "的患者补偿所有采集器失败", e.getMessage(), e);
|
|
|
@ -294,13 +295,53 @@ public class TaskServiceImpl implements TaskService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public CommonResult compensate() {
|
|
|
|
public CommonResult compensate(String startTime, String entTime, String collectId) {
|
|
|
|
//查询所有需要补偿患者id
|
|
|
|
//查询所有需要补偿患者id
|
|
|
|
List<String> ids = archiveMasterMapper.getMasterid();
|
|
|
|
List<String> ids = archiveMasterMapper.getMasterid(startTime, entTime);
|
|
|
|
for (String id : ids) {
|
|
|
|
for (String masterId : ids) {
|
|
|
|
taskService.repairTask(id);
|
|
|
|
PrintParam printParam = new PrintParam();
|
|
|
|
|
|
|
|
//任务表入参
|
|
|
|
|
|
|
|
ArchiveOtherExtDto dto = new ArchiveOtherExtDto();
|
|
|
|
|
|
|
|
//任务生成时间
|
|
|
|
|
|
|
|
Date date = new Date();
|
|
|
|
|
|
|
|
SimpleDateFormat SycTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
|
|
//获取当前患者基础信息
|
|
|
|
|
|
|
|
List<ArchiveMasterVo> archiveMasters = archiveMasterMapper.getArchiveMasterByMasterId(masterId);
|
|
|
|
|
|
|
|
if (CollectionUtils.isEmpty(archiveMasters)) {
|
|
|
|
|
|
|
|
log.info("补偿所有采集查询不到masterId为:" + masterId + "的患者补偿采集器id为:"+collectId+"失败");
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
//查询当前患者要补偿采集器是否存在任务,不存在时新增任务
|
|
|
|
|
|
|
|
List<ArchiveOtherExtVo> others = archiveOtherExtMapper.getOtherByMidAndFlag(archiveMasters.get(0).getId(), Integer.parseInt(collectId));
|
|
|
|
|
|
|
|
if (CollectionUtils.isEmpty(others)) {
|
|
|
|
|
|
|
|
//任务表新增
|
|
|
|
|
|
|
|
dto.setId(SnowflakeIdWorker.idWorker.nextId());
|
|
|
|
|
|
|
|
dto.setSycTime(SycTime.format(date));
|
|
|
|
|
|
|
|
dto.setOtherID("0");
|
|
|
|
|
|
|
|
dto.setSysFlag(Integer.parseInt(collectId));
|
|
|
|
|
|
|
|
dto.setSysUpdateTime(SycTime.format(date));
|
|
|
|
|
|
|
|
dto.setJzh(archiveMasters.get(0).getPatientId());
|
|
|
|
|
|
|
|
dto.setZyh(archiveMasters.get(0).getInpNo());
|
|
|
|
|
|
|
|
dto.setStatusFlag(0);
|
|
|
|
|
|
|
|
dto.setMID(archiveMasters.get(0).getId());
|
|
|
|
|
|
|
|
if (collectId.equals("8")) {
|
|
|
|
|
|
|
|
dto.setC1("长临医嘱");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (collectId.equals("1")) {
|
|
|
|
|
|
|
|
dto.setC1("护理记录");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
archiveOtherExtMapper.addOther(dto);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//存在任务表中修改任务表状态
|
|
|
|
|
|
|
|
archiveOtherExtMapper.updateStatic(masterId, collectId);
|
|
|
|
|
|
|
|
GenerateQueue(archiveMasters.get(0), printParam, 10, collectId);
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
log.error("masterId为:" + masterId + "的患者补偿采集器id为:"+collectId+"失败", e.getMessage(), e);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
log.info("masterId为:" + masterId + "的患者补偿采集器id为:"+collectId+"成功");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return CommonResult.success("补偿7月份患者医嘱成功");
|
|
|
|
return CommonResult.success("补偿完成");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|