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
e2c12ab5
Commit
e2c12ab5
authored
Jun 01, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop_tzs_register' of…
Merge branch 'develop_tzs_register' of
http://36.40.66.175:5000/moa/amos-boot-biz
into develop_tzs_register
parents
3e8d92b7
bb0cb3f8
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
95 additions
and
29 deletions
+95
-29
pom.xml
amos-boot-data/amos-boot-data-openapi/pom.xml
+1
-1
SyncCylinderDataService.java
...mos/api/openapi/face/service/SyncCylinderDataService.java
+1
-0
TmCylinderFillingCheckService.java
...i/openapi/face/service/TmCylinderFillingCheckService.java
+3
-1
TmCylinderFillingExamineService.java
...openapi/face/service/TmCylinderFillingExamineService.java
+2
-1
TmCylinderFillingRecordService.java
.../openapi/face/service/TmCylinderFillingRecordService.java
+3
-1
TmCylinderFillingService.java
...os/api/openapi/face/service/TmCylinderFillingService.java
+2
-1
TmCylinderInfoService.java
.../amos/api/openapi/face/service/TmCylinderInfoService.java
+2
-1
TmCylinderInspectionService.java
...api/openapi/face/service/TmCylinderInspectionService.java
+3
-1
TmCylinderTagsService.java
.../amos/api/openapi/face/service/TmCylinderTagsService.java
+2
-1
TmCylinderUnitService.java
.../amos/api/openapi/face/service/TmCylinderUnitService.java
+3
-1
CylCylinderFillingCheckMapper.java
...ylinder/flc/api/mapper/CylCylinderFillingCheckMapper.java
+1
-1
CylinderUnitMapper.java
...ot/module/cylinder/flc/api/mapper/CylinderUnitMapper.java
+1
-0
CylCylinderFillingCheckMapper.xml
...c/main/resources/mapper/CylCylinderFillingCheckMapper.xml
+2
-4
CylinderInfoController.java
...e/cylinder/flc/biz/controller/CylinderInfoController.java
+1
-1
CylinderInfoServiceImpl.java
...ylinder/flc/biz/service/impl/CylinderInfoServiceImpl.java
+68
-14
No files found.
amos-boot-data/amos-boot-data-openapi/pom.xml
View file @
e2c12ab5
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
<dependency>
<dependency>
<groupId>
com.baomidou
</groupId>
<groupId>
com.baomidou
</groupId>
<artifactId>
dynamic-datasource-spring-boot-starter
</artifactId>
<artifactId>
dynamic-datasource-spring-boot-starter
</artifactId>
<version>
3.
1.0
</version>
<version>
3.
4.1
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
...
...
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/service/SyncCylinderDataService.java
View file @
e2c12ab5
...
@@ -32,6 +32,7 @@ import com.yeejoin.amos.boot.module.cylinder.flc.api.mapper.CylinderUnitMapper;
...
@@ -32,6 +32,7 @@ import com.yeejoin.amos.boot.module.cylinder.flc.api.mapper.CylinderUnitMapper;
import
java.util.List
;
import
java.util.List
;
@Component
@Component
@DS
(
"tzs"
)
public
class
SyncCylinderDataService
public
class
SyncCylinderDataService
{
{
/**
/**
...
...
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/service/TmCylinderFillingCheckService.java
View file @
e2c12ab5
...
@@ -4,6 +4,7 @@ package com.yeejoin.amos.api.openapi.face.service;
...
@@ -4,6 +4,7 @@ package com.yeejoin.amos.api.openapi.face.service;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
com.baomidou.dynamic.datasource.annotation.DSTransactional
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderFillingCheckDto
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderFillingCheckDto
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderFillingDto
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderFillingDto
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -37,7 +38,8 @@ public class TmCylinderFillingCheckService extends BaseService<TmCylinderFilling
...
@@ -37,7 +38,8 @@ public class TmCylinderFillingCheckService extends BaseService<TmCylinderFilling
private
RedisTemplate
redisTemplate
;
private
RedisTemplate
redisTemplate
;
@Autowired
@Autowired
private
SyncCylinderDataService
syncCylinderDataService
;
private
SyncCylinderDataService
syncCylinderDataService
;
@Transactional
(
rollbackFor
=
{
Exception
.
class
})
@DSTransactional
public
String
createCylinderFillingAfter
(
List
<
TmCylinderFillingCheckModel
>
model
)
{
public
String
createCylinderFillingAfter
(
List
<
TmCylinderFillingCheckModel
>
model
)
{
// TODO Auto-generated method stub
// TODO Auto-generated method stub
// if (ValidationUtil.isEmpty(model))
// if (ValidationUtil.isEmpty(model))
...
...
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/service/TmCylinderFillingExamineService.java
View file @
e2c12ab5
...
@@ -4,6 +4,7 @@ package com.yeejoin.amos.api.openapi.face.service;
...
@@ -4,6 +4,7 @@ package com.yeejoin.amos.api.openapi.face.service;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
com.baomidou.dynamic.datasource.annotation.DSTransactional
;
import
com.yeejoin.amos.api.openapi.face.model.TmCylinderUnitModel
;
import
com.yeejoin.amos.api.openapi.face.model.TmCylinderUnitModel
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderFillingExamineDto
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderFillingExamineDto
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderUnitDto
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderUnitDto
;
...
@@ -42,7 +43,7 @@ public class TmCylinderFillingExamineService extends BaseService<TmCylinderFilli
...
@@ -42,7 +43,7 @@ public class TmCylinderFillingExamineService extends BaseService<TmCylinderFilli
private
SyncCylinderDataService
syncCylinderDataService
;
private
SyncCylinderDataService
syncCylinderDataService
;
@Transactional
(
rollbackFor
=
{
Exception
.
class
})
@DSTransactional
public
String
createCylinderFillingExamine
(
List
<
TmCylinderFillingExamineModel
>
model
)
{
public
String
createCylinderFillingExamine
(
List
<
TmCylinderFillingExamineModel
>
model
)
{
// TODO Auto-generated method stub
// TODO Auto-generated method stub
if
(
ValidationUtil
.
isEmpty
(
model
))
if
(
ValidationUtil
.
isEmpty
(
model
))
...
...
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/service/TmCylinderFillingRecordService.java
View file @
e2c12ab5
...
@@ -8,6 +8,7 @@ import java.util.List;
...
@@ -8,6 +8,7 @@ import java.util.List;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
com.baomidou.dynamic.datasource.annotation.DS
;
import
com.baomidou.dynamic.datasource.annotation.DS
;
import
com.baomidou.dynamic.datasource.annotation.DSTransactional
;
import
com.yeejoin.amos.api.openapi.face.orm.dao.ESCylinderFillingRecordRepository
;
import
com.yeejoin.amos.api.openapi.face.orm.dao.ESCylinderFillingRecordRepository
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.module.cylinder.api.entity.ESCylinderFillingRecordDto
;
import
com.yeejoin.amos.boot.module.cylinder.api.entity.ESCylinderFillingRecordDto
;
...
@@ -55,7 +56,7 @@ public class TmCylinderFillingRecordService extends BaseService<TmCylinderFillin
...
@@ -55,7 +56,7 @@ public class TmCylinderFillingRecordService extends BaseService<TmCylinderFillin
@Autowired
@Autowired
private
SyncCylinderDataService
syncCylinderDataService
;
private
SyncCylinderDataService
syncCylinderDataService
;
@Transactional
(
rollbackFor
=
{
Exception
.
class
})
@DSTransactional
public
String
createCylinderFilling
(
List
<
TmCylinderFillingRecordModel
>
model
)
{
public
String
createCylinderFilling
(
List
<
TmCylinderFillingRecordModel
>
model
)
{
// TODO Auto-generated method stub
// TODO Auto-generated method stub
// if (ValidationUtil.isEmpty(model))
// if (ValidationUtil.isEmpty(model))
...
@@ -73,6 +74,7 @@ public class TmCylinderFillingRecordService extends BaseService<TmCylinderFillin
...
@@ -73,6 +74,7 @@ public class TmCylinderFillingRecordService extends BaseService<TmCylinderFillin
return
"OK"
;
return
"OK"
;
}
}
@DS
(
"tzs"
)
private
void
syncCylinderFilling
(
List
<
TmCylinderFillingRecordModel
>
model
)
{
private
void
syncCylinderFilling
(
List
<
TmCylinderFillingRecordModel
>
model
)
{
syncCylinderDataService
.
syncCylinderFillingRecord
(
model
);
syncCylinderDataService
.
syncCylinderFillingRecord
(
model
);
}
}
...
...
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/service/TmCylinderFillingService.java
View file @
e2c12ab5
...
@@ -4,6 +4,7 @@ package com.yeejoin.amos.api.openapi.face.service;
...
@@ -4,6 +4,7 @@ package com.yeejoin.amos.api.openapi.face.service;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
com.baomidou.dynamic.datasource.annotation.DSTransactional
;
import
com.yeejoin.amos.api.openapi.face.model.TmCylinderUnitModel
;
import
com.yeejoin.amos.api.openapi.face.model.TmCylinderUnitModel
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderFillingDto
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderFillingDto
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderInfoDto
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderInfoDto
;
...
@@ -40,7 +41,7 @@ public class TmCylinderFillingService extends BaseService<TmCylinderFillingModel
...
@@ -40,7 +41,7 @@ public class TmCylinderFillingService extends BaseService<TmCylinderFillingModel
@Autowired
@Autowired
private
SyncCylinderDataService
syncCylinderDataService
;
private
SyncCylinderDataService
syncCylinderDataService
;
@
Transactional
(
rollbackFor
=
{
Exception
.
class
})
@
DSTransactional
public
String
createCylinderFillingBefore
(
List
<
TmCylinderFillingModel
>
model
)
{
public
String
createCylinderFillingBefore
(
List
<
TmCylinderFillingModel
>
model
)
{
// TODO Auto-generated method stub
// TODO Auto-generated method stub
// if (ValidationUtil.isEmpty(model))
// if (ValidationUtil.isEmpty(model))
...
...
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/service/TmCylinderInfoService.java
View file @
e2c12ab5
...
@@ -6,6 +6,7 @@ import java.util.ArrayList;
...
@@ -6,6 +6,7 @@ import java.util.ArrayList;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
com.baomidou.dynamic.datasource.annotation.DSTransactional
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.yeejoin.amos.api.openapi.face.model.TmCylinderUnitModel
;
import
com.yeejoin.amos.api.openapi.face.model.TmCylinderUnitModel
;
import
com.yeejoin.amos.api.openapi.face.orm.dao.ESCylinderInfoRepository
;
import
com.yeejoin.amos.api.openapi.face.orm.dao.ESCylinderInfoRepository
;
...
@@ -58,7 +59,7 @@ public class TmCylinderInfoService extends BaseService<TmCylinderInfoModel, TmCy
...
@@ -58,7 +59,7 @@ public class TmCylinderInfoService extends BaseService<TmCylinderInfoModel, TmCy
@Autowired
@Autowired
ESCylinderInfoRepository
esCylinderInfoRepository
;
ESCylinderInfoRepository
esCylinderInfoRepository
;
@Transactional
(
rollbackFor
=
{
Exception
.
class
})
@DSTransactional
public
String
createCylinderInfo
(
List
<
TmCylinderInfoModel
>
model
)
{
public
String
createCylinderInfo
(
List
<
TmCylinderInfoModel
>
model
)
{
// TODO Auto-generated method stub
// TODO Auto-generated method stub
if
(
ValidationUtil
.
isEmpty
(
model
))
if
(
ValidationUtil
.
isEmpty
(
model
))
...
...
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/service/TmCylinderInspectionService.java
View file @
e2c12ab5
...
@@ -4,6 +4,7 @@ package com.yeejoin.amos.api.openapi.face.service;
...
@@ -4,6 +4,7 @@ package com.yeejoin.amos.api.openapi.face.service;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
com.baomidou.dynamic.datasource.annotation.DSTransactional
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderInspectionDto
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderInspectionDto
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderUnitDto
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderUnitDto
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -39,7 +40,8 @@ public class TmCylinderInspectionService extends BaseService<TmCylinderInspectio
...
@@ -39,7 +40,8 @@ public class TmCylinderInspectionService extends BaseService<TmCylinderInspectio
private
RedisTemplate
redisTemplate
;
private
RedisTemplate
redisTemplate
;
@Autowired
@Autowired
private
SyncCylinderDataService
syncCylinderDataService
;
private
SyncCylinderDataService
syncCylinderDataService
;
@Transactional
(
rollbackFor
=
{
Exception
.
class
})
@DSTransactional
public
String
createCylinderInspection
(
List
<
TmCylinderInspectionModel
>
model
)
{
public
String
createCylinderInspection
(
List
<
TmCylinderInspectionModel
>
model
)
{
if
(
ValidationUtil
.
isEmpty
(
model
))
if
(
ValidationUtil
.
isEmpty
(
model
))
throw
new
BadRequest
(
"气瓶检验信息为空."
);
throw
new
BadRequest
(
"气瓶检验信息为空."
);
...
...
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/service/TmCylinderTagsService.java
View file @
e2c12ab5
...
@@ -4,6 +4,7 @@ package com.yeejoin.amos.api.openapi.face.service;
...
@@ -4,6 +4,7 @@ package com.yeejoin.amos.api.openapi.face.service;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
com.baomidou.dynamic.datasource.annotation.DSTransactional
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderInspectionDto
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderInspectionDto
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderTagsDto
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderTagsDto
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -40,7 +41,7 @@ public class TmCylinderTagsService extends BaseService<TmCylinderTagsModel, TmCy
...
@@ -40,7 +41,7 @@ public class TmCylinderTagsService extends BaseService<TmCylinderTagsModel, TmCy
@Autowired
@Autowired
private
SyncCylinderDataService
syncCylinderDataService
;
private
SyncCylinderDataService
syncCylinderDataService
;
@Transactional
(
rollbackFor
=
{
Exception
.
class
})
@DSTransactional
public
String
createCylinderTag
(
List
<
TmCylinderTagsModel
>
model
)
{
public
String
createCylinderTag
(
List
<
TmCylinderTagsModel
>
model
)
{
// TODO Auto-generated method stub
// TODO Auto-generated method stub
if
(
ValidationUtil
.
isEmpty
(
model
))
if
(
ValidationUtil
.
isEmpty
(
model
))
...
...
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/face/service/TmCylinderUnitService.java
View file @
e2c12ab5
...
@@ -4,6 +4,7 @@ package com.yeejoin.amos.api.openapi.face.service;
...
@@ -4,6 +4,7 @@ package com.yeejoin.amos.api.openapi.face.service;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
com.baomidou.dynamic.datasource.annotation.DSTransactional
;
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
;
...
@@ -39,7 +40,8 @@ public class TmCylinderUnitService extends BaseService<TmCylinderUnitModel, TmCy
...
@@ -39,7 +40,8 @@ public class TmCylinderUnitService extends BaseService<TmCylinderUnitModel, TmCy
private
RedisTemplate
redisTemplate
;
private
RedisTemplate
redisTemplate
;
@Autowired
@Autowired
private
SyncCylinderDataService
syncCylinderDataService
;
private
SyncCylinderDataService
syncCylinderDataService
;
@Transactional
(
rollbackFor
=
{
Exception
.
class
})
@DSTransactional
public
String
createCylinderUnit
(
List
<
TmCylinderUnitModel
>
model
)
{
public
String
createCylinderUnit
(
List
<
TmCylinderUnitModel
>
model
)
{
if
(
ValidationUtil
.
isEmpty
(
model
))
if
(
ValidationUtil
.
isEmpty
(
model
))
throw
new
BadRequest
(
"气瓶企业信息数据为空."
);
throw
new
BadRequest
(
"气瓶企业信息数据为空."
);
...
...
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-api/src/main/java/com/yeejoin/amos/boot/module/cylinder/flc/api/mapper/CylCylinderFillingCheckMapper.java
View file @
e2c12ab5
...
@@ -34,7 +34,7 @@ public interface CylCylinderFillingCheckMapper extends BaseMapper<CylinderFillin
...
@@ -34,7 +34,7 @@ public interface CylCylinderFillingCheckMapper extends BaseMapper<CylinderFillin
boolean
updataSyncFilling
(
@Param
(
"ids"
)
List
<
Long
>
appIds
);
boolean
updataSyncFilling
(
@Param
(
"ids"
)
List
<
Long
>
appIds
);
boolean
saveAndBatchInsert
(
@Param
(
"list"
)
List
<
CylinderFilling
>
list
);
void
saveAndBatchInsert
(
@Param
(
"list"
)
List
<
CylinderFilling
>
list
);
Long
selectCountTotal
();
Long
selectCountTotal
();
...
...
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-api/src/main/java/com/yeejoin/amos/boot/module/cylinder/flc/api/mapper/CylinderUnitMapper.java
View file @
e2c12ab5
...
@@ -56,6 +56,7 @@ public interface CylinderUnitMapper extends BaseMapper<CylinderUnit> {
...
@@ -56,6 +56,7 @@ public interface CylinderUnitMapper extends BaseMapper<CylinderUnit> {
* @return list
* @return list
*/
*/
List
<
CityCylinderInfoDto
>
getCylinderDataByLevel
(
@Param
(
"level"
)
String
level
);
List
<
CityCylinderInfoDto
>
getCylinderDataByLevel
(
@Param
(
"level"
)
String
level
);
void
saveOrUpdateBatch
(
@Param
(
"list"
)
List
<
CylinderUnit
>
list
);
void
saveOrUpdateBatch
(
@Param
(
"list"
)
List
<
CylinderUnit
>
list
);
...
...
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-api/src/main/resources/mapper/CylCylinderFillingCheckMapper.xml
View file @
e2c12ab5
...
@@ -141,10 +141,8 @@
...
@@ -141,10 +141,8 @@
LIMIT 1000
LIMIT 1000
</select>
</select>
<insert
id=
"saveAndBatchInsert"
>
<insert
id=
"saveAndBatchInsert"
parameterType=
"com.yeejoin.amos.boot.module.cylinder.flc.api.entity.CylinderFillingRecord"
>
INSERT INTO "tz_cylinder_filling"
INSERT INTO tz_cylinder_filling( sequence_nbr,
(
sequence_nbr,
filling_before_id,
filling_before_id,
filling_unit_name,
filling_unit_name,
sequence_code,
sequence_code,
...
...
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-biz/src/main/java/com/yeejoin/amos/boot/module/cylinder/flc/biz/controller/CylinderInfoController.java
View file @
e2c12ab5
...
@@ -1361,7 +1361,7 @@ public class CylinderInfoController extends BaseController {
...
@@ -1361,7 +1361,7 @@ public class CylinderInfoController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"市级为维度,各市的充装次数和累计充装量"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"市级为维度,各市的充装次数和累计充装量"
)
@GetMapping
(
value
=
"/countFillingTimesAndQuantityByCity"
)
@GetMapping
(
value
=
"/countFillingTimesAndQuantityByCity"
)
public
ResponseModel
<
Object
>
countFillingTimesAndQuantityByCity
()
{
public
ResponseModel
<
Map
<
String
,
Object
>
>
countFillingTimesAndQuantityByCity
()
{
return
ResponseHelper
.
buildResponse
(
cylinderInfoServiceImpl
.
countFillingTimesAndQuantityByCity
());
return
ResponseHelper
.
buildResponse
(
cylinderInfoServiceImpl
.
countFillingTimesAndQuantityByCity
());
}
}
}
}
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-biz/src/main/java/com/yeejoin/amos/boot/module/cylinder/flc/biz/service/impl/CylinderInfoServiceImpl.java
View file @
e2c12ab5
...
@@ -1260,66 +1260,120 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
...
@@ -1260,66 +1260,120 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
public
List
<
Map
<
String
,
Object
>
>
countFillingTimesAndQuantityByCity
()
{
public
Map
<
String
,
Object
>
countFillingTimesAndQuantityByCity
()
{
// 查询所有的市级城市
// 查询所有的市级城市
List
<
RegionModel
>
regionModelList
=
Systemctl
.
regionClient
.
queryByLevel
(
"2"
).
getResult
();
List
<
RegionModel
>
regionModelList
=
Systemctl
.
regionClient
.
queryByLevel
(
"2"
).
getResult
();
// 并行处理每个城市的数据
// 并行处理每个城市的数据
List
<
CompletableFuture
<
Map
<
String
,
Object
>>>
futures
=
regionModelList
.
stream
()
List
<
CompletableFuture
<
Map
<
String
,
Object
>>>
futures
=
regionModelList
.
stream
()
.
map
(
regionModel
->
CompletableFuture
.
supplyAsync
(()
->
esQuery
(
regionModel
)))
.
map
(
regionModel
->
CompletableFuture
.
supplyAsync
(()
->
esQuery
(
regionModel
)))
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
return
futures
.
stream
()
List
<
Map
<
String
,
Object
>>
collect
=
futures
.
stream
()
.
map
(
CompletableFuture:
:
join
)
.
map
(
CompletableFuture:
:
join
)
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
return
assemblingHistogramData
(
collect
);
// Map<String, Object> stringObjectMap = esQuery(regionModelList.get(3));
// ArrayList<Map<String, Object>> ss = new ArrayList<>();
// ss.add(stringObjectMap);
// return assemblingHistogramData(ss);
}
private
static
Map
<
String
,
Object
>
assemblingHistogramData
(
List
<
Map
<
String
,
Object
>>
collect
)
{
// 组装数据
// {
// "seriesData": [
// {
// "data": [
// 3,
// 2,
// 2,
// 3,
// 1
// ],
// "name": "正常点",
// "stack": "正常点"
// },
// {
// "data": [
// 1,
// 1,
// 2,
// 1,
// 2
// ],
// "name": "异常点",
// "stack": "巡检点"
// }
// ],
// "axisData": [
// "A",
// "B",
// "C",
// "D",
// "E"
// ]
// }
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
seriesData
=
new
ArrayList
<>();
List
<
String
>
axisData
=
new
ArrayList
<>();
List
<
String
>
seriesFillingTimesDataList
=
new
ArrayList
<>();
List
<
String
>
seriesCumulativeFillingQuantityDataList
=
new
ArrayList
<>();
collect
.
forEach
(
x
->{
axisData
.
add
(
String
.
valueOf
(
x
.
get
(
"regionName"
)));
seriesFillingTimesDataList
.
add
(
String
.
valueOf
(
x
.
get
(
"fillingTimes"
)));
seriesCumulativeFillingQuantityDataList
.
add
(
String
.
valueOf
(
x
.
get
(
"fillingQuantity"
)));
});
HashMap
<
String
,
Object
>
temMap1
=
new
HashMap
<>();
temMap1
.
put
(
"data"
,
seriesFillingTimesDataList
);
temMap1
.
put
(
"name"
,
"充装次数"
);
temMap1
.
put
(
"stack"
,
"充装次数"
);
HashMap
<
String
,
Object
>
temMap2
=
new
HashMap
<>();
temMap2
.
put
(
"data"
,
seriesCumulativeFillingQuantityDataList
);
temMap2
.
put
(
"name"
,
"累计充装量"
);
temMap2
.
put
(
"stack"
,
"累计充装量"
);
seriesData
.
add
(
temMap1
);
seriesData
.
add
(
temMap2
);
result
.
put
(
"seriesData"
,
seriesData
);
result
.
put
(
"axisData"
,
axisData
);
return
result
;
}
}
private
Map
<
String
,
Object
>
esQuery
(
RegionModel
regionModel
)
{
private
Map
<
String
,
Object
>
esQuery
(
RegionModel
regionModel
)
{
SearchRequest
searchRequest
=
new
SearchRequest
(
INDEX_NAME
);
SearchRequest
searchRequest
=
new
SearchRequest
(
INDEX_NAME
);
SearchSourceBuilder
searchSourceBuilder
=
new
SearchSourceBuilder
();
SearchSourceBuilder
searchSourceBuilder
=
new
SearchSourceBuilder
();
// 将 regionModel.getRegionCode() 转换成匹配中间部分的格式
// 将 regionModel.getRegionCode() 转换成匹配中间部分的格式
String
regionCodePattern
=
"*"
+
regionModel
.
getRegionCode
()
+
"*"
;
String
regionCodePattern
=
"*"
+
regionModel
.
getRegionCode
()
+
"*"
;
BoolQueryBuilder
boolQueryBuilder
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
boolQueryBuilder
=
QueryBuilders
.
boolQuery
();
boolQueryBuilder
.
must
(
QueryBuilders
.
wildcardQuery
(
"regionCode"
,
regionCodePattern
));
boolQueryBuilder
.
must
(
QueryBuilders
.
wildcardQuery
(
"regionCode"
,
regionCodePattern
));
searchSourceBuilder
.
query
(
boolQueryBuilder
);
searchSourceBuilder
.
query
(
boolQueryBuilder
);
searchSourceBuilder
.
aggregation
(
searchSourceBuilder
.
aggregation
(
AggregationBuilders
.
cardinality
(
"total_filling_count"
)
AggregationBuilders
.
cardinality
(
"total_filling_count"
)
.
field
(
"sequenceNbr
.keyword
"
)
.
field
(
"sequenceNbr"
)
);
);
searchSourceBuilder
.
aggregation
(
searchSourceBuilder
.
aggregation
(
AggregationBuilders
.
sum
(
"total_filling_quantity"
)
AggregationBuilders
.
sum
(
"total_filling_quantity"
)
.
field
(
"fillingQuantity"
)
.
field
(
"fillingQuantity"
)
);
);
searchRequest
.
source
(
searchSourceBuilder
);
searchRequest
.
source
(
searchSourceBuilder
);
System
.
out
.
println
(
"Search Request: "
+
searchRequest
);
System
.
out
.
println
(
"Search Request: "
+
searchRequest
);
try
{
try
{
// 执行搜索请求
// 执行搜索请求
SearchResponse
searchResponse
=
restHighLevelClient
.
search
(
searchRequest
,
RequestOptions
.
DEFAULT
);
SearchResponse
searchResponse
=
restHighLevelClient
.
search
(
searchRequest
,
RequestOptions
.
DEFAULT
);
// 获取所有聚合结果
// 获取所有聚合结果
Aggregations
aggregations
=
searchResponse
.
getAggregations
();
Aggregations
aggregations
=
searchResponse
.
getAggregations
();
ParsedCardinality
cardinalityAgg
=
aggregations
.
get
(
"total_filling_count"
);
ParsedCardinality
cardinalityAgg
=
aggregations
.
get
(
"total_filling_count"
);
long
uniqueCount
=
cardinalityAgg
.
getValue
();
long
uniqueCount
=
cardinalityAgg
.
getValue
();
Sum
sumAgg
=
aggregations
.
get
(
"total_filling_quantity"
);
Sum
sumAgg
=
aggregations
.
get
(
"total_filling_quantity"
);
double
totalSum
=
sumAgg
.
getValue
();
double
totalSum
=
sumAgg
.
getValue
();
System
.
out
.
println
(
"填充数量的唯一值数量: "
+
uniqueCount
);
System
.
out
.
println
(
"填充数量的唯一值数量: "
+
uniqueCount
);
System
.
out
.
println
(
"填充量的总和: "
+
totalSum
);
System
.
out
.
println
(
"填充量的总和: "
+
totalSum
);
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
resultMap
.
put
(
REGION_CODE
,
regionModel
.
getRegionCode
());
resultMap
.
put
(
REGION_CODE
,
regionModel
.
getRegionCode
());
resultMap
.
put
(
REGION_NAME
,
regionModel
.
getRegionName
());
resultMap
.
put
(
REGION_NAME
,
regionModel
.
getRegionName
());
resultMap
.
put
(
FILLING_TIMES
,
uniqueCount
);
resultMap
.
put
(
FILLING_TIMES
,
uniqueCount
);
resultMap
.
put
(
FILLING_QUANTITY
,
totalSum
);
resultMap
.
put
(
FILLING_QUANTITY
,
totalSum
);
return
resultMap
;
return
resultMap
;
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
...
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