|
@@ -128,6 +128,9 @@ public class FsPrescribeServiceImpl implements IFsPrescribeService
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IFsUserInformationCollectionService fsUserInformationCollectionService;
|
|
private IFsUserInformationCollectionService fsUserInformationCollectionService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private FsPrescribeServiceImpl currentProxy;//注入自身,避免使用this.调用本类方法事务失效
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 查询处方
|
|
* 查询处方
|
|
|
*
|
|
*
|
|
@@ -545,7 +548,7 @@ public class FsPrescribeServiceImpl implements IFsPrescribeService
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public String PrescribeImgYsyTask(Long prescribeId,Integer signFlag) {
|
|
|
|
|
|
|
+ public String prescribeImgYsyTask(Long prescribeId,Integer signFlag) {
|
|
|
FsPrescribeVO f = fsPrescribeMapper.selectFsPrescribeByPrescribeIdVO(prescribeId);
|
|
FsPrescribeVO f = fsPrescribeMapper.selectFsPrescribeByPrescribeIdVO(prescribeId);
|
|
|
Asserts.notNull(f,String.format("处方 %d 未找到!",prescribeId));
|
|
Asserts.notNull(f,String.format("处方 %d 未找到!",prescribeId));
|
|
|
|
|
|
|
@@ -576,6 +579,7 @@ public class FsPrescribeServiceImpl implements IFsPrescribeService
|
|
|
if (StringUtils.isNotBlank(f.getRemark())){
|
|
if (StringUtils.isNotBlank(f.getRemark())){
|
|
|
o.setRemark(f.getRemark());
|
|
o.setRemark(f.getRemark());
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ log.error("PrescribeImgYsyTask 处方id:{},缺失医嘱内容", f.getPrescribeId());
|
|
|
o.setRemark("请按照用药说明书服用药品,如有不适,请及时就医!");
|
|
o.setRemark("请按照用药说明书服用药品,如有不适,请及时就医!");
|
|
|
}
|
|
}
|
|
|
o.setHistoryAllergic(f.getHistoryAllergic());
|
|
o.setHistoryAllergic(f.getHistoryAllergic());
|
|
@@ -638,7 +642,7 @@ public class FsPrescribeServiceImpl implements IFsPrescribeService
|
|
|
List<FsPrescribeDrug> list = fsPrescribeDrugMapper.selectFsPrescribeDrugList(d);
|
|
List<FsPrescribeDrug> list = fsPrescribeDrugMapper.selectFsPrescribeDrugList(d);
|
|
|
|
|
|
|
|
if (CollectionUtils.isEmpty(list)) {
|
|
if (CollectionUtils.isEmpty(list)) {
|
|
|
- throw new IllegalArgumentException(String.format("处方单 %d 对应药品为空!",prescribeId));
|
|
|
|
|
|
|
+ throw new CustomException(String.format("处方单 %d 对应药品为空!",prescribeId));
|
|
|
}
|
|
}
|
|
|
PrescribeXyImgParam o = new PrescribeXyImgParam();
|
|
PrescribeXyImgParam o = new PrescribeXyImgParam();
|
|
|
o.setStatus(fsStoreOrder.getStatus());
|
|
o.setStatus(fsStoreOrder.getStatus());
|
|
@@ -654,16 +658,6 @@ public class FsPrescribeServiceImpl implements IFsPrescribeService
|
|
|
} else {
|
|
} else {
|
|
|
o.setBedId("中医科");
|
|
o.setBedId("中医科");
|
|
|
}
|
|
}
|
|
|
-// String remark = "";
|
|
|
|
|
-// if (f.getUsageJson() != null) {
|
|
|
|
|
-// FsPrescribeUsageDTO usage = JSONUtil.toBean(f.getUsageJson(), FsPrescribeUsageDTO.class);
|
|
|
|
|
-// remark = usage.getRemark();
|
|
|
|
|
-// }
|
|
|
|
|
-// if (remark != null && remark != "") {
|
|
|
|
|
-// o.setRemark(remark);
|
|
|
|
|
-// } else {
|
|
|
|
|
-// o.setRemark("请按照用药说明书服用药品,如有不适,请及时就医!");
|
|
|
|
|
-// }
|
|
|
|
|
if (StringUtils.isNotBlank(f.getRemark())){
|
|
if (StringUtils.isNotBlank(f.getRemark())){
|
|
|
o.setRemark(f.getRemark());
|
|
o.setRemark(f.getRemark());
|
|
|
} else {
|
|
} else {
|
|
@@ -1211,6 +1205,9 @@ public class FsPrescribeServiceImpl implements IFsPrescribeService
|
|
|
if(prescribe.getStatus()!=0){
|
|
if(prescribe.getStatus()!=0){
|
|
|
return R.error("非法操作");
|
|
return R.error("非法操作");
|
|
|
}
|
|
}
|
|
|
|
|
+ //无论审核是否通过,都删除之前只有医生签名的处方图片
|
|
|
|
|
+ delUrl(param.getPrescribeId());
|
|
|
|
|
+
|
|
|
FsPrescribe map=new FsPrescribe();
|
|
FsPrescribe map=new FsPrescribe();
|
|
|
map.setPrescribeId(param.getPrescribeId());
|
|
map.setPrescribeId(param.getPrescribeId());
|
|
|
map.setDrugDoctorId(param.getDoctorId());
|
|
map.setDrugDoctorId(param.getDoctorId());
|
|
@@ -1279,8 +1276,6 @@ public class FsPrescribeServiceImpl implements IFsPrescribeService
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- delUrl(param.getPrescribeId());
|
|
|
|
|
if (this.updateFsPrescribe(map) > 0){
|
|
if (this.updateFsPrescribe(map) > 0){
|
|
|
return R.ok("审核成功");
|
|
return R.ok("审核成功");
|
|
|
}
|
|
}
|
|
@@ -1376,7 +1371,7 @@ public class FsPrescribeServiceImpl implements IFsPrescribeService
|
|
|
record.setCreateTime(LocalDateTime.now());
|
|
record.setCreateTime(LocalDateTime.now());
|
|
|
record.setExecuteStatus(0);
|
|
record.setExecuteStatus(0);
|
|
|
record.setRetryCount(0);
|
|
record.setRetryCount(0);
|
|
|
- //可生成医生签名图片标识
|
|
|
|
|
|
|
+ //只生成医生签名图片标识
|
|
|
record.setSignFlag(1);
|
|
record.setSignFlag(1);
|
|
|
prescriptionTaskRecordMapper.insert(record);
|
|
prescriptionTaskRecordMapper.insert(record);
|
|
|
|
|
|
|
@@ -1406,15 +1401,17 @@ public class FsPrescribeServiceImpl implements IFsPrescribeService
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- //TODO 医生确认处方后立即生成处方图片
|
|
|
|
|
-
|
|
|
|
|
|
|
+ //医生确认处方后立即生成处方图片
|
|
|
|
|
+ currentProxy.createDoctorSignImg(fsPrescribe);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //即时生成处方图片
|
|
|
|
|
- private void createImg(Long prescribeId) {
|
|
|
|
|
- String prescribeImgUrl = this.PrescribeImgYsyTask(prescribeId,1);//1-处方只带医生签名
|
|
|
|
|
-// fsPrescribe.setPrescribeImgUrl(prescribeImgUrl);
|
|
|
|
|
-// fsPrescribeService.updateFsPrescribe(fsPrescribe);
|
|
|
|
|
|
|
+ //手动生成带医生签名的处方图片
|
|
|
|
|
+ public void createDoctorSignImg(FsPrescribe fsPrescribe) {
|
|
|
|
|
+ if(fsPrescribe != null&& fsPrescribe.getPrescribeId() != null) {
|
|
|
|
|
+ String prescribeImgUrl = currentProxy.prescribeImgYsyTask(fsPrescribe.getPrescribeId(),1);//1:只生成有医生签名的处方
|
|
|
|
|
+ fsPrescribe.setPrescribeImgUrl(prescribeImgUrl);
|
|
|
|
|
+ fsPrescribeMapper.updateFsPrescribe(fsPrescribe);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|