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
5b66aa10
Commit
5b66aa10
authored
Mar 10, 2023
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改扫描bug
parent
517cb0b8
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
114 additions
and
287 deletions
+114
-287
IndexLogsRequest.java
...ejoin/equipmanage/common/entity/dto/IndexLogsRequest.java
+8
-3
IEquipmentSpecificAlarmLogService.java
...quipmanage/service/IEquipmentSpecificAlarmLogService.java
+1
-1
EquipmentSpecificAlarmLogServiceImpl.java
...ge/service/impl/EquipmentSpecificAlarmLogServiceImpl.java
+12
-44
NoServiceImpl.java
.../amos/boot/module/jcs/biz/service/impl/NoServiceImpl.java
+1
-1
OrganizationImpl.java
...os/boot/module/jcs/biz/service/impl/OrganizationImpl.java
+18
-57
OrganizationUserImpl.java
...oot/module/jcs/biz/service/impl/OrganizationUserImpl.java
+0
-1
PowerTransferCompanyResourcesServiceImpl.java
...ervice/impl/PowerTransferCompanyResourcesServiceImpl.java
+12
-7
PowerTransferServiceImpl.java
...module/jcs/biz/service/impl/PowerTransferServiceImpl.java
+52
-165
PowerrTransferLogServiceImpl.java
...le/jcs/biz/service/impl/PowerrTransferLogServiceImpl.java
+4
-4
RuleAlertCalledService.java
...t/module/jcs/biz/service/impl/RuleAlertCalledService.java
+5
-3
FireFightingSystemMapper.xml
...ip/src/main/resources/mapper/FireFightingSystemMapper.xml
+1
-1
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/dto/IndexLogsRequest.java
View file @
5b66aa10
...
@@ -15,12 +15,17 @@ public class IndexLogsRequest {
...
@@ -15,12 +15,17 @@ public class IndexLogsRequest {
private
String
timeStart
;
private
String
timeStart
;
private
String
timeEnd
;
private
String
timeEnd
;
private
String
fieldKey
;
private
String
fieldKey
;
private
String
equipmentIndex
;
private
Long
page
;
private
Long
total
;
private
Long
size
;
public
IndexLogsRequest
(
String
iotCode
,
String
timeStart
,
String
timeEnd
,
String
fieldKey
)
{
public
IndexLogsRequest
(
String
timeStart
,
String
timeEnd
,
String
equipmentIndex
,
Long
page
,
Long
size
)
{
this
.
iotCode
=
iotCode
;
this
.
timeStart
=
timeStart
;
this
.
timeStart
=
timeStart
;
this
.
timeEnd
=
timeEnd
;
this
.
timeEnd
=
timeEnd
;
this
.
fieldKey
=
fieldKey
;
this
.
equipmentIndex
=
equipmentIndex
;
this
.
page
=
page
;
this
.
size
=
size
;
}
}
public
IndexLogsRequest
()
{
public
IndexLogsRequest
()
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IEquipmentSpecificAlarmLogService.java
View file @
5b66aa10
...
@@ -61,5 +61,5 @@ public interface IEquipmentSpecificAlarmLogService extends IService<EquipmentSpe
...
@@ -61,5 +61,5 @@ public interface IEquipmentSpecificAlarmLogService extends IService<EquipmentSpe
* endTime:结束时间
* endTime:结束时间
* @return
* @return
*/
*/
Page
<
EquipmentAlarmLogDto
>
getEquipAlarmLog
(
String
id
,
String
startTime
,
String
endTime
,
int
pageSize
,
int
current
);
Page
<
EquipmentAlarmLogDto
>
getEquipAlarmLog
(
String
id
,
String
startTime
,
String
endTime
,
long
pageSize
,
long
current
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentSpecificAlarmLogServiceImpl.java
View file @
5b66aa10
package
com
.
yeejoin
.
equipmanage
.
service
.
impl
;
package
com
.
yeejoin
.
equipmanage
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
...
@@ -9,7 +8,6 @@ import com.google.common.collect.Lists;
...
@@ -9,7 +8,6 @@ import com.google.common.collect.Lists;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarm
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarm
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarmLog
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarmLog
;
import
com.yeejoin.equipmanage.common.entity.FireFightingSystemEntity
;
import
com.yeejoin.equipmanage.common.entity.FireFightingSystemEntity
;
import
com.yeejoin.equipmanage.common.entity.OrgUsr
;
import
com.yeejoin.equipmanage.common.entity.dto.EquipmentAlarmLogDto
;
import
com.yeejoin.equipmanage.common.entity.dto.EquipmentAlarmLogDto
;
import
com.yeejoin.equipmanage.common.entity.dto.IndexLogsRequest
;
import
com.yeejoin.equipmanage.common.entity.dto.IndexLogsRequest
;
import
com.yeejoin.equipmanage.common.entity.vo.EquiplistSpecificBySystemVO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquiplistSpecificBySystemVO
;
...
@@ -94,7 +92,7 @@ public class EquipmentSpecificAlarmLogServiceImpl extends ServiceImpl<EquipmentS
...
@@ -94,7 +92,7 @@ public class EquipmentSpecificAlarmLogServiceImpl extends ServiceImpl<EquipmentS
}
}
@Override
@Override
public
Page
<
EquipmentAlarmLogDto
>
getEquipAlarmLog
(
String
code
,
String
startTime
,
String
endTime
,
int
pageSize
,
int
current
)
{
public
Page
<
EquipmentAlarmLogDto
>
getEquipAlarmLog
(
String
code
,
String
startTime
,
String
endTime
,
long
pageSize
,
long
current
)
{
Page
<
EquipmentAlarmLogDto
>
pageBean
=
new
Page
<
EquipmentAlarmLogDto
>(
current
,
pageSize
);
Page
<
EquipmentAlarmLogDto
>
pageBean
=
new
Page
<
EquipmentAlarmLogDto
>(
current
,
pageSize
);
QueryWrapper
<
FireFightingSystemEntity
>
wrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
FireFightingSystemEntity
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"code"
,
code
);
wrapper
.
eq
(
"code"
,
code
);
...
@@ -105,16 +103,14 @@ public class EquipmentSpecificAlarmLogServiceImpl extends ServiceImpl<EquipmentS
...
@@ -105,16 +103,14 @@ public class EquipmentSpecificAlarmLogServiceImpl extends ServiceImpl<EquipmentS
String
id
=
sys
.
getId
().
toString
();
String
id
=
sys
.
getId
().
toString
();
//iotcode集合
//iotcode集合
List
<
String
>
iotCodes
=
new
ArrayList
<>();
List
<
String
>
iotCodes
=
new
ArrayList
<>();
//装备名称集合
Map
<
String
,
String
>
mapcode
=
new
HashMap
<>();
//物联参数判断集合
//物联参数判断集合
Map
<
String
,
EquiplistSpecificBySystemVO
>
mapkey
=
new
HashMap
<>();
Map
<
String
,
EquiplistSpecificBySystemVO
>
mapkey
=
new
HashMap
<>();
//存储整理后的数据
//存储整理后的数据
List
<
EquipmentAlarmLogDto
>
listDate
=
new
ArrayList
<>();
List
<
EquipmentAlarmLogDto
>
listDate
=
new
ArrayList
<>();
//获取系统下所有装备组装数据
this
.
getEquiplistBySystemId
(
id
,
iotCodes
,
mapcode
);
//获取系统下所有装备物联指标
//获取系统下所有装备物联指标
this
.
getEquiplistBySystemIdList
(
id
,
mapkey
);
this
.
getEquiplistBySystemIdList
(
id
,
mapkey
,
iotCodes
);
//装备为空返回空
//装备为空返回空
if
(
iotCodes
.
isEmpty
()||
mapkey
.
isEmpty
()){
if
(
iotCodes
.
isEmpty
()||
mapkey
.
isEmpty
()){
return
pageBean
;
return
pageBean
;
...
@@ -123,7 +119,7 @@ public class EquipmentSpecificAlarmLogServiceImpl extends ServiceImpl<EquipmentS
...
@@ -123,7 +119,7 @@ public class EquipmentSpecificAlarmLogServiceImpl extends ServiceImpl<EquipmentS
endTime
=
endTime
.
replace
(
"00:00:00"
,
"23:59:59"
);
endTime
=
endTime
.
replace
(
"00:00:00"
,
"23:59:59"
);
IndexLogsRequest
indexLogsRequest
=
new
IndexLogsRequest
(
iotCode
,
startTime
,
endTime
,
null
);
IndexLogsRequest
indexLogsRequest
=
new
IndexLogsRequest
(
startTime
,
endTime
,
iotCode
,
current
,
pageSize
);
//调用iot 获取数据
//调用iot 获取数据
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
date
=
iotFeign
.
getEquipAlarmLog
(
indexLogsRequest
);
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
date
=
iotFeign
.
getEquipAlarmLog
(
indexLogsRequest
);
...
@@ -140,63 +136,35 @@ public class EquipmentSpecificAlarmLogServiceImpl extends ServiceImpl<EquipmentS
...
@@ -140,63 +136,35 @@ public class EquipmentSpecificAlarmLogServiceImpl extends ServiceImpl<EquipmentS
if
(
mapkey
.
containsKey
(
key
)){
if
(
mapkey
.
containsKey
(
key
)){
EquipmentAlarmLogDto
da
=
new
EquipmentAlarmLogDto
();
EquipmentAlarmLogDto
da
=
new
EquipmentAlarmLogDto
();
da
.
setId
(
UUID
.
randomUUID
().
toString
());
da
.
setId
(
UUID
.
randomUUID
().
toString
());
da
.
setName
(
map
code
.
get
(
map
.
get
(
"iotCode"
).
toString
()
));
da
.
setName
(
map
key
.
get
(
key
).
getEquipmentName
(
));
da
.
setTime
(
map
.
get
(
"createdTime"
).
toString
());
da
.
setTime
(
map
.
get
(
"createdTime"
).
toString
());
String
value
=
map
.
get
(
"indexValue"
).
toString
();
String
value
=
map
.
get
(
"indexValue"
).
toString
();
value
=
getReadableStatus
(
value
);
value
=
getReadableStatus
(
value
);
da
.
setContent
(
mapkey
.
get
(
key
).
getIndexName
()+
":"
+
value
);
da
.
setContent
(
mapkey
.
get
(
key
).
getIndexName
()+
":"
+
value
);
listDate
.
add
(
da
);
listDate
.
add
(
da
);
}
}
}
}
}
}
pageBean
.
setTotal
(
listDate
.
size
());
pageBean
.
setTotal
(
listDate
.
size
());
pageBean
.
setRecords
(
listDate
);
pageBean
.
setRecords
(
listDate
);
return
pageBean
;
return
pageBean
;
}
}
public
String
getReadableStatus
(
String
value
)
{
public
String
getReadableStatus
(
String
value
)
{
if
(
"true"
.
equals
(
value
)){
if
(
"true"
.
equals
(
value
)){
return
"是"
;
return
"是"
;
}
return
"false"
.
equals
(
value
)?
"否"
:
value
;
}
/**
* 获取系统下装备,并组装数据
*
* @param id:系统id iotCodes:装备iot集合
*
* map:key:iotcode,value:装备名称
* @param
* @return
*/
public
void
getEquiplistBySystemId
(
String
id
,
List
<
String
>
iotCodes
,
Map
<
String
,
String
>
map
)
{
//获取系统下所有装备
List
<
EquiplistSpecificBySystemVO
>
list
=
fireFightingSystemMapper
.
getEquiplistBySystemId
(
Long
.
valueOf
(
id
));
if
(!
list
.
isEmpty
())
{
for
(
EquiplistSpecificBySystemVO
equiplistSpecificBySystemVO
:
list
)
{
if
(
equiplistSpecificBySystemVO
.
getIotCode
()
!=
null
)
{
iotCodes
.
add
(
equiplistSpecificBySystemVO
.
getIotCode
());
map
.
put
(
equiplistSpecificBySystemVO
.
getIotCode
(),
equiplistSpecificBySystemVO
.
getEquipmentName
());
}
}
}
}
return
"false"
.
equals
(
value
)?
"否"
:
value
;
}
}
public
void
getEquiplistBySystemIdList
(
String
id
,
Map
<
String
,
EquiplistSpecificBySystemVO
>
map
,
List
<
String
>
iotCodes
)
{
public
void
getEquiplistBySystemIdList
(
String
id
,
Map
<
String
,
EquiplistSpecificBySystemVO
>
map
)
{
//获取系统下所有装备
//获取系统下所有装备
List
<
EquiplistSpecificBySystemVO
>
list
=
fireFightingSystemMapper
.
getEquiplistBySystemIdList
(
Long
.
valueOf
(
id
));
List
<
EquiplistSpecificBySystemVO
>
list
=
fireFightingSystemMapper
.
getEquiplistBySystemIdList
(
Long
.
valueOf
(
id
));
if
(!
list
.
isEmpty
())
{
if
(!
list
.
isEmpty
())
{
for
(
EquiplistSpecificBySystemVO
equiplistSpecificBySystemVO
:
list
)
{
for
(
EquiplistSpecificBySystemVO
equiplistSpecificBySystemVO
:
list
)
{
map
.
put
(
equiplistSpecificBySystemVO
.
getIotCode
()+
equiplistSpecificBySystemVO
.
getIndexKey
(),
equiplistSpecificBySystemVO
);
map
.
put
(
equiplistSpecificBySystemVO
.
getIotCode
()+
equiplistSpecificBySystemVO
.
getIndexKey
(),
equiplistSpecificBySystemVO
);
iotCodes
.
add
(
equiplistSpecificBySystemVO
.
getIotCode
()+
equiplistSpecificBySystemVO
.
getIndexKey
());
}
}
}
}
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/NoServiceImpl.java
View file @
5b66aa10
...
@@ -19,7 +19,7 @@ public class NoServiceImpl implements IHomePageService {
...
@@ -19,7 +19,7 @@ public class NoServiceImpl implements IHomePageService {
@Autowired
@Autowired
EquipFeignClient
quipFeignClient
;
EquipFeignClient
quipFeignClient
;
private
static
EquipFeignClient
quipFeignClient1
;
private
EquipFeignClient
quipFeignClient1
;
@PostConstruct
@PostConstruct
public
void
init
(){
public
void
init
(){
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/OrganizationImpl.java
View file @
5b66aa10
...
@@ -35,6 +35,8 @@ public class OrganizationImpl extends BaseService<Organization,Organization, Org
...
@@ -35,6 +35,8 @@ public class OrganizationImpl extends BaseService<Organization,Organization, Org
@Autowired
@Autowired
private
OrganizationUserMapper
organizationUserMapper
;
private
OrganizationUserMapper
organizationUserMapper
;
private
static
String
NAME
=
"组员信息表第"
;
@Override
@Override
public
Page
<
Map
<
String
,
Object
>>
getOrganizationInfo
(
Page
<
Map
<
String
,
Object
>>
page
,
String
bizOrgCode
)
{
public
Page
<
Map
<
String
,
Object
>>
getOrganizationInfo
(
Page
<
Map
<
String
,
Object
>>
page
,
String
bizOrgCode
)
{
return
organizationMapper
.
getOrganizationInfo
(
page
,
bizOrgCode
);
return
organizationMapper
.
getOrganizationInfo
(
page
,
bizOrgCode
);
...
@@ -42,20 +44,7 @@ public class OrganizationImpl extends BaseService<Organization,Organization, Org
...
@@ -42,20 +44,7 @@ public class OrganizationImpl extends BaseService<Organization,Organization, Org
@Override
@Override
public
Page
<
Map
<
String
,
Object
>>
getOrganizationList
(
Page
<
Map
<
String
,
Object
>>
page
,
String
bizOrgCode
)
{
public
Page
<
Map
<
String
,
Object
>>
getOrganizationList
(
Page
<
Map
<
String
,
Object
>>
page
,
String
bizOrgCode
)
{
// Page<Map<String, Object>> groupPage = new Page<>();
// Page<Map<String, Object>> group = organizationMapper.getOrganizationGroup(groupPage, bizOrgCode);
// Page<Map<String, Object>> mapPage = organizationMapper.getOrganizationList(page, bizOrgCode);
// List<Map<String, Object>> records = group.getRecords();
// ArrayList<Map<String, Object>> result = new ArrayList<>();
// for (Map<String, Object> record : records) {
//
// List<Map<String, Object>> collect = mapPage.getRecords().stream().filter(item -> String.valueOf(record.get("id")).equals(String.valueOf(item.get("groupId")))).collect(Collectors.toList());
// record.put("persons", collect);
// result.add(record);
//
// }
// mapPage.setRecords(result);
// return mapPage;
return
organizationMapper
.
getOrganizationList
(
page
,
bizOrgCode
);
return
organizationMapper
.
getOrganizationList
(
page
,
bizOrgCode
);
}
}
...
@@ -74,12 +63,12 @@ public class OrganizationImpl extends BaseService<Organization,Organization, Org
...
@@ -74,12 +63,12 @@ public class OrganizationImpl extends BaseService<Organization,Organization, Org
public
void
saveOrganization
(
List
<
OrganizationExportDto
>
data
,
List
<
OrganizationUserExportDto
>
userData
,
String
bizOrgCode
)
{
public
void
saveOrganization
(
List
<
OrganizationExportDto
>
data
,
List
<
OrganizationUserExportDto
>
userData
,
String
bizOrgCode
)
{
//由于可以单独导入组,或者单独导入人,只做都为空效验
//由于可以单独导入组,或者单独导入人,只做都为空效验
if
(
data
==
null
&&
userData
==
null
){
if
(
data
==
null
&&
userData
==
null
&&
data
.
size
()>
0
&&
userData
.
size
()>
0
){
throw
new
BadRequest
(
"请填入数据导入!"
);
throw
new
BadRequest
(
"请填入数据导入!"
);
}
}
//对分组数据入库
//对分组数据入库
if
(
data
.
size
()>
0
){
int
sort
=
organizationMapper
.
selectMaxSort
();
int
sort
1
=
organizationMapper
.
selectMaxSort
();
checkOrganizationData
(
data
);
checkOrganizationData
(
data
);
for
(
OrganizationExportDto
dto
:
data
)
{
for
(
OrganizationExportDto
dto
:
data
)
{
LambdaQueryWrapper
<
Organization
>
lambda
=
new
QueryWrapper
<
Organization
>().
lambda
();
LambdaQueryWrapper
<
Organization
>
lambda
=
new
QueryWrapper
<
Organization
>().
lambda
();
...
@@ -89,18 +78,16 @@ public class OrganizationImpl extends BaseService<Organization,Organization, Org
...
@@ -89,18 +78,16 @@ public class OrganizationImpl extends BaseService<Organization,Organization, Org
Organization
organization
=
new
Organization
();
Organization
organization
=
new
Organization
();
if
(
CollectionUtils
.
isEmpty
(
organizations
)){
if
(
CollectionUtils
.
isEmpty
(
organizations
)){
BeanUtils
.
copyProperties
(
dto
,
organization
);
BeanUtils
.
copyProperties
(
dto
,
organization
);
sort
=
sort
+
1
;
sort
1
=
sort1
+
1
;
organization
.
setSort
(
sort
);
organization
.
setSort
(
sort
1
);
organization
.
setBizOrgCode
(
bizOrgCode
);
organization
.
setBizOrgCode
(
bizOrgCode
);
organizationMapper
.
insert
(
organization
);
organizationMapper
.
insert
(
organization
);
}
}
// else{
// throw new BadRequest("用户组"+dto.getEmergencyTeamName()+"已存不能重复导入!");
// }
}
}
}
//对人员数据入库
//对人员数据入库
if
(
userData
.
size
()>
0
){
checkOrganizationUserData
(
userData
);
checkOrganizationUserData
(
userData
);
int
sort
=
organizationMapper
.
selectOrganizationUserMaxSort
();
int
sort
=
organizationMapper
.
selectOrganizationUserMaxSort
();
for
(
OrganizationUserExportDto
userExportDto
:
userData
)
{
for
(
OrganizationUserExportDto
userExportDto
:
userData
)
{
...
@@ -120,35 +107,9 @@ public class OrganizationImpl extends BaseService<Organization,Organization, Org
...
@@ -120,35 +107,9 @@ public class OrganizationImpl extends BaseService<Organization,Organization, Org
organizationUserMapper
.
insert
(
organizationUser
);
organizationUserMapper
.
insert
(
organizationUser
);
}
}
}
}
}
// int sort = organizationMapper.selectMaxSort();
// checkOrganizationData(data);
// checkOrganizationUserData(userData);
// for (OrganizationExportDto dto : data) {
// LambdaQueryWrapper<Organization> lambda = new QueryWrapper<Organization>().lambda();
// lambda.eq(Organization::getIsDelete, false);
// lambda.eq(Organization::getEmergencyTeamName, dto.getEmergencyTeamName());
// List<Organization> organizations = organizationMapper.selectList(lambda);
// Organization organization = new Organization();
// if (CollectionUtils.isEmpty(organizations)){
// BeanUtils.copyProperties(dto, organization);
// sort = sort + 1;
// organization.setSort(sort);
// organization.setBizOrgCode(bizOrgCode);
// organizationMapper.insert(organization);
// }else {
// Organization organization1 = organizations.get(0);
// BeanUtils.copyProperties(organization1, organization);
// }
// List<OrganizationUserExportDto> collect = userData.stream().filter(item -> item.getEmergencyTeamName().equals(dto.getEmergencyTeamName())).collect(Collectors.toList());
// for (OrganizationUserExportDto userExportDto : collect) {
// OrganizationUser organizationUser = new OrganizationUser();
// BeanUtils.copyProperties(userExportDto, organizationUser);
// organizationUser.setEmergencyTeamId(String.valueOf(organization.getSequenceNbr()));
// organizationUserMapper.insert(organizationUser);
// }
// }
}
}
private
void
checkOrganizationData
(
List
<
OrganizationExportDto
>
data
)
{
private
void
checkOrganizationData
(
List
<
OrganizationExportDto
>
data
)
{
...
@@ -167,13 +128,13 @@ public class OrganizationImpl extends BaseService<Organization,Organization, Org
...
@@ -167,13 +128,13 @@ public class OrganizationImpl extends BaseService<Organization,Organization, Org
for
(
int
i
=
0
;
i
<
data
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
data
.
size
();
i
++)
{
OrganizationUserExportDto
dto
=
data
.
get
(
i
);
OrganizationUserExportDto
dto
=
data
.
get
(
i
);
if
(
ObjectUtils
.
isEmpty
(
dto
.
getEmergencyTeamName
()))
{
if
(
ObjectUtils
.
isEmpty
(
dto
.
getEmergencyTeamName
()))
{
throw
new
BadRequest
(
"组员信息表第"
+
(
i
+
1
)
+
"行, 应急救援小组名称为必填信息!"
);
throw
new
BadRequest
(
NAME
+
(
i
+
1
)
+
"行, 应急救援小组名称为必填信息!"
);
}
}
if
(
ObjectUtils
.
isEmpty
(
dto
.
getMemberName
()))
{
if
(
ObjectUtils
.
isEmpty
(
dto
.
getMemberName
()))
{
throw
new
BadRequest
(
"组员信息表第"
+
(
i
+
1
)
+
"行, 组员姓名为必填信息!"
);
throw
new
BadRequest
(
NAME
+
(
i
+
1
)
+
"行, 组员姓名为必填信息!"
);
}
}
if
(
ObjectUtils
.
isEmpty
(
dto
.
getTelephone
()))
{
if
(
ObjectUtils
.
isEmpty
(
dto
.
getTelephone
()))
{
throw
new
BadRequest
(
"组员信息表第"
+
(
i
+
1
)+
"行, 组员电话为必填信息!"
);
throw
new
BadRequest
(
NAME
+
(
i
+
1
)+
"行, 组员电话为必填信息!"
);
}
}
}
}
}
}
...
@@ -222,7 +183,6 @@ public class OrganizationImpl extends BaseService<Organization,Organization, Org
...
@@ -222,7 +183,6 @@ public class OrganizationImpl extends BaseService<Organization,Organization, Org
this
.
updateById
(
organization
);
this
.
updateById
(
organization
);
upOrganization
.
setSort
(
sort
);
upOrganization
.
setSort
(
sort
);
this
.
updateById
(
upOrganization
);
this
.
updateById
(
upOrganization
);
return
true
;
}
else
{
}
else
{
// 下移,查询下一条数据
// 下移,查询下一条数据
LambdaQueryWrapper
<
Organization
>
wrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
Organization
>
wrapper
=
new
LambdaQueryWrapper
<>();
...
@@ -238,8 +198,9 @@ public class OrganizationImpl extends BaseService<Organization,Organization, Org
...
@@ -238,8 +198,9 @@ public class OrganizationImpl extends BaseService<Organization,Organization, Org
this
.
updateById
(
organization
);
this
.
updateById
(
organization
);
downOrganization
.
setSort
(
sort
);
downOrganization
.
setSort
(
sort
);
this
.
updateById
(
downOrganization
);
this
.
updateById
(
downOrganization
);
return
true
;
}
}
return
true
;
}
}
@Override
@Override
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/OrganizationUserImpl.java
View file @
5b66aa10
...
@@ -38,7 +38,6 @@ public class OrganizationUserImpl extends BaseService<OrganizationUser,Organizat
...
@@ -38,7 +38,6 @@ public class OrganizationUserImpl extends BaseService<OrganizationUser,Organizat
if
(!
ObjectUtils
.
isEmpty
(
id
)
&&
id
!=
0
)
{
if
(!
ObjectUtils
.
isEmpty
(
id
)
&&
id
!=
0
)
{
wrapper
.
eq
(
OrganizationUser:
:
getEmergencyTeamId
,
id
);
wrapper
.
eq
(
OrganizationUser:
:
getEmergencyTeamId
,
id
);
}
}
// wrapper.orderByDesc(BaseEntity::getRecDate);
wrapper
.
eq
(
OrganizationUser:
:
getIsDelete
,
false
);
wrapper
.
eq
(
OrganizationUser:
:
getIsDelete
,
false
);
wrapper
.
orderByDesc
(
OrganizationUser:
:
getSort
);
wrapper
.
orderByDesc
(
OrganizationUser:
:
getSort
);
return
this
.
baseMapper
.
selectPage
(
page
,
wrapper
);
return
this
.
baseMapper
.
selectPage
(
page
,
wrapper
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/PowerTransferCompanyResourcesServiceImpl.java
View file @
5b66aa10
...
@@ -27,6 +27,7 @@ import org.springframework.stereotype.Service;
...
@@ -27,6 +27,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
...
@@ -60,13 +61,17 @@ public class PowerTransferCompanyResourcesServiceImpl extends BaseService<PowerT
...
@@ -60,13 +61,17 @@ public class PowerTransferCompanyResourcesServiceImpl extends BaseService<PowerT
@Value
(
"${mqtt.topic.command.power.deployment}"
)
@Value
(
"${mqtt.topic.command.power.deployment}"
)
private
String
topic
;
private
String
topic
;
private
static
String
RESOURCES_ID
=
"resources_id"
;
private
static
String
PHOTOS
=
"/photos:"
;
@Override
@Override
public
AlertCalled
getByPowerTransferCompanyResourId
(
Long
id
)
{
public
AlertCalled
getByPowerTransferCompanyResourId
(
Long
id
)
{
QueryWrapper
<
PowerTransferCompanyResources
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
PowerTransferCompanyResources
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"status"
,
FireCarStatusEnum
.
执行中
.
getCode
());
queryWrapper
.
eq
(
"status"
,
FireCarStatusEnum
.
执行中
.
getCode
());
queryWrapper
.
eq
(
"resources_id"
,
id
.
toString
());
queryWrapper
.
eq
(
RESOURCES_ID
,
id
.
toString
());
PowerTransferCompanyResources
alertFormValue
=
this
.
getOne
(
queryWrapper
);
PowerTransferCompanyResources
alertFormValue
=
this
.
getOne
(
queryWrapper
);
if
(
alertFormValue
!=
null
)
{
if
(
alertFormValue
!=
null
)
{
return
powerTransferCompanyResourcesMapper
.
getByPowerTransferCompanyResourId
(
alertFormValue
.
getPowerTransferCompanyId
());
return
powerTransferCompanyResourcesMapper
.
getByPowerTransferCompanyResourId
(
alertFormValue
.
getPowerTransferCompanyId
());
...
@@ -126,7 +131,7 @@ public class PowerTransferCompanyResourcesServiceImpl extends BaseService<PowerT
...
@@ -126,7 +131,7 @@ public class PowerTransferCompanyResourcesServiceImpl extends BaseService<PowerT
jcSituationDetail
.
setInfo
(
info
);
jcSituationDetail
.
setInfo
(
info
);
if
(
CollectionUtils
.
isNotEmpty
(
photos
)){
if
(
CollectionUtils
.
isNotEmpty
(
photos
)){
jcSituationDetail
.
setInfo
(
info
+
"/photos:"
+
Joiner
.
on
(
","
).
join
(
photos
));
jcSituationDetail
.
setInfo
(
info
+
PHOTOS
+
Joiner
.
on
(
","
).
join
(
photos
));
}
}
jcSituationDetail
.
setPowerTransferCompanyResourcesId
(
powerTransferCompanyResources
.
getSequenceNbr
());
jcSituationDetail
.
setPowerTransferCompanyResourcesId
(
powerTransferCompanyResources
.
getSequenceNbr
());
...
@@ -137,7 +142,7 @@ public class PowerTransferCompanyResourcesServiceImpl extends BaseService<PowerT
...
@@ -137,7 +142,7 @@ public class PowerTransferCompanyResourcesServiceImpl extends BaseService<PowerT
// 定义指令信息消息推送 页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
// 定义指令信息消息推送 页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
emqKeeper
.
getMqttClient
().
publish
(
topic
,
"0"
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
false
);
emqKeeper
.
getMqttClient
().
publish
(
topic
,
"0"
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
false
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
"修改失败!"
);
throw
new
BadRequest
(
"修改失败!"
);
}
}
}
}
...
@@ -154,8 +159,8 @@ public class PowerTransferCompanyResourcesServiceImpl extends BaseService<PowerT
...
@@ -154,8 +159,8 @@ public class PowerTransferCompanyResourcesServiceImpl extends BaseService<PowerT
wrapper
.
orderByDesc
(
BaseEntity:
:
getRecDate
);
wrapper
.
orderByDesc
(
BaseEntity:
:
getRecDate
);
List
<
JcSituationDetail
>
list
=
jcSituationDetailMapper
.
selectList
(
wrapper
);
List
<
JcSituationDetail
>
list
=
jcSituationDetailMapper
.
selectList
(
wrapper
);
list
.
stream
().
forEach
(
e
->{
list
.
stream
().
forEach
(
e
->{
if
(
e
.
getInfo
().
contains
(
"/photos:"
)){
if
(
e
.
getInfo
().
contains
(
PHOTOS
)){
String
[]
content
=
e
.
getInfo
().
split
(
"/photos:"
);
String
[]
content
=
e
.
getInfo
().
split
(
PHOTOS
);
String
info
=
content
[
0
];
String
info
=
content
[
0
];
String
photoUrls
=
content
[
1
];
String
photoUrls
=
content
[
1
];
List
<
String
>
photos
=
Arrays
.
asList
(
photoUrls
);
List
<
String
>
photos
=
Arrays
.
asList
(
photoUrls
);
...
@@ -170,14 +175,14 @@ public class PowerTransferCompanyResourcesServiceImpl extends BaseService<PowerT
...
@@ -170,14 +175,14 @@ public class PowerTransferCompanyResourcesServiceImpl extends BaseService<PowerT
@Override
@Override
public
PowerTransferCompanyResources
getResourceById
(
String
resourceId
)
{
public
PowerTransferCompanyResources
getResourceById
(
String
resourceId
)
{
QueryWrapper
<
PowerTransferCompanyResources
>
powerTransferCompanyResourcesQueryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
PowerTransferCompanyResources
>
powerTransferCompanyResourcesQueryWrapper
=
new
QueryWrapper
<>();
powerTransferCompanyResourcesQueryWrapper
.
eq
(
"resources_id"
,
resourceId
);
powerTransferCompanyResourcesQueryWrapper
.
eq
(
RESOURCES_ID
,
resourceId
);
return
powerTransferCompanyResourcesMapper
.
selectOne
(
powerTransferCompanyResourcesQueryWrapper
);
return
powerTransferCompanyResourcesMapper
.
selectOne
(
powerTransferCompanyResourcesQueryWrapper
);
}
}
@Override
@Override
public
int
getCarExecutingCountById
(
String
resourceId
,
String
status
)
{
public
int
getCarExecutingCountById
(
String
resourceId
,
String
status
)
{
QueryWrapper
<
PowerTransferCompanyResources
>
powerTransferCompanyResourcesQueryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
PowerTransferCompanyResources
>
powerTransferCompanyResourcesQueryWrapper
=
new
QueryWrapper
<>();
powerTransferCompanyResourcesQueryWrapper
.
eq
(
"resources_id"
,
resourceId
);
powerTransferCompanyResourcesQueryWrapper
.
eq
(
RESOURCES_ID
,
resourceId
);
powerTransferCompanyResourcesQueryWrapper
.
eq
(
"status"
,
status
);
powerTransferCompanyResourcesQueryWrapper
.
eq
(
"status"
,
status
);
powerTransferCompanyResourcesQueryWrapper
.
eq
(
"is_delete"
,
0
);
powerTransferCompanyResourcesQueryWrapper
.
eq
(
"is_delete"
,
0
);
return
powerTransferCompanyResourcesMapper
.
selectCount
(
powerTransferCompanyResourcesQueryWrapper
);
return
powerTransferCompanyResourcesMapper
.
selectCount
(
powerTransferCompanyResourcesQueryWrapper
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/PowerTransferServiceImpl.java
View file @
5b66aa10
...
@@ -4,6 +4,7 @@ package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
...
@@ -4,6 +4,7 @@ package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
com.alibaba.fastjson.JSON
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.module.common.api.entity.DutyShift
;
import
com.yeejoin.amos.boot.module.common.api.entity.DutyShift
;
...
@@ -20,11 +21,13 @@ import org.springframework.beans.factory.annotation.Value;
...
@@ -20,11 +21,13 @@ import org.springframework.beans.factory.annotation.Value;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.web.client.HttpClientErrorException
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.core.foundation.exception.BaseException
;
import
org.typroject.tyboot.core.foundation.exception.BaseException
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
...
@@ -123,6 +126,13 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
...
@@ -123,6 +126,13 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
@Autowired
@Autowired
private
DutyShiftMapper
dutyShiftMapper
;
private
DutyShiftMapper
dutyShiftMapper
;
private
static
final
String
PERSON
=
"person"
;
private
static
final
String
USERNAME
=
"userName"
;
private
static
final
String
COUNT
=
"count"
;
private
static
final
String
TOTAL
=
"total"
;
@Override
@Override
public
PowerTransferSimpleDto
getPowerTransferList
(
Long
alertCalledId
)
{
public
PowerTransferSimpleDto
getPowerTransferList
(
Long
alertCalledId
)
{
List
<
PowerTransferCompanyResourcesDto
>
powerTransferList
=
this
.
baseMapper
.
getPowerTransferList
(
alertCalledId
);
List
<
PowerTransferCompanyResourcesDto
>
powerTransferList
=
this
.
baseMapper
.
getPowerTransferList
(
alertCalledId
);
...
@@ -161,23 +171,20 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
...
@@ -161,23 +171,20 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
.
getOne
(
new
QueryWrapper
<
Template
>().
eq
(
"type_code"
,
"LLDP"
).
eq
(
"format"
,
false
));
.
getOne
(
new
QueryWrapper
<
Template
>().
eq
(
"type_code"
,
"LLDP"
).
eq
(
"format"
,
false
));
String
content
=
template
.
getContent
();
String
content
=
template
.
getContent
();
Map
<
String
,
String
>
definitions
=
new
HashMap
<>();
Map
<
String
,
String
>
definitions
=
new
HashMap
<>();
// initDefinitions(definitions, alertCalled, powerTransferDto);
// 创建力量调派单位
// 创建力量调派单位
createPowerTransferCompany
(
powerTransferDto
,
powerTransferSequenceNbr
,
definitions
,
content
,
alertCalled
);
createPowerTransferCompany
(
powerTransferDto
,
powerTransferSequenceNbr
,
definitions
,
content
,
alertCalled
);
// 封装调派任务的集合,以便于实现任务规则校验
// 封装调派任务的集合,以便于实现任务规则校验
try
{
packagePowerTransferDetail
(
powerTransferDto
);
packagePowerTransferDetail
(
powerTransferDto
);
}
catch
(
Exception
e
)
{
log
.
error
(
"调用规则失败:PowerTransferServiceImpl。createPowerTransfer()"
);
}
// 发送调派通知
// 发送调派通知
// 通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
// 通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
emqKeeper
.
getMqttClient
().
publish
(
topic
,
"0"
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
false
);
emqKeeper
.
getMqttClient
().
publish
(
topic
,
"0"
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
false
);
}
catch
(
Mqtt
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
);
throw
new
BadRequest
(
"系统异常"
);
}
}
return
true
;
return
true
;
...
@@ -235,30 +242,10 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
...
@@ -235,30 +242,10 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
// 1.调用装备服务接口查询车辆列表
// 1.调用装备服务接口查询车辆列表
List
<
FireBrigadeResourceDto
>
fireCarDtoList
=
Lists
.
newArrayList
();
List
<
FireBrigadeResourceDto
>
fireCarDtoList
=
Lists
.
newArrayList
();
ResponseModel
<
Object
>
result
=
equipFeignService
.
getFireCarListAll
();
ResponseModel
<
Object
>
result
=
equipFeignService
.
getFireCarListAll
();
// if (!ObjectUtils.isEmpty(result)) {
// List<Map<String, Object>> fireCarListMapList = (List<Map<String, Object>>) result.getResult();
// if (!ValidationUtil.isEmpty(fireCarListMapList)) {
// fireCarListMapList.stream().filter(car -> ObjectUtils.isNotEmpty(car.get("teamId"))).filter(car ->
// FireCarStatusEnum.执勤.getCode().equals(car.get("carState")) //TODO 后续如果需要多个状态需要删掉这个过滤条件
// || FireCarStatusEnum.出动.getCode().equals(car.get("carState"))).forEach(car -> {
//
// FireBrigadeResourceDto fireCarDto = (FireBrigadeResourceDto) Bean.mapToBean(car, FireBrigadeResourceDto.class);
// // TODO 后期根据车物联状态来返回,现在为"(装备)在位=执勤","(装备)执勤=出动"
// if (FireCarStatusEnum.执勤.getCode().equals(fireCarDto.getCarState())) {
// fireCarDto.setCarStateDesc(FireCarStatusEnum.执勤.getName());
// } else {
// fireCarDto.setCarState(FireCarStatusEnum.出动.getCode());
// fireCarDto.setCarStateDesc(FireCarStatusEnum.出动.getName());
// }
// fireCarDtoList.add(fireCarDto);
// });
// }
// }
// 查询车辆当前任务状态
// 查询车辆当前任务状态
QueryWrapper
<
PowerTransferCompanyResources
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
PowerTransferCompanyResources
>
queryWrapper
=
new
QueryWrapper
<>();
// queryWrapper.notIn("car_status",
// FireCarStatusEnum.返队.getCode(),FireCarStatusEnum.加油.getCode(),FireCarStatusEnum.演练.getCode(),FireCarStatusEnum.训练.getCode(),FireCarStatusEnum.试车.getCode());
queryWrapper
.
eq
(
"status"
,
FireCarStatusEnum
.
执行中
.
getCode
());
queryWrapper
.
eq
(
"status"
,
FireCarStatusEnum
.
执行中
.
getCode
());
List
<
PowerTransferCompanyResources
>
alertFormValue
=
powerTransferCompanyResourcesService
.
list
(
queryWrapper
);
List
<
PowerTransferCompanyResources
>
alertFormValue
=
powerTransferCompanyResourcesService
.
list
(
queryWrapper
);
...
@@ -317,10 +304,10 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
...
@@ -317,10 +304,10 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
LinkedHashMap
<
String
,
String
>
infoMap_1
=
new
LinkedHashMap
<
String
,
String
>();
LinkedHashMap
<
String
,
String
>
infoMap_1
=
new
LinkedHashMap
<
String
,
String
>();
for
(
Map
<
String
,
Object
>
specify
:
specifyDateList
)
{
for
(
Map
<
String
,
Object
>
specify
:
specifyDateList
)
{
//
//
if
(
specify
.
containsKey
(
"userName"
)
&&
specify
.
get
(
"userName"
)
!=
null
)
{
if
(
specify
.
containsKey
(
USERNAME
)
&&
specify
.
get
(
USERNAME
)
!=
null
)
{
if
(
specify
.
get
(
"userName"
).
toString
().
contains
(
","
))
{
if
(
specify
.
get
(
USERNAME
).
toString
().
contains
(
","
))
{
String
[]
userNames
=
specify
.
get
(
"userName"
).
toString
().
split
(
","
);
String
[]
userNames
=
specify
.
get
(
USERNAME
).
toString
().
split
(
","
);
num
=
num
+
userNames
.
length
;
num
=
num
+
userNames
.
length
;
infoMap_1
.
put
(
dutyDetail
.
get
(
"name"
).
toString
(),
userNames
.
length
+
""
);
infoMap_1
.
put
(
dutyDetail
.
get
(
"name"
).
toString
(),
userNames
.
length
+
""
);
}
else
{
}
else
{
...
@@ -427,21 +414,7 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
...
@@ -427,21 +414,7 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
// 3.消防队伍-监控大队
// 3.消防队伍-监控大队
List
<
FireBrigadeResourceDto
>
monitorFireBrigadeList
=
fireTeamService
List
<
FireBrigadeResourceDto
>
monitorFireBrigadeList
=
fireTeamService
.
listMonitorFireBrigade
(
FireBrigadeTypeEnum
.
监控大队
.
getCode
());
.
listMonitorFireBrigade
(
FireBrigadeTypeEnum
.
监控大队
.
getCode
());
// List<FireBrigadeResourceDto> monitorFireBrigadeList =
// fireTeamService.listMonitorFireBrigade();
/* bug 2403 队伍未显示图片 2021-09-23 陈召开始 */
// for (FireBrigadeResourceDto fireBrigadeResourceDto : monitorFireBrigadeList) {
// if (fireBrigadeResourceDto.getPic() != null) {
// String[] split = fireBrigadeResourceDto.getPic().split(",");
// if (split.length > 1) {
// fireBrigadeResourceDto.setImage(Arrays.asList(split));
// } else {
// List<String> objects = new ArrayList<>();
// objects.add(fireBrigadeResourceDto.getPic());
// fireBrigadeResourceDto.setImage(objects);
// }
// }
// }
/* bug 2403 队伍未显示图片 2021-09-23 陈召结束 */
/* bug 2403 队伍未显示图片 2021-09-23 陈召结束 */
FireBrigadeResourceDto
monitorResourceDto
=
new
FireBrigadeResourceDto
();
FireBrigadeResourceDto
monitorResourceDto
=
new
FireBrigadeResourceDto
();
monitorResourceDto
.
setId
(
"0"
);
monitorResourceDto
.
setId
(
"0"
);
...
@@ -461,14 +434,14 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
...
@@ -461,14 +434,14 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
Long
powerTransferCompanySequenceNbr
)
{
Long
powerTransferCompanySequenceNbr
)
{
ArrayList
<
PowerTransferCompanyResources
>
powerTransferCompanyResourcesList
=
new
ArrayList
<>();
ArrayList
<
PowerTransferCompanyResources
>
powerTransferCompanyResourcesList
=
new
ArrayList
<>();
PowerTransferCompanyResources
powerTransferCompanyResources
;
PowerTransferCompanyResources
powerTransferCompanyResources
;
List
idList
=
powerTransferCompanyResourcesDtoList
.
stream
()
List
<
String
>
idList
=
powerTransferCompanyResourcesDtoList
.
stream
()
.
map
(
PowerTransferCompanyResourcesDto:
:
getResourcesId
).
collect
(
Collectors
.
toList
());
.
map
(
PowerTransferCompanyResourcesDto:
:
getResourcesId
).
collect
(
Collectors
.
toList
());
QueryWrapper
<
PowerTransferCompanyResources
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
PowerTransferCompanyResources
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"status"
,
FireCarStatusEnum
.
执行中
.
getCode
());
queryWrapper
.
eq
(
"status"
,
FireCarStatusEnum
.
执行中
.
getCode
());
queryWrapper
.
in
(
"resources_id"
,
idList
);
queryWrapper
.
in
(
"resources_id"
,
idList
);
List
<
PowerTransferCompanyResources
>
alertFormValue
=
powerTransferCompanyResourcesService
.
list
(
queryWrapper
);
List
<
PowerTransferCompanyResources
>
alertFormValue
=
powerTransferCompanyResourcesService
.
list
(
queryWrapper
);
if
(
alertFormValue
!=
null
&&
alertFormValue
.
size
()
>
0
)
{
if
(
alertFormValue
!=
null
&&
alertFormValue
.
size
()
>
0
)
{
throw
new
RuntimeException
(
"已选车辆有已调派车辆!"
);
throw
new
BadRequest
(
"已选车辆有已调派车辆!"
);
}
else
{
}
else
{
for
(
PowerTransferCompanyResourcesDto
powerTransferCompanyResourcesDto
:
powerTransferCompanyResourcesDtoList
)
{
for
(
PowerTransferCompanyResourcesDto
powerTransferCompanyResourcesDto
:
powerTransferCompanyResourcesDtoList
)
{
...
@@ -483,15 +456,7 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
...
@@ -483,15 +456,7 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
List
<
Map
<
String
,
Object
>>
equipmentList
=
iDutyCarService
.
getDutyCaruser
(
Long
.
valueOf
(
powerTransferCompanyResources
.
getResourcesId
()));
List
<
Map
<
String
,
Object
>>
equipmentList
=
iDutyCarService
.
getDutyCaruser
(
Long
.
valueOf
(
powerTransferCompanyResources
.
getResourcesId
()));
if
(!
ValidationUtil
.
isEmpty
(
equipmentList
))
{
if
(!
ValidationUtil
.
isEmpty
(
equipmentList
))
{
// String str = "";
// String newStr = "";
// for (int i = 0; i < equipmentList.size(); i++) {
// if (i == equipmentList.size() - 1) {
// newStr =newStr+ str.concat(equipmentList.get(i).get("userName") + "");
// } else {
// newStr = newStr+str.concat(equipmentList.get(i).get("userName") + ",");
// }
// }
powerTransferCompanyResources
.
setCarUser
(
equipmentList
.
size
()+
""
);
powerTransferCompanyResources
.
setCarUser
(
equipmentList
.
size
()+
""
);
}
else
{
}
else
{
powerTransferCompanyResources
.
setCarUser
(
"0"
);
powerTransferCompanyResources
.
setCarUser
(
"0"
);
...
@@ -508,16 +473,10 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
...
@@ -508,16 +473,10 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
PowerTransferDto
powerTransferDto
)
{
PowerTransferDto
powerTransferDto
)
{
List
<
AlertFormValue
>
alertFormValue
=
alertFormValueService
List
<
AlertFormValue
>
alertFormValue
=
alertFormValueService
.
list
(
new
QueryWrapper
<
AlertFormValue
>().
eq
(
"alert_called_id"
,
alertCalled
.
getSequenceNbr
()));
.
list
(
new
QueryWrapper
<
AlertFormValue
>().
eq
(
"alert_called_id"
,
alertCalled
.
getSequenceNbr
()));
// definitions.put("rescueGrid", alertCalled.getRescueGrid());
// definitions.put("alertType", alertCalled.getAlertType());
// definitions.put("address", alertCalled.getAddress());
// definitions.put("trappedNum", alertCalled.getTrappedNum().toString());
// definitions.put("casualtiesNum", alertCalled.getCasualtiesNum().toString());
// definitions.put("companyName", powerTransferDto.getCompanyName());
for
(
AlertFormValue
formValue
:
alertFormValue
)
{
for
(
AlertFormValue
formValue
:
alertFormValue
)
{
definitions
.
put
(
formValue
.
getFieldCode
(),
formValue
.
getFieldValue
());
definitions
.
put
(
formValue
.
getFieldCode
(),
formValue
.
getFieldValue
());
}
}
}
}
private
String
getTaskInformation
(
String
content
,
Map
<
String
,
String
>
definitions
)
{
private
String
getTaskInformation
(
String
content
,
Map
<
String
,
String
>
definitions
)
{
...
@@ -577,8 +536,6 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
...
@@ -577,8 +536,6 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
powerTransferCompany
.
setIsDistributionAgencies
(
false
);
powerTransferCompany
.
setIsDistributionAgencies
(
false
);
StringBuilder
taskInformation
=
new
StringBuilder
();
StringBuilder
taskInformation
=
new
StringBuilder
();
for
(
PowerTransferCompanyResourcesDto
powerTransferCompanyResourcesDto
:
powerTransferCompanyResourcesDtoList
)
{
for
(
PowerTransferCompanyResourcesDto
powerTransferCompanyResourcesDto
:
powerTransferCompanyResourcesDtoList
)
{
// definitions.put("type", powerTransferCompanyResourcesDto.getType());
// definitions.put("resourcesNum", powerTransferCompanyResourcesDto.getResourcesNum());
String
information
=
powerTransferCompanyResourcesDto
.
getType
().
concat
(
"车牌号"
)
String
information
=
powerTransferCompanyResourcesDto
.
getType
().
concat
(
"车牌号"
)
.
concat
(
powerTransferCompanyResourcesDto
.
getResourcesNum
());
.
concat
(
powerTransferCompanyResourcesDto
.
getResourcesNum
());
taskInformation
.
append
(
information
).
append
(
"丶"
);
taskInformation
.
append
(
information
).
append
(
"丶"
);
...
@@ -610,7 +567,7 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
...
@@ -610,7 +567,7 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
List
<
Controller
>
controllers
=
controllerServiceImpl
.
list
(
new
LambdaQueryWrapper
<
Controller
>().
eq
(
Controller:
:
getFireTeamSeq
,
powerTransferCompanyDto
.
getCompanyId
()));
List
<
Controller
>
controllers
=
controllerServiceImpl
.
list
(
new
LambdaQueryWrapper
<
Controller
>().
eq
(
Controller:
:
getFireTeamSeq
,
powerTransferCompanyDto
.
getCompanyId
()));
//bug 5863 打印日志 调派车辆后对应警铃未打开
//bug 5863 打印日志 调派车辆后对应警铃未打开
log
.
info
(
"消防车队伍ID:{}, 根据队伍ID查出来的jc_controller数据:{},查出来的数据量size:{}"
,
powerTransferCompanyDto
.
getCompanyId
(),
JSON
Object
.
toJSONString
(
controllers
),
controllers
.
size
());
log
.
info
(
"消防车队伍ID:{}, 根据队伍ID查出来的jc_controller数据:{},查出来的数据量size:{}"
,
powerTransferCompanyDto
.
getCompanyId
(),
JSON
.
toJSONString
(
controllers
),
controllers
.
size
());
if
(
controllers
.
size
()
>
0
)
{
if
(
controllers
.
size
()
>
0
)
{
...
@@ -728,7 +685,7 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
...
@@ -728,7 +685,7 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
case
"car"
:
case
"car"
:
resultPage
=
getPowerTransferCarResource
(
page
,
alertCalledId
);
resultPage
=
getPowerTransferCarResource
(
page
,
alertCalledId
);
break
;
break
;
case
"person"
:
case
PERSON
:
// TODO 暂时没有调度人员
// TODO 暂时没有调度人员
resultPage
=
new
Page
<>();
resultPage
=
new
Page
<>();
break
;
break
;
...
@@ -745,7 +702,7 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
...
@@ -745,7 +702,7 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
if
(
ValidationUtil
.
isEmpty
(
result
))
{
if
(
ValidationUtil
.
isEmpty
(
result
))
{
ResourceStatisticsDto
team
=
new
ResourceStatisticsDto
(
"team"
,
0
,
0
,
0
);
ResourceStatisticsDto
team
=
new
ResourceStatisticsDto
(
"team"
,
0
,
0
,
0
);
ResourceStatisticsDto
car
=
new
ResourceStatisticsDto
(
"car"
,
0
,
0
,
0
);
ResourceStatisticsDto
car
=
new
ResourceStatisticsDto
(
"car"
,
0
,
0
,
0
);
ResourceStatisticsDto
person
=
new
ResourceStatisticsDto
(
"person"
,
0
,
0
,
0
);
ResourceStatisticsDto
person
=
new
ResourceStatisticsDto
(
PERSON
,
0
,
0
,
0
);
result
.
add
(
team
);
result
.
add
(
team
);
result
.
add
(
car
);
result
.
add
(
car
);
result
.
add
(
person
);
result
.
add
(
person
);
...
@@ -817,19 +774,11 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
...
@@ -817,19 +774,11 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
List
<
Map
<
String
,
Object
>>
totalCarList
=
carList
.
stream
()
List
<
Map
<
String
,
Object
>>
totalCarList
=
carList
.
stream
()
.
filter
(
c
->
carIdList
.
contains
(
Long
.
valueOf
((
String
)
c
.
get
(
"id"
)))).
collect
(
Collectors
.
toList
());
.
filter
(
c
->
carIdList
.
contains
(
Long
.
valueOf
((
String
)
c
.
get
(
"id"
)))).
collect
(
Collectors
.
toList
());
// TODO 车辆枚举后期修改为已到达状态车辆
// List<Map<String, Object>> arrivedCarList = carList.stream()
// .filter(c -> carIdList.contains(Long.valueOf((String) c.get("id")))
// && FireCarStatusEnum.执勤.getCode().equals(c.get("carState")))
// .collect(Collectors.toList());
// 调派-已到达车辆id列表
// 调派-已到达车辆id列表
List
<
Long
>
arrivedCarIdList
=
Lists
.
newArrayList
();
List
<
Long
>
arrivedCarIdList
=
Lists
.
newArrayList
();
// arrivedCarList.forEach(c -> {
// if (FireCarStatusEnum.到场.getCode().equals(c.get("carState"))) {
// arrivedCarIdList.add(Long.valueOf((String) c.get("id")));
// }
// });
List
<
PowerTransferResourceDto
>
tot
=
null
;
List
<
PowerTransferResourceDto
>
tot
=
null
;
if
(
carResourcePage
.
getRecords
()!=
null
&&
carResourcePage
.
getRecords
().
size
()>
0
){
if
(
carResourcePage
.
getRecords
()!=
null
&&
carResourcePage
.
getRecords
().
size
()>
0
){
carResourcePage
.
getRecords
().
forEach
(
c
->
{
carResourcePage
.
getRecords
().
forEach
(
c
->
{
...
@@ -839,21 +788,6 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
...
@@ -839,21 +788,6 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
});
});
}
}
// List<Map<String, Object>> collect = new ArrayList<>();
// if (null != totalCarList && totalCarList.size() > 0) {
// List<StatusDto> statusByIds1 = powerTransferCompanyResourcesMapper.findStatusByIds(carIdList);
// Map<Long, String> statusMap = statusByIds1.stream().collect(Collectors.toMap(StatusDto::getCardId, StatusDto::getCarStatus));
// collect = totalCarList.stream().map(item -> {
// item.put("carState", statusMap.get(Long.valueOf((String) item.get("id"))));
// return item;
// }).collect(Collectors.toList());
// }
//
// //到场车辆信息
// List<Map<String, Object>> arrivedCarList = collect.stream()
// .filter(c -> FireCarStatusEnum.到场.getCode().equals(c.get("carState")))
// .collect(Collectors.toList());
JSONObject
resourceStatistics
=
new
JSONObject
();
JSONObject
resourceStatistics
=
new
JSONObject
();
double
carTotal
=
carResourcePage
.
getTotal
();
double
carTotal
=
carResourcePage
.
getTotal
();
...
@@ -870,24 +804,19 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
...
@@ -870,24 +804,19 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
// 车载药剂统计 车载水量统计
// 车载药剂统计 车载水量统计
waterCount
(
carIdList
,
resourceStatistics
,
carTotal
,
"water"
);
waterCount
(
carIdList
,
resourceStatistics
,
carTotal
,
"water"
);
// carCount(arrivedCarList, resourceStatistics, carTotal, "water");
// 车载药剂统计
/* fireAgentOnCarCount(totalCarList, arrivedCarList, resourceStatistics, "fireAgent", "medicament");*/
return
resourceStatistics
;
return
resourceStatistics
;
}
}
public
void
carCount
(
List
<
Long
>
arrivedCarList
,
JSONObject
resourceStatistics
,
double
carTotal
,
public
void
carCount
(
List
<
Long
>
arrivedCarList
,
JSONObject
resourceStatistics
,
double
carTotal
,
String
jsoKey
)
{
String
jsoKey
)
{
JSONObject
car
=
new
JSONObject
();
JSONObject
car
=
new
JSONObject
();
int
total
=
0
;
if
(
carTotal
>
0
){
if
(
carTotal
>
0
){
car
.
put
(
"total"
,
arrivedCarList
.
size
());
total
=
arrivedCarList
.
size
();
car
.
put
(
"count"
,
arrivedCarList
.
size
());
}
else
{
car
.
put
(
"total"
,
0
);
car
.
put
(
"count"
,
0
);
}
}
car
.
put
(
TOTAL
,
total
);
car
.
put
(
COUNT
,
total
);
resourceStatistics
.
put
(
jsoKey
,
car
);
resourceStatistics
.
put
(
jsoKey
,
car
);
}
}
...
@@ -899,18 +828,18 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
...
@@ -899,18 +828,18 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
if
(
carTotal
>
0
){
if
(
carTotal
>
0
){
// 泡沫和水车载统计 获取调用车辆的车载资源
// 泡沫和水车载统计 获取调用车辆的车载资源
ResponseModel
<
Map
<
String
,
Object
>>
carPropertyByCarIds
=
equipFeignService
.
getCarPropertyByCarIds
(
carIds
);
ResponseModel
<
Map
<
String
,
Object
>>
carPropertyByCarIds
=
equipFeignService
.
getCarPropertyByCarIds
(
carIds
);
obj
.
put
(
"total"
,
carTotal
);
obj
.
put
(
TOTAL
,
carTotal
);
obj
.
put
(
"count"
,
carPropertyByCarIds
.
getResult
().
get
(
"waterNum"
)!=
null
?
carPropertyByCarIds
.
getResult
().
get
(
"waterNum"
):
0
);
obj
.
put
(
COUNT
,
carPropertyByCarIds
.
getResult
().
get
(
"waterNum"
)!=
null
?
carPropertyByCarIds
.
getResult
().
get
(
"waterNum"
):
0
);
jsonObject
.
put
(
"total"
,
carTotal
);
jsonObject
.
put
(
TOTAL
,
carTotal
);
jsonObject
.
put
(
"count"
,
carPropertyByCarIds
.
getResult
().
get
(
"foamNum"
)!=
null
?
carPropertyByCarIds
.
getResult
().
get
(
"foamNum"
):
0
);
jsonObject
.
put
(
COUNT
,
carPropertyByCarIds
.
getResult
().
get
(
"foamNum"
)!=
null
?
carPropertyByCarIds
.
getResult
().
get
(
"foamNum"
):
0
);
}
else
{
}
else
{
obj
.
put
(
"total"
,
0
);
obj
.
put
(
TOTAL
,
0
);
obj
.
put
(
"count"
,
0
);
obj
.
put
(
COUNT
,
0
);
jsonObject
.
put
(
"total"
,
0
);
jsonObject
.
put
(
TOTAL
,
0
);
jsonObject
.
put
(
"count"
,
0
);
jsonObject
.
put
(
COUNT
,
0
);
}
}
resourceStatistics
.
put
(
"medicament"
,
jsonObject
);
resourceStatistics
.
put
(
"medicament"
,
jsonObject
);
...
@@ -920,25 +849,7 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
...
@@ -920,25 +849,7 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
public
void
dutyPersonCount
(
List
<
Long
>
carIdList
,
List
<
Long
>
arrivedCarIdList
,
JSONObject
resourceStatistics
)
{
public
void
dutyPersonCount
(
List
<
Long
>
carIdList
,
List
<
Long
>
arrivedCarIdList
,
JSONObject
resourceStatistics
)
{
JSONObject
person
=
new
JSONObject
();
JSONObject
person
=
new
JSONObject
();
if
(
arrivedCarIdList
!=
null
&&
arrivedCarIdList
.
size
()>
0
){
if
(
arrivedCarIdList
!=
null
&&
arrivedCarIdList
.
size
()>
0
){
// // 当前时间所在班次
// List<Long> shiftIdList = dutyCarService.getDutyShiftIdList();
// List<Map<String, Object>> allDutyPersonList = Lists.newArrayList();
//
// if (!ValidationUtil.isEmpty(shiftIdList)) {
// // 当前值班车辆-人
// allDutyPersonList = dutyCarService.dayDutyPersonList(DateUtils.getDateNowShortStr(), shiftIdList.get(0),
// null);
// }
// // 当前车辆执勤人员
// List<Map<String, Object>> allTransferDutyPerson = allDutyPersonList.stream()
// .filter(c -> carIdList.contains(Long.valueOf((String) c.get("carId")))).collect(Collectors.toList());
//
//
// 当前已到达车辆执勤人员
// List<Map<String, Object>> allArrivedTransferDutyPerson = allDutyPersonList.stream()
// .filter(c -> arrivedCarIdList.contains(Long.valueOf((String) c.get("carId"))))
// .collect(Collectors.toList());
int
num
=
0
;
int
num
=
0
;
for
(
Long
aLong
:
arrivedCarIdList
)
{
for
(
Long
aLong
:
arrivedCarIdList
)
{
...
@@ -947,40 +858,20 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
...
@@ -947,40 +858,20 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
}
}
person
.
put
(
"total"
,
num
);
person
.
put
(
TOTAL
,
num
);
person
.
put
(
"count"
,
num
);
person
.
put
(
COUNT
,
num
);
}
else
{
}
else
{
person
.
put
(
"total"
,
0
);
person
.
put
(
TOTAL
,
0
);
person
.
put
(
"count"
,
0
);
person
.
put
(
COUNT
,
0
);
}
}
resourceStatistics
.
put
(
"person"
,
person
);
resourceStatistics
.
put
(
PERSON
,
person
);
}
}
public
void
fireAgentOnCarCount
(
List
<
Map
<
String
,
Object
>>
totalCarList
,
List
<
Long
>
arrivedCarList
,
public
void
fireAgentOnCarCount
(
List
<
Map
<
String
,
Object
>>
totalCarList
,
List
<
Long
>
arrivedCarList
,
JSONObject
resourceStatistics
,
String
equipType
,
String
jsonKey
)
{
JSONObject
resourceStatistics
,
String
equipType
,
String
jsonKey
)
{
//
// double agentCountArrived = 0;
// double agentCountAll = 0;
// if (null != totalCarList && totalCarList.size()>0) {
// agentCountAll = totalCarList.stream().mapToDouble(
// car -> car.get("resourceList") != null ? ((List<Map<String, Object>>) car.get("resourceList")).stream()
// .filter(res -> equipType.equals(res.get("equipType")))
// .mapToDouble(c -> Double.parseDouble(ValidationUtil.isEmpty(c.get("equipCount")) ? "0" : c.get("equipCount").toString())).sum() : 0)
// .sum();
// if (null != arrivedCarList && arrivedCarList.size()>0) {
// agentCountArrived = arrivedCarList.stream().mapToDouble(
// car -> car.get("resourceList") != null ? ((List<Map<String, Object>>) car.get("resourceList")).stream()
// .filter(res -> equipType.equals(res.get("equipType")))
// .mapToDouble(c -> Double.parseDouble(ValidationUtil.isEmpty(c.get("equipCount")) ? "0" : c.get("equipCount").toString())).sum() : 0)
// .sum();
// }
// }
// JSONObject jsonObject = new JSONObject();
// jsonObject.put("total", agentCountAll);
// jsonObject.put("count", agentCountArrived);
// resourceStatistics.put(jsonKey, jsonObject);
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
...
@@ -991,16 +882,12 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
...
@@ -991,16 +882,12 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
.
mapToDouble
(
c
->
Double
.
parseDouble
(
ValidationUtil
.
isEmpty
(
c
.
get
(
"equipCount"
)
)
?
"0"
:
c
.
get
(
"equipCount"
).
toString
())).
sum
()
:
0
)
.
mapToDouble
(
c
->
Double
.
parseDouble
(
ValidationUtil
.
isEmpty
(
c
.
get
(
"equipCount"
)
)
?
"0"
:
c
.
get
(
"equipCount"
).
toString
())).
sum
()
:
0
)
.
sum
();
.
sum
();
// double agentCountArrived = arrivedCarList.stream().mapToDouble(
// car -> car.get("resourceList") != null ? ((List<Map<String, Object>>) car.get("resourceList")).stream()
jsonObject
.
put
(
TOTAL
,
agentCountAll
);
// .filter(res -> equipType.equals(res.get("equipType")))
jsonObject
.
put
(
COUNT
,
agentCountAll
);
// .mapToDouble(c -> Double.parseDouble(ValidationUtil.isEmpty(c.get("equipCount") ) ? "0" : c.get("equipCount").toString())).sum() : 0)
// .sum();
jsonObject
.
put
(
"total"
,
agentCountAll
);
jsonObject
.
put
(
"count"
,
agentCountAll
);
}
else
{
}
else
{
jsonObject
.
put
(
"total"
,
0
);
jsonObject
.
put
(
TOTAL
,
0
);
jsonObject
.
put
(
"count"
,
0
);
jsonObject
.
put
(
COUNT
,
0
);
}
}
resourceStatistics
.
put
(
jsonKey
,
jsonObject
);
resourceStatistics
.
put
(
jsonKey
,
jsonObject
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/PowerrTransferLogServiceImpl.java
View file @
5b66aa10
...
@@ -115,9 +115,9 @@ public class PowerrTransferLogServiceImpl extends BaseService<PowerrTransferLogD
...
@@ -115,9 +115,9 @@ public class PowerrTransferLogServiceImpl extends BaseService<PowerrTransferLogD
final
String
receiveName
=
personName
;
final
String
receiveName
=
personName
;
List
<
PowerrTransferLog
>
list
=
new
ArrayList
<>();
List
<
PowerrTransferLog
>
list
=
new
ArrayList
<>();
if
(
FireBrigadeTypeEnum
.
专职消防队
.
getKey
().
equals
(
powerTransType
))
{
if
(
FireBrigadeTypeEnum
.
专职消防队
.
getKey
().
equals
(
powerTransType
))
{
List
<
Object
>
companyDetail
=
JSON
Array
.
parseArray
(
JSON
.
toJSON
(
alertCallePowerTransferRo
.
getCompany
()).
toString
(),
Object
.
class
);
List
<
Object
>
companyDetail
=
JSON
.
parseArray
(
JSON
.
toJSON
(
alertCallePowerTransferRo
.
getCompany
()).
toString
(),
Object
.
class
);
for
(
Object
powerTransferCompanyDto
:
companyDetail
)
{
for
(
Object
powerTransferCompanyDto
:
companyDetail
)
{
PowerTransferCompanyDto
powerDto
=
JSON
Object
.
parseObject
(
JSON
.
toJSON
(
powerTransferCompanyDto
).
toString
(),
PowerTransferCompanyDto
.
class
);
PowerTransferCompanyDto
powerDto
=
JSON
.
parseObject
(
JSON
.
toJSON
(
powerTransferCompanyDto
).
toString
(),
PowerTransferCompanyDto
.
class
);
List
<
PowerTransferCompanyResourcesDto
>
powerTransferCompanyResourcesDtoList
=
powerDto
.
getPowerTransferCompanyResourcesDtoList
();
List
<
PowerTransferCompanyResourcesDto
>
powerTransferCompanyResourcesDtoList
=
powerDto
.
getPowerTransferCompanyResourcesDtoList
();
powerTransferCompanyResourcesDtoList
.
stream
().
forEach
(
f
->
{
powerTransferCompanyResourcesDtoList
.
stream
().
forEach
(
f
->
{
PowerrTransferLog
pw
=
new
PowerrTransferLog
();
PowerrTransferLog
pw
=
new
PowerrTransferLog
();
...
@@ -135,9 +135,9 @@ public class PowerrTransferLogServiceImpl extends BaseService<PowerrTransferLogD
...
@@ -135,9 +135,9 @@ public class PowerrTransferLogServiceImpl extends BaseService<PowerrTransferLogD
});
});
}
}
}
else
if
(
FireBrigadeTypeEnum
.
医疗救援队
.
getKey
().
equals
(
powerTransType
)
||
FireBrigadeTypeEnum
.
监控大队
.
getKey
().
equals
(
powerTransType
))
{
}
else
if
(
FireBrigadeTypeEnum
.
医疗救援队
.
getKey
().
equals
(
powerTransType
)
||
FireBrigadeTypeEnum
.
监控大队
.
getKey
().
equals
(
powerTransType
))
{
List
<
Object
>
companyDetail
=
JSON
Array
.
parseArray
(
JSON
.
toJSON
(
alertCallePowerTransferRo
.
getCompany
()).
toString
(),
Object
.
class
);
List
<
Object
>
companyDetail
=
JSON
.
parseArray
(
JSON
.
toJSON
(
alertCallePowerTransferRo
.
getCompany
()).
toString
(),
Object
.
class
);
for
(
Object
powerTransferCompanyDto
:
companyDetail
)
{
for
(
Object
powerTransferCompanyDto
:
companyDetail
)
{
PowerTransferCompanyDto
powerDto
=
JSON
Object
.
parseObject
(
JSON
.
toJSON
(
powerTransferCompanyDto
).
toString
(),
PowerTransferCompanyDto
.
class
);
PowerTransferCompanyDto
powerDto
=
JSON
.
parseObject
(
JSON
.
toJSON
(
powerTransferCompanyDto
).
toString
(),
PowerTransferCompanyDto
.
class
);
PowerrTransferLog
pw
=
new
PowerrTransferLog
();
PowerrTransferLog
pw
=
new
PowerrTransferLog
();
pw
.
setTeamId
(
powerDto
.
getSequenceNbr
());
pw
.
setTeamId
(
powerDto
.
getSequenceNbr
());
pw
.
setReceiveName
(
receiveName
);
pw
.
setReceiveName
(
receiveName
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/RuleAlertCalledService.java
View file @
5b66aa10
...
@@ -54,6 +54,8 @@ public class RuleAlertCalledService {
...
@@ -54,6 +54,8 @@ public class RuleAlertCalledService {
AlertCalledServiceImpl
alertCalledServiceImpl
;
AlertCalledServiceImpl
alertCalledServiceImpl
;
private
static
final
String
DANGEROUSEXPLOSIVES
=
"dangerousExplosives"
;
/**
/**
*
*
* <pre>
* <pre>
...
@@ -134,7 +136,7 @@ public class RuleAlertCalledService {
...
@@ -134,7 +136,7 @@ public class RuleAlertCalledService {
{
{
alertCalledRo
.
setFireSituation
(
alertFormValue
.
getFieldValue
());
alertCalledRo
.
setFireSituation
(
alertFormValue
.
getFieldValue
());
}
}
if
(
alertFormValue
.
getFieldCode
().
equals
(
"dangerousExplosives"
))
if
(
alertFormValue
.
getFieldCode
().
equals
(
DANGEROUSEXPLOSIVES
))
{
{
alertCalledRo
.
setDangerousExplosives
(
alertFormValue
.
getFieldValue
());
alertCalledRo
.
setDangerousExplosives
(
alertFormValue
.
getFieldValue
());
}
}
...
@@ -297,7 +299,7 @@ public class RuleAlertCalledService {
...
@@ -297,7 +299,7 @@ public class RuleAlertCalledService {
if
(
alertFormValue
.
getKey
().
equals
(
"fireSituation"
))
{
if
(
alertFormValue
.
getKey
().
equals
(
"fireSituation"
))
{
alertCallePowerTransferRo
.
setFireSituation
(
alertFormValue
.
getValue
());
alertCallePowerTransferRo
.
setFireSituation
(
alertFormValue
.
getValue
());
}
}
if
(
alertFormValue
.
getKey
().
equals
(
"dangerousExplosives"
))
{
if
(
alertFormValue
.
getKey
().
equals
(
DANGEROUSEXPLOSIVES
))
{
alertCallePowerTransferRo
.
setDangerousExplosives
(
alertFormValue
.
getValue
());
alertCallePowerTransferRo
.
setDangerousExplosives
(
alertFormValue
.
getValue
());
}
}
if
(
alertFormValue
.
getKey
().
equals
(
"fireTime"
))
{
if
(
alertFormValue
.
getKey
().
equals
(
"fireTime"
))
{
...
@@ -312,7 +314,7 @@ public class RuleAlertCalledService {
...
@@ -312,7 +314,7 @@ public class RuleAlertCalledService {
if
(
alertFormValue
.
getKey
().
equals
(
"ageGroup"
))
{
if
(
alertFormValue
.
getKey
().
equals
(
"ageGroup"
))
{
ageGroup
=
alertFormValue
.
getValue
();
ageGroup
=
alertFormValue
.
getValue
();
}
}
if
(
alertFormValue
.
getKey
().
equals
(
"dangerousExplosives"
))
{
if
(
alertFormValue
.
getKey
().
equals
(
DANGEROUSEXPLOSIVES
))
{
dangerousExplosives
=
alertFormValue
.
getValue
();
dangerousExplosives
=
alertFormValue
.
getValue
();
}
}
}
}
...
...
amos-boot-system-equip/src/main/resources/mapper/FireFightingSystemMapper.xml
View file @
5b66aa10
...
@@ -58,7 +58,7 @@
...
@@ -58,7 +58,7 @@
<select
id=
"getEquiplistBySystemIdList"
resultMap=
"EquiplistBySystemId"
>
<select
id=
"getEquiplistBySystemIdList"
resultMap=
"EquiplistBySystemId"
>
SELECT
SELECT
det.`name` equipmentName,
spe.`iot_code` iotCode,
spe.`iot_code` iotCode,
ein.equipment_index_name indexName,
ein.equipment_index_name indexName,
ein.equipment_index_key indexKey,
ein.equipment_index_key indexKey,
...
...
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