Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gs1-office-web-sit
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
吴迪
gs1-office-web-sit
Commits
a6595357
Commit
a6595357
authored
Dec 21, 2021
by
吴迪
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
c737ec05
ec71cfbe
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
110 additions
and
31 deletions
+110
-31
LogLoginController.java
.../office/modules/manage/controller/LogLoginController.java
+2
-2
TycpdmFirmController.java
...ffice/modules/manage/controller/TycpdmFirmController.java
+45
-8
TycpdmFirmService.java
...a/io/office/modules/manage/service/TycpdmFirmService.java
+2
-1
LogLoginServiceImpl.java
...fice/modules/manage/service/impl/LogLoginServiceImpl.java
+3
-2
MemberServiceImpl.java
...office/modules/manage/service/impl/MemberServiceImpl.java
+7
-6
TycpdmFirmServiceImpl.java
...ce/modules/manage/service/impl/TycpdmFirmServiceImpl.java
+51
-12
No files found.
src/main/java/io/office/modules/manage/controller/LogLoginController.java
View file @
a6595357
...
...
@@ -45,11 +45,11 @@ public class LogLoginController {
@Login
// @RequiresPermissions("manage:member:list")
public
R
login
(
@RequestBody
Map
<
String
,
Object
>
params
,
HttpServletRequest
request
,
HttpServletResponse
response
){
/*
DomesticCodeVo domesticCodeVo = new DomesticCodeVo(params.get("uuid").toString(),params.get("captcha").toString());
DomesticCodeVo
domesticCodeVo
=
new
DomesticCodeVo
(
params
.
get
(
"uuid"
).
toString
(),
params
.
get
(
"captcha"
).
toString
());
boolean
captcha
=
sysCaptchaService
.
validate
(
domesticCodeVo
.
getUuid
(),
domesticCodeVo
.
getCaptcha
());
if
(!
captcha
){
return
R
.
error
(
"验证码不正确"
);
}
*/
}
return
R
.
ok
().
put
(
"data"
,
logLoginService
.
login
(
params
,
request
,
response
));
}
...
...
src/main/java/io/office/modules/manage/controller/TycpdmFirmController.java
View file @
a6595357
...
...
@@ -118,11 +118,15 @@ public class TycpdmFirmController extends AbstractController {
public
static
void
main
(
String
[]
args
)
throws
InvocationTargetException
,
IllegalAccessException
{
/* String s = MD5Util.md5Encrypt32Upper("
12312
3");
/* String s = MD5Util.md5Encrypt32Upper("
GS1_2020101
3");
System.out.println(s);*/
String
userName_M
=
DESUtils
.
byteToHexString
(
DESUtils
.
DES_CBC_Encrypt
(
"13515718321"
.
getBytes
(),
"loginkey"
.
getBytes
()));
String
pass_M
=
DESUtils
.
byteToHexString
(
DESUtils
.
DES_CBC_Encrypt
(
"718321"
.
getBytes
(),
"loginkey"
.
getBytes
()));
System
.
out
.
println
(
userName_M
);
String
pass
=
"GS1_20201013"
;
String
pass_MD5
=
MD5Util
.
md5Encrypt32Lower
(
pass
);
System
.
out
.
println
(
"pass_MD5 "
+
pass_MD5
);
// String userName_M = DESUtils.byteToHexString(DESUtils.DES_CBC_Encrypt("1165004".getBytes(),"loginkey".getBytes()));
String
pass_M
=
DESUtils
.
byteToHexString
(
DESUtils
.
DES_CBC_Encrypt
(
pass_MD5
.
getBytes
(),
"appsGdsn"
.
getBytes
()));
// System.out.println(userName_M);
System
.
out
.
println
(
pass_M
);
}
/**
...
...
@@ -149,7 +153,7 @@ public class TycpdmFirmController extends AbstractController {
TycpdmFirmEntity
tycpdmFirm
=
new
TycpdmFirmEntity
();
try
{
BeanUtils
.
populate
(
tycpdmFirm
,
body
);
Integer
fId
=
Integer
.
valueOf
(
String
.
valueOf
(
body
.
get
(
"f
I
d"
)));
Integer
fId
=
Integer
.
valueOf
(
String
.
valueOf
(
body
.
get
(
"f
i
d"
)));
tycpdmFirm
.
setFId
(
fId
);
tycpdmFirmService
.
updateById
(
tycpdmFirm
);
return
R
.
ok
();
...
...
@@ -269,9 +273,14 @@ public class TycpdmFirmController extends AbstractController {
* 跳转GDS页面
*/
@RequestMapping
(
"/authApi/redirectGDS"
)
public
R
redirectGDS
(
HttpServletResponse
response
){
MemberEntity
memberUser
=
getMemberUser
();
String
url
=
tycpdmFirmService
.
redirectGDSURL
(
memberUser
);
public
R
redirectGDS
(
@RequestBody
Map
<
String
,
Object
>
params
){
//由于member表中没有手机用户的信息 通过memberDao获取
Object
id
=
params
.
get
(
"id"
);
MemberEntity
memberEntity
=
null
;
if
(
id
!=
null
){
memberEntity
=
memberDao
.
selectById
(
id
.
toString
());
}
String
url
=
tycpdmFirmService
.
redirectGDSURL
(
memberEntity
,
params
);
try
{
//response.sendRedirect(url);
return
R
.
ok
().
put
(
"data"
,
url
);
...
...
@@ -299,4 +308,32 @@ public class TycpdmFirmController extends AbstractController {
}
/**
* 跳转业务大厅页面
*/
@RequestMapping
(
"/authApi/redirectBusinessHall"
)
public
R
redirectBusinessHall
(
@RequestBody
Map
<
String
,
Object
>
params
){
//由于member表中没有手机用户的信息 通过memberDao获取
Object
id
=
params
.
get
(
"id"
);
MemberEntity
memberEntity
=
memberDao
.
selectById
(
id
.
toString
());
String
url
=
tycpdmFirmService
.
redirectBusinessHall
(
params
,
memberEntity
);
try
{
//response.sendRedirect(url);
return
R
.
ok
().
put
(
"data"
,
url
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
R
.
error
(
"跳转失败"
);
}
}
/**
* 修改企业信息回显(不需要审批)
*/
@RequestMapping
(
"/authApi/findByUserName"
)
public
R
findByUserName
(
@RequestBody
Map
name
){
String
userNameR
=
String
.
valueOf
(
name
.
get
(
"name"
));
TycpdmFirmEntity
userName
=
tycpdmFirmDao
.
findUserName
(
userNameR
);
return
R
.
ok
().
put
(
"data"
,
userName
);
}
}
src/main/java/io/office/modules/manage/service/TycpdmFirmService.java
View file @
a6595357
...
...
@@ -48,9 +48,10 @@ public interface TycpdmFirmService extends IService<TycpdmFirmEntity> {
void
updateSystem
(
Map
<
String
,
Object
>
params
);
String
redirectGDSURL
(
MemberEntity
memberUser
);
String
redirectGDSURL
(
MemberEntity
memberUser
,
Map
<
String
,
Object
>
params
);
String
redirectGDSGLN
(
MemberEntity
memberUser
);
String
redirectBusinessHall
(
Map
map
,
MemberEntity
memberUser
);
}
src/main/java/io/office/modules/manage/service/impl/LogLoginServiceImpl.java
View file @
a6595357
...
...
@@ -74,7 +74,7 @@ public class LogLoginServiceImpl extends ServiceImpl<LogLoginDao, LogLoginEntity
Integer
isQY
=
2
;
//是否开通企业认证 1.开通 2.未开通
Integer
isXT
=
2
;
//是否是业务大厅系统成员 1.是 2.否
Integer
id
=
0
;
//用户ID
Integer
id
=
-
99
;
//用户ID
String
search
=
"ws2"
;
// 用户来源 manager:业务大厅手机号用户 ws2:member表用户
String
carno
=
null
;
// 条码卡号
String
phone
=
null
;
//手机号码
...
...
@@ -98,10 +98,11 @@ public class LogLoginServiceImpl extends ServiceImpl<LogLoginDao, LogLoginEntity
//登录成功
search
=
"manager"
;
phone
=
userName
;
//
TODO tgl
需要中国编码官网提供 条码卡数据 来判断是否是系统用户
//需要中国编码官网提供 条码卡数据 来判断是否是系统用户
JSONObject
data
=
jsonObject
.
getJSONObject
(
"data"
);
if
(
data
!=
null
){
carno
=
data
.
getString
(
"gdsCode"
);
isXT
=
1
;
}
}
}
...
...
src/main/java/io/office/modules/manage/service/impl/MemberServiceImpl.java
View file @
a6595357
...
...
@@ -168,7 +168,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberDao, MemberEntity> impl
String
date
=
timescodeChphoneEntity
.
getDate
();
String
date_1
=
DateUtils
.
getDay
();
if
(
date_1
.
equals
(
date
))
{
times
=
times
+
1
;
times
_validate
=
times_validate
+
1
;
date
=
date_1
;
//更新数据
timescodeChphoneDao
.
updateById
(
new
TimescodeChphoneEntity
(
phone
,
date
,
times
,
times_validate
));
...
...
@@ -179,7 +179,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberDao, MemberEntity> impl
}
}
else
{
//不是同一天修改 数据并初始化数据
times
=
1
;
times
_validate
=
1
;
date
=
date_1
;
timescodeChphoneDao
.
updateById
(
new
TimescodeChphoneEntity
(
phone
,
date
,
times
,
times_validate
));
flag
=
1
;
...
...
@@ -194,7 +194,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberDao, MemberEntity> impl
flag
=
1
;
}
// 以下添加同一个ip短信发送次数验证
/*
// 以下添加同一个ip短信发送次数验证
int flag_ip = 1;
TimescodeChphoneIpEntity timescodeChphoneIpEntity = timescodeChphoneIpDao.selectById(ip);
if (timescodeChphoneIpEntity != null) {
...
...
@@ -221,13 +221,13 @@ public class MemberServiceImpl extends ServiceImpl<MemberDao, MemberEntity> impl
int times_ip = 1;
timescodeChphoneIpDao.insert(new TimescodeChphoneIpEntity(ip, date, times_ip));
flag_ip = 1;
}
}
*/
// 同一个ip短信发送次数验证end
if
(
flag
==
0
)
{
throw
new
RRException
(
"同一手机号每日最多操作三次!"
);
}
else
if
(
flag_ip
==
0
)
{
}
/*
else if (flag_ip == 0) {
throw new RRException("同一ip每日最多操作十次!");
}
}
*/
if
(
phone
.
equals
(
""
))
{
throw
new
RRException
(
"请输入手机号码"
);
}
...
...
@@ -370,6 +370,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberDao, MemberEntity> impl
//不是同一天修改 数据并初始化数据
times
=
1
;
date
=
date_1
;
times_validate
=
0
;
timescodeChphoneDao
.
updateById
(
new
TimescodeChphoneEntity
(
phone
,
date
,
times
,
times_validate
));
flag
=
1
;
}
...
...
src/main/java/io/office/modules/manage/service/impl/TycpdmFirmServiceImpl.java
View file @
a6595357
...
...
@@ -11,6 +11,7 @@ import io.office.modules.manage.entity.*;
import
io.office.modules.manage.service.TycpdmFirmChangeService
;
import
io.office.modules.manage.utils.DESUtils
;
import
io.office.modules.manage.utils.DateUtils
;
import
io.office.modules.manage.utils.MD5Util
;
import
org.apache.commons.beanutils.BeanMap
;
import
org.apache.commons.beanutils.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -448,32 +449,44 @@ public class TycpdmFirmServiceImpl extends ServiceImpl<TycpdmFirmDao, TycpdmFirm
}
@Override
public
String
redirectGDSURL
(
MemberEntity
memberUser
)
{
public
String
redirectGDSURL
(
MemberEntity
memberUser
,
Map
<
String
,
Object
>
params
)
{
//用户类型 1.业务大厅(手机号用户) 2.业务大厅(条码卡成员) 3.官网用户
Integer
userType
=
Integer
.
valueOf
(
String
.
valueOf
(
params
.
get
(
"userType"
)));
Integer
levels
=
null
;
//用户权限 空.代表普通用户 0.代表中心管理员,1.代表校验管理员 其他4位.代表分中心管理员
int
dept
=
-
2
;
//0表示中心管理员;-2表示普通成员。-100表示没有任何值时
String
regist_or_login_from_ancc
=
""
;
String
username
=
memberUser
.
getUsername
();
String
pass
=
memberUser
.
getPass
();
if
(
matchPhoneNumber
(
username
)){
//TODO tgl 手机号用户 调用接口获取 条码数据
String
username
=
null
;
String
pass
=
null
;
if
(
memberUser
!=
null
){
username
=
memberUser
.
getUsername
();
pass
=
memberUser
.
getPass
();
}
if
(
userType
==
1
){
//手机号用户获取 条码卡号
Integer
carno
=
Integer
.
valueOf
(
String
.
valueOf
(
params
.
get
(
"carno"
)));
username
=
carno
+
""
;
MemberEntity
memberEntity
=
memberDao
.
selectByName
(
carno
+
""
);
//获取密码MD5加密后的密码
String
pass_MD5
=
memberEntity
.
getPass
();
//再进行 DES加密
pass
=
DESUtils
.
byteToHexString
(
DESUtils
.
DES_CBC_Encrypt
(
pass_MD5
.
getBytes
(),
"appsGdsn"
.
getBytes
()));
}
else
{
//其他用户
//密码进行 DES加密
//String pass_DES = DESUtils.byteToHexString(DESUtils.DES_CBC_Encrypt(pass.getBytes(),DESUtils.Key.getBytes()));
levels
=
memberDao
.
selectCode_agen
(
username
);
if
(
levels
==
null
){
dept
=-
2
;
}
else
if
(
levels
==
0
){
dept
=
0
;
}
regist_or_login_from_ancc
=
dept
+
"{regist_or_login_from_ancc}"
;
regist_or_login_from_ancc
=
DESUtils
.
byteToHexString
(
DESUtils
.
DES_CBC_Encrypt
(
regist_or_login_from_ancc
.
getBytes
(),
DESUtils
.
Key
.
getBytes
()));
String
url
=
"http://v3.gds.org.cn/registerOrLoginFromAncc.aspx?uname="
+
username
+
"&pwd="
+
pass
+
"®ist_or_login_from_ancc="
+
regist_or_login_from_ancc
+
"&dept="
+
dept
;
return
url
;
pass
=
DESUtils
.
byteToHexString
(
DESUtils
.
DES_CBC_Encrypt
(
pass
.
getBytes
(),
"appsGdsn"
.
getBytes
()));
}
return
null
;
regist_or_login_from_ancc
=
dept
+
"{regist_or_login_from_ancc}"
;
regist_or_login_from_ancc
=
MD5Util
.
md5Encrypt32Lower
(
regist_or_login_from_ancc
);
String
url
=
"http://v3.gds.org.cn/registerOrLoginFromAncc.aspx?uname="
+
username
+
"&pwd="
+
pass
+
"®ist_or_login_from_ancc="
+
regist_or_login_from_ancc
+
"&dept="
+
dept
;
return
url
;
}
/**
...
...
@@ -492,6 +505,32 @@ public class TycpdmFirmServiceImpl extends ServiceImpl<TycpdmFirmDao, TycpdmFirm
return
url
;
}
@Override
public
String
redirectBusinessHall
(
Map
map
,
MemberEntity
memberUser
)
{
String
phone
=
""
;
//用户类型 1.业务大厅(手机号用户) 2.业务大厅(条码卡成员) 3.官网用户
Integer
userType
=
Integer
.
valueOf
(
String
.
valueOf
(
map
.
get
(
"userType"
)));
if
(
userType
==
1
){
phone
=
memberUser
.
getUsername
();
//手机号
}
else
if
(
userType
==
2
){
//调用另一个接口
phone
=
memberUser
.
getUsername
();
//条码卡号
String
phone_M
=
DESUtils
.
byteToHexString
(
DESUtils
.
DES_CBC_Encrypt
(
phone
.
getBytes
(),
"loginkey"
.
getBytes
()));
String
password
=
memberUser
.
getPassword
();
//名文密码
String
password_M
=
DESUtils
.
byteToHexString
(
DESUtils
.
DES_CBC_Encrypt
(
password
.
getBytes
(),
"loginkey"
.
getBytes
()));
String
url
=
"http://wsdt.gs1cn.org/anccoh/login?method=gdsLoginSSO&gdsCode="
+
phone_M
+
"&password="
+
password_M
;
return
url
;
}
else
if
(
userType
==
3
){
phone
=
memberUser
.
getPhone
();
//手机号
}
else
{
throw
new
RRException
(
"用户类型错误"
);
}
String
phone_M
=
DESUtils
.
byteToHexString
(
DESUtils
.
DES_CBC_Encrypt
(
phone
.
getBytes
(),
"loginkey"
.
getBytes
()));
String
url
=
"http://wsdt.gs1cn.org/anccoh/login?method=phoneSSO&phone="
+
phone_M
;
return
url
;
}
/**
* 验证手机号 由于号码段不断的更新,只需要判断手机号有11位,并且全是数字以及1开头等
...
...
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