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
bed5f414
Commit
bed5f414
authored
Jan 08, 2024
by
KeYong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
1de45ba6
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
130 additions
and
19 deletions
+130
-19
EmergencyController.java
...m/yeejoin/equipmanage/controller/EmergencyController.java
+47
-2
SocialPowerController.java
...yeejoin/equipmanage/controller/SocialPowerController.java
+28
-7
EmergencyMapper.java
.../java/com/yeejoin/equipmanage/mapper/EmergencyMapper.java
+1
-1
SocialPowerMapper.java
...ava/com/yeejoin/equipmanage/mapper/SocialPowerMapper.java
+3
-0
IEmergencyService.java
...va/com/yeejoin/equipmanage/service/IEmergencyService.java
+1
-1
ISocialPowerService.java
.../com/yeejoin/equipmanage/service/ISocialPowerService.java
+3
-0
EmergencyServiceImpl.java
...eejoin/equipmanage/service/impl/EmergencyServiceImpl.java
+2
-2
SocialPowerServiceImpl.java
...join/equipmanage/service/impl/SocialPowerServiceImpl.java
+7
-0
EmergencyMapper.xml
...ystem-equip/src/main/resources/mapper/EmergencyMapper.xml
+25
-6
SocialPowerMapper.xml
...tem-equip/src/main/resources/mapper/SocialPowerMapper.xml
+13
-0
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/EmergencyController.java
View file @
bed5f414
...
...
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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
;
import
com.yeejoin.equipmanage.common.entity.dto.FireResourceStatsDTO
;
import
com.yeejoin.equipmanage.common.utils.CommonResponseUtil
;
import
com.yeejoin.equipmanage.common.utils.DateUtils
;
import
com.yeejoin.equipmanage.config.PersonIdentify
;
...
...
@@ -25,6 +26,7 @@ import org.typroject.tyboot.core.foundation.context.RequestContext;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
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
java.math.BigDecimal
;
...
...
@@ -707,8 +709,51 @@ public class EmergencyController extends AbstractBaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
"应急物资及红绿码信息"
)
@GetMapping
(
value
=
"/materials"
)
public
Map
<
String
,
Object
>
getEmergencyMaterials
()
{
return
iEmergencyService
.
emergencyMaterials
();
public
ResponseModel
<
Object
>
getEmergencyMaterials
(
@RequestParam
(
required
=
false
)
String
bizOrgCode
)
{
if
(
StringUtils
.
isEmpty
(
bizOrgCode
))
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
bizOrgCode
=
!
ValidationUtil
.
isEmpty
(
reginParams
.
getPersonIdentity
())
&&
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotEmpty
(
reginParams
.
getPersonIdentity
().
getBizOrgCode
())
?
reginParams
.
getPersonIdentity
().
getBizOrgCode
()
:
null
;
}
Map
<
String
,
Object
>
emergencyMaterials
=
iEmergencyService
.
getEmergencyMaterials
(
bizOrgCode
);
FireResourceStatsDTO
fireExtinguisherDto
=
new
FireResourceStatsDTO
();
fireExtinguisherDto
.
setTotalCounts
(
Long
.
valueOf
(
String
.
valueOf
(
emergencyMaterials
.
get
(
"fireExtinguisher"
))));
fireExtinguisherDto
.
setYellowCounts
(
Long
.
valueOf
(
String
.
valueOf
(
emergencyMaterials
.
get
(
"fireExtinguisherYellowCount"
))));
fireExtinguisherDto
.
setRedCounts
(
Long
.
valueOf
(
String
.
valueOf
(
emergencyMaterials
.
get
(
"fireExtinguisherRedCount"
))));
FireResourceStatsDTO
fireHydrantDto
=
new
FireResourceStatsDTO
();
fireHydrantDto
.
setTotalCounts
(
Long
.
valueOf
(
String
.
valueOf
(
emergencyMaterials
.
get
(
"fireHydrant"
))));
fireHydrantDto
.
setYellowCounts
(
Long
.
valueOf
(
String
.
valueOf
(
emergencyMaterials
.
get
(
"fireHydrantYellowCount"
))));
fireHydrantDto
.
setRedCounts
(
Long
.
valueOf
(
String
.
valueOf
(
emergencyMaterials
.
get
(
"fireHydrantRedCount"
))));
FireResourceStatsDTO
fireShovelDto
=
new
FireResourceStatsDTO
();
fireShovelDto
.
setTotalCounts
(
Long
.
valueOf
(
String
.
valueOf
(
emergencyMaterials
.
get
(
"fireShovel"
))));
fireShovelDto
.
setYellowCounts
(
Long
.
valueOf
(
String
.
valueOf
(
emergencyMaterials
.
get
(
"fireShovelYellowCount"
))));
fireShovelDto
.
setRedCounts
(
Long
.
valueOf
(
String
.
valueOf
(
emergencyMaterials
.
get
(
"fireShovelRedCount"
))));
FireResourceStatsDTO
fireAxeDto
=
new
FireResourceStatsDTO
();
fireAxeDto
.
setTotalCounts
(
Long
.
valueOf
(
String
.
valueOf
(
emergencyMaterials
.
get
(
"fireAxe"
))));
fireAxeDto
.
setYellowCounts
(
Long
.
valueOf
(
String
.
valueOf
(
emergencyMaterials
.
get
(
"fireAxeYellowCount"
))));
fireAxeDto
.
setRedCounts
(
Long
.
valueOf
(
String
.
valueOf
(
emergencyMaterials
.
get
(
"fireAxeRedCount"
))));
FireResourceStatsDTO
fireBucketDto
=
new
FireResourceStatsDTO
();
fireBucketDto
.
setTotalCounts
(
Long
.
valueOf
(
String
.
valueOf
(
emergencyMaterials
.
get
(
"fireBucket"
))));
fireBucketDto
.
setYellowCounts
(
Long
.
valueOf
(
String
.
valueOf
(
emergencyMaterials
.
get
(
"fireBucketYellowCount"
))));
fireBucketDto
.
setRedCounts
(
Long
.
valueOf
(
String
.
valueOf
(
emergencyMaterials
.
get
(
"fireBucketRedCount"
))));
FireResourceStatsDTO
respiratorDto
=
new
FireResourceStatsDTO
();
respiratorDto
.
setTotalCounts
(
Long
.
valueOf
(
String
.
valueOf
(
emergencyMaterials
.
get
(
"respirator"
))));
respiratorDto
.
setYellowCounts
(
Long
.
valueOf
(
String
.
valueOf
(
emergencyMaterials
.
get
(
"respiratorYellowCount"
))));
respiratorDto
.
setRedCounts
(
Long
.
valueOf
(
String
.
valueOf
(
emergencyMaterials
.
get
(
"respiratorRedCount"
))));
Map
<
String
,
FireResourceStatsDTO
>
result
=
new
HashMap
<
String
,
FireResourceStatsDTO
>()
{{
put
(
"fireExtinguisher"
,
fireExtinguisherDto
);
put
(
"fireHydrant"
,
fireHydrantDto
);
put
(
"fireShovel"
,
fireShovelDto
);
put
(
"fireAxe"
,
fireAxeDto
);
put
(
"fireBucket"
,
fireBucketDto
);
put
(
"respirator"
,
respiratorDto
);
}};
return
ResponseHelper
.
buildResponse
(
result
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/SocialPowerController.java
View file @
bed5f414
...
...
@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import
com.yeejoin.equipmanage.common.dto.SocialPowerImportParam
;
import
com.yeejoin.equipmanage.common.entity.SocialPower
;
import
com.yeejoin.equipmanage.common.entity.UploadFile
;
import
com.yeejoin.equipmanage.common.entity.dto.FireResourceStatsDTO
;
import
com.yeejoin.equipmanage.common.utils.CommonRequest
;
import
com.yeejoin.equipmanage.common.utils.CommonResponseUtil
;
import
com.yeejoin.equipmanage.common.utils.FileItem
;
...
...
@@ -22,6 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.http.MediaType
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
...
...
@@ -65,8 +67,10 @@ public class SocialPowerController extends AbstractBaseController {
socialPower
.
setBizOrgCode
(
bizOrgCode
);
socialPower
.
setBizOrgName
(
bizOrgName
);
boolean
bool
=
socialPowerService
.
save
(
socialPower
);
if
(
0
<
socialPower
.
getAttachFiles
().
size
()
&&
bool
)
{
iUploadFileService
.
saveBatch
(
convertAttachFiles
(
socialPower
.
getAttachFiles
(),
socialPower
.
getId
()));
if
(!
CollectionUtils
.
isEmpty
(
socialPower
.
getAttachFiles
()))
{
if
(
0
<
socialPower
.
getAttachFiles
().
size
()
&&
bool
)
{
iUploadFileService
.
saveBatch
(
convertAttachFiles
(
socialPower
.
getAttachFiles
(),
socialPower
.
getId
()));
}
}
return
ResponseHelper
.
buildResponse
(
socialPower
);
}
...
...
@@ -82,11 +86,13 @@ public class SocialPowerController extends AbstractBaseController {
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据id更新社会力量"
,
notes
=
"根据id更新社会力量"
)
public
ResponseModel
<
SocialPower
>
updateByIdWlSocialPower
(
@RequestBody
SocialPower
model
)
{
boolean
bool
=
socialPowerService
.
updateById
(
model
);
if
(
0
<
model
.
getAttachFiles
().
size
()
&&
bool
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"object_id"
,
model
.
getId
());
iUploadFileService
.
removeByMap
(
map
);
iUploadFileService
.
saveBatch
(
convertAttachFiles
(
model
.
getAttachFiles
(),
model
.
getId
()));
if
(!
CollectionUtils
.
isEmpty
(
model
.
getAttachFiles
()))
{
if
(
0
<
model
.
getAttachFiles
().
size
()
&&
bool
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"object_id"
,
model
.
getId
());
iUploadFileService
.
removeByMap
(
map
);
iUploadFileService
.
saveBatch
(
convertAttachFiles
(
model
.
getAttachFiles
(),
model
.
getId
()));
}
}
return
ResponseHelper
.
buildResponse
(
model
);
}
...
...
@@ -284,4 +290,19 @@ public class SocialPowerController extends AbstractBaseController {
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"资源概览社会力量数据统计"
,
notes
=
"资源概览社会力量数据统计"
)
@GetMapping
(
value
=
"/statistics"
)
public
ResponseModel
getStatistics
(
@RequestParam
(
required
=
false
)
String
bizOrgCode
)
{
if
(
StringUtils
.
isEmpty
(
bizOrgCode
))
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
bizOrgCode
=
reginParams
.
getPersonIdentity
().
getBizOrgCode
();;
}
FireResourceStatsDTO
socialPowerStats
=
socialPowerService
.
getStatistics
(
bizOrgCode
);
Map
<
String
,
FireResourceStatsDTO
>
map
=
new
HashMap
<
String
,
FireResourceStatsDTO
>(){{
put
(
"socialPowerStats"
,
socialPowerStats
);
}};
return
ResponseHelper
.
buildResponse
(
map
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/EmergencyMapper.java
View file @
bed5f414
...
...
@@ -20,7 +20,7 @@ public interface EmergencyMapper extends BaseMapper{
*/
Map
<
String
,
Object
>
selectEmergencyMaterials
();
Map
<
String
,
Object
>
getEmergencyMaterials
();
Map
<
String
,
Object
>
getEmergencyMaterials
(
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
/**
* 应急物资详情
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/SocialPowerMapper.java
View file @
bed5f414
...
...
@@ -3,6 +3,7 @@ package com.yeejoin.equipmanage.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.equipmanage.common.entity.SocialPower
;
import
com.yeejoin.equipmanage.common.entity.dto.FireResourceStatsDTO
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
...
...
@@ -20,4 +21,6 @@ public interface SocialPowerMapper extends BaseMapper<SocialPower> {
Page
<
SocialPower
>
listPage
(
@Param
(
"page"
)
Page
page
,
@Param
(
"dto"
)
SocialPower
dto
);
List
<
Map
<
String
,
Object
>>
getSocialPowerList
();
FireResourceStatsDTO
getStatistics
(
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IEmergencyService.java
View file @
bed5f414
...
...
@@ -26,7 +26,7 @@ public interface IEmergencyService {
Map
<
String
,
Object
>
emergencyMaterials
();
Map
<
String
,
Object
>
getEmergencyMaterials
();
Map
<
String
,
Object
>
getEmergencyMaterials
(
String
bizOrgCode
);
Page
<
Map
<
String
,
Object
>>
emergencyMaterialsDetails
(
Page
<
Map
<
String
,
Object
>>
page
,
String
bizOrgCode
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/ISocialPowerService.java
View file @
bed5f414
...
...
@@ -4,6 +4,7 @@ package com.yeejoin.equipmanage.service;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yeejoin.equipmanage.common.entity.SocialPower
;
import
com.yeejoin.equipmanage.common.entity.dto.FireResourceStatsDTO
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -20,4 +21,6 @@ public interface ISocialPowerService extends IService<SocialPower> {
Page
<
SocialPower
>
listPage
(
Page
page
,
SocialPower
socialPower
);
List
<
Map
<
String
,
Object
>>
getSocialPowerList
();
FireResourceStatsDTO
getStatistics
(
String
bizOrgCode
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EmergencyServiceImpl.java
View file @
bed5f414
...
...
@@ -659,7 +659,7 @@ public class EmergencyServiceImpl implements IEmergencyService {
}
@Override
public
Map
<
String
,
Object
>
getEmergencyMaterials
()
{
return
emergencyMapper
.
getEmergencyMaterials
();
public
Map
<
String
,
Object
>
getEmergencyMaterials
(
String
bizOrgCode
)
{
return
emergencyMapper
.
getEmergencyMaterials
(
bizOrgCode
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/SocialPowerServiceImpl.java
View file @
bed5f414
...
...
@@ -3,6 +3,7 @@ package com.yeejoin.equipmanage.service.impl;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yeejoin.equipmanage.common.entity.SocialPower
;
import
com.yeejoin.equipmanage.common.entity.dto.FireResourceStatsDTO
;
import
com.yeejoin.equipmanage.mapper.SocialPowerMapper
;
import
com.yeejoin.equipmanage.service.ISocialPowerService
;
import
org.springframework.stereotype.Service
;
...
...
@@ -29,4 +30,9 @@ public class SocialPowerServiceImpl extends ServiceImpl<SocialPowerMapper, Socia
public
List
<
Map
<
String
,
Object
>>
getSocialPowerList
()
{
return
this
.
baseMapper
.
getSocialPowerList
();
}
@Override
public
FireResourceStatsDTO
getStatistics
(
String
bizOrgCode
)
{
return
this
.
baseMapper
.
getStatistics
(
bizOrgCode
);
}
}
\ No newline at end of file
amos-boot-system-equip/src/main/resources/mapper/EmergencyMapper.xml
View file @
bed5f414
...
...
@@ -1374,42 +1374,61 @@
COUNT( CASE WHEN wes.equip_status = '2' THEN 1 END ) AS fireExtinguisherRedCount
FROM
wl_equipment_specific wes
WHERE wes.equipment_code LIKE CONCAT('3104', '%')) AS fireExtinguisherStates,
WHERE wes.equipment_code LIKE CONCAT('3104', '%')
<if
test=
"bizOrgCode != null and bizOrgCode != ''"
>
and wes.biz_org_code like concat(#{bizOrgCode},'%')
</if>
) AS fireExtinguisherStates,
(SELECT
COUNT(1) AS fireHydrant,
COUNT( CASE WHEN wes.equip_status = '1' THEN 1 END ) AS fireHydrantYellowCount,
COUNT( CASE WHEN wes.equip_status = '2' THEN 1 END ) AS fireHydrantRedCount
FROM
wl_equipment_specific wes
WHERE wes.equipment_code LIKE CONCAT('3105', '%')) AS fireHydrantStates,
WHERE wes.equipment_code LIKE CONCAT('3105', '%')
<if
test=
"bizOrgCode != null and bizOrgCode != ''"
>
and wes.biz_org_code like concat(#{bizOrgCode},'%')
</if>
) AS fireHydrantStates,
(SELECT
COUNT(1) AS fireShovel,
COUNT( CASE WHEN wes.equip_status = '1' THEN 1 END ) AS fireShovelYellowCount,
COUNT( CASE WHEN wes.equip_status = '2' THEN 1 END ) AS fireShovelRedCount
FROM
wl_equipment_specific wes
WHERE wes.equipment_code LIKE CONCAT('3910', '%')) AS fireShovelStates,
WHERE wes.equipment_code LIKE CONCAT('3910', '%')
<if
test=
"bizOrgCode != null and bizOrgCode != ''"
>
and wes.biz_org_code like concat(#{bizOrgCode},'%')
</if>
) AS fireShovelStates,
(SELECT
COUNT(1) AS fireAxe,
COUNT( CASE WHEN wes.equip_status = '1' THEN 1 END ) AS fireAxeYellowCount,
COUNT( CASE WHEN wes.equip_status = '2' THEN 1 END ) AS fireAxeRedCount
FROM
wl_equipment_specific wes
WHERE wes.equipment_code LIKE CONCAT('3904', '%')) AS fireAxeStates,
WHERE wes.equipment_code LIKE CONCAT('3904', '%')
<if
test=
"bizOrgCode != null and bizOrgCode != ''"
>
and wes.biz_org_code like concat(#{bizOrgCode},'%')
</if>
) AS fireAxeStates,
(SELECT
COUNT(1) AS fireBucket,
COUNT( CASE WHEN wes.equip_status = '1' THEN 1 END ) AS fireBucketYellowCount,
COUNT( CASE WHEN wes.equip_status = '2' THEN 1 END ) AS fireBucketRedCount
FROM
wl_equipment_specific wes
WHERE wes.equipment_code LIKE CONCAT('3911', '%')) AS fireBucketStates,
WHERE wes.equipment_code LIKE CONCAT('3911', '%')
<if
test=
"bizOrgCode != null and bizOrgCode != ''"
>
and wes.biz_org_code like concat(#{bizOrgCode},'%')
</if>
) AS fireBucketStates,
(SELECT
COUNT(1) AS respirator,
COUNT( CASE WHEN wes.equip_status = '1' THEN 1 END ) AS respiratorYellowCount,
COUNT( CASE WHEN wes.equip_status = '2' THEN 1 END ) AS respiratorRedCount
FROM
wl_equipment_specific wes
WHERE wes.equipment_code LIKE CONCAT('1106', '%')) AS respiratorStates
WHERE wes.equipment_code LIKE CONCAT('1106', '%')
<if
test=
"bizOrgCode != null and bizOrgCode != ''"
>
and wes.biz_org_code like concat(#{bizOrgCode},'%')
</if>
) AS respiratorStates
)
</select>
</mapper>
amos-boot-system-equip/src/main/resources/mapper/SocialPowerMapper.xml
View file @
bed5f414
...
...
@@ -31,4 +31,17 @@
FROM
wl_social_power wsp
</select>
<select
id=
"getStatistics"
resultType=
"com.yeejoin.equipmanage.common.entity.dto.FireResourceStatsDTO"
>
SELECT
COUNT(1) AS totalCounts,
0 AS yellowCounts,
0 AS redCountsrr
FROM wl_social_power wsp
<where>
<if
test=
"bizOrgCode != null and bizOrgCode != ''"
>
wsp.biz_org_code like concat(#{bizOrgCode},'%')
</if>
</where>
</select>
</mapper>
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