|
@ -850,6 +850,13 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public List<BusinessOrderDO> selectListStatus(String relationCode){
|
|
|
|
List<BusinessOrderDO> businessOrderDOList = businessOrderDao.selectListByRelationCode(relationCode);
|
|
|
|
return businessOrderDOList;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* 易联众退款
|
|
* 易联众退款
|
|
* @param wechatId
|
|
* @param wechatId
|
|
@ -1159,16 +1166,19 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
|
|
* @return
|
|
* @return
|
|
* @throws Exception
|
|
* @throws Exception
|
|
*/
|
|
*/
|
|
public Map yktMedicalCardTopUp(String mzhm,Double jkje,Integer type,Integer paymentType,String patientId,String wechatId,String hospitalId) throws Exception {
|
|
|
|
|
|
public Map yktMedicalCardTopUp(String mzhm,Double jkje,Integer type,Integer paymentType,String patientId,String wechatId,String hospitalId,String wxPayType) throws Exception {
|
|
BasePatientDO patientDO = patientDao.findById(patientId);
|
|
BasePatientDO patientDO = patientDao.findById(patientId);
|
|
BusinessOrderDO businessOrderDO = new BusinessOrderDO();
|
|
BusinessOrderDO businessOrderDO = new BusinessOrderDO();
|
|
businessOrderDO.setPatient(patientId);
|
|
businessOrderDO.setPatient(patientId);
|
|
businessOrderDO.setPatientName(patientDO.getName());
|
|
businessOrderDO.setPatientName(patientDO.getName());
|
|
businessOrderDO.setCreateTime(DateUtil.getNowDate());
|
|
businessOrderDO.setCreateTime(DateUtil.getNowDate());
|
|
businessOrderDO.setOrderCategory("5");
|
|
businessOrderDO.setOrderCategory("5");
|
|
businessOrderDO.setDescription("眼科就诊卡充值");
|
|
|
|
|
|
businessOrderDO.setDescription("就诊卡充值");
|
|
businessOrderDO.setPayPrice(jkje);
|
|
businessOrderDO.setPayPrice(jkje);
|
|
businessOrderDO.setOrderNo("HLWYY"+System.currentTimeMillis()+(int)(Math.random()*900)+100);
|
|
businessOrderDO.setOrderNo("HLWYY"+System.currentTimeMillis()+(int)(Math.random()*900)+100);
|
|
|
|
businessOrderDO.setRelationCode(mzhm);
|
|
|
|
businessOrderDO.setRelationName("就诊卡充值");
|
|
|
|
businessOrderDO.setStatus(0);
|
|
if (paymentType==1){
|
|
if (paymentType==1){
|
|
businessOrderDO.setPayType(2);
|
|
businessOrderDO.setPayType(2);
|
|
}
|
|
}
|
|
@ -1181,31 +1191,31 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
|
|
if (type==1){
|
|
if (type==1){
|
|
businessOrderDO.setOrderType(11);
|
|
businessOrderDO.setOrderType(11);
|
|
}
|
|
}
|
|
Map<String,Object> map=null;
|
|
|
|
|
|
Map<String,Object> map= new HashMap<>();
|
|
String rs = ykyyService.getNewSerialNumber(mzhm, jkje.intValue(), type, paymentType, patientDO.getUserId(), hospitalId);
|
|
String rs = ykyyService.getNewSerialNumber(mzhm, jkje.intValue(), type, paymentType, patientDO.getUserId(), hospitalId);
|
|
|
|
logger.info("眼科获取充值订单接口调用结果:"+rs);
|
|
|
|
|
|
Map<String,Object> rsMap = JSONObject.parseObject(rs, Map.class);
|
|
Map<String,Object> rsMap = JSONObject.parseObject(rs, Map.class);
|
|
if ("10000".equalsIgnoreCase(rsMap.get("code").toString())){
|
|
if ("10000".equalsIgnoreCase(rsMap.get("code").toString())){
|
|
businessOrderDO.setYkOrderNo(rsMap.get("value").toString());
|
|
businessOrderDO.setYkOrderNo(rsMap.get("value").toString());
|
|
}else {
|
|
}else {
|
|
map.put("error","眼科接口调用失败");
|
|
|
|
logger.info("error="+"眼科接口调用失败");
|
|
|
|
return map;
|
|
|
|
|
|
logger.info("error=眼科接口调用失败");
|
|
|
|
return rsMap;
|
|
}
|
|
}
|
|
|
|
|
|
businessOrderDO = businessOrderDao.save(businessOrderDO);
|
|
businessOrderDO = businessOrderDao.save(businessOrderDO);
|
|
List<BasePatientWechatDo> patientWechatDoList = patientWechatDao.findByWechatIdAndPatientId(wechatId, patientId);
|
|
List<BasePatientWechatDo> patientWechatDoList = patientWechatDao.findByWechatIdAndPatientId(wechatId, patientId);
|
|
|
|
|
|
if (patientWechatDoList.isEmpty()){
|
|
|
|
|
|
if (patientWechatDoList==null || patientWechatDoList.size()==0){
|
|
map.put("error","无openId");
|
|
map.put("error","无openId");
|
|
logger.info("error="+"无openId");
|
|
|
|
|
|
logger.info("error=无openId");
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|
|
WxWechatDO wxWechatDO = wechatDao.findById(wechatId);
|
|
WxWechatDO wxWechatDO = wechatDao.findById(wechatId);
|
|
String url = wxWechatDO.getBaseUrl();
|
|
String url = wxWechatDO.getBaseUrl();
|
|
String notifyUrl =url;
|
|
String notifyUrl =url;
|
|
String price = (int)(businessOrderDO.getPayPrice()*100)+"";
|
|
String price = (int)(businessOrderDO.getPayPrice()*100)+"";
|
|
map = unifiedorder(wechatId,businessOrderDO.getDescription(),price,WeChatConfig.TRADE_TYPE_JSAPI,patientWechatDoList.get(0).getOpenid(),businessOrderDO.getOrderNo(),notifyUrl);
|
|
|
|
|
|
map = unifiedorder(wechatId,businessOrderDO.getDescription(),price,wxPayType,patientWechatDoList.get(0).getOpenid(),businessOrderDO.getOrderNo(),notifyUrl);
|
|
logger.info("success="+JSONObject.toJSONString(map));
|
|
logger.info("success="+JSONObject.toJSONString(map));
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|