|
@@ -8,10 +8,12 @@ import cn.hnthyy.thmz.entity.his.mz.*;
|
|
|
import cn.hnthyy.thmz.entity.his.zd.ZdUnitCode;
|
|
|
import cn.hnthyy.thmz.entity.thmz.User;
|
|
|
import cn.hnthyy.thmz.enums.ConfirmFlagEnum;
|
|
|
+import cn.hnthyy.thmz.enums.SocketSenderTypeEnum;
|
|
|
import cn.hnthyy.thmz.service.his.YpZdDictService;
|
|
|
import cn.hnthyy.thmz.service.his.YpZdManufactoryService;
|
|
|
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.vo.*;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -49,7 +51,8 @@ public class MzPharmacyController {
|
|
|
private MzPatientMiService mzPatientMiService;
|
|
|
@Autowired
|
|
|
private MzOrderFrequencyService mzOrderFrequencyService;
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ private DispensingSocketService dispensingSocketService;
|
|
|
/**
|
|
|
* 查询处方信息
|
|
|
*
|
|
@@ -441,6 +444,7 @@ public class MzPharmacyController {
|
|
|
return resultMap;
|
|
|
}
|
|
|
resultMap = mzPharmacyService.sendMedicineProcessing(mzChargeDetail, tokenUser);
|
|
|
+ dispensingSocketService.sendToMedicine(mzChargeDetail.getPatientId(),SocketSenderTypeEnum.SEND_MEDICINE.code);
|
|
|
return resultMap;
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
@@ -491,6 +495,8 @@ public class MzPharmacyController {
|
|
|
if (num > 0) {
|
|
|
resultMap.put("code", 0);
|
|
|
resultMap.put("message", "配药处理成功");
|
|
|
+ dispensingSocketService.sendDispensing(SocketSenderTypeEnum.DISPENSING_MEDICINE.code);
|
|
|
+ dispensingSocketService.sendToMedicine(mzChargeDetail.getPatientId(),SocketSenderTypeEnum.DISPENSING_MEDICINE.code);
|
|
|
return resultMap;
|
|
|
}
|
|
|
resultMap.put("code", -1);
|
|
@@ -544,7 +550,6 @@ public class MzPharmacyController {
|
|
|
Map<String, Object> printMap = new HashMap<>();
|
|
|
MzPatientMi mzPatientMi = mzPatientMiService.queryByPatientId(mzChargeDetail.getPatientId());
|
|
|
MzVisitTable visit = mzVisitTableService.queryByPatientIdAndTimes(mzChargeDetail.getPatientId(), mzChargeDetail.getTimes());
|
|
|
- String warnDeptName = zdUnitCodeService.queryDeptNameByIdInCache(mzChargeDetail.getWarnDept());
|
|
|
printMap.put("patientId", mzChargeDetail.getPatientId());
|
|
|
printMap.put("ybCardNo", mzPatientMi.getYbCardNo());
|
|
|
printMap.put("name", mzPatientMi.getName());
|
|
@@ -554,7 +559,6 @@ public class MzPharmacyController {
|
|
|
printMap.put("phoneNo", mzPatientMi.getPhoneNo());
|
|
|
printMap.put("address", mzPatientMi.getAddress());
|
|
|
printMap.put("icdText", visit.getIcdText());//诊断
|
|
|
- printMap.put("warnDeptName", warnDeptName);//科室
|
|
|
mzChargeDetail.setBillItemCode("TC");
|
|
|
List<MzChargeDetail> mzChargeDetails = mzChargeDetailService.getMzChargeDetailList(mzChargeDetail);
|
|
|
if (mzChargeDetails.size() > 0) {
|
|
@@ -563,7 +567,12 @@ public class MzPharmacyController {
|
|
|
Employee employee = new Employee();
|
|
|
BigDecimal totalPrice = new BigDecimal("0");//总价
|
|
|
List<Map<String, Object>> list = new ArrayList<>();
|
|
|
- for (MzChargeDetail chargeDetail : mzChargeDetails) {
|
|
|
+ for (int i = 0; i < mzChargeDetails.size(); i++) {
|
|
|
+ MzChargeDetail chargeDetail = mzChargeDetails.get(i);
|
|
|
+ if(i == 0){
|
|
|
+ String warnDeptName = zdUnitCodeService.queryDeptNameByIdInCache(chargeDetail.getWarnDept());
|
|
|
+ printMap.put("warnDeptName", warnDeptName);//科室
|
|
|
+ }
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
totalPrice = totalPrice.add(chargeDetail.getUnitPrice().multiply(BigDecimal.valueOf(chargeDetail.getQuantity())));
|
|
|
map.put("quantity", chargeDetail.getQuantity());//数量
|