|
@ -1426,15 +1426,15 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
|
|
|
* @param tradeType
|
|
|
* @return
|
|
|
*/
|
|
|
public JSONObject tradeQuery(String orderNo,String tradeType) throws Exception {
|
|
|
BusinessOrderDO businessOrderDO = businessOrderDao.selectByOrderNo(orderNo);
|
|
|
public JSONObject tradeQuery(String relationCode,String tradeType) throws Exception {
|
|
|
BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(relationCode);
|
|
|
String operatorId = "";
|
|
|
String operatorName = "";
|
|
|
if(wechatId.equalsIgnoreCase("xm_dsyy_wx")){
|
|
|
operatorId = "HLWCS";
|
|
|
operatorName = "互联网医院";
|
|
|
}
|
|
|
String response = ylzPayService.tradeQuery(operatorId,operatorName,orderNo,tradeType,businessOrderDO.getRematk());
|
|
|
String response = ylzPayService.tradeQuery(operatorId,operatorName,businessOrderDO.getOrderNo(),tradeType,businessOrderDO.getRematk());
|
|
|
JSONObject object = JSONObject.parseObject(response);
|
|
|
if (object.getString("respCode").equalsIgnoreCase("000000")){
|
|
|
JSONObject param = object.getJSONObject("param");
|
|
@ -1675,7 +1675,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public String ylzRechargePreDs(String code,String depositType,String wechatId,String cardType,String cardNo,boolean demoFlag) throws Exception {
|
|
|
public String ylzRechargePreDs(String code,String depositType,String wechatId,String cardType,String cardNo,boolean demoFlag,String appletCode) throws Exception {
|
|
|
try {
|
|
|
String response = null;
|
|
|
WxWechatDO wxWechatDO = wechatDao.findById(wechatId).get();
|
|
@ -1718,15 +1718,19 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
|
|
|
businessOrderDO.setOrderNo("HLWYY"+System.currentTimeMillis()+(int)(Math.random()*900)+100);
|
|
|
businessOrderDO.setDepositType(depositType);
|
|
|
businessOrderDao.save(businessOrderDO);
|
|
|
if(depositType.equalsIgnoreCase("WX_MIN")){
|
|
|
openId = patientDO.getOpenid();
|
|
|
if (StringUtils.isNotBlank(appletCode)){
|
|
|
logger.info("appletCode不为空"+appletCode);
|
|
|
Map<String,Object> objectMap = checkApplets(appletCode,wxWechatDO.getApplets(),wxWechatDO.getAppletsSecret());
|
|
|
if (objectMap!=null){
|
|
|
openId = objectMap.get("openid").toString();
|
|
|
logger.info("appletCode"+appletCode);
|
|
|
logger.info("openid"+openId);
|
|
|
}
|
|
|
}else {
|
|
|
List<BasePatientWechatDo> patientWechatDos = patientWechatDao.findByWechatIdAndPatientId(wechatId,wlyyOutpatientDO.getConsumer());
|
|
|
if (patientWechatDos!=null&&patientWechatDos.size()!=0){
|
|
|
BasePatientWechatDo patientWechatDo = patientWechatDos.get(0);
|
|
|
openId = patientWechatDo.getOpenid();
|
|
|
}else {
|
|
|
throw new Exception("请关注“第三医院”公众号,点击互联网医院-在线诊室进行结算!");
|
|
|
logger.info("appletCode为空"+appletCode);
|
|
|
List<BasePatientWechatDo> patientWechatDo = patientWechatDao.findByWechatIdAndPatientId(wechatId,businessOrderDO.getPatient());
|
|
|
if (patientWechatDo!=null&&patientWechatDo.size()!=0){
|
|
|
openId = patientWechatDo.get(0).getOpenid();
|
|
|
}
|
|
|
}
|
|
|
String price = businessOrderDO.getPayPrice().toString();
|
|
@ -1808,15 +1812,19 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
|
|
|
businessOrderDO.setCreateTime(new Date());
|
|
|
businessOrderDO.setUpdateTime(new Date());
|
|
|
businessOrderDao.save(businessOrderDO);
|
|
|
if(depositType.equalsIgnoreCase("WX_MIN")){
|
|
|
openId = patientDO.getOpenid();
|
|
|
if (StringUtils.isNotBlank(appletCode)){
|
|
|
logger.info("appletCode不为空"+appletCode);
|
|
|
Map<String,Object> objectMap = checkApplets(appletCode,wxWechatDO.getApplets(),wxWechatDO.getAppletsSecret());
|
|
|
if (objectMap!=null){
|
|
|
openId = objectMap.get("openid").toString();
|
|
|
logger.info("appletCode"+appletCode);
|
|
|
logger.info("openid"+openId);
|
|
|
}
|
|
|
}else {
|
|
|
List<BasePatientWechatDo> patientWechatDos = patientWechatDao.findByWechatIdAndPatientId(wechatId,wlyyOutpatientDO.getConsumer());
|
|
|
if (patientWechatDos!=null&&patientWechatDos.size()!=0){
|
|
|
BasePatientWechatDo patientWechatDo = patientWechatDos.get(0);
|
|
|
openId = patientWechatDo.getOpenid();
|
|
|
}else {
|
|
|
throw new Exception("请关注“第三医院”公众号,点击互联网医院-在线诊室进行结算!");
|
|
|
logger.info("appletCode为空"+appletCode);
|
|
|
List<BasePatientWechatDo> patientWechatDo = patientWechatDao.findByWechatIdAndPatientId(wechatId,businessOrderDO.getPatient());
|
|
|
if (patientWechatDo!=null&&patientWechatDo.size()!=0){
|
|
|
openId = patientWechatDo.get(0).getOpenid();
|
|
|
}
|
|
|
}
|
|
|
String price = businessOrderDO.getPayPrice().toString();
|
|
@ -2046,7 +2054,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public String ylzRechargeJson(String code,String depositType,String wechatId,String cardType,String cardNo,boolean demoFlag) throws Exception {
|
|
|
public String ylzRechargeJson(String code,String depositType,String wechatId,String cardType,String cardNo,boolean demoFlag,String appletCode) throws Exception {
|
|
|
String response = null;
|
|
|
WxWechatDO wxWechatDO = wechatDao.findByIdAndStatus(wechatId);
|
|
|
if(wxWechatDO==null){
|
|
@ -2131,15 +2139,19 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
|
|
|
businessOrderDO.setOrderNo("HLWYY"+System.currentTimeMillis()+(int)(Math.random()*900)+100);
|
|
|
businessOrderDO.setDepositType(depositType);
|
|
|
businessOrderDao.save(businessOrderDO);
|
|
|
if(depositType.equalsIgnoreCase("WX_MIN")){
|
|
|
openId = patientDO.getOpenid();
|
|
|
if (StringUtils.isNotBlank(appletCode)){
|
|
|
logger.info("appletCode不为空"+appletCode);
|
|
|
Map<String,Object> objectMap = checkApplets(appletCode,wxWechatDO.getApplets(),wxWechatDO.getAppletsSecret());
|
|
|
if (objectMap!=null){
|
|
|
openId = objectMap.get("openid").toString();
|
|
|
logger.info("appletCode"+appletCode);
|
|
|
logger.info("openid"+openId);
|
|
|
}
|
|
|
}else {
|
|
|
List<BasePatientWechatDo> patientWechatDos = patientWechatDao.findByWechatIdAndPatientId(wechatId,wlyyOutpatientDO.getConsumer());
|
|
|
if (patientWechatDos!=null&&patientWechatDos.size()!=0){
|
|
|
BasePatientWechatDo patientWechatDo = patientWechatDos.get(0);
|
|
|
openId = patientWechatDo.getOpenid();
|
|
|
}else {
|
|
|
throw new Exception("请关注“第三医院”公众号,点击互联网医院-在线诊室进行结算!");
|
|
|
logger.info("appletCode为空"+appletCode);
|
|
|
List<BasePatientWechatDo> patientWechatDo = patientWechatDao.findByWechatIdAndPatientId(wechatId,businessOrderDO.getPatient());
|
|
|
if (patientWechatDo!=null&&patientWechatDo.size()!=0){
|
|
|
openId = patientWechatDo.get(0).getOpenid();
|
|
|
}
|
|
|
}
|
|
|
String price = businessOrderDO.getPayPrice().toString();
|