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
2b343df4
Commit
2b343df4
authored
Sep 17, 2020
by
jscat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nyx javaapp: 功能优化
1. 解决订单页面(order.wxml) 订单重复提交问题(onPay)
parent
c4d386dd
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
65 行增加
和
16 行删除
+65
-16
增值产品-小程序及app/nyx_app_key/api/src/main/java/cn/com/fun/nyxkey/api/common/ExceptionMsg.java
+5
-3
增值产品-小程序及app/nyx_app_key/api/src/main/java/cn/com/fun/nyxkey/api/repository/Rockwell_keyMapper.java
+2
-1
增值产品-小程序及app/nyx_app_key/api/src/main/java/cn/com/fun/nyxkey/api/service/Rockwell_keyService.java
+2
-1
增值产品-小程序及app/nyx_app_key/api/src/main/java/cn/com/fun/nyxkey/api/service/impl/Rockwell_keyServiceImpl.java
+17
-1
增值产品-小程序及app/nyx_app_key/api/src/main/java/cn/com/fun/nyxkey/api/web/controller/NyxApiController.java
+23
-8
增值产品-小程序及app/nyx_app_key/api/src/main/resources/cn/com/fun/nyxkey/api/repository/Rockwell_keyMapper.xml
+11
-1
增值产品-小程序及app/nyx_app_key/api/src/main/resources/config/application.yml
+5
-1
没有找到文件。
增值产品-小程序及app/nyx_app_key/api/src/main/java/cn/com/fun/nyxkey/api/common/ExceptionMsg.java
查看文件 @
2b343df4
packa
ge
cn
.
com
.
fun
.
nyxkey
.
api
.
common
;
packa
ge
cn
.
com
.
fun
.
nyxkey
.
api
.
common
;
...
@@ -3,7 +3,7 @@ package cn.com.fun.nyxkey.api.common;
...
@@ -3,7 +3,7 @@ package cn.com.fun.nyxkey.api.common;
public
enum
ExceptionMsg
{
public
enum
ExceptionMsg
{
SUCCESS
(
"000000"
,
"操作成功"
),
SUCCESS
(
"000000"
,
"操作成功"
),
FAILED
(
"999999"
,
"操作失败"
),
FAILED
(
"999999"
,
"操作失败"
),
ParamError
(
"000001"
,
"参数错误!"
),
ParamError
(
"000001"
,
"参数
为空
错误!"
),
LoginNameOrPassWordError
(
"000100"
,
"用户名或者密码错误!"
),
LoginNameOrPassWordError
(
"000100"
,
"用户名或者密码错误!"
),
EmailUsed
(
"000101"
,
"该邮箱已被注册"
),
EmailUsed
(
"000101"
,
"该邮箱已被注册"
),
...
@@ -24,7 +24,9 @@ public enum ExceptionMsg {
...
@@ -24,7 +24,9 @@ public enum ExceptionMsg {
LimitPictureSize
(
"000401"
,
"图片大小必须小于2M"
),
LimitPictureSize
(
"000401"
,
"图片大小必须小于2M"
),
LimitPictureType
(
"000402"
,
"图片格式必须为'jpg'、'png'、'jpge'、'gif'、'bmp'"
),
LimitPictureType
(
"000402"
,
"图片格式必须为'jpg'、'png'、'jpge'、'gif'、'bmp'"
),
OSSTokenNameIsBlack
(
"000501"
,
"cardNumber或tokenName不能为空!"
),
OSSTokenNameIsBlack
(
"000501"
,
"cardNumber或tokenName不能为空!"
),
OSSServerInternalError
(
"000502"
,
"获取阿里oss token失败,服务器内部错误!"
)
OSSServerInternalError
(
"000502"
,
"获取阿里oss token失败,服务器内部错误!"
),
ResubmitError
(
"000601"
,
"重复提交错误!"
)
;
;
private
ExceptionMsg
(
String
code
,
String
msg
)
{
private
ExceptionMsg
(
String
code
,
String
msg
)
{
...
...
增值产品-小程序及app/nyx_app_key/api/src/main/java/cn/com/fun/nyxkey/api/repository/Rockwell_keyMapper.java
查看文件 @
2b343df4
packa
ge
cn
.
com
.
fun
.
nyxkey
.
api
.
repository
;
packa
ge
cn
.
com
.
fun
.
nyxkey
.
api
.
repository
;
...
@@ -54,6 +54,7 @@ public interface Rockwell_keyMapper {
...
@@ -54,6 +54,7 @@ public interface Rockwell_keyMapper {
String
genT_order_id
();
String
genT_order_id
();
void
addT_order
(
Rockwell_keyT_order
rockwell_keyT_order
);
void
addT_order
(
Rockwell_keyT_order
rockwell_keyT_order
);
void
addT_order_item
(
Rockwell_keyT_order_item
rockwell_keyT_order_item
);
void
addT_order_item
(
Rockwell_keyT_order_item
rockwell_keyT_order_item
);
List
<
Rockwell_keyT_order
>
checkOrderResubmit
(
Rockwell_keyT_orderQuery
rockwell_keyT_orderQuery
);
/* collect api */
/* collect api */
List
<
Rockwell_keyV_collect
>
getV_collect_by_page
(
Rockwell_keyT_collectQuery
rockwell_keyT_collectQuery
);
List
<
Rockwell_keyV_collect
>
getV_collect_by_page
(
Rockwell_keyT_collectQuery
rockwell_keyT_collectQuery
);
...
...
增值产品-小程序及app/nyx_app_key/api/src/main/java/cn/com/fun/nyxkey/api/service/Rockwell_keyService.java
查看文件 @
2b343df4
packa
ge
cn
.
com
.
fun
.
nyxkey
.
api
.
service
;
packa
ge
cn
.
com
.
fun
.
nyxkey
.
api
.
service
;
...
@@ -73,6 +73,7 @@ public interface Rockwell_keyService {
...
@@ -73,6 +73,7 @@ public interface Rockwell_keyService {
String
Rockwell_keyServiceGenT_order_id
();
String
Rockwell_keyServiceGenT_order_id
();
JSONResult
Rockwell_keyServiceAddT_order
(
String
orderId
,
String
activityId
,
String
userId
,
String
productImage
,
Double
totalPrice
,
int
totalCount
,
JSONResult
Rockwell_keyServiceAddT_order
(
String
orderId
,
String
activityId
,
String
userId
,
String
productImage
,
Double
totalPrice
,
int
totalCount
,
String
qrcodeUrl
,
List
<
Rockwell_keyT_product
>
listRockwell_keyT_product
);
String
qrcodeUrl
,
List
<
Rockwell_keyT_product
>
listRockwell_keyT_product
);
int
Rockwell_keyServiceCheckOrderResubmit
(
String
activityId
,
String
userId
,
int
interval
);
/*
/*
collect api 收藏api
collect api 收藏api
...
...
增值产品-小程序及app/nyx_app_key/api/src/main/java/cn/com/fun/nyxkey/api/service/impl/Rockwell_keyServiceImpl.java
查看文件 @
2b343df4
packa
ge
cn
.
com
.
fun
.
nyxkey
.
api
.
service
.
impl
;
packa
ge
cn
.
com
.
fun
.
nyxkey
.
api
.
service
.
impl
;
...
@@ -412,6 +412,22 @@ public class Rockwell_keyServiceImpl implements Rockwell_keyService {
...
@@ -412,6 +412,22 @@ public class Rockwell_keyServiceImpl implements Rockwell_keyService {
}
}
public
int
Rockwell_keyServiceCheckOrderResubmit
(
String
activityId
,
String
userId
,
int
interval
)
{
LOGGER
.
debug
(
"find Rockwell_keyServiceCheckOrderResubmit"
);
List
<
Rockwell_keyT_order
>
listRockwell_keyT_order
=
new
ArrayList
<>();
Rockwell_keyT_orderQuery
rockwell_keyT_orderQuery
=
new
Rockwell_keyT_orderQuery
();
rockwell_keyT_orderQuery
.
setUserId
(
userId
);
rockwell_keyT_orderQuery
.
setActivityId
(
activityId
);
Date
date
=
new
Date
();
date
.
setTime
(
date
.
getTime
()
-
interval
*
60
*
1000
);
rockwell_keyT_orderQuery
.
setCreateDatetime
(
date
);
listRockwell_keyT_order
=
rockwell_keyMapper
.
checkOrderResubmit
(
rockwell_keyT_orderQuery
);
return
listRockwell_keyT_order
.
size
();
}
/* activity api
/* activity api
* 通过 activityId 来获取 view_activity_detail 的详细信息
* 通过 activityId 来获取 view_activity_detail 的详细信息
...
...
增值产品-小程序及app/nyx_app_key/api/src/main/java/cn/com/fun/nyxkey/api/web/controller/NyxApiController.java
查看文件 @
2b343df4
packa
ge
cn
.
com
.
fun
.
nyxkey
.
api
.
web
.
controller
;
packa
ge
cn
.
com
.
fun
.
nyxkey
.
api
.
web
.
controller
;
package
cn
.
com
.
fun
.
nyxkey
.
api
.
web
.
controller
;
package
cn
.
com
.
fun
.
nyxkey
.
api
.
web
.
controller
;
import
cn.com.fun.nyxkey.api.common.ExceptionMsg
;
import
cn.com.fun.nyxkey.api.common.JSONResult
;
import
cn.com.fun.nyxkey.api.common.JSONResult
;
import
cn.com.fun.nyxkey.api.domain.Rockwell_keyT_match
;
import
cn.com.fun.nyxkey.api.domain.Rockwell_keyT_match
;
import
cn.com.fun.nyxkey.api.domain.Rockwell_keyT_product
;
import
cn.com.fun.nyxkey.api.domain.Rockwell_keyT_product
;
...
@@ -8,10 +9,12 @@ import cn.com.fun.nyxkey.api.service.*;
...
@@ -8,10 +9,12 @@ import cn.com.fun.nyxkey.api.service.*;
import
cn.com.fun.nyxkey.api.web.common.ResponseHelper
;
import
cn.com.fun.nyxkey.api.web.common.ResponseHelper
;
import
cn.com.fun.nyxkey.api.web.common.ResponseWrapper
;
import
cn.com.fun.nyxkey.api.web.common.ResponseWrapper
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.sun.org.apache.xpath.internal.operations.Bool
;
import
io.swagger.annotations.*
;
import
io.swagger.annotations.*
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
...
@@ -41,6 +44,10 @@ public class NyxApiController {
...
@@ -41,6 +44,10 @@ public class NyxApiController {
@Autowired
@Autowired
private
Rockwell_ossService
ossService
;
private
Rockwell_ossService
ossService
;
//AccessKeyId表示RAM子账号的AccessKeyId;
@Value
(
"${resubmit.interval}"
)
private
int
interval
;
// 1.1 获取最近10条quiz
// 1.1 获取最近10条quiz
// http://localhost:8084/api/financing/hotsearch/report?pageNum=1&pageCount=5
// http://localhost:8084/api/financing/hotsearch/report?pageNum=1&pageCount=5
@ApiOperation
(
value
=
"顺序获取quiz"
,
notes
=
"获取quiz"
)
@ApiOperation
(
value
=
"顺序获取quiz"
,
notes
=
"获取quiz"
)
...
@@ -485,13 +492,21 @@ public class NyxApiController {
...
@@ -485,13 +492,21 @@ public class NyxApiController {
int
totalCount
,
int
totalCount
,
String
orderItemString
String
orderItemString
)
{
)
{
List
<
Rockwell_keyT_product
>
listRockwell_keyT_product
=
JSON
.
parseArray
(
orderItemString
,
Rockwell_keyT_product
.
class
);
int
resubmit
=
keyService
.
Rockwell_keyServiceCheckOrderResubmit
(
activityId
,
userId
,
interval
);
//生成orderId
if
(
resubmit
!=
0
)
String
orderId
=
keyService
.
Rockwell_keyServiceGenT_order_id
();
{
//生成qrcode, 上传oss,得到qrcode_url
return
new
JSONResult
(
ExceptionMsg
.
ResubmitError
);
String
qrcodeUrl
=
ossService
.
Rockwell_ossServiceGetQrcodeUrl
(
orderId
);
}
return
keyService
.
Rockwell_keyServiceAddT_order
(
orderId
,
activityId
,
userId
,
productImage
,
totalPrice
,
totalCount
,
else
{
qrcodeUrl
,
listRockwell_keyT_product
);
List
<
Rockwell_keyT_product
>
listRockwell_keyT_product
=
JSON
.
parseArray
(
orderItemString
,
Rockwell_keyT_product
.
class
);
//生成orderId
String
orderId
=
keyService
.
Rockwell_keyServiceGenT_order_id
();
//生成qrcode, 上传oss,得到qrcode_url
String
qrcodeUrl
=
ossService
.
Rockwell_ossServiceGetQrcodeUrl
(
orderId
);
return
keyService
.
Rockwell_keyServiceAddT_order
(
orderId
,
activityId
,
userId
,
productImage
,
totalPrice
,
totalCount
,
qrcodeUrl
,
listRockwell_keyT_product
);
}
}
}
// 收藏表(tbl_collect)的相关api 获取 view_collect 的数据 by page
// 收藏表(tbl_collect)的相关api 获取 view_collect 的数据 by page
...
...
增值产品-小程序及app/nyx_app_key/api/src/main/resources/cn/com/fun/nyxkey/api/repository/Rockwell_keyMapper.xml
查看文件 @
2b343df4
<?xml
version="1.0" encoding="UTF-8"?>
<?xml
version="1.0" encoding="UTF-8"?>
...
@@ -501,6 +501,16 @@ limitations under the License.
...
@@ -501,6 +501,16 @@ limitations under the License.
</foreach>
</foreach>
</insert>
</insert>
<!-- collect api 5-5 检查是否有重复提交操作 jscat 20200917 -->
<select
id=
"checkOrderResubmit"
parameterType=
"cn.com.fun.nyxkey.api.domain.query.Rockwell_keyT_orderQuery"
resultType=
"cn.com.fun.nyxkey.api.domain.Rockwell_keyT_order"
>
select * from tbl_order
where 1=1
AND create_datetime >= #{createDatetime}
AND user_id=#{userId}
AND activity_id=#{activityId}
</select>
<!-- collect api 6-1 获取 v_collect 的值 by page; order by start_datetime asc jscat 20200826 -->
<!-- collect api 6-1 获取 v_collect 的值 by page; order by start_datetime asc jscat 20200826 -->
<select
id=
"getV_collect_by_page"
parameterType=
"cn.com.fun.nyxkey.api.domain.query.Rockwell_keyT_collectQuery"
<select
id=
"getV_collect_by_page"
parameterType=
"cn.com.fun.nyxkey.api.domain.query.Rockwell_keyT_collectQuery"
resultType=
"cn.com.fun.nyxkey.api.domain.Rockwell_keyV_collect"
>
resultType=
"cn.com.fun.nyxkey.api.domain.Rockwell_keyV_collect"
>
...
...
增值产品-小程序及app/nyx_app_key/api/src/main/resources/config/application.yml
查看文件 @
2b343df4
serve
r
:
serve
r
:
...
@@ -84,3 +84,6 @@ aliyun:
...
@@ -84,3 +84,6 @@ aliyun:
dir
:
user-dir/
dir
:
user-dir/
dirQrcode
:
qrcode-dir/
dirQrcode
:
qrcode-dir/
dirLogo
:
logo-dir/
dirLogo
:
logo-dir/
resubmit
:
interval
:
3
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论