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
62631784
Commit
62631784
authored
Apr 28, 2022
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改随车人员,
parent
3c9738c6
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
183 additions
and
65 deletions
+183
-65
PointTreeVo.java
...com/yeejoin/equipmanage/common/entity/vo/PointTreeVo.java
+4
-1
PowerTransferMapper.xml
...jcs-api/src/main/resources/mapper/PowerTransferMapper.xml
+2
-1
EquipmentDetailController.java
...oin/equipmanage/controller/EquipmentDetailController.java
+42
-4
EquipmentDetailServiceImpl.java
.../equipmanage/service/impl/EquipmentDetailServiceImpl.java
+12
-1
StockServiceImpl.java
...om/yeejoin/equipmanage/service/impl/StockServiceImpl.java
+16
-14
PowerTransferServiceImpl.java
...module/jcs/biz/service/impl/PowerTransferServiceImpl.java
+102
-41
FireFightingSystemMapper.xml
...ip/src/main/resources/mapper/FireFightingSystemMapper.xml
+5
-3
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/vo/PointTreeVo.java
View file @
62631784
...
@@ -145,5 +145,8 @@ public class PointTreeVo {
...
@@ -145,5 +145,8 @@ public class PointTreeVo {
private
String
address
;
private
String
address
;
/**
* 装备编码
*/
private
String
code
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/resources/mapper/PowerTransferMapper.xml
View file @
62631784
...
@@ -308,7 +308,8 @@
...
@@ -308,7 +308,8 @@
SELECT DISTINCT
SELECT DISTINCT
car.resources_id sequenceNbr,
car.resources_id sequenceNbr,
car.resources_name,
car.resources_name,
'car' type
'car' type,
car.car_status carState
FROM
FROM
jc_power_transfer_company_resources car
jc_power_transfer_company_resources car
LEFT JOIN jc_power_transfer_company company ON company.sequence_nbr = car.power_transfer_company_id
LEFT JOIN jc_power_transfer_company company ON company.sequence_nbr = car.power_transfer_company_id
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/EquipmentDetailController.java
View file @
62631784
...
@@ -10,6 +10,7 @@ import com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto;
...
@@ -10,6 +10,7 @@ import com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto;
import
com.yeejoin.amos.boot.biz.common.interceptors.PermissionInterceptorContext
;
import
com.yeejoin.amos.boot.biz.common.interceptors.PermissionInterceptorContext
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.equipmanage.common.entity.*
;
import
com.yeejoin.equipmanage.common.entity.*
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentDetailDownloadVO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentDetailDownloadVO
;
import
com.yeejoin.equipmanage.common.enums.ExcelEnums
;
import
com.yeejoin.equipmanage.common.enums.ExcelEnums
;
...
@@ -67,6 +68,7 @@ public class EquipmentDetailController extends AbstractBaseController {
...
@@ -67,6 +68,7 @@ public class EquipmentDetailController extends AbstractBaseController {
@Autowired
@Autowired
IEquipmentDetailService
iEquipmentDetailService
;
IEquipmentDetailService
iEquipmentDetailService
;
@Autowired
@Autowired
EquipmentDetailMapper
equipmentDetailMapper
;
EquipmentDetailMapper
equipmentDetailMapper
;
@Autowired
@Autowired
...
@@ -580,16 +582,52 @@ public class EquipmentDetailController extends AbstractBaseController {
...
@@ -580,16 +582,52 @@ public class EquipmentDetailController extends AbstractBaseController {
// }
// }
// List<EquipmentDetailDownloadTemplateVO> equipmentDetailDownloadS = ExcelUtils.importExcel(file, 1, 1, EquipmentDetailDownloadTemplateVO.class);
// List<EquipmentDetailDownloadTemplateVO> equipmentDetailDownloadS = ExcelUtils.importExcel(file, 1, 1, EquipmentDetailDownloadTemplateVO.class);
Object
date
=
""
;
String
key
=
""
;
try
{
UUID
uuid
=
UUID
.
randomUUID
();
key
=
uuid
.
toString
();
ExcelEnums
excelEnums
=
ExcelEnums
.
getByKey
(
type
);
ExcelEnums
excelEnums
=
ExcelEnums
.
getByKey
(
type
);
ExcelDto
excelDto
=
new
ExcelDto
(
excelEnums
.
getFileName
(),
excelEnums
.
getSheetName
(),
excelEnums
.
getClassUrl
(),
excelEnums
.
getType
());
ExcelDto
excelDto
=
new
ExcelDto
(
excelEnums
.
getFileName
(),
excelEnums
.
getSheetName
(),
excelEnums
.
getClassUrl
(),
excelEnums
.
getType
());
// date= excelService.commonUpload(file, excelDto, getSelectedOrgInfo(), getUserInfo());
date
=
excelService
.
commonUpload
(
file
,
excelDto
,
getSelectedOrgInfo
(),
getUserInfo
());
EquipmentDetailController
controllerProxy1
=
SpringUtils
.
getBean
(
EquipmentDetailController
.
class
);
controllerProxy1
.
commonUpload
(
file
,
excelDto
,
key
,
getSelectedOrgInfo
(),
getUserInfo
());
EquipmentDetailController
controllerProxy
=
SpringUtils
.
getBean
(
EquipmentDetailController
.
class
);
EquipmentDetailController
controllerProxy
=
SpringUtils
.
getBean
(
EquipmentDetailController
.
class
);
controllerProxy
.
refreshAllCount
();
controllerProxy
.
refreshAllCount
();
return
ResponseHelper
.
buildResponse
(
date
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
BadRequest
(
e
.
getMessage
());
}
return
ResponseHelper
.
buildResponse
(
key
);
}
@Async
public
void
commonUpload
(
MultipartFile
file
,
ExcelDto
excelDto
,
String
key
,
ReginParams
reginParams
,
AgencyUserModel
user
)
{
synchronized
(
this
.
getClass
()){
Object
date
=
""
;
date
=
excelService
.
commonUpload
(
file
,
excelDto
,
reginParams
,
user
);
redisUtils
.
set
(
key
,
date
);
}
}
}
@RequestMapping
(
value
=
"/getUpload/{key}"
,
method
=
RequestMethod
.
GET
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id查询上传进度"
,
notes
=
"根据id查询上传进度"
)
public
ResponseModel
<
Object
>
getUpload
(
@PathVariable
String
key
)
{
if
(
redisUtils
.
hasKey
(
key
)){
return
ResponseHelper
.
buildResponse
(
redisUtils
.
get
(
key
));
}
else
{
return
ResponseHelper
.
buildResponse
(
null
);
}
}
@Async
@Async
public
void
refreshAllCount
()
{
public
void
refreshAllCount
()
{
// 清空单位装备分类树缓存
// 清空单位装备分类树缓存
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentDetailServiceImpl.java
View file @
62631784
...
@@ -6,16 +6,22 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...
@@ -6,16 +6,22 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto
;
import
com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.equipmanage.common.entity.*
;
import
com.yeejoin.equipmanage.common.entity.*
;
import
com.yeejoin.equipmanage.common.enums.BillContentEnum
;
import
com.yeejoin.equipmanage.common.enums.BillContentEnum
;
import
com.yeejoin.equipmanage.common.enums.FileTypeEnum
;
import
com.yeejoin.equipmanage.common.enums.FileTypeEnum
;
import
com.yeejoin.equipmanage.common.utils.StringUtil
;
import
com.yeejoin.equipmanage.common.utils.StringUtil
;
import
com.yeejoin.equipmanage.dto.ExcelDto
;
import
com.yeejoin.equipmanage.mapper.*
;
import
com.yeejoin.equipmanage.mapper.*
;
import
com.yeejoin.equipmanage.service.*
;
import
com.yeejoin.equipmanage.service.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.HashMap
;
...
@@ -68,7 +74,10 @@ public class EquipmentDetailServiceImpl extends ServiceImpl<EquipmentDetailMappe
...
@@ -68,7 +74,10 @@ public class EquipmentDetailServiceImpl extends ServiceImpl<EquipmentDetailMappe
private
IEquipmentSpecificIndexSerivce
equipmentSpecificIndexSerivce
;
private
IEquipmentSpecificIndexSerivce
equipmentSpecificIndexSerivce
;
@Autowired
@Autowired
JCSRemoteService
jcsRemoteService
;
JCSRemoteService
jcsRemoteService
;
@Autowired
private
RedisUtils
redisUtils
;
@Autowired
private
IExcelService
excelService
;
@Value
(
"${fileserver_domain}"
)
@Value
(
"${fileserver_domain}"
)
private
String
fileServer
;
private
String
fileServer
;
...
@@ -299,4 +308,6 @@ public class EquipmentDetailServiceImpl extends ServiceImpl<EquipmentDetailMappe
...
@@ -299,4 +308,6 @@ public class EquipmentDetailServiceImpl extends ServiceImpl<EquipmentDetailMappe
public
List
<
OrgMenuDto
>
companyDeptTree
()
{
public
List
<
OrgMenuDto
>
companyDeptTree
()
{
return
jcsRemoteService
.
getCompanyDeptTreeWithAuth
(
authKey
,
null
);
return
jcsRemoteService
.
getCompanyDeptTreeWithAuth
(
authKey
,
null
);
}
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/StockServiceImpl.java
View file @
62631784
...
@@ -294,9 +294,9 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
...
@@ -294,9 +294,9 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
StringBuffer
errBufferName
=
new
StringBuffer
();
StringBuffer
errBufferName
=
new
StringBuffer
();
StringBuffer
erryy
=
new
StringBuffer
();
StringBuffer
erryy
=
new
StringBuffer
();
int
errNum
=
0
;
//失败条数
// StringBuffer errNum="0"
; //失败条数
int
okNum
=
0
;
//成功条数
// StringBuffer okNum="0"
; //成功条数
errBufferName
.
append
(
"导入失败装备:"
);
//
errBufferName.append("导入失败装备:");
SimpleDateFormat
stf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
SimpleDateFormat
stf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
List
<
EquipmentSpecific
>
list
=
new
ArrayList
<>();
List
<
EquipmentSpecific
>
list
=
new
ArrayList
<>();
try
{
try
{
...
@@ -478,8 +478,8 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
...
@@ -478,8 +478,8 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
for
(
int
i
=
0
;
i
<
equipmentDetailDownloadVOS
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
equipmentDetailDownloadVOS
.
size
();
i
++)
{
try
{
try
{
seveRK
(
equipmentDetailDownloadVOS
.
get
(
i
),
reginParams
,
agencyUserModel
,
fireFightSysIdsBuffer
,
list
,
errBufferName
,
erryy
,
errNum
,
seveRK
(
equipmentDetailDownloadVOS
.
get
(
i
),
reginParams
,
agencyUserModel
,
okNum
);
fireFightSysIdsBuffer
,
list
,
errBufferName
,
erryy
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
@@ -503,11 +503,13 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
...
@@ -503,11 +503,13 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
//处理异常 返回 成功失败条数
//处理异常 返回 成功失败条数
e
.
printStackTrace
();
e
.
printStackTrace
();
String
date
=
"上传成功:"
+
okNum
+
"条---上传失败:"
+
errNum
+
"条(失败编号:"
+
errBufferName
+
"详情:"
+
erryy
+
")"
;
String
[]
split
=
errBufferName
.
toString
().
split
(
","
);
String
date
=
"上传成功:"
+(
equipmentDetailDownloadVOS
.
size
()-(
split
!=
null
?
split
.
length
:
0
))+
"条---上传失败:"
+(
split
!=
null
?
split
.
length
:
0
)+
"条(失败编号:"
+
errBufferName
+
"详情:"
+
erryy
+
")"
;
log
.
error
(
date
);
log
.
error
(
date
);
return
date
;
return
date
;
}
}
String
date
=
"上传成功:"
+
okNum
+
"条---上传失败:"
+
errNum
+
"条(失败编号:"
+
errBufferName
+
"详情:"
+
erryy
+
")"
;
String
[]
split
=
errBufferName
.
toString
().
split
(
","
);
String
date
=
"上传成功:"
+(
equipmentDetailDownloadVOS
.
size
()-(
split
!=
null
?
split
.
length
:
0
))+
"条---上传失败:"
+(
split
!=
null
?
split
.
length
:
0
)+
"条(失败编号:"
+
errBufferName
+
"详情:"
+
erryy
+
")"
;
log
.
error
(
date
);
log
.
error
(
date
);
return
date
;
return
date
;
}
}
...
@@ -519,9 +521,8 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
...
@@ -519,9 +521,8 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
StringBuffer
fireFightSysIdsBuffer
,
StringBuffer
fireFightSysIdsBuffer
,
List
<
EquipmentSpecific
>
list
,
List
<
EquipmentSpecific
>
list
,
StringBuffer
errBufferName
,
StringBuffer
errBufferName
,
StringBuffer
erryy
,
StringBuffer
erryy
int
errNum
,
int
okNum
){
){
SimpleDateFormat
stf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
SimpleDateFormat
stf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
...
@@ -533,13 +534,14 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
...
@@ -533,13 +534,14 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
equipmentQueryWrapper
.
lambda
().
eq
(
Equipment:
:
getCode
,
equipmentDetailDownloadVOS
.
getCode
());
equipmentQueryWrapper
.
lambda
().
eq
(
Equipment:
:
getCode
,
equipmentDetailDownloadVOS
.
getCode
());
Equipment
equipment
=
equipmentMapper
.
selectOne
(
equipmentQueryWrapper
);
Equipment
equipment
=
equipmentMapper
.
selectOne
(
equipmentQueryWrapper
);
if
(
equipment
==
null
)
{
if
(
equipment
==
null
)
{
erryy
.
append
(
String
.
format
(
"装备(器材)编码[%S]填写错误,请输入正确的装备(器材)编码!"
,
equipmentDetailDownloadVOS
.
getCode
())
+
","
);
throw
new
RuntimeException
(
String
.
format
(
"装备(器材)编码[%S]填写错误,请输入正确的装备(器材)编码!"
,
equipmentDetailDownloadVOS
.
getCode
()));
throw
new
RuntimeException
(
String
.
format
(
"装备(器材)编码[%S]填写错误,请输入正确的装备(器材)编码!"
,
equipmentDetailDownloadVOS
.
getCode
()));
}
}
String
sysCode
=
equipmentDetailDownloadVOS
.
getSystemCode
();
String
sysCode
=
equipmentDetailDownloadVOS
.
getSystemCode
();
if
(
StringUtils
.
isNotEmpty
(
sysCode
)
&&
StringUtils
.
isNotEmpty
(
sysCode
.
trim
()))
{
if
(
StringUtils
.
isNotEmpty
(
sysCode
)
&&
StringUtils
.
isNotEmpty
(
sysCode
.
trim
()))
{
Integer
code
=
equipmentSpecificMapper
.
selectCount
(
new
QueryWrapper
<
EquipmentSpecific
>().
eq
(
"code"
,
sysCode
.
trim
()));
Integer
code
=
equipmentSpecificMapper
.
selectCount
(
new
QueryWrapper
<
EquipmentSpecific
>().
eq
(
"code"
,
sysCode
.
trim
()));
if
(
code
!=
0
)
{
if
(
code
!=
0
)
{
erryy
.
append
(
String
.
format
(
"设备编码[%S]填写重复,请重新输入!"
,
sysCode
)+
","
);
throw
new
RuntimeException
(
String
.
format
(
"设备编码[%S]填写重复,请重新输入!"
,
sysCode
));
throw
new
RuntimeException
(
String
.
format
(
"设备编码[%S]填写重复,请重新输入!"
,
sysCode
));
}
}
}
}
...
@@ -547,10 +549,11 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
...
@@ -547,10 +549,11 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
if
(
StringUtils
.
isNotEmpty
(
iot
)
&&
StringUtils
.
isNotEmpty
(
iot
.
trim
()))
{
if
(
StringUtils
.
isNotEmpty
(
iot
)
&&
StringUtils
.
isNotEmpty
(
iot
.
trim
()))
{
Integer
iot_code
=
equipmentSpecificMapper
.
selectCount
(
new
QueryWrapper
<
EquipmentSpecific
>().
eq
(
"iot_code"
,
iot
.
trim
()));
Integer
iot_code
=
equipmentSpecificMapper
.
selectCount
(
new
QueryWrapper
<
EquipmentSpecific
>().
eq
(
"iot_code"
,
iot
.
trim
()));
if
(
iot_code
!=
0
)
{
if
(
iot_code
!=
0
)
{
erryy
.
append
(
String
.
format
(
"物联编码[%S]填写重复,请重新输入!"
,
iot
)+
","
);
throw
new
RuntimeException
(
String
.
format
(
"物联编码[%S]填写重复,请重新输入!"
,
iot
));
throw
new
RuntimeException
(
String
.
format
(
"物联编码[%S]填写重复,请重新输入!"
,
iot
));
}
}
if
(
iot
.
startsWith
(
"20210003"
)||
iot
.
startsWith
(
"20210004"
)||
iot
.
startsWith
(
"20210005"
)){
if
(
iot
.
startsWith
(
"20210003"
)||
iot
.
startsWith
(
"20210004"
)||
iot
.
startsWith
(
"20210005"
)){
erryy
.
append
(
String
.
format
(
"物联编码[%S]航班已占用,请重新输入!"
,
iot
)+
","
);
throw
new
BadRequest
(
"物联编码航班已占用"
);
throw
new
BadRequest
(
"物联编码航班已占用"
);
}
}
}
}
...
@@ -640,6 +643,7 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
...
@@ -640,6 +643,7 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
warehouseStructureQueryWrapper
.
lambda
().
eq
(
WarehouseStructure:
:
getCode
,
equipmentDetailDownloadVOS
.
getWarehouseStructCode
());
warehouseStructureQueryWrapper
.
lambda
().
eq
(
WarehouseStructure:
:
getCode
,
equipmentDetailDownloadVOS
.
getWarehouseStructCode
());
WarehouseStructure
warehouseStructure
=
warehouseStructureService
.
getOne
(
warehouseStructureQueryWrapper
);
WarehouseStructure
warehouseStructure
=
warehouseStructureService
.
getOne
(
warehouseStructureQueryWrapper
);
if
(
warehouseStructure
==
null
)
{
if
(
warehouseStructure
==
null
)
{
erryy
.
append
(
String
.
format
(
"货位编码[%S]填写错误,请输入正确的货位编码!"
,
equipmentDetailDownloadVOS
.
getWarehouseStructCode
())+
","
);
throw
new
RuntimeException
(
String
.
format
(
"货位编码[%S]填写错误,请输入正确的货位编码!"
,
equipmentDetailDownloadVOS
.
getWarehouseStructCode
()));
throw
new
RuntimeException
(
String
.
format
(
"货位编码[%S]填写错误,请输入正确的货位编码!"
,
equipmentDetailDownloadVOS
.
getWarehouseStructCode
()));
}
else
{
}
else
{
equipmentSpecific
.
setPosition
(
warehouseStructure
.
getFullName
());
equipmentSpecific
.
setPosition
(
warehouseStructure
.
getFullName
());
...
@@ -706,10 +710,8 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
...
@@ -706,10 +710,8 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
list
.
add
(
equipmentSpecific
);
list
.
add
(
equipmentSpecific
);
this
.
equipmentSpecificIndexSave
(
equipmentDetail
,
equipmentSpecific
);
this
.
equipmentSpecificIndexSave
(
equipmentDetail
,
equipmentSpecific
);
platformTransactionManager
.
commit
(
transactionStatus
);
platformTransactionManager
.
commit
(
transactionStatus
);
okNum
=
okNum
+
1
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
platformTransactionManager
.
rollback
(
transactionStatus
);
platformTransactionManager
.
rollback
(
transactionStatus
);
errNum
=
errNum
+
1
;
errBufferName
.
append
(
equipmentDetailDownloadVOS
.
getCode
()
+
","
);
errBufferName
.
append
(
equipmentDetailDownloadVOS
.
getCode
()
+
","
);
e
.
printStackTrace
();
e
.
printStackTrace
();
...
...
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 @
62631784
...
@@ -3,8 +3,8 @@ package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
...
@@ -3,8 +3,8 @@ 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.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.
module.common.api.entity.DutyShift
;
import
com.yeejoin.amos.boot.
biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper
;
import
com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper
;
import
com.yeejoin.amos.boot.module.common.api.mapper.DutyShiftMapper
;
import
com.yeejoin.amos.boot.module.common.api.mapper.DutyShiftMapper
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
...
@@ -30,7 +30,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
...
@@ -30,7 +30,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.module.common.api.dto.FireBrigadeResourceDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FireBrigadeResourceDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.FireTeam
;
import
com.yeejoin.amos.boot.module.common.api.entity.FireTeam
;
import
com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient
;
import
com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient
;
...
@@ -772,35 +771,55 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
...
@@ -772,35 +771,55 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
IPage
<
PowerTransferResourceDto
>
carResourcePage
=
powerTransferMapper
IPage
<
PowerTransferResourceDto
>
carResourcePage
=
powerTransferMapper
.
getPowerTransferCarResource
(
new
Page
<>(
1L
,
Long
.
MAX_VALUE
),
alertCalledId
);
.
getPowerTransferCarResource
(
new
Page
<>(
1L
,
Long
.
MAX_VALUE
),
alertCalledId
);
// 调派的车辆id列表
// 调派的车辆id列表
List
<
Long
>
carIdList
=
Lists
.
transform
(
carResourcePage
.
getRecords
(),
PowerTransferResourceDto:
:
getSequenceNbr
);
List
<
Long
>
carIdList
=
Lists
.
transform
(
carResourcePage
.
getRecords
(),
PowerTransferResourceDto:
:
getSequenceNbr
);
// 调派的车辆信息列表
// 调派的车辆信息列表
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 车辆枚举后期修改为已到达状态车辆
// TODO 车辆枚举后期修改为已到达状态车辆
List
<
Map
<
String
,
Object
>>
arrivedCarList
=
carList
.
stream
()
// List<Map<String, Object>> arrivedCarList = carList.stream()
.
filter
(
c
->
carIdList
.
contains
(
Long
.
valueOf
((
String
)
c
.
get
(
"id"
)))
// .filter(c -> carIdList.contains(Long.valueOf((String) c.get("id")))
&&
FireCarStatusEnum
.
到场
.
getCode
().
equals
(
c
.
get
(
"carState"
)))
// && FireCarStatusEnum.执勤.getCode().equals(c.get("carState")))
.
collect
(
Collectors
.
toList
());
// .collect(Collectors.toList());
// 调派-已到达车辆id列表
// 调派-已到达车辆id列表
List
<
Long
>
arrivedCarIdList
=
Lists
.
newArrayList
();
List
<
Long
>
arrivedCarIdList
=
Lists
.
newArrayList
();
arrivedCarList
.
forEach
(
c
->
{
// arrivedCarList.forEach(c -> {
if
(
FireCarStatusEnum
.
到场
.
getCode
().
equals
(
c
.
get
(
"carState"
)))
{
// if (FireCarStatusEnum.到场.getCode().equals(c.get("carState"))) {
arrivedCarIdList
.
add
(
Long
.
valueOf
((
String
)
c
.
get
(
"id"
)));
// arrivedCarIdList.add(Long.valueOf((String) c.get("id")));
// }
// });
List
<
PowerTransferResourceDto
>
tot
=
null
;
if
(
carResourcePage
.
getRecords
()!=
null
&&
carResourcePage
.
getRecords
().
size
()>
0
){
carResourcePage
.
getRecords
().
forEach
(
c
->
{
if
(
FireCarStatusEnum
.
到场
.
getCode
().
equals
(
c
.
getCarState
()))
{
arrivedCarIdList
.
add
(
c
.
getSequenceNbr
());
}
}
});
});
}
JSONObject
resourceStatistics
=
new
JSONObject
();
JSONObject
resourceStatistics
=
new
JSONObject
();
double
carTotal
=
carResourcePage
.
getTotal
();
double
carTotal
=
carResourcePage
.
getTotal
();
// 车辆统计
// 车辆统计
carCount
(
arrivedCarList
,
resourceStatistics
,
carTotal
,
"car"
);
carCount
(
arrivedCar
Id
List
,
resourceStatistics
,
carTotal
,
"car"
);
// 车辆人员统计
// 车辆人员统计
dutyPersonCount
(
carIdList
,
arrivedCarIdList
,
resourceStatistics
);
dutyPersonCount
(
carIdList
,
arrivedCarIdList
,
resourceStatistics
);
// 车载器材统计
// 车载器材统计
fireAgentOnCarCount
(
totalCarList
,
arrivedCarList
,
resourceStatistics
,
"equipment"
,
"equip"
);
fireAgentOnCarCount
(
totalCarList
,
arrivedCar
Id
List
,
resourceStatistics
,
"equipment"
,
"equip"
);
// 车载药剂统计 车载水量统计
// 车载药剂统计 车载水量统计
...
@@ -812,11 +831,17 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
...
@@ -812,11 +831,17 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
return
resourceStatistics
;
return
resourceStatistics
;
}
}
public
void
carCount
(
List
<
Map
<
String
,
Object
>
>
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
();
car
.
put
(
"total"
,
carTotal
);
if
(
carTotal
>
0
){
car
.
put
(
"total"
,
arrivedCarList
.
size
());
car
.
put
(
"count"
,
arrivedCarList
.
size
());
car
.
put
(
"count"
,
arrivedCarList
.
size
());
}
else
{
car
.
put
(
"total"
,
0
);
car
.
put
(
"count"
,
0
);
}
resourceStatistics
.
put
(
jsoKey
,
car
);
resourceStatistics
.
put
(
jsoKey
,
car
);
}
}
...
@@ -824,58 +849,94 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
...
@@ -824,58 +849,94 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
public
void
waterCount
(
List
<
Long
>
carIds
,
JSONObject
resourceStatistics
,
double
carTotal
,
public
void
waterCount
(
List
<
Long
>
carIds
,
JSONObject
resourceStatistics
,
double
carTotal
,
String
jsoKey
)
{
String
jsoKey
)
{
JSONObject
obj
=
new
JSONObject
();
JSONObject
obj
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
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
jsonObject
=
new
JSONObject
();
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
);
resourceStatistics
.
put
(
"medicament"
,
jsonObject
);
}
else
{
obj
.
put
(
"total"
,
0
);
obj
.
put
(
"count"
,
0
);
jsonObject
.
put
(
"total"
,
0
);
jsonObject
.
put
(
"count"
,
0
);
}
resourceStatistics
.
put
(
"medicament"
,
jsonObject
);
resourceStatistics
.
put
(
jsoKey
,
obj
);
resourceStatistics
.
put
(
jsoKey
,
obj
);
}
}
public
void
dutyPersonCount
(
List
<
Long
>
carIdList
,
List
<
Long
>
arrivedCarIdList
,
JSONObject
resourceStatistics
)
{
public
void
dutyPersonCount
(
List
<
Long
>
carIdList
,
List
<
Long
>
arrivedCarIdList
,
JSONObject
resourceStatistics
)
{
// 当前时间所在班次
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
());
JSONObject
person
=
new
JSONObject
();
JSONObject
person
=
new
JSONObject
();
person
.
put
(
"total"
,
allTransferDutyPerson
.
size
());
if
(
arrivedCarIdList
!=
null
&&
arrivedCarIdList
.
size
()>
0
){
person
.
put
(
"count"
,
allArrivedTransferDutyPerson
.
size
());
// // 当前时间所在班次
// 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
;
for
(
Long
aLong
:
arrivedCarIdList
)
{
List
<
Map
<
String
,
Object
>>
equipmentList
=
iDutyCarService
.
getDutyCaruser
(
aLong
);
num
=
num
+
equipmentList
.
size
();
}
person
.
put
(
"total"
,
num
);
person
.
put
(
"count"
,
num
);
}
else
{
person
.
put
(
"total"
,
0
);
person
.
put
(
"count"
,
0
);
}
resourceStatistics
.
put
(
"person"
,
person
);
resourceStatistics
.
put
(
"person"
,
person
);
}
}
public
void
fireAgentOnCarCount
(
List
<
Map
<
String
,
Object
>>
totalCarList
,
List
<
Map
<
String
,
Object
>
>
arrivedCarList
,
public
void
fireAgentOnCarCount
(
List
<
Map
<
String
,
Object
>>
totalCarList
,
List
<
Long
>
arrivedCarList
,
JSONObject
resourceStatistics
,
String
equipType
,
String
jsonKey
)
{
JSONObject
resourceStatistics
,
String
equipType
,
String
jsonKey
)
{
JSONObject
jsonObject
=
new
JSONObject
();
if
(
totalCarList
!=
null
&&
totalCarList
.
size
()>
0
){
double
agentCountAll
=
totalCarList
.
stream
().
mapToDouble
(
double
agentCountAll
=
totalCarList
.
stream
().
mapToDouble
(
car
->
car
.
get
(
"resourceList"
)
!=
null
?
((
List
<
Map
<
String
,
Object
>>)
car
.
get
(
"resourceList"
)).
stream
()
car
->
car
.
get
(
"resourceList"
)
!=
null
?
((
List
<
Map
<
String
,
Object
>>)
car
.
get
(
"resourceList"
)).
stream
()
.
filter
(
res
->
equipType
.
equals
(
res
.
get
(
"equipType"
)))
.
filter
(
res
->
equipType
.
equals
(
res
.
get
(
"equipType"
)))
.
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
(
// double agentCountArrived = arrivedCarList.stream().mapToDouble(
car
->
car
.
get
(
"resourceList"
)
!=
null
?
((
List
<
Map
<
String
,
Object
>>)
car
.
get
(
"resourceList"
)).
stream
()
// car -> car.get("resourceList") != null ? ((List<Map<String, Object>>) car.get("resourceList")).stream()
.
filter
(
res
->
equipType
.
equals
(
res
.
get
(
"equipType"
)))
// .filter(res -> equipType.equals(res.get("equipType")))
.
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();
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"total"
,
agentCountAll
);
jsonObject
.
put
(
"total"
,
agentCountAll
);
jsonObject
.
put
(
"count"
,
agentCountArrived
);
jsonObject
.
put
(
"count"
,
agentCountAll
);
}
else
{
jsonObject
.
put
(
"total"
,
0
);
jsonObject
.
put
(
"count"
,
0
);
}
resourceStatistics
.
put
(
jsonKey
,
jsonObject
);
resourceStatistics
.
put
(
jsonKey
,
jsonObject
);
}
}
...
...
amos-boot-system-equip/src/main/resources/mapper/FireFightingSystemMapper.xml
View file @
62631784
...
@@ -210,8 +210,9 @@
...
@@ -210,8 +210,9 @@
'equipment' as componentKey,
'equipment' as componentKey,
'equipment' as `key`,
'equipment' as `key`,
equ.img as imgPath,
equ.img as imgPath,
-- spe.qr_code as equipCode,
spe.qr_code as equipCode,
spe.code as equipCode,
-- spe.code as equipCode,
spe.code AS code,
stru.source_id as parentId,
stru.source_id as parentId,
cat.id as equipId,
cat.id as equipId,
cat.code as categoryCode,
cat.code as categoryCode,
...
@@ -256,7 +257,8 @@
...
@@ -256,7 +257,8 @@
'equipment' AS componentKey,
'equipment' AS componentKey,
'video' AS `key`,
'video' AS `key`,
img AS imgPath,
img AS imgPath,
vid.CODE AS equipCode,
vid.code AS equipCode,
vid.code AS code,
vis.source_id AS parentId,
vis.source_id AS parentId,
vid.id AS equipId,
vid.id AS equipId,
vid.CODE AS categoryCode,
vid.CODE AS categoryCode,
...
...
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