|
@ -1,7 +1,6 @@
|
|
|
package com.yihu.jw.care.service.pay;
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
|
|
import com.yihu.fastdfs.FastDFSUtil;
|
|
@ -9,12 +8,16 @@ import com.yihu.jw.care.dao.doorCoach.BaseDoorCoachFeeDetailDao;
|
|
|
import com.yihu.jw.care.dao.doorCoach.BaseDoorCoachOrderDao;
|
|
|
import com.yihu.jw.care.dao.lifeCare.LifeCareFeeDetailDao;
|
|
|
import com.yihu.jw.care.dao.lifeCare.LifeCareOrderDao;
|
|
|
import com.yihu.jw.care.dao.sign.ServicePackageItemDao;
|
|
|
import com.yihu.jw.care.dao.sign.ServicePackageSignRecordDao;
|
|
|
import com.yihu.jw.care.service.doorCoach.PatientDoorCoachOrderService;
|
|
|
import com.yihu.jw.care.service.lifeCare.LifeCareOrderService;
|
|
|
import com.yihu.jw.care.service.sign.ServicePackageService;
|
|
|
import com.yihu.jw.care.util.WxpayUtil;
|
|
|
import com.yihu.jw.care.util.XMLUtil;
|
|
|
import com.yihu.jw.entity.base.patient.BasePatientDO;
|
|
|
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
|
|
|
import com.yihu.jw.entity.base.servicePackage.ServicePackageItemDO;
|
|
|
import com.yihu.jw.entity.base.servicePackage.ServicePackageSignRecordDO;
|
|
|
import com.yihu.jw.entity.base.wx.WxWechatDO;
|
|
|
import com.yihu.jw.entity.care.common.WxPayHttpLogDO;
|
|
|
import com.yihu.jw.entity.care.doorCoach.BaseDoorCoachFeeDetailDO;
|
|
@ -22,13 +25,9 @@ import com.yihu.jw.entity.care.doorCoach.BaseDoorCoachOrderDO;
|
|
|
import com.yihu.jw.entity.care.lifeCare.LifeCareFeeDetailDO;
|
|
|
import com.yihu.jw.entity.care.lifeCare.LifeCareOrderDO;
|
|
|
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
|
|
|
import com.yihu.jw.entity.hospital.healthCare.YlzMedicalRelationDO;
|
|
|
import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
|
|
|
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
|
|
|
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
|
|
|
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionInfoDO;
|
|
|
import com.yihu.jw.entity.order.BusinessOrderDO;
|
|
|
import com.yihu.jw.entity.order.BusinessOrderRefundDO;
|
|
|
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
|
|
|
import com.yihu.jw.order.BusinessOrderService;
|
|
|
import com.yihu.jw.order.dao.BusinessOrderDao;
|
|
|
import com.yihu.jw.order.dao.BusinessOrderRefundDao;
|
|
@ -110,6 +109,14 @@ public class PayService {
|
|
|
private LifeCareFeeDetailDao lifeCareFeeDetailDao;
|
|
|
@Autowired
|
|
|
private BaseDoorCoachFeeDetailDao doorCoachFeeDetailDao;
|
|
|
@Autowired
|
|
|
private ServicePackageService servicePackageService;
|
|
|
@Autowired
|
|
|
private ServicePackageSignRecordDao signRecordDao;
|
|
|
@Autowired
|
|
|
private ServicePackageItemDao servicePackageItemDao;
|
|
|
@Autowired
|
|
|
private WlyyHospitalSysDictDao hospitalSysDictDao;
|
|
|
|
|
|
/**
|
|
|
* 顶部状态栏订单各分类总条数
|
|
@ -231,6 +238,9 @@ public class PayService {
|
|
|
}else if("4".equals(type)){
|
|
|
List<LifeCareFeeDetailDO> feeDetailDOList = lifeCareFeeDetailDao.findByOrderId(businessOrderDO.getRelationCode());
|
|
|
resJson.put("fees",feeDetailDOList);
|
|
|
}else if("5".equals(type)){
|
|
|
List<ServicePackageItemDO> feeDetailDOList = servicePackageItemDao.findByServicePackageId(businessOrderDO.getRelationCode());
|
|
|
resJson.put("fees",feeDetailDOList);
|
|
|
}
|
|
|
//退款信息
|
|
|
if(status>2){
|
|
@ -367,6 +377,13 @@ public class PayService {
|
|
|
result.put(ResponseContant.resultMsg, "支付工单不存在");
|
|
|
return result;
|
|
|
}
|
|
|
}else if("5".equals(category)){
|
|
|
ServicePackageSignRecordDO orderDO = signRecordDao.findOne(orderId);
|
|
|
if (orderDO==null){
|
|
|
result.put(ResponseContant.resultFlag, ResponseContant.fail);
|
|
|
result.put(ResponseContant.resultMsg, "支付工单不存在");
|
|
|
return result;
|
|
|
}
|
|
|
}
|
|
|
BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(orderId);
|
|
|
if (businessOrderDO==null){
|
|
@ -524,6 +541,10 @@ public class PayService {
|
|
|
//desc = "生活照料服务";
|
|
|
lifeCareOrderService.payOrderAfter(orderDO.getRelationCode());
|
|
|
break;
|
|
|
case "5":
|
|
|
//签约服务包
|
|
|
servicePackageService.payOrderAfter(orderDO.getRelationCode());
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
@ -564,6 +585,10 @@ public class PayService {
|
|
|
//desc = "生活照料服务";
|
|
|
lifeCareOrderService.refundOrderAfter(businessOrderDO.getRelationCode());
|
|
|
break;
|
|
|
case "5":
|
|
|
//签约服务包相关
|
|
|
servicePackageService.refundOrderAfter(businessOrderDO.getRelationCode());
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
@ -616,7 +641,12 @@ public class PayService {
|
|
|
reqMap.put("mch_id", mchId);
|
|
|
reqMap.put("nonce_str", noceStr);
|
|
|
// 此路径是微信服务器调用支付结果通知路径
|
|
|
reqMap.put("notify_url", "https://zhyzh.gongshu.gov.cn/cloudCare/pay/open/wxPayNotify");
|
|
|
String notifyUrl ="https://zhyzh.gongshu.gov.cn/cloudCare/pay/open/wxPayNotify";
|
|
|
WlyyHospitalSysDictDO dictDO = hospitalSysDictDao.findById("wxPayNotify");
|
|
|
if(dictDO!=null){
|
|
|
notifyUrl = dictDO.getDictValue();
|
|
|
}
|
|
|
reqMap.put("notify_url", notifyUrl);
|
|
|
reqMap.put("out_trade_no", businessOrderDO.getOrderNo());
|
|
|
reqMap.put("spbill_create_ip", IpUtil.getOneIpAddress(request));
|
|
|
reqMap.put("product_id", businessOrderDO.getOrderNo());
|
|
@ -696,7 +726,12 @@ public class PayService {
|
|
|
reqMap.put("mch_id", mchId);
|
|
|
reqMap.put("nonce_str", noceStr);
|
|
|
// 此路径是微信服务器调用支付结果通知路径
|
|
|
reqMap.put("notify_url", "https://zhyzh.gongshu.gov.cn/cloudCare/pay/open/wxPayNotify");
|
|
|
String notifyUrl ="https://zhyzh.gongshu.gov.cn/cloudCare/pay/open/wxPayNotify";
|
|
|
WlyyHospitalSysDictDO dictDO = hospitalSysDictDao.findById("wxPayNotify");
|
|
|
if(dictDO!=null){
|
|
|
notifyUrl = dictDO.getDictValue();
|
|
|
}
|
|
|
reqMap.put("notify_url", notifyUrl);
|
|
|
reqMap.put("out_trade_no", businessOrderDO.getOrderNo());
|
|
|
reqMap.put("spbill_create_ip", IpUtil.getOneIpAddress(request));
|
|
|
reqMap.put("product_id", businessOrderDO.getOrderNo());
|
|
@ -744,7 +779,7 @@ public class PayService {
|
|
|
|
|
|
/**
|
|
|
* 提交支付订单
|
|
|
* 订单类型 1招生,2 课程,3 上门辅导托幼) 4 生活照料
|
|
|
* 订单类型 1招生,2 课程,3 上门辅导托幼) 4 生活照料 5签约服务包
|
|
|
* @return
|
|
|
*/
|
|
|
public BusinessOrderDO submitOrder(String patientId,String type,String relationCode,Double price){
|
|
@ -776,6 +811,10 @@ public class PayService {
|
|
|
desc = "生活照料服务项目费";
|
|
|
relateName = "生活照料";
|
|
|
break;
|
|
|
case "5":
|
|
|
desc = "签约服务包费";
|
|
|
relateName = "签约服务包";
|
|
|
break;
|
|
|
default:
|
|
|
desc = "服务费";
|
|
|
relateName = "服务";
|
|
@ -868,7 +907,7 @@ public class PayService {
|
|
|
}
|
|
|
if (businessOrderDO!=null){
|
|
|
if (businessOrderDO.getStatus()==1){
|
|
|
throw new Exception("该处方已支付过");
|
|
|
throw new Exception("该订单已支付过");
|
|
|
}
|
|
|
String openId = "";
|
|
|
if (StringUtils.isNotBlank(appletCode)){
|
|
@ -886,6 +925,10 @@ public class PayService {
|
|
|
businessOrderDO.setOrderNo(getOrderNo());
|
|
|
businessOrderDO= businessOrderDao.save(businessOrderDO);
|
|
|
String notifyUrl ="https://zhyzh.gongshu.gov.cn/cloudCare/pay/open/cloudPayNotify";
|
|
|
WlyyHospitalSysDictDO dictDO = hospitalSysDictDao.findById("cloudPayNotify");
|
|
|
if(dictDO!=null){
|
|
|
notifyUrl = dictDO.getDictValue();
|
|
|
}
|
|
|
String totalFee =businessOrderDO.getPayPrice().intValue()+"";
|
|
|
map = businessOrderService.unifiedorder(wechatId,businessOrderDO.getDescription(),totalFee, depositType,openId,businessOrderDO.getOrderNo(),notifyUrl,businessOrderDO.getPatient());
|
|
|
}
|