|
@ -9,14 +9,14 @@ import com.yihu.wlyy.entity.doctor.profile.Doctor;
|
|
|
import com.yihu.wlyy.entity.organization.HospitalMapping;
|
|
|
import com.yihu.wlyy.entity.patient.Patient;
|
|
|
import com.yihu.wlyy.entity.patient.SignFamily;
|
|
|
import com.yihu.wlyy.entity.ylz.PayConfigura;
|
|
|
import com.yihu.wlyy.repository.charge.ChargeDao;
|
|
|
import com.yihu.wlyy.repository.doctor.DoctorDao;
|
|
|
import com.yihu.wlyy.repository.organization.HospitalMappingDao;
|
|
|
import com.yihu.wlyy.repository.patient.PatientDao;
|
|
|
import com.yihu.wlyy.repository.patient.SignFamilyDao;
|
|
|
import com.yihu.wlyy.service.third.httplog.LogService;
|
|
|
import com.yihu.wlyy.repository.ylz.PayConfiguraDao;
|
|
|
import com.yihu.wlyy.service.third.ylz.PayLogService;
|
|
|
import com.yihu.wlyy.service.weixin.wxpay.common.Configure;
|
|
|
import com.yihu.wlyy.service.weixin.wxpay.model.BindCard;
|
|
|
import com.yihu.wlyy.service.weixin.wxpay.model.Charge;
|
|
|
import com.yihu.wlyy.util.SystemConf;
|
|
@ -25,7 +25,6 @@ import com.ylzinfo.onepay.sdk.OnepayDefaultClient;
|
|
|
import com.ylzinfo.onepay.sdk.domain.RequestParams;
|
|
|
import com.ylzinfo.onepay.sdk.domain.ResponseParams;
|
|
|
import com.ylzinfo.onepay.sdk.utils.DateUtil;
|
|
|
import io.swagger.models.auth.In;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@ -48,7 +47,7 @@ import java.util.*;
|
|
|
public class OnePayService {
|
|
|
|
|
|
@Autowired
|
|
|
private Configure config;
|
|
|
private PayConfiguraDao configuraDao;
|
|
|
|
|
|
@Autowired
|
|
|
private PayLogService logService;
|
|
@ -137,12 +136,14 @@ public class OnePayService {
|
|
|
String response = "";
|
|
|
String error = "";
|
|
|
List<BindCard> result = new ArrayList<BindCard>();
|
|
|
|
|
|
String appId = config.getOnepayAppId();
|
|
|
String appSecret = config.getOnepayAppSecret();
|
|
|
OnepayDefaultClient onepayClient = new OnepayDefaultClient(config.getOnepayApi(), appId, appSecret, signType, encryptType);
|
|
|
PayConfigura config = configuraDao.findWorkConfigura();
|
|
|
|
|
|
try {
|
|
|
String appId = config.getOnepayAppId();
|
|
|
String appSecret = config.getOnepayAppSecret();
|
|
|
OnepayDefaultClient onepayClient = new OnepayDefaultClient(config.getOnepayApi(), appId, appSecret, signType, encryptType);
|
|
|
|
|
|
|
|
|
RequestParams requestParams = new RequestParams();
|
|
|
// requestParams.setTransType();
|
|
|
// requestParams.setVersion();
|
|
@ -196,22 +197,19 @@ public class OnePayService {
|
|
|
/**
|
|
|
* 家庭医生签约支付
|
|
|
*/
|
|
|
public String charge(String orgCode, String chargeType, String chargeRelation, String totalAmount, String patient, String openid, String accessToken) throws Exception {
|
|
|
public String charge(String orgCode, String chargeType, String chargeRelation, String totalAmount, String patient, String repUid, String openid, String accessToken) throws Exception {
|
|
|
//获取机构映射
|
|
|
HospitalMapping hos = hospitalMappingDao.findByCode(orgCode);
|
|
|
if (hos == null) {
|
|
|
throw new Exception("no hospital mapping!");
|
|
|
}
|
|
|
return charge(orgCode, hos.getName(), hos.getAppId(), hos.getAppSecret(),hos.getSbCode(), chargeType, chargeRelation, totalAmount,patient, openid,accessToken);
|
|
|
// 对应机构的APPID和appsecret
|
|
|
// return charge(orgCode, hos.getName(), "54BBAF5148521AC9E053F000660AC502", "54BBAF5148531AC9E053F000660AC502",hos.getSbCode(), chargeType, chargeRelation, totalAmount,patient, openid,accessToken);
|
|
|
// return charge(orgCode, hos.getName(), "54BBAF5148521AC9E053F000660AC502", "54BBAF5148531AC9E053F000660AC502", "0380", chargeType, chargeRelation, totalAmount, patient, openid, accessToken);
|
|
|
return charge(orgCode, hos.getName(), hos.getAppId(), hos.getAppSecret(), hos.getSbCode(), chargeType, chargeRelation, totalAmount, patient, repUid, openid, accessToken);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 家庭医生签约支付,成功则返回支付路径
|
|
|
*/
|
|
|
private String charge(String orgCode, String orgName, String appId, String appSecret, String sbCode, String chargeType, String chargeRelation, String totalAmount, String patient, String openid, String accessToken) throws Exception {
|
|
|
private String charge(String orgCode, String orgName, String appId, String appSecret, String sbCode, String chargeType, String chargeRelation, String totalAmount, String patient, String repUid, String openid, String accessToken) throws Exception {
|
|
|
Boolean isSuccess = true;
|
|
|
String msgBody = "";
|
|
|
String response = "";
|
|
@ -219,20 +217,22 @@ public class OnePayService {
|
|
|
String result = "";
|
|
|
String channel = "WX_MMP"; // 医保支付渠道
|
|
|
String subject = "家庭医生签约支付"; // 订单名称
|
|
|
|
|
|
OnepayDefaultClient onepayClient = new OnepayDefaultClient(config.getOnepayApi(), appId, appSecret, signType, encryptType);
|
|
|
// 未真正完成支付以前预存储支付信息到wlyy_charge表
|
|
|
WlyyCharge charge = new WlyyCharge();
|
|
|
String uuid = UUID.randomUUID().toString().replaceAll("-", "");
|
|
|
|
|
|
charge.setChargeType(chargeType); //交易类型
|
|
|
charge.setChargeRelation(chargeRelation); //交易关联代码 wlyy_sign_family字段code
|
|
|
charge.setCode(uuid); // 接入应用支付业务流水号
|
|
|
Date now = new Date();
|
|
|
charge.setCreateTime(now);
|
|
|
charge.setPatient(patient); // 用户
|
|
|
charge.setOpenid(openid); // 用戶微信openid
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
|
PayConfigura config = configuraDao.findWorkConfigura();
|
|
|
|
|
|
try {
|
|
|
OnepayDefaultClient onepayClient = new OnepayDefaultClient(config.getOnepayApi(), appId, appSecret, signType, encryptType);
|
|
|
String uuid = format.format(new Date()) + UUID.randomUUID().toString().replaceAll("-", "").substring(0, 4);
|
|
|
|
|
|
charge.setChargeType(chargeType); //交易类型
|
|
|
charge.setChargeRelation(chargeRelation); //交易关联代码 wlyy_sign_family字段code
|
|
|
charge.setCode(uuid); // 接入应用支付业务流水号
|
|
|
Date now = new Date();
|
|
|
charge.setCreateTime(now);
|
|
|
charge.setPatient(patient); // 用户
|
|
|
charge.setOpenid(openid); // 用戶微信openid
|
|
|
|
|
|
charge.setHospital(orgCode);
|
|
|
charge.setHospitalName(orgName);
|
|
|
charge.setChannel(channel);
|
|
@ -250,8 +250,7 @@ public class OnePayService {
|
|
|
charge.setIdNo(idNo);
|
|
|
charge.setSsc(ssc);
|
|
|
|
|
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
|
String currentDateTime = formatter.format(now);
|
|
|
String currentDateTime = format.format(now);
|
|
|
RequestParams requestParams = new RequestParams();
|
|
|
// requestParams.setVersion();
|
|
|
// requestParams.setSign();
|
|
@ -284,9 +283,6 @@ public class OnePayService {
|
|
|
params.put("subject", subject); //订单名称
|
|
|
params.put("wxToken", accessToken);
|
|
|
|
|
|
|
|
|
//extendParams 扩展入参
|
|
|
//家庭医生签约信息
|
|
|
// 根据签约code查询签约信息
|
|
|
SignFamily signFamily = signFamilyDao.findByCode(chargeRelation);
|
|
|
if (signFamily != null) {
|
|
@ -296,37 +292,44 @@ public class OnePayService {
|
|
|
|
|
|
Doctor doctor = doctorDao.findByCode(signDoctorCode);
|
|
|
Patient user = patientDao.findByCode(people);
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
|
|
|
|
Map<String, String> familyContent = new HashMap<>();
|
|
|
// familyContent.put("moRegNo", chargeRelation);//医院签约号限长20 signFamily code
|
|
|
String moregNo = sdf.format(new Date())+ uuid.substring(0,6);
|
|
|
String moregNo = format.format(new Date()) + uuid.substring(0, 6);
|
|
|
familyContent.put("moRegNo", moregNo);//医院签约号限长20 signFamily code
|
|
|
familyContent.put("moRegName",signFamily.getName()); //签约人姓名
|
|
|
// familyContent.put("moRegName", "沈在鑫"); //签约人姓名
|
|
|
familyContent.put("moRegName", signFamily.getName()); //签约人姓名
|
|
|
familyContent.put("moRegAddr", user.getAddress()); //签约人地址
|
|
|
familyContent.put("moRegTelephone", signFamily.getMobile());//签约人联系电话
|
|
|
familyContent.put("moRegOrgNo", sbCode); //签约机构 限长4
|
|
|
familyContent.put("moRegDocNo", doctor.getIdcard());//签约医生编号 限长18 身份证号
|
|
|
familyContent.put("moRegDocName", signFamily.getSignDoctorName()); //签约医生姓名
|
|
|
familyContent.put("moRegTime", sdf.format(signFamily.getBegin())); //签约时间
|
|
|
familyContent.put("moRegEndTime", sdf.format(signFamily.getEnd())); //签约截止时间
|
|
|
// familyContent.put("moRegYear", "04");//签约年度
|
|
|
familyContent.put("moRegTime", format.format(signFamily.getBegin())); //签约时间
|
|
|
familyContent.put("moRegEndTime", format.format(signFamily.getEnd())); //签约截止时间
|
|
|
familyContent.put("moRegTear", signFamily.getSignYear());//签约年度
|
|
|
familyContent.put("moRegSource", signFamily.getSignSource()); //签约来源
|
|
|
familyContent.put("moCollectOrgNo", sbCode); //扣费机构 签约机构
|
|
|
familyContent.put("moCollectorNo", signFamily.getSignDoctorName());//扣费人 签约医生姓名
|
|
|
familyContent.put("benefitType", signFamily.getExpensesType()); //补贴类型
|
|
|
// familyContent.put("benefitType", "01"); //补贴类型
|
|
|
familyContent.put("moBookOrgNo", sbCode);//登记机构 签约机构
|
|
|
familyContent.put("moBookerNo", signFamily.getSignDoctorName()); //登记人 签约医生姓名
|
|
|
familyContent.put("moBookTime", sdf.format(signFamily.getBegin())); //登记时间 签约时间
|
|
|
familyContent.put("moBookTime", format.format(signFamily.getBegin())); //登记时间 签约时间
|
|
|
params.put("familyContent", objectMapper.writeValueAsString(familyContent));// 家庭医生签约信息
|
|
|
}
|
|
|
//请求结构体
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
map.put("feeType", "04");//家庭医生签约
|
|
|
map.put("settleType", "03"); //健康账户支付
|
|
|
//易联众新增字段v1.3.7
|
|
|
map.put("principalCardNo", ssc); //实际签约卡号( 默认为绑卡主体卡号)
|
|
|
charge.setPrincipalSsc(ssc);
|
|
|
if (!patient.equals(repUid)) {
|
|
|
Patient people = patientDao.findByCode(repUid);
|
|
|
String repOpenId = people.getOpenid();
|
|
|
BindCard repCard = ownerCard(repOpenId);
|
|
|
String repSsc = repCard.getAttachCardNo();
|
|
|
map.put("principalCardNo", repSsc); //实际签约卡号( 默认为绑卡主体卡号)
|
|
|
charge.setPrincipalSsc(repSsc);
|
|
|
}
|
|
|
|
|
|
params.put("requestContent", objectMapper.writeValueAsString(map));// 请求结构体
|
|
|
requestParams.setParam(params);
|
|
|
msgBody = JSON.toJSONString(requestParams);
|
|
@ -356,7 +359,6 @@ public class OnePayService {
|
|
|
chargeDao.save(charge);
|
|
|
|
|
|
//保存http日志
|
|
|
// logService.saveHttpLog(isSuccess, config.getChargeType(), "家庭医生签约支付", "POST", null, msgBody, response, error, logService.onepayType);
|
|
|
logService.saveHttpLog(isSuccess, config.getChargeType(), "家庭医生签约支付", "POST", null, msgBody, response, error, logService.onepayType);
|
|
|
|
|
|
if (!isSuccess) {
|
|
@ -375,19 +377,19 @@ public class OnePayService {
|
|
|
String response = "";
|
|
|
String error = "";
|
|
|
String result = null;
|
|
|
PayConfigura config = configuraDao.findWorkConfigura();
|
|
|
|
|
|
WlyyCharge charge = chargeDao.findByCode(code);
|
|
|
HospitalMapping hospitalMapping = hospitalMappingDao.findByCode(charge.getHospital());
|
|
|
OnepayDefaultClient onepayClient = new OnepayDefaultClient(config.getOnepayApi(), hospitalMapping.getAppId(), hospitalMapping.getAppSecret(), signType, encryptType);
|
|
|
// OnepayDefaultClient onepayClient = new OnepayDefaultClient(config.getOnepayApi(), "54BBAF5148521AC9E053F000660AC501", "54BBAF5148531AC9E053F000660AC501", signType, encryptType);
|
|
|
try {
|
|
|
WlyyCharge charge = chargeDao.findByCode(code);
|
|
|
HospitalMapping hospitalMapping = hospitalMappingDao.findByCode(charge.getHospital());
|
|
|
OnepayDefaultClient onepayClient = new OnepayDefaultClient(config.getOnepayApi(), hospitalMapping.getAppId(), hospitalMapping.getAppSecret(), signType, encryptType);
|
|
|
|
|
|
RequestParams requestParams = new RequestParams();
|
|
|
// requestParams.setVersion();
|
|
|
// requestParams.setSign();
|
|
|
// requestParams.setEncryptData();
|
|
|
// requestParams.setAppId(appId);
|
|
|
requestParams.setAppId(hospitalMapping.getAppId());
|
|
|
// requestParams.setAppId("54BBAF5148521AC9E053F000660AC501");
|
|
|
requestParams.setTimestamp(DateUtil.getCurrentDateTime());
|
|
|
requestParams.setSignType(signType);
|
|
|
requestParams.setEncryptType(encryptType);
|
|
@ -410,10 +412,132 @@ public class OnePayService {
|
|
|
|
|
|
// result = JSON.toJavaObject(res.getParam(), Charge.class);
|
|
|
result = JSON.toJSONString(res.getParam());
|
|
|
// 返回医保机构体
|
|
|
// 新增保存数据
|
|
|
JSONObject request = JSON.parseObject(result);
|
|
|
|
|
|
String chargeStatus = request.getString("chargeStatus");//交易状态
|
|
|
String chargeNo = request.getString("chargeNo");//支付平台流水号
|
|
|
String chargeTime = request.getString("chargeTime");//支付平台交易成功时间
|
|
|
String outChargeNo = request.getString("outChargeNo");//接入应用业务流水号
|
|
|
String outChargeTime = request.getString("outChargeTime");//接入应用时间
|
|
|
String medOrgNo = request.getString("medOrgNo");//医疗机构编号
|
|
|
String medOrgName = request.getString("medOrgName");//医疗机构名称
|
|
|
String billNo = request.getString("billNo");//待结算费用单据号
|
|
|
String cardNo = request.getString("cardNo");//医保卡号
|
|
|
String totalAmount = request.getString("totalAmount");//交易总金额
|
|
|
String insuranceAmount = request.getString("insuranceAmount");//医保支付金额
|
|
|
String selfPayAmount = request.getString("selfPayAmount");//自付金额
|
|
|
String userId = request.getString("userId");//用户openID
|
|
|
String userName = request.getString("userName");//用户名字
|
|
|
String idType = request.getString("idType");//证件类型
|
|
|
String idNo = request.getString("idNo");//证件号码
|
|
|
|
|
|
// String appId = request.getString("appId");
|
|
|
// String channel = request.getString("channel");//支付方式
|
|
|
// String sign = request.getString("sign");
|
|
|
// String signType = request.getString("signType");
|
|
|
// String timestamp = request.getString("timestamp");
|
|
|
|
|
|
|
|
|
WlyyCharge chargePay = chargeDao.findByCode(outChargeNo);
|
|
|
if (request.containsKey("responseContent")){
|
|
|
JSONObject responseContents = request.getJSONObject("responseContent");//医保结构体
|
|
|
if (responseContents != null) {
|
|
|
String miRegisterNo = null;//医保挂号
|
|
|
String miCollectDate = null;//收费日期
|
|
|
String miCollectTime = null;//收费时间
|
|
|
String miSettleNo = null;//医保收费单据号 (医保签约号)
|
|
|
String miCollectStatus = null;//扣费状态
|
|
|
String miRegisterStatus = null;//登记状态
|
|
|
String cadresPay = "0";//公务员补助
|
|
|
String miTotalFee = "0";//本次报销总额
|
|
|
String healthCarePay = "0";//保健基金支付
|
|
|
String heathPay = "0";//健康账户支付
|
|
|
String accountPay = "0";//个人账户支付
|
|
|
String selfPay = "0";//个人现金支付
|
|
|
String civilPay = "0";//民政补助金额
|
|
|
|
|
|
if (responseContents.containsKey(miRegisterNo)) {
|
|
|
miRegisterNo = responseContents.getString("miRegisterNo");
|
|
|
}
|
|
|
if (responseContents.containsKey(miCollectDate)) {
|
|
|
miCollectDate = responseContents.getString("miCollectDate");
|
|
|
}
|
|
|
if (responseContents.containsKey(miCollectTime)) {
|
|
|
miCollectTime = responseContents.getString("miCollectTime");
|
|
|
}
|
|
|
if (responseContents.containsKey(miSettleNo)) {
|
|
|
miSettleNo = responseContents.getString("miSettleNo");
|
|
|
}
|
|
|
if (responseContents.containsKey(miCollectStatus)) {
|
|
|
miCollectStatus = responseContents.getString("miCollectStatus");
|
|
|
}
|
|
|
if (responseContents.containsKey(miRegisterStatus)) {
|
|
|
miRegisterStatus = responseContents.getString("miRegisterStatus");
|
|
|
}
|
|
|
if (responseContents.containsKey(cadresPay)) {
|
|
|
cadresPay = responseContents.getString("cadresPay");
|
|
|
}
|
|
|
if (responseContents.containsKey(miTotalFee)) {
|
|
|
miTotalFee = responseContents.getString("miTotalFee");
|
|
|
}
|
|
|
if (responseContents.containsKey(healthCarePay)) {
|
|
|
healthCarePay = responseContents.getString("healthCarePay");
|
|
|
}
|
|
|
if (responseContents.containsKey(heathPay)) {
|
|
|
heathPay = responseContents.getString("heathPay");
|
|
|
}
|
|
|
if (responseContents.containsKey(accountPay)) {
|
|
|
accountPay = responseContents.getString("accountPay");
|
|
|
}
|
|
|
if (responseContents.containsKey(selfPay)) {
|
|
|
selfPay = responseContents.getString("selfPay");
|
|
|
}
|
|
|
if (responseContents.containsKey(civilPay)) {
|
|
|
civilPay = responseContents.getString("civilPay");
|
|
|
}
|
|
|
|
|
|
chargePay.setMiRegisterNo(miRegisterNo);//医保挂号
|
|
|
chargePay.setMiCollectDate(miCollectDate);
|
|
|
chargePay.setMiCollectTime(miCollectTime);
|
|
|
chargePay.setMiSettleNo(miSettleNo);
|
|
|
chargePay.setMiCollectStatus(miCollectStatus);
|
|
|
chargePay.setMiRegisterStatus(miRegisterStatus);
|
|
|
chargePay.setCadresPay(cadresPay);
|
|
|
chargePay.setMiTotalFee(miTotalFee);
|
|
|
chargePay.setHealthCarePay(healthCarePay);
|
|
|
chargePay.setHeathPay(heathPay);
|
|
|
chargePay.setAccountPay(accountPay);
|
|
|
chargePay.setSelfPay(selfPay);
|
|
|
chargePay.setCivilPay(civilPay);
|
|
|
}
|
|
|
|
|
|
|
|
|
// System.out.println("请求成功,返回参数:" + result.getTradeStatus() + " " + result.getUserName());
|
|
|
LOGGER.info("请求成功,返回参数: "+result);
|
|
|
}
|
|
|
if ("0".equals(chargeStatus) || "SUCCESS".equals(chargeStatus)) {
|
|
|
chargePay.setTradeStatus("1");//交易状态 成功1 失败0
|
|
|
} else {
|
|
|
chargePay.setTradeStatus("0");//交易状态 成功1 失败0
|
|
|
}
|
|
|
chargePay.setChargeNo(chargeNo);//支付流水号
|
|
|
SimpleDateFormat formatDate = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
|
chargePay.setChargeTime(chargeTime);//支付平台交易成功时间
|
|
|
chargePay.setCreateTime(formatDate.parse(outChargeTime));//接入应用内业务时间
|
|
|
chargePay.setMedOrgNo(medOrgNo);//医疗机构编号
|
|
|
chargePay.setMedOrgName(medOrgName);//医疗机构名称
|
|
|
chargePay.setBillNo(billNo);//待结算费用单据号
|
|
|
chargePay.setSsc(cardNo);//医保卡号
|
|
|
chargePay.setTotalAmount(Integer.parseInt(totalAmount));//交易总金额
|
|
|
chargePay.setInsuranceAmount(Integer.parseInt(insuranceAmount));//医保支付金额
|
|
|
chargePay.setSelfpayAmount(Integer.parseInt(selfPayAmount));//自付金额
|
|
|
chargePay.setOpenid(userId);
|
|
|
chargePay.setName(userName);
|
|
|
chargePay.setIdType(idType);//证件类型
|
|
|
chargePay.setIdNo(idNo);//证件号码
|
|
|
|
|
|
// 保存数据库更改记录
|
|
|
chargeDao.save(chargePay);
|
|
|
LOGGER.info("请求成功,返回参数: " + result);
|
|
|
} else {
|
|
|
isSuccess = false;
|
|
|
error = "请求失败,返回结果:" + res.getRespCode() + "," + res.getRespMsg();
|
|
@ -439,18 +563,22 @@ public class OnePayService {
|
|
|
/**
|
|
|
* 生成电子社保卡
|
|
|
*/
|
|
|
public String createSicard(String patient, String openid) throws Exception {
|
|
|
public String createSicard(String patient, String openid, String createType) throws Exception {
|
|
|
Boolean isSuccess = true;
|
|
|
String msgBody = "";
|
|
|
String response = "";
|
|
|
String error = "";
|
|
|
String result = "";
|
|
|
|
|
|
String appId = config.getOnepayAppId();
|
|
|
String appSecret = config.getOnepayAppSecret();
|
|
|
OnepayDefaultClient onepayClient = new OnepayDefaultClient(config.getOnepayApi(), appId, appSecret, signType, encryptType);
|
|
|
PayConfigura config = null;
|
|
|
|
|
|
try {
|
|
|
config = configuraDao.findWorkConfigura();
|
|
|
|
|
|
String appId = config.getOnepayAppId();
|
|
|
String appSecret = config.getOnepayAppSecret();
|
|
|
OnepayDefaultClient onepayClient = new OnepayDefaultClient(config.getOnepayApi(), appId, appSecret, signType, encryptType);
|
|
|
|
|
|
|
|
|
RequestParams requestParams = new RequestParams();
|
|
|
requestParams.setAppId(appId);
|
|
|
requestParams.setTimestamp(DateUtil.getCurrentDateTime());
|
|
@ -463,6 +591,8 @@ public class OnePayService {
|
|
|
JSONObject params = new JSONObject();
|
|
|
params.put("openId", openid);
|
|
|
params.put("accId", accId); //微信公众号开发者ID
|
|
|
// 易联众新增字段代支付v1.3.7
|
|
|
params.put("createType", createType); //生成类型 sicard 个人电子社保卡 OR family 家庭成员绑卡 ( 默认 sicard)
|
|
|
requestParams.setParam(params);
|
|
|
requestParams.setTransType(config.getCreateSicardType());
|
|
|
|
|
@ -558,15 +688,12 @@ public class OnePayService {
|
|
|
/**
|
|
|
* 更改数据 wlyy_sign_family wlyy_charge
|
|
|
*/
|
|
|
public void updateData(String chargeCode, String chargeNo, String chargeTime, String totalAmount, String insuranceAmount, String selfPayAmount, String billNo, String miRegisterNo) throws Exception {
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
|
Date chargeSuccess = sdf.parse(chargeTime);
|
|
|
Date updateTime = new Date();
|
|
|
chargeDao.updateByChargeCode(chargeCode, chargeTime, updateTime, Integer.parseInt(totalAmount), Integer.parseInt(insuranceAmount), Integer.parseInt(selfPayAmount),
|
|
|
billNo, miRegisterNo, "0");
|
|
|
// 根据wlyy_charge的code 去查找关联代码signCode在更新签约表
|
|
|
WlyyCharge charge = chargeDao.findByCode(chargeCode);
|
|
|
signFamilyDao.updatePatientBegin(charge.getChargeRelation(), chargeSuccess, chargeNo, "1",2);
|
|
|
public void updateData(String chargeStatus, Date chargeTime, String chargeNo, WlyyCharge charge) throws Exception {
|
|
|
chargeDao.save(charge);
|
|
|
// 成功支付根据wlyy_charge的code 去查找关联代码signCode在更新签约表
|
|
|
if ("0".equals(chargeStatus)) {
|
|
|
signFamilyDao.updatePatientBegin(charge.getChargeRelation(), chargeTime, chargeNo, "1", 2);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|