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
97bcd858
Commit
97bcd858
authored
Jul 24, 2024
by
刘林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jg):移装变更接口修改
parent
489273ed
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
82 additions
and
17 deletions
+82
-17
JgChangeRegistrationTransferEq.java
.../module/jg/api/entity/JgChangeRegistrationTransferEq.java
+6
-0
JgChangeRegistrationTransferMapper.java
...ule/jg/api/mapper/JgChangeRegistrationTransferMapper.java
+2
-0
JgChangeRegistrationTransferMapper.xml
...n/resources/mapper/JgChangeRegistrationTransferMapper.xml
+3
-1
JgChangeRegistrationTransferController.java
...iz/controller/JgChangeRegistrationTransferController.java
+0
-16
JgChangeRegistrationTransferServiceImpl.java
...service/impl/JgChangeRegistrationTransferServiceImpl.java
+0
-0
JgChangeRegistrationTransferUsedCheckImpl.java
...rvice/impl/JgChangeRegistrationTransferUsedCheckImpl.java
+71
-0
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/entity/JgChangeRegistrationTransferEq.java
View file @
97bcd858
...
...
@@ -64,4 +64,10 @@ public class JgChangeRegistrationTransferEq extends BaseEntity {
@TableField
(
"device_info"
)
private
String
deviceInfo
;
/**
* 使用登记证
*/
@TableField
(
"use_registration_code"
)
private
String
useRegistrationCode
;
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/mapper/JgChangeRegistrationTransferMapper.java
View file @
97bcd858
...
...
@@ -29,4 +29,6 @@ public interface JgChangeRegistrationTransferMapper extends BaseMapper<JgChangeR
@Select
(
"select name from tz_equipment_category where code=#{code}"
)
String
getEquiplistNameByEquiplist
(
String
code
);
List
<
String
>
queryForFlowingEquipList
();
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgChangeRegistrationTransferMapper.xml
View file @
97bcd858
...
...
@@ -110,5 +110,7 @@
</if>
recDate desc
</select>
<select
id=
"queryForFlowingEquipList"
resultType=
"java.lang.String"
>
select change_data from tzs_jg_registration_history WHERE registration_class = '移装变更登记'
</select>
</mapper>
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/JgChangeRegistrationTransferController.java
View file @
97bcd858
...
...
@@ -49,14 +49,6 @@ public class JgChangeRegistrationTransferController extends BaseController {
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增移装变更登记登记"
,
notes
=
"新增移装变更登记登记"
)
public
ResponseModel
<
Object
>
save
(
@RequestParam
(
value
=
"submitType"
)
String
submitType
,
@RequestBody
JSONObject
map
)
{
Map
<
String
,
Object
>
tableData
=
(
Map
<
String
,
Object
>)
map
.
get
(
TABLE_PAGE_ID
);
if
(
ValidationUtil
.
isEmpty
(
tableData
)){
throw
new
BadRequest
(
"参数校验失败."
);
}
String
equId
=
(
String
)
tableData
.
get
(
"record"
);
if
(
ValidationUtil
.
isEmpty
(
equId
)){
throw
new
BadRequest
(
"参数校验失败."
);
}
ReginParams
reginParams
=
getSelectedOrgInfo
();
return
ResponseHelper
.
buildResponse
(
jgChangeRegistrationTransferService
.
createTransfer
(
submitType
,
map
,
reginParams
));
}
...
...
@@ -72,14 +64,6 @@ public class JgChangeRegistrationTransferController extends BaseController {
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新移装变更登记登记"
,
notes
=
"根据sequenceNbr更新移装变更登记登记"
)
public
ResponseModel
<
Object
>
updateBySequenceNbr
(
@RequestParam
(
value
=
"submitType"
)
String
submitType
,
@RequestBody
JSONObject
map
)
{
Map
<
String
,
Object
>
tableData
=
(
Map
<
String
,
Object
>)
map
.
get
(
TABLE_PAGE_ID
);
if
(
ValidationUtil
.
isEmpty
(
tableData
)){
throw
new
BadRequest
(
"参数校验失败."
);
}
String
equId
=
(
String
)
tableData
.
get
(
"sequenceNbr"
);
if
(
ValidationUtil
.
isEmpty
(
equId
)){
throw
new
BadRequest
(
"参数校验失败."
);
}
ReginParams
reginParams
=
getSelectedOrgInfo
();
return
ResponseHelper
.
buildResponse
(
jgChangeRegistrationTransferService
.
updateTransfer
(
submitType
,
map
,
reginParams
));
}
...
...
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/JgChangeRegistrationTransferServiceImpl.java
View file @
97bcd858
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/JgChangeRegistrationTransferUsedCheckImpl.java
0 → 100644
View file @
97bcd858
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgChangeRegistrationTransferMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.redisson.api.RBucket
;
import
org.redisson.api.RedissonClient
;
import
org.springframework.stereotype.Component
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
* @author Administrator
*/
@Component
@Slf4j
public
class
JgChangeRegistrationTransferUsedCheckImpl
extends
BaseEquipUsedCheckService
{
private
final
RedissonClient
redissonClient
;
private
final
String
bizType
=
"changeRegistrationTransfer"
;
private
final
JgChangeRegistrationTransferMapper
mapper
;
public
JgChangeRegistrationTransferUsedCheckImpl
(
RedissonClient
redissonClient
,
JgChangeRegistrationTransferMapper
mapper
)
{
this
.
redissonClient
=
redissonClient
;
this
.
mapper
=
mapper
;
}
@Override
public
RedissonClient
getRedisClient
()
{
return
redissonClient
;
}
@Override
public
String
getApplyBizType
()
{
return
bizType
;
}
public
void
init
()
{
// 获取设备数据并处理
Map
<
String
,
Set
<
String
>>
resultMap
=
mapper
.
queryForFlowingEquipList
().
stream
()
.
filter
(
Objects:
:
nonNull
)
.
flatMap
(
changeData
->
{
JSONObject
changeDataJson
=
JSON
.
parseObject
(
changeData
);
return
changeDataJson
.
getJSONArray
(
"registrationList"
).
stream
()
.
filter
(
item
->
item
instanceof
JSONObject
)
.
map
(
item
->
(
JSONObject
)
item
)
.
collect
(
Collectors
.
groupingBy
(
reg
->
reg
.
getString
(
"useUnitCreditCode"
),
Collectors
.
mapping
(
reg
->
reg
.
getString
(
"sequenceNbr"
),
Collectors
.
toSet
())
)).
entrySet
().
stream
();
})
.
collect
(
Collectors
.
toMap
(
Map
.
Entry
::
getKey
,
Map
.
Entry
::
getValue
,
(
existing
,
replacement
)
->
{
existing
.
addAll
(
replacement
);
return
existing
;
}
));
// 将结果存储到 Redis
resultMap
.
forEach
((
companyCode
,
records
)
->
{
RBucket
<
Set
<
String
>>
rBucket
=
redissonClient
.
getBucket
(
getFlowingEquipRedisKey
(
companyCode
,
bizType
));
rBucket
.
set
(
records
);
});
}
}
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