|
@ -2,8 +2,13 @@ package com.yihu.jw.base.service.a3service;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.tencentcloudapi.dayu.v20180709.models.IpUnBlockData;
|
|
|
import com.yihu.jw.base.dao.a2dao.MedicineDevicePrintMessageDao;
|
|
|
import com.yihu.jw.base.dao.a2dao.MedicineorderDao;
|
|
|
import com.yihu.jw.base.dao.a2dao.MediicineDeviceDao;
|
|
|
import com.yihu.jw.base.dao.a2dao.MediicineorderdetailDao;
|
|
|
import com.yihu.jw.entity.a1entity.MedicineDevicePrintMessage;
|
|
|
import com.yihu.jw.entity.a1entity.Mediicinedevice;
|
|
|
import com.yihu.jw.entity.a1entity.Mediicineorder;
|
|
|
import com.yihu.jw.entity.a1entity.Mediicineorderdetail;
|
|
|
import com.yihu.jw.entity.hospital.DmHospitalDO;
|
|
@ -71,6 +76,10 @@ public class MedOrderService {
|
|
|
private YlzService ylzService;
|
|
|
@Autowired
|
|
|
private MedicineOrderService orderService;
|
|
|
@Autowired
|
|
|
private MedicineDevicePrintMessageDao medicineDevicePrintMessageDao;
|
|
|
@Autowired
|
|
|
private MediicineDeviceDao deviceDao;
|
|
|
|
|
|
/**
|
|
|
* 获取续方订单及药方
|
|
@ -376,6 +385,7 @@ public class MedOrderService {
|
|
|
}if (StringUtils.isNotBlank(idcard)){
|
|
|
ylzMedicalRelationDO.setIdcard(idcard);
|
|
|
}
|
|
|
ylzMedicalRelationDO.setEquNum(equ_num);
|
|
|
ylzMedicailRelationDao.save(ylzMedicalRelationDO);
|
|
|
input.put("data",inputDetail);
|
|
|
dataDetail.put("input",input);
|
|
@ -752,6 +762,78 @@ public class MedOrderService {
|
|
|
result.put("message","核对金额无误!");
|
|
|
ylzMedicailRelationDao.save(ylzMedicalRelationDO);
|
|
|
}
|
|
|
MedicineDevicePrintMessage medicineDevicePrintMessage = medicineDevicePrintMessageDao.findDeviceId(ylzMedicalRelationDO.getEquNum());
|
|
|
JSONObject jsonObject =new JSONObject();
|
|
|
if (medicineDevicePrintMessage==null){
|
|
|
jsonObject.put("status","500");
|
|
|
jsonObject.put("data","此药柜尚未设置打印模板!");
|
|
|
}else {
|
|
|
jsonObject.put("status","200");
|
|
|
JSONObject object = new JSONObject();
|
|
|
String feeInfo = medicineDevicePrintMessage.getFeeInfo();
|
|
|
object.put("feeRemark",medicineDevicePrintMessage.getFeeRemark());
|
|
|
Mediicinedevice mediicinedevice = deviceDao.findMediicinedeviceByEquNum(ylzMedicalRelationDO.getEquNum());
|
|
|
if (feeInfo.contains("hospital")){
|
|
|
object.put("hospital",mediicinedevice.getCommunity());
|
|
|
}
|
|
|
if (feeInfo.contains("cardno")){
|
|
|
object.put("cardno",ylzMedicalRelationDO.getCardNo());
|
|
|
}
|
|
|
if (feeInfo.contains("name")){
|
|
|
object.put("name",ylzMedicalRelationDO.getName());
|
|
|
}
|
|
|
if (feeInfo.contains("deptName")){
|
|
|
object.put("deptName",ylzMedicalRelationDO.getDeptName());
|
|
|
}
|
|
|
if (feeInfo.contains("doctorName")){
|
|
|
object.put("doctorName",ylzMedicalRelationDO.getDrName());
|
|
|
}
|
|
|
if (feeInfo.contains("hisSettleNo")){
|
|
|
object.put("hisSettleNo",ylzMedicalRelationDO.getRelationCode());
|
|
|
}
|
|
|
if (feeInfo.contains("applyTime")){
|
|
|
object.put("applyTime",ylzMedicalRelationDO.getApplyTime());
|
|
|
}
|
|
|
if (feeInfo.contains("total")){
|
|
|
object.put("total",ylzMedicalRelationDO.getTotalAmount());
|
|
|
}
|
|
|
if (feeInfo.contains("personAccount")){
|
|
|
object.put("personAccount",ylzMedicalRelationDO.getPersonAccount());
|
|
|
}
|
|
|
if (feeInfo.contains("medicarePrice")){
|
|
|
object.put("medicarePrice",ylzMedicalRelationDO.getMedicalPrice());
|
|
|
}
|
|
|
if (feeInfo.contains("tcjjPay")){
|
|
|
object.put("tcjjPay",ylzMedicalRelationDO.getTcjjPay()==null?0:ylzMedicalRelationDO.getTcjjPay());
|
|
|
}
|
|
|
if (feeInfo.contains("personCash")){
|
|
|
object.put("personCash",ylzMedicalRelationDO.getPersonCash());
|
|
|
}
|
|
|
if (feeInfo.contains("balance")){
|
|
|
object.put("balance",ylzMedicalRelationDO.getBalance());
|
|
|
}
|
|
|
if (feeInfo.contains("accountBalance")){
|
|
|
object.put("accountBalance",ylzMedicalRelationDO.getAccountBalance());
|
|
|
}
|
|
|
if (feeInfo.contains("drugName")){
|
|
|
List<YlzMedicalMxDO> medicalMxDOS = ylzMedicailMxDao.findByMedicalId(ylzMedicalRelationDO.getId());
|
|
|
JSONArray array = new JSONArray();
|
|
|
for (YlzMedicalMxDO mxDO:medicalMxDOS){
|
|
|
JSONObject mxObj = new JSONObject();
|
|
|
mxObj.put("drugName",mxDO.getItemName());
|
|
|
mxObj.put("money",mxDO.getTotalMoney());
|
|
|
mxObj.put("count",mxDO.getAmount());
|
|
|
mxObj.put("unit",mxDO.getChargeUnitName());
|
|
|
mxObj.put("specification",mxDO.getSpecificationType());
|
|
|
array.add(mxObj);
|
|
|
}
|
|
|
object.put("itemList",array);
|
|
|
}else {
|
|
|
object.put("itemList",null);
|
|
|
}
|
|
|
jsonObject.put("data",object);
|
|
|
}
|
|
|
result.put("printMessage",jsonObject);
|
|
|
result.put("getSettleInfo",ylzMedicalRelationDO);
|
|
|
|
|
|
return result;
|