Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
N
nyx
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
发现
nyx
Commits
4a539323
Commit
4a539323
authored
Nov 18, 2020
by
jscat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nyx javaapp: 功能更新
1. 基于app流程, 将获取prepay_id的输入参数变为userId
parent
10c6f395
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
25 行增加
和
4 行删除
+25
-4
app/nyx_app_key/api/src/main/java/cn/com/fun/nyxkey/api/service/Rockwell_userService.java
+1
-0
app/nyx_app_key/api/src/main/java/cn/com/fun/nyxkey/api/service/impl/Rockwell_userServiceImpl.java
+13
-0
app/nyx_app_key/api/src/main/java/cn/com/fun/nyxkey/api/web/controller/PayApiController.java
+11
-4
没有找到文件。
app/nyx_app_key/api/src/main/java/cn/com/fun/nyxkey/api/service/Rockwell_userService.java
查看文件 @
4a539323
...
...
@@ -19,5 +19,6 @@ public interface Rockwell_userService {
JSONResult
Rockwell_userServiceReg
(
String
userId
);
JSONResult
Rockwell_userServiceGetT_userinfo
(
String
userId
);
JSONResult
webLogin
(
Rockwell_userT_user
rockwell_userT_user
);
Rockwell_userT_user
Rockwell_userServiceGetT_user
(
String
userId
);
}
app/nyx_app_key/api/src/main/java/cn/com/fun/nyxkey/api/service/impl/Rockwell_userServiceImpl.java
查看文件 @
4a539323
...
...
@@ -263,4 +263,17 @@ public class Rockwell_userServiceImpl implements Rockwell_userService {
return
userName
;
}
/*
通过userid获取 Rockwell_userT_user
*/
public
Rockwell_userT_user
Rockwell_userServiceGetT_user
(
String
userId
)
{
Rockwell_userT_userQuery
rockwell_userT_userQuery
=
new
Rockwell_userT_userQuery
();
rockwell_userT_userQuery
.
setId
(
userId
);
Rockwell_userT_user
user
=
rockwell_userMapper
.
queryUserByid
(
rockwell_userT_userQuery
);
return
user
;
}
}
app/nyx_app_key/api/src/main/java/cn/com/fun/nyxkey/api/web/controller/PayApiController.java
查看文件 @
4a539323
...
...
@@ -7,6 +7,8 @@ package cn.com.fun.nyxkey.api.web.controller;
*/
import
cn.com.fun.nyxkey.api.common.JSONResult
;
import
cn.com.fun.nyxkey.api.domain.Rockwell_userT_user
;
import
cn.com.fun.nyxkey.api.service.Rockwell_userService
;
import
cn.com.fun.nyxkey.api.utils.PayUtil
;
import
cn.com.fun.nyxkey.api.web.common.HttpRequest
;
import
com.alibaba.fastjson.JSONObject
;
...
...
@@ -16,6 +18,7 @@ import io.swagger.annotations.ApiImplicitParams;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -58,6 +61,9 @@ public class PayApiController {
@Value
(
"${weixin.notifyUrl}"
)
public
String
notifyUrl
;
@Autowired
private
Rockwell_userService
userService
;
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
PayApiController
.
class
);
/**
...
...
@@ -76,13 +82,13 @@ public class PayApiController {
*/
@ApiOperation
(
value
=
"微信支付统一下单"
,
notes
=
"微信支付统一下单"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"
openId"
,
value
=
"openId
"
,
required
=
true
,
dataType
=
"String"
,
defaultValue
=
"1"
),
@ApiImplicitParam
(
name
=
"
userId"
,
value
=
"用户名
"
,
required
=
true
,
dataType
=
"String"
,
defaultValue
=
"1"
),
@ApiImplicitParam
(
name
=
"money"
,
value
=
"标价金额"
,
required
=
true
,
dataType
=
"String"
,
defaultValue
=
"1"
),
@ApiImplicitParam
(
name
=
"body"
,
value
=
"商品描述"
,
required
=
true
,
dataType
=
"String"
,
defaultValue
=
"1"
)
})
@RequestMapping
(
value
=
"/nyx/wx/pay/orders"
,
method
=
RequestMethod
.
GET
)
public
Map
<
String
,
Object
>
orders
(
@RequestParam
(
value
=
"
openId"
,
required
=
true
,
defaultValue
=
"1"
)
String
open
Id
,
@RequestParam
(
value
=
"
userId"
,
required
=
true
,
defaultValue
=
"1"
)
String
user
Id
,
@RequestParam
(
value
=
"money"
,
required
=
true
,
defaultValue
=
"1"
)
Double
money
,
@RequestParam
(
value
=
"body"
,
required
=
true
,
defaultValue
=
"0"
)
String
body
,
HttpServletRequest
request
...
...
@@ -115,6 +121,9 @@ public class PayApiController {
ip
=
ips
[
0
].
trim
();
}
Rockwell_userT_user
user
=
userService
.
Rockwell_userServiceGetT_user
(
userId
);
String
openId
=
user
.
getOpenid
();
paraMap
.
put
(
"appid"
,
appid
);
// 商家平台ID
paraMap
.
put
(
"body"
,
body
);
// 商家名称-销售商品类目、String(128)
paraMap
.
put
(
"mch_id"
,
mchid
);
// 商户ID
...
...
@@ -188,7 +197,6 @@ public class PayApiController {
System
.
out
.
println
(
"微信返回给回调函数的信息为:"
+
xml
);
if
(
notifyMap
.
get
(
"return_code"
).
equals
(
"SUCCESS"
)){
if
(
notifyMap
.
get
(
"result_code"
).
equals
(
"SUCCESS"
)){
String
ordersSn
=
notifyMap
.
get
(
"out_trade_no"
);
// 商户订单号
...
...
@@ -199,7 +207,6 @@ public class PayApiController {
* 以下是自己的业务处理------仅做参考 更新order对应字段/已支付金额/状态码
*/
System
.
out
.
println
(
"===notify===回调方法已经被调!!!"
);
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论