Commit 209d4f6f by jinxin

接口开发

parent 75787816
......@@ -82,6 +82,13 @@ public interface LicenceOrderService {
* @return
*/
Integer saveTransactionCode(Long orderId, String transactionCode, String prepayId, String wxOrderId);
/**
* 查询企业微信订单详情
*
* @param transactionId 订单编号
* @return
*/
TabHaobanLicenceOrder selectByTransactionId(String transactionId);
}
......@@ -195,4 +195,9 @@ public class LicenceOrderServiceImpl implements LicenceOrderService {
public Integer saveTransactionCode(Long orderId, String transactionCode, String prepayId, String wxOrderId) {
return tabHaobanLicenceOrderMapper.saveTransactionCode(orderId,transactionCode,prepayId,wxOrderId);
}
@Override
public TabHaobanLicenceOrder selectByTransactionId(String transactionId) {
return tabHaobanLicenceOrderMapper.selectByTransactionId(transactionId);
}
}
......@@ -156,6 +156,7 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
}
@Override
@Transactional(rollbackFor = RuntimeException.class)
public ServiceResponse<Boolean> wxCallBack(String params) {
logger.info("接收微信回调参数:{}",params);
if(StrUtil.isBlank(params)){
......@@ -166,9 +167,14 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
String orderId = object.getString("orderId");
String transactionId = object.getString("transactionId");
String timeEnd = object.getString("timeEnd");
//
return null;
TabHaobanLicenceOrder licenceOrder = licenceOrderService.selectByTransactionId(transactionId);
//更新订单状态
licenceOrderService.updateLicenceOrderType(licenceOrder.getOrderId(),1,licenceOrder.getEnterpriseId(),licenceOrder.getWxEnterpriseId(),"系统");
//保存微信订单id
licenceOrderService.saveTransactionCode(licenceOrder.getOrderId(), null,null,orderId);
//生成企业微信订单
payLicenceOrder(licenceOrder.getOrderId(),licenceOrder.getWxEnterpriseId());
return ServiceResponse.success(true);
}
@Override
......
......@@ -248,7 +248,7 @@
and delete_flag = 0
</update>
<select id="selectByTransactionId" parameterType="long" resultMap="BaseResultMap">
<select id="selectByTransactionId" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM tab_haoban_licence_order WHERE transaction_id = #{transactionId} and delete_flag=0
......
......@@ -192,7 +192,13 @@ public class LicenceOrderController {
"NATIVE");
//二维码
//通知回调的url
String url = "https://hope.demogic.com/"+"gic-thirdparty/weixin_payment_result_notice_qywx";
String host = config.getHost();
// 最后一个分隔符位置
int lastIndex = host.lastIndexOf("/");
// 倒数第二个分隔符位置
int secondLastIndex = host.lastIndexOf("/", lastIndex - 1);
String subHost = host.substring(0, secondLastIndex+1);
String url = subHost+"gic-thirdparty/weixin_payment_result_notice_qywx";
scanPayReqData.setNotify_url(url);
ScanPayResDataDTO prePaymentOrderForQYWX = pay4WXService.createPrePaymentOrderForQYWX(scanPayReqData);
logger.info("微信预支付返回信息:{}",JSON.toJSONString(prePaymentOrderForQYWX));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment