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
38a531bd
Commit
38a531bd
authored
Nov 21, 2024
by
韩桐桐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jg):三环车用气瓶监听查询接口排除已经入库的一部分数据
parent
75771fd9
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
82 additions
and
55 deletions
+82
-55
ShCarMapper.java
...m/yeejoin/amos/boot/module/jg/api/mapper/ShCarMapper.java
+4
-0
IShCarService.java
...eejoin/amos/boot/module/jg/api/service/IShCarService.java
+3
-0
ShCarMapper.xml
...t-module-jg-api/src/main/resources/mapper/ShCarMapper.xml
+14
-0
ShCarController.java
...n/amos/boot/module/jg/biz/controller/ShCarController.java
+1
-55
ShCarServiceImpl.java
...mos/boot/module/jg/biz/service/impl/ShCarServiceImpl.java
+60
-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/mapper/ShCarMapper.java
View file @
38a531bd
...
...
@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.yeejoin.amos.boot.module.jg.api.dto.ShCarDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.ShCar
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
/**
* 三环系统-车辆信息表 Mapper 接口
...
...
@@ -15,4 +17,6 @@ public interface ShCarMapper extends BaseMapper<ShCar> {
Page
<
ShCarDto
>
queryForshCarPage
(
Page
<
ShCarDto
>
page
,
ShCarDto
dto
);
Integer
alreadyExist
(
@Param
(
"value"
)
String
value
);
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/service/IShCarService.java
View file @
38a531bd
...
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jg.api.service;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jg.api.dto.ShCarDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.ShCar
;
import
java.util.Map
;
...
...
@@ -16,4 +17,6 @@ public interface IShCarService {
Page
<
ShCarDto
>
queryForShCarPage
(
Page
<
ShCarDto
>
page
,
ShCarDto
dto
);
Boolean
claim
(
Map
<
String
,
Object
>
paramMap
);
ShCar
searchForSanHan
(
Map
<?,
?>
map
);
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/ShCarMapper.xml
View file @
38a531bd
...
...
@@ -25,4 +25,18 @@
ORDER BY
tsc.USE_REGISTRATION_CODE DESC
</select>
<select
id=
"alreadyExist"
resultType=
"java.lang.Integer"
>
SELECT SUM(num) AS total_count
FROM (SELECT COUNT(*) AS num
FROM "amos_tzs_biz"."idx_biz_jg_register_info" jri
LEFT JOIN "amos_tzs_biz"."idx_biz_jg_other_info" joi ON joi."RECORD" = jri."RECORD"
WHERE (jri."USE_ORG_CODE" = #{value} OR jri."CAR_NUMBER" = #{value})
AND joi.CLAIM_STATUS = '已认领'
UNION ALL
SELECT COUNT(*) AS num
FROM "amos_tzs_biz"."tzs_jg_vehicle_information"
WHERE "identification_code" = #{value}
and "status" != '已作废') AS combined_counts;
</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/ShCarController.java
View file @
38a531bd
...
...
@@ -42,9 +42,6 @@ public class ShCarController extends BaseController {
@Autowired
ShCarServiceImpl
shCarServiceImpl
;
@Resource
ShCarEquServiceImpl
shCarEquServiceImpl
;
@Autowired
IShCarService
iShCarService
;
...
...
@@ -161,58 +158,7 @@ public class ShCarController extends BaseController {
if
(
map
==
null
||
map
.
isEmpty
())
{
return
ResponseHelper
.
buildResponse
(
new
ShCar
());
// 返回空对象
}
ShCar
shCar
=
null
;
for
(
Object
value
:
map
.
values
())
{
String
sanHuanInputValue
=
String
.
valueOf
(
value
);
// 如果值为空,直接跳过
if
(
ValidationUtil
.
isEmpty
(
sanHuanInputValue
))
{
continue
;
}
// 查询 ShCar 表
shCar
=
shCarServiceImpl
.
getBaseMapper
()
.
selectList
(
new
LambdaQueryWrapper
<
ShCar
>()
.
eq
(
ShCar:
:
getClaimedFlag
,
Boolean
.
FALSE
)
.
and
(
w
->
w
.
eq
(
ShCar:
:
getCarNumber
,
sanHuanInputValue
)
.
or
()
.
eq
(
ShCar:
:
getUseRegistrationCode
,
sanHuanInputValue
)
.
or
()
.
eq
(
ShCar:
:
getFrameNumber
,
sanHuanInputValue
)
)
).
stream
().
findFirst
().
orElse
(
null
);
// 如果找到符合条件的 ShCar,直接返回
if
(
shCar
!=
null
&&
!
ValidationUtil
.
isEmpty
(
shCar
.
getSequenceNbr
()))
{
return
ResponseHelper
.
buildResponse
(
shCar
);
}
// 查询 ShCarEqu 表
Optional
<
ShCarEqu
>
carEqu
=
shCarEquServiceImpl
.
getBaseMapper
()
.
selectList
(
new
LambdaQueryWrapper
<
ShCarEqu
>()
.
eq
(
ShCarEqu:
:
getEquCode
,
sanHuanInputValue
))
.
stream
().
findFirst
();
// 如果 ShCarEqu 存在,继续查询 ShCar
if
(
carEqu
.
isPresent
())
{
shCar
=
shCarServiceImpl
.
getBaseMapper
()
.
selectList
(
new
LambdaQueryWrapper
<
ShCar
>()
.
eq
(
ShCar:
:
getClaimedFlag
,
Boolean
.
FALSE
)
.
eq
(
ShCar:
:
getSequenceNbr
,
carEqu
.
get
().
getCarId
())
).
stream
().
findFirst
().
orElse
(
null
);
// 如果找到,直接返回
if
(
shCar
!=
null
&&
!
ValidationUtil
.
isEmpty
(
shCar
.
getSequenceNbr
()))
{
return
ResponseHelper
.
buildResponse
(
shCar
);
}
}
}
// 如果未找到,返回空对象
return
ResponseHelper
.
buildResponse
(
new
ShCar
());
return
ResponseHelper
.
buildResponse
(
shCarServiceImpl
.
searchForSanHan
(
map
));
}
...
...
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/ShCarServiceImpl.java
View file @
38a531bd
...
...
@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.yeejoin.amos.boot.biz.common.bo.CompanyBo
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
...
...
@@ -64,6 +65,8 @@ public class ShCarServiceImpl extends BaseService<ShCar, ShCar, ShCarMapper> imp
@Resource
private
RedisUtils
redisUtils
;
@Resource
ShCarEquServiceImpl
shCarEquServiceImpl
;
@Resource
private
SnowflakeIdUtil
sequence
;
@Resource
private
IdxBizJgUseInfoServiceImpl
idxBizJgUseInfoService
;
...
...
@@ -128,6 +131,63 @@ public class ShCarServiceImpl extends BaseService<ShCar, ShCar, ShCarMapper> imp
}
@Override
public
ShCar
searchForSanHan
(
Map
<?,
?>
map
)
{
ShCar
shCar
=
null
;
for
(
Object
value
:
map
.
values
())
{
String
sanHuanInputValue
=
String
.
valueOf
(
value
);
// 如果值为空,直接跳过
if
(
ValidationUtil
.
isEmpty
(
sanHuanInputValue
))
{
continue
;
}
// 查询 ShCar 表
shCar
=
this
.
getBaseMapper
()
.
selectList
(
new
LambdaQueryWrapper
<
ShCar
>()
.
eq
(
ShCar:
:
getClaimedFlag
,
Boolean
.
FALSE
)
.
and
(
w
->
w
.
eq
(
ShCar:
:
getCarNumber
,
sanHuanInputValue
)
.
or
()
.
eq
(
ShCar:
:
getUseRegistrationCode
,
sanHuanInputValue
)
.
or
()
.
eq
(
ShCar:
:
getFrameNumber
,
sanHuanInputValue
)
)
).
stream
().
findFirst
().
orElse
(
null
);
// 如果找到符合条件的 ShCar,再检查该使用登记证号、车牌号或者车架号是否已经在系统中通过历史设备登记入库
if
(
shCar
!=
null
&&
!
ValidationUtil
.
isEmpty
(
shCar
.
getSequenceNbr
())
&&
!
alreadyExist
(
sanHuanInputValue
))
{
return
shCar
;
}
// 查询 ShCarEqu 表
Optional
<
ShCarEqu
>
carEqu
=
shCarEquServiceImpl
.
getBaseMapper
()
.
selectList
(
new
LambdaQueryWrapper
<
ShCarEqu
>()
.
eq
(
ShCarEqu:
:
getEquCode
,
sanHuanInputValue
))
.
stream
().
findFirst
();
// 如果 ShCarEqu 存在,继续查询 ShCar
if
(
carEqu
.
isPresent
())
{
shCar
=
this
.
getBaseMapper
()
.
selectList
(
new
LambdaQueryWrapper
<
ShCar
>()
.
eq
(
ShCar:
:
getClaimedFlag
,
Boolean
.
FALSE
)
.
eq
(
ShCar:
:
getSequenceNbr
,
carEqu
.
get
().
getCarId
())
).
stream
().
findFirst
().
orElse
(
null
);
// 如果找到,再检查该使用登记证号、车牌号或者车架号是否已经在系统中通过历史设备登记入库
if
(
shCar
!=
null
&&
!
ValidationUtil
.
isEmpty
(
shCar
.
getSequenceNbr
())
&&
!
alreadyExist
(
sanHuanInputValue
))
{
return
shCar
;
}
}
}
// 如果未找到,返回空对象
return
new
ShCar
();
}
/**
* 判断是否已存在在一码通库中
*
* @param value 登记证号、车牌号或者车架号
* @return result
*/
public
Boolean
alreadyExist
(
String
value
)
{
return
this
.
baseMapper
.
alreadyExist
(
value
)
>
0
;
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Boolean
claim
(
Map
<
String
,
Object
>
paramMap
)
{
...
...
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