|
@@ -150,32 +150,32 @@ public class FsPrescribeDataScrmServiceImpl implements IFsPrescribeDataScrmServi
|
|
|
return CollectionUtils.isEmpty(list) ? Collections.emptyList() : list;
|
|
return CollectionUtils.isEmpty(list) ? Collections.emptyList() : list;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // ==================== 医生操作 ====================
|
|
|
|
|
|
|
+ // 医生拒方
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public int doctorRejectScrmPrescribe(FsPrescribeDataDoctorUpdateDto updateDto) {
|
|
public int doctorRejectScrmPrescribe(FsPrescribeDataDoctorUpdateDto updateDto) {
|
|
|
if (getPrescribeIsDocument(updateDto.getPrescribeId())){
|
|
if (getPrescribeIsDocument(updateDto.getPrescribeId())){
|
|
|
throw new CustomException("销售已制单,当前操作不可执行,请刷新后重试!");
|
|
throw new CustomException("销售已制单,当前操作不可执行,请刷新后重试!");
|
|
|
}
|
|
}
|
|
|
|
|
+ // 拒方
|
|
|
|
|
+ if (StringUtils.isBlank(updateDto.getAuditReason())) {
|
|
|
|
|
+ throw new CustomException("拒方原因不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ updateDto.setAuditReason("医生拒方:"+updateDto.getAuditReason());
|
|
|
// 1. 清除原有基础处方图片
|
|
// 1. 清除原有基础处方图片
|
|
|
clearPrescriptionImage(updateDto.getPrescribeId());
|
|
clearPrescriptionImage(updateDto.getPrescribeId());
|
|
|
-
|
|
|
|
|
- // 2. 更新处方主记录
|
|
|
|
|
|
|
+ // 2. 更新处方记录
|
|
|
FsPrescribeDataScrm updatePrescribe = new FsPrescribeDataScrm();
|
|
FsPrescribeDataScrm updatePrescribe = new FsPrescribeDataScrm();
|
|
|
BeanCopyUtils.copy(updateDto, updatePrescribe);
|
|
BeanCopyUtils.copy(updateDto, updatePrescribe);
|
|
|
updatePrescribe.setDoctorConfirm(-1);
|
|
updatePrescribe.setDoctorConfirm(-1);
|
|
|
int updateCount = fsPrescribeDataScrmMapper.updateFsPrescribeDataScrm(updatePrescribe);
|
|
int updateCount = fsPrescribeDataScrmMapper.updateFsPrescribeDataScrm(updatePrescribe);
|
|
|
- // 拒方
|
|
|
|
|
- if (StringUtils.isBlank(updateDto.getAuditReason())) {
|
|
|
|
|
- throw new CustomException("拒方原因不能为空");
|
|
|
|
|
- }
|
|
|
|
|
// 更新客户信息表状态为已拒方
|
|
// 更新客户信息表状态为已拒方
|
|
|
updateCustomerStatus(updateDto.getPrescribeId(), REJECT_PRESCRIBE);
|
|
updateCustomerStatus(updateDto.getPrescribeId(), REJECT_PRESCRIBE);
|
|
|
|
|
|
|
|
return updateCount;
|
|
return updateCount;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // ==================== 药师操作 ====================
|
|
|
|
|
|
|
+ // 药师---审核商城处方
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public int drugDoctorExecuteScrmPrescribe(FsPrescribeDataDrugDoctorUpdateDto updateDto) {
|
|
public int drugDoctorExecuteScrmPrescribe(FsPrescribeDataDrugDoctorUpdateDto updateDto) {
|
|
@@ -193,10 +193,13 @@ public class FsPrescribeDataScrmServiceImpl implements IFsPrescribeDataScrmServi
|
|
|
if (updateDto.getStatus() == 1) {
|
|
if (updateDto.getStatus() == 1) {
|
|
|
// 审核通过 → 异步生成医生+药师签名处方图片任务
|
|
// 审核通过 → 异步生成医生+药师签名处方图片任务
|
|
|
submitPrescribeImageTask(updateDto.getPrescribeId(), 2);
|
|
submitPrescribeImageTask(updateDto.getPrescribeId(), 2);
|
|
|
|
|
+ // 直接生成医生签名+药师签名处方图片(这里可能会有性能问题)
|
|
|
|
|
+ //prescriptionTaskRecordService.prescribeScrmImgYsyTask(updateDto.getPrescribeId(), 2);
|
|
|
updateCustomerStatus(updateDto.getPrescribeId(), OPEN_PRESCRIBE);
|
|
updateCustomerStatus(updateDto.getPrescribeId(), OPEN_PRESCRIBE);
|
|
|
} else if (updateDto.getStatus() == 2) {
|
|
} else if (updateDto.getStatus() == 2) {
|
|
|
// 审核不通过 → 清除处方图片,退回状态
|
|
// 审核不通过 → 清除处方图片,退回状态
|
|
|
clearPrescriptionImage(updateDto.getPrescribeId());
|
|
clearPrescriptionImage(updateDto.getPrescribeId());
|
|
|
|
|
+ updateDto.setAuditReason("药师审核不通过:"+updateDto.getAuditReason());
|
|
|
updateDto.setDoctorConfirm(0);//药师审核不通过,处方医生状态回退为"待开方"
|
|
updateDto.setDoctorConfirm(0);//药师审核不通过,处方医生状态回退为"待开方"
|
|
|
updateCustomerStatus(updateDto.getPrescribeId(), IS_PRESCRIBING);
|
|
updateCustomerStatus(updateDto.getPrescribeId(), IS_PRESCRIBING);
|
|
|
}
|
|
}
|
|
@@ -288,12 +291,15 @@ public class FsPrescribeDataScrmServiceImpl implements IFsPrescribeDataScrmServi
|
|
|
if (getPrescribeIsDocument(submitDto.getPrescribeId())){
|
|
if (getPrescribeIsDocument(submitDto.getPrescribeId())){
|
|
|
throw new CustomException("销售已制单,当前操作不可执行,请刷新后重试!");
|
|
throw new CustomException("销售已制单,当前操作不可执行,请刷新后重试!");
|
|
|
}
|
|
}
|
|
|
- // 1. 清除原处方图片(如果有)
|
|
|
|
|
|
|
+ // 1. 清除上次生成的处方图片(因为同一处方医生会开多次)
|
|
|
clearPrescriptionImage(submitDto.getPrescribeId());
|
|
clearPrescriptionImage(submitDto.getPrescribeId());
|
|
|
|
|
|
|
|
// 2. 更新处方主表数据
|
|
// 2. 更新处方主表数据
|
|
|
FsPrescribeDataScrm update = new FsPrescribeDataScrm();
|
|
FsPrescribeDataScrm update = new FsPrescribeDataScrm();
|
|
|
BeanCopyUtils.copy(submitDto, update);
|
|
BeanCopyUtils.copy(submitDto, update);
|
|
|
|
|
+ // 显式设置中药字段
|
|
|
|
|
+ update.setDiagnoseChinese(submitDto.getDiagnoseChinese());
|
|
|
|
|
+ update.setRemarkChinese(submitDto.getRemarkChinese());
|
|
|
update.setDoctorConfirm(1); // 确认开方
|
|
update.setDoctorConfirm(1); // 确认开方
|
|
|
update.setStatus(0); // 待药师审核
|
|
update.setStatus(0); // 待药师审核
|
|
|
int updateCount = fsPrescribeDataScrmMapper.updateFsPrescribeDataScrm(update);
|
|
int updateCount = fsPrescribeDataScrmMapper.updateFsPrescribeDataScrm(update);
|