Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
项目统一框架
amos-boot-biz
Commits
b2086a28
Commit
b2086a28
authored
May 19, 2023
by
曹盼盼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改登录逻辑
parent
a537c28a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
106 additions
and
4 deletions
+106
-4
RegUnitInfoMapper.java
...mos/boot/module/tzs/flc/api/mapper/RegUnitInfoMapper.java
+3
-0
RegUnitInfoMapper.xml
...e-tzs-api/src/main/resources/mapper/RegUnitInfoMapper.xml
+39
-0
TzsAppController.java
...amos/boot/module/tzs/biz/controller/TzsAppController.java
+56
-1
TzsAppService.java
.../amos/boot/module/tzs/biz/service/impl/TzsAppService.java
+8
-3
No files found.
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/mapper/RegUnitInfoMapper.java
View file @
b2086a28
...
...
@@ -16,4 +16,7 @@ public interface RegUnitInfoMapper extends BaseMapper<RegUnitInfo> {
List
<
RegUnitInfo
>
userData
(
String
phone
);
RegUnitInfo
userDataINfo
(
String
adminLoginName
,
String
adminLoginPwd
);
RegUnitInfo
userIdINfo
(
String
userId
);
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/resources/mapper/RegUnitInfoMapper.xml
View file @
b2086a28
...
...
@@ -83,5 +83,44 @@
AND admin_login_pwd=#{adminLoginPwd}
</select>
<select
id=
"userIdINfo"
resultType=
"com.yeejoin.amos.boot.module.tzs.flc.api.entity.RegUnitInfo"
>
SELECT
sequence_nbr,
name,
unit_code,
unit_code_type,
unit_type,
unit_type_code,
management_unit,
management_unit_id,
region_code,
country,
province,
city,
district,
stree,
community,
address,
longitude,
latitude,
industry_name,
legal_person,
legal_person_tel,
contact_person,
contact_person_tel,
admin_name,
admin_tel,
admin_id_number,
amos_company_seq,
unit_code_type_name,
admin_id_card_photo
FROM tz_flc_reg_unit_info WHERE
admin_user_id=#{userId}
</select>
</mapper>
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/TzsAppController.java
View file @
b2086a28
...
...
@@ -13,11 +13,15 @@ import com.yeejoin.amos.boot.module.tzs.api.entity.TzBaseEnterpriseInfo;
import
com.yeejoin.amos.boot.module.tzs.api.service.ITzBaseEnterpriseInfoService
;
import
com.yeejoin.amos.boot.module.tzs.biz.service.impl.EquipmentCategoryServiceImpl
;
import
com.yeejoin.amos.boot.module.tzs.biz.service.impl.TzsAppService
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.entity.RegUnitInfo
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.mapper.RegUnitInfoMapper
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.PermissionModel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -36,6 +40,7 @@ import java.util.Map;
import
java.util.stream.Collectors
;
@RestController
@Slf4j
@Api
(
tags
=
"tzs小程序接口"
)
@RequestMapping
(
value
=
"/tzs-app"
)
public
class
TzsAppController
{
...
...
@@ -43,6 +48,9 @@ public class TzsAppController {
@Autowired
TzsAppService
appService
;
@Autowired
private
RegUnitInfoMapper
regUnitInfoMapper
;
@Autowired
ITzBaseEnterpriseInfoService
iTzBaseEnterpriseInfoService
;
@Autowired
private
EquipmentCategoryServiceImpl
equipmentCategoryService
;
...
...
@@ -125,4 +133,51 @@ public class TzsAppController {
return
app
;
}
}
//修改密码
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/{userId}/password"
,
method
=
RequestMethod
.
PUT
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"修改密码"
,
notes
=
"修改密码"
)
public
ResponseModel
<
Boolean
>
updatePassword
(
@PathVariable
(
"userId"
)
String
userId
,
@RequestBody
AgencyUserModel
AgencyUserModel
)
{
Boolean
result
=
false
;
if
(
ValidationUtil
.
isEmpty
(
userId
)
||
ValidationUtil
.
isEmpty
(
AgencyUserModel
.
getOriginalPassword
())
||
ValidationUtil
.
isEmpty
(
AgencyUserModel
.
getRePassword
())
||
ValidationUtil
.
isEmpty
(
AgencyUserModel
.
getPassword
())
)
{
log
.
error
(
"用户信息不能为空"
);
return
ResponseHelper
.
buildResponse
(
result
);
}
if
(!
AgencyUserModel
.
getRePassword
().
equals
(
AgencyUserModel
.
getPassword
()))
{
log
.
error
(
"两次密码不一致"
);
return
ResponseHelper
.
buildResponse
(
result
);
}
//平台修改
AgencyUserModel
.
setUserId
(
userId
);
FeignClientResult
<
AgencyUserModel
>
agencyUserModelFeignClientResult
=
Privilege
.
agencyUserClient
.
modifyPassword
(
userId
,
AgencyUserModel
);
if
(
agencyUserModelFeignClientResult
.
getStatus
()
!=
200
)
{
log
.
error
(
"Privilege远程调用失败"
);
return
ResponseHelper
.
buildResponse
(
result
);
}
if
(
ValidationUtil
.
isEmpty
(
agencyUserModelFeignClientResult
.
getResult
())
||
ValidationUtil
.
isEmpty
(
agencyUserModelFeignClientResult
.
getResult
().
getUserId
()))
{
log
.
error
(
"平台修改失败"
);
return
ResponseHelper
.
buildResponse
(
result
);
}
//走业务修改
LambdaQueryWrapper
<
RegUnitInfo
>
objectLambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
objectLambdaQueryWrapper
.
eq
(
RegUnitInfo:
:
getAdminUserId
,
agencyUserModelFeignClientResult
.
getResult
().
getUserId
());
RegUnitInfo
regUnitInfo
=
new
RegUnitInfo
();
regUnitInfo
.
setAdminLoginPwd
(
AgencyUserModel
.
getRePassword
());
int
update
=
regUnitInfoMapper
.
update
(
regUnitInfo
,
objectLambdaQueryWrapper
);
if
(
update
==
0
)
{
log
.
error
(
"业务更新失败"
);
return
ResponseHelper
.
buildResponse
(
result
);
}
result
=
true
;
return
ResponseHelper
.
buildResponse
(
result
);
}
}
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/TzsAppService.java
View file @
b2086a28
...
...
@@ -348,13 +348,18 @@ public class TzsAppService {
}
if
(
idpassword
.
getStatus
()
!=
successsCode
)
{
log
.
error
(
"
调用平台手机号验证码登录失败:{}
"
,
idpassword
.
getDevMessage
());
log
.
error
(
"
远程调用Privilege服务失败
"
,
idpassword
.
getDevMessage
());
String
message
=
idpassword
.
getMessage
();
if
(
StringUtils
.
isEmpty
(
message
))
{
message
=
"账号
已被禁用,请联系管理员
"
;
message
=
"账号
或密码错误
"
;
}
throw
new
CommonException
(
600001
,
message
);
}
if
(
ValidationUtil
.
isEmpty
(
idpassword
)
||
ValidationUtil
.
isEmpty
(
idpassword
.
getResult
())
||
ValidationUtil
.
isEmpty
(
idpassword
.
getResult
().
get
(
"userId"
)))
{
log
.
error
(
"未修改成功"
);
return
new
HashMap
<
String
,
Object
>();
}
HashMap
<
Object
,
Object
>
authInfo
=
new
HashMap
<>();
// 设置authInfo信息
authInfo
.
put
(
"token"
,
idpassword
.
getResult
().
get
(
"token"
));
...
...
@@ -363,7 +368,7 @@ public class TzsAppService {
authInfo
.
put
(
"product"
,
product
);
result
.
put
(
"authInfo"
,
authInfo
);
//业务查询
RegUnitInfo
userInfo
=
regUnitInfoMapper
.
user
DataINfo
(
param
.
getPhoneNo
(),
param
.
getVerifyCode
(
));
RegUnitInfo
userInfo
=
regUnitInfoMapper
.
user
IdINfo
(
idpassword
.
getResult
().
get
(
"userId"
));
result
.
put
(
"userInfo"
,
userInfo
);
return
result
;
}
...
...
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