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
b40a8b81
Commit
b40a8b81
authored
Jan 06, 2025
by
麻笑宇
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop_tzs_bugfix' into develop_tzs_bugfix
parents
6caa9a95
9e0ebc0f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
153 additions
and
36 deletions
+153
-36
SSOServiceImpl.java
...yeejoin/amos/api/openapi/face/service/SSOServiceImpl.java
+41
-11
JgInstallationNoticeEqMapper.java
...ot/module/jg/api/mapper/JgInstallationNoticeEqMapper.java
+10
-1
JgInstallationNoticeMapper.java
...boot/module/jg/api/mapper/JgInstallationNoticeMapper.java
+7
-0
JgUseRegistrationManageMapper.java
...t/module/jg/api/mapper/JgUseRegistrationManageMapper.java
+2
-1
JgUseRegistrationMapper.java
...os/boot/module/jg/api/mapper/JgUseRegistrationMapper.java
+1
-0
JgInstallationNoticeEqMapper.xml
...rc/main/resources/mapper/JgInstallationNoticeEqMapper.xml
+14
-0
JgInstallationNoticeMapper.xml
.../src/main/resources/mapper/JgInstallationNoticeMapper.xml
+22
-2
JgUseRegistrationManageMapper.xml
...c/main/resources/mapper/JgUseRegistrationManageMapper.xml
+27
-15
DataHandlerController.java
.../boot/module/jg/biz/controller/DataHandlerController.java
+17
-0
JgUseRegistrationManageController.java
.../jg/biz/controller/JgUseRegistrationManageController.java
+3
-3
DataHandlerServiceImpl.java
...ot/module/jg/biz/service/impl/DataHandlerServiceImpl.java
+0
-0
JgUseRegistrationManageServiceImpl.java
.../biz/service/impl/JgUseRegistrationManageServiceImpl.java
+9
-3
No files found.
amos-boot-data/amos-boot-data-accessapi/src/main/java/com/yeejoin/amos/api/openapi/face/service/SSOServiceImpl.java
View file @
b40a8b81
...
...
@@ -4,17 +4,23 @@ import cn.hutool.core.util.URLUtil;
import
cn.hutool.http.HttpUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.api.openapi.face.orm.entity.SSOAccountRelation
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.model.Page
;
import
com.yeejoin.amos.component.feign.utils.FeignUtil
;
import
com.yeejoin.amos.component.robot.AmosRequestContext
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.LoginInfoModel
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.VerifyCodeAuthModel
;
import
com.yeejoin.amos.feign.privilege.util.AesUtil
;
import
com.yeejoin.amos.openapi.enums.SSOLoginStatusEnum
;
import
com.yeejoin.amos.openapi.enums.TaAccessConfigBizeEnum
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
java.util.Date
;
import
java.util.
List
;
import
java.util.
HashMap
;
import
java.util.Map
;
/**
...
...
@@ -29,6 +35,9 @@ public class SSOServiceImpl {
@Autowired
private
SSOAccountRelationServiceImpl
ssoAccountRelationService
;
@Autowired
AmosRequestContext
amosRequestContext
;
public
Map
<
String
,
String
>
getPlatformUserInfo
(
String
portalCode
)
{
// 获取统一门户accessToken
String
accessToken
=
getPortalAccessToken
(
portalCode
);
...
...
@@ -53,20 +62,41 @@ public class SSOServiceImpl {
ssoAccountRelationService
.
save
(
ssoAccountRelation
);
return
null
;
}
// 存在两个平台用户对应关系并且登录状态(LoginStatus)为1,则用查到的用户信息登录监管平台
if
(
ssoAccountRelation
.
getLoginStatus
().
equals
(
SSOLoginStatusEnum
.
SUCCESS
.
getCode
()))
{
// 1.查询监管平台用户登录信息(loginId和password)
List
<
LoginInfoModel
>
agencyUserClientList
=
FeignUtil
.
remoteCall
(()
->
Privilege
.
agencyUserClient
.
getLoginInfoList
(
userPhoneNumber
));
if
(
ValidationUtil
.
isEmpty
(
agencyUserClientList
))
{
ssoAccountRelation
.
setLoginStatus
(
SSOLoginStatusEnum
.
FAILED
.
getCode
());
ssoAccountRelationService
.
updateById
(
ssoAccountRelation
);
RequestContext
.
setProduct
(
amosRequestContext
.
getProduct
());
RequestContext
.
setAppKey
(
amosRequestContext
.
getAppKey
());
RequestContext
.
setToken
(
amosRequestContext
.
getToken
());
// 1.查询监管平台用户信息
Page
<
AgencyUserModel
>
agencyUserModelList
=
FeignUtil
.
remoteCall
(()
->
Privilege
.
agencyUserClient
.
queryForPage
(
null
,
null
,
userPhoneNumber
,
null
,
1
,
100
));
if
(
ValidationUtil
.
isEmpty
(
agencyUserModelList
)
||
agencyUserModelList
.
getTotal
()
==
0
)
{
ssoAccountRelation
.
setLoginStatus
(
SSOLoginStatusEnum
.
FAILED
.
getCode
());
ssoAccountRelationService
.
updateById
(
ssoAccountRelation
);
return
null
;
}
else
{
ssoAccountRelation
.
setLoginStatus
(
SSOLoginStatusEnum
.
SUCCESS
.
getCode
());
// 2.登录监管平台
Map
<
String
,
String
>
agencyUserModel
=
(
Map
<
String
,
String
>)
agencyUserModelList
.
getRecords
().
get
(
0
);
VerifyCodeAuthModel
verifyCodeAuthModel
=
new
VerifyCodeAuthModel
();
verifyCodeAuthModel
.
setLoginId
(
agencyUserModel
.
get
(
"userName"
));
verifyCodeAuthModel
.
setVerifyCode
(
AesUtil
.
encode
(
agencyUserModel
.
get
(
"userName"
),
"qaz"
));
FeignClientResult
<
Map
<
String
,
String
>>
loginResult
;
loginResult
=
Privilege
.
authClient
.
userNameVerifyCode
(
verifyCodeAuthModel
);
if
(
loginResult
.
getStatus
()
!=
200
)
{
return
null
;
}
// 2.登录监管平台
ssoAccountRelationService
.
updateById
(
ssoAccountRelation
);
String
amosUserId
=
loginResult
.
getResult
().
get
(
"userId"
);
String
amosToken
=
loginResult
.
getResult
().
get
(
"token"
);
// 3.为用户授权应用
RequestContext
.
setToken
(
amosToken
);
RequestContext
.
setAgencyCode
(
"tzs"
);
RequestContext
.
setExeUserId
(
amosUserId
);
FeignUtil
.
remoteCall
(()
->
Privilege
.
applicationClient
.
queryUserService
());
// 4.返回监管平台用户登录信息
Map
<
String
,
String
>
result
=
new
HashMap
<>();
result
.
put
(
"amosToken"
,
amosToken
);
result
.
put
(
"amosUserId"
,
amosUserId
);
return
result
;
}
return
null
;
}
/**
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/mapper/JgInstallationNoticeEqMapper.java
View file @
b40a8b81
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
mapper
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNoticeEq
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
java.util.List
;
/**
* 安装告知设备关系表 Mapper 接口
...
...
@@ -11,4 +13,11 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public
interface
JgInstallationNoticeEqMapper
extends
CustomBaseMapper
<
JgInstallationNoticeEq
>
{
/**
* 查询安装告知完成但是纳管状态非已纳管的管道
*
* @return List<JgInstallationNoticeEq> 管道record数组
*/
List
<
JgInstallationNoticeEq
>
selectErrorRecordOfInIntoManage
();
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/mapper/JgInstallationNoticeMapper.java
View file @
b40a8b81
...
...
@@ -52,4 +52,11 @@ public interface JgInstallationNoticeMapper extends CustomBaseMapper<JgInstallat
List
<
Map
<
String
,
Object
>>
getDeviceListByProjectContraption
(
@Param
(
"projectContraptionSeq"
)
String
projectContraptionSeq
);
List
<
Map
<
String
,
Object
>>
getPipelineEquInfoByRecords
(
@Param
(
"records"
)
List
<
String
>
records
);
/**
* 安装使用登记查询关联的安装告知
* @param useRegisterId 使用登记id
* @return 登记关联的告知
*/
JgInstallationNotice
selectNoticeDataByUseRegisterId
(
@Param
(
"useRegisterId"
)
String
useRegisterId
);
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/mapper/JgUseRegistrationManageMapper.java
View file @
b40a8b81
...
...
@@ -34,6 +34,7 @@ public interface JgUseRegistrationManageMapper extends BaseMapper<JgUseRegistrat
List
<
CertificateVo
>
queryCertificateInIds
(
@Param
(
"ids"
)
List
<
String
>
ids
);
@MapKey
(
"year"
)
List
<
Map
<
String
,
String
>>
initUseRegistrationCodeIntoRedis
(
@Param
(
"year"
)
String
year
);
List
<
Map
<
String
,
String
>>
initVehicleUseRegCodeIntoRedis
(
@Param
(
"year"
)
String
year
);
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/mapper/JgUseRegistrationMapper.java
View file @
b40a8b81
...
...
@@ -121,4 +121,5 @@ public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> {
* @return List<Map<String, Object>>
*/
List
<
Map
<
String
,
Object
>>
selectPieLineListByOfCanReg
(
@Param
(
"projectContraptionSeq"
)
String
projectContraptionSeq
);
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgInstallationNoticeEqMapper.xml
View file @
b40a8b81
...
...
@@ -2,4 +2,18 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeEqMapper"
>
<select
id=
"selectErrorRecordOfInIntoManage"
resultType=
"com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNoticeEq"
>
SELECT
ne.equ_id
FROM
"tzs_jg_installation_notice" n,
tzs_jg_installation_notice_eq ne,
"idx_biz_jg_use_info" u
WHERE
n.notice_status = '6616'
and ne.equip_transfer_id = n.sequence_nbr
and ne.equ_id = u."RECORD"
and (u."IS_INTO_MANAGEMENT" = false or u."IS_INTO_MANAGEMENT" is null)
and n.project_contraption
<![CDATA[<>]]>
''
</select>
</mapper>
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgInstallationNoticeMapper.xml
View file @
b40a8b81
...
...
@@ -315,6 +315,26 @@
</where>
</select>
<select
id=
"selectNoticeDataByUseRegisterId"
resultType=
"com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice"
>
SELECT
n.sequence_nbr,
n.project_contraption,
n.project_contraption_id,
ne.equ_id as remark
FROM
"tzs_jg_installation_notice" n,
tzs_jg_installation_notice_eq ne
WHERE
n.notice_status = '6616'
and ne.equip_transfer_id = n.sequence_nbr
and ne.equ_id = (
select
re.equ_id
from
tzs_jg_use_registration_eq re
where
re.equip_transfer_id = #{useRegisterId} limit 1
)
limit 1
</select>
</mapper>
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgUseRegistrationManageMapper.xml
View file @
b40a8b81
...
...
@@ -217,25 +217,37 @@
<select
id=
"initUseRegistrationCodeIntoRedis"
resultType=
"java.util.Map"
>
SELECT
SUBSTR(
t.use_registration_code, 1, 5
) AS prefix,
SUBSTR(
MAX(t.use_registration_code), 6, 5
) AS code
SUBSTR(
T.use_registration_code, 1, 5
) AS prefix,
SUBSTR(
MAX ( T.use_registration_code ), 6, 5
) AS code
FROM
tzs_jg_use_registration_manage t
LEFT JOIN
tzs_jg_use_registration tjur
ON tjur.use_registration_code = t.use_registration_code
AND (tjur.reg_type IS NULL OR tjur.reg_type = '2' OR tjur.reg_type = '0')
AND tjur.is_delete = 0
LEFT JOIN
tzs_jg_vehicle_information v
ON v.use_registration_code = t.use_registration_code
and v.reg_type = '0'
tzs_jg_use_registration_manage T
RIGHT JOIN tzs_jg_use_registration tjur ON tjur.use_registration_code = T.use_registration_code
WHERE
LENGTH(t.use_registration_code
) = 14
AND SUBSTR(
t.use_registration_code, 1, 1) IN ('容', '锅', '管', '瓶', '梯', '起', '索', '游', '车'
)
LENGTH ( T.use_registration_code
) = 14
AND SUBSTR(
T.use_registration_code, 1, 1 ) IN ( '容', '锅', '管', '瓶', '梯', '起', '索', '游', '车'
)
AND TRIM(t.use_registration_code) LIKE concat('%(',#{year},')')
AND ( tjur.reg_type IS NULL OR tjur.reg_type = '2' OR tjur.reg_type = '0' )
AND tjur.is_delete = 0
GROUP BY
SUBSTR(t.use_registration_code, 1, 5)
SUBSTR( T.use_registration_code, 1, 5 )
HAVING code
<![CDATA[ <> ]]>
'00000'
ORDER BY prefix
</select>
<select
id=
"initVehicleUseRegCodeIntoRedis"
resultType=
"java.util.Map"
>
SELECT
SUBSTR(M.use_registration_code, 1, 5) AS prefix,
SUBSTR(MAX(M.use_registration_code), 6, 5) AS code
FROM
tzs_jg_use_registration_manage M
RIGHT JOIN tzs_jg_vehicle_information v ON v.use_registration_code = M.use_registration_code
WHERE
LENGTH ( M.use_registration_code ) = 14
AND SUBSTR( M.use_registration_code, 1, 1 ) IN ( '容', '锅', '管', '瓶', '梯', '起', '索', '游', '车' )
and v.reg_type is null
AND TRIM ( M.use_registration_code ) LIKE concat ( '%(',#{year}, ')' )
GROUP BY
SUBSTR( M.use_registration_code, 1, 5 )
HAVING code
<![CDATA[ <> ]]>
'00000'
ORDER BY prefix
</select>
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/DataHandlerController.java
View file @
b40a8b81
...
...
@@ -69,4 +69,21 @@ public class DataHandlerController extends BaseController {
return
ResponseHelper
.
buildResponse
(
true
);
}
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"安装告知缺少装置id、装置未创建、安装告知完成但是设备状态为未纳管数据处理"
,
notes
=
"历史数据处理"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/v3/projectContraption/notice"
)
public
ResponseModel
<
Boolean
>
projectContraptionNoticeDataDealV3
(){
dataHandlerService
.
projectContraptionNoticeDataDeal
();
return
ResponseHelper
.
buildResponse
(
true
);
}
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"使用登记缺少装置id数据处理"
,
notes
=
"历史数据处理,依赖/v3/projectContraption/notice作为基础数据"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/v3/projectContraption/useRegister"
)
public
ResponseModel
<
Boolean
>
projectContraptionUseRegisterDataDealV3
(){
dataHandlerService
.
projectContraptionUseRegisterDataDeal
();
return
ResponseHelper
.
buildResponse
(
true
);
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/JgUseRegistrationManageController.java
View file @
b40a8b81
...
...
@@ -318,9 +318,9 @@ public class JgUseRegistrationManageController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/initRegCodeIntoRedis"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"初始化使用登记证序列号到Redis"
,
notes
=
"初始化使用登记证序列号到Redis"
)
public
ResponseModel
<
Object
>
initUseRegistrationCodeIntoRedis
()
{
jgUseRegistrationManageServiceImpl
.
initUseRegistrationCodeIntoRedis
();
return
ResponseHelper
.
buildResponse
(
"
Redis初始化完成!"
);
public
ResponseModel
<
Object
>
initUseRegistrationCodeIntoRedis
(
@RequestParam
(
value
=
"year"
,
defaultValue
=
"24"
)
String
year
)
{
jgUseRegistrationManageServiceImpl
.
initUseRegistrationCodeIntoRedis
(
year
);
return
ResponseHelper
.
buildResponse
(
year
+
"年使用登记证序列码
Redis初始化完成!"
);
}
/**
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/DataHandlerServiceImpl.java
View file @
b40a8b81
This diff is collapsed.
Click to expand it.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/JgUseRegistrationManageServiceImpl.java
View file @
b40a8b81
...
...
@@ -766,12 +766,18 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr
return
parseArray
(
json
,
FormValue
.
class
);
}
public
void
initUseRegistrationCodeIntoRedis
()
{
public
void
initUseRegistrationCodeIntoRedis
(
String
year
)
{
// 获取当前年份的两位数
String
currentYearSuffix
=
String
.
valueOf
(
LocalDate
.
now
().
getYear
()
%
100
);
Date
endOfYear
=
com
.
yeejoin
.
amos
.
boot
.
module
.
ymt
.
api
.
common
.
DateUtils
.
calculateEndOfYear
(
new
Date
());
// 从数据库中加载数据并批量设置到 Redis
jgUseRegistrationManageMapper
.
initUseRegistrationCodeIntoRedis
(
currentYearSuffix
)
// 非车用气瓶-从数据库中加载使用登记证最大序列码刷新到Redis中
jgUseRegistrationManageMapper
.
initUseRegistrationCodeIntoRedis
(
year
)
.
forEach
(
resultMap
->
Optional
.
ofNullable
(
resultMap
)
.
ifPresent
(
map
->
setValueWithoutExpiration
(
map
.
get
(
"prefix"
),
map
.
get
(
"code"
)))
);
// 车用气瓶-从数据库中加载使用登记证最大序列码刷新到Redis中
jgUseRegistrationManageMapper
.
initVehicleUseRegCodeIntoRedis
(
year
)
.
forEach
(
resultMap
->
Optional
.
ofNullable
(
resultMap
)
.
ifPresent
(
map
->
setValueWithoutExpiration
(
map
.
get
(
"prefix"
),
map
.
get
(
"code"
)))
...
...
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