Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
T
tcm-system
Project
Project
Details
Activity
Releases
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
TCM
tcm-system
Commits
768cb72f
Commit
768cb72f
authored
Aug 13, 2020
by
tangf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改注册流程
parent
e62f55c3
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
199 additions
and
93 deletions
+199
-93
CompanyController.java
.../pangding/web/authority/controller/CompanyController.java
+10
-1
CompanyDaoImpl.java
...a/com/pangding/web/authority/dao/impl/CompanyDaoImpl.java
+1
-1
PayFeign.java
src/main/java/com/pangding/web/authority/feign/PayFeign.java
+6
-1
CompanyService.java
...va/com/pangding/web/authority/service/CompanyService.java
+7
-0
CompanyServiceImpl.java
...ngding/web/authority/service/impl/CompanyServiceImpl.java
+130
-61
RegisterServiceImpl.java
...gding/web/authority/service/impl/RegisterServiceImpl.java
+7
-7
UserServiceImpl.java
.../pangding/web/authority/service/impl/UserServiceImpl.java
+38
-22
No files found.
src/main/java/com/pangding/web/authority/controller/CompanyCtroller.java
→
src/main/java/com/pangding/web/authority/controller/CompanyC
on
troller.java
View file @
768cb72f
...
...
@@ -3,8 +3,10 @@ package com.pangding.web.authority.controller;
import
com.pangding.web.authority.service.CompanyService
;
import
com.pangding.web.vo.system.req.company.CompanyReqVo
;
import
com.pangding.web.vo.system.req.company.SaveCompanyReqVo
;
import
com.yanzuoguang.util.helper.CheckerHelper
;
import
com.yanzuoguang.util.vo.ResponseResult
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
...
@@ -14,7 +16,7 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping
(
"/newCompany"
)
public
class
CompanyCtroller
{
public
class
CompanyC
on
troller
{
@Autowired
private
CompanyService
companyService
;
...
...
@@ -30,6 +32,13 @@ public class CompanyCtroller {
return
ResponseResult
.
result
(
companyService
.
findCompanyBalance
(
req
));
}
@ApiOperation
(
value
=
"公司,个人实名制"
,
notes
=
"返回实名制结果"
)
@RequestMapping
(
value
=
"/updateCompanyInfo"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
ResponseResult
<
SaveCompanyReqVo
>
updateCompanyInfo
(
@RequestBody
SaveCompanyReqVo
req
){
CheckerHelper
.
newInstance
().
notBlankCheck
(
"id"
,
req
.
getCompanyVo
().
getId
()).
checkException
();
return
companyService
.
updateCompanyInfo
(
req
);
}
}
src/main/java/com/pangding/web/authority/dao/impl/CompanyDaoImpl.java
View file @
768cb72f
...
...
@@ -29,7 +29,7 @@ public class CompanyDaoImpl extends BaseDaoImpl implements CompanyDao {
.
add
(
"examineStatus"
,
"and examine_status = ?"
)
.
add
(
"companyId"
,
"and invitation_company_id = ? "
);
getSql
(
DaoConst
.
LOAD
).
addCode
(
"{FIELD}"
,
",b.*"
,
"{INNER}"
,
"INNER JOIN pd_comp
na
y_extend b ON a.id = b.id"
);
getSql
(
DaoConst
.
LOAD
).
addCode
(
"{FIELD}"
,
",b.*"
,
"{INNER}"
,
"INNER JOIN pd_comp
an
y_extend b ON a.id = b.id"
);
}
...
...
src/main/java/com/pangding/web/authority/feign/PayFeign.java
View file @
768cb72f
...
...
@@ -2,10 +2,12 @@ package com.pangding.web.authority.feign;
import
com.pangding.web.authority.vo.reqvo.CompanyBankReqVo
;
import
com.pangding.web.authority.vo.reqvo.CompanyReqVo
;
import
com.pangding.web.vo.system.req.company.SaveCompanyReqVo
;
import
com.yanzuoguang.util.vo.ResponseResult
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
...
...
@@ -23,7 +25,10 @@ public interface PayFeign {
* @return
*/
@RequestMapping
(
value
=
"/register"
)
public
ResponseResult
<
CompanyReqVo
>
setCompanyInfo
(
@RequestBody
CompanyReqVo
req
);
ResponseResult
<
CompanyReqVo
>
setCompanyInfo
(
@RequestBody
CompanyReqVo
req
);
@RequestMapping
(
value
=
"/setCompanyInfo"
,
method
=
RequestMethod
.
POST
)
ResponseResult
<
SaveCompanyReqVo
>
setCompanyInfo1
(
@RequestBody
SaveCompanyReqVo
req
);
/**
* 绑定银行卡
...
...
src/main/java/com/pangding/web/authority/service/CompanyService.java
View file @
768cb72f
...
...
@@ -17,6 +17,13 @@ import java.util.List;
*/
public
interface
CompanyService
{
/**
* 公司个人实名认证
* @param req
* @return
*/
ResponseResult
<
com
.
pangding
.
web
.
vo
.
system
.
req
.
company
.
SaveCompanyReqVo
>
updateCompanyInfo
(
com
.
pangding
.
web
.
vo
.
system
.
req
.
company
.
SaveCompanyReqVo
req
);
/**
* 修改公司信息
* @param companyVo
...
...
src/main/java/com/pangding/web/authority/service/impl/CompanyServiceImpl.java
View file @
768cb72f
This diff is collapsed.
Click to expand it.
src/main/java/com/pangding/web/authority/service/impl/RegisterServiceImpl.java
View file @
768cb72f
...
...
@@ -456,13 +456,13 @@ public class RegisterServiceImpl implements RegisterService {
companyScenicInfoReqVo
.
setCompanyId
(
companyVo
.
getId
());
companyScenicInfoReqVo
.
setProductOrInterface
(
0
);
ResponseResult
result
=
new
ResponseResult
();
try
{
result
=
storeFeign
.
getCompanyScenicInfo
(
companyScenicInfoReqVo
);
}
catch
(
Exception
e
)
{
resVo
.
setMerchant
(
null
);
}
MerchantVo
merchant
=
(
MerchantVo
)
result
.
getData
();
resVo
.
setMerchant
(
merchant
);
//
try {
//
result = storeFeign.getCompanyScenicInfo(companyScenicInfoReqVo);
//
} catch (Exception e) {
//
resVo.setMerchant(null);
//
}
//
MerchantVo merchant = (MerchantVo) result.getData();
//
resVo.setMerchant(merchant);
/*获取用户权限列表*/
RoleAuthorityGetReqVo
roleAuthorityGetReqVo
=
new
RoleAuthorityGetReqVo
();
...
...
src/main/java/com/pangding/web/authority/service/impl/UserServiceImpl.java
View file @
768cb72f
...
...
@@ -8,6 +8,7 @@ import com.pangding.web.authority.service.UserService;
import
com.pangding.web.authority.vo.*
;
import
com.pangding.web.authority.vo.resvo.WebUserResVo
;
import
com.pangding.web.constant.AuthorityConstant
;
import
com.pangding.web.constant.PangdConstant
;
import
com.pangding.web.util.RSAUtils
;
import
com.pangding.web.vo.system.pd.authority.RoleAuthorityVo
;
import
com.pangding.web.vo.system.pd.authority.RoleVo
;
...
...
@@ -330,8 +331,10 @@ public class UserServiceImpl implements UserService {
*
* @param saveUserReqVo
*/
@Override
public
ResponseResult
<
String
>
registerSaveUser
(
SaveUserReqVo
saveUserReqVo
){
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
public
ResponseResult
<
String
>
registerSaveUser
(
SaveUserReqVo
saveUserReqVo
)
{
// 用户名是否存在
UserReqVo
userReqVo
=
new
UserReqVo
();
userReqVo
.
setAccount
(
saveUserReqVo
.
getAccount
());
...
...
@@ -340,10 +343,10 @@ public class UserServiceImpl implements UserService {
// 用户名已存在
return
ResponseResult
.
error
(
"99"
,
"该用户名已存在"
);
}
try
{
try
{
/*将RSA加密后的密码解密*/
String
password
=
RSAUtils
.
decryptionByPrivateKey
(
saveUserReqVo
.
getPassword
(),
RsaConstant
.
privateKey
);
String
confirmPassword
=
RSAUtils
.
decryptionByPrivateKey
(
saveUserReqVo
.
getConfirmPassword
(),
RsaConstant
.
privateKey
);
String
password
=
saveUserReqVo
.
getPassword
();
//
RSAUtils.decryptionByPrivateKey(saveUserReqVo.getPassword(), RsaConstant.privateKey);
String
confirmPassword
=
saveUserReqVo
.
getConfirmPassword
();
//
RSAUtils.decryptionByPrivateKey(saveUserReqVo.getConfirmPassword(), RsaConstant.privateKey);
if
(!
StringHelper
.
compare
(
password
,
confirmPassword
))
{
return
ResponseResult
.
error
(
"99"
,
"两次填写的密码不相等"
);
}
...
...
@@ -352,13 +355,12 @@ public class UserServiceImpl implements UserService {
CompanyReqVo
companyReqVo
=
new
CompanyReqVo
();
companyReqVo
.
setInvitationCode
(
saveUserReqVo
.
getInvitationCode
());
CompanyResVo
companyResVo
=
companyDao
.
load
(
companyReqVo
,
CompanyResVo
.
class
);
if
(
StringHelper
.
isEmpty
(
companyResVo
))
{
if
(
StringHelper
.
isEmpty
(
companyResVo
))
{
// 邀请码不正确
return
ResponseResult
.
error
(
"99"
,
"邀请码错误"
);
}
// TODO 是否需要判断商户的状态
String
companyId
=
StringHelper
.
getNewID
();
String
userId
=
StringHelper
.
getNewID
();
...
...
@@ -372,6 +374,7 @@ public class UserServiceImpl implements UserService {
userVo
.
setCreateTime
(
DateHelper
.
getNow
());
userVo
.
setCreateId
(
userId
);
userVo
.
setCreateName
(
saveUserReqVo
.
getAccount
());
userVo
.
setStatus
(
0
);
userDao
.
create
(
userVo
);
// 保存公司表
...
...
@@ -379,6 +382,16 @@ public class UserServiceImpl implements UserService {
companyVo
.
setId
(
companyId
);
companyVo
.
setInvitationCompanyId
(
companyResVo
.
getId
());
companyVo
.
setStatus
(
CompanyConstant
.
COMPANY_STATUS_INIT
);
companyVo
.
setNature
(
saveUserReqVo
.
getCompanyType
());
if
(
3
==
companyVo
.
getNature
()){
companyVo
.
setCompanyType
(
0
);
}
else
{
companyVo
.
setCompanyType
(
1
);
}
companyVo
.
setSigningStatus
(
0
);
companyVo
.
setCreateTime
(
DateHelper
.
getNow
());
companyVo
.
setProductOrInterface
(
0
);
companyVo
.
setExamineStatus
(
0
);
companyDao
.
create
(
companyVo
);
// 保存公司扩展信息表
CompanyExtendVo
companyExtendVo
=
new
CompanyExtendVo
();
...
...
@@ -390,18 +403,21 @@ public class UserServiceImpl implements UserService {
RoleVo
roleVo
=
new
RoleVo
();
roleVo
.
setId
(
roleId
);
roleVo
.
setCompanyId
(
companyId
);
roleVo
.
setName
(
saveUserReqVo
+
"Admin"
);
roleVo
.
setRemark
(
saveUserReqVo
+
"Admin"
);
roleVo
.
setName
(
saveUserReqVo
.
getAccount
()
+
"Admin"
);
roleVo
.
setRemark
(
saveUserReqVo
.
getAccount
()
+
"Admin"
);
roleDao
.
create
(
roleVo
);
// 保存角色用户表
UserRoleVo
userRoleVo
=
new
UserRoleVo
();
userRoleVo
.
setId
(
StringHelper
.
getNewID
());
userRoleVo
.
setUserId
(
userId
);
userRoleVo
.
setRoleId
(
roleId
);
userRoleDao
.
create
(
userRoleVo
);
// 保存角色权限表 先查询默认权限,跟角色添加默认权限
AuthorityReqVo
authorityReqVo
=
new
AuthorityReqVo
();
authorityReqVo
.
setAttribute
(
PangdConstant
.
ATTRIBUTE_SCENIC
);
authorityReqVo
.
setAuthorityLevel
(
AuthorityConstant
.
AUTHORITY_LEVEL_DEFAULT
);
List
<
AuthorityResVo
>
authorityResVoList
=
authorityDao
.
loadList
(
authorityReqVo
,
AuthorityResVo
.
class
);
for
(
int
i
=
0
;
i
<
authorityResVoList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
authorityResVoList
.
size
();
i
++)
{
AuthorityResVo
authorityResVo
=
authorityResVoList
.
get
(
i
);
RoleAuthorityVo
roleAuthorityVo
=
new
RoleAuthorityVo
();
roleAuthorityVo
.
setId
(
StringHelper
.
getNewID
());
...
...
@@ -410,7 +426,7 @@ public class UserServiceImpl implements UserService {
roleAuthorityDao
.
create
(
roleAuthorityVo
);
}
return
ResponseResult
.
result
(
"注册成功"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
return
ResponseResult
.
error
(
"99"
,
e
.
getMessage
());
}
}
...
...
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