|
|
@@ -11,6 +11,7 @@ import thyyxxk.wxservice_server.config.exception.ExceptionEnum;
|
|
|
import thyyxxk.wxservice_server.constant.CardCostTypes;
|
|
|
import thyyxxk.wxservice_server.constant.OrderType;
|
|
|
import thyyxxk.wxservice_server.dao.CouponDao;
|
|
|
+import thyyxxk.wxservice_server.dao.ImportDrugDao;
|
|
|
import thyyxxk.wxservice_server.dao.InpatientDao;
|
|
|
import thyyxxk.wxservice_server.dao.WxApiDao;
|
|
|
import thyyxxk.wxservice_server.entity.PureCodeName;
|
|
|
@@ -18,6 +19,8 @@ import thyyxxk.wxservice_server.entity.ResultVo;
|
|
|
import thyyxxk.wxservice_server.entity.coupon.CouponAttribute;
|
|
|
import thyyxxk.wxservice_server.entity.coupon.CouponFactory;
|
|
|
import thyyxxk.wxservice_server.entity.coupon.PatientCoupon;
|
|
|
+import thyyxxk.wxservice_server.entity.drugconsult.ImportDrugPurchase;
|
|
|
+import thyyxxk.wxservice_server.entity.drugconsult.PrepayState;
|
|
|
import thyyxxk.wxservice_server.entity.electronichealthcard.HisRegister;
|
|
|
import thyyxxk.wxservice_server.entity.inpatient.GetZyFeeParam;
|
|
|
import thyyxxk.wxservice_server.entity.wxapi.PushMessageParam;
|
|
|
@@ -44,17 +47,19 @@ public class SavePayResultService {
|
|
|
private final WxApiDao dao;
|
|
|
private final InpatientDao yjjDao;
|
|
|
private final CouponDao couponDao;
|
|
|
+ private final ImportDrugDao drugDao;
|
|
|
private final ThmzService thmzService;
|
|
|
private final WxRefundService refundService;
|
|
|
private final PushWxMessageService pushWxMessageService;
|
|
|
private final ElectronicHealthCardService healthCardService;
|
|
|
|
|
|
@Autowired
|
|
|
- public SavePayResultService(WxApiDao dao, InpatientDao yjjDao, CouponDao couponDao, ThmzService thmzService, WxRefundService refundService,
|
|
|
+ public SavePayResultService(WxApiDao dao, InpatientDao yjjDao, CouponDao couponDao, ImportDrugDao drugDao, ThmzService thmzService, WxRefundService refundService,
|
|
|
PushWxMessageService pushWxMessageService, ElectronicHealthCardService healthCardService) {
|
|
|
this.dao = dao;
|
|
|
this.yjjDao = yjjDao;
|
|
|
this.couponDao = couponDao;
|
|
|
+ this.drugDao = drugDao;
|
|
|
this.thmzService = thmzService;
|
|
|
this.refundService = refundService;
|
|
|
this.pushWxMessageService = pushWxMessageService;
|
|
|
@@ -243,6 +248,19 @@ public class SavePayResultService {
|
|
|
return "领取优惠券失败,请联系管理员。";
|
|
|
}
|
|
|
|
|
|
+ public String saveDrugPurchase(WxPayOrder order, String payTime) {
|
|
|
+ ImportDrugPurchase purchase = drugDao.selectById(order.getDrugPurchaseId());
|
|
|
+ if (purchase.getPrepayState() == PrepayState.SUCCESS) {
|
|
|
+ log.info("订单号:{} 的药品申购订金已支付,无需再次保存。", order.getTradeNo());
|
|
|
+ return payTime;
|
|
|
+ }
|
|
|
+ dao.couponUsed(order.getCouponId());
|
|
|
+ purchase.setPrepayState(PrepayState.SUCCESS);
|
|
|
+ drugDao.updateById(purchase);
|
|
|
+ log.info("缴纳药品申购订金成功:{}", JSON.toJSONStringWithDateFormat(order, "yyyy-MM-dd HH:mm:ss"));
|
|
|
+ return payTime;
|
|
|
+ }
|
|
|
+
|
|
|
public void notifyCytj(WxPayOrder order, String payTime) {
|
|
|
CytjService cytjService = new CytjService();
|
|
|
int rescode = cytjService.notifyPaymentSuccess(order, payTime);
|