多个方法重构合一

master
linjj 2 weeks ago
parent d21a140e82
commit 7e70514922

@ -225,8 +225,7 @@ public class TaskController {
public CommonResult<?> compensate(@RequestParam @ApiParam(required = true, name = "startTime", value = "补偿开始时间") String startTime, public CommonResult<?> compensate(@RequestParam @ApiParam(required = true, name = "startTime", value = "补偿开始时间") String startTime,
@RequestParam @ApiParam(required = true, name = "entTime", value = "补偿开始时间") String entTime, @RequestParam @ApiParam(required = true, name = "entTime", value = "补偿开始时间") String entTime,
@RequestParam @ApiParam(required = true, name = "collectId", value = "采集器id") String collectId) { @RequestParam @ApiParam(required = true, name = "collectId", value = "采集器id") String collectId) {
taskService.compensate(startTime,entTime,collectId); return taskService.compensate(startTime,entTime,collectId);
return CommonResult.success("补偿完成");
} }
} }

@ -87,6 +87,9 @@ public class MedicalAdviceServiceImpl implements MedicalAdviceService {
if (collectId.equals("1")){ if (collectId.equals("1")){
dto.setC1("护理记录"); dto.setC1("护理记录");
} }
if (collectId.equals("2")){
dto.setC1("电子病例");
}
//任务表新增任务 //任务表新增任务
if (archiveOtherExtMapper.addOther(dto)) { if (archiveOtherExtMapper.addOther(dto)) {
//存放队列消息 //存放队列消息

@ -98,22 +98,7 @@ public class TaskServiceImpl implements TaskService {
List<ArchiveOtherExtVo> others = archiveOtherExtMapper.getOtherByMidAndFlag(archiveMasters.get(0).getId(), Integer.parseInt(collectId)); List<ArchiveOtherExtVo> others = archiveOtherExtMapper.getOtherByMidAndFlag(archiveMasters.get(0).getId(), Integer.parseInt(collectId));
if (CollectionUtils.isEmpty(others)) { if (CollectionUtils.isEmpty(others)) {
//任务表新增 //任务表新增
dto.setId(SnowflakeIdWorker.idWorker.nextId()); addOther(collectId, dto, date, SycTime, archiveMasters);
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); archiveOtherExtMapper.updateStatic(masterId, collectId);
GenerateQueue(archiveMasters.get(0), printParam, 10, collectId); GenerateQueue(archiveMasters.get(0), printParam, 10, collectId);
@ -142,23 +127,7 @@ public class TaskServiceImpl implements TaskService {
//查询任务表数据是否存在不存在时任务表新增存在时将任务状态改为0 //查询任务表数据是否存在不存在时任务表新增存在时将任务状态改为0
List<ArchiveOtherExtVo> others = archiveOtherExtMapper.getOtherByMidAndFlag(masterId, Integer.parseInt(collectId)); List<ArchiveOtherExtVo> others = archiveOtherExtMapper.getOtherByMidAndFlag(masterId, Integer.parseInt(collectId));
if (CollectionUtils.isEmpty(others)) { if (CollectionUtils.isEmpty(others)) {
//任务表新增 addOther(collectId, dto, date, SycTime, archiveMasters);
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);
} else { } else {
archiveOtherExtMapper.updateStatic(masterId, collectId); archiveOtherExtMapper.updateStatic(masterId, collectId);
} }
@ -315,23 +284,7 @@ public class TaskServiceImpl implements TaskService {
//查询当前患者要补偿采集器是否存在任务,不存在时新增任务 //查询当前患者要补偿采集器是否存在任务,不存在时新增任务
List<ArchiveOtherExtVo> others = archiveOtherExtMapper.getOtherByMidAndFlag(archiveMasters.get(0).getId(), Integer.parseInt(collectId)); List<ArchiveOtherExtVo> others = archiveOtherExtMapper.getOtherByMidAndFlag(archiveMasters.get(0).getId(), Integer.parseInt(collectId));
if (CollectionUtils.isEmpty(others)) { if (CollectionUtils.isEmpty(others)) {
//任务表新增 addOther(collectId, dto, date, SycTime, archiveMasters);
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); archiveOtherExtMapper.updateStatic(masterId, collectId);
@ -344,6 +297,29 @@ public class TaskServiceImpl implements TaskService {
return CommonResult.success("补偿完成"); return CommonResult.success("补偿完成");
} }
private void addOther(String collectId, ArchiveOtherExtDto dto, Date date, SimpleDateFormat SycTime, List<ArchiveMasterVo> archiveMasters) {
//任务表新增
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("护理记录");
}
if (collectId.equals("2")){
dto.setC1("电子病例");
}
archiveOtherExtMapper.addOther(dto);
}
//生成队列消息 //生成队列消息
private void GenerateQueue(ArchiveMasterVo task, PrintParam data, Integer ispriority, String collectid) { private void GenerateQueue(ArchiveMasterVo task, PrintParam data, Integer ispriority, String collectid) {

@ -20,18 +20,18 @@ public class CollectorConfig {
@Bean @Bean
public JobDetail MedicalAdvice() { public JobDetail MedicalAdvice() {
return JobBuilder.newJob(MedicalAdviceQuartz.class).withIdentity("MedicalAdviceQuartz").storeDurably().build(); return JobBuilder.newJob(MedicalAdviceQuartz.class)
.withIdentity("MedicalAdviceQuartz").storeDurably()
.build();
} }
@Bean @Bean
public Trigger pacsPushTrigger() { public Trigger pacsPushTrigger() {
return TriggerBuilder.newTrigger()
return TriggerBuilder.newTrigger().forJob(MedicalAdvice()) .forJob(MedicalAdvice())
.withIdentity("MedicalAdviceQuartz") .withIdentity("MedicalAdviceQuartz")
.withSchedule(CronScheduleBuilder.cronSchedule(medicalAdviceTime)) .withSchedule(CronScheduleBuilder.cronSchedule(medicalAdviceTime))
.build(); .build();
} }
} }

@ -58,8 +58,8 @@ logging:
medicalAdviceTime: 0 0/30 * * * ? medicalAdviceTime: 0 0/30 * * * ?
#medicalAdviceTime: 0/1 * * * * ? #medicalAdviceTime: 0/1 * * * * ?
#定时轮询时需要新增的采集标识 #定时轮询时需要新增的采集标识
collectIdList: 1,8 collectIdList: 1, 2,8
#补偿时,需要补偿的采集器标识,可以支持多个使用逗号','隔开 #补偿时,需要补偿的采集器标识,可以支持多个使用逗号','隔开
repairCollectIds: 1,8 repairCollectIds: 1,2,8
#文件保存地址 #文件保存地址
savePath: D:\reload savePath: D:\reload
Loading…
Cancel
Save