|
@ -25,6 +25,7 @@ import net.sf.json.xml.XMLSerializer;
|
|
|
import org.apache.commons.collections.map.HashedMap;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.commons.lang3.math.NumberUtils;
|
|
|
import org.checkerframework.checker.units.qual.A;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@ -809,6 +810,11 @@ public class TasyNatService {
|
|
|
baseNatAppointmentDO.setVoucherNo(voucherNo);
|
|
|
if ("已扣费".equalsIgnoreCase(jsonObject.getString("Status"))){
|
|
|
baseNatAppointmentDO.setPayStatus("1");
|
|
|
BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(baseNatAppointmentDO.getId().toString());
|
|
|
if (businessOrderDO!=null){
|
|
|
businessOrderDO.setStatus(1);
|
|
|
businessOrderDao.save(businessOrderDO);
|
|
|
}
|
|
|
}
|
|
|
baseNatAppointmentDao.save(baseNatAppointmentDO);
|
|
|
}
|
|
@ -836,7 +842,6 @@ public class TasyNatService {
|
|
|
businessOrderDO.setOrderNo(newOrder);
|
|
|
businessOrderDO.setHistoryOrder(orderNo+","+newOrder);
|
|
|
}
|
|
|
|
|
|
com.alibaba.fastjson.JSONObject orderObj= new com.alibaba.fastjson.JSONObject();
|
|
|
orderObj.put("payType",1);
|
|
|
orderObj.put("tradeNo",businessOrderDO.getOrderNo());
|
|
@ -925,4 +930,69 @@ public class TasyNatService {
|
|
|
logger.info("hdrQueryDataWS json:"+json);
|
|
|
return json;
|
|
|
}
|
|
|
|
|
|
public Map checkBalance(String relationCode) throws Exception{
|
|
|
BaseNatAppointmentDO baseNatAppointmentDO = baseNatAppointmentDao.findOne(Integer.parseInt(relationCode));
|
|
|
WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyHospitalSysDictDao.findById("MzBalance");
|
|
|
String tmpBalance="";
|
|
|
if (wlyyHospitalSysDictDO!=null){
|
|
|
tmpBalance=wlyyHospitalSysDictDO.getDictValue();
|
|
|
}
|
|
|
String res = findHisPatientCard(baseNatAppointmentDO.getCardNo());
|
|
|
String mediacard=baseNatAppointmentDO.getMedicare();
|
|
|
Map result=new HashMap();
|
|
|
if (StringUtils.isNoneBlank(res)){
|
|
|
JSONObject jsonObject = JSON.parseObject(res);
|
|
|
if ("1".equalsIgnoreCase(jsonObject.getString("ReturnCode"))) {
|
|
|
String patients=jsonObject.getString("patients");
|
|
|
if (patients.contains("[")){
|
|
|
JSONArray jsonArray = JSON.parseArray(patients);
|
|
|
if (jsonArray != null && jsonArray.size() > 0) {
|
|
|
for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
JSONObject child = jsonArray.getJSONObject(i);
|
|
|
if (mediacard.equalsIgnoreCase(child.getString("CardNo"))) {
|
|
|
String MzBalance = child.getString("MzBalance");
|
|
|
if (StringUtils.isNoneBlank(tmpBalance)){
|
|
|
MzBalance=tmpBalance;
|
|
|
}
|
|
|
System.out.println("MzBalance====="+MzBalance);
|
|
|
if (StringUtils.isNoneBlank(MzBalance) && Integer.parseInt(MzBalance) < 0) {
|
|
|
result.put("msgCode", "-1");
|
|
|
result.put("msg", "余额不足");
|
|
|
return result;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}else {
|
|
|
try {
|
|
|
JSONObject jsonObject1= JSONObject.parseObject(patients);
|
|
|
if (mediacard.equalsIgnoreCase(jsonObject1.getString("CardNo"))) {
|
|
|
String MzBalance = jsonObject1.getString("MzBalance");
|
|
|
if (StringUtils.isNoneBlank(tmpBalance)){
|
|
|
MzBalance=tmpBalance;
|
|
|
}
|
|
|
System.out.println("MzBalance====="+MzBalance);
|
|
|
if (StringUtils.isNoneBlank(MzBalance) && Integer.parseInt(MzBalance) < 0) {
|
|
|
result.put("msgCode", "-1");
|
|
|
result.put("msg", "余额不足");
|
|
|
return result;
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
result.put("msgCode","-1000");
|
|
|
result.put("msg","json格式验证失败");
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
result.put("msgCode","200");
|
|
|
result.put("msg","验证通过");
|
|
|
return result;
|
|
|
}
|
|
|
}
|