|
|
@@ -8,6 +8,7 @@ import cn.hnthyy.thmz.enums.PayMarkEnum;
|
|
|
import cn.hnthyy.thmz.pageDto.MzChargeDetailPageDto;
|
|
|
import cn.hnthyy.thmz.service.his.mz.*;
|
|
|
import cn.hnthyy.thmz.service.his.zd.ZdUnitCodeService;
|
|
|
+import cn.hnthyy.thmz.service.thmz.DispensingSocketService;
|
|
|
import cn.hnthyy.thmz.service.thmz.HaiCiAdapterService;
|
|
|
import cn.hnthyy.thmz.service.thmz.OrderStatusChangeService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
@@ -40,6 +41,8 @@ public class OrderStatusChangeServiceImpl implements OrderStatusChangeService {
|
|
|
private MzChargeDetailService mzChargeDetailService;
|
|
|
@Autowired
|
|
|
private MzYjReqService mzYjReqService;
|
|
|
+ @Autowired
|
|
|
+ private DispensingSocketService dispensingSocketService;
|
|
|
//就诊状态通知开关
|
|
|
@Value("${sendNoticeToPatient}")
|
|
|
private boolean sendNoticeToPatient;
|
|
|
@@ -51,9 +54,6 @@ public class OrderStatusChangeServiceImpl implements OrderStatusChangeService {
|
|
|
public void orderStatusChange(String text) {
|
|
|
executor.submit(() -> {
|
|
|
try {
|
|
|
- if (!sendNoticeToPatient) {
|
|
|
- return;
|
|
|
- }
|
|
|
if (StringUtils.isBlank(text)) {
|
|
|
return;
|
|
|
}
|
|
|
@@ -65,11 +65,22 @@ public class OrderStatusChangeServiceImpl implements OrderStatusChangeService {
|
|
|
if (patientInfo == null || patientInfo.length == 0) {
|
|
|
return;
|
|
|
}
|
|
|
+ String status = arr[1];
|
|
|
+ if (OrderStatusEnum.SUCCESSFUL_PRESCRIPTION_PAYMENT.code.equals(status)) {
|
|
|
+ try {
|
|
|
+ dispensingSocketService.sendToMedicine(patientInfo[0], Integer.valueOf(patientInfo[1]));
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("通知药房出错,错误信息{}", e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!sendNoticeToPatient) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
MzPatientMi mzPatientMi = mzPatientMiService.queryByPatientId(patientInfo[0]);
|
|
|
if (mzPatientMi == null || StringUtils.isBlank(mzPatientMi.getIcCardNo())) {
|
|
|
return;
|
|
|
}
|
|
|
- String status = arr[1];
|
|
|
+
|
|
|
if (OrderStatusEnum.REGISTRATION_SUCCESS.code.equals(status)) {
|
|
|
MzyReqrec mzyReqrec = mzyReqrecService.queryMzyReqrecByPatientIdAndTimes(patientInfo[0], Integer.valueOf(patientInfo[1]));
|
|
|
if (mzyReqrec == null) {
|