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
9df00ac7
Commit
9df00ac7
authored
Dec 21, 2021
by
唐功亮
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【新增】 个人中心三个跳转
parent
c131b13d
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
90 additions
and
22 deletions
+90
-22
LogLoginController.java
.../office/modules/manage/controller/LogLoginController.java
+2
-2
TycpdmFirmController.java
...ffice/modules/manage/controller/TycpdmFirmController.java
+34
-7
TycpdmFirmService.java
...a/io/office/modules/manage/service/TycpdmFirmService.java
+2
-1
LogLoginServiceImpl.java
...fice/modules/manage/service/impl/LogLoginServiceImpl.java
+3
-2
TycpdmFirmServiceImpl.java
...ce/modules/manage/service/impl/TycpdmFirmServiceImpl.java
+49
-10
No files found.
src/main/java/io/office/modules/manage/controller/LogLoginController.java
View file @
9df00ac7
...
...
@@ -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 @
9df00ac7
...
...
@@ -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
);
}
/**
...
...
@@ -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,22 @@ 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
(
"跳转失败"
);
}
}
}
src/main/java/io/office/modules/manage/service/TycpdmFirmService.java
View file @
9df00ac7
...
...
@@ -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 @
9df00ac7
...
...
@@ -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/TycpdmFirmServiceImpl.java
View file @
9df00ac7
...
...
@@ -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,34 +449,46 @@ 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
;
}
pass
=
DESUtils
.
byteToHexString
(
DESUtils
.
DES_CBC_Encrypt
(
pass
.
getBytes
(),
"appsGdsn"
.
getBytes
()));
}
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
())
);
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
;
}
return
null
;
}
/**
* 只有官网注册用户登录,已通过厂商实名认证的,此处直接跳转,传参为用户名和密码
* username 参数 进行DES加密
...
...
@@ -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