|
@ -3,10 +3,13 @@ package com.yihu.wlyy.web.third.ylzpay;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.yihu.wlyy.entity.organization.HospitalMapping;
|
|
|
import com.yihu.wlyy.entity.patient.Patient;
|
|
|
import com.yihu.wlyy.entity.ylz.PayConfigura;
|
|
|
import com.yihu.wlyy.repository.organization.HospitalMappingDao;
|
|
|
import com.yihu.wlyy.repository.patient.PatientDao;
|
|
|
import com.yihu.wlyy.repository.ylz.PayConfiguraDao;
|
|
|
import com.yihu.wlyy.service.third.ylz.PayLogService;
|
|
|
import com.yihu.wlyy.service.weixin.wxpay.model.BindCard;
|
|
|
import com.yihu.wlyy.service.weixin.wxpay.model.Charge;
|
|
|
import com.yihu.wlyy.service.weixin.wxpay.service.OnePayService;
|
|
|
import com.yihu.wlyy.util.HttpClientUtil;
|
|
@ -16,13 +19,15 @@ import com.ylzinfo.onepay.sdk.domain.ResponseParams;
|
|
|
import com.ylzinfo.onepay.sdk.exception.PayException;
|
|
|
import com.ylzinfo.onepay.sdk.utils.StringUtil;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.json.JSONObject;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.util.StreamUtils;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
@ -32,6 +37,7 @@ import java.io.PrintWriter;
|
|
|
import java.io.StringWriter;
|
|
|
import java.nio.charset.Charset;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* Created by Reece on 2017/8/30/030.
|
|
@ -55,6 +61,8 @@ public class ThirdOnepayController extends WeixinBaseController {
|
|
|
private HospitalMappingDao mappingDao;
|
|
|
@Autowired
|
|
|
ObjectMapper objectMapper;
|
|
|
@Autowired
|
|
|
private PatientDao patientDao;
|
|
|
|
|
|
/**
|
|
|
* 支付真正完成,异步回调返回支付参数 后台做数据操作
|
|
@ -123,5 +131,83 @@ public class ThirdOnepayController extends WeixinBaseController {
|
|
|
// 记录log日志到数据库
|
|
|
logService.saveHttpLog(isSuccess, config.getReceiveNotify(), "异步支付通知", "POST", null, params, responses, error, logService.onepayType);
|
|
|
}
|
|
|
|
|
|
//
|
|
|
// @RequestMapping(value = "bindCard", method = RequestMethod.POST)
|
|
|
// @ApiOperation("查询绑卡信息")
|
|
|
// @ResponseBody
|
|
|
// public String bindCard(
|
|
|
// @ApiParam(name = "uid", value = "居民CODE", defaultValue = "")
|
|
|
// @RequestParam String uid,
|
|
|
// @ApiParam(name = "repUid", value = "家人居民CODE", defaultValue = "")
|
|
|
// @RequestParam String repUid) throws Exception {
|
|
|
// try {
|
|
|
// JSONObject json = new JSONObject();
|
|
|
// String msg = null;
|
|
|
//
|
|
|
// Patient people = patientDao.findByCode(uid);
|
|
|
// String openid = people.getOpenid();
|
|
|
// String ssc = people.getSsc();
|
|
|
// String createType = "sicard";
|
|
|
// if (!repUid.equals(uid)) {
|
|
|
// createType = "family";
|
|
|
// people = patientDao.findByCode(repUid);
|
|
|
// ssc = people.getSsc();
|
|
|
// }
|
|
|
// if("undefined".equals(openid)|| StringUtils.isEmpty(openid)){
|
|
|
// people.setOpenid(null);
|
|
|
// patientDao.save(people);
|
|
|
// return write(-1, "用户微信信息格式不正确!");
|
|
|
// }
|
|
|
//
|
|
|
//// BindCard bindCard = pay.bindCard(patient, openid);
|
|
|
// List<BindCard> bindCard = pay.bindCardList(openid);
|
|
|
// String sicardUrl = pay.createSicard(uid, openid, createType);
|
|
|
// for (BindCard cards : bindCard) {
|
|
|
// String attachCardNo = cards.getAttachCardNo();
|
|
|
// if (StringUtil.isNotEmpty(attachCardNo) && StringUtil.isNotEmpty(ssc) && ssc.equals(attachCardNo)) {
|
|
|
// String attachRelation = cards.getAttachRelation();
|
|
|
// String attachIdType = cards.getAttachIdType();
|
|
|
// String attachIdNo = cards.getAttachIdNo();
|
|
|
// String attachName = cards.getAttachName();
|
|
|
// json.put("attachRelation", attachRelation);
|
|
|
// json.put("attachCardNo", attachCardNo);
|
|
|
// json.put("attachIdType", attachIdType);
|
|
|
// json.put("attachIdNo", attachIdNo);
|
|
|
// json.put("attachName", attachName);
|
|
|
// json.put("bindStatus", "000000");
|
|
|
// json.put("sicardUrl", sicardUrl);
|
|
|
// msg = "查询绑卡信息成功!";
|
|
|
// return write(200, msg, "data", json);
|
|
|
// } else {
|
|
|
// json.put("sicardUrl", sicardUrl);
|
|
|
// json.put("bindStatus", "030007");
|
|
|
// msg = "生成电子社保卡成功!";
|
|
|
// }
|
|
|
// }
|
|
|
// if (bindCard.size() == 0 || bindCard == null) {
|
|
|
// json.put("sicardUrl", sicardUrl);
|
|
|
// json.put("bindStatus", "030007");
|
|
|
// msg = "生成电子社保卡成功!";
|
|
|
// }
|
|
|
// return write(200, msg, "data", json);
|
|
|
// /*if (bindCard != null) {
|
|
|
// JSONObject json = new JSONObject(bindCard);
|
|
|
// json.put("bindStatus", "000000");
|
|
|
// json.put("sicardUrl", sicardUrl);
|
|
|
// return write(200, "查询绑卡信息成功!", "data", json);
|
|
|
// } else {
|
|
|
//// 返回电子社保卡链接
|
|
|
// JSONObject json = new JSONObject();
|
|
|
// json.put("sicardUrl", sicardUrl);
|
|
|
// json.put("bindStatus", "030007");
|
|
|
// return write(200, "生成电子社保卡成功!", "data", json);
|
|
|
// }*/
|
|
|
//
|
|
|
// } catch (Exception e) {
|
|
|
// error(e);
|
|
|
// return write(-1, "查询电子社保卡失败!");
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
}
|