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
735575bb
Commit
735575bb
authored
Aug 17, 2021
by
kongfm
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
a8a76aea
eb7fd81d
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
268 additions
and
164 deletions
+268
-164
FailureDetailsDto.java
...in/amos/boot/module/common/api/dto/FailureDetailsDto.java
+1
-1
RequestData.java
.../yeejoin/amos/boot/module/common/api/dto/RequestData.java
+3
-0
FailureDetails.java
...in/amos/boot/module/common/api/entity/FailureDetails.java
+1
-1
FailureStatuEnum.java
...n/amos/boot/module/common/api/enums/FailureStatuEnum.java
+2
-2
EquipFeignClient.java
...n/amos/boot/module/common/api/feign/EquipFeignClient.java
+11
-1
CalendarStatusCountRespone.java
...ance/core/common/response/CalendarStatusCountRespone.java
+1
-1
CommandController.java
...boot/module/command/biz/controller/CommandController.java
+23
-0
FailureAuditController.java
.../module/common/biz/controller/FailureAuditController.java
+2
-4
FailureDetailsController.java
...odule/common/biz/controller/FailureDetailsController.java
+1
-1
FailureMaintainController.java
...dule/common/biz/controller/FailureMaintainController.java
+20
-4
FailureAuditServiceImpl.java
...dule/common/biz/service/impl/FailureAuditServiceImpl.java
+40
-10
FailureDetailsServiceImpl.java
...le/common/biz/service/impl/FailureDetailsServiceImpl.java
+14
-8
FailureMaintainServiceImpl.java
...e/common/biz/service/impl/FailureMaintainServiceImpl.java
+67
-16
CheckController.java
...amos/maintenance/business/controller/CheckController.java
+13
-20
CheckMapper.java
...oin/amos/maintenance/business/dao/mapper/CheckMapper.java
+2
-2
CheckServiceImpl.java
...s/maintenance/business/service/impl/CheckServiceImpl.java
+9
-19
PointServiceImpl.java
...s/maintenance/business/service/impl/PointServiceImpl.java
+33
-26
ICheckService.java
...mos/maintenance/business/service/intfc/ICheckService.java
+1
-1
IPointService.java
...mos/maintenance/business/service/intfc/IPointService.java
+1
-1
MaintenanceResourceData.java
...amos/maintenance/business/vo/MaintenanceResourceData.java
+4
-34
dbTemplate_check.xml
...tenance/src/main/resources/db/mapper/dbTemplate_check.xml
+19
-12
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/FailureDetailsDto.java
View file @
735575bb
...
@@ -49,7 +49,7 @@ public class FailureDetailsDto extends BaseDto {
...
@@ -49,7 +49,7 @@ public class FailureDetailsDto extends BaseDto {
private
Integer
submissionPid
;
private
Integer
submissionPid
;
@ApiModelProperty
(
value
=
"组织code"
)
@ApiModelProperty
(
value
=
"组织code"
)
private
Stri
ng
bizCode
;
private
Lo
ng
bizCode
;
@ApiModelProperty
(
value
=
"报送时间"
)
@ApiModelProperty
(
value
=
"报送时间"
)
private
Date
submissionTime
;
private
Date
submissionTime
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/RequestData.java
View file @
735575bb
...
@@ -36,4 +36,7 @@ public class RequestData {
...
@@ -36,4 +36,7 @@ public class RequestData {
@ApiModelProperty
(
value
=
"灾情状态"
)
@ApiModelProperty
(
value
=
"灾情状态"
)
private
int
status
=
0
;
private
int
status
=
0
;
@ApiModelProperty
(
value
=
"灾情ID"
)
private
Long
alertId
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/entity/FailureDetails.java
View file @
735575bb
...
@@ -76,7 +76,7 @@ public class FailureDetails extends BaseEntity {
...
@@ -76,7 +76,7 @@ public class FailureDetails extends BaseEntity {
* 组织code
* 组织code
*/
*/
@TableField
(
"biz_code"
)
@TableField
(
"biz_code"
)
private
Stri
ng
bizCode
;
private
Lo
ng
bizCode
;
/**
/**
* 报送时间
* 报送时间
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/enums/FailureStatuEnum.java
View file @
735575bb
...
@@ -7,8 +7,8 @@ public enum FailureStatuEnum {
...
@@ -7,8 +7,8 @@ public enum FailureStatuEnum {
WAITING_MAINTAIN
(
2
,
"待维修"
),
WAITING_MAINTAIN
(
2
,
"待维修"
),
WAITING_ACCEPTANCE
(
3
,
"待验收"
),
WAITING_ACCEPTANCE
(
3
,
"待验收"
),
REFUSE
(
4
,
"已拒绝"
),
REFUSE
(
4
,
"已拒绝"
),
FINISH
(
5
,
"已完结"
)
;
FINISH
(
5
,
"已完结"
)
,
IN_MAINTENANCE
(
6
,
"维修中"
);
private
FailureStatuEnum
(
Integer
code
,
String
name
){
private
FailureStatuEnum
(
Integer
code
,
String
name
){
this
.
code
=
code
;
this
.
code
=
code
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/feign/EquipFeignClient.java
View file @
735575bb
...
@@ -139,7 +139,17 @@ public interface EquipFeignClient {
...
@@ -139,7 +139,17 @@ public interface EquipFeignClient {
* @param
* @param
* @return
* @return
*/
*/
@RequestMapping
(
value
=
"/
/
building/video/page"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/building/video/page"
,
method
=
RequestMethod
.
GET
)
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
getVideo
(
@RequestParam
Page
page
,
@RequestParam
Long
buildingId
);
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
getVideo
(
@RequestParam
Page
page
,
@RequestParam
Long
buildingId
);
/**
*
*获取视频列表
* @param
* @return
*/
@RequestMapping
(
value
=
"/video/pageVideo"
,
method
=
RequestMethod
.
GET
)
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
pageVideo
(
@RequestParam
Integer
pageNum
,
@RequestParam
Integer
pageSize
,
@RequestParam
Double
longitude
,
@RequestParam
Double
latitude
,
@RequestParam
Double
distance
);
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-maintenance-api/src/main/java/com/yeejoin/amos/maintenance/core/common/response/CalendarStatusCountRespone.java
View file @
735575bb
...
@@ -6,7 +6,7 @@ public class CalendarStatusCountRespone {
...
@@ -6,7 +6,7 @@ public class CalendarStatusCountRespone {
/**
/**
* 个数
* 个数
*/
*/
private
d
ouble
count
;
private
D
ouble
count
;
/**
/**
* 状态
* 状态
*/
*/
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-command-biz/src/main/java/com/yeejoin/amos/boot/module/command/biz/controller/CommandController.java
View file @
735575bb
...
@@ -235,6 +235,29 @@ public class CommandController extends BaseController {
...
@@ -235,6 +235,29 @@ public class CommandController extends BaseController {
/**
* 水源列表分页查询
*
* @return
*/
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"video/list"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
" 视频分页查询88"
,
notes
=
"视频分页查询88"
)
public
ResponseModel
<
Object
>
getVideo
(
Integer
pageNum
,
Integer
pageSize
,
RequestData
par
)
{
if
(
par
.
getAlertId
()!=
null
){
AlertCalled
alertCalled
=
iAlertCalledService
.
getAlertCalledById
(
par
.
getAlertId
());
par
.
setLatitude
(
alertCalled
.
getCoordinateX
());
par
.
setLongitude
(
alertCalled
.
getCoordinateY
());
}
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
data
=
equipFeignClient
.
pageVideo
(
pageNum
,
pageSize
,
par
.
getLongitude
(),
par
.
getLatitude
(),
par
.
getDistance
());
return
ResponseHelper
.
buildResponse
(
data
!=
null
?
data
.
getResult
():
null
);
}
/**
/**
* 水源列表分页查询
* 水源列表分页查询
*
*
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/FailureAuditController.java
View file @
735575bb
...
@@ -40,10 +40,8 @@ public class FailureAuditController extends BaseController {
...
@@ -40,10 +40,8 @@ public class FailureAuditController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
public
ResponseModel
<
FailureAuditDto
>
save
(
@RequestBody
FailureAuditDto
model
)
throws
Exception
{
public
ResponseModel
<
Object
>
save
(
@RequestBody
FailureAuditDto
model
)
throws
Exception
{
return
ResponseHelper
.
buildResponse
(
failureAuditServiceImpl
.
savemodel
(
model
,
getSelectedOrgInfo
()));
model
=
failureAuditServiceImpl
.
savemodel
(
model
,
getSelectedOrgInfo
());
return
ResponseHelper
.
buildResponse
(
model
);
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/FailureDetailsController.java
View file @
735575bb
...
@@ -62,7 +62,7 @@ public class FailureDetailsController extends BaseController {
...
@@ -62,7 +62,7 @@ public class FailureDetailsController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
public
ResponseModel
<
Object
>
save
(
@RequestBody
FailureDetailsDto
model
)
{
public
ResponseModel
<
Object
>
save
(
@RequestBody
FailureDetailsDto
model
)
throws
Exception
{
return
ResponseHelper
.
buildResponse
(
failureDetailsServiceImpl
.
savemodel
(
model
,
getSelectedOrgInfo
()));
return
ResponseHelper
.
buildResponse
(
failureDetailsServiceImpl
.
savemodel
(
model
,
getSelectedOrgInfo
()));
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/FailureMaintainController.java
View file @
735575bb
...
@@ -38,8 +38,8 @@ public class FailureMaintainController extends BaseController {
...
@@ -38,8 +38,8 @@ public class FailureMaintainController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
public
ResponseModel
<
FailureMaintainDto
>
save
(
@RequestBody
FailureMaintainDto
model
,
ReginParams
userInfo
)
{
public
ResponseModel
<
Object
>
save
(
@RequestBody
FailureMaintainDto
model
)
{
model
=
failureMaintainServiceImpl
.
savemodel
(
model
,
userInfo
);
failureMaintainServiceImpl
.
savemodel
(
model
,
getSelectedOrgInfo
()
);
return
ResponseHelper
.
buildResponse
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
}
}
...
@@ -53,11 +53,27 @@ public class FailureMaintainController extends BaseController {
...
@@ -53,11 +53,27 @@ public class FailureMaintainController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"验收操作"
,
notes
=
"根据sequenceNbr更新"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"验收操作"
,
notes
=
"根据sequenceNbr更新"
)
public
Object
updateBySequenceNbrFailureMaintain
(
@RequestBody
FailureMaintainDto
model
,
Integer
status
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
,
ReginParams
userInfo
)
{
public
Object
updateBySequenceNbrFailureMaintain
(
@RequestBody
FailureMaintainDto
model
,
Integer
status
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
failureMaintainServiceImpl
.
updateModel
(
model
,
status
,
userInfo
));
return
ResponseHelper
.
buildResponse
(
failureMaintainServiceImpl
.
updateModel
(
model
,
status
,
getSelectedOrgInfo
()
));
}
}
/**
* 根据sequenceNbr更新
* 根据传递的Status状态确认验收状态
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/update/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"维修完成"
,
notes
=
"根据sequenceNbr更新"
)
public
Object
updateByFailureMaintain
(
@RequestBody
FailureMaintainDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
failureMaintainServiceImpl
.
updateStatus
(
model
,
getSelectedOrgInfo
()));
}
/*
/*
*/
*/
/**
/**
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/FailureAuditServiceImpl.java
View file @
735575bb
...
@@ -3,9 +3,13 @@ package com.yeejoin.amos.boot.module.common.biz.service.impl;
...
@@ -3,9 +3,13 @@ package com.yeejoin.amos.boot.module.common.biz.service.impl;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
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.transaction.interceptor.TransactionAspectSupport
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
@@ -36,6 +40,8 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
...
@@ -36,6 +40,8 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
@Autowired
@Autowired
FailureRepairlogServiceImpl
failureRepairlogService
;
FailureRepairlogServiceImpl
failureRepairlogService
;
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
FailureAuditServiceImpl
.
class
);
/**
/**
* 分页查询
* 分页查询
*/
*/
...
@@ -54,9 +60,15 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
...
@@ -54,9 +60,15 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
* 发起审核
* 发起审核
*/
*/
@Transactional
@Transactional
public
FailureAuditDto
savemodel
(
FailureAuditDto
model
,
ReginParams
userInfo
)
throws
Exception
{
public
Object
savemodel
(
FailureAuditDto
model
,
ReginParams
userInfo
)
throws
Exception
{
int
condition
=
Integer
.
parseInt
(
model
.
getCondition
());
int
condition
=
Integer
.
parseInt
(
model
.
getCondition
());
model
.
setAuditTime
(
new
Date
());
model
.
setAuditDepartmentId
(
userInfo
.
getDepartment
().
getSequenceNbr
());
model
.
setAuditor
(
userInfo
.
getRole
().
getRoleName
());
model
.
setAuditDepartment
(
userInfo
.
getDepartment
().
getDepartmentName
());
try
{
//根据审核的结果进行业务操作
//根据审核的结果进行业务操作
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
())
{
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
())
{
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_MAINTAIN
,
userInfo
,
condition
);
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_MAINTAIN
,
userInfo
,
condition
);
...
@@ -65,33 +77,49 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
...
@@ -65,33 +77,49 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
}
else
if
(
condition
==
(
AuditResultEnum
.
SEND_BACK
.
getCode
()))
{
}
else
if
(
condition
==
(
AuditResultEnum
.
SEND_BACK
.
getCode
()))
{
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_SUBMIT
,
userInfo
,
condition
);
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_SUBMIT
,
userInfo
,
condition
);
}
}
return
this
.
createWithModel
(
model
);
FailureAuditDto
withModel
=
this
.
createWithModel
(
model
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
e
.
printStackTrace
();
logger
.
info
(
"添加故障审核信息到数据库失败"
);
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
return
false
;
}
return
true
;
}
}
/**
/**
* 修改故障保修单任务状态
* 修改故障保修单任务状态
*/
*/
@Transactional
@Transactional
FailureDetailsDto
updateStatus
(
FailureAuditDto
model
,
FailureStatuEnum
status
,
ReginParams
userInfo
,
int
condition
)
throws
Exception
{
public
Boolean
updateStatus
(
FailureAuditDto
model
,
FailureStatuEnum
status
,
ReginParams
userInfo
,
int
condition
)
throws
Exception
{
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
model
.
getFaultId
());
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
model
.
getFaultId
());
//当前角色部门id为应急指挥科的时候 并且同意时 不修改主表状态 依然为待审核
//当前角色部门id为维修部门的时候 修改状态
if
(
userInfo
.
getDepartment
().
getSequenceNbr
()
==
failureDetailsDto
.
getBizCode
()
&&
condition
==
AuditResultEnum
.
AGREE
.
getCode
()){
failureDetailsDto
.
setCurrentStatus
(
failureDetailsDto
.
getCurrentStatus
());
}
else
if
(
userInfo
.
getDepartment
().
getSequenceNbr
()
!=
failureDetailsDto
.
getBizCode
()
)
{
failureDetailsDto
.
setCurrentStatus
(
status
.
getCode
());
failureDetailsDto
.
setCurrentStatus
(
status
.
getCode
());
}
failureDetailsDto
.
setSequenceNbr
(
model
.
getFaultId
());
failureDetailsDto
.
setSequenceNbr
(
model
.
getFaultId
());
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
String
conditionText
;
String
conditionText
;
boolean
result
=
failureDetailsService
.
checkExcuteTaskAuth
(
failureDetailsDto
.
getSequenceNbr
(),
userInfo
);
boolean
result
=
failureDetailsService
.
checkExcuteTaskAuth
(
failureDetailsDto
.
getSequenceNbr
(),
userInfo
);
if
(
result
){
if
(
result
){
//添加报修日志
//添加报修日志
Long
faultId
=
model
.
getFaultId
();
Long
faultId
=
model
.
getFaultId
();
model
.
setAuditTime
(
new
Date
());
model
.
setAuditDepartmentId
(
userInfo
.
getDepartment
().
getSequenceNbr
());
model
.
setAuditor
(
userInfo
.
getRole
().
getRoleName
());
model
.
setAuditDepartment
(
userInfo
.
getDepartment
().
getDepartmentName
());
Date
processTime
=
model
.
getAuditTime
();
Date
processTime
=
model
.
getAuditTime
();
String
processDepartment
=
model
.
getAuditDepartment
();
String
processDepartment
=
model
.
getAuditDepartment
();
String
processAuditor
=
model
.
getAuditor
();
String
processAuditor
=
model
.
getAuditor
();
Integer
processAuditorId
=
Integer
.
parseInt
(
userInfo
.
getUserModel
().
getUserId
())
;
Integer
processAuditorId
=
Integer
.
parseInt
(
userInfo
.
getUserModel
().
getUserId
())
;
Long
auditDepartmentId
=
(
userInfo
.
getDepartment
().
getSequenceNbr
());
Long
auditDepartmentId
=
(
userInfo
.
getDepartment
().
getSequenceNbr
());
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
())
{
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
()
)
{
conditionText
=
AuditResultEnum
.
AGREE
.
getName
();
conditionText
=
AuditResultEnum
.
AGREE
.
getName
();
repairlog
(
faultId
,
processAuditor
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
);
repairlog
(
faultId
,
processAuditor
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
);
}
}
...
@@ -99,12 +127,14 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
...
@@ -99,12 +127,14 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
conditionText
=
AuditResultEnum
.
SEND_BACK
.
getName
();
conditionText
=
AuditResultEnum
.
SEND_BACK
.
getName
();
repairlog
(
faultId
,
processAuditor
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
);
repairlog
(
faultId
,
processAuditor
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
);
}
}
if
(
condition
==
AuditResultEnum
.
REFUSE
.
getCode
()){
conditionText
=
AuditResultEnum
.
REFUSE
.
getName
();
conditionText
=
AuditResultEnum
.
REFUSE
.
getName
();
repairlog
(
faultId
,
processAuditor
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
);
repairlog
(
faultId
,
processAuditor
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
);
}
failureDetailsService
.
excuteTask
(
failureDetailsDto
.
getProcessId
(),
userInfo
,
condition
+
""
);
failureDetailsService
.
excuteTask
(
failureDetailsDto
.
getProcessId
(),
userInfo
,
condition
+
""
);
return
failureDetailsService
.
updateWithModel
(
failureDetailsDto
)
;
return
true
;
}
}
return
null
;
return
false
;
}
}
/**
/**
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/FailureDetailsServiceImpl.java
View file @
735575bb
...
@@ -203,6 +203,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -203,6 +203,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
int
acceptanceStatus
=
0
;
int
acceptanceStatus
=
0
;
int
refuseStatus
=
0
;
int
refuseStatus
=
0
;
int
finishStatus
=
0
;
int
finishStatus
=
0
;
int
inMaintenance
=
0
;
List
<
FailureStatusCountDto
>
list
=
new
ArrayList
<>();
List
<
FailureStatusCountDto
>
list
=
new
ArrayList
<>();
// String[] statusName = new String[]{"待审核", "待提交", "待维修", "待验收", "已拒绝", "已完结"};
// String[] statusName = new String[]{"待审核", "待提交", "待维修", "待验收", "已拒绝", "已完结"};
...
@@ -211,7 +212,9 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -211,7 +212,9 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
FailureStatuEnum
.
WAITING_SUBMIT
.
getName
(),
FailureStatuEnum
.
WAITING_SUBMIT
.
getName
(),
FailureStatuEnum
.
WAITING_MAINTAIN
.
getName
(),
FailureStatuEnum
.
WAITING_MAINTAIN
.
getName
(),
FailureStatuEnum
.
WAITING_ACCEPTANCE
.
getName
(),
FailureStatuEnum
.
WAITING_ACCEPTANCE
.
getName
(),
FailureStatuEnum
.
REFUSE
.
getName
());
FailureStatuEnum
.
REFUSE
.
getName
(),
FailureStatuEnum
.
FINISH
.
getName
(),
FailureStatuEnum
.
IN_MAINTENANCE
.
getName
());
for
(
int
i
=
0
;
i
<
failureDetailsDtos
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
failureDetailsDtos
.
size
();
i
++)
{
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
WAITING_AUDIT
.
getCode
())){
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
WAITING_AUDIT
.
getCode
())){
...
@@ -232,9 +235,14 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -232,9 +235,14 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
FINISH
.
getCode
())){
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
FINISH
.
getCode
())){
finishStatus
++;
finishStatus
++;
}
}
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
IN_MAINTENANCE
.
getCode
())){
inMaintenance
++;
}
}
}
int
[]
statusCount
=
{
auditStatus
,
submitStatus
,
maintainStatus
,
acceptanceStatus
,
refuseStatus
,
finishStatus
};
int
[]
statusCount
=
{
auditStatus
,
submitStatus
,
maintainStatus
,
acceptanceStatus
,
refuseStatus
,
finishStatus
,
inMaintenance
};
for
(
int
i
=
0
;
i
<
statusName
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
statusName
.
size
();
i
++)
{
FailureStatusCountDto
statusCountDto
=
new
FailureStatusCountDto
();
FailureStatusCountDto
statusCountDto
=
new
FailureStatusCountDto
();
statusCountDto
.
setStatus
(
statusName
.
get
(
i
));
statusCountDto
.
setStatus
(
statusName
.
get
(
i
));
...
@@ -249,7 +257,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -249,7 +257,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
*
*
* @throws Exception
* @throws Exception
*/
*/
public
Object
savemodel
(
FailureDetailsDto
failureDetailsDto
,
ReginParams
userInfo
)
throws
Exception
{
public
Object
savemodel
(
FailureDetailsDto
failureDetailsDto
,
ReginParams
userInfo
)
{
String
businessKey
=
buildOrderNo
();
String
businessKey
=
buildOrderNo
();
JSONObject
body
=
new
JSONObject
();
JSONObject
body
=
new
JSONObject
();
body
.
put
(
"businessKey"
,
businessKey
);
body
.
put
(
"businessKey"
,
businessKey
);
...
@@ -268,12 +276,10 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -268,12 +276,10 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
failureDetailsDto
.
setProcessId
(
instance
.
getString
(
"id"
));
failureDetailsDto
.
setProcessId
(
instance
.
getString
(
"id"
));
FailureDetailsDto
model
=
null
;
FailureDetailsDto
model
=
null
;
try
{
try
{
// 发起主表流程 并添加至报修日志
// 发起主表流程 并添加至报修日志
failureDetailsDto
.
setSubmissionTime
(
new
Date
());
failureDetailsDto
.
setSubmissionTime
(
new
Date
());
failureDetailsDto
.
setFailureCode
(
buildOrderNo
());
failureDetailsDto
.
setFailureCode
(
buildOrderNo
());
failureDetailsDto
.
setBizCode
(
buildOrderNo
());
failureDetailsDto
.
setBizCode
(
userInfo
.
getDepartment
().
getSequenceNbr
());
failureDetailsDto
.
setIsDelete
(
false
);
failureDetailsDto
.
setIsDelete
(
false
);
model
=
this
.
createWithModel
(
failureDetailsDto
);
model
=
this
.
createWithModel
(
failureDetailsDto
);
...
@@ -528,10 +534,10 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -528,10 +534,10 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
if
(
buttonValueString
.
endsWith
(
PROCESS_NAME
[
0
]))
{
//提交维修单
if
(
buttonValueString
.
endsWith
(
PROCESS_NAME
[
0
]))
{
//提交维修单
flag
=
1
;
flag
=
1
;
}
else
if
(
buttonValueString
.
endsWith
(
PROCESS_NAME
[
1
]))
{
//审核
}
else
if
(
buttonValueString
.
endsWith
(
PROCESS_NAME
[
1
]))
{
//审核
flag
=
2
;
if
(
buttonValueString
.
startsWith
(
PROCESS_NAME
[
2
]))
{
if
(
buttonValueString
.
startsWith
(
PROCESS_NAME
[
2
]))
{
flag
=
3
;
flag
=
3
;
}
}
flag
=
2
;
}
else
if
(
buttonValueString
.
endsWith
(
PROCESS_NAME
[
2
]))
{
//维修
}
else
if
(
buttonValueString
.
endsWith
(
PROCESS_NAME
[
2
]))
{
//维修
flag
=
4
;
flag
=
4
;
}
else
if
(
buttonValueString
.
endsWith
(
PROCESS_NAME
[
3
]))
{
//验收
}
else
if
(
buttonValueString
.
endsWith
(
PROCESS_NAME
[
3
]))
{
//验收
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/FailureMaintainServiceImpl.java
View file @
735575bb
...
@@ -3,8 +3,14 @@ package com.yeejoin.amos.boot.module.common.biz.service.impl;
...
@@ -3,8 +3,14 @@ package com.yeejoin.amos.boot.module.common.biz.service.impl;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureAuditDto
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
...
@@ -26,6 +32,7 @@ import com.yeejoin.amos.boot.module.common.api.service.IFailureMaintainService;
...
@@ -26,6 +32,7 @@ import com.yeejoin.amos.boot.module.common.api.service.IFailureMaintainService;
* @date 2021-08-04
* @date 2021-08-04
*/
*/
@Service
@Service
@Transactional
public
class
FailureMaintainServiceImpl
extends
BaseService
<
FailureMaintainDto
,
FailureMaintain
,
FailureMaintainMapper
>
implements
IFailureMaintainService
{
public
class
FailureMaintainServiceImpl
extends
BaseService
<
FailureMaintainDto
,
FailureMaintain
,
FailureMaintainMapper
>
implements
IFailureMaintainService
{
@Autowired
@Autowired
SourceFileServiceImpl
sourceFileServiceImpl
;
SourceFileServiceImpl
sourceFileServiceImpl
;
...
@@ -34,6 +41,11 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
...
@@ -34,6 +41,11 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
@Autowired
@Autowired
FailureRepairlogServiceImpl
failureRepairlogService
;
FailureRepairlogServiceImpl
failureRepairlogService
;
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
FailureMaintainServiceImpl
.
class
);
private
static
String
[]
MAINTENANCE_STATUS
=
{
"维修完成"
,
"维修中"
};
private
static
String
[]
PROCESS_RESULT
=
{
"验证通过"
,
"验证未通过"
};
/**
/**
* 分页查询
* 分页查询
*/
*/
...
@@ -51,10 +63,11 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
...
@@ -51,10 +63,11 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
/**
/**
* 添加维修记录
* 添加维修记录
*/
*/
public
FailureMaintainDto
savemodel
(
FailureMaintainDto
failureMaintainDto
,
ReginParams
userInfo
)
{
public
Object
savemodel
(
FailureMaintainDto
failureMaintainDto
,
ReginParams
userInfo
)
{
failureDetailsService
.
checkExcuteTaskAuthMap
(
failureMaintainDto
.
getFaultId
(),
userInfo
);
failureDetailsService
.
checkExcuteTaskAuthMap
(
failureMaintainDto
.
getFaultId
(),
userInfo
);
failureDetailsService
.
excuteTask
(
failureMaintainDto
.
getFaultId
(),
userInfo
,
null
);
try
{
this
.
createWithModel
(
failureMaintainDto
);
this
.
createWithModel
(
failureMaintainDto
);
//添加完成后修改保修单状态为待验收
//添加完成后修改保修单状态为待验收
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
failureMaintainDto
.
getFaultId
());
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
failureMaintainDto
.
getFaultId
());
...
@@ -62,23 +75,55 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
...
@@ -62,23 +75,55 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
//添加报修日志
//添加报修日志
String
processResult
=
"维修完成"
;
String
processResult
=
MAINTENANCE_STATUS
[
1
];
//维修中
Integer
processAuditorId
=
Integer
.
parseInt
(
failureMaintainDto
.
getRecUserId
());
Integer
processAuditorId
=
Integer
.
parseInt
(
failureMaintainDto
.
getRecUserId
());
repairlog
(
failureMaintainDto
.
getFaultId
(),
failureMaintainDto
.
getMaintainMan
(),
processAuditorId
,
userInfo
.
getDepartment
().
getSequenceNbr
(),
failureMaintainDto
.
getMaintainTime
(),
repairlog
(
failureMaintainDto
.
getFaultId
(),
failureMaintainDto
.
getMaintainMan
(),
processAuditorId
,
userInfo
.
getDepartment
().
getSequenceNbr
(),
failureMaintainDto
.
getMaintainTime
(),
failureMaintainDto
.
getDepartment
(),
processResult
);
failureMaintainDto
.
getDepartment
(),
processResult
);
if
(
ObjectUtils
.
isNotEmpty
(
failureMaintainDto
.
getAttachment
())){
sourceFileServiceImpl
.
saveSourceFile
(
failureMaintainDto
.
getSequenceNbr
(),
failureMaintainDto
.
getAttachment
());
sourceFileServiceImpl
.
saveSourceFile
(
failureMaintainDto
.
getSequenceNbr
(),
failureMaintainDto
.
getAttachment
());
return
failureMaintainDto
;
}
failureDetailsService
.
excuteTask
(
failureMaintainDto
.
getFaultId
(),
userInfo
,
null
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
e
.
printStackTrace
();
logger
.
info
(
"添加故障维修信息到数据库失败"
);
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
return
false
;
}
}
return
true
;
}
/**
/**
*
根据FaultId查询
*
更新状态维修完成
*/
*/
public
List
<
FailureMaintain
>
findByfaultId
(
Long
faultId
)
{
public
Boolean
updateStatus
(
FailureMaintainDto
failureMaintainDto
,
ReginParams
userInfo
)
{
Page
<
FailureMaintain
>
page
=
new
Page
<>();
try
{
QueryWrapper
<
FailureMaintain
>
queryWrapper
=
new
QueryWrapper
<>();
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
failureMaintainDto
.
getFaultId
());
queryWrapper
.
eq
(
"fault_id"
,
faultId
).
orderByDesc
(
"submission_time"
);
failureDetailsDto
.
setCurrentStatus
(
FailureStatuEnum
.
IN_MAINTENANCE
.
getCode
());
return
baseMapper
.
selectList
(
queryWrapper
);
this
.
updateWithModel
(
failureMaintainDto
);
//添加报修日志
String
processResult
=
MAINTENANCE_STATUS
[
0
];
//维修完成
Integer
processAuditorId
=
Integer
.
parseInt
(
failureMaintainDto
.
getRecUserId
());
repairlog
(
failureMaintainDto
.
getFaultId
(),
failureMaintainDto
.
getMaintainMan
(),
processAuditorId
,
userInfo
.
getDepartment
().
getSequenceNbr
(),
failureMaintainDto
.
getMaintainTime
(),
failureMaintainDto
.
getDepartment
(),
processResult
);
if
(
ObjectUtils
.
isNotEmpty
(
failureMaintainDto
.
getAttachment
())){
sourceFileServiceImpl
.
saveSourceFile
(
failureMaintainDto
.
getSequenceNbr
(),
failureMaintainDto
.
getAttachment
());
}
failureDetailsService
.
excuteTask
(
failureMaintainDto
.
getFaultId
(),
userInfo
,
null
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
logger
.
info
(
"更新故障验收信息到数据库失败"
);
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
return
false
;
}
return
true
;
}
}
/**
/**
...
@@ -87,21 +132,27 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
...
@@ -87,21 +132,27 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
public
Boolean
updateModel
(
FailureMaintainDto
failureMaintainDto
,
Integer
status
,
ReginParams
userInfo
)
{
public
Boolean
updateModel
(
FailureMaintainDto
failureMaintainDto
,
Integer
status
,
ReginParams
userInfo
)
{
boolean
result
=
failureDetailsService
.
checkExcuteTaskAuth
(
failureMaintainDto
.
getFaultId
(),
userInfo
);
boolean
result
=
failureDetailsService
.
checkExcuteTaskAuth
(
failureMaintainDto
.
getFaultId
(),
userInfo
);
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
failureMaintainDto
.
getFaultId
());
if
(
result
){
if
(
result
){
this
.
updateWithModel
(
failureMaintainDto
);
this
.
updateWithModel
(
failureMaintainDto
);
//根据status修改状态
//根据status修改状态
String
processResult
=
new
String
();
String
processResult
=
new
String
();
String
condition
=
new
String
();
String
condition
=
new
String
();
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
failureMaintainDto
.
getFaultId
());
if
(
status
==
AuditResultEnum
.
AGREE
.
getCode
()
&&
userInfo
.
getDepartment
().
getSequenceNbr
()
if
(
status
==
AuditResultEnum
.
AGREE
.
getCode
())
{
//同意状态为已完结
==
failureDetailsDto
.
getBizCode
())
{
//同意状态为已完结
failureDetailsDto
.
setCurrentStatus
(
FailureStatuEnum
.
FINISH
.
getCode
());
failureDetailsDto
.
setCurrentStatus
(
failureDetailsDto
.
getCurrentStatus
());
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
processResult
=
PROCESS_RESULT
[
0
]
;
condition
=
AuditResultEnum
.
AGREE
.
getName
();
}
else
if
(
status
==
AuditResultEnum
.
AGREE
.
getCode
()
)
{
//同意状态为已完结
failureDetailsDto
.
setCurrentStatus
(
failureDetailsDto
.
getCurrentStatus
());
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
processResult
=
"验证通过"
;
processResult
=
PROCESS_RESULT
[
0
]
;
condition
=
AuditResultEnum
.
AGREE
.
getName
();
condition
=
AuditResultEnum
.
AGREE
.
getName
();
}
else
{
//不同意状态为已拒绝
}
else
{
//不同意状态为已拒绝
failureDetailsDto
.
setCurrentStatus
(
FailureStatuEnum
.
REFUSE
.
getCode
());
failureDetailsDto
.
setCurrentStatus
(
FailureStatuEnum
.
REFUSE
.
getCode
());
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
processResult
=
"验证未通过"
;
processResult
=
PROCESS_RESULT
[
1
]
;
condition
=
AuditResultEnum
.
REFUSE
.
getName
();
condition
=
AuditResultEnum
.
REFUSE
.
getName
();
}
}
//添加报修日志
//添加报修日志
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/controller/CheckController.java
View file @
735575bb
...
@@ -295,28 +295,24 @@ public class CheckController extends AbstractBaseController {
...
@@ -295,28 +295,24 @@ public class CheckController extends AbstractBaseController {
/**
/**
* 获取巡检日历数据
* 获取巡检日历数据
*
*
* @param
queryRequests
* @param
date
* @return
* @return
*/
*/
@PersonIdentify
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"
获取巡检日历数据<font color='blue'>手机app</font>"
,
notes
=
"获取巡检日历数据<font color='blue'>手机app</font>
"
)
@ApiOperation
(
value
=
"
维保日历-mobile"
,
notes
=
"维保日历-mobile
"
)
@
PostMapping
(
value
=
"
/checkCalendar"
,
produces
=
"application/json;charset=UTF-8"
)
@
GetMapping
(
value
=
"/{date}
/checkCalendar"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
checkCalendar
(
public
CommonResponse
checkCalendar
(
@ApiParam
(
value
=
"
查询条件"
,
required
=
false
)
@RequestBody
(
required
=
false
)
List
<
CommonRequest
>
queryRequests
)
{
@ApiParam
(
value
=
"
date,格式YYYY-MM-DD"
,
required
=
true
)
@PathVariable
String
date
)
{
try
{
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
loginOrgCode
=
getOrgCode
(
reginParams
);
String
loginOrgCode
=
getOrgCode
(
reginParams
);
String
roleTypeName
=
getRoleTypeName
(
reginParams
);
Map
<
String
,
Object
>
authMap
=
Bean
.
BeantoMap
(
reginParams
.
getPersonIdentity
()
);
List
<
DaoCriteria
>
daoCriterias
=
buildDaoCriterias
(
queryRequests
,
true
,
loginOrgCode
,
roleTypeName
);
params
.
putAll
(
authMap
);
params
.
put
(
"checkTime"
,
date
);
params
.
put
(
"orgCode"
,
loginOrgCode
);
Map
<
String
,
Object
>
map
=
checkService
.
checkCalendar
(
CheckParamUtil
.
checkCalendar
(
daoCriterias
)
);
Map
<
String
,
Object
>
map
=
checkService
.
checkCalendar
(
params
);
return
CommonResponseUtil
.
success
(
map
);
return
CommonResponseUtil
.
success
(
map
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
CommonResponseUtil
.
failure
(
e
.
getMessage
());
}
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
...
@@ -347,13 +343,8 @@ public class CheckController extends AbstractBaseController {
...
@@ -347,13 +343,8 @@ public class CheckController extends AbstractBaseController {
@ApiOperation
(
value
=
"获取巡检记录详情信息<font color='blue'>手机app</font>"
,
notes
=
"获取巡检记录详情信息<font color='blue'>手机app</font>"
)
@ApiOperation
(
value
=
"获取巡检记录详情信息<font color='blue'>手机app</font>"
,
notes
=
"获取巡检记录详情信息<font color='blue'>手机app</font>"
)
@RequestMapping
(
value
=
"/queryCheckDetail"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/queryCheckDetail"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryRecordById
(
@RequestParam
(
required
=
true
)
int
checkId
)
{
public
CommonResponse
queryRecordById
(
@RequestParam
(
required
=
true
)
int
checkId
)
{
try
{
Map
<
String
,
Object
>
map
=
checkService
.
queryRecordById
(
checkId
);
Map
<
String
,
Object
>
map
=
checkService
.
queryRecordById
(
checkId
);
return
CommonResponseUtil
.
success
(
map
);
return
CommonResponseUtil
.
success
(
map
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
CommonResponseUtil
.
failure
(
e
.
getMessage
());
}
}
}
/**
/**
...
@@ -498,6 +489,7 @@ public class CheckController extends AbstractBaseController {
...
@@ -498,6 +489,7 @@ public class CheckController extends AbstractBaseController {
@ApiParam
(
value
=
"结束时间"
)
@RequestParam
(
value
=
"endTime"
,
required
=
false
)
String
endTime
,
@ApiParam
(
value
=
"结束时间"
)
@RequestParam
(
value
=
"endTime"
,
required
=
false
)
String
endTime
,
@ApiParam
(
value
=
"维保人员"
)
@RequestParam
(
value
=
"personId"
,
required
=
false
)
String
person
,
@ApiParam
(
value
=
"维保人员"
)
@RequestParam
(
value
=
"personId"
,
required
=
false
)
String
person
,
@ApiParam
(
value
=
"业主单位"
)
@RequestParam
(
value
=
"teamId"
,
required
=
false
)
String
teamId
,
@ApiParam
(
value
=
"业主单位"
)
@RequestParam
(
value
=
"teamId"
,
required
=
false
)
String
teamId
,
@ApiParam
(
value
=
"设施Id"
)
@RequestParam
(
value
=
"equipId"
,
required
=
false
)
String
equipId
,
@ApiParam
(
value
=
"当前页"
)
@RequestParam
(
value
=
"pageNumber"
)
int
pageNumber
,
@ApiParam
(
value
=
"当前页"
)
@RequestParam
(
value
=
"pageNumber"
)
int
pageNumber
,
@ApiParam
(
value
=
"页大小"
)
@RequestParam
(
value
=
"pageSize"
)
int
pageSize
)
throws
Exception
{
@ApiParam
(
value
=
"页大小"
)
@RequestParam
(
value
=
"pageSize"
)
int
pageSize
)
throws
Exception
{
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
params
=
new
HashMap
<>();
...
@@ -513,6 +505,7 @@ public class CheckController extends AbstractBaseController {
...
@@ -513,6 +505,7 @@ public class CheckController extends AbstractBaseController {
params
.
put
(
"endTime"
,
endTime
);
params
.
put
(
"endTime"
,
endTime
);
params
.
put
(
"person"
,
person
);
params
.
put
(
"person"
,
person
);
params
.
put
(
"teamId"
,
teamId
);
params
.
put
(
"teamId"
,
teamId
);
params
.
put
(
"equipId"
,
equipId
);
params
.
put
(
"orgCode"
,
loginOrgCode
);
params
.
put
(
"orgCode"
,
loginOrgCode
);
CommonPageable
pageable
=
new
CommonPageable
(
pageNumber
,
pageSize
);
CommonPageable
pageable
=
new
CommonPageable
(
pageNumber
,
pageSize
);
return
CommonResponseUtil
.
success
(
checkService
.
getCheckPage
(
params
,
pageable
));
return
CommonResponseUtil
.
success
(
checkService
.
getCheckPage
(
params
,
pageable
));
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/dao/mapper/CheckMapper.java
View file @
735575bb
...
@@ -45,14 +45,14 @@ public interface CheckMapper extends BaseMapper {
...
@@ -45,14 +45,14 @@ public interface CheckMapper extends BaseMapper {
* @param param
* @param param
* @return
* @return
*/
*/
Map
<
String
,
Object
>
pieChartData
(
CheckRecordParam
param
);
Map
<
String
,
Object
>
pieChartData
(
Map
<
String
,
Object
>
param
);
/**
/**
* 巡检日历日历数据
* 巡检日历日历数据
* @param param
* @param param
* @return
* @return
*/
*/
List
<
Map
<
String
,
Object
>>
calendarData
(
CheckRecordParam
param
);
List
<
Map
<
String
,
Object
>>
calendarData
(
Map
<
String
,
Object
>
param
);
List
<
Map
<
String
,
Object
>>
queryRecordByPointId
(
HashMap
<
String
,
Object
>
req
);
List
<
Map
<
String
,
Object
>>
queryRecordByPointId
(
HashMap
<
String
,
Object
>
req
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/service/impl/CheckServiceImpl.java
View file @
735575bb
...
@@ -624,26 +624,16 @@ public class CheckServiceImpl implements ICheckService {
...
@@ -624,26 +624,16 @@ public class CheckServiceImpl implements ICheckService {
}
}
@Override
@Override
public
Map
<
String
,
Object
>
checkCalendar
(
CheckRecordParam
recordP
aram
)
{
public
Map
<
String
,
Object
>
checkCalendar
(
Map
<
String
,
Object
>
p
aram
)
{
Map
<
String
,
Object
>
charData
=
checkMapper
.
pieChartData
(
recordP
aram
);
Map
<
String
,
Object
>
charData
=
checkMapper
.
pieChartData
(
p
aram
);
List
<
Map
<
String
,
Object
>>
calendarData
=
checkMapper
.
calendarData
(
recordP
aram
);
List
<
Map
<
String
,
Object
>>
calendarData
=
checkMapper
.
calendarData
(
p
aram
);
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
Map
<
String
,
List
<
CalendarStatusCountRespone
>>
calendarMap
=
new
HashMap
<>();
Map
<
String
,
List
<
CalendarStatusCountRespone
>>
calendarMap
=
calendarData
.
stream
().
collect
(
Collectors
.
groupingBy
(
map
->
map
.
get
(
"time"
).
toString
(),
Collectors
.
mapping
(
c
->{
if
(!
calendarData
.
isEmpty
())
{
CalendarStatusCountRespone
countRespone
=
new
CalendarStatusCountRespone
();
calendarData
.
forEach
(
action
->
{
countRespone
.
setCount
(
Long
.
parseLong
(
c
.
get
(
"count"
).
toString
()));
List
<
CalendarStatusCountRespone
>
statusCountList
=
new
ArrayList
<>();
countRespone
.
setStatus
(
c
.
get
(
"status"
).
toString
());
CalendarStatusCountRespone
statusCount
=
new
CalendarStatusCountRespone
();
return
countRespone
;
statusCount
.
setCount
(
Double
.
valueOf
(
action
.
get
(
"count"
).
toString
()));
},
Collectors
.
toList
())));
statusCount
.
setStatus
(
action
.
get
(
"status"
).
toString
());
if
(
calendarMap
.
containsKey
(
action
.
get
(
"time"
)))
{
statusCountList
=
calendarMap
.
get
(
action
.
get
(
"time"
));
statusCountList
.
add
(
statusCount
);
}
else
{
statusCountList
.
add
(
statusCount
);
calendarMap
.
put
(
action
.
get
(
"time"
).
toString
(),
statusCountList
);
}
});
}
result
.
put
(
"charData"
,
charData
);
result
.
put
(
"charData"
,
charData
);
result
.
put
(
"calendarData"
,
calendarMap
);
result
.
put
(
"calendarData"
,
calendarMap
);
return
result
;
return
result
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/service/impl/PointServiceImpl.java
View file @
735575bb
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.maintenance.business.service.impl;
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.maintenance.business.service.impl;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.toolkit.Sequence
;
import
com.baomidou.mybatisplus.core.toolkit.Sequence
;
import
com.baomidou.mybatisplus.extension.api.R
;
import
com.google.common.base.Joiner
;
import
com.google.common.base.Joiner
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
...
@@ -35,6 +36,7 @@ import org.springframework.data.domain.*;
...
@@ -35,6 +36,7 @@ import org.springframework.data.domain.*;
import
org.springframework.data.domain.Sort.Direction
;
import
org.springframework.data.domain.Sort.Direction
;
import
org.springframework.data.domain.Sort.Order
;
import
org.springframework.data.domain.Sort.Order
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.scheduling.annotation.Async
;
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
;
...
@@ -228,26 +230,19 @@ public class PointServiceImpl implements IPointService {
...
@@ -228,26 +230,19 @@ public class PointServiceImpl implements IPointService {
if
(!
pointInputItems
.
isEmpty
())
{
if
(!
pointInputItems
.
isEmpty
())
{
iPointInputItemDao
.
saveAll
(
pointInputItems
);
iPointInputItemDao
.
saveAll
(
pointInputItems
);
}
}
//TODO 2.分类暂时不需要 维保
}
}
@Override
@Override
@Transactional
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
List
<
Long
>
delPointById
(
Long
[]
ids
)
{
public
List
<
Long
>
delPointById
(
Long
[]
ids
)
{
List
<
Long
>
idList
=
new
ArrayList
<
Long
>();
List
<
Long
>
idList
=
new
ArrayList
<
Long
>();
for
(
long
pointId
:
ids
)
{
idList
.
addAll
(
Arrays
.
asList
(
ids
));
idList
.
add
(
pointId
);
}
iPointClassifyDao
.
deleteByPointId
(
idList
);
// 物理删除点的分类
List
<
PointInputItem
>
pointInputItem
=
iPointInputItemDao
.
findAllById
(
idList
);
List
<
PointInputItem
>
pointInputItem
=
iPointInputItemDao
.
findAllById
(
idList
);
List
<
Long
>
pointInputItemIds
=
Lists
.
transform
(
pointInputItem
,
PointInputItem:
:
getId
);
List
<
Long
>
pointInputItemIds
=
Lists
.
transform
(
pointInputItem
,
PointInputItem:
:
getId
);
if
(
pointInputItemIds
.
size
()
>
0
)
// 物理删除p_point_inputitem表对应行
iPointInputItemDao
.
deleteFmeaRelationByPointInputItemIds
(
pointInputItemIds
);
//物理删除fmea关联巡检点项
iPointInputItemDao
.
deleteByPointId
(
idList
);
iPointInputItemDao
.
deleteByPointId
(
idList
);
// 物理删除p_point_inputitem表对应行
// 物理删除p_route_point、p_route_point_item中相关行
iPointPhotoDao
.
deleteByPointId
(
idList
);
// 物理删除点的图片信息
// iRoutePointDao.delRoutePointByPointId(idList); //
// 物理删除p_route_point中相关行
List
<
BigInteger
>
routePointIdList
=
iRoutePointDao
.
queryRoutePointByPointId
(
idList
);
List
<
BigInteger
>
routePointIdList
=
iRoutePointDao
.
queryRoutePointByPointId
(
idList
);
for
(
BigInteger
routePointId
:
routePointIdList
)
{
for
(
BigInteger
routePointId
:
routePointIdList
)
{
iRoutePointItemDao
.
delRoutePointItem
(
routePointId
.
longValue
());
iRoutePointItemDao
.
delRoutePointItem
(
routePointId
.
longValue
());
...
@@ -270,18 +265,19 @@ public class PointServiceImpl implements IPointService {
...
@@ -270,18 +265,19 @@ public class PointServiceImpl implements IPointService {
}
}
}
}
}
}
// 删除p_plan_task_detail相关行
iPlanTaskDetailDao
.
deletePlanTaskDetailByPointId
(
idList
);
// 删除p_plan_task_detail相关行
iPlanTaskDetailDao
.
deletePlanTaskDetailByPointId
(
idList
);
// 删除p_point相关行
iPointDao
.
delPointById
(
idList
);
iPointDao
.
delPointById
(
idList
);
return
idList
;
return
idList
;
}
}
@Override
@Override
@Transactional
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Point
updatePoint
(
PointParam
pointParam
)
{
public
Point
updatePoint
(
PointParam
pointParam
)
{
//1.更新点
//1.更新点
long
pointId
=
pointParam
.
getPoint
().
getId
();
long
pointId
=
pointParam
.
getPoint
().
getId
();
Point
newPoint
=
iPointDao
.
findById
(
pointId
).
get
(
);
Point
newPoint
=
iPointDao
.
findById
(
pointId
).
orElseThrow
(()->
new
RuntimeException
(
"找不到原始数据"
)
);
Bean
.
copyExistPropertis
(
pointParam
.
getPoint
(),
newPoint
);
Bean
.
copyExistPropertis
(
pointParam
.
getPoint
(),
newPoint
);
newPoint
.
setLastUpdateTime
(
new
Date
());
newPoint
.
setLastUpdateTime
(
new
Date
());
iPointDao
.
save
(
newPoint
);
iPointDao
.
save
(
newPoint
);
...
@@ -381,6 +377,7 @@ public class PointServiceImpl implements IPointService {
...
@@ -381,6 +377,7 @@ public class PointServiceImpl implements IPointService {
}
}
return
returnList
;
return
returnList
;
}
}
@Override
@Override
public
List
<
PointInputItemVo
>
queryPointInputItem
(
Long
pointId
)
{
public
List
<
PointInputItemVo
>
queryPointInputItem
(
Long
pointId
)
{
return
pointMapper
.
getPointInputItemById1
(
pointId
,
null
);
return
pointMapper
.
getPointInputItemById1
(
pointId
,
null
);
...
@@ -1089,11 +1086,27 @@ public class PointServiceImpl implements IPointService {
...
@@ -1089,11 +1086,27 @@ public class PointServiceImpl implements IPointService {
return
equipFeign
.
getRegionTress
();
return
equipFeign
.
getRegionTress
();
}
}
@Override
@Override
@Async
public
void
syncSavePoint
(
List
<
MaintenanceResourceData
>
list
,
String
orgCode
,
String
userId
)
{
public
void
syncSavePoint
(
List
<
MaintenanceResourceData
>
list
,
String
orgCode
,
String
userId
)
{
List
<
Point
>
points
=
new
ArrayList
<>();
List
<
Point
>
points
=
new
ArrayList
<>();
List
<
PointInputItem
>
inputItems
=
new
ArrayList
<>();
List
<
PointInputItem
>
inputItems
=
new
ArrayList
<>();
List
<
Long
>
ids
=
new
ArrayList
<
Long
>();
List
<
Long
>
ids
=
new
ArrayList
<>();
//1.删除已有数据
for
(
MaintenanceResourceData
x
:
list
)
{
String
pointNo
=
x
.
getFireFacilityCode
();
String
originalId
=
String
.
valueOf
(
x
.
getFireFacilityId
());
Long
id
=
iPointDao
.
findPointByEquipmentIdAndFireFacilityId
(
pointNo
,
originalId
);
if
(
null
!=
id
)
{
ids
.
add
(
id
);
}
}
if
(!
ids
.
isEmpty
())
{
Long
[]
idsArray
=
ids
.
toArray
(
new
Long
[
0
]);
delPointById
(
idsArray
);
}
//2.创建
for
(
MaintenanceResourceData
x
:
list
)
{
for
(
MaintenanceResourceData
x
:
list
)
{
Point
point
=
new
Point
();
Point
point
=
new
Point
();
String
pointNo
=
StringUtil
.
isNotEmpty
(
x
.
getFireFacilityCode
())
?
x
.
getFireFacilityCode
()
:
String
.
valueOf
(
sequence
.
nextId
());
String
pointNo
=
StringUtil
.
isNotEmpty
(
x
.
getFireFacilityCode
())
?
x
.
getFireFacilityCode
()
:
String
.
valueOf
(
sequence
.
nextId
());
...
@@ -1107,16 +1120,13 @@ public class PointServiceImpl implements IPointService {
...
@@ -1107,16 +1120,13 @@ public class PointServiceImpl implements IPointService {
point
.
setBelongSystemName
(
x
.
getFireFightSysName
());
point
.
setBelongSystemName
(
x
.
getFireFightSysName
());
point
.
setOwnerId
(
String
.
valueOf
(
x
.
getOwnerUnitId
()));
point
.
setOwnerId
(
String
.
valueOf
(
x
.
getOwnerUnitId
()));
point
.
setOwnerName
(
x
.
getOwnerUnitName
());
point
.
setOwnerName
(
x
.
getOwnerUnitName
());
point
.
setAddress
(
x
.
getLocation
());
point
.
setBuildingId
(
x
.
getBuildingId
()
!=
null
?
x
.
getBuildingId
().
toString
()
:
""
);
point
.
setBuildingName
(
x
.
getBuildingName
());
point
.
setAddress
(
x
.
getArea
());
point
.
setLevel
(
""
);
point
.
setLevel
(
""
);
point
.
setCreatorId
(
userId
);
point
.
setCreatorId
(
userId
);
point
.
setOrgCode
(
orgCode
);
point
.
setOrgCode
(
orgCode
);
points
.
add
(
point
);
points
.
add
(
point
);
Long
id
=
iPointDao
.
findPointByEquipmentIdAndFireFacilityId
(
pointNo
,
originalId
);
if
(
null
!=
id
)
{
ids
.
add
(
id
);
iPointDao
.
delPointBIds
(
id
);
}
iPointDao
.
save
(
point
);
iPointDao
.
save
(
point
);
List
<
InputItem
>
inputItemVos
=
inputItemMapper
.
getInputItemByEquipmentName
(
x
.
getClassifyName
(),
orgCode
);
List
<
InputItem
>
inputItemVos
=
inputItemMapper
.
getInputItemByEquipmentName
(
x
.
getClassifyName
(),
orgCode
);
if
(
0
<
inputItemVos
.
size
())
{
if
(
0
<
inputItemVos
.
size
())
{
...
@@ -1129,9 +1139,6 @@ public class PointServiceImpl implements IPointService {
...
@@ -1129,9 +1139,6 @@ public class PointServiceImpl implements IPointService {
});
});
}
}
}
}
if
(
0
<
ids
.
size
())
{
iPointInputItemDao
.
deleteByPointId
(
ids
);
}
iPointInputItemDao
.
saveAll
(
inputItems
);
iPointInputItemDao
.
saveAll
(
inputItems
);
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/service/intfc/ICheckService.java
View file @
735575bb
...
@@ -66,7 +66,7 @@ public interface ICheckService {
...
@@ -66,7 +66,7 @@ public interface ICheckService {
* @param requestParam
* @param requestParam
* @return
* @return
*/
*/
Map
<
String
,
Object
>
checkCalendar
(
CheckRecordParam
requestParam
);
Map
<
String
,
Object
>
checkCalendar
(
Map
<
String
,
Object
>
requestParam
);
/**
/**
* 根据点ID查询点巡检记录 手机APP
* 根据点ID查询点巡检记录 手机APP
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/service/intfc/IPointService.java
View file @
735575bb
...
@@ -297,7 +297,7 @@ public interface IPointService {
...
@@ -297,7 +297,7 @@ public interface IPointService {
List
queryItemList4RoutePoint
(
Long
pointId
,
Long
equipId
);
List
queryItemList4RoutePoint
(
Long
pointId
,
Long
equipId
);
LinkedHashMap
<
String
,
Object
>
getRegionTress
();
LinkedHashMap
<
String
,
Object
>
getRegionTress
();
void
syncSavePoint
(
List
<
MaintenanceResourceData
>
list
,
String
orgCode
,
String
userId
);
void
syncSavePoint
(
List
<
MaintenanceResourceData
>
list
,
String
orgCode
,
String
userId
);
/**
/**
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/vo/MaintenanceResourceData.java
View file @
735575bb
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
vo
;
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
vo
;
import
cn.afterturn.easypoi.excel.annotation.Excel
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -53,7 +52,6 @@ public class MaintenanceResourceData {
...
@@ -53,7 +52,6 @@ public class MaintenanceResourceData {
/**
/**
* 业主单位名称
* 业主单位名称
*/
*/
@Excel
(
name
=
"所属单位"
,
width
=
30
,
orderNum
=
"7"
)
private
String
ownerUnitName
;
private
String
ownerUnitName
;
/**
/**
...
@@ -69,7 +67,6 @@ public class MaintenanceResourceData {
...
@@ -69,7 +67,6 @@ public class MaintenanceResourceData {
/**
/**
* 消防系统名称
* 消防系统名称
*/
*/
@Excel
(
name
=
"所属消防系统"
,
width
=
30
,
orderNum
=
"4"
)
private
String
fireFightSysName
;
private
String
fireFightSysName
;
/**
/**
...
@@ -85,7 +82,6 @@ public class MaintenanceResourceData {
...
@@ -85,7 +82,6 @@ public class MaintenanceResourceData {
/**
/**
* 分类名称
* 分类名称
*/
*/
@Excel
(
name
=
"设施类型"
,
width
=
30
,
orderNum
=
"3"
)
private
String
classifyName
;
private
String
classifyName
;
/**
/**
...
@@ -101,13 +97,11 @@ public class MaintenanceResourceData {
...
@@ -101,13 +97,11 @@ public class MaintenanceResourceData {
/**
/**
* 消防设施编码
* 消防设施编码
*/
*/
@Excel
(
name
=
"设施编码"
,
width
=
30
,
orderNum
=
"6"
)
private
String
fireFacilityCode
;
private
String
fireFacilityCode
;
/**
/**
* 消防设施名称
* 消防设施名称
*/
*/
@Excel
(
name
=
"设施名称"
,
width
=
30
,
orderNum
=
"1"
)
private
String
fireFacilityName
;
private
String
fireFacilityName
;
/**
/**
...
@@ -116,29 +110,10 @@ public class MaintenanceResourceData {
...
@@ -116,29 +110,10 @@ public class MaintenanceResourceData {
private
String
fireFacilityType
;
private
String
fireFacilityType
;
/**
/**
* 维保到期时间
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@Excel
(
name
=
"到期维保时间"
,
exportFormat
=
"yyyy-MM-dd HH:mm:ss"
,
importFormat
=
"yyyy-MM-dd HH:mm:ss"
,
width
=
30
,
orderNum
=
"5"
)
private
Date
maintenanceExpirationTime
;
/**
* 位置
* 位置
*/
*/
@Excel
(
name
=
"安装或设置位置"
,
width
=
50
,
orderNum
=
"2"
)
private
String
location
;
private
String
location
;
/**
* 建筑层级IDS
*/
private
String
buildTierIds
;
/**
* 新增和更新执行
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@Excel
(
name
=
"添加时间"
,
exportFormat
=
"yyyy-MM-dd HH:mm:ss"
,
importFormat
=
"yyyy-MM-dd HH:mm:ss"
,
width
=
30
,
orderNum
=
"8"
)
private
Date
createDate
;
/**
/**
* 建筑ID
* 建筑ID
...
@@ -150,17 +125,12 @@ public class MaintenanceResourceData {
...
@@ -150,17 +125,12 @@ public class MaintenanceResourceData {
*/
*/
private
String
buildingName
;
private
String
buildingName
;
/**
* 是否已关联
*/
private
List
<
Long
>
buildingIds
;
/**
/**
*
是否已关联
*
详情位置
*/
*/
private
Boolean
isRelation
;
private
String
area
;
// public void setRelation(Boolean relation) {
// isRelation = relation == null ? null : false;
// }
}
}
amos-boot-system-maintenance/src/main/resources/db/mapper/dbTemplate_check.xml
View file @
735575bb
...
@@ -286,27 +286,32 @@
...
@@ -286,27 +286,32 @@
COUNT(id) count
COUNT(id) count
FROM
FROM
p_check
p_check
WHERE
<include
refid=
"calendar-where"
/>
DATE_FORMAT(check_time, '%Y-%m') = #{checkTime}
<if
test=
"userId!=null and userId!=0"
>
AND FIND_IN_SET(#{userId}, user_id)>0
</if>
<if
test=
"routeId!=null and routeId!=0"
>
AND route_id = #{routeId}
</if>
<if
test=
"orgCode!=null"
>
AND org_code LIKE #{orgCode}
</if>
</select>
</select>
<sql
id=
"calendar-where"
>
<where>
DATE_FORMAT(check_time, '%Y-%m') = #{checkTime}
<choose>
<when
test=
"identityType==1"
>
And (org_code LIKE CONCAT( #{orgCode}, '-%' ) or org_code= #{orgCode} )
</when>
<when
test=
"identityType==2"
>
And owner_id = #{companyId}
</when>
</choose>
</where>
</sql>
<select
id=
"calendarData"
resultType=
"Map"
>
<select
id=
"calendarData"
resultType=
"Map"
>
SELECT
SELECT
sum(is_ok
) AS count,
count(id
) AS count,
DATE_FORMAT(check_time, '%Y-%m-%d') time,
DATE_FORMAT(check_time, '%Y-%m-%d') time,
is_ok status
is_ok status
FROM
FROM
p_check
p_check
WHERE
<include
refid=
"calendar-where"
/>
DATE_FORMAT(check_time, '%Y-%m') = #{checkTime}
<if
test=
"userId!=null and userId!=0"
>
AND FIND_IN_SET(#{userId}, user_id)>0
</if>
<if
test=
"routeId!=null and routeId!=0"
>
AND route_id = #{routeId}
</if>
<if
test=
"orgCode!=null"
>
AND org_code LIKE #{orgCode}
</if>
GROUP BY is_ok,time
GROUP BY is_ok,time
ORDER BY time
ORDER BY
check_
time
</select>
</select>
...
@@ -1907,6 +1912,7 @@
...
@@ -1907,6 +1912,7 @@
pp.belong_system_id systemId,
pp.belong_system_id systemId,
pp.belong_system_name systemName,
pp.belong_system_name systemName,
pp.address address,
pp.address address,
pp.original_id equipId,
CONCAT(pp.address, pp.building_name) buildingName
CONCAT(pp.address, pp.building_name) buildingName
FROM p_check pc
FROM p_check pc
LEFT JOIN p_point pp ON pp.id = pc.point_id
LEFT JOIN p_point pp ON pp.id = pc.point_id
...
@@ -1937,6 +1943,7 @@
...
@@ -1937,6 +1943,7 @@
<include
refid=
"mobile-check-time-last-month"
></include>
<include
refid=
"mobile-check-time-last-month"
></include>
</if>
</if>
<if
test=
"finishStatus != null"
>
and a.finishStatus = #{finishStatus}
</if>
<if
test=
"finishStatus != null"
>
and a.finishStatus = #{finishStatus}
</if>
<if
test=
"equipId != null and equipId != '' "
>
and a.equipId = #{equipId}
</if>
<if
test=
"beginTime != null and beginTime != '' and endTime != null and endTime != '' "
>
<if
test=
"beginTime != null and beginTime != '' and endTime != null and endTime != '' "
>
AND (
AND (
(
(
...
...
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