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
ce550b94
Commit
ce550b94
authored
Jun 06, 2023
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、增加一码通总览数据表数据写入逻辑
2、修改一码通总览数据查询逻辑
parent
fa266b61
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
289 additions
and
25 deletions
+289
-25
EquipmentCategoryDataDto.java
...mos/boot/module/tzs/api/dto/EquipmentCategoryDataDto.java
+77
-0
EquipmentCategoryData.java
...mos/boot/module/tzs/api/entity/EquipmentCategoryData.java
+79
-0
EquipmentCategoryDataMapper.java
...ot/module/tzs/api/mapper/EquipmentCategoryDataMapper.java
+13
-0
EquipmentCategoryMapper.java
...s/boot/module/tzs/api/mapper/EquipmentCategoryMapper.java
+4
-0
IEquipmentCategoryService.java
...oot/module/tzs/api/service/IEquipmentCategoryService.java
+2
-0
EquipmentCategoryMapper.xml
...api/src/main/resources/mapper/EquipmentCategoryMapper.xml
+25
-0
EquipmentCategoryController.java
...odule/tzs/biz/controller/EquipmentCategoryController.java
+9
-0
EquipmentCategoryServiceImpl.java
...le/tzs/biz/service/impl/EquipmentCategoryServiceImpl.java
+64
-17
equipCategory.json
...module-tzs-biz/src/main/resources/json/equipCategory.json
+16
-8
No files found.
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/dto/EquipmentCategoryDataDto.java
0 → 100644
View file @
ce550b94
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
dto
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Data
;
/**
* 一码通总览数据统计
*
* @author system_generator
*/
@Data
@ApiModel
(
value
=
"EquipmentCategoryDataDto"
,
description
=
"一码通总览数据统计"
)
public
class
EquipmentCategoryDataDto
extends
BaseDto
{
/**
* 管辖分局组织机构代码
*/
@TableField
(
"org_code"
)
private
String
orgCode
;
/**
* 单位统一信用代码
*/
@TableField
(
"unit_code"
)
private
String
unitCode
;
/**
* 电梯
*/
@TableField
(
"elevator"
)
private
String
elevator
;
/**
* 厂车
*/
@TableField
(
"vehicle"
)
private
String
vehicle
;
/**
* 索道
*/
@TableField
(
"ropeway"
)
private
String
ropeway
;
/**
* 游乐设施
*/
@TableField
(
"rides"
)
private
String
rides
;
/**
* 锅炉
*/
@TableField
(
"boiler"
)
private
String
boiler
;
/**
* 压力容器
*/
@TableField
(
"vessel"
)
private
String
vessel
;
/**
* 压力管道
*/
@TableField
(
"pipeline"
)
private
String
pipeline
;
/**
* 起重机械
*/
@TableField
(
"lifting"
)
private
String
lifting
;
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/entity/EquipmentCategoryData.java
0 → 100644
View file @
ce550b94
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
/**
* 一码通总览数据统计表
* @author system_generator
*/
@Data
@Accessors
(
chain
=
true
)
@TableName
(
"biz_jg_equipment_category_data"
)
public
class
EquipmentCategoryData
extends
BaseEntity
{
/**
* 管辖分局组织机构代码
*/
@TableField
(
"org_code"
)
private
String
orgCode
;
/**
* 单位统一信用代码
*/
@TableField
(
"unit_code"
)
private
String
unitCode
;
/**
* 电梯
*/
@TableField
(
"elevator"
)
private
String
elevator
;
/**
* 厂车
*/
@TableField
(
"vehicle"
)
private
String
vehicle
;
/**
* 索道
*/
@TableField
(
"ropeway"
)
private
String
ropeway
;
/**
* 游乐设施
*/
@TableField
(
"rides"
)
private
String
rides
;
/**
* 锅炉
*/
@TableField
(
"boiler"
)
private
String
boiler
;
/**
* 压力容器
*/
@TableField
(
"vessel"
)
private
String
vessel
;
/**
* 压力管道
*/
@TableField
(
"pipeline"
)
private
String
pipeline
;
/**
* 起重机械
*/
@TableField
(
"lifting"
)
private
String
lifting
;
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/mapper/EquipmentCategoryDataMapper.java
0 → 100644
View file @
ce550b94
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.EquipmentCategoryData
;
/**
* 一码通总览数据统计
*
* @author system_generator
*/
public
interface
EquipmentCategoryDataMapper
extends
BaseMapper
<
EquipmentCategoryData
>
{
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/mapper/EquipmentCategoryMapper.java
View file @
ce550b94
...
...
@@ -35,4 +35,8 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
Map
<
String
,
Object
>
getCategoryAndDefineByRecord
(
@Param
(
"record"
)
String
record
);
List
<
Map
<
String
,
Object
>>
getAllUnit
();
List
<
Map
<
String
,
Object
>>
getCategoryData
(
String
level
,
String
orgCode
,
String
companyCode
);
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/service/IEquipmentCategoryService.java
View file @
ce550b94
...
...
@@ -36,4 +36,6 @@ public interface IEquipmentCategoryService {
Map
<
String
,
Map
<
String
,
Object
>>
getFormRecordById
(
Map
<
String
,
Object
>
map
);
void
checkEsData
(
String
id
);
List
<
Map
<
String
,
Object
>>
createEquipmentCategoryData
();
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/resources/mapper/EquipmentCategoryMapper.xml
View file @
ce550b94
...
...
@@ -147,4 +147,29 @@
WHERE
"RECORD" = #{record}
</select>
<select
id=
"getAllUnit"
resultType=
"java.util.Map"
>
SELECT DISTINCT(use_code) ,supervise_org_code FROM "tz_base_enterprise_info"
</select>
<select
id=
"getCategoryData"
resultType=
"java.util.Map"
>
SELECT
elevator,
lifting,
vehicle,
boiler,
vessel,
pipeline,
rides,
ropeway
FROM
biz_jg_equipment_category_data bjecd
WHERE
<if
test=
"level == 'company'"
>
bjecd."unit_code" LIKE CONCAT('%',#{companyCode},'%')
</if>
<if
test=
"level != 'company'"
>
bjecd."org_code" LIKE CONCAT('%',#{orgCode},'%')
</if>
</select>
</mapper>
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/EquipmentCategoryController.java
View file @
ce550b94
...
...
@@ -242,6 +242,15 @@ public class EquipmentCategoryController extends BaseController {
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/createEquipmentCategoryData"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"get"
,
value
=
"初始化一码通总览数据"
,
notes
=
"初始化一码通总览数据"
)
public
ResponseModel
<
Object
>
createEquipmentCategoryData
(){
return
ResponseHelper
.
buildResponse
(
equipmentCategoryService
.
createEquipmentCategoryData
());
}
/**
* 获取管辖分局树
*
...
...
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/EquipmentCategoryServiceImpl.java
View file @
ce550b94
...
...
@@ -2,10 +2,10 @@ package com.yeejoin.amos.boot.module.tzs.biz.service.impl;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.TypeReference
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.CompanyBo
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
...
...
@@ -16,20 +16,14 @@ import com.yeejoin.amos.boot.module.tzs.api.entity.*;
import
com.yeejoin.amos.boot.module.tzs.api.enums.EquimentEnum
;
import
com.yeejoin.amos.boot.module.tzs.api.enums.EquipmentCategoryEnum
;
import
com.yeejoin.amos.boot.module.tzs.api.enums.EquipmentClassifityEnum
;
import
com.yeejoin.amos.boot.module.tzs.api.mapper.CategoryOtherInfoMapper
;
import
com.yeejoin.amos.boot.module.tzs.api.mapper.EquipmentCategoryMapper
;
import
com.yeejoin.amos.boot.module.tzs.api.mapper.SuperviseInfoMapper
;
import
com.yeejoin.amos.boot.module.tzs.api.mapper.SupervisoryCodeInfoMapper
;
import
com.yeejoin.amos.boot.module.tzs.api.mapper.*
;
import
com.yeejoin.amos.boot.module.tzs.api.service.IEquipmentCategoryService
;
import
com.yeejoin.amos.boot.module.tzs.biz.dao.ESCylinderFillingRecordRepository
;
import
com.yeejoin.amos.boot.module.tzs.biz.dao.ESEquipmentCategory
;
import
com.yeejoin.amos.boot.module.tzs.biz.utils.JsonUtils
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.feign.IdxFeignService
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.feign.PrivilegeFeginService
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
io.netty.util.internal.ObjectUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.http.HttpHost
;
import
org.apache.http.auth.AuthScope
;
...
...
@@ -46,12 +40,10 @@ import org.elasticsearch.client.RestHighLevelClient;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.elasticsearch.search.builder.SearchSourceBuilder
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.core.io.Resource
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.Assert
;
import
org.springframework.util.ObjectUtils
;
...
...
@@ -185,15 +177,19 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
String
level
=
reginParams
.
getUserModel
().
getCompanys
().
get
(
0
).
getLevel
();
String
orgCode
=
reginParams
.
getUserModel
().
getCompanys
().
get
(
0
).
getOrgCode
();
String
companyCode
=
reginParams
.
getUserModel
().
getCompanys
().
get
(
0
).
getCompanyCode
();
List
<
Map
<
String
,
Object
>>
listMap
=
equipmentCategoryMapper
.
getCategory
Count
(
level
,
orgCode
,
companyCode
);
List
<
Map
<
String
,
Object
>>
listMap
=
equipmentCategoryMapper
.
getCategory
Data
(
level
,
orgCode
,
companyCode
);
for
(
Map
<
String
,
Object
>
map
:
mapList
)
{
for
(
Map
<
String
,
Object
>
map1
:
listMap
)
{
if
(
map
.
get
(
"code"
).
equals
(
map1
.
get
(
"category"
)))
{
map
.
put
(
"waitClaim"
,
map1
.
get
(
"waitClaim"
));
map
.
put
(
"alreadyClaim"
,
map1
.
get
(
"alreadyClaim"
));
map
.
put
(
"refuseClaim"
,
map1
.
get
(
"refuseClaim"
));
Long
sum
=
Long
.
valueOf
(
map1
.
get
(
"waitClaim"
).
toString
())
+
Long
.
valueOf
(
map1
.
get
(
"alreadyClaim"
).
toString
())
+
Long
.
valueOf
(
map1
.
get
(
"refuseClaim"
).
toString
());
map
.
put
(
"sum"
,
sum
);
for
(
String
s
:
map1
.
keySet
())
{
HashMap
<
String
,
Object
>
jsonMap
=
JSON
.
parseObject
(
map1
.
get
(
s
).
toString
(),
new
TypeReference
<
HashMap
<
String
,
Object
>>()
{
});
if
(
s
.
equals
(
map
.
get
(
"type"
)))
{
map
.
put
(
"waitClaim"
,
Long
.
valueOf
(
map
.
get
(
"waitClaim"
).
toString
())
+
Long
.
valueOf
(
jsonMap
.
get
(
"waitClaim"
).
toString
()));
map
.
put
(
"alreadyClaim"
,
Long
.
valueOf
(
map
.
get
(
"alreadyClaim"
).
toString
())
+
Long
.
valueOf
(
jsonMap
.
get
(
"alreadyClaim"
).
toString
()));
map
.
put
(
"refuseClaim"
,
Long
.
valueOf
(
map
.
get
(
"refuseClaim"
).
toString
())
+
Long
.
valueOf
(
jsonMap
.
get
(
"refuseClaim"
).
toString
()));
Long
sum
=
Long
.
valueOf
(
jsonMap
.
get
(
"waitClaim"
).
toString
())
+
Long
.
valueOf
(
jsonMap
.
get
(
"alreadyClaim"
).
toString
())
+
Long
.
valueOf
(
jsonMap
.
get
(
"refuseClaim"
).
toString
());
map
.
put
(
"sum"
,
Long
.
valueOf
(
map
.
get
(
"sum"
).
toString
())
+
sum
);
}
}
}
list
.
add
(
map
);
...
...
@@ -778,6 +774,57 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
}
}
@Autowired
EquipmentCategoryDataMapper
equipmentCategoryDataMapper
;
@Override
public
List
<
Map
<
String
,
Object
>>
createEquipmentCategoryData
()
{
List
<
Map
<
String
,
Object
>>
allUnitList
=
equipmentCategoryMapper
.
getAllUnit
();
for
(
Map
<
String
,
Object
>
map
:
allUnitList
)
{
EquipmentCategoryData
equipmentCategoryData
=
new
EquipmentCategoryData
();
equipmentCategoryData
.
setOrgCode
(
map
.
get
(
"supervise_org_code"
).
toString
());
equipmentCategoryData
.
setUnitCode
(
map
.
get
(
"use_code"
).
toString
());
List
<
Map
<
String
,
Object
>>
listMap
=
equipmentCategoryMapper
.
getCategoryCount
(
"company"
,
null
,
map
.
get
(
"use_code"
).
toString
());
for
(
Map
<
String
,
Object
>
dataMap
:
listMap
)
{
Map
<
String
,
Object
>
data
=
new
HashMap
<>();
data
.
put
(
"waitClaim"
,
dataMap
.
get
(
"waitClaim"
));
data
.
put
(
"alreadyClaim"
,
dataMap
.
get
(
"alreadyClaim"
));
data
.
put
(
"refuseClaim"
,
dataMap
.
get
(
"refuseClaim"
));
JSONObject
jsonObject
=
new
JSONObject
(
data
);
switch
(
dataMap
.
get
(
"category"
).
toString
())
{
case
"1000"
:
equipmentCategoryData
.
setBoiler
(
jsonObject
+
""
);
break
;
case
"2000"
:
equipmentCategoryData
.
setVessel
(
jsonObject
+
""
);
break
;
case
"3000"
:
equipmentCategoryData
.
setElevator
(
jsonObject
+
""
);
break
;
case
"4000"
:
equipmentCategoryData
.
setLifting
(
jsonObject
+
""
);
break
;
case
"5000"
:
equipmentCategoryData
.
setVehicle
(
jsonObject
+
""
);
break
;
case
"6000"
:
equipmentCategoryData
.
setRides
(
jsonObject
+
""
);
break
;
case
"8000"
:
equipmentCategoryData
.
setPipeline
(
jsonObject
+
""
);
break
;
case
"9000"
:
equipmentCategoryData
.
setRopeway
(
jsonObject
+
""
);
break
;
}
}
int
insert
=
equipmentCategoryDataMapper
.
insert
(
equipmentCategoryData
);
System
.
out
.
println
(
insert
);
}
return
null
;
}
//分页查询所有数据
public
Page
<
Map
<
String
,
Object
>>
getAll
(
Map
<
String
,
Object
>
map
)
{
...
...
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/resources/json/equipCategory.json
View file @
ce550b94
...
...
@@ -7,7 +7,8 @@
"waitClaim"
:
"0"
,
"alreadyClaim"
:
"0"
,
"refuseClaim"
:
"0"
,
"sum"
:
"0"
"sum"
:
"0"
,
"type"
:
"elevator"
},
{
"name"
:
"起重机械"
,
...
...
@@ -16,7 +17,8 @@
"waitClaim"
:
"0"
,
"alreadyClaim"
:
"0"
,
"refuseClaim"
:
"0"
,
"sum"
:
"0"
"sum"
:
"0"
,
"type"
:
"lifting"
},
{
"name"
:
"场内机动车辆"
,
...
...
@@ -25,7 +27,8 @@
"waitClaim"
:
"0"
,
"alreadyClaim"
:
"0"
,
"refuseClaim"
:
"0"
,
"sum"
:
"0"
"sum"
:
"0"
,
"type"
:
"vehicle"
},
{
"name"
:
"锅炉"
,
...
...
@@ -34,7 +37,8 @@
"waitClaim"
:
"0"
,
"alreadyClaim"
:
"0"
,
"refuseClaim"
:
"0"
,
"sum"
:
"0"
"sum"
:
"0"
,
"type"
:
"boiler"
},
{
"name"
:
"压力容器"
,
...
...
@@ -43,7 +47,8 @@
"waitClaim"
:
"0"
,
"alreadyClaim"
:
"0"
,
"refuseClaim"
:
"0"
,
"sum"
:
"0"
"sum"
:
"0"
,
"type"
:
"vessel"
},
{
"name"
:
"压力管道"
,
...
...
@@ -52,7 +57,8 @@
"waitClaim"
:
"0"
,
"alreadyClaim"
:
"0"
,
"refuseClaim"
:
"0"
,
"sum"
:
"0"
"sum"
:
"0"
,
"type"
:
"pipeline"
},
{
"name"
:
"大型游乐设施"
,
...
...
@@ -61,7 +67,8 @@
"waitClaim"
:
"0"
,
"alreadyClaim"
:
"0"
,
"refuseClaim"
:
"0"
,
"sum"
:
"0"
"sum"
:
"0"
,
"type"
:
"rides"
},
{
"name"
:
"客运索道"
,
...
...
@@ -70,7 +77,8 @@
"waitClaim"
:
"0"
,
"alreadyClaim"
:
"0"
,
"refuseClaim"
:
"0"
,
"sum"
:
"0"
"sum"
:
"0"
,
"type"
:
"ropeway"
}
],
"other"
:
[
...
...
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