|
|
@ -3,6 +3,7 @@ package com.cweb.controller; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
|
|
|
|
import com.hfkj.channel.lakala.LaKaLaTradeService; |
|
|
|
import com.hfkj.common.exception.ErrorCode; |
|
|
|
import com.hfkj.common.exception.ErrorCode; |
|
|
|
import com.hfkj.common.exception.ErrorHelp; |
|
|
|
import com.hfkj.common.exception.ErrorHelp; |
|
|
|
import com.hfkj.common.exception.SysCode; |
|
|
|
import com.hfkj.common.exception.SysCode; |
|
|
@ -62,6 +63,15 @@ public class BsTradeOrderController { |
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
private BsPayQrCodeService payQrCodeService; |
|
|
|
private BsPayQrCodeService payQrCodeService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
private BsMerPlatformNoService platformNoService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
private BsMerPlatformTermService platformTermService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
private LaKaLaTradeService laKaLaTradeService; |
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/calculation",method = RequestMethod.GET) |
|
|
|
@RequestMapping(value="/calculation",method = RequestMethod.GET) |
|
|
|
@ResponseBody |
|
|
|
@ResponseBody |
|
|
|
@ApiOperation(value = "计算支付金额") |
|
|
|
@ApiOperation(value = "计算支付金额") |
|
|
@ -431,4 +441,53 @@ public class BsTradeOrderController { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/getLkLUnionUserId",method = RequestMethod.POST) |
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
|
|
|
|
@ApiOperation(value = "获取拉卡拉银联用户id") |
|
|
|
|
|
|
|
public ResponseData getLkLUnionUserId(@RequestBody JSONObject body) { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
if (body == null |
|
|
|
|
|
|
|
|| StringUtils.isBlank(body.getString("serialNumber")) |
|
|
|
|
|
|
|
|| StringUtils.isBlank(body.getString("userAuthCode")) |
|
|
|
|
|
|
|
|| StringUtils.isBlank(body.getString("appUpIdentifier"))) { |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.PASSWORD_ERROR, ""); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 查询二维码
|
|
|
|
|
|
|
|
BsPayQrCode qrCode = payQrCodeService.getDetailBySN(body.getString("serialNumber")); |
|
|
|
|
|
|
|
if (qrCode == null) { |
|
|
|
|
|
|
|
log.error("BsPayQrCodeController error!","未找到支付码信息"); |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到支付码信息"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (qrCode.getStoreId() == null) { |
|
|
|
|
|
|
|
log.error("BsPayQrCodeController error!","支付码未绑定门店"); |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "支付码未绑定门店"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!qrCode.getStatus().equals(PayQrCodeStatusEnum.status1.getNumber())) { |
|
|
|
|
|
|
|
log.error("BsPayQrCodeController error!","支付码已被停用"); |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "支付码已被停用"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 查询商户号
|
|
|
|
|
|
|
|
BsMerPlatformNo platformNo = platformNoService.getPlatformNo(qrCode.getMerId(), PlatformTypeEnum.type1); |
|
|
|
|
|
|
|
if (platformNo == null) { |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户号"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 查询终端号
|
|
|
|
|
|
|
|
BsMerPlatformTerm merPlatformTerm = platformTermService.getMerPlatformTerm(platformNo.getId(), "WECHAT_PAY"); |
|
|
|
|
|
|
|
if (merPlatformTerm == null) { |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户终端号"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return ResponseMsgUtil.success(laKaLaTradeService.openidQuery( |
|
|
|
|
|
|
|
platformNo.getCupNo(), |
|
|
|
|
|
|
|
merPlatformTerm.getTermNo(), |
|
|
|
|
|
|
|
body.getString("userAuthCode"), |
|
|
|
|
|
|
|
"030304", |
|
|
|
|
|
|
|
null, |
|
|
|
|
|
|
|
body.getString("appUpIdentifier") |
|
|
|
|
|
|
|
)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
log.error(e.getMessage(), e); |
|
|
|
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|