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
0dba56c9
Commit
0dba56c9
authored
Jul 29, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.气瓶-大屏2个接口 区县报错接口新开发,中间地图性能问题接口新开发
parent
89ee3da5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
86 additions
and
27 deletions
+86
-27
CylinderStatisticsMapper.java
...odule/statistics/api/mapper/CylinderStatisticsMapper.java
+16
-0
CommonBaseMapper.xml
...istics-api/src/main/resources/mapper/CommonBaseMapper.xml
+0
-1
CylinderStatisticsMapper.xml
...pi/src/main/resources/mapper/CylinderStatisticsMapper.xml
+13
-0
CylinderDPStatisticsController.java
...tistcs/biz/controller/CylinderDPStatisticsController.java
+24
-25
CylinderDPStatisticsServiceImpl.java
...tcs/biz/service/impl/CylinderDPStatisticsServiceImpl.java
+0
-0
StCommonServiceImpl.java
...odule/statistcs/biz/service/impl/StCommonServiceImpl.java
+32
-0
CylinderAreaDataMapper.xml
...-api/src/main/resources/mapper/CylinderAreaDataMapper.xml
+1
-1
No files found.
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/java/com/yeejoin/amos/boot/module/statistics/api/mapper/CylinderStatisticsMapper.java
0 → 100644
View file @
0dba56c9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistics
.
api
.
mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
/**
* Mapper 接口
*
* @author system_generator
* @date 2023-12-13
*/
@Mapper
public
interface
CylinderStatisticsMapper
{
Long
countEnterpriseNumForCylinder
(
@Param
(
"orgCode"
)
String
orgCode
);
}
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/resources/mapper/CommonBaseMapper.xml
View file @
0dba56c9
...
...
@@ -5,5 +5,4 @@
<select
id=
"getOrgCodeByCompanyCode"
resultType=
"java.lang.String"
>
select org_code from privilege_company where company_code = #{companyCode} limit 1
</select>
</mapper>
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/resources/mapper/CylinderStatisticsMapper.xml
0 → 100644
View file @
0dba56c9
<?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.CylinderStatisticsMapper"
>
<select
id=
"countEnterpriseNumForCylinder"
resultType=
"java.lang.Long"
>
SELECT
count(1)
FROM "tz_base_enterprise_info"
where
unit_type LIKE'%充装单位%'
and supervise_org_code like concat(#{orgCode},'%')
</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/controller/CylinderDPStatisticsController.java
View file @
0dba56c9
...
...
@@ -2,13 +2,17 @@ package com.yeejoin.amos.boot.module.statistcs.biz.controller;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.common.api.dto.CylinderFillingRecordStatisticsDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto
;
import
com.yeejoin.amos.boot.module.statistcs.biz.service.impl.CylinderDPStatisticsServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.validation.FieldError
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
...
...
@@ -35,7 +39,7 @@ public class CylinderDPStatisticsController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/getCylinderStatisticsData"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"
获取气瓶统计数据-按照企业名称统计"
,
notes
=
"获取气瓶统计数据-按照企业名称统计
"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"
大屏-气瓶-企业气瓶数量排名"
,
notes
=
"大屏-气瓶-企业气瓶数量排名
"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
getCylinderStatisticsData
(
@RequestParam
(
value
=
"regionCode"
)
String
regionCode
)
throws
IOException
{
List
<
Map
<
String
,
Object
>>
result
=
dpStatisticsService
.
getCylinderStatisticsData
(
regionCode
);
return
ResponseHelper
.
buildResponse
(
result
);
...
...
@@ -43,44 +47,40 @@ public class CylinderDPStatisticsController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/getCylinderStatisticsDataByCity"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"
获取气瓶统计数据-按照城市统计"
,
notes
=
"获取气瓶统计数据-按照城市
统计"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getCylinderStatisticsDataByCity
(
@
RequestBody
Map
<
String
,
Object
>
map
)
throws
Exception
{
Object
regionCode
=
map
.
get
(
"cityCode"
);
if
(
ObjectUtils
.
isEmpty
(
regionCode
))
{
regionCode
=
"610000"
;
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"
大屏-气瓶-区域统计"
,
notes
=
"大屏-气瓶-区域
统计"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getCylinderStatisticsDataByCity
(
@
Validated
@RequestBody
DPFilterParamDto
dpFilterParamDto
,
BindingResult
bindingResult
)
throws
Exception
{
List
<
FieldError
>
fieldErrors
=
bindingResult
.
getFieldErrors
(
);
if
(
!
fieldErrors
.
isEmpty
(
))
{
throw
new
BadRequest
(
fieldErrors
.
get
(
0
).
getDefaultMessage
())
;
}
Map
<
String
,
Object
>
result
=
dpStatisticsService
.
getCylinderStatisticsDataByCity
(
regionCode
.
toString
());
Map
<
String
,
Object
>
result
=
dpStatisticsService
.
getCylinderStatisticsDataByCity
(
dpFilterParamDto
);
return
ResponseHelper
.
buildResponse
(
result
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/getCylinderStatisticsDataByCityForTotal"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"
获取气瓶统计数据-按照城市统计"
,
notes
=
"获取气瓶统计数据-按照城市统计-地图统计
"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getCylinderStatisticsDataByCityForTotal
(
@
RequestBody
Map
<
String
,
Object
>
map
)
throws
Exception
{
Object
regionCode
=
map
.
get
(
"cityCode"
);
if
(
ObjectUtils
.
isEmpty
(
regionCode
))
{
regionCode
=
"610000"
;
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"
大屏-气瓶-地图统计图列"
,
notes
=
"大屏-气瓶-地图统计图列
"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getCylinderStatisticsDataByCityForTotal
(
@
Validated
@RequestBody
DPFilterParamDto
dpFilterParamDto
,
BindingResult
bindingResult
)
throws
Exception
{
List
<
FieldError
>
fieldErrors
=
bindingResult
.
getFieldErrors
(
);
if
(
!
fieldErrors
.
isEmpty
(
))
{
throw
new
BadRequest
(
fieldErrors
.
get
(
0
).
getDefaultMessage
())
;
}
Map
<
String
,
Object
>
result
=
dpStatisticsService
.
getCylinderStatisticsDataByCityForTotal
(
regionCode
.
toString
());
Map
<
String
,
Object
>
result
=
dpStatisticsService
.
getCylinderStatisticsDataByCityForTotal
(
dpFilterParamDto
);
return
ResponseHelper
.
buildResponse
(
result
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/getCylinderStatisticsDataByCityForMap"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"
获取气瓶统计数据-按照城市统计"
,
notes
=
"获取气瓶统计数据-按照城市统计-
地图"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
getCylinderStatisticsDataByCityForMap
(
@
RequestBody
Map
<
String
,
Object
>
map
)
throws
Exception
{
Object
regionCode
=
map
.
get
(
"cityCode"
);
if
(
ObjectUtils
.
isEmpty
(
regionCode
))
{
regionCode
=
"610000"
;
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"
大屏-气瓶-中间地图"
,
notes
=
"大屏-气瓶-中间
地图"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
getCylinderStatisticsDataByCityForMap
(
@
Validated
@RequestBody
DPFilterParamDto
dpFilterParamDto
,
BindingResult
bindingResult
)
throws
Exception
{
List
<
FieldError
>
fieldErrors
=
bindingResult
.
getFieldErrors
(
);
if
(
!
fieldErrors
.
isEmpty
(
))
{
throw
new
BadRequest
(
fieldErrors
.
get
(
0
).
getDefaultMessage
())
;
}
List
<
Map
<
String
,
Object
>>
result
=
dpStatisticsService
.
getCylinderStatisticsDataByCityForMap
(
regionCode
.
toString
());
List
<
Map
<
String
,
Object
>>
result
=
dpStatisticsService
.
getCylinderStatisticsDataByCityForMap
(
dpFilterParamDto
);
return
ResponseHelper
.
buildResponse
(
result
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"30天的充装量、卸液量数据"
)
@GetMapping
(
value
=
"/fillingTimesAndQuantity"
)
...
...
@@ -88,5 +88,4 @@ public class CylinderDPStatisticsController extends BaseController {
return
ResponseHelper
.
buildResponse
(
dpStatisticsService
.
fillingTimesAndQuantity
(
reginCode
));
}
}
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 @
0dba56c9
This diff is collapsed.
Click to expand it.
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/StCommonServiceImpl.java
View file @
0dba56c9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistcs
.
biz
.
service
.
impl
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.module.common.api.constant.TZSCommonConstant
;
import
com.yeejoin.amos.boot.module.common.api.enums.ReginStepEnum
;
import
com.yeejoin.amos.boot.module.statistics.api.mapper.CommonBaseMapper
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.RegionModel
;
import
org.springframework.stereotype.Service
;
import
java.util.*
;
import
java.util.concurrent.ConcurrentHashMap
;
/**
* @author Administrator
...
...
@@ -13,9 +17,16 @@ import java.util.*;
@Service
public
class
StCommonServiceImpl
{
private
CommonBaseMapper
commonMapper
;
private
static
Map
<
String
,
String
>
regionCodeOrgCodeMap
=
new
ConcurrentHashMap
<>();
private
static
List
<
RegionModel
>
regionModels
=
new
ArrayList
<>();
public
StCommonServiceImpl
(
CommonBaseMapper
commonMapper
)
{
this
.
commonMapper
=
commonMapper
;
}
public
void
init
()
{
initReginCode
();
}
...
...
@@ -37,6 +48,17 @@ public class StCommonServiceImpl {
}
}
public
String
getAndSetOrgCode
(
String
cityCode
)
{
String
orgCode
=
regionCodeOrgCodeMap
.
get
(
cityCode
);
if
(
orgCode
==
null
)
{
orgCode
=
commonMapper
.
getOrgCodeByCompanyCode
(
cityCode
);
if
(
orgCode
!=
null
)
{
regionCodeOrgCodeMap
.
put
(
cityCode
,
orgCode
);
}
}
return
orgCode
;
}
public
List
<
RegionModel
>
getUserRegionCode
(
ReginParams
selectedOrgInfo
)
{
String
regionCode
=
selectedOrgInfo
.
getCompany
().
getCompanyCode
();
Optional
<
RegionModel
>
op
=
regionModels
.
stream
().
filter
(
e
->
e
.
getRegionCode
().
toString
().
equals
(
regionCode
)).
findFirst
();
...
...
@@ -46,4 +68,14 @@ public class StCommonServiceImpl {
result
.
setRegionCode
(
Integer
.
parseInt
(
regionCode
));
return
Collections
.
singletonList
(
result
);
}
public
List
<
RegionModel
>
setRegionIfRootParent
(
String
regionCode
)
throws
Exception
{
List
<
RegionModel
>
regionList
=
Systemctl
.
regionClient
.
queryByParentRegionCode
(
Integer
.
parseInt
(
regionCode
)).
getResult
();
// 陕西省时需要在地图返回独立的地级市:韩城、杨凌、西咸
if
(
regionCode
.
equals
(
TZSCommonConstant
.
SHAN_XI_REGION_CODE
))
{
List
<
RegionModel
>
independentRegions
=
ReginStepEnum
.
enum2RegionList
(
"map"
);
regionList
.
addAll
(
independentRegions
);
}
return
regionList
;
}
}
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/resources/mapper/CylinderAreaDataMapper.xml
View file @
0dba56c9
...
...
@@ -151,7 +151,7 @@
WHERE
u.data_sources = '陕西省内企业'
AND u.unit_type LIKE'%充装单位%'
AND ui.post like '%
"6552"
%'
AND ui.post like '%
6552
%'
<if
test=
"orgCodes != null and orgCodes.size > 0"
>
AND
<foreach
collection=
"orgCodes"
open=
"("
item=
"orgCode"
close=
")"
separator=
" or "
>
...
...
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