Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
agent-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
agent-platform
Commits
ef193df6
Commit
ef193df6
authored
Apr 27, 2025
by
赵啸非
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
0cada2f1
6fb6a36c
Pipeline
#2958
canceled with stages
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
2 deletions
+47
-2
agent-manager/src/main/java/com/mortals/xhx/busiz/web/H5LoginController.java
...ain/java/com/mortals/xhx/busiz/web/H5LoginController.java
+17
-1
agent-manager/src/main/java/com/mortals/xhx/module/company/service/CompanyService.java
...om/mortals/xhx/module/company/service/CompanyService.java
+8
-0
agent-manager/src/main/java/com/mortals/xhx/module/company/service/impl/CompanyServiceImpl.java
...s/xhx/module/company/service/impl/CompanyServiceImpl.java
+22
-1
No files found.
agent-manager/src/main/java/com/mortals/xhx/busiz/web/H5LoginController.java
View file @
ef193df6
...
@@ -8,11 +8,13 @@ import com.mortals.framework.exception.AppException;
...
@@ -8,11 +8,13 @@ import com.mortals.framework.exception.AppException;
import
com.mortals.framework.service.IAuthTokenService
;
import
com.mortals.framework.service.IAuthTokenService
;
import
com.mortals.framework.service.IUser
;
import
com.mortals.framework.service.IUser
;
import
com.mortals.framework.util.DateUtils
;
import
com.mortals.framework.util.DateUtils
;
import
com.mortals.framework.util.SecurityUtil
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.xhx.base.system.user.model.UserEntity
;
import
com.mortals.xhx.base.system.user.model.UserEntity
;
import
com.mortals.xhx.base.system.user.model.UserQuery
;
import
com.mortals.xhx.base.system.user.model.UserQuery
;
import
com.mortals.xhx.base.system.user.service.UserService
;
import
com.mortals.xhx.base.system.user.service.UserService
;
import
com.mortals.xhx.busiz.req.H5Req
;
import
com.mortals.xhx.busiz.req.H5Req
;
import
com.mortals.xhx.module.company.model.CompanyEntity
;
import
com.mortals.xhx.module.company.service.CompanyService
;
import
com.mortals.xhx.module.company.service.CompanyService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -74,7 +76,7 @@ public class H5LoginController extends BaseCRUDJsonBodyMappingController<UserSer
...
@@ -74,7 +76,7 @@ public class H5LoginController extends BaseCRUDJsonBodyMappingController<UserSer
ret
.
put
(
KEY_RESULT_DATA
,
data
);
ret
.
put
(
KEY_RESULT_DATA
,
data
);
ret
.
put
(
KEY_RESULT_CODE
,
VALUE_RESULT_SUCCESS
);
ret
.
put
(
KEY_RESULT_CODE
,
VALUE_RESULT_SUCCESS
);
ret
.
put
(
KEY_RESULT_MSG
,
"用户登录系统成功!"
);
ret
.
put
(
KEY_RESULT_MSG
,
"用户登录系统成功!"
);
recordSysLog
(
request
,
userEntity
,
"h
4
用户登录系统成功!"
);
recordSysLog
(
request
,
userEntity
,
"h
5
用户登录系统成功!"
);
return
ret
.
toJSONString
();
return
ret
.
toJSONString
();
}
catch
(
AppException
e
)
{
}
catch
(
AppException
e
)
{
log
.
error
(
"h5 login error "
,
e
);
log
.
error
(
"h5 login error "
,
e
);
...
@@ -114,6 +116,18 @@ public class H5LoginController extends BaseCRUDJsonBodyMappingController<UserSer
...
@@ -114,6 +116,18 @@ public class H5LoginController extends BaseCRUDJsonBodyMappingController<UserSer
if
(
ObjectUtils
.
isEmpty
(
userEntity
))
{
if
(
ObjectUtils
.
isEmpty
(
userEntity
))
{
//todo h5登录的用户不存在,新增用户,用户名用openId,密码用123
//todo h5登录的用户不存在,新增用户,用户名用openId,密码用123
userEntity
=
new
UserEntity
();
userEntity
.
initAttrValue
();
userEntity
.
setOpenId
(
req
.
getOpenId
());
userEntity
.
setRealName
(
req
.
getUserName
());
userEntity
.
setLoginName
(
req
.
getOpenId
());
userEntity
.
setPhone
(
req
.
getPhone
());
userEntity
.
setMobile
(
req
.
getPhone
());
userEntity
.
setLoginPwd
(
SecurityUtil
.
md5DoubleEncoding
(
"123"
));
userEntity
.
setUserType
(
2
);
CompanyEntity
companyEntity
=
companyService
.
getCompanyByH5
(
req
);
userEntity
.
setCompanyId
(
companyEntity
.
getId
());
userEntity
=
userService
.
save
(
userEntity
);
}
}
if
(!
ObjectUtils
.
isEmpty
(
userEntity
)
if
(!
ObjectUtils
.
isEmpty
(
userEntity
)
...
@@ -123,6 +137,8 @@ public class H5LoginController extends BaseCRUDJsonBodyMappingController<UserSer
...
@@ -123,6 +137,8 @@ public class H5LoginController extends BaseCRUDJsonBodyMappingController<UserSer
if
(!
ObjectUtils
.
isEmpty
(
userEntity
)
if
(!
ObjectUtils
.
isEmpty
(
userEntity
)
&&
ObjectUtils
.
isEmpty
(
userEntity
.
getCompanyId
()))
{
&&
ObjectUtils
.
isEmpty
(
userEntity
.
getCompanyId
()))
{
//todo 当前用户存在 但是未绑定公司 可绑定
//todo 当前用户存在 但是未绑定公司 可绑定
CompanyEntity
companyEntity
=
companyService
.
getCompanyByH5
(
req
);
userEntity
.
setCompanyId
(
companyEntity
.
getId
());
}
}
//当前用户绑定公司 用户名可与phone绑定
//当前用户绑定公司 用户名可与phone绑定
...
...
agent-manager/src/main/java/com/mortals/xhx/module/company/service/CompanyService.java
View file @
ef193df6
package
com.mortals.xhx.module.company.service
;
package
com.mortals.xhx.module.company.service
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.xhx.busiz.req.H5Req
;
import
com.mortals.xhx.module.company.model.CompanyEntity
;
import
com.mortals.xhx.module.company.model.CompanyEntity
;
import
com.mortals.xhx.module.company.dao.CompanyDao
;
import
com.mortals.xhx.module.company.dao.CompanyDao
;
/**
/**
...
@@ -13,4 +14,11 @@ import com.mortals.xhx.module.company.dao.CompanyDao;
...
@@ -13,4 +14,11 @@ import com.mortals.xhx.module.company.dao.CompanyDao;
public
interface
CompanyService
extends
ICRUDService
<
CompanyEntity
,
Long
>{
public
interface
CompanyService
extends
ICRUDService
<
CompanyEntity
,
Long
>{
CompanyDao
getDao
();
CompanyDao
getDao
();
/**
* H5注册
* @param req
* @return
*/
CompanyEntity
getCompanyByH5
(
H5Req
req
);
}
}
\ No newline at end of file
agent-manager/src/main/java/com/mortals/xhx/module/company/service/impl/CompanyServiceImpl.java
View file @
ef193df6
package
com.mortals.xhx.module.company.service.impl
;
package
com.mortals.xhx.module.company.service.impl
;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.xhx.busiz.req.H5Req
;
import
com.mortals.xhx.common.utils.BeanUtil
;
import
com.mortals.xhx.module.company.model.CompanyQuery
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
java.util.Date
;
import
java.util.function.Function
;
import
java.util.function.Function
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
...
@@ -10,6 +15,8 @@ import com.mortals.xhx.module.company.dao.CompanyDao;
...
@@ -10,6 +15,8 @@ import com.mortals.xhx.module.company.dao.CompanyDao;
import
com.mortals.xhx.module.company.model.CompanyEntity
;
import
com.mortals.xhx.module.company.model.CompanyEntity
;
import
com.mortals.xhx.module.company.service.CompanyService
;
import
com.mortals.xhx.module.company.service.CompanyService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.util.ObjectUtils
;
/**
/**
* CompanyService
* CompanyService
* 企业基本信息 service实现
* 企业基本信息 service实现
...
@@ -20,5 +27,19 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -20,5 +27,19 @@ import lombok.extern.slf4j.Slf4j;
@Service
(
"companyService"
)
@Service
(
"companyService"
)
@Slf4j
@Slf4j
public
class
CompanyServiceImpl
extends
AbstractCRUDServiceImpl
<
CompanyDao
,
CompanyEntity
,
Long
>
implements
CompanyService
{
public
class
CompanyServiceImpl
extends
AbstractCRUDServiceImpl
<
CompanyDao
,
CompanyEntity
,
Long
>
implements
CompanyService
{
@Override
public
CompanyEntity
getCompanyByH5
(
H5Req
req
)
{
CompanyEntity
companyEntity
=
this
.
selectOne
(
new
CompanyQuery
().
parkId
(
req
.
getParkId
()).
applyName
(
req
.
getApplyName
()).
phone
(
req
.
getPhone
()));
if
(
ObjectUtils
.
isEmpty
(
companyEntity
)){
companyEntity
=
new
CompanyEntity
();
companyEntity
.
initAttrValue
();
BeanUtils
.
copyProperties
(
req
,
companyEntity
,
BeanUtil
.
getNullPropertyNames
(
req
));
companyEntity
.
setCreateTime
(
new
Date
());
companyEntity
.
setCreateUserId
(
1L
);
return
this
.
save
(
companyEntity
);
}
else
{
return
companyEntity
;
}
}
}
}
\ No newline at end of file
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