|
@ -24,6 +24,7 @@ import com.yihu.jw.hospital.healthCare.YlzMedicailRelationDao;
|
|
import com.yihu.jw.hospital.healthCare.YlzMedicalResponseDao;
|
|
import com.yihu.jw.hospital.healthCare.YlzMedicalResponseDao;
|
|
import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
|
|
import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
|
|
import com.yihu.jw.util.date.DateUtil;
|
|
import com.yihu.jw.util.date.DateUtil;
|
|
|
|
import com.yihu.jw.utils.hibernate.HibenateUtils;
|
|
import com.yihu.jw.wlyy.wlyyhttp.WlyyHttpService;
|
|
import com.yihu.jw.wlyy.wlyyhttp.WlyyHttpService;
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
@ -80,6 +81,8 @@ public class MedOrderService {
|
|
private MedicineDevicePrintMessageDao medicineDevicePrintMessageDao;
|
|
private MedicineDevicePrintMessageDao medicineDevicePrintMessageDao;
|
|
@Autowired
|
|
@Autowired
|
|
private MediicineDeviceDao deviceDao;
|
|
private MediicineDeviceDao deviceDao;
|
|
|
|
@Autowired
|
|
|
|
private HibenateUtils hibenateUtils;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取续方订单及药方
|
|
* 获取续方订单及药方
|
|
@ -1351,6 +1354,86 @@ public class MedOrderService {
|
|
return list;
|
|
return list;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public List<Map<String,Object>> selectSettlementList(String cardNo,String equNum,Integer page,Integer size){
|
|
|
|
String sql = "select id,name,apply_time as applyTime,total_amount as totalAmount from base_ylz_medical_relation where status=1 and state =1 and card_no ='"+cardNo+"' and equ_num ='"+equNum+"' ";
|
|
|
|
List<Map<String,Object>> mapList = hibenateUtils.createSQLQuery(sql,page,size);
|
|
|
|
for (Map<String,Object> jsonObject:mapList){
|
|
|
|
String relationId= jsonObject.get("id").toString();
|
|
|
|
YlzMedicalRelationDO ylzMedicalRelationDO = ylzMedicailRelationDao.findOne(relationId);
|
|
|
|
MedicineDevicePrintMessage medicineDevicePrintMessage = medicineDevicePrintMessageDao.findDeviceId(equNum);
|
|
|
|
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(equNum);
|
|
|
|
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()==null?"无":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()==null?"0":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.getHisItemName());
|
|
|
|
mxObj.put("money",mxDO.getTotalMoney());
|
|
|
|
mxObj.put("count",mxDO.getAmount());
|
|
|
|
mxObj.put("unit",mxDO.getChargeUnitName());
|
|
|
|
mxObj.put("specification",mxDO.getSpecificationType()==null?"无":mxDO.getSpecificationType());
|
|
|
|
array.add(mxObj);
|
|
|
|
}
|
|
|
|
object.put("itemList",array);
|
|
|
|
}else {
|
|
|
|
object.put("itemList",null);
|
|
|
|
}
|
|
|
|
jsonObject.put("data",object);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return mapList;
|
|
|
|
}
|
|
|
|
|
|
@Transactional(propagation= Propagation.NOT_SUPPORTED)
|
|
@Transactional(propagation= Propagation.NOT_SUPPORTED)
|
|
public void saveHttpLog(String code,String name,String patient,String request,String response){
|
|
public void saveHttpLog(String code,String name,String patient,String request,String response){
|
|
WlyyHttpLogDO logDO = new WlyyHttpLogDO();
|
|
WlyyHttpLogDO logDO = new WlyyHttpLogDO();
|