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
8999317d
Commit
8999317d
authored
Mar 17, 2020
by
弓厶
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
93581591
91d354be
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
100 additions
and
84 deletions
+100
-84
new-user/src/main/java/com/winsun/controller/PackageNewClothes.java
+100
-84
No files found.
new-user/src/main/java/com/winsun/controller/PackageNewClothes.java
View file @
8999317d
...
@@ -17,6 +17,7 @@ import com.winsun.utils.FileUtil;
...
@@ -17,6 +17,7 @@ import com.winsun.utils.FileUtil;
import
com.winsun.utils.PicturesUtil
;
import
com.winsun.utils.PicturesUtil
;
import
com.winsun.utils.XbkUtil
;
import
com.winsun.utils.XbkUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
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
;
...
@@ -98,6 +99,9 @@ public class PackageNewClothes {
...
@@ -98,6 +99,9 @@ public class PackageNewClothes {
log
.
info
(
"JT0001获取手机号码接口异常"
,
e
.
getMessage
());
log
.
info
(
"JT0001获取手机号码接口异常"
,
e
.
getMessage
());
ResponseData
.
error
(
"手机号码获取失败,请重新获取。"
);
ResponseData
.
error
(
"手机号码获取失败,请重新获取。"
);
}
}
if
(!
"0"
.
equals
(
jsonObject
.
getString
(
"code"
)))
{
return
ResponseData
.
error
(
jsonObject
.
getString
(
"msg"
));
}
return
ResponseData
.
success
(
jsonObject
);
return
ResponseData
.
success
(
jsonObject
);
}
}
...
@@ -144,32 +148,20 @@ public class PackageNewClothes {
...
@@ -144,32 +148,20 @@ public class PackageNewClothes {
return
ResponseData
.
error
(
"联系号码有误,请重新输入"
);
return
ResponseData
.
error
(
"联系号码有误,请重新输入"
);
}
}
/**
/**
*
身份证
验证
*
套餐
验证
*/
*/
JSONObject
jsonObject
=
null
;
ResponseData
<
String
>
pac
=
packageVerification
(
partner
,
cardId
);
try
{
if
(!
pac
.
isSuccess
()){
jsonObject
=
XbkUtil
.
idCardCheckJT0005
(
idCard
,
customerName
);
return
pac
;
}
catch
(
Exception
e
)
{
log
.
info
(
"身份证验证接口调用异常"
,
e
.
getMessage
());
}
if
(
jsonObject
==
null
)
{
return
ResponseData
.
error
(
"身份证验证失败。"
);
}
if
(!
"0"
.
equals
(
jsonObject
.
getString
(
"code"
)))
{
return
ResponseData
.
error
(
jsonObject
.
getString
(
"msg"
));
}
Integer
i
=
Integer
.
parseInt
(
idCard
.
substring
(
6
,
10
));
DateFormat
dateFormat
=
new
SimpleDateFormat
(
"yyyyMMdd"
);
Date
timeDate
=
new
Date
();
Integer
age
=
Integer
.
parseInt
(
dateFormat
.
format
(
timeDate
.
getTime
()));
Integer
time16
=
Integer
.
parseInt
(
String
.
valueOf
(
i
+
16
)
+
idCard
.
substring
(
10
,
14
));
Integer
time25
=
Integer
.
parseInt
(
String
.
valueOf
(
i
+
25
)
+
idCard
.
substring
(
10
,
14
));
if
(
age
<
time16
)
{
return
ResponseData
.
error
(
"根据工信部要求,未满16周岁的用户,应由法定代理人代为办理线上入网,如有疑问请联系客服,谢谢。"
);
}
}
if
(
age
>
time25
)
{
/**
return
ResponseData
.
error
(
"您已满25周岁,不符合办理条件,如有疑问请联系客服,谢谢。"
);
* 身份证验证
*/
ResponseData
<
String
>
res
=
idCardVerification
(
idCard
,
customerName
);
if
(!
res
.
isSuccess
()){
return
res
;
}
}
Calendar
instance
=
Calendar
.
getInstance
();
Calendar
instance
=
Calendar
.
getInstance
();
instance
.
add
(
Calendar
.
DATE
,
-
94
);
instance
.
add
(
Calendar
.
DATE
,
-
94
);
Date
time
=
instance
.
getTime
();
Date
time
=
instance
.
getTime
();
...
@@ -258,32 +250,18 @@ public class PackageNewClothes {
...
@@ -258,32 +250,18 @@ public class PackageNewClothes {
return
ResponseData
.
error
(
"联系号码有误,请重新输入"
);
return
ResponseData
.
error
(
"联系号码有误,请重新输入"
);
}
}
/**
/**
*
身份证
验证
*
套餐
验证
*/
*/
JSONObject
jsonObject1
=
null
;
ResponseData
<
String
>
pac
=
packageVerification
(
partner
,
cardId
);
try
{
if
(!
pac
.
isSuccess
()){
jsonObject1
=
XbkUtil
.
idCardCheckJT0005
(
idCard
,
customerName
);
return
pac
;
}
catch
(
Exception
e
)
{
log
.
info
(
"身份证验证接口调用异常"
,
e
.
getMessage
());
}
if
(
jsonObject1
==
null
)
{
log
.
info
(
"身份证验证接口调用异常"
);
return
ResponseData
.
error
(
"身份证验证失败。"
);
}
if
(!
"0"
.
equals
(
jsonObject1
.
getString
(
"code"
)))
{
return
ResponseData
.
error
(
jsonObject1
.
getString
(
"msg"
));
}
Integer
i
=
Integer
.
parseInt
(
idCard
.
substring
(
6
,
10
));
DateFormat
dateFormat
=
new
SimpleDateFormat
(
"yyyyMMdd"
);
Date
timeDate
=
new
Date
();
Integer
age
=
Integer
.
parseInt
(
dateFormat
.
format
(
timeDate
.
getTime
()));
Integer
time16
=
Integer
.
parseInt
(
String
.
valueOf
(
i
+
16
)
+
idCard
.
substring
(
10
,
14
));
Integer
time25
=
Integer
.
parseInt
(
String
.
valueOf
(
i
+
25
)
+
idCard
.
substring
(
10
,
14
));
if
(
age
<
time16
)
{
return
ResponseData
.
error
(
"根据工信部要求,未满16周岁的用户,应由法定代理人代为办理线上入网,如有疑问请联系客服,谢谢。"
);
}
}
if
(
age
>
time25
)
{
/**
return
ResponseData
.
error
(
"您已满25周岁,不符合办理条件,如有疑问请联系客服,谢谢。"
);
* 身份证验证
*/
ResponseData
<
String
>
res
=
idCardVerification
(
idCard
,
customerName
);
if
(!
res
.
isSuccess
()){
return
res
;
}
}
Calendar
instance
=
Calendar
.
getInstance
();
Calendar
instance
=
Calendar
.
getInstance
();
instance
.
add
(
Calendar
.
DATE
,
-
94
);
instance
.
add
(
Calendar
.
DATE
,
-
94
);
...
@@ -359,8 +337,8 @@ public class PackageNewClothes {
...
@@ -359,8 +337,8 @@ public class PackageNewClothes {
* @return
* @return
*/
*/
@RequestMapping
(
value
=
"XiaoBaiCard"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"XiaoBaiCard"
,
method
=
RequestMethod
.
POST
)
public
ResponseData
<
String
>
XiaoBaiCard
(
@RequestParam
(
"contactNumber"
)
String
contactNumber
,
@RequestParam
(
"site"
)
String
site
public
ResponseData
<
String
>
XiaoBaiCard
(
@RequestParam
(
"contactNumber"
)
String
contactNumber
,
@RequestParam
(
value
=
"site"
,
required
=
false
)
String
site
,
@RequestParam
(
"studentCard"
)
String
studentCard
,
@RequestParam
(
"cardId"
)
String
cardId
,
@RequestParam
(
"addRess"
)
String
addRess
,
@RequestParam
(
"studentCard"
)
String
studentCard
,
@RequestParam
(
"cardId"
)
String
cardId
,
@RequestParam
(
value
=
"addRess"
,
required
=
false
)
String
addRess
,
@RequestParam
(
"customerName"
)
String
customerName
,
@RequestParam
(
"partner"
)
String
partner
,
@RequestParam
(
"businessNumber"
)
String
businessNumber
,
@RequestParam
(
"customerName"
)
String
customerName
,
@RequestParam
(
"partner"
)
String
partner
,
@RequestParam
(
"businessNumber"
)
String
businessNumber
,
@RequestParam
(
value
=
"remarks"
,
required
=
false
)
String
remarks
,
@RequestParam
(
value
=
"kapin"
)
String
kapin
,
@RequestParam
(
value
=
"remarks"
,
required
=
false
)
String
remarks
,
@RequestParam
(
value
=
"kapin"
)
String
kapin
,
@RequestParam
(
value
=
"idCard"
)
String
idCard
,
@RequestParam
(
value
=
"userSchool"
)
String
userSchool
)
{
,
@RequestParam
(
value
=
"idCard"
)
String
idCard
,
@RequestParam
(
value
=
"userSchool"
)
String
userSchool
)
{
...
@@ -373,6 +351,20 @@ public class PackageNewClothes {
...
@@ -373,6 +351,20 @@ public class PackageNewClothes {
Package
aPackage
=
packageMapper
.
selectById
(
cardId
);
Package
aPackage
=
packageMapper
.
selectById
(
cardId
);
String
xbId
=
aPackage
.
getXbId
();
String
xbId
=
aPackage
.
getXbId
();
/**
/**
* 套餐验证
*/
ResponseData
<
String
>
pac
=
packageVerification
(
partner
,
cardId
);
if
(!
pac
.
isSuccess
()){
return
pac
;
}
/**
* 身份证验证
*/
ResponseData
<
String
>
res
=
idCardVerification
(
idCard
,
customerName
);
if
(!
res
.
isSuccess
()){
return
res
;
}
/**
* 小白卡下单
* 小白卡下单
*/
*/
JSONObject
jsonObject
=
null
;
JSONObject
jsonObject
=
null
;
...
@@ -389,37 +381,6 @@ public class PackageNewClothes {
...
@@ -389,37 +381,6 @@ public class PackageNewClothes {
return
ResponseData
.
error
(
"小白卡下单失败,如有疑问请联系客服,谢谢。"
);
return
ResponseData
.
error
(
"小白卡下单失败,如有疑问请联系客服,谢谢。"
);
}
}
Map
map
=
JSON
.
parseObject
(
jsonObject
.
getString
(
"dataArray"
),
HashMap
.
class
);
Map
map
=
JSON
.
parseObject
(
jsonObject
.
getString
(
"dataArray"
),
HashMap
.
class
);
/**
* 身份证验证
*/
JSONObject
jsonObject1
=
null
;
try
{
jsonObject1
=
XbkUtil
.
idCardCheckJT0005
(
idCard
,
customerName
);
}
catch
(
Exception
e
)
{
log
.
info
(
"身份证验证接口调用异常"
,
e
.
getMessage
());
}
if
(
jsonObject1
==
null
)
{
log
.
info
(
"身份证验证接口调用异常"
);
return
ResponseData
.
error
(
"身份证验证失败。"
);
}
if
(
"1"
.
equals
(
jsonObject1
.
getString
(
"code"
)))
{
return
ResponseData
.
error
(
"姓名和身份证信息不匹配。"
);
}
if
(!
"0"
.
equals
(
jsonObject1
.
getString
(
"code"
)))
{
return
ResponseData
.
error
(
"身份证验证失败。"
);
}
Integer
i
=
Integer
.
parseInt
(
idCard
.
substring
(
6
,
10
));
DateFormat
dateFormat
=
new
SimpleDateFormat
(
"yyyyMMdd"
);
Date
timeDate
=
new
Date
();
Integer
age
=
Integer
.
parseInt
(
dateFormat
.
format
(
timeDate
.
getTime
()));
Integer
time16
=
Integer
.
parseInt
(
String
.
valueOf
(
i
+
16
)
+
idCard
.
substring
(
10
,
14
));
Integer
time25
=
Integer
.
parseInt
(
String
.
valueOf
(
i
+
25
)
+
idCard
.
substring
(
10
,
14
));
if
(
age
<
time16
)
{
return
ResponseData
.
error
(
"根据工信部要求,未满16周岁的用户,应由法定代理人代为办理线上入网,如有疑问请联系客服,谢谢。"
);
}
if
(
age
>
time25
)
{
return
ResponseData
.
error
(
"您已满25周岁,不符合办理条件,如有疑问请联系客服,谢谢。"
);
}
Calendar
instance
=
Calendar
.
getInstance
();
Calendar
instance
=
Calendar
.
getInstance
();
instance
.
add
(
Calendar
.
DATE
,
-
94
);
instance
.
add
(
Calendar
.
DATE
,
-
94
);
Date
time
=
instance
.
getTime
();
Date
time
=
instance
.
getTime
();
...
@@ -442,14 +403,20 @@ public class PackageNewClothes {
...
@@ -442,14 +403,20 @@ public class PackageNewClothes {
order
.
setOrderStatus
(
"待识别"
);
order
.
setOrderStatus
(
"待识别"
);
order
.
setUserSchool
(
userSchool
);
order
.
setUserSchool
(
userSchool
);
order
.
setHehuorenId
(
partner
);
order
.
setHehuorenId
(
partner
);
order
.
setSite
(
site
);
order
.
setXbType
(
1
);
order
.
setXbType
(
1
);
if
(
StringUtils
.
isNotBlank
(
site
)){
order
.
setSite
(
site
);
}
if
(
StringUtils
.
isNotBlank
(
addRess
)){
order
.
setAddress
(
addRess
);
}
order
.
setKapin
(
kapin
);
order
.
setKapin
(
kapin
);
order
.
setPackageId
(
cardId
);
order
.
setPackageId
(
cardId
);
order
.
setCustomerName
(
customerName
);
order
.
setCustomerName
(
customerName
);
order
.
setContactNumber
(
contactNumber
);
order
.
setContactNumber
(
contactNumber
);
order
.
setRemarks
(
remarks
);
order
.
setRemarks
(
remarks
);
order
.
setAddress
(
addRess
);
order
.
setStudenCard
(
PicturesUtil
.
uploadPictures
(
studentCard
,
partner
));
order
.
setStudenCard
(
studentCard
);
order
.
setBusinessNumber
(
businessNumber
);
order
.
setBusinessNumber
(
businessNumber
);
Date
date
=
new
Date
();
Date
date
=
new
Date
();
order
.
setCreateTime
(
date
);
order
.
setCreateTime
(
date
);
...
@@ -471,10 +438,59 @@ public class PackageNewClothes {
...
@@ -471,10 +438,59 @@ public class PackageNewClothes {
if
(
insert
==
1
)
{
if
(
insert
==
1
)
{
appMapper
.
inserOrderHis
(
id
,
"资料提交成功,等待上传证件"
,
date
,
sysUser
.
getName
());
appMapper
.
inserOrderHis
(
id
,
"资料提交成功,等待上传证件"
,
date
,
sysUser
.
getName
());
return
ResponseData
.
success
(
id
);
return
ResponseData
.
success
(
map
.
get
(
"orderCode"
).
toString
()
);
}
}
return
ResponseData
.
error
(
"开卡失败!"
);
return
ResponseData
.
error
(
"开卡失败!"
);
}
}
/**
* 身份证验证
* @param idCard 身份证
* @param customerName 姓名
* @return
*/
public
static
ResponseData
<
String
>
idCardVerification
(
String
idCard
,
String
customerName
){
JSONObject
jsonObject1
=
null
;
try
{
jsonObject1
=
XbkUtil
.
idCardCheckJT0005
(
idCard
,
customerName
);
}
catch
(
Exception
e
)
{
log
.
info
(
"身份证验证接口调用异常"
,
e
.
getMessage
());
}
if
(
jsonObject1
==
null
)
{
log
.
info
(
"身份证验证接口调用异常"
);
return
ResponseData
.
error
(
"身份证验证失败。"
);
}
if
(!
"0"
.
equals
(
jsonObject1
.
getString
(
"code"
)))
{
return
ResponseData
.
error
(
jsonObject1
.
getString
(
"msg"
));
}
Integer
i
=
Integer
.
parseInt
(
idCard
.
substring
(
6
,
10
));
DateFormat
dateFormat
=
new
SimpleDateFormat
(
"yyyyMMdd"
);
Date
timeDate
=
new
Date
();
Integer
age
=
Integer
.
parseInt
(
dateFormat
.
format
(
timeDate
.
getTime
()));
Integer
time16
=
Integer
.
parseInt
(
String
.
valueOf
(
i
+
16
)
+
idCard
.
substring
(
10
,
14
));
Integer
time25
=
Integer
.
parseInt
(
String
.
valueOf
(
i
+
25
)
+
idCard
.
substring
(
10
,
14
));
if
(
age
<
time16
)
{
return
ResponseData
.
error
(
"根据工信部要求,未满16周岁的用户,应由法定代理人代为办理线上入网,如有疑问请联系客服,谢谢。"
);
}
if
(
age
>
time25
)
{
return
ResponseData
.
error
(
"您已满25周岁,不符合办理条件,如有疑问请联系客服,谢谢。"
);
}
return
ResponseData
.
success
(
"OK"
);
}
/**
* 查询当前用户是否适用此套餐
*
* @param partner
* @return
*/
public
ResponseData
<
String
>
packageVerification
(
String
partner
,
String
packageID
)
{
String
schoolId
=
appMapper
.
selectSchoolId
(
partner
);
List
<
String
>
packageIds
=
appMapper
.
selectPackageId
(
schoolId
);
if
(
packageIds
.
contains
(
packageID
)){
return
ResponseData
.
success
(
"ok"
);
}
return
ResponseData
.
error
(
"当前用户没有此套餐!"
);
}
}
}
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