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
403645c8
Commit
403645c8
authored
May 06, 2023
by
曹盼盼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改登录接口
parent
12fa0cb8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
158 additions
and
7 deletions
+158
-7
MobileLoginParam.java
...oin/amos/boot/module/tzs/api/common/MobileLoginParam.java
+3
-2
RegUnitInfoMapper.java
...mos/boot/module/tzs/flc/api/mapper/RegUnitInfoMapper.java
+1
-0
RegUnitInfoMapper.xml
...e-tzs-api/src/main/resources/mapper/RegUnitInfoMapper.xml
+76
-2
TzsAppController.java
...amos/boot/module/tzs/biz/controller/TzsAppController.java
+16
-3
TzsAppService.java
.../amos/boot/module/tzs/biz/service/impl/TzsAppService.java
+62
-0
No files found.
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/common/MobileLoginParam.java
View file @
403645c8
...
...
@@ -36,12 +36,12 @@ public class MobileLoginParam {
private
String
code
;
/**
*
注册类型为2-手机验证登录时使用:
手机号
*
账号或
手机号
*/
private
String
phoneNo
;
/**
*
注册类型为2-手机验证登录时使用:验证
码
*
密
码
*/
private
String
verifyCode
;
}
\ No newline at end of file
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 @
403645c8
...
...
@@ -15,4 +15,5 @@ public interface RegUnitInfoMapper extends BaseMapper<RegUnitInfo> {
List
<
RegUnitInfo
>
userData
(
String
phone
);
RegUnitInfo
userDataINfo
(
String
adminLoginName
,
String
adminLoginPwd
);
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/resources/mapper/RegUnitInfoMapper.xml
View file @
403645c8
...
...
@@ -4,8 +4,82 @@
<select
id=
"userData"
resultType=
"com.yeejoin.amos.boot.module.tzs.flc.api.entity.RegUnitInfo"
>
SELECT *
FROM tz_flc_reg_unit_info WHERE admin_tel=#{phone}
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_login_name,
admin_login_pwd,
admin_tel,
admin_id_number,
state,
admin_user_id,
amos_company_seq,
rec_user_id,
rec_user_name,
rec_date,
is_delete,
unit_code_type_name,
admin_id_card_photo
FROM tz_flc_reg_unit_info WHERE admin_tel=#{phone}
</select>
<select
id=
"userDataINfo"
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_login_name=#{adminLoginName} AND admin_login_pwd=#{adminLoginPwd}
</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 @
403645c8
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
controller
;
import
com.yeejoin.amos.boot.module.tzs.api.common.MobileLoginParam
;
import
com.yeejoin.amos.boot.module.tzs.biz.service.impl.TzsAppService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.Map
;
@RestController
@Api
(
tags
=
"tzs小程序接口"
)
@RequestMapping
(
value
=
"/tzs-app"
)
...
...
@@ -41,4 +42,16 @@ public class TzsAppController {
public
ResponseModel
<
Object
>
getEquipInfoBySuperviseCode
(
String
supervisoryCode
)
{
return
ResponseHelper
.
buildResponse
(
appService
.
getEquipInfoBySuperviseCode
(
supervisoryCode
));
}
/**
* 登录
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@PostMapping
(
value
=
"/mobile/login"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"小程序登录"
,
notes
=
"小程序登录"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
login
(
@RequestBody
MobileLoginParam
param
)
{
return
ResponseHelper
.
buildResponse
(
appService
.
login
(
param
));
}
}
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 @
403645c8
...
...
@@ -7,13 +7,21 @@ import com.baomidou.mybatisplus.core.MybatisConfiguration;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.TableInfoHelper
;
import
com.yeejoin.amos.boot.biz.common.utils.QRCodeUtil
;
import
com.yeejoin.amos.boot.module.tzs.api.common.CommonException
;
import
com.yeejoin.amos.boot.module.tzs.api.common.MobileLoginParam
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.*
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.*
;
import
com.yeejoin.amos.boot.module.tzs.api.mapper.CategoryOtherInfoMapper
;
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.IdPasswordAuthModel
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.http.entity.ContentType
;
import
org.apache.ibatis.builder.MapperBuilderAssistant
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -22,6 +30,7 @@ import org.springframework.mock.web.MockMultipartFile;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
...
...
@@ -32,6 +41,7 @@ import java.lang.reflect.Field;
import
java.util.*
;
@Service
@Slf4j
public
class
TzsAppService
{
@Autowired
DesignInfoService
designInfoService
;
...
...
@@ -95,6 +105,19 @@ public class TzsAppService {
@Value
(
"${minio.url.path}"
)
String
minioPath
;
@Autowired
private
RegUnitInfoMapper
regUnitInfoMapper
;
/**
* 产品appkey
*/
private
static
final
String
appKey
=
"AMOS_STUDIO"
;
/**
* 产品product
*/
private
static
final
String
product
=
"AMOS_STUDIO_WEB"
;
private
final
int
successsCode
=
200
;
public
Map
<
String
,
Object
>
getEquipmentInfo
(
String
record
){
Map
<
String
,
Object
>
map
=
new
HashMap
();
...
...
@@ -304,4 +327,43 @@ public class TzsAppService {
CategoryOtherInfo
categoryOtherInfo
=
categoryOtherInfoMapper
.
selectOne
(
new
QueryWrapper
<
CategoryOtherInfo
>().
eq
(
"SUPERVISORY_CODE"
,
supervisoryCode
));
return
ObjectUtils
.
isEmpty
(
categoryOtherInfo
)
?
null
:
getEquipmentInfo
(
categoryOtherInfo
.
getRecord
());
}
public
Map
<
String
,
Object
>
login
(
MobileLoginParam
param
){
Map
<
String
,
Object
>
result
=
new
LinkedHashMap
<>();
IdPasswordAuthModel
idPasswordAuthModel
=
new
IdPasswordAuthModel
();
idPasswordAuthModel
.
setLoginId
(
param
.
getPhoneNo
());
idPasswordAuthModel
.
setPassword
(
param
.
getVerifyCode
());
FeignClientResult
<
Map
<
String
,
String
>>
idpassword
=
new
FeignClientResult
<>();
RequestContext
.
setToken
(
""
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
try
{
idpassword
=
Privilege
.
authClient
.
idpassword
(
idPasswordAuthModel
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
if
(
idpassword
.
getStatus
()
!=
successsCode
)
{
log
.
error
(
"调用平台手机号验证码登录失败:{}"
,
idpassword
.
getDevMessage
());
String
message
=
idpassword
.
getMessage
();
if
(
StringUtils
.
isEmpty
(
message
))
{
message
=
"账号已被禁用,请联系管理员"
;
}
throw
new
CommonException
(
600001
,
message
);
}
HashMap
<
Object
,
Object
>
authInfo
=
new
HashMap
<>();
// 设置authInfo信息
authInfo
.
put
(
"token"
,
idpassword
.
getResult
().
get
(
"token"
));
authInfo
.
put
(
"personId"
,
idpassword
.
getResult
().
get
(
"userId"
));
authInfo
.
put
(
"appKey"
,
appKey
);
authInfo
.
put
(
"product"
,
product
);
result
.
put
(
"authInfo"
,
authInfo
);
//业务查询
RegUnitInfo
userInfo
=
regUnitInfoMapper
.
userDataINfo
(
param
.
getPhoneNo
(),
param
.
getVerifyCode
());
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