Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gdtel-gztel-school-center
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
吴学德
gdtel-gztel-school-center
Commits
f5807ce8
Commit
f5807ce8
authored
Sep 26, 2021
by
伍思炜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
宽带下单时多媒体账号与密码的填写规则修改
parent
c89a14ea
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
167 additions
and
44 deletions
+167
-44
apply-net/src/main/java/com/winsun/controller/DankuanController.java
+64
-41
apply-net/src/main/java/com/winsun/controller/RongHeController.java
+26
-3
apply-net/src/main/java/com/winsun/utils/CheckPwd.java
+77
-0
No files found.
apply-net/src/main/java/com/winsun/controller/DankuanController.java
View file @
f5807ce8
...
...
@@ -4,13 +4,13 @@ import com.alibaba.fastjson.JSONArray;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.mapper.EntityWrapper
;
import
com.baomidou.mybatisplus.mapper.Wrapper
;
import
com.winsun.utils.CheckPwd
;
import
com.winsun.auth.core.common.model.ResponseData
;
import
com.winsun.bean.*
;
import
com.winsun.constant.Constant
;
import
com.winsun.constant.OrderStatus
;
import
com.winsun.mapper.*
;
import
com.winsun.outSideSystem.IntelligenceSendOrder
;
import
com.winsun.smsUtils.StringUtil
;
import
com.winsun.utils.*
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -36,6 +36,7 @@ import javax.servlet.http.HttpServletResponse;
import
java.net.URLEncoder
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.regex.Pattern
;
/**
* 单宽办理接口
...
...
@@ -78,6 +79,7 @@ public class DankuanController {
@Autowired
private
IntelligenceSendOrder
intelligenceSendOrder
;
/**
* 查询单宽办理接口
*
...
...
@@ -99,7 +101,7 @@ public class DankuanController {
return
ResponseData
.
success
(
product
);
}
@RequestMapping
(
value
=
"/selectUniversity"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
@RequestMapping
(
value
=
"/selectUniversity"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
public
ResponseData
<
UniversityInfo
>
selectUniversity
(
@RequestParam
(
"universityId"
)
String
universityId
)
{
UniversityInfo
universityInfo
=
universityInfoMapper
.
selectById
(
universityId
);
return
ResponseData
.
success
(
universityInfo
);
...
...
@@ -111,7 +113,7 @@ public class DankuanController {
* @return
*/
@PostMapping
(
"/createProductOrder"
)
public
ResponseData
<
Object
>
createProductOrder
(
HttpServletRequest
request
,
HttpServletRequest
response
)
{
public
ResponseData
<
Object
>
createProductOrder
(
HttpServletRequest
request
,
HttpServletRequest
response
)
{
String
orderName
=
request
.
getParameter
(
"orderName"
);
String
orderPhone
=
request
.
getParameter
(
"orderPhone"
);
String
orderNumber
=
request
.
getParameter
(
"orderNumber"
);
...
...
@@ -129,27 +131,47 @@ public class DankuanController {
String
campus
=
request
.
getParameter
(
"campus"
);
if
(
sell
!=
null
&&
StringUtils
.
isNumeric
(
sell
))
{
if
(
sell
!=
null
&&
StringUtils
.
isNumeric
(
sell
))
{
}
else
{
}
else
{
sell
=
""
;
}
if
(
StringUtils
.
isNotBlank
(
orderCustomerAccount
))
{
String
orderCustomerAccounts
=
orderCustomerAccount
.
split
(
"@"
)[
0
];
if
(!
orderPhone
.
equals
(
orderCustomerAccounts
))
{
Pattern
iphoneVerification
=
Pattern
.
compile
(
"^[1][3|4|5|6|7|8|9][0-9]{9}$"
);
if
(!
iphoneVerification
.
matcher
(
orderCustomerAccounts
).
matches
())
{
return
ResponseData
.
error
(
"多媒体账号请填写为手机号"
);
}
}
}
else
{
return
ResponseData
.
error
(
"多媒体账号不能为空"
);
}
if
(
StringUtils
.
isNotBlank
(
orderCustomerPwd
))
{
if
(!
CheckPwd
.
checkPassword
(
orderCustomerPwd
))
{
return
ResponseData
.
error
(
"多媒体账号的密码必须为8~12位的数字加字母组合"
);
}
}
else
{
return
ResponseData
.
error
(
"多媒体账号的密码不能为空"
);
}
String
filePath
=
""
;
String
orderSeq
=
RandomUtil
.
RandomNumber
(
20
);
try
{
try
{
String
uuid
=
UUID
.
randomUUID
().
toString
();
boolean
boo1
=
redisLockUtil
.
redisLock
(
orderNumber
,
uuid
,
10
);
boolean
boo2
=
redisLockUtil
.
redisLock
(
orderCustomerAccount
,
uuid
,
10
);
if
(!
boo1
||
!
boo2
)
{
boolean
boo1
=
redisLockUtil
.
redisLock
(
orderNumber
,
uuid
,
10
);
boolean
boo2
=
redisLockUtil
.
redisLock
(
orderCustomerAccount
,
uuid
,
10
);
if
(!
boo1
||
!
boo2
)
{
return
ResponseData
.
error
(
"重复下单!"
);
}
if
(
StringUtils
.
isBlank
(
imgUrl
))
{
if
(
StringUtils
.
isBlank
(
imgUrl
))
{
return
ResponseData
.
error
(
"签名失败!"
);
}
if
(
StringUtils
.
isNotBlank
(
imgUrl
))
{
filePath
=
PicturesUtil
.
uploadPictures
(
imgUrl
,
orderSeq
,
"signImg"
);
if
(
StringUtils
.
isNotBlank
(
imgUrl
))
{
filePath
=
PicturesUtil
.
uploadPictures
(
imgUrl
,
orderSeq
,
"signImg"
);
}
OrderView
orderV
=
new
OrderView
();
...
...
@@ -174,8 +196,8 @@ public class DankuanController {
/**
* 广美用来判断校区
*/
if
(
StringUtils
.
isNotBlank
(
productId
)
&&
"84"
.
equals
(
productId
)){
if
(
StringUtils
.
isNotBlank
(
campus
)
&&
"1"
.
equals
(
campus
)){
if
(
StringUtils
.
isNotBlank
(
productId
)
&&
"84"
.
equals
(
productId
))
{
if
(
StringUtils
.
isNotBlank
(
campus
)
&&
"1"
.
equals
(
campus
))
{
orderView
.
setOrderRegion
(
"海珠区"
);
}
}
...
...
@@ -185,10 +207,10 @@ public class DankuanController {
}
else
{
orderView
.
setIPay
(
"1"
);
}
if
(
product
.
getProductIntroductionPic3
().
equals
(
"1"
))
{
if
(
product
.
getProductIntroductionPic3
().
equals
(
"1"
))
{
// 现金支付
orderView
.
setCustomerId
(
"xjzf"
);
// 接入商
}
else
{
}
else
{
orderView
.
setCustomerId
(
"xyzxyql"
);
// 接入商
}
if
(
StringUtils
.
isBlank
((
String
)
orderCustomerStudentId
))
{
...
...
@@ -206,13 +228,13 @@ public class DankuanController {
Integer
insert
=
orderViewMapper
.
insert
(
orderView
);
if
(
webOrderAmount
.
equals
(
"0"
)
||
product
.
getProductIntroductionPic3
().
equals
(
"1"
))
{
res
=
createOrder
(
productId
,
orderView
,
partner
,
filePath
,
"未下单"
,
sell
);
Map
<
String
,
Object
>
map
=
orderMapper
.
selectKdOrder
(
orderSeq
);
res
=
createOrder
(
productId
,
orderView
,
partner
,
filePath
,
"未下单"
,
sell
);
Map
<
String
,
Object
>
map
=
orderMapper
.
selectKdOrder
(
orderSeq
);
intelligenceSendOrder
.
singleBroadSendOrder
(
map
);
Order
order
=(
Order
)
res
.
getData
();
Order
order
=
(
Order
)
res
.
getData
();
orderV
.
setOrderRf2
(
order
.
getId
());
}
else
{
res
=
createOrder
(
productId
,
orderView
,
partner
,
filePath
,
"未支付"
,
sell
);
}
else
{
res
=
createOrder
(
productId
,
orderView
,
partner
,
filePath
,
"未支付"
,
sell
);
}
if
(!
res
.
isSuccess
())
{
return
ResponseData
.
error
(
"下单失败,请检查套餐设置!"
);
...
...
@@ -225,10 +247,10 @@ public class DankuanController {
return
ResponseData
.
success
(
orderV
,
"订单提交完成!"
);
}
return
ResponseData
.
error
(
"提交失败!"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
ResponseData
.
error
(
"下单失败,请检查套餐设置!"
);
}
finally
{
}
finally
{
redisTemplate
.
delete
(
orderNumber
);
redisTemplate
.
delete
(
orderCustomerAccount
);
}
...
...
@@ -236,14 +258,15 @@ public class DankuanController {
/**
* 0元调用 创建order
*
* @param orderView
* @param userId
* @return
* @throws Exception
*/
public
ResponseData
<
Object
>
createOrder
(
String
productId
,
OrderView
orderView
,
String
userId
,
String
filePath
,
String
orderStatus
,
String
sell
)
{
public
ResponseData
<
Object
>
createOrder
(
String
productId
,
OrderView
orderView
,
String
userId
,
String
filePath
,
String
orderStatus
,
String
sell
)
{
Order
order
=
new
Order
();
try
{
try
{
String
uuid
=
UUID
.
randomUUID
().
toString
();
String
id
=
uuid
.
split
(
"-"
)[
0
]
+
uuid
.
split
(
"-"
)[
1
];
...
...
@@ -272,24 +295,24 @@ public class DankuanController {
String
schoolId
=
appMapper
.
selectSchoolId
(
userId
);
School
school
=
schoolMapper
.
selectById
(
schoolId
);
order
.
setHehuorenSchool
(
school
.
getSchoolName
());
order
.
setHehuorenName
(
sysUser
.
getName
()
+
sell
);
order
.
setHehuorenName
(
sysUser
.
getName
()
+
sell
);
order
.
setHehuorenArea
(
school
.
getSubName
());
order
.
setSignImg
(
filePath
);
List
<
String
>
userId1
=
appMapper
.
selectsupervisorBySchool
(
schoolId
);
if
(
userId1
!=
null
&&
userId1
.
size
()
!=
0
)
{
for
(
String
data
:
userId1
)
{
try
{
for
(
String
data
:
userId1
)
{
try
{
Wrapper
<
HhrUser
>
userWrapper
=
new
EntityWrapper
<>();
userWrapper
.
eq
(
"id"
,
data
);
userWrapper
.
eq
(
"position"
,
"总经理"
);
userWrapper
.
eq
(
"id"
,
data
);
userWrapper
.
eq
(
"position"
,
"总经理"
);
List
<
HhrUser
>
hhrUsers
=
hhrUserMapper
.
selectList
(
userWrapper
);
if
(
hhrUsers
!=
null
&&
hhrUsers
.
size
()==
1
)
{
if
(
hhrUsers
!=
null
&&
hhrUsers
.
size
()
==
1
)
{
SysUser
user
=
sysUserMapper
.
selectById
(
hhrUsers
.
get
(
0
).
getId
());
order
.
setSupervisorName
(
user
.
getName
());
}
}
catch
(
Exception
e
)
{
log
.
error
(
"查询督导失败:"
+
e
.
getMessage
(),
e
);
}
catch
(
Exception
e
)
{
log
.
error
(
"查询督导失败:"
+
e
.
getMessage
(),
e
);
}
}
}
...
...
@@ -303,7 +326,7 @@ public class DankuanController {
// uiWrapper.eq("university_id", product.getUniversityId());
// Map<String, Object> schoolMap = universityInfoMapper.selectMaps(uiWrapper).get(0);
orderMapper
.
insert
(
order
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
Wrapper
<
OrderView
>
wrapper
=
new
EntityWrapper
<>();
wrapper
.
eq
(
StringUtils
.
isNotBlank
(
orderView
.
getOrderSeq
().
toString
()),
"orderSeq"
,
orderView
.
getOrderSeq
().
toString
());
...
...
@@ -480,15 +503,15 @@ public class DankuanController {
public
ResponseData
<
Object
>
toPaymentPlatformPage
(
@RequestParam
(
"orderSeq"
)
String
orderSeq
,
@RequestParam
(
"ipay"
)
String
ipay
,
@RequestParam
(
"userId"
)
String
userId
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
String
uuid
=
UUID
.
randomUUID
().
toString
();
try
{
boolean
boo1
=
redisLockUtil
.
redisLock
(
orderSeq
,
uuid
,
10
);
if
(!
boo1
)
{
boolean
boo1
=
redisLockUtil
.
redisLock
(
orderSeq
,
uuid
,
10
);
if
(!
boo1
)
{
return
ResponseData
.
error
(
"已在支付中"
);
}
String
result
=
JsoupMethodZhifu
(
orderSeq
,
ipay
,
userId
,
request
,
response
);
return
ResponseData
.
success
(
result
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
}
finally
{
redisLockUtil
.
deleteLock
(
orderSeq
);
}
return
ResponseData
.
error
(
"支付失败!若已支付请实名认证,未支付请稍后尝试支付。"
);
...
...
@@ -499,7 +522,7 @@ public class DankuanController {
* @Description:支付请求
*/
public
String
JsoupMethodZhifu
(
String
orderSeq
,
String
ipay
,
String
userId
,
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
Exception
{
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
Exception
{
log
.
info
(
"----------首先发送支付请求接口----------"
);
//查询订单信息
String
uuid
=
UUID
.
randomUUID
().
toString
();
...
...
@@ -534,14 +557,14 @@ public class DankuanController {
/**
* 测试后提交代码要恢复正式环境地址
*/
//
String MERCHANTURL = "https://dx.dianyuanjiangli.com/mobile/#/hhr/kdyToSuccessPage?kdId=" + orderSeq;
//
String MERCHANTURL = "https://dx.dianyuanjiangli.com/mobile/#/hhr/kdyToSuccessPage?kdId=" + orderSeq;
String
MERCHANTURL
=
"https://dx.dianyuanjiangli.com/mobile/#/hhr/kdyToSuccessPage/"
+
orderSeq
;
map
.
put
(
"MERCHANTURL"
,
MERCHANTURL
);
//单宽回调后端接口地址
// 正式环境
map
.
put
(
"BACKDROPURL"
,
"https://dx.dianyuanjiangli.com/app/ciop/dankuan/toSubmisOrderPreser"
);
//测试地址
//
map.put("BACKDROPURL", "http://3715zj2369.qicp.vip/ciop/dankuan/toSubmisOrderPreser");
//
map.put("BACKDROPURL", "http://3715zj2369.qicp.vip/ciop/dankuan/toSubmisOrderPreser");
String
str
=
"ORDERSEQ="
+
orderView
.
getOrderSeq
()
+
"&ORDERDATE="
+
ft
.
format
(
orderdate
)
+
"&ORDERAMOUNT="
+
orderView
.
getWebOrderAmount
()
+
"&KEY="
+
Constant
.
APPK
;
//商户标识
...
...
apply-net/src/main/java/com/winsun/controller/RongHeController.java
View file @
f5807ce8
...
...
@@ -35,6 +35,7 @@ import java.net.URLEncoder;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.regex.Pattern
;
/**
* 融合办理接口
...
...
@@ -170,6 +171,27 @@ public class RongHeController {
}
else
{
sell
=
""
;
}
if
(
StringUtils
.
isNotBlank
(
orderCustomerAccount
))
{
String
orderCustomerAccounts
=
orderCustomerAccount
.
split
(
"@"
)[
0
];
if
(!
orderPhone
.
equals
(
orderCustomerAccounts
))
{
Pattern
iphoneVerification
=
Pattern
.
compile
(
"^[1][3|4|5|6|7|8|9][0-9]{9}$"
);
if
(!
iphoneVerification
.
matcher
(
orderCustomerAccounts
).
matches
())
{
return
ResponseData
.
error
(
"多媒体账号请填写为手机号"
);
}
}
}
else
{
return
ResponseData
.
error
(
"多媒体账号不能为空"
);
}
if
(
StringUtils
.
isNotBlank
(
orderCustomerPwd
))
{
if
(!
CheckPwd
.
checkPassword
(
orderCustomerPwd
))
{
return
ResponseData
.
error
(
"多媒体账号的密码必须为8~12位的数字加字母组合"
);
}
}
else
{
return
ResponseData
.
error
(
"多媒体账号的密码不能为空"
);
}
String
imgUrl
=
request
.
getParameter
(
"imgUrl"
);
String
filePath
=
""
;
String
orderSeq
=
RandomUtil
.
RandomNumber
(
20
);
...
...
@@ -214,9 +236,10 @@ public class RongHeController {
orderView
.
setOrderUniversityName
(
product
.
getProductUniversity
());
// 学校
orderView
.
setOrderRegion
(
product
.
getProductRegion
());
// 区域
/**
* 广美用来判断校区
*/
/*
广美用来判断校区
*/
if
(
StringUtils
.
isNotBlank
(
productId
)
&&
"84"
.
equals
(
productId
)){
if
(
StringUtils
.
isNotBlank
(
campus
)
&&
"1"
.
equals
(
campus
)){
orderView
.
setOrderRegion
(
"海珠区"
);
...
...
apply-net/src/main/java/com/winsun/utils/CheckPwd.java
0 → 100644
View file @
f5807ce8
package
com
.
winsun
.
utils
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
public
class
CheckPwd
{
/**
* 验证多媒体密码
* @param new_password
* @return
*/
public
static
boolean
checkPassword
(
String
new_password
)
{
if
(
new_password
.
length
()
<
8
||
new_password
.
length
()
>
12
)
{
//密码格式错误
return
false
;
}
else
{
int
passNumber
=
0
;
Pattern
pattern1
=
Pattern
.
compile
(
"(?=.*[-._/!@#$%^*]).{8,12}"
);
Matcher
m1
=
pattern1
.
matcher
(
new_password
);
if
(
m1
.
matches
())
{
return
false
;
}
Pattern
pattern2
=
Pattern
.
compile
(
"(?=.*\\d).{8,12}"
);
Matcher
m2
=
pattern2
.
matcher
(
new_password
);
if
(
m2
.
matches
())
{
passNumber
++;
}
Pattern
pattern3
=
Pattern
.
compile
(
"(?=.*[a-z]).{8,12}"
);
Matcher
m3
=
pattern3
.
matcher
(
new_password
);
if
(
m3
.
matches
())
{
passNumber
++;
}
Pattern
pattern4
=
Pattern
.
compile
(
"(?=.*[A-Z]).{8,12}"
);
Matcher
m4
=
pattern4
.
matcher
(
new_password
);
if
(
m4
.
matches
())
{
passNumber
++;
}
if
(
passNumber
<
2
)
{
//密码格式错误
return
false
;
}
if
(!
new_password
.
matches
(
"^[0-9a-zA-Z]{8,12}$"
))
{
return
false
;
}
if
(
new_password
.
contains
(
"&"
))
{
return
false
;
}
}
return
true
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment