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
74ae1035
Commit
74ae1035
authored
Feb 26, 2025
by
hezhuozhi
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop_tzs_register_test' into develop_tzs_register_test
parents
3d450102
024c9d45
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
342 additions
and
65 deletions
+342
-65
RegistrationTypeEnum.java
...n/amos/boot/module/jg/api/enums/RegistrationTypeEnum.java
+26
-0
SafetyProblemTypeEnum.java
.../amos/boot/module/jg/api/enums/SafetyProblemTypeEnum.java
+2
-1
JgUseRegistrationMapper.java
...os/boot/module/jg/api/mapper/JgUseRegistrationMapper.java
+2
-0
CommonMapper.xml
...-module-jg-api/src/main/resources/mapper/CommonMapper.xml
+2
-2
JgUseRegistrationMapper.xml
...api/src/main/resources/mapper/JgUseRegistrationMapper.xml
+16
-0
SafetyProblemTracingController.java
...ule/jg/biz/controller/SafetyProblemTracingController.java
+1
-1
XKCQEventHandler.java
...oin/amos/boot/module/jg/biz/handler/XKCQEventHandler.java
+7
-0
ZZCQEventHandler.java
...oin/amos/boot/module/jg/biz/handler/ZZCQEventHandler.java
+7
-0
SafetyProblemTopicMessage.java
...oot/module/jg/biz/listener/SafetyProblemTopicMessage.java
+9
-37
CommonServiceImpl.java
...os/boot/module/jg/biz/service/impl/CommonServiceImpl.java
+26
-2
JgChangeRegistrationNameServiceImpl.java
...biz/service/impl/JgChangeRegistrationNameServiceImpl.java
+9
-5
JgUseRegistrationServiceImpl.java
...ule/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
+5
-3
use-registration-form-set.ftl
...rc/main/resources/templates/use-registration-form-set.ftl
+1
-1
use-registration-form-unit.ftl
...c/main/resources/templates/use-registration-form-unit.ftl
+1
-1
JyjcInspectionApplicationServiceImpl.java
...iz/service/impl/JyjcInspectionApplicationServiceImpl.java
+6
-4
CylinderBusinessStatisticsDto.java
...ule/statistics/api/dto/CylinderBusinessStatisticsDto.java
+31
-0
CylinderBusinessStatistics.java
...ule/statistics/api/entity/CylinderBusinessStatistics.java
+51
-0
CylinderBusinessStatisticsMapper.java
...atistics/api/mapper/CylinderBusinessStatisticsMapper.java
+22
-0
CylinderBusinessStatisticsMapper.xml
...ain/resources/mapper/CylinderBusinessStatisticsMapper.xml
+32
-0
MonthCylinderBusinessStatisticsJob.java
...statistcs/biz/job/MonthCylinderBusinessStatisticsJob.java
+50
-0
CylinderDPStatisticsServiceImpl.java
...tcs/biz/service/impl/CylinderDPStatisticsServiceImpl.java
+29
-6
JGDPStatisticsServiceImpl.java
...statistcs/biz/service/impl/JGDPStatisticsServiceImpl.java
+7
-2
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/enums/RegistrationTypeEnum.java
0 → 100644
View file @
74ae1035
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
enums
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
@Getter
@AllArgsConstructor
public
enum
RegistrationTypeEnum
{
新设备首次启用
(
"新设备首次启用"
,
"DJ_SY"
),
历史无证设备登记
(
"历史无证设备登记"
,
"SP_TT"
);
private
String
name
;
private
String
code
;
public
static
String
getNameByType
(
String
code
)
{
String
name
=
null
;
for
(
RegistrationTypeEnum
enumOne
:
RegistrationTypeEnum
.
values
())
{
if
(
enumOne
.
getCode
().
equals
(
code
))
{
name
=
enumOne
.
getName
();
break
;
}
}
return
name
;
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/enums/SafetyProblemTypeEnum.java
View file @
74ae1035
...
@@ -4,6 +4,7 @@ import lombok.Getter;
...
@@ -4,6 +4,7 @@ import lombok.Getter;
/**
/**
* 业务类型枚举
* 业务类型枚举
* 枚举code需同字典表中问题类型(type=ISSUE_TYPE)code保持一致
*
*
* @author Administrator
* @author Administrator
*/
*/
...
@@ -18,7 +19,7 @@ public enum SafetyProblemTypeEnum {
...
@@ -18,7 +19,7 @@ public enum SafetyProblemTypeEnum {
WBCQ
(
"1"
,
"维保超期"
,
"设备维保超期"
,
"safetyProblemTracing/wb/cq"
,
"outOfMaintenanceRecords"
),
WBCQ
(
"1"
,
"维保超期"
,
"设备维保超期"
,
"safetyProblemTracing/wb/cq"
,
"outOfMaintenanceRecords"
),
WBBA
(
"11"
,
"维保合同备案"
,
"设备维保合同备案"
,
"safetyProblemTracing/wb/ba"
,
null
),
WBBA
(
"11"
,
"维保合同备案"
,
"设备维保合同备案"
,
"safetyProblemTracing/wb/ba"
,
null
),
XKCQ
(
"3"
,
"许可超期"
,
"企业许可超期"
,
"safetyProblemTracing/xk/cq"
,
null
),
XKCQ
(
"3"
,
"许可超期"
,
"企业许可超期"
,
"safetyProblemTracing/xk/cq"
,
null
),
ZZCQ
(
"
4"
,
"人员
资质超期"
,
"人员资质超期"
,
"safetyProblemTracing/zz/cq"
,
null
);
ZZCQ
(
"
9"
,
"
资质超期"
,
"人员资质超期"
,
"safetyProblemTracing/zz/cq"
,
null
);
private
final
String
code
;
private
final
String
code
;
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/mapper/JgUseRegistrationMapper.java
View file @
74ae1035
...
@@ -92,6 +92,8 @@ public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> {
...
@@ -92,6 +92,8 @@ public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> {
List
<
Map
<
String
,
Object
>>
getUseRegisterCount
(
@Param
(
"orgCode"
)
String
orgCode
);
List
<
Map
<
String
,
Object
>>
getUseRegisterCount
(
@Param
(
"orgCode"
)
String
orgCode
);
List
<
Map
<
String
,
Object
>>
getUseRegisterCountTotal
();
List
<
Map
<
String
,
Object
>>
getElevatorModeList
(
@Param
(
"equIds"
)
List
<
String
>
equIds
);
List
<
Map
<
String
,
Object
>>
getElevatorModeList
(
@Param
(
"equIds"
)
List
<
String
>
equIds
);
List
<
Map
<
String
,
Object
>>
getCylinderInfoList
(
@Param
(
"records"
)
List
<
String
>
records
);
List
<
Map
<
String
,
Object
>>
getCylinderInfoList
(
@Param
(
"records"
)
List
<
String
>
records
);
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/CommonMapper.xml
View file @
74ae1035
...
@@ -2561,7 +2561,7 @@
...
@@ -2561,7 +2561,7 @@
ei.unit_type unitType,
ei.unit_type unitType,
ei.supervise_org_code superviseOrgCode,
ei.supervise_org_code superviseOrgCode,
ei.supervise_org_name superviseOrgName,
ei.supervise_org_name superviseOrgName,
ul.sequence_nbr
licenceSeq
,
ul.sequence_nbr
problemSourceId
,
ul.cert_no certNo,
ul.cert_no certNo,
ul.expiry_date expiryDate,
ul.expiry_date expiryDate,
ul.item_code itemCode,
ul.item_code itemCode,
...
@@ -2625,7 +2625,7 @@
...
@@ -2625,7 +2625,7 @@
ei.unit_type unitType,
ei.unit_type unitType,
ei.supervise_org_code superviseOrgCode,
ei.supervise_org_code superviseOrgCode,
ei.supervise_org_name superviseOrgName,
ei.supervise_org_name superviseOrgName,
tup.sequence_nbr p
ermissionSeq
,
tup.sequence_nbr p
roblemSourceId
,
tup.cert_no certNo,
tup.cert_no certNo,
tup.expiry_date expiryDate,
tup.expiry_date expiryDate,
tui.name userName,
tui.name userName,
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgUseRegistrationMapper.xml
View file @
74ae1035
...
@@ -1290,4 +1290,20 @@
...
@@ -1290,4 +1290,20 @@
)
)
</update>
</update>
<select
id=
"getUseRegisterCountTotal"
resultType=
"java.util.Map"
>
SELECT
date_format(A.audit_pass_date, '%Y-%m') AS time,
A.supervision_org_code AS supervisionOrgCode
FROM
"tzs_jg_use_registration_eq" ae
JOIN tzs_jg_use_registration A ON A.sequence_nbr = ae.equip_transfer_id
JOIN "idx_biz_jg_use_info" u ON ae.equ_id = u."RECORD"
JOIN idx_biz_jg_register_info ri ON u."RECORD" = ri."RECORD"
WHERE
ae.equ_id = u."RECORD"
AND ri.EQU_CATEGORY = '2300'
AND A.status = '已完成'
AND A.is_delete = 0
AND A.supervision_org_code is not null
</select>
</mapper>
</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/SafetyProblemTracingController.java
View file @
74ae1035
...
@@ -258,7 +258,7 @@ public class SafetyProblemTracingController extends BaseController {
...
@@ -258,7 +258,7 @@ public class SafetyProblemTracingController extends BaseController {
* @return
* @return
*/
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"生成
维保超期数据"
,
notes
=
"生成维保
超期数据"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"生成
人员资质超期数据"
,
notes
=
"生成人员资质
超期数据"
)
@GetMapping
(
value
=
"/gen/test4"
)
@GetMapping
(
value
=
"/gen/test4"
)
public
ResponseModel
<
String
>
test4
()
{
public
ResponseModel
<
String
>
test4
()
{
safetyProblemTracingGenService
.
executePersonnalCertificationCheck
();
safetyProblemTracingGenService
.
executePersonnalCertificationCheck
();
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/handler/XKCQEventHandler.java
View file @
74ae1035
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jg.biz.handler;
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jg.biz.handler;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.jg.api.enums.SafetyProblemSourceTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.api.enums.SafetyProblemTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.api.enums.SafetyProblemTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.api.event.SafetyProblemEvent
;
import
com.yeejoin.amos.boot.module.jg.api.event.SafetyProblemEvent
;
import
com.yeejoin.amos.boot.module.jg.api.event.handler.SafetyProblemEventHandler
;
import
com.yeejoin.amos.boot.module.jg.api.event.handler.SafetyProblemEventHandler
;
...
@@ -38,6 +39,12 @@ public class XKCQEventHandler implements SafetyProblemEventHandler {
...
@@ -38,6 +39,12 @@ public class XKCQEventHandler implements SafetyProblemEventHandler {
}
}
private
void
generateProblem
(
JSONArray
jsonArray
)
{
private
void
generateProblem
(
JSONArray
jsonArray
)
{
jsonArray
.
forEach
(
item
->
{
JSONObject
problemObj
=
(
JSONObject
)
item
;
problemObj
.
put
(
"sourceType"
,
SafetyProblemSourceTypeEnum
.
UNIT
.
getName
());
problemObj
.
put
(
"sourceTypeCode"
,
SafetyProblemSourceTypeEnum
.
UNIT
.
getCode
());
problemObj
.
put
(
"problemDesc"
,
"证书编号:"
+
problemObj
.
get
(
"certNo"
)
+
SafetyProblemTypeEnum
.
XKCQ
.
getName
());
});
SafetyProblemTopicMessage
.
generateUnitProblem
(
jsonArray
,
SafetyProblemTypeEnum
.
XKCQ
,
safetyProblemTracingService
);
SafetyProblemTopicMessage
.
generateUnitProblem
(
jsonArray
,
SafetyProblemTypeEnum
.
XKCQ
,
safetyProblemTracingService
);
}
}
}
}
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/handler/ZZCQEventHandler.java
View file @
74ae1035
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jg.biz.handler;
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jg.biz.handler;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.jg.api.enums.SafetyProblemSourceTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.api.enums.SafetyProblemTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.api.enums.SafetyProblemTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.api.event.SafetyProblemEvent
;
import
com.yeejoin.amos.boot.module.jg.api.event.SafetyProblemEvent
;
import
com.yeejoin.amos.boot.module.jg.api.event.handler.SafetyProblemEventHandler
;
import
com.yeejoin.amos.boot.module.jg.api.event.handler.SafetyProblemEventHandler
;
...
@@ -38,6 +39,12 @@ public class ZZCQEventHandler implements SafetyProblemEventHandler {
...
@@ -38,6 +39,12 @@ public class ZZCQEventHandler implements SafetyProblemEventHandler {
}
}
private
void
generateProblem
(
JSONArray
jsonArray
)
{
private
void
generateProblem
(
JSONArray
jsonArray
)
{
jsonArray
.
forEach
(
item
->
{
JSONObject
problemObj
=
(
JSONObject
)
item
;
problemObj
.
put
(
"sourceType"
,
SafetyProblemSourceTypeEnum
.
PERSONNEL
.
getName
());
problemObj
.
put
(
"sourceTypeCode"
,
SafetyProblemSourceTypeEnum
.
PERSONNEL
.
getCode
());
problemObj
.
put
(
"problemDesc"
,
"证书编号:"
+
problemObj
.
getOrDefault
(
"certNo"
,
""
)
+
SafetyProblemTypeEnum
.
ZZCQ
.
getName
());
});
SafetyProblemTopicMessage
.
generatePersonnelProblem
(
jsonArray
,
SafetyProblemTypeEnum
.
ZZCQ
,
safetyProblemTracingService
);
SafetyProblemTopicMessage
.
generatePersonnelProblem
(
jsonArray
,
SafetyProblemTypeEnum
.
ZZCQ
,
safetyProblemTracingService
);
}
}
}
}
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/listener/SafetyProblemTopicMessage.java
View file @
74ae1035
...
@@ -151,6 +151,10 @@ public class SafetyProblemTopicMessage extends EmqxListener {
...
@@ -151,6 +151,10 @@ public class SafetyProblemTopicMessage extends EmqxListener {
}
}
public
static
void
generateUnitProblem
(
JSONArray
jsonArray
,
SafetyProblemTypeEnum
problemTypeEnum
,
SafetyProblemTracingServiceImpl
safetyProblemTracingService
)
{
public
static
void
generateUnitProblem
(
JSONArray
jsonArray
,
SafetyProblemTypeEnum
problemTypeEnum
,
SafetyProblemTracingServiceImpl
safetyProblemTracingService
)
{
generateProblem2
(
jsonArray
,
problemTypeEnum
,
safetyProblemTracingService
);
}
private
static
void
generateProblem2
(
JSONArray
jsonArray
,
SafetyProblemTypeEnum
problemTypeEnum
,
SafetyProblemTracingServiceImpl
safetyProblemTracingService
)
{
if
(
jsonArray
==
null
||
problemTypeEnum
==
null
)
{
if
(
jsonArray
==
null
||
problemTypeEnum
==
null
)
{
throw
new
IllegalArgumentException
(
"jsonObject and problemTypeEnum must not be null."
);
throw
new
IllegalArgumentException
(
"jsonObject and problemTypeEnum must not be null."
);
}
}
...
@@ -163,10 +167,10 @@ public class SafetyProblemTopicMessage extends EmqxListener {
...
@@ -163,10 +167,10 @@ public class SafetyProblemTopicMessage extends EmqxListener {
SafetyProblemTracing
safetyProblemTracing
=
new
SafetyProblemTracing
();
SafetyProblemTracing
safetyProblemTracing
=
new
SafetyProblemTracing
();
safetyProblemTracing
.
setProblemType
(
problemTypeEnum
.
getName
());
safetyProblemTracing
.
setProblemType
(
problemTypeEnum
.
getName
());
safetyProblemTracing
.
setProblemTypeCode
(
problemTypeEnum
.
getCode
());
safetyProblemTracing
.
setProblemTypeCode
(
problemTypeEnum
.
getCode
());
safetyProblemTracing
.
setProblemDesc
(
problemTypeEnum
.
getDesc
()
+
"-"
+
json
.
getOrDefault
(
"itemName"
,
""
)
+
"-"
+
json
.
getOrDefault
(
"subItemName"
,
"
"
));
safetyProblemTracing
.
setProblemDesc
(
json
.
getString
(
"problemDesc
"
));
safetyProblemTracing
.
setSourceType
(
SafetyProblemSourceTypeEnum
.
UNIT
.
getName
(
));
safetyProblemTracing
.
setSourceType
(
json
.
getString
(
"sourceType"
));
safetyProblemTracing
.
setSourceTypeCode
(
SafetyProblemSourceTypeEnum
.
UNIT
.
getCode
(
));
safetyProblemTracing
.
setSourceTypeCode
(
json
.
getString
(
"sourceTypeCode"
));
safetyProblemTracing
.
setSourceId
(
json
.
get
OrDefault
(
"licenceSeq"
,
""
).
toString
(
));
safetyProblemTracing
.
setSourceId
(
json
.
get
String
(
"problemSourceId"
));
safetyProblemTracing
.
setProblemTime
(
new
Date
());
safetyProblemTracing
.
setProblemTime
(
new
Date
());
safetyProblemTracing
.
setPrincipalUnit
(
json
.
getOrDefault
(
"useUnit"
,
""
).
toString
());
safetyProblemTracing
.
setPrincipalUnit
(
json
.
getOrDefault
(
"useUnit"
,
""
).
toString
());
safetyProblemTracing
.
setPrincipalUnitCode
(
json
.
getOrDefault
(
"useUnitCode"
,
""
).
toString
());
safetyProblemTracing
.
setPrincipalUnitCode
(
json
.
getOrDefault
(
"useUnitCode"
,
""
).
toString
());
...
@@ -187,39 +191,7 @@ public class SafetyProblemTopicMessage extends EmqxListener {
...
@@ -187,39 +191,7 @@ public class SafetyProblemTopicMessage extends EmqxListener {
}
}
public
static
void
generatePersonnelProblem
(
JSONArray
jsonArray
,
SafetyProblemTypeEnum
problemTypeEnum
,
SafetyProblemTracingServiceImpl
safetyProblemTracingService
)
{
public
static
void
generatePersonnelProblem
(
JSONArray
jsonArray
,
SafetyProblemTypeEnum
problemTypeEnum
,
SafetyProblemTracingServiceImpl
safetyProblemTracingService
)
{
if
(
jsonArray
==
null
||
problemTypeEnum
==
null
)
{
generateProblem2
(
jsonArray
,
problemTypeEnum
,
safetyProblemTracingService
);
throw
new
IllegalArgumentException
(
"jsonObject and problemTypeEnum must not be null."
);
}
if
(!
ValidationUtil
.
isEmpty
(
jsonArray
))
{
List
<
SafetyProblemTracing
>
safetyProblemTracingList
=
jsonArray
.
stream
().
map
(
item
->
{
if
(!(
item
instanceof
JSONObject
))
{
throw
new
IllegalArgumentException
(
"item is not a JSONObject."
);
}
JSONObject
json
=
(
JSONObject
)
item
;
SafetyProblemTracing
safetyProblemTracing
=
new
SafetyProblemTracing
();
safetyProblemTracing
.
setProblemType
(
problemTypeEnum
.
getName
());
safetyProblemTracing
.
setProblemTypeCode
(
problemTypeEnum
.
getCode
());
safetyProblemTracing
.
setProblemDesc
(
problemTypeEnum
.
getDesc
()
+
"-"
+
json
.
getOrDefault
(
"userName"
,
""
)
+
"-"
+
json
.
getOrDefault
(
"certNo"
,
""
));
safetyProblemTracing
.
setSourceType
(
SafetyProblemSourceTypeEnum
.
PERSONNEL
.
getName
());
safetyProblemTracing
.
setSourceTypeCode
(
SafetyProblemSourceTypeEnum
.
PERSONNEL
.
getCode
());
safetyProblemTracing
.
setSourceId
(
json
.
getOrDefault
(
"permissionSeq"
,
""
).
toString
());
safetyProblemTracing
.
setProblemTime
(
new
Date
());
safetyProblemTracing
.
setPrincipalUnit
(
json
.
getOrDefault
(
"useUnit"
,
""
).
toString
());
safetyProblemTracing
.
setPrincipalUnitCode
(
json
.
getOrDefault
(
"useUnitCode"
,
""
).
toString
());
safetyProblemTracing
.
setPrincipalUnitType
(
json
.
getOrDefault
(
"unitType"
,
""
).
toString
());
safetyProblemTracing
.
setGoverningBody
(
json
.
getOrDefault
(
"superviseOrgName"
,
""
).
toString
());
safetyProblemTracing
.
setGoverningBodyCode
(
json
.
getOrDefault
(
"useUnitCode"
,
""
).
toString
());
safetyProblemTracing
.
setGoverningBodyOrgCode
(
json
.
getOrDefault
(
"superviseOrgCode"
,
""
).
toString
());
safetyProblemTracing
.
setCreateDate
(
new
Date
());
safetyProblemTracing
.
setProblemStatus
(
SafetyProblemStatusEnum
.
UNHANDLED
.
getName
());
safetyProblemTracing
.
setProblemStatusCode
(
SafetyProblemStatusEnum
.
UNHANDLED
.
getCode
());
return
safetyProblemTracing
;
}).
collect
(
Collectors
.
toList
());
safetyProblemTracingService
.
saveOrUpdateBatchByColumns
(
safetyProblemTracingList
,
safetyProblemTracing
->
new
QueryWrapper
<>()
.
eq
(
"problem_type_code"
,
safetyProblemTracing
.
getProblemTypeCode
())
.
eq
(
"source_id"
,
safetyProblemTracing
.
getSourceId
())
.
eq
(
"problem_status_code"
,
SafetyProblemStatusEnum
.
UNHANDLED
.
getCode
()));}
}
}
public
String
buildTopic
(
String
topic
)
{
public
String
buildTopic
(
String
topic
)
{
...
...
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/CommonServiceImpl.java
View file @
74ae1035
...
@@ -2234,6 +2234,10 @@ public class CommonServiceImpl implements ICommonService {
...
@@ -2234,6 +2234,10 @@ public class CommonServiceImpl implements ICommonService {
DateTimeFormatter
outputFormatter
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
);
DateTimeFormatter
outputFormatter
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
);
Pattern
timePattern
=
Pattern
.
compile
(
"\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}"
);
Pattern
timePattern
=
Pattern
.
compile
(
"\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}"
);
//登记类型
if
(
jsonObject
.
containsKey
(
"type"
)){
formData
.
put
(
"registrationType"
,
RegistrationTypeEnum
.
getNameByType
(
jsonObject
.
getString
(
"type"
)));
}
for
(
String
key
:
formData
.
keySet
())
{
for
(
String
key
:
formData
.
keySet
())
{
if
(
key
.
contains
(
"Date"
)
&&
timePattern
.
matcher
(
formData
.
getString
(
key
)).
matches
()){
if
(
key
.
contains
(
"Date"
)
&&
timePattern
.
matcher
(
formData
.
getString
(
key
)).
matches
()){
// 解析原始日期时间字符串
// 解析原始日期时间字符串
...
@@ -2280,7 +2284,7 @@ public class CommonServiceImpl implements ICommonService {
...
@@ -2280,7 +2284,7 @@ public class CommonServiceImpl implements ICommonService {
formData
.
put
(
"productName"
,
formData
.
getString
(
"projectContraption"
));
formData
.
put
(
"productName"
,
formData
.
getString
(
"projectContraption"
));
}
}
//单位模版 部分字段需从设备列表中获取
//单位模版 部分字段需从设备列表中获取
if
(
formData
.
containsKey
(
"equipmentLists"
)
&&
manageType
.
equals
(
UNIT
)
){
if
(
formData
.
containsKey
(
"equipmentLists"
)
){
JSONArray
equipmentLists
=
formData
.
getJSONArray
(
"equipmentLists"
);
JSONArray
equipmentLists
=
formData
.
getJSONArray
(
"equipmentLists"
);
List
<
Map
<
String
,
Object
>>
equips
=
equipmentLists
.
stream
()
List
<
Map
<
String
,
Object
>>
equips
=
equipmentLists
.
stream
()
.
filter
(
obj
->
obj
instanceof
Map
)
.
filter
(
obj
->
obj
instanceof
Map
)
...
@@ -2290,7 +2294,27 @@ public class CommonServiceImpl implements ICommonService {
...
@@ -2290,7 +2294,27 @@ public class CommonServiceImpl implements ICommonService {
formData
.
put
(
"equNum"
,
equipmentLists
.
size
());
formData
.
put
(
"equNum"
,
equipmentLists
.
size
());
//设备品种
//设备品种
formData
.
put
(
"equDefine"
,
equips
.
get
(
0
).
get
(
"equDefineName"
));
formData
.
put
(
"equDefine"
,
equips
.
get
(
0
).
get
(
"equDefineName"
));
}
else
if
(
manageType
.
equals
(
UNIT
)
&&
!
CollectionUtils
.
isEmpty
(
equips
)){
Set
<
String
>
productNameSet
=
equips
.
stream
()
.
filter
(
Objects:
:
nonNull
)
// 过滤掉equip为null的情况
.
map
(
e
->
e
.
get
(
"productName"
))
// 获取productName
.
filter
(
Objects:
:
nonNull
)
// 过滤掉productName为null的情况
.
map
(
Object:
:
toString
)
// 转换为String类型
.
collect
(
Collectors
.
toSet
());
// 收集到Set中
// 将set转成字符串逗号拼接
String
productName
=
""
;
List
<
String
>
sortedProductNameList
=
new
ArrayList
<>(
productNameSet
);
if
(
sortedProductNameList
.
size
()
>
3
)
{
productName
=
String
.
join
(
","
,
sortedProductNameList
.
subList
(
0
,
3
))
+
",..."
;
}
else
{
productName
=
String
.
join
(
","
,
sortedProductNameList
);
}
formData
.
put
(
"productName"
,
productName
);
}
else
if
(
manageType
.
equals
(
VEHICLE
)
&&
!
CollectionUtils
.
isEmpty
(
equips
)){
//气瓶数量
//气瓶数量
formData
.
put
(
"gasNum"
,
equips
.
size
());
formData
.
put
(
"gasNum"
,
equips
.
size
());
//设备品种
//设备品种
...
...
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/JgChangeRegistrationNameServiceImpl.java
View file @
74ae1035
...
@@ -316,11 +316,15 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
...
@@ -316,11 +316,15 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
*/
*/
private
void
delRepeatUseEquipData
(
JgChangeRegistrationName
notice
)
{
private
void
delRepeatUseEquipData
(
JgChangeRegistrationName
notice
)
{
if
(
NOT_FLOWING_STATE
.
contains
(
notice
.
getAuditStatus
()))
{
if
(
NOT_FLOWING_STATE
.
contains
(
notice
.
getAuditStatus
()))
{
LambdaQueryWrapper
<
JgChangeRegistrationNameEq
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
final
String
creditCode
=
notice
.
getUseUnitCreditCode
().
contains
(
"_"
)
queryWrapper
.
eq
(
JgChangeRegistrationNameEq:
:
getNameChangeRegistrationId
,
notice
.
getSequenceNbr
());
?
notice
.
getUseUnitCreditCode
().
substring
(
notice
.
getUseUnitCreditCode
().
indexOf
(
"_"
)
+
1
)
List
<
JgChangeRegistrationNameEq
>
noticeEqList
=
jgChangeRegistrationNameEqMapper
.
selectList
(
queryWrapper
);
:
notice
.
getUseUnitCreditCode
();
noticeEqList
.
forEach
(
noticeEq
->
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
CHANGE_NAME_KEY
)
jgChangeRegistrationNameEqMapper
.
selectList
(
.
delDataForCheckEquipRepeatUsed
(
Collections
.
singletonList
(
noticeEq
.
getCertificateSeq
()),
notice
.
getUseUnitCreditCode
())
new
LambdaQueryWrapper
<
JgChangeRegistrationNameEq
>()
.
eq
(
JgChangeRegistrationNameEq:
:
getNameChangeRegistrationId
,
notice
.
getSequenceNbr
())
).
forEach
(
noticeEq
->
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
CHANGE_NAME_KEY
)
.
delDataForCheckEquipRepeatUsed
(
Collections
.
singletonList
(
noticeEq
.
getCertificateSeq
()),
creditCode
)
);
);
}
}
}
}
...
...
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/JgUseRegistrationServiceImpl.java
View file @
74ae1035
...
@@ -2520,10 +2520,12 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -2520,10 +2520,12 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
if
(
CollectionUtils
.
isNotEmpty
(
equipmentLists
))
{
if
(
CollectionUtils
.
isNotEmpty
(
equipmentLists
))
{
equipmentLists
.
stream
()
equipmentLists
.
stream
()
.
map
(
obj
->
(
JSONObject
)
obj
)
.
map
(
obj
->
(
JSONObject
)
obj
)
.
peek
(
equipmentItem
->
equipmentItem
.
put
(
"useDate"
,
timeToMonths
(
useDateValue
)))
.
filter
(
equipmentItem
->
this
.
checkEquStatusInUse
(
equipmentItem
.
getString
(
"record"
)))
.
filter
(
equipmentItem
->
this
.
checkEquStatusInUse
(
equipmentItem
.
getString
(
"record"
)))
.
filter
(
equipmentItem
->
addedEquCodes
.
add
(
equipmentItem
.
getString
(
"equCode"
)))
.
forEach
(
item
->{
.
forEach
(
allEquipment:
:
add
);
item
.
put
(
"useDate"
,
timeToMonths
(
useDateValue
));
allEquipment
.
add
(
item
);
addedEquCodes
.
add
(
item
.
getString
(
"equCode"
));
});
}
}
});
});
total
=
allEquipment
.
size
();
total
=
allEquipment
.
size
();
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/resources/templates/use-registration-form-set.ftl
View file @
74ae1035
...
@@ -2191,7 +2191,7 @@
...
@@ -2191,7 +2191,7 @@
<w:spacing
w:val=
"-1"
/>
<w:spacing
w:val=
"-1"
/>
<w:lang
w:val=
"en-US"
w:eastAsia=
"zh-CN"
/>
<w:lang
w:val=
"en-US"
w:eastAsia=
"zh-CN"
/>
</w:rPr>
</w:rPr>
<w:t>
${(
resul
tNo)!''}
</w:t>
<w:t>
${(
inspectRepor
tNo)!''}
</w:t>
</w:r>
</w:r>
</w:p>
</w:p>
</w:tc>
</w:tc>
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/resources/templates/use-registration-form-unit.ftl
View file @
74ae1035
...
@@ -543,7 +543,7 @@
...
@@ -543,7 +543,7 @@
<w:sz
w:val=
"21"
/>
<w:sz
w:val=
"21"
/>
<w:sz-cs
w:val=
"21"
/>
<w:sz-cs
w:val=
"21"
/>
</w:rPr>
</w:rPr>
<w:t>
${(registrationType)!''}
</w:t>
<w:t>
${(registrationType)!'
新设备首次启用
'}
</w:t>
</w:r>
</w:r>
</w:p>
</w:p>
<w:p>
<w:p>
...
...
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/JyjcInspectionApplicationServiceImpl.java
View file @
74ae1035
...
@@ -1344,7 +1344,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
...
@@ -1344,7 +1344,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
String
test
=
QueryParser
.
escape
(
map
.
getString
(
"USE_INNER_CODE"
));
String
test
=
QueryParser
.
escape
(
map
.
getString
(
"USE_INNER_CODE"
));
boolMust
.
must
(
QueryBuilders
.
matchPhraseQuery
(
"USE_INNER_CODE"
,
test
));
boolMust
.
must
(
QueryBuilders
.
matchPhraseQuery
(
"USE_INNER_CODE"
,
test
));
}
}
this
.
setFilterOfInFlowing
(
boolMust
,
map
.
getString
(
"EQU_LIST_CODE"
),
map
.
getString
(
"inspectionType"
));
this
.
setFilterOfInFlowing
(
boolMust
,
map
.
getString
(
"EQU_LIST_CODE"
),
map
.
getString
(
"inspectionType"
)
,
map
.
getString
(
"EQU_CATEGORY_CODE"
)
);
builder
.
query
(
boolMust
);
builder
.
query
(
boolMust
);
builder
.
sort
(
"REC_DATE"
,
SortOrder
.
DESC
);
builder
.
sort
(
"REC_DATE"
,
SortOrder
.
DESC
);
builder
.
from
((
pageNumber
-
1
)
*
size
);
builder
.
from
((
pageNumber
-
1
)
*
size
);
...
@@ -1382,14 +1382,16 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
...
@@ -1382,14 +1382,16 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
/**
/**
* 过滤条件去掉流程中的设备,
* 过滤条件去掉流程中的设备,
*
*
* @param boolMust 条件
* @param boolMust 条件
* @param equCategoryCode
*/
*/
private
void
setFilterOfInFlowing
(
BoolQueryBuilder
boolMust
,
String
equListCode
,
String
inspectionType
)
{
private
void
setFilterOfInFlowing
(
BoolQueryBuilder
boolMust
,
String
equListCode
,
String
inspectionType
,
String
equCategoryCode
)
{
Set
<
String
>
records
=
this
.
getEquipInFlowing
();
Set
<
String
>
records
=
this
.
getEquipInFlowing
();
if
(
records
!=
null
&&
!
records
.
isEmpty
())
{
if
(
records
!=
null
&&
!
records
.
isEmpty
())
{
boolMust
.
mustNot
(
QueryBuilders
.
termsQuery
(
"SEQUENCE_NBR.keyword"
,
records
));
boolMust
.
mustNot
(
QueryBuilders
.
termsQuery
(
"SEQUENCE_NBR.keyword"
,
records
));
}
}
if
(
"5000"
.
equals
(
equListCode
)
&&
JYJCBusinessTypeEnum
.
SCJY
.
getCode
().
equals
(
inspectionType
))
{
// 流动时起重机械及厂车可直接做首检
if
((
"5000"
.
equals
(
equListCode
)
||
"4400"
.
equals
(
equCategoryCode
))
&&
JYJCBusinessTypeEnum
.
SCJY
.
getCode
().
equals
(
inspectionType
))
{
boolMust
.
must
(
QueryBuilders
.
termQuery
(
"IS_INTO_MANAGEMENT"
,
false
));
boolMust
.
must
(
QueryBuilders
.
termQuery
(
"IS_INTO_MANAGEMENT"
,
false
));
}
else
{
}
else
{
BoolQueryBuilder
shouldBuilder
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
shouldBuilder
=
QueryBuilders
.
boolQuery
();
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/java/com/yeejoin/amos/boot/module/statistics/api/dto/CylinderBusinessStatisticsDto.java
0 → 100644
View file @
74ae1035
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistics
.
api
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
/**
*
*
* @author system_generator
* @date 2025-02-21
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"CylinderBusinessStatisticsDto"
,
description
=
""
)
public
class
CylinderBusinessStatisticsDto
extends
BaseDto
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"年月"
)
private
String
time
;
@ApiModelProperty
(
value
=
"总数"
)
private
Long
num
;
@ApiModelProperty
(
value
=
"机构代码"
)
private
String
supervisionOrgCode
;
}
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/java/com/yeejoin/amos/boot/module/statistics/api/entity/CylinderBusinessStatistics.java
0 → 100644
View file @
74ae1035
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistics
.
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.Data
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
/**
*
*
* @author system_generator
* @date 2025-02-21
*/
@Data
@Accessors
(
chain
=
true
)
@TableName
(
"tzs_cylinder_business_statistics"
)
public
class
CylinderBusinessStatistics
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@TableId
(
value
=
"SEQUENCE_NBR"
,
type
=
IdType
.
ID_WORKER
)
protected
Long
sequenceNbr
;
/**
* 年月
*/
@TableField
(
"time"
)
private
String
time
;
/**
* 总数
*/
@TableField
(
"num"
)
private
Long
num
;
/**
* 机构代码
*/
@TableField
(
"supervision_org_code"
)
private
String
supervisionOrgCode
;
public
CylinderBusinessStatistics
(
String
time
,
String
supervisionOrgCode
)
{
this
.
time
=
time
;
this
.
supervisionOrgCode
=
supervisionOrgCode
;
}
}
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/java/com/yeejoin/amos/boot/module/statistics/api/mapper/CylinderBusinessStatisticsMapper.java
0 → 100644
View file @
74ae1035
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistics
.
api
.
mapper
;
import
com.yeejoin.amos.boot.module.statistics.api.entity.CylinderBusinessStatistics
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
* Mapper 接口
*
* @author system_generator
* @date 2025-02-21
*/
public
interface
CylinderBusinessStatisticsMapper
extends
BaseMapper
<
CylinderBusinessStatistics
>
{
void
deleteAll
();
void
insertBatch
(
@Param
(
"list"
)
List
<
CylinderBusinessStatistics
>
cylinderBusinessStatisticsList
);
List
<
Map
<
String
,
Object
>>
getUseRegisterCount
(
@Param
(
"orgCode"
)
String
orgCode
);
}
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/resources/mapper/CylinderBusinessStatisticsMapper.xml
0 → 100644
View file @
74ae1035
<?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.statistics.api.mapper.CylinderBusinessStatisticsMapper"
>
<insert
id=
"insertBatch"
parameterType=
"com.yeejoin.amos.boot.module.statistics.api.entity.CylinderBusinessStatistics"
>
insert into tzs_cylinder_business_statistics
(sequence_nbr, time, supervision_org_code, update_time) values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(
#{item.sequenceNbr},
#{item.time},
#{item.supervisionOrgCode},
CURRENT_TIMESTAMP
)
</foreach>
</insert>
<delete
id=
"deleteAll"
>
delete from tzs_cylinder_business_statistics
</delete>
<select
id=
"getUseRegisterCount"
resultType=
"java.util.Map"
>
SELECT
C.time, -- 月份
COUNT(1) AS num -- 每月的记录数
FROM
tzs_cylinder_business_statistics C
WHERE
C.supervision_org_code LIKE '50%' -- 仅过滤 '50%' 开头的监管机构代码
GROUP BY
C.time -- 按月份分组
</select>
</mapper>
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/job/MonthCylinderBusinessStatisticsJob.java
0 → 100644
View file @
74ae1035
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistcs
.
biz
.
job
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationMapper
;
import
com.yeejoin.amos.boot.module.statistics.api.entity.CylinderBusinessStatistics
;
import
com.yeejoin.amos.boot.module.statistics.api.mapper.CylinderBusinessStatisticsMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
net.javacrumbs.shedlock.spring.annotation.SchedulerLock
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* 定时任务统计
*
* @author LiuLin
*/
@EnableScheduling
@Component
@Slf4j
public
class
MonthCylinderBusinessStatisticsJob
{
private
final
JgUseRegistrationMapper
useRegistrationMapper
;
private
final
CylinderBusinessStatisticsMapper
businessStatisticsMapper
;
public
MonthCylinderBusinessStatisticsJob
(
JgUseRegistrationMapper
useRegistrationMapper
,
CylinderBusinessStatisticsMapper
businessStatisticsMapper
)
{
this
.
useRegistrationMapper
=
useRegistrationMapper
;
this
.
businessStatisticsMapper
=
businessStatisticsMapper
;
}
@Scheduled
(
cron
=
"0 */5 * * * ?"
)
@SchedulerLock
(
name
=
"cylinderBusinessStatisticsJob"
,
lockAtMostFor
=
"PT1H"
)
public
void
cylinderBusinessStatisticsJob
()
{
List
<
Map
<
String
,
Object
>>
useRegisterCountList
=
useRegistrationMapper
.
getUseRegisterCountTotal
();
if
(!
CollectionUtils
.
isEmpty
(
useRegisterCountList
))
{
businessStatisticsMapper
.
deleteAll
();
List
<
CylinderBusinessStatistics
>
statisticsList
=
useRegisterCountList
.
stream
()
.
map
(
item
->
new
CylinderBusinessStatistics
(
(
String
)
item
.
get
(
"time"
),
(
String
)
item
.
get
(
"supervisionOrgCode"
)
))
.
collect
(
Collectors
.
toList
());
businessStatisticsMapper
.
insertBatch
(
statisticsList
);
}
}
}
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/CylinderDPStatisticsServiceImpl.java
View file @
74ae1035
...
@@ -306,11 +306,11 @@ public class CylinderDPStatisticsServiceImpl {
...
@@ -306,11 +306,11 @@ public class CylinderDPStatisticsServiceImpl {
public
Map
<
String
,
Object
>
getCylinderStatisticsDataByCityForTotal
(
DPFilterParamDto
dpFilterParamDto
)
{
public
Map
<
String
,
Object
>
getCylinderStatisticsDataByCityForTotal
(
DPFilterParamDto
dpFilterParamDto
)
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
dpFilterParamDto
.
getCityCode
());
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
dpFilterParamDto
.
getCityCode
());
getCylinderMapCount
(
orgCode
,
result
);
getCylinderMapCount
(
orgCode
,
result
,
dpFilterParamDto
.
getCityCode
()
);
return
result
;
return
result
;
}
}
private
Map
<
String
,
Object
>
getCylinderMapCount
(
String
orgCode
,
Map
<
String
,
Object
>
result
)
{
private
void
getCylinderMapCount
(
String
orgCode
,
Map
<
String
,
Object
>
result
,
String
cityCode
)
{
if
(
StringUtils
.
isNotEmpty
(
orgCode
))
{
if
(
StringUtils
.
isNotEmpty
(
orgCode
))
{
Long
cylindersCount
=
this
.
countForCylinderNum
(
orgCode
);
Long
cylindersCount
=
this
.
countForCylinderNum
(
orgCode
);
Long
automotiveGasCount
=
this
.
countForCylinderNumForVehicleUsed
(
orgCode
);
Long
automotiveGasCount
=
this
.
countForCylinderNumForVehicleUsed
(
orgCode
);
...
@@ -330,15 +330,38 @@ public class CylinderDPStatisticsServiceImpl {
...
@@ -330,15 +330,38 @@ public class CylinderDPStatisticsServiceImpl {
// 检验超期气瓶数
// 检验超期气瓶数
result
.
put
(
"jycqsbCount"
,
this
.
countForCylinderOverdueInspect
(
orgCode
));
result
.
put
(
"jycqsbCount"
,
this
.
countForCylinderOverdueInspect
(
orgCode
));
// 充气量
// 充气量
Long
fillingVolumeCount
=
cylinderStatisticsMapper
.
countFillingVolumeCount
(
orgCode
);
// Long fillingVolumeCount = cylinderStatisticsMapper.countFillingVolumeCount(orgCode);
result
.
put
(
"fillingVolumeCount"
,
fillingVolumeCount
==
null
?
0L
:
new
BigDecimal
(
fillingVolumeCount
).
divide
(
new
BigDecimal
(
"10000000"
)).
setScale
(
3
,
RoundingMode
.
HALF_UP
).
toString
());
Double
fillingVolumeCount
=
this
.
countFillingVolumeCount
(
cityCode
);
BigDecimal
value
=
new
BigDecimal
(
fillingVolumeCount
);
value
=
value
.
divide
(
new
BigDecimal
(
"1000"
),
3
,
RoundingMode
.
HALF_UP
);
String
unit
=
(
fillingVolumeCount
==
0
)
?
"吨"
:
(
fillingVolumeCount
>
10000
?
"万吨"
:
"吨"
);
BigDecimal
resultValue
=
(
fillingVolumeCount
>
10000000
)
?
value
.
divide
(
new
BigDecimal
(
"10000000"
),
3
,
RoundingMode
.
HALF_UP
)
:
value
;
result
.
put
(
"fillingVolumeCount"
,
resultValue
);
// 卸液量
// 卸液量
Long
dischargeVolumeCount
=
cylinderStatisticsMapper
.
countDischargeVolumeCount
(
orgCode
);
Long
dischargeVolumeCount
=
cylinderStatisticsMapper
.
countDischargeVolumeCount
(
orgCode
);
result
.
put
(
"dischargeVolumeCount"
,
dischargeVolumeCount
==
null
?
0L
:
new
BigDecimal
(
dischargeVolumeCount
).
divide
(
new
BigDecimal
(
"10000000"
)).
setScale
(
3
,
RoundingMode
.
HALF_UP
).
toString
());
result
.
put
(
"dischargeVolumeCount"
,
dischargeVolumeCount
==
null
?
0L
:
new
BigDecimal
(
dischargeVolumeCount
).
divide
(
new
BigDecimal
(
"10000000"
)).
setScale
(
3
,
RoundingMode
.
HALF_UP
).
toString
());
}
else
{
}
else
{
this
.
setDefaultValueIfNoData
(
result
,
"cylindersCount"
,
"stationCount"
,
"operatorCount"
,
"liquefiedGasCount"
,
"automotiveGasCount"
,
"industrialGasCount"
,
"useRegistrationQuantityCount"
,
"jylqsbCount"
,
"jycqsbCount"
,
"fillingVolumeCount"
,
"dischargeVolumeCount"
);
this
.
setDefaultValueIfNoData
(
result
,
"cylindersCount"
,
"stationCount"
,
"operatorCount"
,
"liquefiedGasCount"
,
"automotiveGasCount"
,
"industrialGasCount"
,
"useRegistrationQuantityCount"
,
"jylqsbCount"
,
"jycqsbCount"
,
"fillingVolumeCount"
,
"dischargeVolumeCount"
);
}
}
return
result
;
}
/**
* 从ES查询总量
* @param cityCode
* @return
*/
private
Double
countFillingVolumeCount
(
String
cityCode
)
{
DPFilterParamForDetailDto
dpFilterParamForDetailDto
=
new
DPFilterParamForDetailDto
();
dpFilterParamForDetailDto
.
setCityCode
(
cityCode
);
List
<
Map
<
String
,
Object
>>
list
=
this
.
getFillingQuantity
(
dpFilterParamForDetailDto
,
null
,
null
);
return
list
.
isEmpty
()
?
0L
:
list
.
stream
()
.
mapToDouble
(
e
->
Optional
.
ofNullable
(
e
.
get
(
"fillingQuantity"
))
.
map
(
f
->
Double
.
parseDouble
(
f
.
toString
()))
.
orElse
(
0.0
))
.
sum
();
}
}
/**
/**
...
@@ -422,7 +445,7 @@ public class CylinderDPStatisticsServiceImpl {
...
@@ -422,7 +445,7 @@ public class CylinderDPStatisticsServiceImpl {
Map
<
String
,
Object
>
item
=
new
HashMap
<>();
Map
<
String
,
Object
>
item
=
new
HashMap
<>();
item
.
put
(
"regionCode"
,
r
.
getRegionCode
());
item
.
put
(
"regionCode"
,
r
.
getRegionCode
());
item
.
put
(
"regionName"
,
r
.
getRegionName
());
item
.
put
(
"regionName"
,
r
.
getRegionName
());
getCylinderMapCount
(
orgCode
,
item
);
getCylinderMapCount
(
orgCode
,
item
,
dpFilterParamDto
.
getCityCode
()
);
return
item
;
return
item
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
}
}
...
...
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/JGDPStatisticsServiceImpl.java
View file @
74ae1035
...
@@ -35,6 +35,7 @@ import com.yeejoin.amos.boot.module.jg.api.entity.SafetyProblemTracing;
...
@@ -35,6 +35,7 @@ import com.yeejoin.amos.boot.module.jg.api.entity.SafetyProblemTracing;
import
com.yeejoin.amos.boot.module.jg.api.enums.*
;
import
com.yeejoin.amos.boot.module.jg.api.enums.*
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.*
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.*
;
import
com.yeejoin.amos.boot.module.statistcs.biz.utils.JsonUtils
;
import
com.yeejoin.amos.boot.module.statistcs.biz.utils.JsonUtils
;
import
com.yeejoin.amos.boot.module.statistics.api.mapper.CylinderBusinessStatisticsMapper
;
import
com.yeejoin.amos.boot.module.statistics.api.mapper.JGStatisticsMapper
;
import
com.yeejoin.amos.boot.module.statistics.api.mapper.JGStatisticsMapper
;
import
com.yeejoin.amos.boot.module.statistics.api.mapper.ZLStatisticsMapper
;
import
com.yeejoin.amos.boot.module.statistics.api.mapper.ZLStatisticsMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentCategoryDto
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentCategoryDto
;
...
@@ -180,6 +181,8 @@ public class JGDPStatisticsServiceImpl {
...
@@ -180,6 +181,8 @@ public class JGDPStatisticsServiceImpl {
private
JgUseRegistrationMapper
useRegistrationMapper
;
private
JgUseRegistrationMapper
useRegistrationMapper
;
private
CylinderBusinessStatisticsMapper
businessStatisticsMapper
;
private
JgEnableDisableMapper
enableDisableMapper
;
private
JgEnableDisableMapper
enableDisableMapper
;
private
JgScrapCancelMapper
scrapCancelMapper
;
private
JgScrapCancelMapper
scrapCancelMapper
;
...
@@ -277,8 +280,10 @@ public class JGDPStatisticsServiceImpl {
...
@@ -277,8 +280,10 @@ public class JGDPStatisticsServiceImpl {
IdxBizJgTechParamsPipelineMapper
idxBizJgTechParamsPipelineMapper
,
IdxBizJgTechParamsPipelineMapper
idxBizJgTechParamsPipelineMapper
,
IdxBizJgTechParamsElevatorMapper
idxBizJgTechParamsElevatorMapper
,
IdxBizJgTechParamsElevatorMapper
idxBizJgTechParamsElevatorMapper
,
DataDictionaryServiceImpl
iDataDictionaryService
,
DataDictionaryServiceImpl
iDataDictionaryService
,
SafetyProblemTracingMapper
safetyProblemTracingMapper
)
{
SafetyProblemTracingMapper
safetyProblemTracingMapper
,
CylinderBusinessStatisticsMapper
businessStatisticsMapper
)
{
this
.
useRegistrationMapper
=
useRegistrationMapper
;
this
.
useRegistrationMapper
=
useRegistrationMapper
;
this
.
businessStatisticsMapper
=
businessStatisticsMapper
;
this
.
enableDisableMapper
=
enableDisableMapper
;
this
.
enableDisableMapper
=
enableDisableMapper
;
this
.
scrapCancelMapper
=
scrapCancelMapper
;
this
.
scrapCancelMapper
=
scrapCancelMapper
;
this
.
restHighLevelClient
=
restHighLevelClient
;
this
.
restHighLevelClient
=
restHighLevelClient
;
...
@@ -512,7 +517,7 @@ public class JGDPStatisticsServiceImpl {
...
@@ -512,7 +517,7 @@ public class JGDPStatisticsServiceImpl {
List
<
Object
>
scrappedDeviceList
=
new
ArrayList
();
List
<
Object
>
scrappedDeviceList
=
new
ArrayList
();
DateTimeFormatter
sdf
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM"
);
DateTimeFormatter
sdf
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM"
);
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
dpFilterParamDto
.
getCityCode
());
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
dpFilterParamDto
.
getCityCode
());
List
<
Map
<
String
,
Object
>>
useRegisterCountList
=
useRegistration
Mapper
.
getUseRegisterCount
(
orgCode
);
List
<
Map
<
String
,
Object
>>
useRegisterCountList
=
businessStatistics
Mapper
.
getUseRegisterCount
(
orgCode
);
List
<
Map
<
String
,
Object
>>
scrappedDeviceCountList
=
scrapCancelMapper
.
getScrappedDeviceCount
(
dpFilterParamDto
);
List
<
Map
<
String
,
Object
>>
scrappedDeviceCountList
=
scrapCancelMapper
.
getScrappedDeviceCount
(
dpFilterParamDto
);
Map
<
String
,
Object
>
useRegisterCount
=
new
HashMap
<>();
Map
<
String
,
Object
>
useRegisterCount
=
new
HashMap
<>();
Map
<
String
,
Object
>
scrappedDeviceCount
=
new
HashMap
<>();
Map
<
String
,
Object
>
scrappedDeviceCount
=
new
HashMap
<>();
...
...
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