|
@ -1091,7 +1091,7 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
|
|
|
/**
|
|
|
* 挂号接口
|
|
|
* @param outPatientId
|
|
|
* @param doctor
|
|
|
* @param doctor flag 0自费1医保
|
|
|
* @return
|
|
|
*/
|
|
|
public JSONObject registerOutPatient(String outPatientId, String doctor){
|
|
@ -1156,7 +1156,7 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
|
|
|
}
|
|
|
JSONObject res = null;
|
|
|
try {
|
|
|
String obj = hcyyEntranceService.registered(doctorFlag,outpatientDO.getDept(),patientMappingDO.getMappingCode(),chargeType,courierflag);
|
|
|
String obj = hcyyEntranceService.registered(doctorFlag,outpatientDO.getDept(),patientMappingDO.getMappingCode(),chargeType,courierflag,outpatientDO.getMedicalState());
|
|
|
if (StringUtils.isNoneBlank(obj)){
|
|
|
res = JSONObject.parseObject(obj);
|
|
|
}
|
|
@ -1648,6 +1648,7 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
|
|
|
if (ylzMedicalRelationDO==null){
|
|
|
ylzMedicalRelationDO = new YlzMedicalRelationDO();
|
|
|
ylzMedicalRelationDO.setLogNo(logNo);
|
|
|
ylzMedicalRelationDO.setMedicalState(Integer.parseInt(outpatientDO.getMedicalState()));
|
|
|
ylzMedicalRelationDO.setRelationCode(outpatientId);
|
|
|
ylzMedicalRelationDO.setName(object.getString("PSN_NAME"));
|
|
|
ylzMedicalRelationDO.setTotalAmount(object.getString("COST"));
|
|
@ -1660,9 +1661,20 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
|
|
|
ylzMedicalRelationDO.setHisDeptName(object.getString("DEPT_NAME"));
|
|
|
ylzMedicalRelationDO.setStatus(0);
|
|
|
ylzMedicalRelationDO.setState(0);
|
|
|
ylzMedicalRelationDO.setDel(1);
|
|
|
ylzMedicalRelationDO.setDataSource("54");
|
|
|
ylzMedicalRelationDO.setIdcard(outpatientDO.getIdcard());
|
|
|
ylzMedicalRelationDO.setBalance(balance);
|
|
|
ylzMedicalRelationDO.setPersonAccount("0");
|
|
|
ylzMedicalRelationDO.setMedicalPrice("0");
|
|
|
ylzMedicalRelationDO.setCertType("01");
|
|
|
ylzMedicalRelationDO.setMedicalMode("10");
|
|
|
ylzMedicalRelationDO.setRegionCode("350200");
|
|
|
if (StringUtils.isNoneBlank(outpatientDO.getDiseaseCode())){
|
|
|
ylzMedicalRelationDO.setMedicalType("13");
|
|
|
}else {
|
|
|
ylzMedicalRelationDO.setMedicalType("11");
|
|
|
}
|
|
|
ylzMedicalRelationDO.setHisSettleNo(object.getString("IPT_OTP_NO"));
|
|
|
ylzMedicalRelationDO.setCardNo(object.getString("CARD_NO"));
|
|
|
ylzMedicalRelationDO.setDate(DateUtil.strToDate(object.getString("BEGNTIME")));
|
|
@ -1670,6 +1682,9 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
|
|
|
}else {
|
|
|
ylzMedicalRelationDO.setLogNo(logNo);
|
|
|
ylzMedicalRelationDO.setRelationCode(outpatientId);
|
|
|
ylzMedicalRelationDO.setDataSource("54");
|
|
|
ylzMedicalRelationDO.setDel(1);
|
|
|
ylzMedicalRelationDO.setMedicalState(Integer.parseInt(outpatientDO.getMedicalState()));
|
|
|
ylzMedicalRelationDO.setName(object.getString("PSN_NAME"));
|
|
|
ylzMedicalRelationDO.setTotalAmount(object.getString("COST"));
|
|
|
ylzMedicalRelationDO.setPersonCash(object.getString("ORIGIN_CHARGES"));
|
|
@ -1682,6 +1697,15 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
|
|
|
ylzMedicalRelationDO.setPersonAccount("0");
|
|
|
ylzMedicalRelationDO.setMedicalPrice("0");
|
|
|
ylzMedicalRelationDO.setBalance(balance);
|
|
|
ylzMedicalRelationDO.setCertType("01");
|
|
|
ylzMedicalRelationDO.setMedicalMode("10");
|
|
|
ylzMedicalRelationDO.setRegionCode("350200");
|
|
|
if (StringUtils.isNoneBlank(outpatientDO.getDiseaseCode())){
|
|
|
ylzMedicalRelationDO.setMedicalType("13");
|
|
|
}else {
|
|
|
ylzMedicalRelationDO.setMedicalType("11");
|
|
|
}
|
|
|
ylzMedicalRelationDO.setIdcard(outpatientDO.getIdcard());
|
|
|
ylzMedicalRelationDO.setHisSettleNo(object.getString("IPT_OTP_NO"));
|
|
|
ylzMedicalRelationDO.setCardNo(object.getString("CARD_NO"));
|
|
|
ylzMedicalRelationDO.setDate(DateUtil.strToDate(object.getString("BEGNTIME")));
|
|
@ -1693,16 +1717,20 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
|
|
|
String detailSql =" select * from SST_JSDP_JSMX_GJYB where LOG_NO ='"+logNo+"' ";
|
|
|
String detailRes = hcyyEntranceService.getSql(detailSql);
|
|
|
List<YlzMedicalMxDO> mxDOList = new ArrayList<>();
|
|
|
Integer itemCount = 0;
|
|
|
if (StringUtils.isNoneBlank(detailRes)) {
|
|
|
JSONObject drs = JSONObject.parseObject(detailRes);
|
|
|
Integer dstatus = drs.getInteger("status");
|
|
|
if (dstatus != null && dstatus == 200) {
|
|
|
JSONArray darray = drs.getJSONArray("detailModelList");
|
|
|
itemCount=darray.size();
|
|
|
for (int j = 0; j < darray.size(); j++) {
|
|
|
JSONObject dobject = darray.getJSONObject(j);
|
|
|
YlzMedicalMxDO medicalMxDO = new YlzMedicalMxDO();
|
|
|
medicalMxDO.setDel(1);
|
|
|
medicalMxDO.setMedicalId(ylzMedicalRelationDO.getId());
|
|
|
medicalMxDO.setCreateTime(new Date());
|
|
|
medicalMxDO.setInvoiceType("01");
|
|
|
medicalMxDO.setItemName(dobject.getString("XMMC00"));
|
|
|
medicalMxDO.setHisDetailSn(dobject.getString("FEEDETL_SN"));
|
|
|
medicalMxDO.setItemCode(dobject.getString("MED_LIST_CODG"));
|
|
@ -1711,6 +1739,13 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
|
|
|
medicalMxDO.setSpecificationType(dobject.getString(""));
|
|
|
medicalMxDO.setAmount(dobject.getString("CNT"));
|
|
|
medicalMxDO.setPrice(dobject.getString("PRIC"));
|
|
|
medicalMxDO.setPrescriptionCode(dobject.getString("RXNO"));
|
|
|
medicalMxDO.setSpecificationType(dobject.getString("SPECIFICATION_TYPE"));
|
|
|
medicalMxDO.setDosageForm(dobject.getString("DOSAGE_FORM"));
|
|
|
medicalMxDO.setPrescriptionDate(DateUtil.strToDate(object.getString("BEGNTIME")));
|
|
|
medicalMxDO.setActgDate(DateUtil.strToDate(object.getString("BEGNTIME")));
|
|
|
medicalMxDO.setClerkDays(DateUtil.strToDate(object.getString("BEGNTIME")));
|
|
|
medicalMxDO.setPeopleType(null);
|
|
|
medicalMxDO.setSingleDose(dobject.getString("SIN_DOS_DSCR"));
|
|
|
medicalMxDO.setUseFrequency(dobject.getString("USED_FRQU_DSCR"));
|
|
|
medicalMxDO.setMedicationDays(dobject.getString("PRD_DAYS"));
|
|
@ -1721,7 +1756,13 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
|
|
|
medicalMxDO.setHisDeptName(dobject.getString("BILG_DEPT_NAME"));
|
|
|
medicalMxDO.setMedicalPerId(dobject.getString("BILG_DR_CODG"));
|
|
|
medicalMxDO.setMedicalPerName(dobject.getString("BILG_DR_NAME"));
|
|
|
medicalMxDO.setLimitType(dobject.getString("HOSP_APPR_FLAG"));
|
|
|
if (StringUtils.isNoneBlank(dobject.getString("HOSP_APPR_FLAG"))){
|
|
|
if (dobject.getString("HOSP_APPR_FLAG").equalsIgnoreCase("0")||dobject.getString("HOSP_APPR_FLAG").equalsIgnoreCase("2")){
|
|
|
medicalMxDO.setLimitType("N");
|
|
|
} else if (dobject.getString("HOSP_APPR_FLAG").equalsIgnoreCase("1")) {
|
|
|
medicalMxDO.setLimitType("Y");
|
|
|
}
|
|
|
}
|
|
|
medicalMxDO.setHisItemCode(dobject.getString("MED_LIST_CODG"));
|
|
|
medicalMxDO.setHisItemName(dobject.getString("XMMC00"));
|
|
|
medicalMxDO.setTotalMoney(dobject.getString("DET_ITEM_FEE_SUMAMT"));
|
|
@ -1730,11 +1771,13 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
ylzMedicalRelationDO.setItemCount(itemCount+"");
|
|
|
ylzMedicalRelationDO = ylzMedicailRelationDao.save(ylzMedicalRelationDO);
|
|
|
ylzMedicalRelationDO.setYlzMedicalMxDOList(mxDOList);
|
|
|
List<YlzMedicalIcdDO> icdDOS = new ArrayList<>();
|
|
|
ylzMedicailIcdDao.deleteByMedicalId(ylzMedicalRelationDO.getId());
|
|
|
//获取诊断
|
|
|
String icdSql =" select * from SST_JSDP_JSMX_GJYB where LOG_NO ='"+logNo+"' ";
|
|
|
String icdSql =" select * from SST_JSDP_DZMX_GJYB where LOG_NO ='"+logNo+"' ";
|
|
|
String icdRes = hcyyEntranceService.getSql(icdSql);
|
|
|
if (StringUtils.isNoneBlank(icdRes)) {
|
|
|
JSONObject drs = JSONObject.parseObject(icdRes);
|
|
@ -1773,61 +1816,124 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
|
|
|
throw new Exception("未找到待结算记录");
|
|
|
}
|
|
|
YlzMedicalRelationDO ylzMedicalRelationDO = ylzMedicailRelationDao.findByOutpatient(outpatientId);
|
|
|
if (ylzMedicalRelationDO.getState()==1){
|
|
|
if (ylzMedicalRelationDO.getState()!=null&&ylzMedicalRelationDO.getState()==1){
|
|
|
return "已结算";
|
|
|
}
|
|
|
BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(ylzMedicalRelationDO.getId());
|
|
|
ylzMedicalRelationDO.setState(1);
|
|
|
ylzMedicalRelationDO.setSettleDate(new Date());
|
|
|
ylzMedicalRelationDO = ylzMedicailRelationDao.save(ylzMedicalRelationDO);
|
|
|
String sql = "update SST_JSDP_JBXX_GJYB\n" +
|
|
|
" set SETL_ID = '', \n" +
|
|
|
" ACCT_PAY = '0',\n" +
|
|
|
" PSN_CASH_PAY = '"+ylzMedicalRelationDO.getTotalAmount()+"',\n" +
|
|
|
" FUND_PAY_SUMAMT = '0',\n" +
|
|
|
" CVLSERV_PAY = '0',\n" +
|
|
|
" PSN_PART_AMT = '0',\n" +
|
|
|
" HIFMI_PAY = '0',\n" +
|
|
|
" MEDFEE_SUMAMT = '"+ylzMedicalRelationDO.getBcwkje()+"',\n" +
|
|
|
" SETL_TIME = '0',\n" +
|
|
|
" BALC = '0',\n" +
|
|
|
" ACCT_MULAID_PAY = '0',\n" +
|
|
|
" HIFOB_PAY = '0',\n" +
|
|
|
" MDTRT_ID = '',\n" +
|
|
|
" HIFP_PAY = '0',\n" +
|
|
|
" MAF_PAY = '',\n" +
|
|
|
" OTH_PAY = '0',\n" +
|
|
|
" HIFES_PAY = '0',\n" +
|
|
|
" OUTCHARGENO = '"+businessOrderDO.getOrderNo()+"',\n" +
|
|
|
" PSN_CERT_TYPE = '0',\n" +
|
|
|
" NATY = '0',\n" +
|
|
|
" BRDY = '0',\n" +
|
|
|
" CVLSERV_FLAG = '0',\n" +
|
|
|
" ACT_PAY_DEDC = '0',\n" +
|
|
|
" PSN_TYPE = '0',\n" +
|
|
|
" HOSP_PART_AMT = '0',\n" +
|
|
|
" CLR_OPTINS = '0',\n" +
|
|
|
" CLR_WAY = '0',\n" +
|
|
|
" CLR_TYPE = '0',\n" +
|
|
|
" POOL_PROP_SELFPAY = '0',\n" +
|
|
|
" INSUPLC_ADMDVS = '',\n" +
|
|
|
" INSUTYPE = '',\n" +
|
|
|
" PSN_NO = '',\n" +
|
|
|
" CHANNEL_TYPE = '',\n" +
|
|
|
" ACSIGN_TYPE = 'null',\n" +
|
|
|
" MDTRT_CERT_TYPE = '03',\n" +
|
|
|
" CVL_ACCT_PAY = '0',\n" +
|
|
|
" CVL_ACCT_BALC = '0',\n" +
|
|
|
" HL_ACCT_PAY = '0',\n" +
|
|
|
" HL_ACCT_BALC = '0',\n" +
|
|
|
" FM_ACCT_BALC = '0',\n" +
|
|
|
" PUR_ACCT_PAY = '0'\n" +
|
|
|
" where 1 = 1\n" +
|
|
|
" and LOG_NO = '"+ylzMedicalRelationDO.getLogNo()+"'";
|
|
|
//结算更新
|
|
|
System.out.println("sql=="+sql);
|
|
|
String res = hcyyEntranceService.updateUrl(sql);
|
|
|
|
|
|
String depositType = "";
|
|
|
String depositAmount = "";
|
|
|
String outChargeNo = "";
|
|
|
String orderNo="";
|
|
|
if (businessOrderDO!=null){
|
|
|
depositType = businessOrderDO.getDepositType();
|
|
|
depositAmount = businessOrderDO.getPayPrice()+"";
|
|
|
outChargeNo = businessOrderDO.getTraceNo();
|
|
|
orderNo = businessOrderDO.getOrderNo();
|
|
|
}
|
|
|
if (ylzMedicalRelationDO.getMedicalState()==null||(ylzMedicalRelationDO.getMedicalState()!=null&&ylzMedicalRelationDO.getMedicalState()==0)){
|
|
|
String sql = "update SST_JSDP_JBXX_GJYB\n" +
|
|
|
" set SETL_ID = '', \n" +
|
|
|
" ACCT_PAY = '0',\n" +
|
|
|
" PSN_CASH_PAY = '"+ylzMedicalRelationDO.getPersonCash()+"',\n" +
|
|
|
" FUND_PAY_SUMAMT = '0',\n" +
|
|
|
" CVLSERV_PAY = '0',\n" +
|
|
|
" PSN_PART_AMT = '0',\n" +
|
|
|
" HIFMI_PAY = '0',\n" +
|
|
|
" MEDFEE_SUMAMT = '"+ylzMedicalRelationDO.getBcwkje()+"',\n" +
|
|
|
" SETL_TIME = '0',\n" +
|
|
|
" BALC = '0',\n" +
|
|
|
" ACCT_MULAID_PAY = '0',\n" +
|
|
|
" HIFOB_PAY = '0',\n" +
|
|
|
" MDTRT_ID = '',\n" +
|
|
|
" HIFP_PAY = '0',\n" +
|
|
|
" MAF_PAY = '',\n" +
|
|
|
" OTH_PAY = '0',\n" +
|
|
|
" HIFES_PAY = '0',\n" +
|
|
|
" OUTCHARGENO = '"+orderNo+"',\n" +
|
|
|
" PSN_CERT_TYPE = '0',\n" +
|
|
|
" NATY = '0',\n" +
|
|
|
" BRDY = '0',\n" +
|
|
|
" CVLSERV_FLAG = '0',\n" +
|
|
|
" ACT_PAY_DEDC = '0',\n" +
|
|
|
" PSN_TYPE = '0',\n" +
|
|
|
" HOSP_PART_AMT = '0',\n" +
|
|
|
" CLR_OPTINS = '0',\n" +
|
|
|
" CLR_WAY = '0',\n" +
|
|
|
" CLR_TYPE = '0',\n" +
|
|
|
" POOL_PROP_SELFPAY = '0',\n" +
|
|
|
" INSUPLC_ADMDVS = '',\n" +
|
|
|
" INSUTYPE = '',\n" +
|
|
|
" PSN_NO = '',\n" +
|
|
|
" CHANNEL_TYPE = '',\n" +
|
|
|
" ACSIGN_TYPE = 'null',\n" +
|
|
|
" MDTRT_CERT_TYPE = '03',\n" +
|
|
|
" CVL_ACCT_PAY = '0',\n" +
|
|
|
" CVL_ACCT_BALC = '0',\n" +
|
|
|
" HL_ACCT_PAY = '0',\n" +
|
|
|
" HL_ACCT_BALC = '0',\n" +
|
|
|
" FM_ACCT_BALC = '0',\n" +
|
|
|
" PUR_ACCT_PAY = '0'\n" +
|
|
|
" where 1 = 1\n" +
|
|
|
" and LOG_NO = '"+ylzMedicalRelationDO.getLogNo()+"'";
|
|
|
//结算更新
|
|
|
System.out.println("sql=="+sql);
|
|
|
String res = hcyyEntranceService.updateUrl(sql);
|
|
|
}else {
|
|
|
String sql = "update SST_JSDP_JBXX_GJYB\n" +
|
|
|
" set SETL_ID = '"+ylzMedicalRelationDO.getBillSerial()+"',\n" +
|
|
|
" PSN_CASH_PAY = '"+ylzMedicalRelationDO.getPersonCash()+"',\n" +
|
|
|
" MEDFEE_SUMAMT = '"+ylzMedicalRelationDO.getBcwkje()+"',\n" +
|
|
|
" HIFOB_PAY = '0',\n" +
|
|
|
" OUTCHARGENO = '"+orderNo+"',\n" +
|
|
|
" BRDY = '0',\n" +
|
|
|
" CVLSERV_FLAG = '0',\n" +
|
|
|
" HOSP_PART_AMT = '0',\n" +
|
|
|
" POOL_PROP_SELFPAY = '0',\n" +
|
|
|
" INSUPLC_ADMDVS = '"+ylzMedicalRelationDO.getAdministrativeArea()+"',\n" +
|
|
|
" INSUTYPE = '',\n" +
|
|
|
" PSN_NO = '',\n" +
|
|
|
" CHANNEL_TYPE = '',\n" +
|
|
|
" ACSIGN_TYPE = 'null',\n" +
|
|
|
" MDTRT_CERT_TYPE = '03',\n" +
|
|
|
" CVL_ACCT_PAY = '0',\n" +
|
|
|
" CVL_ACCT_BALC = '0',\n" +
|
|
|
" HL_ACCT_PAY = '0',\n" +
|
|
|
" HL_ACCT_BALC = '0',\n" +
|
|
|
" FM_ACCT_BALC = '0',\n" +
|
|
|
" PUR_ACCT_PAY = '0',\n" +
|
|
|
" CHRG_BCHNO = '"+ylzMedicalRelationDO.getBillSerial()+"',\n" +
|
|
|
" MDTRT_ID = '"+ylzMedicalRelationDO.getInsuranceSerial()+"',\n" +
|
|
|
" PSN_CERT_TYPE = '"+ylzMedicalRelationDO.getCertType()+"',\n" +
|
|
|
" NATY = '"+ylzMedicalRelationDO.getCertType()+"',\n" +
|
|
|
" PSN_TYPE = '"+ylzMedicalRelationDO.getTreatmentType()+"',\n" +
|
|
|
" RYDYMC = '"+ylzMedicalRelationDO.getTreatmentTypeName()+"',\n" +
|
|
|
" YBDYZT = '"+(StringUtils.isNoneBlank(ylzMedicalRelationDO.getTreatmentStatus())?ylzMedicalRelationDO.getTreatmentStatus():0)+"',\n" +
|
|
|
" YBDYMC = '"+(StringUtils.isNoneBlank(ylzMedicalRelationDO.getTreatmentStatusName())?ylzMedicalRelationDO.getTreatmentStatusName():"")+"',\n" +
|
|
|
" YDJYLX = '"+ylzMedicalRelationDO.getAllopatryType()+"',\n" +
|
|
|
" YDLXMC = '"+ylzMedicalRelationDO.getAllopatryTypeName()+"',\n" +
|
|
|
" ACT_PAY_DEDC = '"+ylzMedicalRelationDO.getPayStandard()+"',\n" +
|
|
|
" HIFP_PAY = '"+ylzMedicalRelationDO.getTcjjPay()+"',\n" +
|
|
|
" CVLSERV_PAY = '"+ylzMedicalRelationDO.getGwyPay()+"',\n" +
|
|
|
" HIFES_PAY = '"+ylzMedicalRelationDO.getEnterpriseSupplement()+"',\n" +
|
|
|
" HIFMI_PAY = '"+ylzMedicalRelationDO.getSbjjPay()+"',\n" +
|
|
|
" MAF_PAY = '"+ylzMedicalRelationDO.getYljzPay()+"',\n" +
|
|
|
" OTH_PAY = '"+ylzMedicalRelationDO.getOtherPay()+"',\n" +
|
|
|
" PSN_PART_AMT = '"+ylzMedicalRelationDO.getPersonCash()+"',\n" +
|
|
|
" ACCT_PAY = '"+ylzMedicalRelationDO.getPersonAccount()+"',\n" +
|
|
|
" BALC = '"+ylzMedicalRelationDO.getAccountBalance()+"',\n" +
|
|
|
" ACCT_MULAID_PAY = '"+ylzMedicalRelationDO.getJtgjPay()+"',\n" +
|
|
|
" CLR_WAY = '"+(StringUtils.isNoneBlank(ylzMedicalRelationDO.getClrWay())?ylzMedicalRelationDO.getClrWay():0)+"',\n" +
|
|
|
" CLR_OPTINS = '"+(StringUtils.isNoneBlank(ylzMedicalRelationDO.getClrOptins())?ylzMedicalRelationDO.getClrOptins():0)+"',\n" +
|
|
|
" CLR_TYPE = '"+(StringUtils.isNoneBlank(ylzMedicalRelationDO.getClrType())?ylzMedicalRelationDO.getClrType():0)+"',\n" +
|
|
|
" FUND_PAY_SUMAMT = '"+ylzMedicalRelationDO.getFundPrice()+"',\n" +
|
|
|
" SETL_TIME = '"+DateUtil.dateToStrShort(ylzMedicalRelationDO.getPayDate())+"',\n" +
|
|
|
" OUTYBSFJSON = '"+ylzMedicalRelationDO.getOutJson()+"'\n" +
|
|
|
" where 1 = 1\n" +
|
|
|
" and LOG_NO = '"+ylzMedicalRelationDO.getLogNo()+"'";
|
|
|
//结算更新
|
|
|
System.out.println("sql=="+sql);
|
|
|
String res = hcyyEntranceService.updateUrl(sql);
|
|
|
}
|
|
|
Map<String,Object> params = new HashedMap();
|
|
|
String url =entranceUrlLocal +"comfirmSettleMent";
|
|
|
params.put("mct","03");
|
|
@ -1835,38 +1941,73 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
|
|
|
params.put("xtgzh0",ylzMedicalRelationDO.getLogNo());
|
|
|
HttpResponse response = HttpUtils.doGet(url,params);
|
|
|
System.out.println("response=="+response.getContent());
|
|
|
List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findByOutPatientIdList(ylzMedicalRelationDO.getRelationCode());
|
|
|
/*String */
|
|
|
String realOrder = "";
|
|
|
for (WlyyPrescriptionDO prescriptionDO:wlyyPrescriptionDOS){
|
|
|
if (prescriptionDO.getStatus()==20){
|
|
|
WlyyPrescriptionLogDO prescriptionLogDO = new WlyyPrescriptionLogDO();
|
|
|
prescriptionLogDO.setCreateTime(new Date());
|
|
|
prescriptionLogDO.setStatus(30);
|
|
|
prescriptionLogDO.setOutpatientId(prescriptionDO.getOutpatientId());
|
|
|
prescriptionLogDO.setPrescriptionCode(prescriptionDO.getId());
|
|
|
prescriptionLogDO.setUserCode(prescriptionDO.getPatientCode());
|
|
|
prescriptionLogDO.setUserName(prescriptionDO.getPatientName());
|
|
|
prescriptionLogDO.setUserType(1);
|
|
|
prescriptionLogDO.setDatajson("处方结算");
|
|
|
prescriptionLogDao.save(prescriptionLogDO);
|
|
|
prescriptionDO.setStatus(30);
|
|
|
prescriptionDO.setPayTime(new Date());
|
|
|
prescriptionDao.save(prescriptionDO);
|
|
|
logger.info("变更处方结算状态成功");
|
|
|
realOrder = prescriptionDO.getRealOrder();
|
|
|
String res = response.getContent();
|
|
|
boolean flag = true;
|
|
|
if (StringUtils.isNoneBlank(res)){
|
|
|
JSONObject jsonObject = JSONObject.parseObject(res);
|
|
|
String status = jsonObject.getString("status");
|
|
|
if (status.equalsIgnoreCase("200")){
|
|
|
JSONObject obj = jsonObject.getJSONObject("obj");
|
|
|
String rs = obj.getString("rs");
|
|
|
JSONObject rsObj = JSONObject.parseObject(rs);
|
|
|
String retCode = rsObj.getString("retCode");
|
|
|
if (retCode.equalsIgnoreCase("99")){
|
|
|
flag=false;
|
|
|
throw new Exception(rsObj.getString("retMsg"));
|
|
|
|
|
|
}
|
|
|
}else {
|
|
|
flag = false;
|
|
|
}
|
|
|
}
|
|
|
if (flag){
|
|
|
ylzMedicalRelationDO.setState(1);
|
|
|
ylzMedicalRelationDO.setSettleDate(new Date());
|
|
|
ylzMedicalRelationDO = ylzMedicailRelationDao.save(ylzMedicalRelationDO);
|
|
|
List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findByOutPatientIdList(ylzMedicalRelationDO.getRelationCode());
|
|
|
/*String */
|
|
|
String realOrder = "";
|
|
|
for (WlyyPrescriptionDO prescriptionDO:wlyyPrescriptionDOS){
|
|
|
if (prescriptionDO.getStatus()==20){
|
|
|
WlyyPrescriptionLogDO prescriptionLogDO = new WlyyPrescriptionLogDO();
|
|
|
prescriptionLogDO.setCreateTime(new Date());
|
|
|
prescriptionLogDO.setStatus(30);
|
|
|
prescriptionLogDO.setOutpatientId(prescriptionDO.getOutpatientId());
|
|
|
prescriptionLogDO.setPrescriptionCode(prescriptionDO.getId());
|
|
|
prescriptionLogDO.setUserCode(prescriptionDO.getPatientCode());
|
|
|
prescriptionLogDO.setUserName(prescriptionDO.getPatientName());
|
|
|
prescriptionLogDO.setUserType(1);
|
|
|
prescriptionLogDO.setDatajson("处方结算");
|
|
|
prescriptionLogDao.save(prescriptionLogDO);
|
|
|
prescriptionDO.setStatus(30);
|
|
|
prescriptionDO.setVoucherNo(ylzMedicalRelationDO.getHisBillSerial());
|
|
|
prescriptionDO.setPayTime(new Date());
|
|
|
prescriptionDao.save(prescriptionDO);
|
|
|
logger.info("变更处方结算状态成功");
|
|
|
realOrder = prescriptionDO.getRealOrder();
|
|
|
}
|
|
|
try {
|
|
|
sfToHis(outpatientId, realOrder);
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
|
|
|
}
|
|
|
try {
|
|
|
sfToHis(outpatientId, realOrder);
|
|
|
logger.info("=================电子发票开具开始=================");
|
|
|
hcyyEntranceService.OutpatientInvoicing(ylzMedicalRelationDO.getHisBillSerial(),"lb");
|
|
|
logger.info("=================电子发票开具结束=================");
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
|
|
|
return "结算成功!";
|
|
|
}else {
|
|
|
throw new Exception("结算失败!");
|
|
|
}
|
|
|
return "结算成功!";
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
return "结算失败";
|
|
|
throw new Exception(e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|