Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
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
8timerv2
8timerapiv200
Commits
c417db5e
Commit
c417db5e
authored
5 years ago
by
tangzhaoqian
Committed by
chenzg
3 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录bug
parent
e3ccb5ac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
17 deletions
+21
-17
src/main/java/cn/timer/api/controller/LoginController.java
+21
-17
No files found.
src/main/java/cn/timer/api/controller/LoginController.java
View file @
c417db5e
package
cn
.
timer
.
api
.
controller
;
import
java.io.IOException
;
import
java.text.DateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.stream.Stream
;
import
javax.annotation.PostConstruct
;
...
...
@@ -25,7 +23,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.alibaba.druid.sql.visitor.functions.Now
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper
;
...
...
@@ -43,7 +40,6 @@ import cn.timer.api.bean.zzgl.ZzglAuth;
import
cn.timer.api.bean.zzgl.ZzglBmgwM
;
import
cn.timer.api.config.annotation.CurrentUser
;
import
cn.timer.api.config.annotation.UserBean
;
import
cn.timer.api.config.enuminterface.YgEnumInterface
;
import
cn.timer.api.config.enums.CommonEnum
;
import
cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper
;
import
cn.timer.api.dao.qyzx.QyzxEmpLoginMapper
;
...
...
@@ -472,14 +468,10 @@ public class LoginController {
return
ResultUtil
.
error
(
"已注册过企业"
);
}
}
//增加一个月试用期
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
setTime
(
new
Date
());
cal
.
add
(
Calendar
.
MONTH
,
1
);
cal
.
getTime
();
// 企业信息
QyzxEntInfoM
qyzxEntInfoM
=
QyzxEntInfoM
.
builder
().
name
(
name
).
registerTime
(
DateUtil
.
date
())
.
endTime
(
DateUtil
.
offsetDay
(
new
Date
(),
offset
)).
level
(
CommonEnum
.
LEVEL_PROBATION
.
getType
())
.
endTime
(
cal
.
getTime
())
.
endTime
(
DateUtil
.
offsetDay
(
new
Date
(),
offset
)).
level
(
CommonEnum
.
LEVEL_PROBATION
.
getType
())
.
build
();
boolean
b1
=
qyzxEntInfoM
.
insert
();
if
(!
b1
)
{
...
...
@@ -520,7 +512,7 @@ public class LoginController {
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
return
ResultUtil
.
error
(
"注册企业失败4"
);
}
return
ResultUtil
.
success
(
"注册企业成功"
);
}
catch
(
Exception
e
)
{
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
...
...
@@ -574,12 +566,24 @@ public class LoginController {
qyzxEmpLogin1
.
setQys
(
qys
);
QysDto
ctrl
=
qys
.
get
(
0
);
if
(
qyzxEmpLogin1
.
getOrgId
()
!=
null
)
{
Stream
<
QysDto
>
s
=
qys
.
stream
()
.
filter
(
item
->
"1"
.
equals
(
item
.
getStatus
().
toString
())
&&
qyzxEmpLogin1
.
getOrgId
().
equals
(
item
.
getId
()));
if
(
s
!=
null
)
{
ctrl
=
s
.
findFirst
().
get
();
// for (QysDto qysDto : qys) {
// if (qyzxEmpLogin1.getOrgId().equals(qysDto.getId()) && qysDto.getStatus() == 1) {
// ctrl = qysDto;
// }
// System.out.println(qyzxEmpLogin1.getOrgId());
// System.out.println(qysDto);
// }
Optional
<
QysDto
>
s
=
qys
.
parallelStream
()
.
filter
(
item
->
item
.
getStatus
()
==
1
&&
qyzxEmpLogin1
.
getOrgId
().
equals
(
item
.
getId
())).
findFirst
();
System
.
out
.
println
(
s
.
isPresent
());
if
(
s
!=
null
&&
s
.
isPresent
())
{
ctrl
=
s
.
get
();
}
}
if
(
ctrl
.
getStatus
()
==
null
||
ctrl
.
getStatus
().
equals
(
0
))
{
return
ResultUtil
.
error
(
"帐号被禁用"
);
...
...
This diff is collapsed.
Click to expand it.
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