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
ee41c37f
Commit
ee41c37f
authored
Jul 09, 2024
by
麻笑宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
大屏相关路径文件初始化
parent
a9ff3d5b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
114 additions
and
14 deletions
+114
-14
ScreenMapper.java
...yeejoin/amos/boot/module/tcm/api/mapper/ScreenMapper.java
+3
-7
IScreenService.java
...oot/module/tcm/api/service/statistics/IScreenService.java
+3
-1
ScreenMapper.xml
...module-tcm-api/src/main/resources/mapper/ScreenMapper.xml
+10
-1
ScreenController.java
...le/tcm/biz/controller/statistics/dp/ScreenController.java
+4
-3
ScreenImpl.java
...ot/module/tcm/biz/service/impl/statistics/ScreenImpl.java
+94
-2
No files found.
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/java/com/yeejoin/amos/boot/module/tcm/api/mapper/ScreenMapper.java
View file @
ee41c37f
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tcm
.
api
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.tcm.api.dto.*
;
import
com.yeejoin.amos.boot.module.tcm.api.entity.AlertCalled
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
/**
* 大屏Mapper 接口
...
...
@@ -19,7 +13,9 @@ import java.util.Set;
* @author maxy
* @date 2024-07-09
*/
@Mapper
public
interface
ScreenMapper
{
List
<
Map
<
String
,
Object
>>
getCompanyInfo
(
@Param
(
"screenDto"
)
ScreenDto
screenDto
);
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/java/com/yeejoin/amos/boot/module/tcm/api/service/statistics/IScreenService.java
View file @
ee41c37f
...
...
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.tcm.api.dto.*
;
import
com.yeejoin.amos.boot.module.tcm.api.enums.DispatchPaperEnums
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.List
;
...
...
@@ -16,7 +17,8 @@ import java.util.Map;
* @author maxy
* @date 2024-07-09
*/
@Service
public
interface
IScreenService
{
ResponseModel
<
Map
>
companyInfo
(
ScreenDto
screenDto
);
List
<
Map
<
String
,
Object
>
>
companyInfo
(
ScreenDto
screenDto
);
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/resources/mapper/ScreenMapper.xml
View file @
ee41c37f
...
...
@@ -3,7 +3,16 @@
<mapper
namespace=
"com.yeejoin.amos.boot.module.tcm.api.mapper.ScreenMapper"
>
<select
id=
"getCompanyInfo"
resultType=
"java.util.Map"
>
SELECT bi.equip_category as equipCategory,bi.unit_type as unitType
FROM (
SELECT org_code
FROM privilege_company
WHERE company_code = #{screenDto.cityCode}
) AS subquery
JOIN tz_base_enterprise_info bi ON bi.supervise_org_code LIKE CONCAT(subquery.org_code, '%')
where bi.equip_category is not null and bi.equip_category != '[]' and bi.unit_type is not null;
</select>
</mapper>
...
...
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/controller/statistics/dp/ScreenController.java
View file @
ee41c37f
...
...
@@ -10,9 +10,11 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.Map
;
/**
...
...
@@ -30,9 +32,8 @@ public class ScreenController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/companyInfo"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"大屏企业统计"
,
notes
=
"大屏企业统计"
)
public
ResponseModel
<
Map
>
companyInfo
(
@RequestBody
ScreenDto
screenDto
){
return
screenService
.
companyInfo
(
screenDto
);
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
companyInfo
(
@RequestBody
ScreenDto
screenDto
){
return
ResponseHelper
.
buildResponse
(
screenService
.
companyInfo
(
screenDto
));
}
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/service/impl/statistics/ScreenImpl.java
View file @
ee41c37f
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tcm
.
biz
.
service
.
impl
.
statistics
;
import
com.alibaba.fastjson.JSONArray
;
import
com.yeejoin.amos.boot.module.tcm.api.dto.ScreenDto
;
import
com.yeejoin.amos.boot.module.tcm.api.mapper.ScreenMapper
;
import
com.yeejoin.amos.boot.module.tcm.api.service.statistics.IScreenService
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.Map
;
import
javax.annotation.Resource
;
import
java.util.*
;
@Service
public
class
ScreenImpl
implements
IScreenService
{
@Resource
private
ScreenMapper
screenMapper
;
@Override
public
ResponseModel
<
Map
>
companyInfo
(
ScreenDto
screenDto
)
{
public
List
<
Map
<
String
,
Object
>>
companyInfo
(
ScreenDto
screenDto
)
{
List
<
Map
<
String
,
Object
>>
list
=
screenMapper
.
getCompanyInfo
(
screenDto
);
if
(
CollectionUtils
.
isEmpty
(
list
)){
return
list
;
}
//数据处理后Map,key为企业类型+设备,value为计数
Map
<
String
,
Integer
>
dataMap
=
new
HashMap
<>();
for
(
Map
<
String
,
Object
>
map
:
list
){
JSONArray
equipCategoryArray
=
(
JSONArray
)
JSONArray
.
parse
((
String
)
map
.
get
(
"equipCategory"
));
String
[]
UnitTypeArray
=
((
String
)
map
.
get
(
"unitType"
)).
split
(
"#"
);
for
(
int
i
=
0
;
i
<
UnitTypeArray
.
length
;
i
++){
String
unitTypeName
=
UnitTypeArray
[
i
];
for
(
int
j
=
0
;
j
<
equipCategoryArray
.
size
();
j
++){
if
(
dataMap
.
containsKey
(
unitTypeName
+
equipCategoryArray
.
get
(
j
))){
dataMap
.
put
(
unitTypeName
+
equipCategoryArray
.
get
(
j
),
dataMap
.
get
(
unitTypeName
+
equipCategoryArray
.
get
(
j
))+
1
);
}
else
{
dataMap
.
put
(
unitTypeName
+
equipCategoryArray
.
get
(
j
),
1
);
}
}
}
}
/**
* 4000 起重机械
* 3000 电梯
* 5000 场(厂)内机动车辆
* 1000 锅炉
* 2000 压力容器
* 6000 大型游乐设施(B类)
* 9000 客运索道
*企业数量:按单位类型及单位管理的设备进行统计(按设备类型收集制造单位数量,省、市-李静):八大类制造单位(不要气瓶)、电梯维保单位、八大类使用单位(不要气瓶)、气瓶充装单位、八大类安改维单位(不要气瓶)、八大类设计单位(不要气瓶)
* 1、设计单位只有压力容器设计和压力管道设计两类;(没有数据显示0)
* 3、安改维有锅炉、压力管道、电梯、起重机械、客运索道、场(厂)内专用机动车辆、大型游乐设施7类;
* 4、充装单位有移动式压力容器、气瓶两类(所有充装企业都统计为气瓶类型)
*/
//制造Map
Map
<
String
,
Object
>
zhizaoMap
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
zhizaoCompanyList
=
new
ArrayList
<>();
zhizaoMap
.
put
(
"key"
,
"zhizaoCompany"
);
zhizaoMap
.
put
(
"value"
,
"制造单位"
);
//制造电梯
Map
<
String
,
Object
>
zhizaodiantiMap
=
new
HashMap
<>();
zhizaodiantiMap
.
put
(
"key"
,
"key01"
);
zhizaodiantiMap
.
put
(
"name"
,
"电梯"
);
zhizaodiantiMap
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"制造单位3000"
,
0
));
zhizaoCompanyList
.
add
(
zhizaodiantiMap
);
//制造锅炉
Map
<
String
,
Object
>
zhizaoguoluMap
=
new
HashMap
<>();
zhizaoguoluMap
.
put
(
"key"
,
"key02"
);
zhizaoguoluMap
.
put
(
"name"
,
"锅炉"
);
zhizaoguoluMap
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"制造单位1000"
,
0
));
zhizaoCompanyList
.
add
(
zhizaoguoluMap
);
//制造锅炉
Map
<
String
,
Object
>
zhizaojidongcheMap
=
new
HashMap
<>();
zhizaojidongcheMap
.
put
(
"key"
,
"key03"
);
zhizaojidongcheMap
.
put
(
"name"
,
"场内机动车"
);
zhizaojidongcheMap
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"制造单位5000"
,
0
));
zhizaoCompanyList
.
add
(
zhizaojidongcheMap
);
//制造压力容器
Map
<
String
,
Object
>
zhizaoyalirongqiMap
=
new
HashMap
<>();
zhizaoyalirongqiMap
.
put
(
"key"
,
"key04"
);
zhizaoyalirongqiMap
.
put
(
"name"
,
"压力容器"
);
zhizaoyalirongqiMap
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"制造单位2000"
,
0
));
zhizaoCompanyList
.
add
(
zhizaoyalirongqiMap
);
//制造起重机械
Map
<
String
,
Object
>
zhizaoqizhongjixieMap
=
new
HashMap
<>();
zhizaoqizhongjixieMap
.
put
(
"key"
,
"key06"
);
zhizaoqizhongjixieMap
.
put
(
"name"
,
"起重机械"
);
zhizaoqizhongjixieMap
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"制造单位4000"
,
0
));
zhizaoCompanyList
.
add
(
zhizaoqizhongjixieMap
);
//制造游乐设施
Map
<
String
,
Object
>
zhizaoyoulesheshiMap
=
new
HashMap
<>();
zhizaoyoulesheshiMap
.
put
(
"key"
,
"key07"
);
zhizaoyoulesheshiMap
.
put
(
"name"
,
"大型游乐设施"
);
zhizaoyoulesheshiMap
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"制造单位6000"
,
0
));
zhizaoCompanyList
.
add
(
zhizaoyoulesheshiMap
);
//制造客运索道
Map
<
String
,
Object
>
zhizaokeyunsuodaoMap
=
new
HashMap
<>();
zhizaokeyunsuodaoMap
.
put
(
"key"
,
"key08"
);
zhizaokeyunsuodaoMap
.
put
(
"name"
,
"客运索道"
);
zhizaokeyunsuodaoMap
.
put
(
"value"
,
dataMap
.
getOrDefault
(
"制造单位9000"
,
0
));
zhizaoCompanyList
.
add
(
zhizaokeyunsuodaoMap
);
zhizaoMap
.
put
(
"data"
,
zhizaoCompanyList
);
return
null
;
}
}
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