|
|
|
@ -115,6 +115,7 @@ public class TaskServiceImpl implements TaskService {
|
|
|
|
|
}
|
|
|
|
|
archiveOtherExtMapper.addOther(dto);
|
|
|
|
|
}
|
|
|
|
|
archiveOtherExtMapper.updateStatic(masterId, collectId);
|
|
|
|
|
GenerateQueue(archiveMasters.get(0), printParam, 10, collectId);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
log.error("masterId为:" + masterId + "的患者补偿所有采集器失败", e.getMessage(), e);
|
|
|
|
@ -172,13 +173,13 @@ public class TaskServiceImpl implements TaskService {
|
|
|
|
|
//根据患者masterId,collectId删除
|
|
|
|
|
boolean stactic = archiveDetailMapper.delFileBySource(masterId, collectId);
|
|
|
|
|
if (stactic) {
|
|
|
|
|
return CommonResult.success("删除成功,masterId:" + masterId+"删除分类:"+collectId);
|
|
|
|
|
return CommonResult.success("删除成功,masterId:" + masterId + "删除分类:" + collectId);
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
log.error("删除接口失败:"+e.getMessage(),e);
|
|
|
|
|
return CommonResult.failed("删除失败,masterId:" + masterId+"删除分类:"+collectId);
|
|
|
|
|
log.error("删除接口失败:" + e.getMessage(), e);
|
|
|
|
|
return CommonResult.failed("删除失败,masterId:" + masterId + "删除分类:" + collectId);
|
|
|
|
|
}
|
|
|
|
|
return CommonResult.failed("删除失败,masterId:" + masterId+"删除分类:"+collectId);
|
|
|
|
|
return CommonResult.failed("删除失败,masterId:" + masterId + "删除分类:" + collectId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -220,7 +221,7 @@ public class TaskServiceImpl implements TaskService {
|
|
|
|
|
return CommonResult.success("id为:" + dto.getMid() + "任务表维护成功");
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
log.error("维护任务表失败:"+dto.getMid()+"异常处理"+e.getMessage(),e);
|
|
|
|
|
log.error("维护任务表失败:" + dto.getMid() + "异常处理" + e.getMessage(), e);
|
|
|
|
|
}
|
|
|
|
|
return CommonResult.success("id为:" + dto.getMid() + "任务表维护失败");
|
|
|
|
|
}
|
|
|
|
@ -284,23 +285,63 @@ public class TaskServiceImpl implements TaskService {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
log.error("异常处理:" + e.getMessage(),e);
|
|
|
|
|
log.error("异常处理:" + e.getMessage(), e);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
log.error("异常处理:" + e.getMessage(),e);
|
|
|
|
|
log.error("异常处理:" + e.getMessage(), e);
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public CommonResult compensate() {
|
|
|
|
|
public CommonResult compensate(String startTime, String entTime, String collectId) {
|
|
|
|
|
//查询所有需要补偿患者id
|
|
|
|
|
List<String> ids = archiveMasterMapper.getMasterid();
|
|
|
|
|
for (String id : ids) {
|
|
|
|
|
taskService.repairTask(id);
|
|
|
|
|
List<String> ids = archiveMasterMapper.getMasterid(startTime, entTime);
|
|
|
|
|
for (String masterId : ids) {
|
|
|
|
|
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("补偿完成");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|