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
132c9620
Commit
132c9620
authored
Nov 21, 2024
by
刘林
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop_tzs_bugfix' into develop_tzs_bugfix
parents
856b8fb1
66132b3a
Show whitespace changes
Inline
Side-by-side
Showing
38 changed files
with
2946 additions
and
101 deletions
+2946
-101
CylinderService.java
...eejoin/amos/api/openapi/face/service/CylinderService.java
+43
-18
IssueTypeEnum.java
...join/amos/boot/module/common/api/enums/IssueTypeEnum.java
+22
-4
ZBGLEnum.java
...m/yeejoin/amos/boot/module/common/api/enums/ZBGLEnum.java
+14
-12
ShCarDto.java
...ava/com/yeejoin/amos/boot/module/jg/api/dto/ShCarDto.java
+177
-0
ShCarEquDto.java
.../com/yeejoin/amos/boot/module/jg/api/dto/ShCarEquDto.java
+104
-0
JgCertificateChangeRecord.java
.../boot/module/jg/api/entity/JgCertificateChangeRecord.java
+4
-3
JgCertificateChangeRecordEq.java
...oot/module/jg/api/entity/JgCertificateChangeRecordEq.java
+4
-2
JgUseRegistrationManage.java
...os/boot/module/jg/api/entity/JgUseRegistrationManage.java
+4
-10
JgVehicleInformation.java
.../amos/boot/module/jg/api/entity/JgVehicleInformation.java
+4
-2
JgVehicleInformationEq.java
...mos/boot/module/jg/api/entity/JgVehicleInformationEq.java
+4
-2
ShCar.java
...ava/com/yeejoin/amos/boot/module/jg/api/entity/ShCar.java
+216
-0
ShCarEqu.java
.../com/yeejoin/amos/boot/module/jg/api/entity/ShCarEqu.java
+148
-0
ShCarEquMapper.java
...eejoin/amos/boot/module/jg/api/mapper/ShCarEquMapper.java
+14
-0
ShCarMapper.java
...m/yeejoin/amos/boot/module/jg/api/mapper/ShCarMapper.java
+18
-0
IShCarEquService.java
...oin/amos/boot/module/jg/api/service/IShCarEquService.java
+9
-0
IShCarService.java
...eejoin/amos/boot/module/jg/api/service/IShCarService.java
+19
-0
CarAndEquVo.java
...a/com/yeejoin/amos/boot/module/jg/api/vo/CarAndEquVo.java
+18
-0
ShCarEquVo.java
...va/com/yeejoin/amos/boot/module/jg/api/vo/ShCarEquVo.java
+120
-0
CommonMapper.xml
...-module-jg-api/src/main/resources/mapper/CommonMapper.xml
+6
-1
ShCarEquMapper.xml
...odule-jg-api/src/main/resources/mapper/ShCarEquMapper.xml
+5
-0
ShCarMapper.xml
...t-module-jg-api/src/main/resources/mapper/ShCarMapper.xml
+28
-0
ShCarController.java
...n/amos/boot/module/jg/biz/controller/ShCarController.java
+230
-0
ShCarEquController.java
...mos/boot/module/jg/biz/controller/ShCarEquController.java
+127
-0
IdxBizJgRegisterInfoServiceImpl.java
.../jg/biz/service/impl/IdxBizJgRegisterInfoServiceImpl.java
+39
-0
JgVehicleInformationServiceImpl.java
.../jg/biz/service/impl/JgVehicleInformationServiceImpl.java
+30
-0
ShCarEquServiceImpl.java
.../boot/module/jg/biz/service/impl/ShCarEquServiceImpl.java
+87
-0
ShCarServiceImpl.java
...mos/boot/module/jg/biz/service/impl/ShCarServiceImpl.java
+513
-0
JyjcInspectionResultDataModel.java
.../module/jyjc/api/model/JyjcInspectionResultDataModel.java
+5
-0
InspectionApplicationPushEventListener.java
...vent/listener/InspectionApplicationPushEventListener.java
+34
-12
JyjcInspectionResultServiceImpl.java
...yjc/biz/service/impl/JyjcInspectionResultServiceImpl.java
+67
-23
ZBGLStatisticsMapper.java
...ot/module/statistics/api/mapper/ZBGLStatisticsMapper.java
+10
-0
ZBGLStatisticsMapper.xml
...cs-api/src/main/resources/mapper/ZBGLStatisticsMapper.xml
+65
-0
JYJCDPStatisticsServiceImpl.java
...atistcs/biz/service/impl/JYJCDPStatisticsServiceImpl.java
+2
-2
AyhlxyhslpmServiceImpl.java
...tcs/biz/service/impl/ZBGLImpl/AyhlxyhslpmServiceImpl.java
+121
-0
DnztdwyhpmServiceImpl.java
...stcs/biz/service/impl/ZBGLImpl/DnztdwyhpmServiceImpl.java
+149
-0
KrjyydqkServiceImpl.java
...tistcs/biz/service/impl/ZBGLImpl/KrjyydqkServiceImpl.java
+15
-10
QyaqzstjServiceImpl.java
...tistcs/biz/service/impl/ZBGLImpl/QyaqzstjServiceImpl.java
+326
-0
YwblpjsxtjServiceImpl.java
...stcs/biz/service/impl/ZBGLImpl/YwblpjsxtjServiceImpl.java
+145
-0
No files found.
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/service/CylinderService.java
View file @
132c9620
...
@@ -17,8 +17,6 @@ import org.springframework.beans.BeanUtils;
...
@@ -17,8 +17,6 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.PlatformTransactionManager
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.component.cache.Redis
;
import
org.typroject.tyboot.component.cache.Redis
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
...
@@ -26,10 +24,15 @@ import org.typroject.tyboot.core.foundation.context.RequestContext;
...
@@ -26,10 +24,15 @@ import org.typroject.tyboot.core.foundation.context.RequestContext;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
javax.annotation.PostConstruct
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.concurrent.BlockingQueue
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
import
java.util.concurrent.LinkedBlockingQueue
;
/**
/**
* 气瓶service
* 气瓶service
...
@@ -48,11 +51,11 @@ public class CylinderService {
...
@@ -48,11 +51,11 @@ public class CylinderService {
private
final
TmCylinderFillingRecordService
cylinderFillingRecordService
;
private
final
TmCylinderFillingRecordService
cylinderFillingRecordService
;
private
final
TmCylinderFillingService
cylinderFillingService
;
private
final
TmCylinderFillingService
cylinderFillingService
;
private
final
PlatformTransactionManager
transactionManager
;
private
final
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
)
;
private
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
private
final
BlockingQueue
<
CylinderFillingMessageModel
>
blockingQueue
=
new
LinkedBlockingQueue
<>(
);
public
CylinderService
(
RedisTemplate
redisTemplate
,
CylinderFillingDataValidationService
cylinderFillingDataValidationService
,
TmCylinderFillingMessageService
cylinderFillingMessageService
,
EmqKeeper
emqKeeper
,
TmCylinderFillingCheckService
cylinderFillingCheckService
,
TmCylinderFillingRecordService
cylinderFillingRecordService
,
TmCylinderFillingService
cylinderFillingService
,
PlatformTransactionManager
transactionManager
)
{
public
CylinderService
(
RedisTemplate
redisTemplate
,
CylinderFillingDataValidationService
cylinderFillingDataValidationService
,
TmCylinderFillingMessageService
cylinderFillingMessageService
,
EmqKeeper
emqKeeper
,
TmCylinderFillingCheckService
cylinderFillingCheckService
,
TmCylinderFillingRecordService
cylinderFillingRecordService
,
TmCylinderFillingService
cylinderFillingService
)
{
this
.
redisTemplate
=
redisTemplate
;
this
.
redisTemplate
=
redisTemplate
;
this
.
cylinderFillingDataValidationService
=
cylinderFillingDataValidationService
;
this
.
cylinderFillingDataValidationService
=
cylinderFillingDataValidationService
;
this
.
cylinderFillingMessageService
=
cylinderFillingMessageService
;
this
.
cylinderFillingMessageService
=
cylinderFillingMessageService
;
...
@@ -60,7 +63,6 @@ public class CylinderService {
...
@@ -60,7 +63,6 @@ public class CylinderService {
this
.
cylinderFillingCheckService
=
cylinderFillingCheckService
;
this
.
cylinderFillingCheckService
=
cylinderFillingCheckService
;
this
.
cylinderFillingRecordService
=
cylinderFillingRecordService
;
this
.
cylinderFillingRecordService
=
cylinderFillingRecordService
;
this
.
cylinderFillingService
=
cylinderFillingService
;
this
.
cylinderFillingService
=
cylinderFillingService
;
this
.
transactionManager
=
transactionManager
;
}
}
@DSTransactional
@DSTransactional
...
@@ -101,8 +103,8 @@ public class CylinderService {
...
@@ -101,8 +103,8 @@ public class CylinderService {
emqKeeper
.
getMqttClient
().
publish
(
"openapi/cylinder/filling"
,
JSONObject
.
fromObject
(
cylinderFillingMessage
).
toString
().
getBytes
(),
2
,
false
);
emqKeeper
.
getMqttClient
().
publish
(
"openapi/cylinder/filling"
,
JSONObject
.
fromObject
(
cylinderFillingMessage
).
toString
().
getBytes
(),
2
,
false
);
}
}
@Transactional
//
@Transactional
public
JSONArray
validateFillingData
(
JSONObject
jsonobject
,
CylinderFillingMessage
cylinderFillingMessage
)
throws
MqttException
{
public
JSONArray
validateFillingData
(
JSONObject
jsonobject
,
CylinderFillingMessage
cylinderFilling
Log
Message
)
throws
MqttException
{
CylinderFillingDataValidationResultModel
validateResult
=
null
;
CylinderFillingDataValidationResultModel
validateResult
=
null
;
try
{
try
{
...
@@ -110,13 +112,13 @@ public class CylinderService {
...
@@ -110,13 +112,13 @@ public class CylinderService {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
logger
.
error
(
"液化气体气瓶充装信息上报,数据校验失败"
);
logger
.
error
(
"液化气体气瓶充装信息上报,数据校验失败"
);
cylinderFillingMessage
.
setMessage
(
e
.
getMessage
());
cylinderFilling
Log
Message
.
setMessage
(
e
.
getMessage
());
}
}
JSONArray
errorData
=
new
JSONArray
();
JSONArray
errorData
=
new
JSONArray
();
if
(!
ObjectUtils
.
isEmpty
(
validateResult
))
{
if
(!
ObjectUtils
.
isEmpty
(
validateResult
))
{
cylinderFillingMessage
.
setCylinderNumber
(
validateResult
.
getCylinderNumber
());
cylinderFilling
Log
Message
.
setCylinderNumber
(
validateResult
.
getCylinderNumber
());
List
<
String
>
message
=
new
ArrayList
<>();
List
<
String
>
message
=
new
ArrayList
<>();
int
errorNumber
=
0
;
int
errorNumber
=
0
;
JSONObject
error
=
new
JSONObject
();
JSONObject
error
=
new
JSONObject
();
...
@@ -144,23 +146,46 @@ public class CylinderService {
...
@@ -144,23 +146,46 @@ public class CylinderService {
if
(!
ObjectUtils
.
isEmpty
(
validateResult
.
getSeqCodeErrorData
()))
{
if
(!
ObjectUtils
.
isEmpty
(
validateResult
.
getSeqCodeErrorData
()))
{
errorNumber
+=
validateResult
.
getSeqCodeErrorData
().
size
();
errorNumber
+=
validateResult
.
getSeqCodeErrorData
().
size
();
error
.
put
(
"气瓶信息不存在:"
,
validateResult
.
getSeqCodeErrorData
());
error
.
put
(
"气瓶信息不存在:"
,
validateResult
.
getSeqCodeErrorData
());
message
.
add
(
"气瓶信息不存在数量:"
+
validateResult
.
getSeqCodeErrorData
().
size
());
message
.
add
(
"气瓶信息不存在数量:"
+
validateResult
.
getSeqCodeErrorData
().
size
()
+
"个"
);
errorData
.
add
(
error
);
errorData
.
add
(
error
);
}
}
if
(
errorNumber
<=
0
)
{
if
(
errorNumber
<=
0
)
{
message
.
add
(
"液化气体气瓶充装信息成功数:"
+
validateResult
.
getSuccessCylinderNumber
()
+
"条"
);
cylinderFillingLogMessage
.
setMessage
(
"液化气体气瓶充装信息成功数:"
+
validateResult
.
getSuccessCylinderNumber
()
+
"条"
);
}
else
{
}
else
{
cylinderFillingMessage
.
setMessage
(
String
.
join
(
"条; "
,
message
)
+
"个"
);
cylinderFillingLogMessage
.
setMessage
(
String
.
join
(
"条; "
,
message
));
CylinderFillingMessageModel
cylinderFillingMessageModel
=
new
CylinderFillingMessageModel
();
// cylinderFillingMessageService.createWithModel(cylinderFillingMessageModel);
BeanUtils
.
copyProperties
(
cylinderFillingMessage
,
cylinderFillingMessageModel
);
emqKeeper
.
getMqttClient
().
publish
(
"openapi/cylinder/filling"
,
JSONObject
.
fromObject
(
cylinderFillingLogMessage
).
toString
().
getBytes
(),
2
,
false
);
cylinderFillingMessageService
.
createWithModel
(
cylinderFillingMessageModel
);
emqKeeper
.
getMqttClient
().
publish
(
"openapi/cylinder/filling"
,
JSONObject
.
fromObject
(
cylinderFillingMessage
).
toString
().
getBytes
(),
2
,
false
);
throw
new
BadRequest
(
error
.
toString
());
}
}
CylinderFillingMessageModel
cylinderFillingMessageModel
=
new
CylinderFillingMessageModel
();
BeanUtils
.
copyProperties
(
cylinderFillingLogMessage
,
cylinderFillingMessageModel
);
// 充装信息概览放入blockingQueue
blockingQueue
.
add
(
cylinderFillingMessageModel
);
}
else
{
}
else
{
errorData
.
add
(
new
JSONObject
().
put
(
"数据校验失败"
,
"数据校验失败"
));
errorData
.
add
(
new
JSONObject
().
put
(
"数据校验失败"
,
"数据校验失败"
));
}
}
return
errorData
;
return
errorData
;
}
}
@PostConstruct
void
init
()
{
ExecutorService
executorService
=
Executors
.
newFixedThreadPool
(
3
);
for
(
int
i
=
0
;
i
<
3
;
i
++)
{
executorService
.
execute
(()
->
{
try
{
while
(
true
)
{
logger
.
info
(
"处理气瓶对接错误信息入库~开始"
);
CylinderFillingMessageModel
cylinderFillingMessageModel
=
blockingQueue
.
take
();
cylinderFillingMessageService
.
createWithModel
(
cylinderFillingMessageModel
);
logger
.
info
(
"处理气瓶对接错误信息入库~完成"
);
}
}
catch
(
InterruptedException
e
)
{
Thread
.
currentThread
().
interrupt
();
logger
.
error
(
"处理气瓶对接错误信息入库异常"
,
e
);
throw
new
RuntimeException
(
e
);
}
});
}
}
}
}
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/enums/IssueTypeEnum.java
View file @
132c9620
...
@@ -2,10 +2,7 @@ package com.yeejoin.amos.boot.module.common.api.enums;
...
@@ -2,10 +2,7 @@ package com.yeejoin.amos.boot.module.common.api.enums;
import
lombok.Getter
;
import
lombok.Getter
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.EnumSet
;
import
java.util.HashMap
;
import
java.util.List
;
@Getter
@Getter
public
enum
IssueTypeEnum
{
public
enum
IssueTypeEnum
{
...
@@ -83,4 +80,25 @@ public enum IssueTypeEnum {
...
@@ -83,4 +80,25 @@ public enum IssueTypeEnum {
return
list
;
return
list
;
}
}
public
static
List
<
String
>
getEnumCodeListByMainBody
(
String
mainBody
)
{
List
<
String
>
list
=
new
ArrayList
<>();
for
(
IssueTypeEnum
testEnum
:
EnumSet
.
allOf
(
IssueTypeEnum
.
class
))
{
if
(
testEnum
.
getMainBody
().
contains
(
mainBody
)){
list
.
add
(
testEnum
.
getCode
());
}
}
return
list
;
}
public
static
List
<
Map
<
String
,
String
>>
getEnumListByMainBody
(
String
mainBody
)
{
List
<
Map
<
String
,
String
>>
list
=
new
ArrayList
<>();
for
(
IssueTypeEnum
testEnum
:
EnumSet
.
allOf
(
IssueTypeEnum
.
class
))
{
if
(
testEnum
.
getMainBody
().
contains
(
mainBody
)){
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"name"
,
testEnum
.
getName
());
map
.
put
(
"code"
,
testEnum
.
getCode
());
list
.
add
(
map
);
}
}
return
list
;
}
}
}
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/enums/ZBGLEnum.java
View file @
132c9620
...
@@ -8,18 +8,18 @@ import java.util.*;
...
@@ -8,18 +8,18 @@ import java.util.*;
@Getter
@Getter
@AllArgsConstructor
@AllArgsConstructor
public
enum
ZBGLEnum
{
public
enum
ZBGLEnum
{
YJCZ
(
"应急处置"
,
"yjcz"
,
true
,
null
,
""
),
YJCZ
(
"应急处置"
,
"yjcz"
,
true
,
null
,
""
,
false
),
DTGZYYZBFX
(
"电梯故障原因占比分析"
,
"dtgzyyzbfx"
,
false
,
"yjcz"
,
"dtgzyyzbfxServiceImpl"
),
DTGZYYZBFX
(
"电梯故障原因占比分析"
,
"dtgzyyzbfx"
,
false
,
"yjcz"
,
"dtgzyyzbfxServiceImpl"
,
false
),
DTKRSJCSFX
(
"电梯困人事件场所分布"
,
"dtkrsjcsfx"
,
false
,
"yjcz"
,
"dtkrsjcsfxServiceImpl"
),
DTKRSJCSFX
(
"电梯困人事件场所分布"
,
"dtkrsjcsfx"
,
false
,
"yjcz"
,
"dtkrsjcsfxServiceImpl"
,
false
),
KRJYYDQK
(
"困人救援月度情况"
,
"krjyydqk"
,
false
,
"yjcz"
,
"krjyydqkServiceImpl"
),
KRJYYDQK
(
"困人救援月度情况"
,
"krjyydqk"
,
false
,
"yjcz"
,
"krjyydqkServiceImpl"
,
false
),
JDGL
(
"监督管理"
,
"jdgl"
,
true
,
null
,
""
),
JDGL
(
"监督管理"
,
"jdgl"
,
true
,
null
,
""
,
false
),
YWBLPJSXTJ
(
"业务办理平均时效统计"
,
"ywblpjsxtj"
,
false
,
"jdgl"
,
"
"
),
YWBLPJSXTJ
(
"业务办理平均时效统计"
,
"ywblpjsxtj"
,
false
,
"jdgl"
,
"
ywblpjsxtjServiceImpl"
,
false
),
AQZS
(
"安全追溯"
,
"aqzs"
,
true
,
null
,
""
),
AQZS
(
"安全追溯"
,
"aqzs"
,
true
,
null
,
""
,
false
),
YHSLQS
(
"隐患数量趋势(近12个月)"
,
"yhslqs"
,
false
,
"aqzs"
,
""
),
// YHSLQS("隐患数量趋势(近12个月)","yhslqs",false,"aqzs","",false
),
AYHLXYHSLPM
(
"按隐患类型隐患数量排名(Top10)"
,
"ayhlxyhslpm"
,
false
,
"aqzs"
,
"
"
),
AYHLXYHSLPM
(
"按隐患类型隐患数量排名(Top10)"
,
"ayhlxyhslpm"
,
false
,
"aqzs"
,
"
ayhlxyhslpmServiceImpl"
,
false
),
DNZTDWYHPM
(
"当年主体单位隐患排名(Top10)"
,
"dnztdwyhpm"
,
false
,
"aqzs"
,
"
"
),
DNZTDWYHPM
(
"当年主体单位隐患排名(Top10)"
,
"dnztdwyhpm"
,
false
,
"aqzs"
,
"
dnztdwyhpmServiceImpl"
,
true
),
QP
(
"气瓶"
,
"qp"
,
true
,
null
,
""
),
QP
(
"气瓶"
,
"qp"
,
true
,
null
,
""
,
false
),
QYAQZSTJ
(
"区域安全指数统计"
,
"qyaqzstj"
,
false
,
"qp"
,
"
"
),
QYAQZSTJ
(
"区域安全指数统计"
,
"qyaqzstj"
,
false
,
"qp"
,
"
qyaqzstjServiceImpl"
,
false
),
;
;
...
@@ -28,6 +28,7 @@ public enum ZBGLEnum {
...
@@ -28,6 +28,7 @@ public enum ZBGLEnum {
Boolean
isMainBody
;
Boolean
isMainBody
;
String
mainBody
;
String
mainBody
;
String
className
;
String
className
;
Boolean
havePage
;
public
static
List
<
Map
<
String
,
Object
>>
getEnumList
()
{
public
static
List
<
Map
<
String
,
Object
>>
getEnumList
()
{
List
<
Map
<
String
,
Object
>>
result
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
result
=
new
ArrayList
<>();
...
@@ -42,6 +43,7 @@ public enum ZBGLEnum {
...
@@ -42,6 +43,7 @@ public enum ZBGLEnum {
HashMap
<
String
,
Object
>
childrenMap
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
childrenMap
=
new
HashMap
<>();
childrenMap
.
put
(
"title"
,
childrenEnum
.
name
);
childrenMap
.
put
(
"title"
,
childrenEnum
.
name
);
childrenMap
.
put
(
"value"
,
childrenEnum
.
code
);
childrenMap
.
put
(
"value"
,
childrenEnum
.
code
);
childrenMap
.
put
(
"havePage"
,
childrenEnum
.
havePage
);
childrenList
.
add
(
childrenMap
);
childrenList
.
add
(
childrenMap
);
}
}
}
}
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/dto/ShCarDto.java
0 → 100644
View file @
132c9620
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
dto
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
lombok.*
;
import
java.util.Date
;
/**
* 三环系统-车辆信息表
*
* @author system_generator
* @date 2024-11-08
*/
@Data
@ApiModel
(
value
=
"ShCarDto"
,
description
=
"三环系统-车辆信息表"
)
@Builder
@AllArgsConstructor
@NoArgsConstructor
public
class
ShCarDto
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"seq"
)
@TableId
(
"SEQUENCE_NBR"
)
private
String
sequenceNbr
;
@ApiModelProperty
(
value
=
"登记机关"
)
@TableField
(
"REGISTRATION_AGENCY"
)
private
String
registrationAgency
;
@ApiModelProperty
(
value
=
"登记机关代码"
)
@TableField
(
"REGISTRATION_AGENCY_CODE"
)
private
String
registrationAgencyCode
;
@ApiModelProperty
(
value
=
"使用登记证代码"
)
@TableField
(
"USE_REGISTRATION_CODE"
)
private
String
useRegistrationCode
;
@ApiModelProperty
(
value
=
"气瓶安装日期"
)
@TableField
(
"INSTALL_START_DATE"
)
private
Date
installStartDate
;
@ApiModelProperty
(
value
=
"车辆属性 A 代表 私家车 B代表公交车 C代表快捷货运 H 代表营运车 P代表公务车 V 代表微型货运车 X代表 其他 T代表出租车 J代表教练车 "
)
@TableField
(
"VEHICLE_ATTRIBUTE"
)
private
String
vehicleAttribute
;
@ApiModelProperty
(
value
=
"车牌号"
)
@TableField
(
"CAR_NUMBER"
)
private
String
carNumber
;
@ApiModelProperty
(
value
=
"车架号"
)
@TableField
(
"FRAME_NUMBER"
)
private
String
frameNumber
;
@ApiModelProperty
(
value
=
"登记日期"
)
@TableField
(
"REG_DATE"
)
private
Date
regDate
;
@ApiModelProperty
(
value
=
"停用日期"
)
@TableField
(
"DEA_DATE"
)
private
Date
deaDate
;
@ApiModelProperty
(
value
=
"发动机号"
)
@TableField
(
"ENGINE_NUMBER"
)
private
String
engineNumber
;
@ApiModelProperty
(
value
=
"气瓶数量"
)
@TableField
(
"BATCH_QUANTITY"
)
private
Integer
batchQuantity
;
@ApiModelProperty
(
value
=
"车辆品牌型号"
)
@TableField
(
"VEHICLE_BRAND_MODEL"
)
private
String
vehicleBrandModel
;
@ApiModelProperty
(
value
=
"证打印标识"
)
@TableField
(
"CERTIFICATE_PRINT_FLAG"
)
private
String
certificatePrintFlag
;
@ApiModelProperty
(
value
=
"联系人"
)
@TableField
(
"CONTACT_PERSON"
)
private
String
contactPerson
;
@ApiModelProperty
(
value
=
"联系电话"
)
@TableField
(
"CONTACT_PHONE"
)
private
String
contactPhone
;
@ApiModelProperty
(
value
=
"所有人"
)
@TableField
(
"OWNER"
)
private
String
owner
;
@ApiModelProperty
(
value
=
"安装单位"
)
@TableField
(
"INSTALLATION_UNIT"
)
private
String
installationUnit
;
@ApiModelProperty
(
value
=
"改装车是否打印备案通知单 原装车 忽略看"
)
@TableField
(
"IF_FLAG"
)
private
String
ifFlag
;
@ApiModelProperty
(
value
=
"第一次打印证日期"
)
@TableField
(
"PRINT_DATE"
)
private
Date
printDate
;
@ApiModelProperty
(
value
=
"充装介质"
)
@TableField
(
"MEDIA"
)
private
String
media
;
@ApiModelProperty
(
value
=
"最新检验报告编号"
)
@TableField
(
"LAST_INSPECT_REPORT_NO"
)
private
String
lastInspectReportNo
;
@ApiModelProperty
(
value
=
"气瓶状态 0正常 1变更 2报废 3注销 4启用 5停用 6注销"
)
@TableField
(
"STATE"
)
private
Integer
state
;
@ApiModelProperty
(
value
=
"登记单位"
)
@TableField
(
"REG_UNIT"
)
private
String
regUnit
;
@ApiModelProperty
(
value
=
"总容积"
)
@TableField
(
"TOTAL_VOLUME"
)
private
String
totalVolume
;
@ApiModelProperty
(
value
=
"监检/检验单位"
)
@TableField
(
"INSPECTION_UNIT"
)
private
String
inspectionUnit
;
@ApiModelProperty
(
value
=
"气瓶加装方式"
)
@TableField
(
"CYLINDER_INSTALLATION_METHOD"
)
private
String
cylinderInstallationMethod
;
@ApiModelProperty
(
value
=
"住址"
)
@TableField
(
"ADDRESS"
)
private
String
address
;
@ApiModelProperty
(
value
=
"上一次检验报告编号"
)
@TableField
(
"PREVIOUS_INSPECTION_REPORT_NUMBER"
)
private
String
previousInspectionReportNumber
;
@ApiModelProperty
(
value
=
"是否认领 1已认领 0未认领"
)
@TableField
(
"CLAIMED_FLAG"
)
private
String
claimedFlag
;
@ApiModelProperty
(
value
=
"登记证管理表的seq"
)
@TableField
(
exist
=
false
)
private
String
certificateSeq
;
@ApiModelProperty
(
value
=
"单位类型,个人、企业"
)
@TableField
(
exist
=
false
)
private
String
companyType
;
@ApiModelProperty
(
value
=
"使用单位名称"
)
@TableField
(
exist
=
false
)
private
String
useUnitName
;
@ApiModelProperty
(
value
=
"使用单位统一社会信用代码"
)
@TableField
(
exist
=
false
)
private
String
useUnitCreditCode
;
@ApiModelProperty
(
value
=
"使用单位地址"
)
@TableField
(
exist
=
false
)
private
String
useUnitAddress
;
@ApiModelProperty
(
value
=
"安全管理员"
)
@TableField
(
exist
=
false
)
private
String
safetyManagerId
;
@ApiModelProperty
(
value
=
"安全管理员联系电话"
)
@TableField
(
exist
=
false
)
private
String
phone
;
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/dto/ShCarEquDto.java
0 → 100644
View file @
132c9620
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
dto
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
lombok.*
;
import
java.util.Date
;
/**
*
*
* @author system_generator
* @date 2024-11-08
*/
@Data
@ApiModel
(
value
=
"ShCarEquDto"
,
description
=
""
)
@Builder
@AllArgsConstructor
@NoArgsConstructor
public
class
ShCarEquDto
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"primary key"
)
@TableId
(
"SEQUENCE_NBR"
)
private
String
sequenceNbr
;
@ApiModelProperty
(
value
=
"tzs_sh_car表主键"
)
@TableField
(
"CAR_ID"
)
private
String
carId
;
@ApiModelProperty
(
value
=
"设备编号"
)
@TableField
(
"SEQUENCE_CODE"
)
private
String
sequenceCode
;
@ApiModelProperty
(
value
=
"设备代码"
)
@TableField
(
"EQU_CODE"
)
private
String
equCode
;
@ApiModelProperty
(
value
=
"制造日期"
)
@TableField
(
"PRODUCE_DATE"
)
private
Date
produceDate
;
@ApiModelProperty
(
value
=
"安装日期"
)
@TableField
(
"EQU_INSTALLDATE"
)
private
Date
equInstalldate
;
@ApiModelProperty
(
value
=
"检查日期"
)
@TableField
(
"EQU_CHECKDATE"
)
private
Date
equCheckdate
;
@ApiModelProperty
(
value
=
"firstDate"
)
@TableField
(
"EQU_FIRSTDATE"
)
private
Date
equFirstdate
;
@ApiModelProperty
(
value
=
"序号"
)
@TableField
(
"SERIAL_NUMBER"
)
private
String
serialNumber
;
@ApiModelProperty
(
value
=
"sub_DM 代码"
)
@TableField
(
"EQU_DM"
)
private
String
equDm
;
@ApiModelProperty
(
value
=
"单位编号"
)
@TableField
(
"EQU_DWBH"
)
private
String
equDwbh
;
@ApiModelProperty
(
value
=
"公称工作压力(MPa)"
)
@TableField
(
"EQU_QPGC"
)
private
String
equQpgc
;
@ApiModelProperty
(
value
=
"气瓶批号"
)
@TableField
(
"BATCH_NUMBER"
)
private
String
batchNumber
;
@ApiModelProperty
(
value
=
"PFZZDW PF制造单位"
)
@TableField
(
"EQU_PFZZDW"
)
private
String
equPfzzdw
;
@ApiModelProperty
(
value
=
"isChange"
)
@TableField
(
"ISCHANGE"
)
private
Integer
ischange
;
@ApiModelProperty
(
value
=
"报告编号"
)
@TableField
(
"REPORTCODE"
)
private
String
reportcode
;
@ApiModelProperty
(
value
=
"BFReportCode"
)
@TableField
(
"BFREPORTCODE"
)
private
String
bfreportcode
;
@ApiModelProperty
(
value
=
"操作方式"
)
@TableField
(
"EQU_CZFS"
)
private
String
equCzfs
;
@ApiModelProperty
(
value
=
"是否认领 1已认领 0未认领"
)
@TableField
(
"CLAIMED_FLAG"
)
private
String
claimedFlag
;
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/entity/JgCertificateChangeRecord.java
View file @
132c9620
...
@@ -3,9 +3,7 @@ package com.yeejoin.amos.boot.module.jg.api.entity;
...
@@ -3,9 +3,7 @@ package com.yeejoin.amos.boot.module.jg.api.entity;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
lombok.Builder
;
import
lombok.*
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -18,6 +16,9 @@ import java.util.Date;
...
@@ -18,6 +16,9 @@ import java.util.Date;
@Data
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName
(
"tzs_jg_certificate_change_record"
)
@TableName
(
"tzs_jg_certificate_change_record"
)
public
class
JgCertificateChangeRecord
extends
BaseEntity
{
public
class
JgCertificateChangeRecord
extends
BaseEntity
{
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/entity/JgCertificateChangeRecordEq.java
View file @
132c9620
...
@@ -2,9 +2,8 @@ package com.yeejoin.amos.boot.module.jg.api.entity;
...
@@ -2,9 +2,8 @@ package com.yeejoin.amos.boot.module.jg.api.entity;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.*
;
import
org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity
;
import
org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
/**
/**
...
@@ -16,6 +15,9 @@ import lombok.experimental.Accessors;
...
@@ -16,6 +15,9 @@ import lombok.experimental.Accessors;
@Data
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName
(
"tzs_jg_certificate_change_record_eq"
)
@TableName
(
"tzs_jg_certificate_change_record_eq"
)
public
class
JgCertificateChangeRecordEq
extends
BaseEntity
{
public
class
JgCertificateChangeRecordEq
extends
BaseEntity
{
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/entity/JgUseRegistrationManage.java
View file @
132c9620
...
@@ -5,8 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
...
@@ -5,8 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.*
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -20,6 +19,9 @@ import java.util.Date;
...
@@ -20,6 +19,9 @@ import java.util.Date;
@Data
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName
(
"tzs_jg_use_registration_manage"
)
@TableName
(
"tzs_jg_use_registration_manage"
)
public
class
JgUseRegistrationManage
extends
BaseEntity
{
public
class
JgUseRegistrationManage
extends
BaseEntity
{
...
@@ -208,12 +210,4 @@ public class JgUseRegistrationManage extends BaseEntity {
...
@@ -208,12 +210,4 @@ public class JgUseRegistrationManage extends BaseEntity {
*/
*/
@TableField
(
"change_reason"
)
@TableField
(
"change_reason"
)
private
String
changeReason
;
private
String
changeReason
;
/**
*
* 登记机关名称
*/
@TableField
(
"reg_unit_name"
)
private
String
regUnitName
;
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/entity/JgVehicleInformation.java
View file @
132c9620
...
@@ -3,8 +3,7 @@ package com.yeejoin.amos.boot.module.jg.api.entity;
...
@@ -3,8 +3,7 @@ package com.yeejoin.amos.boot.module.jg.api.entity;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
lombok.Data
;
import
lombok.*
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -17,6 +16,9 @@ import java.util.Date;
...
@@ -17,6 +16,9 @@ import java.util.Date;
@Data
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName
(
"tzs_jg_vehicle_information"
)
@TableName
(
"tzs_jg_vehicle_information"
)
public
class
JgVehicleInformation
extends
BaseEntity
{
public
class
JgVehicleInformation
extends
BaseEntity
{
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/entity/JgVehicleInformationEq.java
View file @
132c9620
...
@@ -3,8 +3,7 @@ package com.yeejoin.amos.boot.module.jg.api.entity;
...
@@ -3,8 +3,7 @@ package com.yeejoin.amos.boot.module.jg.api.entity;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
lombok.Data
;
import
lombok.*
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -17,6 +16,9 @@ import java.util.Date;
...
@@ -17,6 +16,9 @@ import java.util.Date;
@Data
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName
(
"tzs_jg_vehicle_information_eq"
)
@TableName
(
"tzs_jg_vehicle_information_eq"
)
public
class
JgVehicleInformationEq
extends
BaseEntity
{
public
class
JgVehicleInformationEq
extends
BaseEntity
{
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/entity/ShCar.java
0 → 100644
View file @
132c9620
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.*
;
import
org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity
;
import
lombok.experimental.Accessors
;
import
java.util.Date
;
/**
* 三环系统-车辆信息表
*
* @author system_generator
* @date 2024-11-08
*/
@Data
@Accessors
(
chain
=
true
)
@TableName
(
"tzs_sh_car"
)
@AllArgsConstructor
@NoArgsConstructor
@Builder
public
class
ShCar
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* seq
*/
@TableField
(
value
=
"\"SEQUENCE_NBR\""
)
@TableId
(
value
=
"\"SEQUENCE_NBR\""
,
type
=
IdType
.
ID_WORKER
)
private
String
sequenceNbr
;
/**
* 登记机关
*/
@TableField
(
value
=
"\"REGISTRATION_AGENCY\""
)
private
String
registrationAgency
;
/**
* 登记机关代码
*/
@TableField
(
value
=
"\"REGISTRATION_AGENCY_CODE\""
)
private
String
registrationAgencyCode
;
/**
* 使用登记证代码
*/
@TableField
(
value
=
"\"USE_REGISTRATION_CODE\""
)
private
String
useRegistrationCode
;
/**
* 气瓶安装日期
*/
@TableField
(
value
=
"\"INSTALL_START_DATE\""
)
private
Date
installStartDate
;
/**
* 车辆属性
* A 代表 私家车 B代表公交车 C代表快捷货运 H 代表营运车 P代表公务车 V 代表微型货运车 X代表 其他 T代表出租车 J代表教练车
*/
@TableField
(
value
=
"\"VEHICLE_ATTRIBUTE\""
)
private
String
vehicleAttribute
;
/**
* 车牌号
*/
@TableField
(
value
=
"\"CAR_NUMBER\""
)
private
String
carNumber
;
/**
* 车架号
*/
@TableField
(
value
=
"\"FRAME_NUMBER\""
)
private
String
frameNumber
;
/**
* 登记日期
*/
@TableField
(
value
=
"\"REG_DATE\""
)
private
Date
regDate
;
/**
* 停用日期
*/
@TableField
(
value
=
"\"DEA_DATE\""
)
private
Date
deaDate
;
/**
* 发动机号
*/
@TableField
(
value
=
"\"ENGINE_NUMBER\""
)
private
String
engineNumber
;
/**
* 气瓶数量
*/
@TableField
(
value
=
"\"BATCH_QUANTITY\""
)
private
Integer
batchQuantity
;
/**
* 车辆品牌型号
*/
@TableField
(
value
=
"\"VEHICLE_BRAND_MODEL\""
)
private
String
vehicleBrandModel
;
/**
* 证打印标识
*/
@TableField
(
value
=
"\"CERTIFICATE_PRINT_FLAG\""
)
private
String
certificatePrintFlag
;
/**
* 联系人
*/
@TableField
(
value
=
"\"CONTACT_PERSON\""
)
private
String
contactPerson
;
/**
* 联系电话
*/
@TableField
(
value
=
"\"CONTACT_PHONE\""
)
private
String
contactPhone
;
/**
* 所有人
*/
@TableField
(
value
=
"\"OWNER\""
)
private
String
owner
;
/**
* 安装单位
*/
@TableField
(
value
=
"\"INSTALLATION_UNIT\""
)
private
String
installationUnit
;
/**
* 改装车是否打印备案通知单
* 原装车 忽略看
*/
@TableField
(
value
=
"\"IF_FLAG\""
)
private
String
ifFlag
;
/**
* 第一次打印证日期
*/
@TableField
(
value
=
"\"PRINT_DATE\""
)
private
Date
printDate
;
/**
* 充装介质
*/
@TableField
(
value
=
"\"MEDIA\""
)
private
String
media
;
/**
* 最新检验报告编号
*/
@TableField
(
value
=
"\"LAST_INSPECT_REPORT_NO\""
)
private
String
lastInspectReportNo
;
/**
* 气瓶状态
* 0正常 1变更 2报废 3注销 4启用 5停用 6注销
*/
@TableField
(
value
=
"\"STATE\""
)
private
Integer
state
;
/**
* 登记单位
*/
@TableField
(
value
=
"\"REG_UNIT\""
)
private
String
regUnit
;
/**
* 总容积
*/
@TableField
(
value
=
"\"TOTAL_VOLUME\""
)
private
String
totalVolume
;
/**
* 监检/检验单位
*/
@TableField
(
value
=
"\"INSPECTION_UNIT\""
)
private
String
inspectionUnit
;
/**
* 气瓶加装方式
*/
@TableField
(
value
=
"\"CYLINDER_INSTALLATION_METHOD\""
)
private
String
cylinderInstallationMethod
;
/**
* 住址
*/
@TableField
(
value
=
"\"ADDRESS\""
)
private
String
address
;
/**
* 上一次检验报告编号
*/
@TableField
(
value
=
"\"PREVIOUS_INSPECTION_REPORT_NUMBER\""
)
private
String
previousInspectionReportNumber
;
/**
* 是否认领 1已认领 0未认领
*/
@TableField
(
value
=
"\"CLAIMED_FLAG\""
)
private
String
claimedFlag
;
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/entity/ShCarEqu.java
0 → 100644
View file @
132c9620
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.*
;
import
org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity
;
import
lombok.experimental.Accessors
;
import
java.util.Date
;
/**
* @author system_generator
* @date 2024-11-08
*/
@Data
@Accessors
(
chain
=
true
)
@TableName
(
"tzs_sh_car_equ"
)
@AllArgsConstructor
@NoArgsConstructor
@Builder
public
class
ShCarEqu
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* primary key
*/
@TableField
(
value
=
"\"SEQUENCE_NBR\""
)
@TableId
(
value
=
"\"SEQUENCE_NBR\""
,
type
=
IdType
.
ID_WORKER
)
private
String
sequenceNbr
;
/**
* tzs_sh_car表主键
*/
@TableField
(
value
=
"\"CAR_ID\""
)
private
String
carId
;
/**
* 设备编号
*/
@TableField
(
value
=
"\"SEQUENCE_CODE\""
)
private
String
sequenceCode
;
/**
* 设备代码
*/
@TableField
(
value
=
"\"EQU_CODE\""
)
private
String
equCode
;
/**
* 制造日期
*/
@TableField
(
value
=
"\"PRODUCE_DATE\""
)
private
Date
produceDate
;
/**
* 安装日期
*/
@TableField
(
value
=
"\"EQU_INSTALLDATE\""
)
private
Date
equInstalldate
;
/**
* 检查日期
*/
@TableField
(
value
=
"\"EQU_CHECKDATE\""
)
private
Date
equCheckdate
;
/**
* firstDate
*/
@TableField
(
value
=
"\"EQU_FIRSTDATE\""
)
private
Date
equFirstdate
;
/**
* 序号
*/
@TableField
(
value
=
"\"SERIAL_NUMBER\""
)
private
String
serialNumber
;
/**
* sub_DM 代码
*/
@TableField
(
value
=
"\"EQU_DM\""
)
private
String
equDm
;
/**
* 单位编号
*/
@TableField
(
value
=
"\"EQU_DWBH\""
)
private
String
equDwbh
;
/**
* 公称工作压力(MPa)
*/
@TableField
(
value
=
"\"EQU_QPGC\""
)
private
String
equQpgc
;
/**
* 气瓶批号
*/
@TableField
(
value
=
"\"BATCH_NUMBER\""
)
private
String
batchNumber
;
/**
* PFZZDW PF制造单位
*/
@TableField
(
value
=
"\"EQU_PFZZDW\""
)
private
String
equPfzzdw
;
/**
* isChange
*/
@TableField
(
value
=
"\"ISCHANGE\""
)
private
Integer
ischange
;
/**
* 报告编号
*/
@TableField
(
value
=
"\"REPORTCODE\""
)
private
String
reportcode
;
/**
* BFReportCode
*/
@TableField
(
value
=
"\"BFREPORTCODE\""
)
private
String
bfreportcode
;
/**
* 操作方式
*/
@TableField
(
value
=
"\"EQU_CZFS\""
)
private
String
equCzfs
;
/**
* 是否认领 1已认领 0未认领
*/
@TableField
(
value
=
"\"CLAIMED_FLAG\""
)
private
String
claimedFlag
;
@TableField
(
value
=
"\"PRODUCE_UNIT_NAME\""
)
private
String
produceUnitName
;
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/mapper/ShCarEquMapper.java
0 → 100644
View file @
132c9620
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
mapper
;
import
com.yeejoin.amos.boot.module.jg.api.entity.ShCarEqu
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* Mapper 接口
*
* @author system_generator
* @date 2024-11-08
*/
public
interface
ShCarEquMapper
extends
BaseMapper
<
ShCarEqu
>
{
}
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
0 → 100644
View file @
132c9620
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
mapper
;
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
;
/**
* 三环系统-车辆信息表 Mapper 接口
*
* @author system_generator
* @date 2024-11-08
*/
public
interface
ShCarMapper
extends
BaseMapper
<
ShCar
>
{
Page
<
ShCarDto
>
queryForshCarPage
(
Page
<
ShCarDto
>
page
,
ShCarDto
dto
);
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/service/IShCarEquService.java
0 → 100644
View file @
132c9620
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
service
;
/**
* 接口类
*
* @author system_generator
* @date 2024-11-08
*/
public
interface
IShCarEquService
{}
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
0 → 100644
View file @
132c9620
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
java.util.Map
;
/**
* 三环系统-车辆信息表接口类
*
* @author system_generator
* @date 2024-11-08
*/
public
interface
IShCarService
{
Page
<
ShCarDto
>
queryForShCarPage
(
Page
<
ShCarDto
>
page
,
ShCarDto
dto
);
Boolean
claim
(
Map
<
String
,
Object
>
paramMap
);
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/vo/CarAndEquVo.java
0 → 100644
View file @
132c9620
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
vo
;
import
com.yeejoin.amos.boot.module.jg.api.dto.ShCarDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.ShCar
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
java.util.List
;
/**
* @author chang xiangyu 2024/11/12
*/
@Data
@AllArgsConstructor
public
class
CarAndEquVo
{
private
ShCarDto
shCar
;
private
List
<
ShCarEquVo
>
shCarEquVoList
;
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/vo/ShCarEquVo.java
0 → 100644
View file @
132c9620
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
vo
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.yeejoin.amos.boot.module.jg.api.entity.ShCarEqu
;
import
lombok.Data
;
import
java.util.Date
;
/**
* @author chang xiangyu 2024/11/12
*/
@Data
public
class
ShCarEquVo
{
/**
* primary key
*/
private
String
sequenceNbr
;
/**
* tzs_sh_car表主键
*/
private
String
carId
;
/**
* 设备编号sequenceCode
*/
private
String
sequenceCode
;
/**
* 设备代码
*/
private
String
equCode
;
/**
* 制造日期
*/
private
Date
produceDate
;
/**
* 安装日期
*/
private
Date
equInstalldate
;
/**
* 检查日期
*/
private
Date
equCheckdate
;
/**
* firstDate
*/
private
Date
equFirstdate
;
/**
* 序号
*/
private
String
serialNumber
;
/**
* sub_DM 代码
*/
private
String
equDm
;
/**
* 单位编号 equDwbh
*/
private
String
UseInnerCode
;
/**
* 公称工作压力(MPa) equQpgc
*/
private
String
nominalWorkingPressure
;
/**
* 气瓶批号
*/
private
String
batchNumber
;
/**
* PFZZDW PF制造单位
*/
private
String
equPfzzdw
;
/**
* isChange
*/
private
Integer
ischange
;
/**
* 报告编号
*/
private
String
reportcode
;
/**
* BFReportCode
*/
private
String
bfreportcode
;
/**
* 操作方式
*/
private
String
equCzfs
;
/**
* 是否认领
*/
private
String
claimedFlag
;
private
String
produceUnitName
;
public
ShCarEquVo
(
ShCarEqu
shCarEqu
)
{
this
.
setSequenceNbr
(
shCarEqu
.
getSequenceNbr
());
this
.
setCarId
(
shCarEqu
.
getCarId
());
this
.
setEquCode
(
shCarEqu
.
getEquCode
());
this
.
setUseInnerCode
(
shCarEqu
.
getEquDwbh
());
this
.
setNominalWorkingPressure
(
shCarEqu
.
getEquQpgc
());
this
.
setProduceUnitName
(
shCarEqu
.
getProduceUnitName
());
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/CommonMapper.xml
View file @
132c9620
...
@@ -957,10 +957,15 @@
...
@@ -957,10 +957,15 @@
SELECT COUNT( 1 )
SELECT COUNT( 1 )
FROM idx_biz_jg_register_info jri
FROM idx_biz_jg_register_info jri
LEFT JOIN idx_biz_jg_other_info joi ON joi."RECORD" = jri."RECORD"
LEFT JOIN idx_biz_jg_other_info joi ON joi."RECORD" = jri."RECORD"
WHERE
<where>
<if
test=
"useRegistrationCode != null and useRegistrationCode != ''"
>
jri."USE_ORG_CODE" = #{useRegistrationCode}
jri."USE_ORG_CODE" = #{useRegistrationCode}
</if>
<if
test=
"equipId != null and equipId != ''"
>
AND jri."RECORD" != #{equipId}
AND jri."RECORD" != #{equipId}
</if>
AND joi.CLAIM_STATUS = '已认领'
AND joi.CLAIM_STATUS = '已认领'
</where>
</select>
</select>
<select
id=
"queryOutOfMaintenanceRecord"
resultType=
"java.util.Map"
>
<select
id=
"queryOutOfMaintenanceRecord"
resultType=
"java.util.Map"
>
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/ShCarEquMapper.xml
0 → 100644
View file @
132c9620
<?xml version="1.0" encoding="UTF-8"?>
<!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.ShCarEquMapper"
>
</mapper>
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/ShCarMapper.xml
0 → 100644
View file @
132c9620
<?xml version="1.0" encoding="UTF-8"?>
<!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.ShCarMapper"
>
<select
id=
"queryForshCarPage"
resultType=
"com.yeejoin.amos.boot.module.jg.api.dto.ShCarDto"
>
select
*
FROM tzs_sh_car tsc
<where>
<if
test=
"dto != null "
>
<if
test=
"dto.useRegistrationCode != null and dto.useRegistrationCode != ''"
>
AND tsc.USE_REGISTRATION_CODE LIKE CONCAT('%', #{dto.useRegistrationCode}, '%')
</if>
<if
test=
"dto.carNumber != null and dto.carNumber != ''"
>
AND tsc.CAR_NUMBER LIKE CONCAT('%', #{dto.carNumber}, '%')
</if>
<if
test=
"dto.frameNumber != null and dto.frameNumber != ''"
>
AND tsc.FRAME_NUMBER LIKE CONCAT('%', #{dto.frameNumber}, '%')
</if>
<if
test=
"dto.claimedFlag != null and dto.claimedFlag != ''"
>
AND tsc.CLAIMED_FLAG = #{dto.claimedFlag}
</if>
</if>
</where>
ORDER BY
tsc.USE_REGISTRATION_CODE DESC
</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
0 → 100644
View file @
132c9620
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
controller
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
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.JgUseRegistrationManage
;
import
com.yeejoin.amos.boot.module.jg.api.entity.ShCar
;
import
com.yeejoin.amos.boot.module.jg.api.entity.ShCarEqu
;
import
com.yeejoin.amos.boot.module.jg.api.service.IShCarService
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.JgUseRegistrationManageServiceImpl
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.ShCarEquServiceImpl
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.ShCarServiceImpl
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletRequest
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
java.util.*
;
/**
* @author system_generator
* @date 2024-11-08
*/
@RestController
@Api
(
tags
=
"Api"
)
@RequestMapping
(
value
=
"/sh-car"
)
public
class
ShCarController
extends
BaseController
{
@Autowired
ShCarServiceImpl
shCarServiceImpl
;
@Resource
ShCarEquServiceImpl
shCarEquServiceImpl
;
@Autowired
IShCarService
iShCarService
;
@Autowired
JgUseRegistrationManageServiceImpl
jgUseRegistrationManageServiceImpl
;
/**
* 新增
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
public
ResponseModel
<
ShCar
>
save
(
@RequestBody
ShCar
shCar
)
{
shCar
=
shCarServiceImpl
.
createWithModel
(
shCar
);
return
ResponseHelper
.
buildResponse
(
shCar
);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新"
,
notes
=
"根据sequenceNbr更新"
)
public
ResponseModel
<
ShCar
>
updateBySequenceNbrShCar
(
@RequestBody
ShCar
entity
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
// entity.setSequenceNbr(sequenceNbr);
entity
.
setSequenceNbr
(
String
.
valueOf
(
sequenceNbr
));
return
ResponseHelper
.
buildResponse
(
shCarServiceImpl
.
updateWithModel
(
entity
));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据sequenceNbr删除"
,
notes
=
"根据sequenceNbr删除"
)
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
shCarServiceImpl
.
removeById
(
sequenceNbr
));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个"
,
notes
=
"根据sequenceNbr查询单个"
)
public
ResponseModel
<
ShCar
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
shCarServiceImpl
.
queryBySeq
(
sequenceNbr
));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param size 每页大小
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"分页查询"
,
notes
=
"分页查询"
)
public
ResponseModel
<
Page
<
ShCarDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
ShCarDto
dto
)
{
Page
<
ShCarDto
>
page
=
new
Page
<>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
Page
<
ShCarDto
>
shCarDtoPage
=
iShCarService
.
queryForShCarPage
(
page
,
dto
);
shCarDtoPage
.
getRecords
().
forEach
(
record
->
{
if
(
"1"
.
equals
(
record
.
getClaimedFlag
()))
{
record
.
setClaimedFlag
(
"是"
);
// 填充 证管理表的seq,用与认领后跳转证详情页
JgUseRegistrationManage
manage
=
jgUseRegistrationManageServiceImpl
.
getBaseMapper
().
selectOne
(
new
LambdaQueryWrapper
<
JgUseRegistrationManage
>()
.
eq
(
JgUseRegistrationManage:
:
getUseRegistrationCode
,
record
.
getUseRegistrationCode
()));
record
.
setCertificateSeq
(
String
.
valueOf
(
manage
.
getSequenceNbr
()));
}
else
if
(
"0"
.
equals
(
record
.
getClaimedFlag
()))
{
record
.
setClaimedFlag
(
"否"
);
}
});
return
ResponseHelper
.
buildResponse
(
shCarDtoPage
);
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表全部数据查询"
,
notes
=
"列表全部数据查询"
)
@GetMapping
(
value
=
"/list"
)
public
ResponseModel
<
List
<
ShCar
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
shCarServiceImpl
.
queryForShCarList
());
}
/**
* 数据查询,校验是否是三环系统数据
*
* @return 结果
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"数据查询,校验是否是三环系统数据"
,
notes
=
"数据查询,校验是否是三环系统数据"
)
@GetMapping
(
value
=
"/searchForSanHan"
)
public
ResponseModel
<
ShCar
>
searchForSanHan
(
@RequestParam
Map
<?,
?>
map
)
{
// 检查 map 是否为空
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 result
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"认领三环系统数据"
,
notes
=
"认领三环系统数据"
)
@PostMapping
(
value
=
"/claim"
)
public
ResponseModel
<
Boolean
>
claim
(
@RequestBody
Map
<
String
,
Object
>
paramMap
)
{
return
ResponseHelper
.
buildResponse
(
shCarServiceImpl
.
claim
(
paramMap
));
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/ShCarEquController.java
0 → 100644
View file @
132c9620
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
controller
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.module.jg.api.entity.ShCarEqu
;
import
com.yeejoin.amos.boot.module.jg.api.vo.CarAndEquVo
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.ShCarEquServiceImpl
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
javax.servlet.http.HttpServletRequest
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
java.util.List
;
/**
*
* @author system_generator
* @date 2024-11-08
*/
@RestController
@Api
(
tags
=
"Api"
)
@RequestMapping
(
value
=
"/sh-car-equ"
)
public
class
ShCarEquController
extends
BaseController
{
@Autowired
ShCarEquServiceImpl
shCarEquServiceImpl
;
/**
* 新增
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
public
ResponseModel
<
ShCarEqu
>
save
(
@RequestBody
ShCarEqu
shCarEqu
)
{
shCarEqu
=
shCarEquServiceImpl
.
createWithModel
(
shCarEqu
);
return
ResponseHelper
.
buildResponse
(
shCarEqu
);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新"
,
notes
=
"根据sequenceNbr更新"
)
public
ResponseModel
<
ShCarEqu
>
updateBySequenceNbrShCarEqu
(
@RequestBody
ShCarEqu
entity
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
// entity.setSequenceNbr(sequenceNbr);
entity
.
setSequenceNbr
(
String
.
valueOf
(
sequenceNbr
));
return
ResponseHelper
.
buildResponse
(
shCarEquServiceImpl
.
updateWithModel
(
entity
));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据sequenceNbr删除"
,
notes
=
"根据sequenceNbr删除"
)
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
){
return
ResponseHelper
.
buildResponse
(
shCarEquServiceImpl
.
removeById
(
sequenceNbr
));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个"
,
notes
=
"根据sequenceNbr查询单个"
)
public
ResponseModel
<
ShCarEqu
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
shCarEquServiceImpl
.
queryBySeq
(
sequenceNbr
));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"分页查询"
,
notes
=
"分页查询"
)
public
ResponseModel
<
Page
<
ShCarEqu
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
Page
<
ShCarEqu
>
page
=
new
Page
<
ShCarEqu
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
shCarEquServiceImpl
.
queryForShCarEquPage
(
page
));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表全部数据查询"
,
notes
=
"列表全部数据查询"
)
@GetMapping
(
value
=
"/list"
)
public
ResponseModel
<
List
<
ShCarEqu
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
shCarEquServiceImpl
.
queryForShCarEquList
());
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"汽车详细信息列表"
,
notes
=
"汽车详细信息列表"
)
@GetMapping
(
value
=
"/selectByCarId"
)
public
ResponseModel
<
CarAndEquVo
>
selectByCarId
(
@RequestParam
String
carId
)
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
return
ResponseHelper
.
buildResponse
(
shCarEquServiceImpl
.
queryByCarId
(
carId
,
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/IdxBizJgRegisterInfoServiceImpl.java
View file @
132c9620
...
@@ -283,6 +283,10 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -283,6 +283,10 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
private
TzBaseEnterpriseInfoMapper
baseEnterpriseInfoMapper
;
private
TzBaseEnterpriseInfoMapper
baseEnterpriseInfoMapper
;
@Autowired
@Autowired
private
TzsUserInfoMapper
tzsUserInfoMapper
;
private
TzsUserInfoMapper
tzsUserInfoMapper
;
@Autowired
private
ShCarEquServiceImpl
shCarEquService
;
@Autowired
private
ShCarServiceImpl
shCarService
;
/**
/**
* 将对象的属性由驼峰转为纯大写下划线格式
* 将对象的属性由驼峰转为纯大写下划线格式
...
@@ -394,6 +398,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -394,6 +398,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
check96333Code
(
equipmentInfoForm
);
check96333Code
(
equipmentInfoForm
);
// 气瓶 校验制造单位统一信用代码与出场编码唯一
// 气瓶 校验制造单位统一信用代码与出场编码唯一
checkFactoryNumUniqueWithGasCylinder
(
equipmentInfoForm
,
record
);
checkFactoryNumUniqueWithGasCylinder
(
equipmentInfoForm
,
record
);
// 检测是否三环系统中的车用气瓶数据 不让三环系统数据通过设备新增方式进来
checkIsSanHanData
(
equipmentInfoForm
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
handleError
(
e
,
null
);
handleError
(
e
,
null
);
}
}
...
@@ -442,6 +448,39 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -442,6 +448,39 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
}
}
}
/**
* 检测是否三环系统中的车用气瓶数据 不让三环系统数据通过设备新增方式进来
* @param equipmentInfoForm 入参
*/
private
void
checkIsSanHanData
(
LinkedHashMap
<?,
?>
equipmentInfoForm
)
{
// 是否车用气瓶
if
(
"2000"
.
equals
(
equipmentInfoForm
.
get
(
EQU_LIST
))
&&
"2300"
.
equals
(
equipmentInfoForm
.
get
(
EQU_CATEGORY
))
&&
"23T0"
.
equals
(
equipmentInfoForm
.
get
(
EQU_DEFINE
))
&&
"1"
.
equals
(
equipmentInfoForm
.
get
(
WHETHER_VEHICLE_CYLINDER
)))
{
String
carNum
=
(
String
)
equipmentInfoForm
.
get
(
"USE_INNER_CODE"
);
String
equCode
=
(
String
)
equipmentInfoForm
.
get
(
"EQU_CODE"
);
// 判断 设备代码EQU_CODE 和 单位内编号(车牌号)USE_INNER_CODE
Integer
carCount
=
shCarService
.
getBaseMapper
()
.
selectCount
(
new
LambdaQueryWrapper
<
ShCar
>()
.
eq
(
ShCar:
:
getCarNumber
,
carNum
)
.
eq
(
ShCar:
:
getClaimedFlag
,
Boolean
.
FALSE
));
Integer
equCount
=
shCarEquService
.
getBaseMapper
()
.
selectList
(
new
LambdaQueryWrapper
<
ShCarEqu
>()
.
eq
(
ShCarEqu:
:
getEquCode
,
equCode
))
.
stream
()
.
findFirst
()
.
map
(
equ
->
shCarService
.
getBaseMapper
().
selectList
(
new
LambdaQueryWrapper
<
ShCar
>()
.
eq
(
ShCar:
:
getSequenceNbr
,
equ
.
getCarId
())
.
eq
(
ShCar:
:
getClaimedFlag
,
Boolean
.
FALSE
))
.
size
()
).
orElse
(
0
);
if
(
carCount
>
0
||
equCount
>
0
)
{
throw
new
BadRequest
(
"原三环系统数据,请直接认领!"
);
}
}
}
private
void
check96333Code
(
LinkedHashMap
equipmentInfoForm
)
{
private
void
check96333Code
(
LinkedHashMap
equipmentInfoForm
)
{
if
(!
ObjectUtils
.
isEmpty
(
equipmentInfoForm
.
get
(
CODE96333
)))
{
if
(!
ObjectUtils
.
isEmpty
(
equipmentInfoForm
.
get
(
CODE96333
)))
{
// 根据96333码检查唯一性
// 根据96333码检查唯一性
...
...
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/JgVehicleInformationServiceImpl.java
View file @
132c9620
...
@@ -168,6 +168,8 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
...
@@ -168,6 +168,8 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
private
WorkFlowFeignService
workFlowFeignService
;
private
WorkFlowFeignService
workFlowFeignService
;
@Autowired
@Autowired
private
JgUseRegistrationManageMapper
jgUseRegistrationManageMapper
;
private
JgUseRegistrationManageMapper
jgUseRegistrationManageMapper
;
@Autowired
private
ShCarServiceImpl
shCarServiceImpl
;
private
Map
<
String
,
Object
>
fillingMediumMap
;
private
Map
<
String
,
Object
>
fillingMediumMap
;
...
@@ -1754,6 +1756,8 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
...
@@ -1754,6 +1756,8 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
if
(
used
){
if
(
used
){
throw
new
BadRequest
(
"使用登记证编号已存在!"
);
throw
new
BadRequest
(
"使用登记证编号已存在!"
);
}
}
// 检测是否三环系统中的车用气瓶数据 不让三环系统数据通过设备新增方式进来
this
.
checkIsSanSystemHanData
(
map
);
//使用登记证编号判断是否使用未来系统生成编号
//使用登记证编号判断是否使用未来系统生成编号
idxBizJgRegisterInfoService
.
checkUseRegistrationCode
(
useRegistrationCode1
,
"vehicle"
);
idxBizJgRegisterInfoService
.
checkUseRegistrationCode
(
useRegistrationCode1
,
"vehicle"
);
...
@@ -1996,6 +2000,32 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
...
@@ -1996,6 +2000,32 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
}
}
/**
/**
* 检测是否三环系统中的车用气瓶数据 不让三环系统数据通过设备新增方式进来
* @param map 入参
*/
private
void
checkIsSanSystemHanData
(
JSONObject
map
)
{
// 使用登记证号,车牌号,车辆VIN码(车架号)
String
useRegistrationCode
=
(
String
)
map
.
get
(
"useRegistrationCode"
);
String
carNumber
=
(
String
)
map
.
get
(
"carNumber"
);
String
identificationCode
=
(
String
)
map
.
get
(
"identificationCode"
);
ShCar
shCar
=
shCarServiceImpl
.
getBaseMapper
()
.
selectList
(
new
LambdaQueryWrapper
<
ShCar
>()
.
eq
(
ShCar:
:
getClaimedFlag
,
Boolean
.
FALSE
)
.
and
(
w
->
w
.
eq
(
ShCar:
:
getCarNumber
,
carNumber
)
.
or
()
.
eq
(
ShCar:
:
getUseRegistrationCode
,
useRegistrationCode
)
.
or
()
.
eq
(
ShCar:
:
getFrameNumber
,
identificationCode
)
)
).
stream
().
findFirst
().
orElse
(
new
ShCar
());
if
(!
ValidationUtil
.
isEmpty
(
shCar
.
getSequenceNbr
()))
{
throw
new
BadRequest
(
"原三环系统数据,请直接认领!"
);
}
}
/**
* 车用气瓶保存历史数据
* 车用气瓶保存历史数据
*
*
* @param map map
* @param map 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/ShCarEquServiceImpl.java
0 → 100644
View file @
132c9620
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.module.jg.api.dto.ShCarDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.ShCar
;
import
com.yeejoin.amos.boot.module.jg.api.entity.ShCarEqu
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.ShCarEquMapper
;
import
com.yeejoin.amos.boot.module.jg.api.service.IShCarEquService
;
import
com.yeejoin.amos.boot.module.jg.api.vo.CarAndEquVo
;
import
com.yeejoin.amos.boot.module.jg.api.vo.ShCarEquVo
;
import
com.yeejoin.amos.boot.module.jg.biz.service.ICommonService
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* 服务实现类
*
* @author system_generator
* @date 2024-11-08
*/
@Service
public
class
ShCarEquServiceImpl
extends
BaseService
<
ShCarEqu
,
ShCarEqu
,
ShCarEquMapper
>
implements
IShCarEquService
{
@Autowired
ShCarServiceImpl
shCarServiceImpl
;
@Autowired
ICommonService
commonService
;
/**
* 分页查询
*/
public
Page
<
ShCarEqu
>
queryForShCarEquPage
(
Page
<
ShCarEqu
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
}
/**
* 列表查询 示例
*/
public
List
<
ShCarEqu
>
queryForShCarEquList
()
{
return
this
.
queryForList
(
""
,
false
);
}
public
CarAndEquVo
queryByCarId
(
String
carId
,
ReginParams
reginParams
)
{
// 根据carId获取Car
LambdaQueryWrapper
<
ShCar
>
queryWrapper1
=
new
LambdaQueryWrapper
<>();
queryWrapper1
.
eq
(
ShCar:
:
getSequenceNbr
,
carId
);
ShCar
shCar
=
shCarServiceImpl
.
getOne
(
queryWrapper1
);
ShCarDto
shCarDto
=
new
ShCarDto
();
BeanUtil
.
copyProperties
(
shCar
,
shCarDto
);
// 补充信息
String
companyType
=
reginParams
.
getCompany
().
getCompanyType
();
AgencyUserModel
userModel
=
reginParams
.
getUserModel
();
shCarDto
.
setCompanyType
(
companyType
);
shCarDto
.
setUseUnitName
(
reginParams
.
getCompany
().
getCompanyName
());
shCarDto
.
setUseUnitCreditCode
(
reginParams
.
getCompany
().
getCompanyCode
());
String
[]
code
=
reginParams
.
getCompany
().
getCompanyCode
().
split
(
"_"
);
String
useUnitCode
=
code
.
length
>
1
?
code
[
1
]
:
code
[
0
];
if
(
"个人主体"
.
equals
(
companyType
))
{
shCarDto
.
setUseUnitAddress
((
String
)
commonService
.
getEnterpriseInfo
(
useUnitCode
).
get
(
"address"
));
}
else
{
shCarDto
.
setUseUnitAddress
(
reginParams
.
getCompany
().
getAddress
());
}
shCarDto
.
setSafetyManagerId
(
"个人主体"
.
equals
(
companyType
)
?
userModel
.
getRealName
()
:
null
);
shCarDto
.
setPhone
(
"个人主体"
.
equals
(
companyType
)
?
userModel
.
getMobile
()
:
null
);
// 根据carId获取设备列表
LambdaQueryWrapper
<
ShCarEqu
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
ShCarEqu:
:
getCarId
,
carId
);
List
<
ShCarEqu
>
list
=
this
.
list
(
queryWrapper
);
// 将设备列表转换为前端可识别bean
List
<
ShCarEquVo
>
collect
=
list
.
stream
().
map
(
shCarEqu
->
new
ShCarEquVo
(
shCarEqu
)).
collect
(
Collectors
.
toList
());
// 封装返回VO
return
new
CarAndEquVo
(
shCarDto
,
collect
);
}
}
\ No newline at end of file
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
0 → 100644
View file @
132c9620
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
cn.hutool.core.date.DatePattern
;
import
cn.hutool.core.date.DateUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
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
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil
;
import
com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory
;
import
com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.ShCarDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.*
;
import
com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.api.enums.CertificateStatusEnum
;
import
com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.ShCarMapper
;
import
com.yeejoin.amos.boot.module.jg.api.service.IShCarService
;
import
com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient
;
import
com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgInspectionDetectionInfoService
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.*
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.annotation.Resource
;
import
java.math.BigDecimal
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
static
com
.
alibaba
.
fastjson
.
JSON
.
toJSONString
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
enums
.
VehicleApanageEnum
.
XIAN_YANG
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
enums
.
VehicleApanageEnum
.
XI_XIAN
;
/**
* 三环系统-车辆信息表服务实现类
*
* @author system_generator
* @date 2024-11-08
*/
@Slf4j
@Service
public
class
ShCarServiceImpl
extends
BaseService
<
ShCar
,
ShCar
,
ShCarMapper
>
implements
IShCarService
{
@Resource
private
RedisUtils
redisUtils
;
@Resource
private
SnowflakeIdUtil
sequence
;
@Resource
private
IdxBizJgUseInfoServiceImpl
idxBizJgUseInfoService
;
@Resource
private
IdxBizJgConstructionInfoServiceImpl
idxBizJgConstructionInfoService
;
@Resource
private
IdxBizJgDesignInfoServiceImpl
idxBizJgDesignInfoService
;
@Resource
private
IdxBizJgFactoryInfoServiceImpl
idxBizJgFactoryInfoService
;
@Resource
private
IdxBizJgInspectionDetectionInfoServiceImpl
idxBizJgInspectionDetectionInfoService
;
@Resource
private
IdxBizJgMaintenanceRecordInfoServiceImpl
idxBizJgMaintenanceRecordInfoService
;
@Resource
private
IdxBizJgOtherInfoServiceImpl
idxBizJgOtherInfoService
;
@Resource
private
IdxBizJgRegisterInfoServiceImpl
idxBizJgRegisterInfoService
;
@Resource
private
IdxBizJgSupervisionInfoServiceImpl
idxBizJgSupervisionInfoService
;
@Resource
private
IdxBizJgTechParamsVesselServiceImpl
idxBizJgTechParamsVesselService
;
@Resource
private
ESEquipmentCategory
esEquipmentCategory
;
@Resource
private
TzsServiceFeignClient
tzsServiceFeignClient
;
@Resource
private
JgVehicleInformationServiceImpl
vehicleInformationService
;
@Resource
private
JgVehicleInformationEqServiceImpl
vehicleInformationEqService
;
@Resource
private
JgUseRegistrationManageServiceImpl
useRegistrationManageService
;
@Resource
private
JgCertificateChangeRecordServiceImpl
certificateChangeRecordService
;
@Resource
private
JgCertificateChangeRecordEqServiceImpl
certificateChangeRecordEqService
;
@Resource
private
CommonServiceImpl
commonService
;
private
final
ShCarMapper
shCarMapper
;
public
ShCarServiceImpl
(
ShCarMapper
shCarMapper
)
{
this
.
shCarMapper
=
shCarMapper
;
}
/**
* 分页查询
*/
public
Page
<
ShCar
>
queryForShCarPage
(
Page
<
ShCar
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
}
/**
* 列表查询 示例
*/
public
List
<
ShCar
>
queryForShCarList
()
{
return
this
.
queryForList
(
""
,
false
);
}
@Override
public
Page
<
ShCarDto
>
queryForShCarPage
(
Page
<
ShCarDto
>
page
,
ShCarDto
dto
)
{
return
shCarMapper
.
queryForshCarPage
(
page
,
dto
);
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Boolean
claim
(
Map
<
String
,
Object
>
paramMap
)
{
// ShCar表的seq
String
shCarSequenceNbr
=
String
.
valueOf
(
paramMap
.
get
(
"sequenceNbr"
));
if
(
ValidationUtil
.
isEmpty
(
shCarSequenceNbr
))
{
throw
new
BadRequest
(
"数据异常!"
);
}
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
()))
+
""
,
ReginParams
.
class
);
JSONArray
equList
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
paramMap
.
get
(
"equList"
)));
// 0. 必要校验
// 0.1 使用登记证的唯一校验
String
useRegistrationCode
=
String
.
valueOf
(
paramMap
.
get
(
"useRegistrationCode"
));
Boolean
used
=
commonService
.
useRegistrationCertificateAccountUnique
(
useRegistrationCode
,
null
);
if
(
used
)
{
throw
new
BadRequest
(
"使用登记证编号已存在!"
);
}
// 0.2 设备代码的唯一校验
Set
<
String
>
equCodeSet
=
equList
.
stream
().
map
(
equ
->
{
JSONObject
jsonObject
=
JSON
.
parseObject
(
toJSONString
(
equ
));
return
jsonObject
.
getString
(
"equCode"
);
}).
collect
(
Collectors
.
toSet
());
if
(
equCodeSet
.
size
()
<
equList
.
size
())
throw
new
BadRequest
(
"设备代码重复!"
);
equCodeSet
.
forEach
(
equCode
->
{
Boolean
useFlag
=
commonService
.
checkEquCodeUniqueness
(
equCode
);
if
(
useFlag
)
{
throw
new
BadRequest
(
"设备代码已存在系统中!"
);
}
});
try
{
// 清除seq,避免后续所有 业务表 都使用此 seq
paramMap
.
remove
(
"sequenceNbr"
);
// 1. 生成设备信息 + 保存es
this
.
claimGenEquInfo
(
useRegistrationCode
,
paramMap
,
equList
,
reginParams
);
// 2. 生成车用气瓶使用登记证单据( JgVehicleInformation JgVehicleInformationEq )信息
JgVehicleInformation
jgVehicleInformation
=
this
.
claimGenVehicleInfoAbout
(
paramMap
,
equList
,
reginParams
);
// 3. 生成 使用登记证管理表信息(JgUseRegistrationManage )证变更记录表信息 (JgCertificateChangeRecord)证变更记录对应设备表信息 (JgCertificateChangeRecordEq)
this
.
claimGenCertificateManageAndChange
(
jgVehicleInformation
,
equList
);
// 4. 修改三环车辆表的认领状态为已认领
ShCar
shCar
=
ShCar
.
builder
().
claimedFlag
(
"1"
).
build
();
shCar
.
setSequenceNbr
(
shCarSequenceNbr
);
this
.
baseMapper
.
updateById
(
shCar
);
return
Boolean
.
TRUE
;
}
catch
(
Exception
e
)
{
log
.
error
(
"三环系统数据认领失败,使用登记证代码:{}"
,
paramMap
.
get
(
"useRegistrationCode"
));
log
.
error
(
"失败原因:{}"
,
e
.
getMessage
());
this
.
handleClaimFailed
(
equList
);
throw
new
BadRequest
(
"认领时出现异常,请联系管理员!"
);
}
}
/**
* 生成使用登记证管理表信息、证变更记录表信息
*
* @param jgVehicleInformation 车用气瓶使用登记证单据
* @param equList 设备集合
*/
private
void
claimGenCertificateManageAndChange
(
JgVehicleInformation
jgVehicleInformation
,
JSONArray
equList
)
{
AgencyUserModel
result
=
Privilege
.
agencyUserClient
.
queryByUserId
(
RequestContext
.
getExeUserId
()).
getResult
();
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy年MM月dd日"
);
String
changeContent
=
jgVehicleInformation
.
getUseUnitName
()
+
"的"
+
result
.
getRealName
()
+
"办理了【"
+
BusinessTypeEnum
.
JG_VEHICLE_GAS_APPLICATION
.
getName
()
+
"】,"
+
"单号【"
+
jgVehicleInformation
.
getApplyNo
()
+
"】,申请日期"
+
simpleDateFormat
.
format
(
new
Date
());
// 3.1 生成使用登记证管理表信息(JgUseRegistrationManage )
Map
<
String
,
String
>
equType
=
new
HashMap
<>();
equType
.
put
(
"equList"
,
"压力容器"
);
equType
.
put
(
"equListCode"
,
"2300"
);
equType
.
put
(
"equCategory"
,
"气瓶"
);
equType
.
put
(
"equCategoryCode"
,
"2300"
);
equType
.
put
(
"equDefine"
,
"特种气瓶"
);
equType
.
put
(
"equDefineCode"
,
"23T0"
);
BigDecimal
totalVolume
=
equList
.
stream
().
map
(
x
->
new
BigDecimal
(
String
.
valueOf
(
JSON
.
parseObject
(
JSON
.
toJSONString
(
x
)).
get
(
"singleBottleVolume"
))))
.
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
JgUseRegistrationManage
registrationManage
=
JgUseRegistrationManage
.
builder
()
.
equList
(
"压力容器"
).
equListCode
(
"2300"
)
.
equCategory
(
"气瓶"
).
equCategoryCode
(
"2300"
)
.
equDefine
(
"特种气瓶"
).
equDefineCode
(
"23T0"
)
.
useUnitName
(
jgVehicleInformation
.
getUseUnitName
())
.
useUnitCreditCode
(
jgVehicleInformation
.
getUseUnitCreditCode
())
.
applyNo
(
jgVehicleInformation
.
getApplyNo
())
.
receiveCompanyCode
(
jgVehicleInformation
.
getReceiveCompanyCode
())
.
receiveOrgName
(
jgVehicleInformation
.
getReceiveOrgName
())
.
auditPassDate
(
jgVehicleInformation
.
getAuditPassDate
())
.
useRegistrationCode
(
jgVehicleInformation
.
getUseRegistrationCode
())
.
certificateNo
(
commonService
.
generateCertificateNo
(
equType
,
new
Date
(),
jgVehicleInformation
.
getReceiveCompanyCode
()))
.
regType
(
BusinessTypeEnum
.
JG_VEHICLE_GAS_APPLICATION
.
getName
())
.
certificateStatus
(
CertificateStatusEnum
.
YIDENGJI
.
getName
())
.
regDate
(
jgVehicleInformation
.
getRegDate
())
.
createUserId
(
RequestContext
.
getExeUserId
())
.
volume
(
totalVolume
.
toPlainString
())
.
carNumber
(
jgVehicleInformation
.
getCarNumber
())
.
createDate
(
new
Date
())
.
gasNum
(
equList
.
size
())
.
useUnitAddress
(
jgVehicleInformation
.
getUseUnitAddress
())
.
manageType
(
"unit"
)
.
isScrap
(
"0"
)
.
version
(
1
)
.
build
();
registrationManage
.
setIsDelete
(
Boolean
.
FALSE
);
useRegistrationManageService
.
save
(
registrationManage
);
// 3.2 证变更记录表信息 (JgCertificateChangeRecord)
// 证变更记录表seq
Long
changeRecordSeq
=
sequence
.
nextId
();
JgCertificateChangeRecord
changeRecord
=
JgCertificateChangeRecord
.
builder
()
.
applyNo
(
jgVehicleInformation
.
getApplyNo
())
.
receiveOrgName
(
jgVehicleInformation
.
getReceiveOrgName
())
.
auditPassDate
(
jgVehicleInformation
.
getAuditPassDate
())
.
regType
(
BusinessTypeEnum
.
JG_VEHICLE_GAS_APPLICATION
.
getName
())
.
regDate
(
jgVehicleInformation
.
getRegDate
()).
changeContent
(
changeContent
)
.
useRegistrationCode
(
jgVehicleInformation
.
getUseRegistrationCode
())
.
receiveCompanyCode
(
jgVehicleInformation
.
getReceiveCompanyCode
())
.
certificateNo
(
registrationManage
.
getCertificateNo
())
.
useUnitCreditCode
(
jgVehicleInformation
.
getUseUnitCreditCode
())
.
useUnitName
(
jgVehicleInformation
.
getUseUnitName
())
.
equCategory
(
"2300"
)
// .routePath(Optional.ofNullable(taskV2Model).map(TaskV2Model::getRoutePath).orElse("")) todo
.
build
();
changeRecord
.
setSequenceNbr
(
changeRecordSeq
);
certificateChangeRecordService
.
save
(
changeRecord
);
// 3.3 证变更记录对应设备表信息 (JgCertificateChangeRecordEq)
ArrayList
<
JgCertificateChangeRecordEq
>
changeRecordEqList
=
new
ArrayList
<>();
equList
.
forEach
(
equ
->
changeRecordEqList
.
add
(
JgCertificateChangeRecordEq
.
builder
()
.
changeRecordId
(
String
.
valueOf
(
changeRecordSeq
))
.
equId
(
JSON
.
parseObject
(
JSON
.
toJSONString
(
equ
)).
getString
(
"record"
))
.
productCode
(
JSON
.
parseObject
(
JSON
.
toJSONString
(
equ
)).
getString
(
"factoryNum"
))
.
build
()));
certificateChangeRecordEqService
.
saveBatch
(
changeRecordEqList
);
}
/**
* 认领流程-生成设备信息
*
* @param equList 设备集合
*/
public
void
claimGenEquInfo
(
String
useRegistrationCode
,
Map
<
String
,
Object
>
paramMap
,
JSONArray
equList
,
ReginParams
reginParams
)
{
CompanyBo
company
=
reginParams
.
getCompany
();
// 保存设备后 后续业务需要的设备信息
for
(
int
i
=
0
;
i
<
equList
.
size
();
i
++)
{
JSONObject
equObj
=
equList
.
getJSONObject
(
i
);
Date
date
=
new
Date
();
// 设备record
String
equRecord
=
UUID
.
randomUUID
().
toString
();
JSONObject
equJson
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equObj
));
equJson
.
put
(
"record"
,
equRecord
);
equObj
=
equJson
;
// 清除原先的seq
equObj
.
remove
(
"sequenceNbr"
);
// 使用信息
IdxBizJgUseInfo
useInfo
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equObj
),
IdxBizJgUseInfo
.
class
);
useInfo
.
setRecord
(
equRecord
);
useInfo
.
setRecDate
(
date
);
useInfo
.
setDataSource
(
"jg_his_sh"
);
useInfo
.
setIsIntoManagement
(
Boolean
.
TRUE
);
useInfo
.
setEquState
(
"1"
);
if
(
CompanyTypeEnum
.
INDIVIDUAL
.
getName
().
equals
(
company
.
getCompanyType
()))
{
useInfo
.
setUseUnitName
(
company
.
getCompanyName
().
split
(
"_"
)[
1
]);
useInfo
.
setUseUnitCreditCode
(
company
.
getCompanyCode
().
split
(
"_"
)[
1
]);
}
else
{
useInfo
.
setUseUnitName
(
company
.
getCompanyName
());
useInfo
.
setUseUnitCreditCode
(
company
.
getCompanyCode
());
}
useInfo
.
setORegUnit
((
String
)
paramMap
.
get
(
"oRegUnit"
));
useInfo
.
setORegDate
((
String
)
paramMap
.
get
(
"oRegDate"
));
useInfo
.
setOldUseRegistrationTable
(
JSON
.
toJSONString
(
paramMap
.
get
(
"oldUseRegistrationTable"
)));
useInfo
.
setOldUseRegistrationCertificate
(
JSON
.
toJSONString
(
paramMap
.
get
(
"oldUseRegistrationCertificate"
)));
idxBizJgUseInfoService
.
save
(
useInfo
);
// 设计信息
IdxBizJgDesignInfo
designInfo
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equObj
),
IdxBizJgDesignInfo
.
class
);
designInfo
.
setRecord
(
equRecord
);
designInfo
.
setRecDate
(
date
);
idxBizJgDesignInfoService
.
save
(
designInfo
);
// 制造信息
IdxBizJgFactoryInfo
factoryInfo
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equObj
),
IdxBizJgFactoryInfo
.
class
);
factoryInfo
.
setRecDate
(
date
);
factoryInfo
.
setRecord
(
equRecord
);
idxBizJgFactoryInfoService
.
save
(
factoryInfo
);
// 施工信息
IdxBizJgConstructionInfo
constructionInfo
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equObj
),
IdxBizJgConstructionInfo
.
class
);
constructionInfo
.
setRecord
(
equRecord
);
constructionInfo
.
setRecDate
(
date
);
idxBizJgConstructionInfoService
.
save
(
constructionInfo
);
// 注册登记信息
IdxBizJgRegisterInfo
registerInfo
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equObj
),
IdxBizJgRegisterInfo
.
class
);
registerInfo
.
setRecord
(
equRecord
);
registerInfo
.
setRecDate
(
date
);
registerInfo
.
setUseOrgCode
(
useRegistrationCode
);
registerInfo
.
setWhetherSkidMountedPressureVessel
(
"0"
);
registerInfo
.
setRegisterState
(
idxBizJgRegisterInfoService
.
getRegCode
());
idxBizJgRegisterInfoService
.
save
(
registerInfo
);
// 监督管理
IdxBizJgSupervisionInfo
supervisionInfo
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equObj
),
IdxBizJgSupervisionInfo
.
class
);
supervisionInfo
.
setRecord
(
equRecord
);
supervisionInfo
.
setRecDate
(
date
);
if
(!
StringUtils
.
isEmpty
(
supervisionInfo
.
getOrgBranchCode
()))
{
String
[]
orgBranchCode
=
supervisionInfo
.
getOrgBranchCode
().
split
(
"_"
);
supervisionInfo
.
setOrgBranchCode
(
orgBranchCode
[
0
]);
supervisionInfo
.
setOrgBranchName
(
orgBranchCode
[
1
]);
HashMap
<
String
,
Object
>
parentMessage
=
(
HashMap
<
String
,
Object
>)
Privilege
.
companyClient
.
queryByOrgcode
(
orgBranchCode
[
0
]).
getResult
();
// 目前平台返回key为compnay(存在拼写错误)
CompanyModel
parentModel
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
parentMessage
.
get
(
"compnay"
)),
CompanyModel
.
class
);
supervisionInfo
.
setCompanyOrgBranchCode
(
parentModel
.
getCompanyCode
());
}
idxBizJgSupervisionInfoService
.
save
(
supervisionInfo
);
// 其他信息
IdxBizJgOtherInfo
otherInfo
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equObj
),
IdxBizJgOtherInfo
.
class
);
otherInfo
.
setRecord
(
equRecord
);
otherInfo
.
setClaimStatus
(
"已认领"
);
otherInfo
.
setRecDate
(
date
);
// ---生成监管码
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
String
vehicleApanage
=
(
String
)
paramMap
.
get
(
"vehicleApanage"
);
// 判断是否为西咸
String
isXiXian
=
XI_XIAN
.
getCode
().
equals
(
vehicleApanage
)
?
"1"
:
"0"
;
map
.
put
(
"cityCode"
,
XI_XIAN
.
getCode
().
equals
(
vehicleApanage
)
?
XIAN_YANG
.
getCode
()
:
vehicleApanage
);
map
.
put
(
"isXiXian"
,
isXiXian
);
map
.
put
(
"equCategory"
,
registerInfo
.
getEquCategory
());
map
.
put
(
"countyCode"
,
XI_XIAN
.
getCode
().
equals
(
vehicleApanage
)
?
XIAN_YANG
.
getCode
()
:
vehicleApanage
);
ResponseModel
<
Map
<
String
,
Object
>>
code
=
tzsServiceFeignClient
.
createCode
(
map
);
Map
<
String
,
Object
>
result
=
code
.
getResult
();
otherInfo
.
setSupervisoryCode
((
String
)
result
.
get
(
"superviseCode"
));
idxBizJgOtherInfoService
.
save
(
otherInfo
);
// 压力容器技术参数
IdxBizJgTechParamsVessel
vessel
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equObj
),
IdxBizJgTechParamsVessel
.
class
);
vessel
.
setRecord
(
equRecord
);
vessel
.
setRecDate
(
date
);
idxBizJgTechParamsVesselService
.
save
(
vessel
);
// 检验检测信息
IdxBizJgInspectionDetectionInfo
inspectionDetectionInfo
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equObj
),
IdxBizJgInspectionDetectionInfo
.
class
);
inspectionDetectionInfo
.
setRecord
(
equRecord
);
inspectionDetectionInfo
.
setRecDate
(
date
);
// 检验机构信息
if
(!
StringUtils
.
isEmpty
(
inspectionDetectionInfo
.
getInspectOrgName
()))
{
String
[]
inspectOrg
=
inspectionDetectionInfo
.
getInspectOrgName
().
split
(
"_"
);
inspectionDetectionInfo
.
setInspectOrgCode
(
inspectOrg
[
0
]);
inspectionDetectionInfo
.
setInspectOrgName
(
inspectOrg
[
1
]);
}
if
(
inspectionDetectionInfo
.
getNextInspectDate
()
!=
null
)
{
inspectionDetectionInfo
.
setNextInspectDate
(
DateUtil
.
parse
(
DateUtil
.
format
(
inspectionDetectionInfo
.
getNextInspectDate
(),
DatePattern
.
NORM_DATE_PATTERN
)));
}
idxBizJgInspectionDetectionInfoService
.
save
(
inspectionDetectionInfo
);
// 保存es
idxBizJgRegisterInfoService
.
checkEsData
(
equRecord
);
// 更新 equList 中的元素
equList
.
set
(
i
,
equJson
);
}
}
/**
* 生成车用气瓶使用登记证单据
*
* @param paramMap 表单信息
* @param equList 设备集合
* @return 车用气瓶使用登记证单据
*/
public
JgVehicleInformation
claimGenVehicleInfoAbout
(
Map
<
String
,
Object
>
paramMap
,
JSONArray
equList
,
ReginParams
reginParams
)
{
// 车用气瓶登记表seq
Long
vehicleInformationSeq
=
sequence
.
nextId
();
CompanyBo
company
=
reginParams
.
getCompany
();
// 申请编号
ResponseModel
<
List
<
String
>>
listResponseModel
=
tzsServiceFeignClient
.
applicationFormCode
(
ApplicationFormTypeEnum
.
SYDJ
.
getCode
(),
1
);
if
(!
ObjectUtils
.
isEmpty
(
listResponseModel
)
&&
listResponseModel
.
getStatus
()
!=
HttpStatus
.
OK
.
value
())
{
log
.
error
(
"车用气瓶使用登记申请单单号获取失败!"
);
throw
new
BadRequest
(
"车用气瓶使用登记申请单单号获取失败!"
);
}
String
applyNo
=
listResponseModel
.
getResult
().
get
(
0
);
// 2.1 车用气瓶登记单表
JgVehicleInformation
vehicleInformation
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
paramMap
),
JgVehicleInformation
.
class
);
vehicleInformation
.
setSequenceNbr
(
vehicleInformationSeq
);
vehicleInformation
.
setApplyNo
(
applyNo
);
// 使用单位信息
if
(
CompanyTypeEnum
.
INDIVIDUAL
.
getName
().
equals
(
company
.
getCompanyType
()))
{
vehicleInformation
.
setUseUnitName
(
company
.
getCompanyName
().
split
(
"_"
)[
1
]);
vehicleInformation
.
setUseUnitCreditCode
(
company
.
getCompanyCode
().
split
(
"_"
)[
1
]);
}
else
{
vehicleInformation
.
setUseUnitName
(
company
.
getCompanyName
());
vehicleInformation
.
setUseUnitCreditCode
(
company
.
getCompanyCode
());
}
// 接收单位信息
if
(!
StringUtils
.
isEmpty
(
vehicleInformation
.
getReceiveOrgCode
()))
{
String
[]
splitReceiveOrgCode
=
vehicleInformation
.
getReceiveOrgCode
().
split
(
"_"
);
CompanyModel
result
=
Privilege
.
companyClient
.
queryByCompanyCode
(
splitReceiveOrgCode
[
0
]).
getResult
();
vehicleInformation
.
setReceiveOrgCode
(
splitReceiveOrgCode
[
0
]);
vehicleInformation
.
setReceiveOrgName
(
splitReceiveOrgCode
[
1
]);
vehicleInformation
.
setReceiveCompanyCode
(
result
.
getCompanyCode
());
}
// 检验机构信息
if
(!
StringUtils
.
isEmpty
(
vehicleInformation
.
getInspectUnitCreditCode
()))
{
String
[]
splitInspectUnitCreditCode
=
vehicleInformation
.
getInspectUnitCreditCode
().
split
(
"_"
);
vehicleInformation
.
setInspectUnitCreditCode
(
splitInspectUnitCreditCode
[
0
]);
vehicleInformation
.
setInspectUnitName
(
splitInspectUnitCreditCode
[
1
]);
}
// 安装单位信息
if
(!
StringUtils
.
isEmpty
(
vehicleInformation
.
getInstallUnitCode
()))
{
String
[]
splitInstallUnitCode
=
vehicleInformation
.
getInstallUnitCode
().
split
(
"_"
);
vehicleInformation
.
setInstallUnitCode
(
splitInstallUnitCode
[
0
]);
vehicleInformation
.
setInstallUnitName
(
splitInstallUnitCode
[
1
]);
}
// 属地监管部门
if
(!
StringUtils
.
isEmpty
(
vehicleInformation
.
getOrgBranchCode
()))
{
String
[]
splitOrgBranchCode
=
vehicleInformation
.
getOrgBranchCode
().
split
(
"_"
);
vehicleInformation
.
setOrgBranchCode
(
splitOrgBranchCode
[
0
]);
vehicleInformation
.
setOrgBranchName
(
splitOrgBranchCode
[
1
]);
}
// 安全管理员
Optional
.
ofNullable
(
String
.
valueOf
(
paramMap
.
get
(
"safetyManagerId"
))).
filter
(
manager
->
manager
.
contains
(
"_"
)).
map
(
manager
->
manager
.
split
(
"_"
)).
ifPresent
(
data
->
{
vehicleInformation
.
setSafetyManagerId
(
data
[
0
]);
vehicleInformation
.
setSafetyManagerName
(
data
[
1
]);
});
// 产权单位信息
if
(!
StringUtils
.
isEmpty
(
vehicleInformation
.
getEstateUnitName
()))
{
String
[]
data
=
String
.
valueOf
(
paramMap
.
get
(
"estateUnitName"
)).
split
(
"_"
);
vehicleInformation
.
setEstateUnitCreditCode
(
data
[
0
]);
vehicleInformation
.
setEstateUnitName
(
data
[
1
]);
}
// 其他附件
if
(!
ObjectUtils
.
isEmpty
(
paramMap
.
get
(
"otherAccessories"
)))
{
vehicleInformation
.
setOtherAccessories
(
JSONObject
.
toJSONString
(
paramMap
.
get
(
"otherAccessories"
)));
}
vehicleInformation
.
setCreateUserId
(
reginParams
.
getUserModel
().
getUserId
());
vehicleInformation
.
setRegDate
(
new
Date
());
vehicleInformation
.
setCreateUserName
(
reginParams
.
getUserModel
().
getRealName
());
vehicleInformation
.
setGasNum
(
equList
.
size
());
vehicleInformation
.
setAuditPassDate
(
new
Date
());
vehicleInformation
.
setRegType
(
"1"
);
// 历史登记
vehicleInformation
.
setStatus
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
vehicleInformation
.
setCreateDate
(
new
Date
());
BigDecimal
totalVolume
=
equList
.
stream
().
map
(
x
->
new
BigDecimal
(
String
.
valueOf
(
JSON
.
parseObject
(
JSON
.
toJSONString
(
x
)).
get
(
"singleBottleVolume"
))))
.
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
vehicleInformation
.
setVolume
(
totalVolume
.
toPlainString
());
vehicleInformationService
.
save
(
vehicleInformation
);
// 2.2 车用气瓶登记单关联设备表
List
<
JgVehicleInformationEq
>
vehicleInformationEqs
=
new
ArrayList
<>();
equList
.
forEach
(
equ
->
vehicleInformationEqs
.
add
(
JgVehicleInformationEq
.
builder
()
.
vehicleId
(
String
.
valueOf
(
vehicleInformationSeq
))
.
equId
(
JSON
.
parseObject
(
JSON
.
toJSONString
(
equ
)).
getString
(
"record"
))
.
build
()));
vehicleInformationEqService
.
saveBatch
(
vehicleInformationEqs
);
return
vehicleInformation
;
}
/**
* 认领过程中报错,回滚第一步的es数据
*/
public
void
handleClaimFailed
(
JSONArray
equList
)
{
if
(!
equList
.
isEmpty
())
{
equList
.
forEach
(
equ
->
{
String
record
=
JSON
.
parseObject
(
toJSONString
(
equ
)).
getString
(
"record"
);
Optional
<
ESEquipmentCategoryDto
>
data
=
esEquipmentCategory
.
findById
(
record
);
if
(!
ObjectUtils
.
isEmpty
(
data
))
{
esEquipmentCategory
.
deleteById
(
record
);
}
});
}
}
}
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/java/com/yeejoin/amos/boot/module/jyjc/api/model/JyjcInspectionResultDataModel.java
View file @
132c9620
...
@@ -82,4 +82,9 @@ public class JyjcInspectionResultDataModel {
...
@@ -82,4 +82,9 @@ public class JyjcInspectionResultDataModel {
*/
*/
private
String
traceId
;
private
String
traceId
;
/**
* 设备唯一标识,record--首检时需要,此时设备无监管码及设备代码
*/
private
String
equipId
;
}
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/event/listener/InspectionApplicationPushEventListener.java
View file @
132c9620
...
@@ -21,6 +21,7 @@ import com.yeejoin.amos.boot.module.jyjc.biz.event.InspectionApplicationPushEven
...
@@ -21,6 +21,7 @@ import com.yeejoin.amos.boot.module.jyjc.biz.event.InspectionApplicationPushEven
import
com.yeejoin.amos.boot.module.jyjc.biz.kafka.KafkaProducer
;
import
com.yeejoin.amos.boot.module.jyjc.biz.kafka.KafkaProducer
;
import
com.yeejoin.amos.boot.module.jyjc.biz.service.impl.JyjcInspectionApplicationEquipServiceImpl
;
import
com.yeejoin.amos.boot.module.jyjc.biz.service.impl.JyjcInspectionApplicationEquipServiceImpl
;
import
com.yeejoin.amos.boot.module.jyjc.biz.service.impl.JyjcInspectionApplicationPushLogServiceImpl
;
import
com.yeejoin.amos.boot.module.jyjc.biz.service.impl.JyjcInspectionApplicationPushLogServiceImpl
;
import
com.yeejoin.amos.boot.module.jyjc.biz.util.JsonUtils
;
import
com.yeejoin.amos.boot.module.jyjc.biz.util.JyjcConstant
;
import
com.yeejoin.amos.boot.module.jyjc.biz.util.JyjcConstant
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.*
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.*
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.*
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.*
;
...
@@ -28,6 +29,7 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -28,6 +29,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.ApplicationListener
;
import
org.springframework.context.ApplicationListener
;
import
org.springframework.core.io.Resource
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.PostConstruct
;
...
@@ -45,6 +47,11 @@ import java.util.stream.Collectors;
...
@@ -45,6 +47,11 @@ import java.util.stream.Collectors;
@Slf4j
@Slf4j
public
class
InspectionApplicationPushEventListener
implements
ApplicationListener
<
InspectionApplicationPushEvent
>
{
public
class
InspectionApplicationPushEventListener
implements
ApplicationListener
<
InspectionApplicationPushEvent
>
{
@Value
(
"classpath:/json/companyCodeRegName.json"
)
private
Resource
regNameJson
;
private
Map
<
String
,
String
>
companyCodeRegNameMap
;
private
BlockingQueue
<
JyjcInspectionApplicationModel
>
queue
=
new
LinkedBlockingQueue
<>();
private
BlockingQueue
<
JyjcInspectionApplicationModel
>
queue
=
new
LinkedBlockingQueue
<>();
@Value
(
"${inspection.push.max.deal.thread.num:2}"
)
@Value
(
"${inspection.push.max.deal.thread.num:2}"
)
...
@@ -107,6 +114,8 @@ public class InspectionApplicationPushEventListener implements ApplicationListen
...
@@ -107,6 +114,8 @@ public class InspectionApplicationPushEventListener implements ApplicationListen
@Autowired
@Autowired
JgUseRegistrationManageMapper
jgUseRegistrationManageMapper
;
JgUseRegistrationManageMapper
jgUseRegistrationManageMapper
;
@Autowired
IdxBizJgDesignInfoMapper
designInfoMapper
;
/**
/**
...
@@ -133,6 +142,7 @@ public class InspectionApplicationPushEventListener implements ApplicationListen
...
@@ -133,6 +142,7 @@ public class InspectionApplicationPushEventListener implements ApplicationListen
@PostConstruct
@PostConstruct
public
void
init
()
{
public
void
init
()
{
companyCodeRegNameMap
=
JsonUtils
.
getResourceJson
(
regNameJson
);
ExecutorService
executorService
=
Executors
.
newFixedThreadPool
(
threadNum
);
ExecutorService
executorService
=
Executors
.
newFixedThreadPool
(
threadNum
);
// 可处理的检验检测类型,目前只处理检验的,不处理检测业务
// 可处理的检验检测类型,目前只处理检验的,不处理检测业务
List
<
String
>
canDealInspectionTypes
=
getCanDealInspectionType
();
List
<
String
>
canDealInspectionTypes
=
getCanDealInspectionType
();
...
@@ -207,9 +217,11 @@ public class InspectionApplicationPushEventListener implements ApplicationListen
...
@@ -207,9 +217,11 @@ public class InspectionApplicationPushEventListener implements ApplicationListen
// 注册信息
// 注册信息
this
.
setRegisterInfo
(
equipData
,
e
.
getEquipUnicode
());
this
.
setRegisterInfo
(
equipData
,
e
.
getEquipUnicode
());
// 制造信息
// 制造信息
this
.
setProductData
(
equipData
,
e
.
getEquipUnicode
());
this
.
setProductData
(
equipData
,
e
.
getEquipUnicode
());
// 设计信息
this
.
setDesignInfo
(
equipData
,
e
.
getEquipUnicode
());
// 维保单位信息
// 维保单位信息
this
.
setMaintenanceInfo
(
equipData
,
e
.
getEquipUnicode
());
this
.
setMaintenanceInfo
(
equipData
,
e
.
getEquipUnicode
());
// 单个查询执行,原因数据量较大 in 慢
// 单个查询执行,原因数据量较大 in 慢
this
.
setOtherInfo
(
equipData
,
e
.
getEquipUnicode
(),
applicationModel
.
getInspectionType
());
this
.
setOtherInfo
(
equipData
,
e
.
getEquipUnicode
(),
applicationModel
.
getInspectionType
());
// 单个查询执行,原因数据量较大 in 慢
// 单个查询执行,原因数据量较大 in 慢
...
@@ -218,11 +230,20 @@ public class InspectionApplicationPushEventListener implements ApplicationListen
...
@@ -218,11 +230,20 @@ public class InspectionApplicationPushEventListener implements ApplicationListen
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
}
}
private
void
setDesignInfo
(
InspectionEquipData
equipData
,
String
equipUnicode
)
{
IdxBizJgDesignInfo
designInfo
=
designInfoMapper
.
selectOne
(
new
LambdaQueryWrapper
<
IdxBizJgDesignInfo
>()
.
eq
(
IdxBizJgDesignInfo:
:
getRecord
,
equipUnicode
)
.
select
(
IdxBizJgDesignInfo:
:
getRecord
,
IdxBizJgDesignInfo:
:
getDesignUseDate
));
if
(
designInfo
!=
null
)
{
equipData
.
setDesignUseDate
(
designInfo
.
getDesignUseDate
());
}
}
private
void
setMaintenanceInfo
(
InspectionEquipData
equipData
,
String
equipUnicode
)
{
private
void
setMaintenanceInfo
(
InspectionEquipData
equipData
,
String
equipUnicode
)
{
MaintenanceInfo
maintenanceInfo
=
maintenanceInfoMapper
.
selectOne
(
new
LambdaQueryWrapper
<
MaintenanceInfo
>()
MaintenanceInfo
maintenanceInfo
=
maintenanceInfoMapper
.
selectOne
(
new
LambdaQueryWrapper
<
MaintenanceInfo
>()
.
eq
(
AbstractEquipBaseEntity:
:
getRecord
,
equipUnicode
)
.
eq
(
AbstractEquipBaseEntity:
:
getRecord
,
equipUnicode
)
.
select
(
MaintenanceInfo:
:
getRecord
,
MaintenanceInfo:
:
getMeUnitCreditCode
,
MaintenanceInfo:
:
getMeUnitName
));
.
select
(
MaintenanceInfo:
:
getRecord
,
MaintenanceInfo:
:
getMeUnitCreditCode
,
MaintenanceInfo:
:
getMeUnitName
));
if
(
maintenanceInfo
!=
null
)
{
if
(
maintenanceInfo
!=
null
)
{
equipData
.
setMeUnitCreditCode
(
maintenanceInfo
.
getMeUnitCreditCode
());
equipData
.
setMeUnitCreditCode
(
maintenanceInfo
.
getMeUnitCreditCode
());
equipData
.
setMeUnitName
(
maintenanceInfo
.
getMeUnitName
());
equipData
.
setMeUnitName
(
maintenanceInfo
.
getMeUnitName
());
}
}
...
@@ -245,7 +266,7 @@ public class InspectionApplicationPushEventListener implements ApplicationListen
...
@@ -245,7 +266,7 @@ public class InspectionApplicationPushEventListener implements ApplicationListen
private
void
setRegisterInfo
(
InspectionEquipData
equipData
,
String
equipUnicode
)
{
private
void
setRegisterInfo
(
InspectionEquipData
equipData
,
String
equipUnicode
)
{
LambdaQueryWrapper
<
IdxBizJgRegisterInfo
>
wrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
IdxBizJgRegisterInfo
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
select
(
IdxBizJgRegisterInfo:
:
getEquType
,
IdxBizJgRegisterInfo:
:
getRecord
);
wrapper
.
select
(
IdxBizJgRegisterInfo:
:
getEquType
,
IdxBizJgRegisterInfo:
:
getRecord
);
wrapper
.
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
equipUnicode
);
wrapper
.
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
equipUnicode
);
wrapper
.
select
(
IdxBizJgRegisterInfo:
:
getRecord
,
wrapper
.
select
(
IdxBizJgRegisterInfo:
:
getRecord
,
IdxBizJgRegisterInfo:
:
getEquType
,
IdxBizJgRegisterInfo:
:
getEquType
,
...
@@ -259,20 +280,21 @@ public class InspectionApplicationPushEventListener implements ApplicationListen
...
@@ -259,20 +280,21 @@ public class InspectionApplicationPushEventListener implements ApplicationListen
equipData
.
setUseCertFilePath
(
jgRegisterInfo
.
getLastUseCertFilePath
());
equipData
.
setUseCertFilePath
(
jgRegisterInfo
.
getLastUseCertFilePath
());
}
}
// 登记机关
// 登记机关
if
(
equipData
.
getUseRegistrationCode
()
!=
null
)
{
if
(
equipData
.
getUseRegistrationCode
()
!=
null
)
{
LambdaQueryWrapper
<
JgUseRegistrationManage
>
queryWrapper
=
new
LambdaQueryWrapper
<
JgUseRegistrationManage
>()
LambdaQueryWrapper
<
JgUseRegistrationManage
>
queryWrapper
=
new
LambdaQueryWrapper
<
JgUseRegistrationManage
>()
.
eq
(
JgUseRegistrationManage:
:
getUseRegistrationCode
,
equipData
.
getUseRegistrationCode
())
.
eq
(
JgUseRegistrationManage:
:
getUseRegistrationCode
,
equipData
.
getUseRegistrationCode
())
.
eq
(
JgUseRegistrationManage:
:
getIsDelete
,
0
).
select
(
JgUseRegistrationManage:
:
getRegUnitName
,
BaseEntity:
:
getSequenceNbr
);
.
eq
(
JgUseRegistrationManage:
:
getIsDelete
,
0
)
JgUseRegistrationManage
jgUseRegistrationManage
=
jgUseRegistrationManageMapper
.
selectOne
(
queryWrapper
);
.
select
(
JgUseRegistrationManage:
:
getReceiveCompanyCode
,
BaseEntity:
:
getSequenceNbr
);
if
(
jgUseRegistrationManage
!=
null
){
JgUseRegistrationManage
manage
=
jgUseRegistrationManageMapper
.
selectOne
(
queryWrapper
);
equipData
.
setRegUnitName
(
jgUseRegistrationManage
.
getRegUnitName
());
if
(
manage
!=
null
)
{
equipData
.
setRegUnitName
(
companyCodeRegNameMap
.
getOrDefault
(
manage
.
getReceiveCompanyCode
(),
manage
.
getReceiveOrgName
()));
}
}
}
}
}
}
private
void
setProductData
(
InspectionEquipData
equipData
,
String
record
)
{
private
void
setProductData
(
InspectionEquipData
equipData
,
String
record
)
{
IdxBizJgFactoryInfo
idxBizJgFactoryInfo
=
factoryInfoMapper
.
selectOne
(
new
LambdaQueryWrapper
<
IdxBizJgFactoryInfo
>().
eq
(
IdxBizJgFactoryInfo:
:
getRecord
,
record
));
IdxBizJgFactoryInfo
idxBizJgFactoryInfo
=
factoryInfoMapper
.
selectOne
(
new
LambdaQueryWrapper
<
IdxBizJgFactoryInfo
>().
eq
(
IdxBizJgFactoryInfo:
:
getRecord
,
record
));
if
(
idxBizJgFactoryInfo
!=
null
)
{
if
(
idxBizJgFactoryInfo
!=
null
)
{
equipData
.
setFactoryNum
(
idxBizJgFactoryInfo
.
getFactoryNum
());
equipData
.
setFactoryNum
(
idxBizJgFactoryInfo
.
getFactoryNum
());
equipData
.
setProduceUnitCreditCode
(
idxBizJgFactoryInfo
.
getProduceUnitCreditCode
());
equipData
.
setProduceUnitCreditCode
(
idxBizJgFactoryInfo
.
getProduceUnitCreditCode
());
equipData
.
setProduceUnitName
(
idxBizJgFactoryInfo
.
getProduceUnitName
());
equipData
.
setProduceUnitName
(
idxBizJgFactoryInfo
.
getProduceUnitName
());
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/service/impl/JyjcInspectionResultServiceImpl.java
View file @
132c9620
...
@@ -41,6 +41,7 @@ import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum;
...
@@ -41,6 +41,7 @@ import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.*
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.*
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieModel
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieModel
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.core.io.Resource
;
import
org.springframework.core.io.Resource
;
...
@@ -53,6 +54,7 @@ import org.typroject.tyboot.core.foundation.context.RequestContext;
...
@@ -53,6 +54,7 @@ import org.typroject.tyboot.core.foundation.context.RequestContext;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity
;
import
org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.*
;
import
java.util.*
;
...
@@ -417,37 +419,73 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
...
@@ -417,37 +419,73 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
List
<
JyjcInspectionResultDataModel
>
receivePushResultData
(
List
<
JyjcInspectionResultDataModel
>
resultDataModels
)
{
public
List
<
JyjcInspectionResultDataModel
>
receivePushResultData
(
List
<
JyjcInspectionResultDataModel
>
resultDataModels
)
{
log
.
info
(
"收到检验检测厂商推送的结果数据:{}"
,
JSONArray
.
toJSONString
(
resultDataModels
));
log
.
info
(
"收到检验检测厂商推送的结果数据:{}"
,
JSONArray
.
toJSONString
(
resultDataModels
));
// 1.组织数据
// 1.数据合法性检查
Map
<
String
,
JyjcInspectionResult
>
resultListMap
=
queryWaitUpdateResultList
(
resultDataModels
);
this
.
checkMustFieldIsValid
(
resultDataModels
);
// 2.组织数据
List
<
JyjcInspectionResult
>
resultList
=
queryResultList
(
resultDataModels
);
// key为{record}, value为{JyjcInspectionResult},首次检验时,设备无监管码,用record作为设备标识,可适用与所有的检验结果的接收
Map
<
String
,
JyjcInspectionResult
>
recordResultMap
=
getRecordKeyResultMap
(
resultList
);
// key为{supervisoryCode}, value为{JyjcInspectionResult} ,适用于非首次检验之外的检验结果接收
Map
<
String
,
JyjcInspectionResult
>
superviseCodeKeyResultMap
=
getSuperviseCodeKeyResultMap
(
resultList
);
List
<
JyjcInspectionResult
>
updateResultList
=
new
ArrayList
<>();
List
<
JyjcInspectionResultAttachment
>
resultAttachments
=
new
ArrayList
<>();
List
<
JyjcInspectionResultAttachment
>
resultAttachments
=
new
ArrayList
<>();
List
<
JyjcInspectionResultParam
>
resultParams
=
new
ArrayList
<>();
List
<
JyjcInspectionResultParam
>
resultParams
=
new
ArrayList
<>();
resultDataModels
.
forEach
(
r
->
{
resultDataModels
.
forEach
(
r
->
{
JyjcInspectionResult
result
=
this
.
getJyjcInspectionResult
(
r
,
recordResultMap
,
superviseCodeKeyResultMap
);
if
(
result
!=
null
)
{
// 填充主表数据
// 填充主表数据
this
.
fillResultData
(
r
,
resultListMap
.
get
(
r
.
getApplicationNo
()
+
":"
+
r
.
getSupervisoryCode
())
);
this
.
fillResultData
(
r
,
result
,
updateResultList
);
// 填充附件数据
// 填充附件数据
this
.
fillResultAttachmentData
(
r
,
resultListMap
.
get
(
r
.
getApplicationNo
()
+
":"
+
r
.
getSupervisoryCode
())
,
resultAttachments
);
this
.
fillResultAttachmentData
(
r
,
result
,
resultAttachments
);
// 填充技术参数数据
// 填充技术参数数据
this
.
fillResultParamData
(
r
,
resultListMap
.
get
(
r
.
getApplicationNo
()
+
":"
+
r
.
getSupervisoryCode
()),
resultParams
);
this
.
fillResultParamData
(
r
,
result
,
resultParams
);
}
});
});
// 2.批量保存主表数据
// 3.数据入库
this
.
updateBatchById
(
resultListMap
.
values
());
if
(!
updateResultList
.
isEmpty
()){
// 3.批量保存子表数据
// 3.1 批量保存主表数据
deleteAndCreateSubTable
(
resultListMap
,
resultAttachments
,
resultParams
);
this
.
updateBatchById
(
updateResultList
);
// 4.异步更新最新一次检验信息
// 3.2 批量保存子表数据
eventPublisher
.
publish
(
new
UseInfoSaveToDbEvent
(
this
,
new
ArrayList
<>(
resultListMap
.
values
())));
deleteAndCreateSubTable
(
updateResultList
,
resultAttachments
,
resultParams
);
// 5.异步更新设备的检验检测信息
// 3.3 异步更新最新一次检验信息
eventPublisher
.
publish
(
new
InspectionDetectionSaveToDbEvent
(
this
,
new
ArrayList
<>(
resultListMap
.
values
())));
eventPublisher
.
publish
(
new
UseInfoSaveToDbEvent
(
this
,
new
ArrayList
<>(
updateResultList
)));
// 4.4 异步更新设备的检验检测信息
eventPublisher
.
publish
(
new
InspectionDetectionSaveToDbEvent
(
this
,
new
ArrayList
<>(
updateResultList
)));
}
return
resultDataModels
;
return
resultDataModels
;
}
}
private
void
deleteAndCreateSubTable
(
Map
<
String
,
JyjcInspectionResult
>
resultListMap
,
List
<
JyjcInspectionResultAttachment
>
resultAttachments
,
List
<
JyjcInspectionResultParam
>
resultParams
)
{
private
void
checkMustFieldIsValid
(
List
<
JyjcInspectionResultDataModel
>
resultDataModels
)
{
List
<
JyjcInspectionResult
>
resultList
=
new
ArrayList
<>(
resultListMap
.
values
());
int
i
=
0
;
for
(
JyjcInspectionResultDataModel
resultDataModel
:
resultDataModels
){
i
++;
if
(
StringUtils
.
isEmpty
(
resultDataModel
.
getEquipId
())
&&
StringUtils
.
isEmpty
(
resultDataModel
.
getSupervisoryCode
())){
throw
new
BadRequest
(
"第"
+
i
+
"条数据存在问题,supervisoryCode和equipId不能同时为空!"
);
}
}
}
private
JyjcInspectionResult
getJyjcInspectionResult
(
JyjcInspectionResultDataModel
resultDataModel
,
Map
<
String
,
JyjcInspectionResult
>
recordResultMap
,
Map
<
String
,
JyjcInspectionResult
>
superviseCodeKeyResultMap
){
if
(
StringUtils
.
isNotEmpty
(
resultDataModel
.
getEquipId
())){
return
recordResultMap
.
get
(
resultDataModel
.
getApplicationNo
()
+
":"
+
resultDataModel
.
getEquipId
());
}
if
(
StringUtils
.
isNotEmpty
(
resultDataModel
.
getSupervisoryCode
())){
return
superviseCodeKeyResultMap
.
get
(
resultDataModel
.
getApplicationNo
()
+
":"
+
resultDataModel
.
getSupervisoryCode
());
}
return
null
;
}
private
void
deleteAndCreateSubTable
(
List
<
JyjcInspectionResult
>
resultList
,
List
<
JyjcInspectionResultAttachment
>
resultAttachments
,
List
<
JyjcInspectionResultParam
>
resultParams
)
{
List
<
Long
>
resultIds
=
resultList
.
stream
().
map
(
BaseEntity:
:
getSequenceNbr
).
collect
(
Collectors
.
toList
());
List
<
Long
>
resultIds
=
resultList
.
stream
().
map
(
BaseEntity:
:
getSequenceNbr
).
collect
(
Collectors
.
toList
());
if
(
resultAttachments
.
size
()
>
0
)
{
if
(
!
resultAttachments
.
isEmpty
()
)
{
attachmentService
.
remove
(
new
LambdaQueryWrapper
<
JyjcInspectionResultAttachment
>().
in
(
JyjcInspectionResultAttachment:
:
getResultSeq
,
resultIds
));
attachmentService
.
remove
(
new
LambdaQueryWrapper
<
JyjcInspectionResultAttachment
>().
in
(
JyjcInspectionResultAttachment:
:
getResultSeq
,
resultIds
));
attachmentService
.
saveBatch
(
resultAttachments
);
attachmentService
.
saveBatch
(
resultAttachments
);
}
}
if
(
resultParams
.
size
()
>
0
)
{
if
(
!
resultParams
.
isEmpty
()
)
{
resultParamService
.
remove
(
new
LambdaQueryWrapper
<
JyjcInspectionResultParam
>().
in
(
JyjcInspectionResultParam:
:
getResultSeq
,
resultIds
));
resultParamService
.
remove
(
new
LambdaQueryWrapper
<
JyjcInspectionResultParam
>().
in
(
JyjcInspectionResultParam:
:
getResultSeq
,
resultIds
));
resultParamService
.
saveBatch
(
resultParams
);
resultParamService
.
saveBatch
(
resultParams
);
}
}
...
@@ -486,7 +524,7 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
...
@@ -486,7 +524,7 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
});
});
}
}
private
void
fillResultData
(
JyjcInspectionResultDataModel
r
,
JyjcInspectionResult
jyjcInspectionResult
)
{
private
void
fillResultData
(
JyjcInspectionResultDataModel
r
,
JyjcInspectionResult
jyjcInspectionResult
,
List
<
JyjcInspectionResult
>
updateResultList
)
{
jyjcInspectionResult
.
setResultStatus
(
ResultStatusEnum
.
YES_RESULT
.
getCode
());
jyjcInspectionResult
.
setResultStatus
(
ResultStatusEnum
.
YES_RESULT
.
getCode
());
jyjcInspectionResult
.
setLicenseNumber
(
r
.
getLicenseNumber
());
jyjcInspectionResult
.
setLicenseNumber
(
r
.
getLicenseNumber
());
jyjcInspectionResult
.
setResultNo
(
r
.
getResultNo
());
jyjcInspectionResult
.
setResultNo
(
r
.
getResultNo
());
...
@@ -501,6 +539,7 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
...
@@ -501,6 +539,7 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
jyjcInspectionResult
.
setNonConformance
(
JSON
.
toJSONString
(
r
.
getNonConformance
()));
jyjcInspectionResult
.
setNonConformance
(
JSON
.
toJSONString
(
r
.
getNonConformance
()));
jyjcInspectionResult
.
setRemark
(
"同步数据"
);
jyjcInspectionResult
.
setRemark
(
"同步数据"
);
jyjcInspectionResult
.
setTraceId
(
r
.
getTraceId
());
jyjcInspectionResult
.
setTraceId
(
r
.
getTraceId
());
updateResultList
.
add
(
jyjcInspectionResult
);
}
}
private
String
getUserSeqByPersonCode
(
String
innerPersonCode
)
{
private
String
getUserSeqByPersonCode
(
String
innerPersonCode
)
{
...
@@ -512,14 +551,19 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
...
@@ -512,14 +551,19 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
return
""
;
return
""
;
}
}
private
Map
<
String
,
JyjcInspectionResult
>
queryWaitUpdateResultList
(
List
<
JyjcInspectionResultDataModel
>
resultDataModels
)
{
private
Map
<
String
,
JyjcInspectionResult
>
getSuperviseCodeKeyResultMap
(
List
<
JyjcInspectionResult
>
resultList
)
{
return
resultList
.
stream
().
filter
(
r
->
StringUtils
.
isNotEmpty
(
r
.
getSupervisoryCode
())).
collect
(
Collectors
.
toMap
((
c
)
->
c
.
getApplicationNo
()
+
":"
+
c
.
getSupervisoryCode
(),
Function
.
identity
()));
}
private
Map
<
String
,
JyjcInspectionResult
>
getRecordKeyResultMap
(
List
<
JyjcInspectionResult
>
resultList
)
{
return
resultList
.
stream
().
collect
(
Collectors
.
toMap
((
c
)
->
c
.
getApplicationNo
()
+
":"
+
c
.
getEquipUnicode
(),
Function
.
identity
()));
}
private
List
<
JyjcInspectionResult
>
queryResultList
(
List
<
JyjcInspectionResultDataModel
>
resultDataModels
)
{
List
<
String
>
applicationNos
=
resultDataModels
.
stream
().
map
(
JyjcInspectionResultDataModel:
:
getApplicationNo
).
collect
(
Collectors
.
toList
());
List
<
String
>
applicationNos
=
resultDataModels
.
stream
().
map
(
JyjcInspectionResultDataModel:
:
getApplicationNo
).
collect
(
Collectors
.
toList
());
List
<
String
>
supervisoryCodes
=
resultDataModels
.
stream
().
map
(
JyjcInspectionResultDataModel:
:
getSupervisoryCode
).
collect
(
Collectors
.
toList
());
LambdaQueryWrapper
<
JyjcInspectionResult
>
wrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
JyjcInspectionResult
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
in
(
JyjcInspectionResult:
:
getApplicationNo
,
applicationNos
);
wrapper
.
in
(
JyjcInspectionResult:
:
getApplicationNo
,
applicationNos
);
wrapper
.
in
(
JyjcInspectionResult:
:
getSupervisoryCode
,
supervisoryCodes
);
return
this
.
list
(
wrapper
);
List
<
JyjcInspectionResult
>
resultList
=
this
.
list
(
wrapper
);
return
resultList
.
stream
().
collect
(
Collectors
.
toMap
((
c
)
->
c
.
getApplicationNo
()
+
":"
+
c
.
getSupervisoryCode
(),
Function
.
identity
()));
}
}
public
List
<
DictionarieModel
>
inspectTypeListByPerson
(
ReginParams
selectedOrgInfo
)
{
public
List
<
DictionarieModel
>
inspectTypeListByPerson
(
ReginParams
selectedOrgInfo
)
{
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/java/com/yeejoin/amos/boot/module/statistics/api/mapper/ZBGLStatisticsMapper.java
View file @
132c9620
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistics
.
api
.
mapper
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistics
.
api
.
mapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamForDetailDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamForDetailDto
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
...
@@ -26,4 +27,13 @@ public interface ZBGLStatisticsMapper {
...
@@ -26,4 +27,13 @@ public interface ZBGLStatisticsMapper {
Map
<
String
,
Long
>
getKRJYYDQKChartData
(
@Param
(
"dpFilterParamForDetailDto"
)
DPFilterParamForDetailDto
dpFilterParamForDetailDto
,
@Param
(
"time"
)
String
time
);
Map
<
String
,
Long
>
getKRJYYDQKChartData
(
@Param
(
"dpFilterParamForDetailDto"
)
DPFilterParamForDetailDto
dpFilterParamForDetailDto
,
@Param
(
"time"
)
String
time
);
Map
<
String
,
Long
>
getAYHLXYHSLPMChartData
(
@Param
(
"dpFilterParamForDetailDto"
)
DPFilterParamForDetailDto
dpFilterParamForDetailDto
);
List
<
Map
<
String
,
Long
>>
getAYHLXYHSLPMPageData
(
@Param
(
"dpFilterParamForDetailDto"
)
DPFilterParamForDetailDto
dpFilterParamForDetailDto
);
Map
<
String
,
Long
>
getDNZTDWYHPMChartData
(
@Param
(
"dpFilterParamForDetailDto"
)
DPFilterParamForDetailDto
dpFilterParamForDetailDto
,
@Param
(
"issueTypeList"
)
List
<
String
>
issueTypeList
);
Page
<
Map
<
String
,
Object
>>
getUnitByOrgCode
(
@Param
(
"page"
)
Page
page
,
@Param
(
"dpFilterParamForDetailDto"
)
DPFilterParamForDetailDto
dpFilterParamForDetailDto
);
List
<
Map
<
String
,
Object
>>
getDNZTDWYHPMPageData
(
@Param
(
"unitCodeList"
)
List
<
String
>
unitCodeList
);
}
}
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/resources/mapper/ZBGLStatisticsMapper.xml
View file @
132c9620
...
@@ -82,6 +82,71 @@
...
@@ -82,6 +82,71 @@
supervisory_unit_org_code
supervisory_unit_org_code
LIMIT 1
LIMIT 1
</select>
</select>
<select
id=
"getAYHLXYHSLPMChartData"
resultType=
"java.util.Map"
>
SELECT COUNT
( 1 ) AS allCount,
SUM ( CASE problem_status_code WHEN '1' THEN 1 ELSE 0 END ) AS endCount
FROM
tzs_safety_problem_tracing
WHERE
governing_body_org_code LIKE concat ( #{dpFilterParamForDetailDto.orgCode}, '%' )
</select>
<select
id=
"getAYHLXYHSLPMPageData"
resultType=
"java.util.Map"
>
SELECT COUNT
( 1 ) AS longValue,
problem_type_code AS fieldValueCode
FROM
tzs_safety_problem_tracing
WHERE
governing_body_org_code LIKE concat ( #{dpFilterParamForDetailDto.orgCode}, '%' )
GROUP BY
problem_type_code
</select>
<select
id=
"getDNZTDWYHPMChartData"
resultType=
"java.util.Map"
>
SELECT COUNT
( 1 ) AS allCount,
SUM ( CASE problem_status_code WHEN '1' THEN 1 ELSE 0 END ) AS endCount
FROM
tzs_safety_problem_tracing
WHERE
governing_body_org_code LIKE concat ( #{dpFilterParamForDetailDto.orgCode}, '%' )
AND problem_type_code IN
(
<foreach
collection=
"issueTypeList"
item=
"item"
separator=
","
>
#{item}
</foreach>
)
</select>
<select
id=
"getUnitByOrgCode"
resultType=
"java.util.Map"
>
SELECT
principal_unit_code AS principalUnitCode
FROM
tzs_safety_problem_tracing
WHERE
source_type_code = '2'
AND governing_body_org_code LIKE concat ( #{dpFilterParamForDetailDto.orgCode}, '%' )
GROUP BY
principal_unit_code
</select>
<select
id=
"getDNZTDWYHPMPageData"
resultType=
"java.util.Map"
>
SELECT COUNT
( 1 ),
principal_unit_code AS principalUnitCode,
problem_type_code AS problemTypeCode,
principal_unit AS principalUnit
FROM
tzs_safety_problem_tracing
WHERE
principal_unit_code IN (
<foreach
collection=
"unitCodeList"
item=
"item"
separator=
","
>
#{item}
</foreach>
)
AND source_type_code = '2'
GROUP BY
principal_unit_code,
problem_type_code
</select>
</mapper>
</mapper>
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/service/impl/JYJCDPStatisticsServiceImpl.java
View file @
132c9620
...
@@ -249,8 +249,8 @@ public class JYJCDPStatisticsServiceImpl {
...
@@ -249,8 +249,8 @@ public class JYJCDPStatisticsServiceImpl {
List
<
Map
<
String
,
String
>>
typeNameList
=
UnitTypeEnum
.
getTypeNameList
();
List
<
Map
<
String
,
String
>>
typeNameList
=
UnitTypeEnum
.
getTypeNameList
();
List
<
Map
<
String
,
Object
>>
result
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
result
=
new
ArrayList
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"title"
,
"人员类型"
);
map
.
put
(
"title"
,
"人员
全部
类型"
);
map
.
put
(
"value"
,
"
0
"
);
map
.
put
(
"value"
,
"
all
"
);
map
.
put
(
"children"
,
typeNameList
);
map
.
put
(
"children"
,
typeNameList
);
result
.
add
(
map
);
result
.
add
(
map
);
return
result
;
return
result
;
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/service/impl/ZBGLImpl/AyhlxyhslpmServiceImpl.java
0 → 100644
View file @
132c9620
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistcs
.
biz
.
service
.
impl
.
ZBGLImpl
;
import
cn.hutool.core.lang.UUID
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamForDetailDto
;
import
com.yeejoin.amos.boot.module.statistcs.biz.service.IZBGLService
;
import
com.yeejoin.amos.boot.module.statistcs.biz.service.impl.StCommonServiceImpl
;
import
com.yeejoin.amos.boot.module.statistics.api.mapper.ZBGLStatisticsMapper
;
import
com.yeejoin.amos.feign.systemctl.model.RegionModel
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.text.DecimalFormat
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
@Component
public
class
AyhlxyhslpmServiceImpl
implements
IZBGLService
{
@Resource
private
StCommonServiceImpl
stCommonService
;
@Resource
private
ZBGLStatisticsMapper
zbglStatisticsMapper
;
@Override
public
Map
<
String
,
Object
>
getChart
(
DPFilterParamForDetailDto
dpFilterParamForDetailDto
)
{
List
<
RegionModel
>
regionModels
=
stCommonService
.
setRegionIfRootParent
(
dpFilterParamForDetailDto
.
getCityCode
());
List
<
Map
<
String
,
Object
>>
result
=
regionModels
.
parallelStream
().
map
(
r
->
{
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
r
.
getRegionCode
()+
""
);
DPFilterParamForDetailDto
dpFilterParamForDetailDtoNew
=
new
DPFilterParamForDetailDto
();
dpFilterParamForDetailDtoNew
.
setOrgCode
(
orgCode
);
Map
<
String
,
Object
>
itemResult
=
new
HashMap
<>();
Map
<
String
,
Long
>
map
=
zbglStatisticsMapper
.
getAYHLXYHSLPMChartData
(
dpFilterParamForDetailDtoNew
);
if
(
map
.
get
(
"allCount"
)
!=
0
&&
map
.
get
(
"endCount"
)
!=
0
){
itemResult
.
put
(
"rate"
,
BigDecimal
.
valueOf
(
map
.
get
(
"endCount"
)).
divide
(
BigDecimal
.
valueOf
(
map
.
get
(
"allCount"
)),
2
,
RoundingMode
.
HALF_UP
).
stripTrailingZeros
().
toPlainString
());
}
else
{
itemResult
.
put
(
"rate"
,
"0"
);
}
itemResult
.
put
(
"count"
,
map
.
get
(
"allCount"
));
itemResult
.
put
(
"xdata"
,
r
.
getRegionName
());
return
itemResult
;
}).
collect
(
Collectors
.
toList
());
Map
<
String
,
Object
>
returnMap
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
legendData
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
2
;
i
++){
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
if
(
i
==
0
){
map
.
put
(
"dataKey"
,
"count"
);
map
.
put
(
"value"
,
"隐患总数"
);
map
.
put
(
"chartType"
,
"bar"
);
}
else
{
map
.
put
(
"dataKey"
,
"rate"
);
map
.
put
(
"value"
,
"完结率"
);
map
.
put
(
"chartType"
,
"line"
);
}
legendData
.
add
(
map
);
}
returnMap
.
put
(
"legendData"
,
legendData
);
List
xdata
=
new
ArrayList
();
List
count
=
new
ArrayList
();
List
rate
=
new
ArrayList
();
Long
sum
=
0L
;
for
(
int
i
=
0
;
i
<
result
.
size
();
i
++){
sum
=
sum
+
(
Long
)
result
.
get
(
i
).
get
(
"count"
);
}
for
(
int
i
=
0
;
i
<
result
.
size
();
i
++){
xdata
.
add
(
result
.
get
(
i
).
get
(
"xdata"
));
count
.
add
(
result
.
get
(
i
).
get
(
"count"
)
==
null
?
"0"
:
result
.
get
(
i
).
get
(
"count"
)+
""
);
rate
.
add
(
result
.
get
(
i
).
get
(
"rate"
)
==
null
?
"0"
:
result
.
get
(
i
).
get
(
"rate"
)+
""
);
}
returnMap
.
put
(
"xdata"
,
xdata
);
returnMap
.
put
(
"count"
,
count
);
returnMap
.
put
(
"rate"
,
rate
);
return
returnMap
;
}
@Override
public
Page
<
Map
<
String
,
Object
>>
getPage
(
Page
page
,
DPFilterParamForDetailDto
dpFilterParamForDetailDto
)
{
List
<
RegionModel
>
regionModels
=
stCommonService
.
setRegionIfRootParent
(
dpFilterParamForDetailDto
.
getCityCode
());
List
<
Map
<
String
,
Object
>>
result
=
regionModels
.
parallelStream
().
map
(
r
->
{
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
r
.
getRegionCode
()+
""
);
DPFilterParamForDetailDto
dpFilterParamForDetailDtoNew
=
new
DPFilterParamForDetailDto
();
dpFilterParamForDetailDtoNew
.
setOrgCode
(
orgCode
);
Map
<
String
,
Object
>
itemResult
=
new
HashMap
<>();
List
<
Map
<
String
,
Long
>>
list
=
zbglStatisticsMapper
.
getAYHLXYHSLPMPageData
(
dpFilterParamForDetailDtoNew
);
Long
sum
=
0L
;
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++){
sum
=
sum
+
(
Long
)
list
.
get
(
i
).
get
(
"longValue"
);
}
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++){
if
(
sum
!=
0
&&
(
Long
)
list
.
get
(
i
).
get
(
"longValue"
)
!=
0
){
itemResult
.
put
(
list
.
get
(
i
).
get
(
"fieldValueCode"
)+
""
,
list
.
get
(
i
).
get
(
"longValue"
)+
" / "
+
new
BigDecimal
(
list
.
get
(
i
).
get
(
"longValue"
)+
""
).
divide
(
BigDecimal
.
valueOf
(
sum
),
2
,
RoundingMode
.
HALF_UP
).
multiply
(
BigDecimal
.
valueOf
(
100
)).
stripTrailingZeros
().
toPlainString
()+
"%"
);
}
}
itemResult
.
put
(
"area"
,
r
.
getRegionName
());
itemResult
.
put
(
"sequenceNbr"
,
UUID
.
fastUUID
().
toString
());
return
itemResult
;
}).
collect
(
Collectors
.
toList
());
page
.
setRecords
(
result
);
page
.
setTotal
(
result
.
size
());
return
page
;
}
@Override
public
List
<
Map
<
String
,
String
>>
getTitle
(
DPFilterParamForDetailDto
dpFilterParamForDetailDto
)
{
List
<
Map
<
String
,
String
>>
list
=
zbglStatisticsMapper
.
getTypeList
(
"ISSUE_TYPE"
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"dataIndex"
,
"area"
);
map
.
put
(
"title"
,
"区域"
);
list
.
add
(
0
,
map
);
return
list
;
}
}
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/service/impl/ZBGLImpl/DnztdwyhpmServiceImpl.java
0 → 100644
View file @
132c9620
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistcs
.
biz
.
service
.
impl
.
ZBGLImpl
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.lang.UUID
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamForDetailDto
;
import
com.yeejoin.amos.boot.module.common.api.enums.IssueMainBodyEnum
;
import
com.yeejoin.amos.boot.module.common.api.enums.IssueTypeEnum
;
import
com.yeejoin.amos.boot.module.statistcs.biz.service.IZBGLService
;
import
com.yeejoin.amos.boot.module.statistcs.biz.service.impl.StCommonServiceImpl
;
import
com.yeejoin.amos.boot.module.statistics.api.mapper.ZBGLStatisticsMapper
;
import
com.yeejoin.amos.feign.systemctl.model.RegionModel
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
@Component
public
class
DnztdwyhpmServiceImpl
implements
IZBGLService
{
@Resource
private
StCommonServiceImpl
stCommonService
;
@Resource
private
ZBGLStatisticsMapper
zbglStatisticsMapper
;
@Override
public
Map
<
String
,
Object
>
getChart
(
DPFilterParamForDetailDto
dpFilterParamForDetailDto
)
{
List
<
RegionModel
>
regionModels
=
stCommonService
.
setRegionIfRootParent
(
dpFilterParamForDetailDto
.
getCityCode
());
List
<
String
>
issueTypeList
=
IssueTypeEnum
.
getEnumCodeListByMainBody
(
IssueMainBodyEnum
.
COMPANY
.
getCode
());
List
<
Map
<
String
,
Object
>>
result
=
regionModels
.
parallelStream
().
map
(
r
->
{
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
r
.
getRegionCode
()+
""
);
DPFilterParamForDetailDto
dpFilterParamForDetailDtoNew
=
new
DPFilterParamForDetailDto
();
dpFilterParamForDetailDtoNew
.
setOrgCode
(
orgCode
);
Map
<
String
,
Object
>
itemResult
=
new
HashMap
<>();
Map
<
String
,
Long
>
map
=
zbglStatisticsMapper
.
getDNZTDWYHPMChartData
(
dpFilterParamForDetailDtoNew
,
issueTypeList
);
if
(
map
.
get
(
"allCount"
)
!=
0
&&
map
.
get
(
"endCount"
)
!=
0
){
itemResult
.
put
(
"rate"
,
BigDecimal
.
valueOf
(
map
.
get
(
"endCount"
)).
divide
(
BigDecimal
.
valueOf
(
map
.
get
(
"allCount"
)),
2
,
RoundingMode
.
HALF_UP
).
stripTrailingZeros
().
toPlainString
());
}
else
{
itemResult
.
put
(
"rate"
,
"0"
);
}
itemResult
.
put
(
"count"
,
map
.
get
(
"allCount"
));
itemResult
.
put
(
"xdata"
,
r
.
getRegionName
());
return
itemResult
;
}).
collect
(
Collectors
.
toList
());
Map
<
String
,
Object
>
returnMap
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
legendData
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
2
;
i
++){
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
if
(
i
==
0
){
map
.
put
(
"dataKey"
,
"count"
);
map
.
put
(
"value"
,
"隐患总数"
);
map
.
put
(
"chartType"
,
"bar"
);
}
else
{
map
.
put
(
"dataKey"
,
"rate"
);
map
.
put
(
"value"
,
"完结率"
);
map
.
put
(
"chartType"
,
"line"
);
}
legendData
.
add
(
map
);
}
returnMap
.
put
(
"legendData"
,
legendData
);
List
xdata
=
new
ArrayList
();
List
count
=
new
ArrayList
();
List
rate
=
new
ArrayList
();
Long
sum
=
0L
;
for
(
int
i
=
0
;
i
<
result
.
size
();
i
++){
sum
=
sum
+
(
Long
)
result
.
get
(
i
).
get
(
"count"
);
}
for
(
int
i
=
0
;
i
<
result
.
size
();
i
++){
xdata
.
add
(
result
.
get
(
i
).
get
(
"xdata"
));
count
.
add
(
result
.
get
(
i
).
get
(
"count"
)
==
null
?
"0"
:
result
.
get
(
i
).
get
(
"count"
)+
""
);
rate
.
add
(
result
.
get
(
i
).
get
(
"rate"
)
==
null
?
"0"
:
result
.
get
(
i
).
get
(
"rate"
)+
""
);
}
returnMap
.
put
(
"xdata"
,
xdata
);
returnMap
.
put
(
"count"
,
count
);
returnMap
.
put
(
"rate"
,
rate
);
return
returnMap
;
}
@Override
public
Page
<
Map
<
String
,
Object
>>
getPage
(
Page
page
,
DPFilterParamForDetailDto
dpFilterParamForDetailDto
)
{
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
dpFilterParamForDetailDto
.
getCityCode
());
dpFilterParamForDetailDto
.
setOrgCode
(
orgCode
);
Page
<
Map
<
String
,
Object
>>
returnPage
=
zbglStatisticsMapper
.
getUnitByOrgCode
(
page
,
dpFilterParamForDetailDto
);
List
<
String
>
unitCodeList
=
new
ArrayList
<>();
Map
<
String
,
Map
<
String
,
Object
>>
unitMap
=
new
HashMap
<>();
for
(
int
i
=
0
;
i
<
returnPage
.
getRecords
().
size
();
i
++){
unitMap
.
put
(
returnPage
.
getRecords
().
get
(
i
).
get
(
"principalUnitCode"
).
toString
(),
new
HashMap
<>());
unitCodeList
.
add
(
returnPage
.
getRecords
().
get
(
i
).
get
(
"principalUnitCode"
).
toString
());
}
Map
<
String
,
Long
>
countMap
=
new
HashMap
<>();
if
(!
CollectionUtil
.
isEmpty
(
unitCodeList
))
{
List
<
Map
<
String
,
Object
>>
list
=
zbglStatisticsMapper
.
getDNZTDWYHPMPageData
(
unitCodeList
);
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
Map
<
String
,
Object
>
map
=
unitMap
.
get
(
list
.
get
(
i
).
get
(
"principalUnitCode"
));
map
.
put
(
list
.
get
(
i
).
get
(
"problemTypeCode"
)
+
""
,
list
.
get
(
i
).
get
(
"count"
));
map
.
put
(
"principalUnit"
,
list
.
get
(
i
).
get
(
"principalUnit"
));
map
.
put
(
"principalUnitCode"
,
list
.
get
(
i
).
get
(
"principalUnitCode"
));
Long
aLong
=
countMap
.
get
(
list
.
get
(
i
).
get
(
"principalUnitCode"
));
if
(
aLong
==
null
)
{
countMap
.
put
(
list
.
get
(
i
).
get
(
"principalUnitCode"
).
toString
(),
(
Long
)
list
.
get
(
i
).
get
(
"count"
));
}
else
{
countMap
.
put
(
list
.
get
(
i
).
get
(
"principalUnitCode"
).
toString
(),
aLong
+
(
Long
)
list
.
get
(
i
).
get
(
"count"
));
}
}
List
<
Map
<
String
,
Object
>>
resultList
=
new
ArrayList
();
unitMap
.
entrySet
().
forEach
(
item
->
{
Map
<
String
,
Object
>
value
=
item
.
getValue
();
value
.
entrySet
().
forEach
(
t
->
{
if
(!
t
.
getKey
().
equals
(
"principalUnit"
)
&&
!
t
.
getKey
().
equals
(
"principalUnitCode"
))
{
t
.
setValue
(
t
.
getValue
()
+
" / "
+
new
BigDecimal
(
t
.
getValue
()
+
""
).
divide
(
BigDecimal
.
valueOf
(
countMap
.
get
(
item
.
getValue
().
get
(
"principalUnitCode"
))),
2
,
RoundingMode
.
HALF_UP
).
multiply
(
BigDecimal
.
valueOf
(
100
)).
stripTrailingZeros
().
toPlainString
()
+
"%"
);
}
});
resultList
.
add
(
value
);
});
page
.
setRecords
(
resultList
);
}
return
page
;
}
@Override
public
List
<
Map
<
String
,
String
>>
getTitle
(
DPFilterParamForDetailDto
dpFilterParamForDetailDto
)
{
List
<
Map
<
String
,
String
>>
list
=
IssueTypeEnum
.
getEnumListByMainBody
(
IssueMainBodyEnum
.
COMPANY
.
getCode
());
List
<
Map
<
String
,
String
>>
returnList
=
new
ArrayList
();
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++){
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"dataIndex"
,
list
.
get
(
i
).
get
(
"code"
));
map
.
put
(
"title"
,
list
.
get
(
i
).
get
(
"name"
));
returnList
.
add
(
map
);
}
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"dataIndex"
,
"principalUnit"
);
map
.
put
(
"title"
,
"主体名称"
);
returnList
.
add
(
0
,
map
);
Map
<
String
,
String
>
map1
=
new
HashMap
<>();
map1
.
put
(
"dataIndex"
,
"principalUnitCode"
);
map1
.
put
(
"title"
,
"主体编码"
);
returnList
.
add
(
1
,
map1
);
return
returnList
;
}
}
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/service/impl/ZBGLImpl/KrjyydqkServiceImpl.java
View file @
132c9620
...
@@ -46,20 +46,25 @@ public class KrjyydqkServiceImpl implements IZBGLService {
...
@@ -46,20 +46,25 @@ public class KrjyydqkServiceImpl implements IZBGLService {
for
(
int
i
=
0
;
i
<
5
;
i
++){
for
(
int
i
=
0
;
i
<
5
;
i
++){
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
if
(
i
==
0
){
if
(
i
==
0
){
map
.
put
(
"dataIndex"
,
"lessNum"
);
map
.
put
(
"dataKey"
,
"lessNum"
);
map
.
put
(
"title"
,
"30分钟内到达次数"
);
map
.
put
(
"value"
,
"30分钟内到达次数"
);
map
.
put
(
"chartType"
,
"bar"
);
}
else
if
(
i
==
1
)
{
}
else
if
(
i
==
1
)
{
map
.
put
(
"dataIndex"
,
"greaterNum"
);
map
.
put
(
"dataKey"
,
"greaterNum"
);
map
.
put
(
"title"
,
"超过30分钟到次数"
);
map
.
put
(
"value"
,
"超过30分钟到次数"
);
map
.
put
(
"chartType"
,
"bar"
);
}
else
if
(
i
==
2
){
}
else
if
(
i
==
2
){
map
.
put
(
"dataIndex"
,
"levelOne"
);
map
.
put
(
"dataKey"
,
"levelOne"
);
map
.
put
(
"title"
,
"一级救援次数"
);
map
.
put
(
"value"
,
"一级救援次数"
);
map
.
put
(
"chartType"
,
"bar"
);
}
else
if
(
i
==
3
){
}
else
if
(
i
==
3
){
map
.
put
(
"dataIndex"
,
"levelTwo"
);
map
.
put
(
"dataKey"
,
"levelTwo"
);
map
.
put
(
"title"
,
"二级救援次数"
);
map
.
put
(
"value"
,
"二级救援次数"
);
map
.
put
(
"chartType"
,
"bar"
);
}
else
{
}
else
{
map
.
put
(
"dataIndex"
,
"levelThree"
);
map
.
put
(
"dataKey"
,
"levelThree"
);
map
.
put
(
"title"
,
"三级救援次数"
);
map
.
put
(
"value"
,
"三级救援次数"
);
map
.
put
(
"chartType"
,
"bar"
);
}
}
legendData
.
add
(
map
);
legendData
.
add
(
map
);
}
}
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/service/impl/ZBGLImpl/QyaqzstjServiceImpl.java
0 → 100644
View file @
132c9620
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistcs
.
biz
.
service
.
impl
.
ZBGLImpl
;
import
cn.hutool.core.lang.UUID
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.dto.KeyValueDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamForDetailDto
;
import
com.yeejoin.amos.boot.module.statistcs.biz.service.IZBGLService
;
import
com.yeejoin.amos.boot.module.statistcs.biz.service.impl.AQZSDPStatisticsServiceImpl
;
import
com.yeejoin.amos.boot.module.statistcs.biz.service.impl.StCommonServiceImpl
;
import
com.yeejoin.amos.boot.module.statistics.api.dto.SecurityIndexCountItemDto
;
import
com.yeejoin.amos.boot.module.statistics.api.mapper.AQZSDPStatisticsMapper
;
import
com.yeejoin.amos.boot.module.statistics.api.mapper.CylinderStatisticsMapper
;
import
com.yeejoin.amos.boot.module.statistics.api.mapper.ZBGLStatisticsMapper
;
import
com.yeejoin.amos.feign.systemctl.model.RegionModel
;
import
org.elasticsearch.client.RequestOptions
;
import
org.elasticsearch.client.RestHighLevelClient
;
import
org.elasticsearch.client.core.CountRequest
;
import
org.elasticsearch.client.core.CountResponse
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.ObjectUtils
;
import
javax.annotation.Resource
;
import
java.io.IOException
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.text.DecimalFormat
;
import
java.util.*
;
import
java.util.stream.Collectors
;
@Component
public
class
QyaqzstjServiceImpl
implements
IZBGLService
{
private
final
static
String
LICENSE_IS_OK
=
"正常"
;
private
final
static
String
NO_DATA_STR
=
"--"
;
@Resource
private
StCommonServiceImpl
stCommonService
;
@Resource
private
ZBGLStatisticsMapper
zbglStatisticsMapper
;
@Resource
private
CylinderStatisticsMapper
cylinderStatisticsMapper
;
@Resource
private
AQZSDPStatisticsMapper
statisticsMapper
;
@Resource
private
RestHighLevelClient
restHighLevelClient
;
@Override
public
Map
<
String
,
Object
>
getChart
(
DPFilterParamForDetailDto
dpFilterParamForDetailDto
)
{
List
<
RegionModel
>
regionModels
=
stCommonService
.
setRegionIfRootParent
(
dpFilterParamForDetailDto
.
getCityCode
());
List
<
SecurityIndexCountItemDto
>
result
=
regionModels
.
parallelStream
().
map
(
r
->
{
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
r
.
getRegionCode
()+
""
);
SecurityIndexCountItemDto
countItemDto
=
new
SecurityIndexCountItemDto
();
countItemDto
.
setRegionCode
(
r
.
getRegionCode
().
toString
());
countItemDto
.
setRegionName
(
r
.
getRegionName
());
if
(
ObjectUtils
.
isEmpty
(
orgCode
))
{
this
.
setDefaultZeroData
(
countItemDto
);
}
else
{
// 1.许可有效率
String
value
=
this
.
getLicenseEfficiencyByRegion
(
orgCode
);
if
(
NO_DATA_STR
.
equals
(
value
))
{
value
=
"0"
;
countItemDto
.
setXuke
(
value
);
}
else
{
countItemDto
.
setXuke
(
value
);
}
// 2.使用登记办理率
countItemDto
.
setShiyongdengji
(
cylinderStatisticsMapper
.
queryUserRegisterCertAppPercent
(
orgCode
));
// 3.检验超期率
countItemDto
.
setJianyanchaoqi
(
statisticsMapper
.
getInspectionExpiredRate
(
orgCode
,
null
).
get
(
"expiredRate"
).
toString
());
// 4.检验合格率
countItemDto
.
setJianyanhege
(
statisticsMapper
.
getInspectionResultRate
(
orgCode
,
null
).
get
(
"resultRate"
).
toString
());
// 5.充装检查率
long
totalAll
=
searchEsCount
(
false
,
false
,
orgCode
,
null
);
long
totalCheck
=
searchEsCount
(
true
,
false
,
orgCode
,
null
);
long
totalResult
=
searchEsCount
(
false
,
true
,
orgCode
,
null
);
if
(
totalAll
!=
0
)
{
countItemDto
.
setCzjc
(
new
DecimalFormat
(
"#.00"
).
format
(((
double
)
totalCheck
/
totalAll
)
*
100
));
}
else
{
countItemDto
.
setCzjc
(
"0"
);
}
// 6.充装检查合格率
if
(
totalAll
!=
0
)
{
countItemDto
.
setCzjchege
(
new
DecimalFormat
(
"#.00"
).
format
(((
double
)
totalResult
/
totalAll
)
*
100
));
}
else
{
countItemDto
.
setCzjchege
(
"0"
);
}
// todo: 7.人员合规率(资质有效期统计) 8.数据合规率需求未明确暂时都为0
// 7.人员合规率(资质有效期统计)
countItemDto
.
setRyhg
(
"0"
);
// 8.数据合规率
countItemDto
.
setSjhg
(
"0"
);
}
return
countItemDto
;
}).
collect
(
Collectors
.
toList
());
Set
<
Map
<
String
,
String
>>
legendData
=
getLegendForCyArea
();
List
<
String
>
xuke
=
new
ArrayList
<>();
List
<
String
>
shiyongdengji
=
new
ArrayList
<>();
List
<
String
>
jianyanchaoqi
=
new
ArrayList
<>();
List
<
String
>
jianyanhege
=
new
ArrayList
<>();
List
<
String
>
czjc
=
new
ArrayList
<>();
List
<
String
>
czjchege
=
new
ArrayList
<>();
List
<
String
>
ryhg
=
new
ArrayList
<>();
List
<
String
>
sjhg
=
new
ArrayList
<>();
List
<
String
>
xdata
=
new
ArrayList
<>();
result
.
forEach
(
countItemDto
->
{
xuke
.
add
(
this
.
castScore2Percent
(
countItemDto
.
getXuke
()));
shiyongdengji
.
add
(
this
.
castScore2Percent
(
countItemDto
.
getShiyongdengji
()));
jianyanchaoqi
.
add
(
this
.
castScore2Percent
(
countItemDto
.
getJianyanchaoqi
()));
jianyanhege
.
add
(
this
.
castScore2Percent
(
countItemDto
.
getJianyanhege
()));
czjc
.
add
(
this
.
castScore2Percent
(
countItemDto
.
getCzjc
()));
czjchege
.
add
(
this
.
castScore2Percent
(
countItemDto
.
getCzjchege
()));
ryhg
.
add
(
this
.
castScore2Percent
(
countItemDto
.
getRyhg
()));
sjhg
.
add
(
this
.
castScore2Percent
(
countItemDto
.
getSjhg
()));
xdata
.
add
(
countItemDto
.
getRegionName
());
});
Map
<
String
,
Object
>
returnMap
=
new
HashMap
<>();
returnMap
.
put
(
"xdata"
,
xdata
);
returnMap
.
put
(
"legendData"
,
legendData
);
returnMap
.
put
(
"xuke"
,
xuke
);
returnMap
.
put
(
"shiyongdengji"
,
shiyongdengji
);
returnMap
.
put
(
"jianyanchaoqi"
,
jianyanchaoqi
);
returnMap
.
put
(
"jianyanhege"
,
jianyanhege
);
returnMap
.
put
(
"czjc"
,
czjc
);
returnMap
.
put
(
"czjchege"
,
czjchege
);
returnMap
.
put
(
"ryhg"
,
ryhg
);
returnMap
.
put
(
"sjhg"
,
sjhg
);
return
returnMap
;
}
@Override
public
Page
<
Map
<
String
,
Object
>>
getPage
(
Page
page
,
DPFilterParamForDetailDto
dpFilterParamForDetailDto
)
{
List
<
RegionModel
>
regionModels
=
stCommonService
.
setRegionIfRootParent
(
dpFilterParamForDetailDto
.
getCityCode
());
List
<
SecurityIndexCountItemDto
>
result
=
regionModels
.
parallelStream
().
map
(
r
->
{
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
r
.
getRegionCode
()+
""
);
SecurityIndexCountItemDto
countItemDto
=
new
SecurityIndexCountItemDto
();
countItemDto
.
setRegionCode
(
r
.
getRegionCode
().
toString
());
countItemDto
.
setRegionName
(
r
.
getRegionName
());
if
(
ObjectUtils
.
isEmpty
(
orgCode
))
{
this
.
setDefaultZeroData
(
countItemDto
);
}
else
{
// 1.许可有效率
String
value
=
this
.
getLicenseEfficiencyByRegion
(
orgCode
);
if
(
NO_DATA_STR
.
equals
(
value
))
{
value
=
"0"
;
countItemDto
.
setXuke
(
value
);
}
else
{
countItemDto
.
setXuke
(
value
);
}
// 2.使用登记办理率
countItemDto
.
setShiyongdengji
(
cylinderStatisticsMapper
.
queryUserRegisterCertAppPercent
(
orgCode
));
// 3.检验超期率
countItemDto
.
setJianyanchaoqi
(
statisticsMapper
.
getInspectionExpiredRate
(
orgCode
,
null
).
get
(
"expiredRate"
).
toString
());
// 4.检验合格率
countItemDto
.
setJianyanhege
(
statisticsMapper
.
getInspectionResultRate
(
orgCode
,
null
).
get
(
"resultRate"
).
toString
());
// 5.充装检查率
long
totalAll
=
searchEsCount
(
false
,
false
,
orgCode
,
null
);
long
totalCheck
=
searchEsCount
(
true
,
false
,
orgCode
,
null
);
long
totalResult
=
searchEsCount
(
false
,
true
,
orgCode
,
null
);
if
(
totalAll
!=
0
)
{
countItemDto
.
setCzjc
(
new
DecimalFormat
(
"#.00"
).
format
(((
double
)
totalCheck
/
totalAll
)
*
100
));
}
else
{
countItemDto
.
setCzjc
(
"0"
);
}
// 6.充装检查合格率
if
(
totalAll
!=
0
)
{
countItemDto
.
setCzjchege
(
new
DecimalFormat
(
"#.00"
).
format
(((
double
)
totalResult
/
totalAll
)
*
100
));
}
else
{
countItemDto
.
setCzjchege
(
"0"
);
}
// todo: 7.人员合规率(资质有效期统计) 8.数据合规率需求未明确暂时都为0
// 7.人员合规率(资质有效期统计)
countItemDto
.
setRyhg
(
"0"
);
// 8.数据合规率
countItemDto
.
setSjhg
(
"0"
);
}
return
countItemDto
;
}).
collect
(
Collectors
.
toList
());
page
.
setRecords
(
result
);
return
page
;
}
@Override
public
List
<
Map
<
String
,
String
>>
getTitle
(
DPFilterParamForDetailDto
dpFilterParamForDetailDto
)
{
List
<
Map
<
String
,
String
>>
list
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
9
;
i
++){
Map
<
String
,
String
>
map
=
new
HashMap
<>();
if
(
i
==
0
){
map
.
put
(
"dataIndex"
,
"regionName"
);
map
.
put
(
"title"
,
"区域"
);
}
else
if
(
i
==
1
){
map
.
put
(
"dataIndex"
,
"czjc"
);
map
.
put
(
"title"
,
"充装检查率"
);
}
else
if
(
i
==
2
){
map
.
put
(
"dataIndex"
,
"xuke"
);
map
.
put
(
"title"
,
"许可有效率"
);
}
else
if
(
i
==
3
){
map
.
put
(
"dataIndex"
,
"shiyongdengji"
);
map
.
put
(
"title"
,
"使用登记办理率"
);
}
else
if
(
i
==
4
){
map
.
put
(
"dataIndex"
,
"jianyanchaoqi"
);
map
.
put
(
"title"
,
"检验超期率"
);
}
else
if
(
i
==
5
){
map
.
put
(
"dataIndex"
,
"jianyanhege"
);
map
.
put
(
"title"
,
"检验合格率"
);
}
else
if
(
i
==
6
){
map
.
put
(
"dataIndex"
,
"czjchege"
);
map
.
put
(
"title"
,
"充装检查率"
);
}
else
if
(
i
==
7
){
map
.
put
(
"dataIndex"
,
"ryhg"
);
map
.
put
(
"title"
,
"人员合规率(资质有效期统计)"
);
}
else
if
(
i
==
8
){
map
.
put
(
"dataIndex"
,
"sjhg"
);
map
.
put
(
"title"
,
"数据合规率"
);
}
list
.
add
(
map
);
}
return
list
;
}
private
void
setDefaultZeroData
(
SecurityIndexCountItemDto
countItemDto
)
{
countItemDto
.
setXuke
(
"0"
);
countItemDto
.
setShiyongdengji
(
"0"
);
countItemDto
.
setJianyanhege
(
"0"
);
countItemDto
.
setCzjc
(
"0"
);
countItemDto
.
setCzjchege
(
"0"
);
countItemDto
.
setJianyanchaoqi
(
"0"
);
countItemDto
.
setRyhg
(
"0"
);
countItemDto
.
setSjhg
(
"0"
);
}
private
long
searchEsCount
(
Boolean
checkOk
,
Boolean
resultOk
,
String
regionCode
,
String
appId
)
{
CountRequest
countRequest
=
new
CountRequest
(
"cylinder_filling"
);
BoolQueryBuilder
boolMust
=
QueryBuilders
.
boolQuery
();
if
(
checkOk
)
{
//匹配充装前检查和充装后检查都有数据
BoolQueryBuilder
meBuilder
=
QueryBuilders
.
boolQuery
();
meBuilder
.
must
(
QueryBuilders
.
existsQuery
(
"inspectionDateMs"
));
meBuilder
.
must
(
QueryBuilders
.
existsQuery
(
"inspectionDateAfterMS"
));
boolMust
.
must
(
meBuilder
);
}
if
(
resultOk
)
{
//匹配充装前检查和充装后检查都有数据
BoolQueryBuilder
meBuilder
=
QueryBuilders
.
boolQuery
();
meBuilder
.
must
(
QueryBuilders
.
termQuery
(
"fillingResult.keyword"
,
"合格"
));
meBuilder
.
must
(
QueryBuilders
.
termQuery
(
"checkResult.keyword"
,
"合格"
));
boolMust
.
must
(
meBuilder
);
}
//匹配行政区划
if
(!
ObjectUtils
.
isEmpty
(
regionCode
))
{
BoolQueryBuilder
query
=
QueryBuilders
.
boolQuery
();
query
.
must
(
QueryBuilders
.
wildcardQuery
(
"regionCode"
,
"*"
+
regionCode
+
"*"
));
boolMust
.
must
(
query
);
}
//匹配appId
if
(!
ObjectUtils
.
isEmpty
(
appId
))
{
BoolQueryBuilder
query
=
QueryBuilders
.
boolQuery
();
query
.
must
(
QueryBuilders
.
matchQuery
(
"appId"
,
appId
));
boolMust
.
must
(
query
);
}
countRequest
.
query
(
boolMust
);
try
{
CountResponse
countResponse
=
restHighLevelClient
.
count
(
countRequest
,
RequestOptions
.
DEFAULT
);
return
countResponse
.
getCount
();
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
private
String
getLicenseEfficiencyByRegion
(
String
orgCode
)
{
List
<
KeyValueDto
>
keyValueDtos
=
statisticsMapper
.
queryLicenseEfficiencyOfRegion
(
orgCode
);
int
totalUnitNumber
=
keyValueDtos
.
stream
().
mapToInt
(
KeyValueDto:
:
getIValue
).
sum
();
int
okUnitNumberNumber
=
keyValueDtos
.
stream
().
filter
(
k
->
k
.
getStrKey
().
equals
(
LICENSE_IS_OK
)).
mapToInt
(
KeyValueDto:
:
getIValue
).
sum
();
if
(
totalUnitNumber
==
0
)
{
return
NO_DATA_STR
;
}
BigDecimal
bigTotalUnitNumber
=
new
BigDecimal
(
String
.
valueOf
(
totalUnitNumber
));
BigDecimal
bigOkUnitNumberNumber
=
new
BigDecimal
(
String
.
valueOf
(
okUnitNumberNumber
));
BigDecimal
result
=
bigOkUnitNumberNumber
.
divide
(
bigTotalUnitNumber
,
4
,
RoundingMode
.
HALF_UP
).
multiply
(
new
BigDecimal
(
"100"
)).
setScale
(
2
,
RoundingMode
.
HALF_UP
);
return
result
.
toPlainString
();
}
private
Set
<
Map
<
String
,
String
>>
getLegendForCyArea
()
{
Set
<
Map
<
String
,
String
>>
legendData
=
new
HashSet
<>();
for
(
int
i
=
0
;
i
<
8
;
i
++)
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
if
(
i
==
0
)
{
map
.
put
(
"dataKey"
,
"xuke"
);
map
.
put
(
"value"
,
"许可有效率"
);
}
else
if
(
i
==
1
)
{
map
.
put
(
"dataKey"
,
"shiyongdengji"
);
map
.
put
(
"value"
,
"使用登记办理率"
);
}
else
if
(
i
==
2
)
{
map
.
put
(
"dataKey"
,
"jianyanchaoqi"
);
map
.
put
(
"value"
,
"检验超期率"
);
}
else
if
(
i
==
3
)
{
map
.
put
(
"dataKey"
,
"jianyanhege"
);
map
.
put
(
"value"
,
"检验合格率"
);
}
else
if
(
i
==
4
)
{
map
.
put
(
"dataKey"
,
"czjc"
);
map
.
put
(
"value"
,
"充装检查"
);
}
else
if
(
i
==
5
)
{
map
.
put
(
"dataKey"
,
"czjchege"
);
map
.
put
(
"value"
,
"充装检查合格率"
);
}
else
if
(
i
==
6
)
{
map
.
put
(
"dataKey"
,
"ryhg"
);
map
.
put
(
"value"
,
"人员合规率(资质有效期统计)"
);
}
else
if
(
i
==
7
)
{
map
.
put
(
"dataKey"
,
"sjhg"
);
map
.
put
(
"value"
,
"数据合规率"
);
}
legendData
.
add
(
map
);
}
return
legendData
;
}
public
String
castScore2Percent
(
String
score
)
{
BigDecimal
big
=
new
BigDecimal
(
score
);
BigDecimal
percent
=
big
.
divide
(
new
BigDecimal
(
"100"
),
2
,
RoundingMode
.
HALF_UP
);
return
percent
.
toPlainString
();
}
}
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/service/impl/ZBGLImpl/YwblpjsxtjServiceImpl.java
0 → 100644
View file @
132c9620
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistcs
.
biz
.
service
.
impl
.
ZBGLImpl
;
import
cn.hutool.core.lang.UUID
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.dto.CountDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamForDetailDto
;
import
com.yeejoin.amos.boot.module.statistcs.biz.service.IZBGLService
;
import
com.yeejoin.amos.boot.module.statistcs.biz.service.impl.StCommonServiceImpl
;
import
com.yeejoin.amos.boot.module.statistics.api.mapper.JGStatisticsMapper
;
import
com.yeejoin.amos.boot.module.statistics.api.mapper.ZBGLStatisticsMapper
;
import
com.yeejoin.amos.feign.systemctl.model.RegionModel
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
@Component
public
class
YwblpjsxtjServiceImpl
implements
IZBGLService
{
@Resource
private
StCommonServiceImpl
stCommonService
;
@Resource
private
JGStatisticsMapper
jgStatisticsMapper
;
@Override
public
Map
<
String
,
Object
>
getChart
(
DPFilterParamForDetailDto
dpFilterParamForDetailDto
)
{
List
<
RegionModel
>
regionModels
=
stCommonService
.
setRegionIfRootParent
(
dpFilterParamForDetailDto
.
getCityCode
());
String
orgCodeP
=
stCommonService
.
getAndSetOrgCode
(
dpFilterParamForDetailDto
.
getCityCode
());
DPFilterParamDto
dpFilterParamDto
=
new
DPFilterParamDto
();
//安装告知、维修告知、改造告知、移装告知
List
<
CountDto
>
noticCount
=
jgStatisticsMapper
.
queryNoticeAvgDayByReceiveCompany
(
dpFilterParamDto
,
orgCodeP
);
//使用登记、车用气瓶使用登记
List
<
CountDto
>
useCount
=
jgStatisticsMapper
.
queryUseAvgDayByReceiveCompany
(
dpFilterParamDto
,
orgCodeP
);
//更名变更登记、改造变更登记、移装变更登记、单位变更登记、气瓶单位变更登记
List
<
CountDto
>
changeCount
=
jgStatisticsMapper
.
queryChangeAvgDayByReceiveCompany
(
dpFilterParamDto
,
orgCodeP
);
//启用停用
List
<
CountDto
>
disableCount
=
jgStatisticsMapper
.
queryDisableAvgDayByReceiveCompany
(
dpFilterParamDto
,
orgCodeP
);
//注销报废
List
<
CountDto
>
cancelCount
=
jgStatisticsMapper
.
queryCancelAvgDayByReceiveCompany
(
dpFilterParamDto
,
orgCodeP
);
Map
<
String
,
Object
>
returnMap
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
legendData
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
5
;
i
++){
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
if
(
i
==
0
){
map
.
put
(
"dataKey"
,
"notic"
);
map
.
put
(
"value"
,
"告知管理"
);
map
.
put
(
"chartType"
,
"bar"
);
}
else
if
(
i
==
1
){
map
.
put
(
"dataKey"
,
"use"
);
map
.
put
(
"value"
,
"使用登记"
);
map
.
put
(
"chartType"
,
"bar"
);
}
else
if
(
i
==
2
){
map
.
put
(
"dataKey"
,
"change"
);
map
.
put
(
"value"
,
"变更登记"
);
map
.
put
(
"chartType"
,
"bar"
);
}
else
if
(
i
==
3
){
map
.
put
(
"dataKey"
,
"disable"
);
map
.
put
(
"value"
,
"停用启用"
);
map
.
put
(
"chartType"
,
"bar"
);
}
else
{
map
.
put
(
"dataKey"
,
"cancel"
);
map
.
put
(
"value"
,
"注销报废"
);
map
.
put
(
"chartType"
,
"bar"
);
}
legendData
.
add
(
map
);
}
returnMap
.
put
(
"legendData"
,
legendData
);
List
xdata
=
new
ArrayList
();
List
notic
=
new
ArrayList
();
List
use
=
new
ArrayList
();
List
change
=
new
ArrayList
();
List
disable
=
new
ArrayList
();
List
cancel
=
new
ArrayList
();
regionModels
.
forEach
(
r
->
{
xdata
.
add
(
r
.
getRegionName
());
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
r
.
getRegionCode
().
toString
());
notic
.
add
(
this
.
avgAndSumDealDate
(
noticCount
.
stream
().
filter
(
c
->
c
.
getKeyStr
().
contains
(
orgCode
)).
collect
(
Collectors
.
toList
())));
use
.
add
(
this
.
avgAndSumDealDate
(
useCount
.
stream
().
filter
(
c
->
c
.
getKeyStr
().
contains
(
orgCode
)).
collect
(
Collectors
.
toList
())));
change
.
add
(
this
.
avgAndSumDealDate
(
changeCount
.
stream
().
filter
(
c
->
c
.
getKeyStr
().
contains
(
orgCode
)).
collect
(
Collectors
.
toList
())));
disable
.
add
(
this
.
avgAndSumDealDate
(
disableCount
.
stream
().
filter
(
c
->
c
.
getKeyStr
().
contains
(
orgCode
)).
collect
(
Collectors
.
toList
())));
cancel
.
add
(
this
.
avgAndSumDealDate
(
cancelCount
.
stream
().
filter
(
c
->
c
.
getKeyStr
().
contains
(
orgCode
)).
collect
(
Collectors
.
toList
())));
});
returnMap
.
put
(
"xdata"
,
xdata
);
returnMap
.
put
(
"notic"
,
notic
);
returnMap
.
put
(
"use"
,
use
);
returnMap
.
put
(
"change"
,
change
);
returnMap
.
put
(
"disable"
,
disable
);
returnMap
.
put
(
"cancel"
,
cancel
);
return
returnMap
;
}
@Override
public
Page
<
Map
<
String
,
Object
>>
getPage
(
Page
page
,
DPFilterParamForDetailDto
dpFilterParamForDetailDto
)
{
List
<
RegionModel
>
regionModels
=
stCommonService
.
setRegionIfRootParent
(
dpFilterParamForDetailDto
.
getCityCode
());
return
page
;
}
@Override
public
List
<
Map
<
String
,
String
>>
getTitle
(
DPFilterParamForDetailDto
dpFilterParamForDetailDto
)
{
List
<
Map
<
String
,
String
>>
list
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
6
;
i
++){
Map
<
String
,
String
>
map
=
new
HashMap
<>();
if
(
i
==
0
){
map
.
put
(
"dataIndex"
,
"regionName"
);
map
.
put
(
"title"
,
"区域"
);
}
else
if
(
i
==
1
){
map
.
put
(
"dataIndex"
,
"notic"
);
map
.
put
(
"title"
,
"告知管理"
);
}
else
if
(
i
==
2
){
map
.
put
(
"dataIndex"
,
"use"
);
map
.
put
(
"title"
,
"使用登记"
);
}
else
if
(
i
==
3
){
map
.
put
(
"dataIndex"
,
"change"
);
map
.
put
(
"title"
,
"变更登记"
);
}
else
if
(
i
==
4
){
map
.
put
(
"dataIndex"
,
"disable"
);
map
.
put
(
"title"
,
"停用启用"
);
}
else
if
(
i
==
5
){
map
.
put
(
"dataIndex"
,
"cancel"
);
map
.
put
(
"title"
,
"注销报废"
);
}
list
.
add
(
map
);
}
return
list
;
}
private
String
avgAndSumDealDate
(
List
<
CountDto
>
collect
)
{
BigDecimal
sum
=
collect
.
stream
().
map
(
c
->
new
BigDecimal
(
c
.
getStrValue
())).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
if
(
collect
.
isEmpty
()){
return
"0"
;
}
return
sum
.
divide
(
BigDecimal
.
valueOf
(
collect
.
size
()),
1
,
RoundingMode
.
HALF_UP
).
toPlainString
();
}
}
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