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
a7795bcb
Commit
a7795bcb
authored
Aug 19, 2021
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改重新提交
parent
b9103c7f
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
721 additions
and
823 deletions
+721
-823
FailureRepairlogDto.java
.../amos/boot/module/common/api/dto/FailureRepairlogDto.java
+1
-2
FailureRepairlog.java
.../amos/boot/module/common/api/entity/FailureRepairlog.java
+0
-2
FailureDetailsMapper.java
...s/boot/module/common/api/mapper/FailureDetailsMapper.java
+29
-0
FailureDetailsMapper.xml
...on-api/src/main/resources/mapper/FailureDetailsMapper.xml
+60
-0
FailureAuditController.java
.../module/common/biz/controller/FailureAuditController.java
+0
-31
FailureMaintainController.java
...dule/common/biz/controller/FailureMaintainController.java
+4
-69
FailureAuditServiceImpl.java
...dule/common/biz/service/impl/FailureAuditServiceImpl.java
+13
-28
FailureDetailsServiceImpl.java
...le/common/biz/service/impl/FailureDetailsServiceImpl.java
+605
-598
FailureMaintainServiceImpl.java
...e/common/biz/service/impl/FailureMaintainServiceImpl.java
+6
-77
FailureVerifyServiceImpl.java
...ule/common/biz/service/impl/FailureVerifyServiceImpl.java
+3
-16
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/FailureRepairlogDto.java
View file @
a7795bcb
...
@@ -24,7 +24,6 @@ public class FailureRepairlogDto extends BaseDto {
...
@@ -24,7 +24,6 @@ public class FailureRepairlogDto extends BaseDto {
@ApiModelProperty
(
value
=
"流程处理人Id"
)
@ApiModelProperty
(
value
=
"流程处理人Id"
)
private
Integer
processAuditorId
;
private
Integer
processAuditorId
;
@ApiModelProperty
(
value
=
"处理人所属部门"
)
@ApiModelProperty
(
value
=
"处理人所属部门"
)
private
String
processDepartment
;
private
String
processDepartment
;
...
@@ -41,6 +40,6 @@ public class FailureRepairlogDto extends BaseDto {
...
@@ -41,6 +40,6 @@ public class FailureRepairlogDto extends BaseDto {
private
Long
faultId
;
private
Long
faultId
;
@ApiModelProperty
(
value
=
"流程处理人"
)
@ApiModelProperty
(
value
=
"流程处理人"
)
private
String
processAuditor
Cid
;
private
String
processAuditor
Name
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/entity/FailureRepairlog.java
View file @
a7795bcb
...
@@ -62,6 +62,4 @@ public class FailureRepairlog extends BaseEntity {
...
@@ -62,6 +62,4 @@ public class FailureRepairlog extends BaseEntity {
@TableField
(
"fault_id"
)
@TableField
(
"fault_id"
)
private
Long
faultId
;
private
Long
faultId
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/mapper/FailureDetailsMapper.java
View file @
a7795bcb
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
mapper
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.FailureDetails
;
import
com.yeejoin.amos.boot.module.common.api.entity.FailureDetails
;
import
org.apache.ibatis.annotations.Param
;
/**
/**
* Mapper 接口
* Mapper 接口
...
@@ -10,4 +15,28 @@ import com.yeejoin.amos.boot.module.common.api.entity.FailureDetails;
...
@@ -10,4 +15,28 @@ import com.yeejoin.amos.boot.module.common.api.entity.FailureDetails;
* @date 2021-08-04
* @date 2021-08-04
*/
*/
public
interface
FailureDetailsMapper
extends
BaseMapper
<
FailureDetails
>
{
public
interface
FailureDetailsMapper
extends
BaseMapper
<
FailureDetails
>
{
/**
*查询全部 分页
* @param page
* @return
*/
IPage
<
FailureDetails
>
selectAllPage
(
Page
page
);
/**
*查询我发起的 分页
* current 当前页
* size 条数
* @return
*/
IPage
<
FailureDetails
>
selectISubPage
(
Page
page
,
String
submissionPid
);
/**
*查询待处理 分页
* @param page
* @return
*/
IPage
<
FailureDetails
>
selectInProcessing
(
Page
page
);
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/FailureDetailsMapper.xml
View file @
a7795bcb
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.common.api.mapper.FailureDetailsMapper"
>
<mapper
namespace=
"com.yeejoin.amos.boot.module.common.api.mapper.FailureDetailsMapper"
>
<select
id=
"selectAllPage"
resultType=
"com.yeejoin.amos.boot.module.common.api.entity.FailureDetails"
>
SELECT
sequence_nbr,
current_status,
current_status,
failure_equipment_id,
failure_equipment,
fault_time,
fault_phenomenon,
submission_name,
submission_pid,
biz_code,
submission_time,
submission_branch,
submission_branch_id
FROM
cb_failure_details
</select>
<select
id=
"selectISubPage"
resultType=
"com.yeejoin.amos.boot.module.common.api.entity.FailureDetails"
>
SELECT
sequence_nbr,
current_status,
failure_equipment_id,
failure_equipment,
fault_time,
fault_phenomenon,
submission_name,
submission_pid,
biz_code,
submission_time,
submission_branch,
submission_branch_id
FROM
cb_failure_details
WHERE
submission_pid = #{submissionPid}
</select>
<select
id=
"selectInProcessing"
resultType=
"com.yeejoin.amos.boot.module.common.api.entity.FailureDetails"
>
SELECT
sequence_nbr,
current_status,
current_status,
failure_equipment_id,
failure_equipment,
fault_time,
fault_phenomenon,
submission_name,
submission_pid,
biz_code,
submission_time,
submission_branch,
submission_branch_id
FROM
cb_failure_details
WHERE
is_delete = 0
</select>
</mapper>
</mapper>
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 @
a7795bcb
...
@@ -49,8 +49,6 @@ public class FailureAuditController extends BaseController {
...
@@ -49,8 +49,6 @@ public class FailureAuditController extends BaseController {
}
}
}
}
/**
/**
* 根据sequenceNbr查询
* 根据sequenceNbr查询
*
*
...
@@ -64,35 +62,6 @@ public class FailureAuditController extends BaseController {
...
@@ -64,35 +62,6 @@ public class FailureAuditController extends BaseController {
return
ResponseHelper
.
buildResponse
(
failureAuditServiceImpl
.
queryBySeq
(
sequenceNbr
));
return
ResponseHelper
.
buildResponse
(
failureAuditServiceImpl
.
queryBySeq
(
sequenceNbr
));
}
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"分页查询"
,
notes
=
"分页查询"
)
public
ResponseModel
<
Page
<
FailureAuditDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
Page
<
FailureAuditDto
>
page
=
new
Page
<
FailureAuditDto
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
failureAuditServiceImpl
.
queryForFailureAuditPage
(
page
));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表全部数据查询"
,
notes
=
"列表全部数据查询"
)
@GetMapping
(
value
=
"/list"
)
public
ResponseModel
<
List
<
FailureAuditDto
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
failureAuditServiceImpl
.
queryForFailureAuditList
());
}
/**
/**
* 审核列表记录查询
* 审核列表记录查询
...
...
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 @
a7795bcb
...
@@ -2,23 +2,23 @@ package com.yeejoin.amos.boot.module.common.biz.controller;
...
@@ -2,23 +2,23 @@ package com.yeejoin.amos.boot.module.common.biz.controller;
import
java.util.List
;
import
java.util.List
;
import
com.yeejoin.amos.boot.module.common.api.entity.FailureAudit
;
import
com.yeejoin.amos.boot.module.common.api.entity.FailureMaintain
;
import
com.yeejoin.amos.boot.module.common.api.entity.FailureMaintain
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureMaintainDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureMaintainDto
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.FailureMaintainServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.FailureMaintainServiceImpl
;
...
@@ -59,71 +59,6 @@ public class FailureMaintainController extends BaseController {
...
@@ -59,71 +59,6 @@ public class FailureMaintainController extends BaseController {
}
}
/**
/**
* 根据sequenceNbr更新
* 根据传递的Status状态确认验收状态
*
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/verify"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"验收操作"
,
notes
=
"根据sequenceNbr更新"
)
public
Object
updateBySequenceNbrFailureMaintain
(
@RequestBody
FailureMaintainDto
model
)
{
try
{
return
ResponseHelper
.
buildResponse
(
failureMaintainServiceImpl
.
updateModel
(
model
,
getSelectedOrgInfo
()));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
ResponseHelper
.
buildResponse
(
false
);
}
}
/*
*/
/**
* 根据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);
try {
return ResponseHelper.buildResponse(failureMaintainServiceImpl.updateStatus(model,getSelectedOrgInfo()));
} catch (Exception e) {
return ResponseHelper.buildResponse(false);
}
}
*/
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"分页查询"
,
notes
=
"分页查询"
)
public
ResponseModel
<
Page
<
FailureMaintainDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
Page
<
FailureMaintainDto
>
page
=
new
Page
<
FailureMaintainDto
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
failureMaintainServiceImpl
.
queryForFailureMaintainPage
(
page
));
}
/**
* 维修列表记录查询
* 维修列表记录查询
*根据关联主表faultId查询
*根据关联主表faultId查询
* @return
* @return
...
...
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 @
a7795bcb
...
@@ -44,21 +44,7 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
...
@@ -44,21 +44,7 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
@Autowired
@Autowired
FailureRepairlogServiceImpl
failureRepairlogService
;
FailureRepairlogServiceImpl
failureRepairlogService
;
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
FailureAuditServiceImpl
.
class
);
/**
* 分页查询
*/
public
Page
<
FailureAuditDto
>
queryForFailureAuditPage
(
Page
<
FailureAuditDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
}
/**
* 列表查询 示例
*/
public
List
<
FailureAuditDto
>
queryForFailureAuditList
()
{
return
this
.
queryForList
(
""
,
false
);
}
/**
/**
* 发起审核
* 发起审核
...
@@ -75,23 +61,23 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
...
@@ -75,23 +61,23 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
model
.
getFaultId
());
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
model
.
getFaultId
());
int
auditResult
=
0
;
int
auditResult
=
0
;
Boolean
repairResult
=
null
;
//根据审核的结果进行业务操作
//根据审核的结果进行业务操作
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
()
&&
userInfo
.
getDepartment
().
getSequenceNbr
().
equals
(
failureDetailsDto
.
getBizCode
()))
{
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
()
&&
userInfo
.
getDepartment
().
getSequenceNbr
().
equals
(
failureDetailsDto
.
getBizCode
()))
{
auditResult
=
AuditResultEnum
.
AGREE
.
getCode
();
auditResult
=
AuditResultEnum
.
AGREE
.
getCode
();
Boolean
repairResult
=
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_AUDIT
,
userInfo
,
condition
);
repairResult
=
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_AUDIT
,
userInfo
,
condition
);
}
else
if
(
condition
==
(
AuditResultEnum
.
REFUSE
.
getCode
()))
{
}
else
if
(
condition
==
(
AuditResultEnum
.
REFUSE
.
getCode
()))
{
auditResult
=
AuditResultEnum
.
REFUSE
.
getCode
();
auditResult
=
AuditResultEnum
.
REFUSE
.
getCode
();
Boolean
repairResult
=
updateStatus
(
model
,
FailureStatuEnum
.
REFUSE
,
userInfo
,
condition
);
repairResult
=
updateStatus
(
model
,
FailureStatuEnum
.
REFUSE
,
userInfo
,
condition
);
}
else
if
(
condition
==
(
AuditResultEnum
.
SEND_BACK
.
getCode
()))
{
}
else
if
(
condition
==
(
AuditResultEnum
.
SEND_BACK
.
getCode
()))
{
auditResult
=
AuditResultEnum
.
SEND_BACK
.
getCode
();
auditResult
=
AuditResultEnum
.
SEND_BACK
.
getCode
();
Boolean
repairResult
=
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_SUBMIT
,
userInfo
,
condition
);
repairResult
=
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_SUBMIT
,
userInfo
,
condition
);
}
else
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
())
{
}
else
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
())
{
auditResult
=
AuditResultEnum
.
AGREE
.
getCode
();
auditResult
=
AuditResultEnum
.
AGREE
.
getCode
();
Boolean
repairResult
=
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_MAINTAIN
,
userInfo
,
condition
);
repairResult
=
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_MAINTAIN
,
userInfo
,
condition
);
}
}
if
(
ObjectUtils
.
isEmpty
(
auditResult
)
)
{
if
(
!
repairResult
)
{
throw
new
Exception
(
"添加报修日志失败"
);
throw
new
Exception
(
"添加报修日志失败"
);
}
}
model
.
setAuditResult
(
auditResult
);
model
.
setAuditResult
(
auditResult
);
...
@@ -115,7 +101,7 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
...
@@ -115,7 +101,7 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
//当前角色部门id为维修部门的时候 修改状态
//当前角色部门id为维修部门的时候 修改状态
failureDetailsDto
.
setCurrentStatus
(
status
.
getCode
());
failureDetailsDto
.
setCurrentStatus
(
status
.
getCode
());
failureDetailsDto
.
setSequenceNbr
(
model
.
getFaultId
());
failureDetailsDto
.
setSequenceNbr
(
model
.
getFaultId
());
FailureDetailsDto
failureDetailsDtos
=
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
String
conditionText
;
String
conditionText
;
boolean
result
=
failureDetailsService
.
checkExcuteTaskAuth
(
failureDetailsDto
.
getSequenceNbr
(),
userInfo
);
boolean
result
=
failureDetailsService
.
checkExcuteTaskAuth
(
failureDetailsDto
.
getSequenceNbr
(),
userInfo
);
...
@@ -124,19 +110,18 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
...
@@ -124,19 +110,18 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
Long
faultId
=
model
.
getFaultId
();
Long
faultId
=
model
.
getFaultId
();
Date
processTime
=
model
.
getAuditTime
();
Date
processTime
=
model
.
getAuditTime
();
String
processDepartment
=
model
.
getAuditDepartment
();
String
processDepartment
=
model
.
getAuditDepartment
();
// String processAuditor = model.getAuditor();
Integer
processAuditorId
=
Integer
.
parseInt
(
userInfo
.
getUserModel
().
getUserId
());
Integer
processAuditorId
=
Integer
.
parseInt
(
userInfo
.
getUserModel
().
getUserId
());
String
processAuditor
Cid
=
userInfo
.
getRole
().
getRole
Name
();
String
processAuditor
Name
=
userInfo
.
getUserModel
().
getReal
Name
();
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
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
,
processAuditor
Cid
);
repairlog
(
faultId
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
,
processAuditor
Name
);
}
else
if
(
condition
==
AuditResultEnum
.
SEND_BACK
.
getCode
())
{
}
else
if
(
condition
==
AuditResultEnum
.
SEND_BACK
.
getCode
())
{
conditionText
=
AuditResultEnum
.
SEND_BACK
.
getName
();
conditionText
=
AuditResultEnum
.
SEND_BACK
.
getName
();
repairlog
(
faultId
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
,
processAuditor
Cid
);
repairlog
(
faultId
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
,
processAuditor
Name
);
}
else
if
(
condition
==
AuditResultEnum
.
REFUSE
.
getCode
())
{
}
else
if
(
condition
==
AuditResultEnum
.
REFUSE
.
getCode
())
{
conditionText
=
AuditResultEnum
.
REFUSE
.
getName
();
conditionText
=
AuditResultEnum
.
REFUSE
.
getName
();
repairlog
(
faultId
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
,
processAuditor
Cid
);
repairlog
(
faultId
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
,
processAuditor
Name
);
}
}
if
(
failureDetailsService
.
excuteTask
(
failureDetailsDto
.
getProcessId
(),
userInfo
,
condition
+
""
)){
if
(
failureDetailsService
.
excuteTask
(
failureDetailsDto
.
getProcessId
(),
userInfo
,
condition
+
""
)){
return
true
;
return
true
;
...
@@ -152,7 +137,7 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
...
@@ -152,7 +137,7 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
*/
*/
@Transactional
@Transactional
public
Boolean
repairlog
(
Long
faultId
,
Integer
processAuditorId
,
Long
departmentId
,
Date
processTime
,
public
Boolean
repairlog
(
Long
faultId
,
Integer
processAuditorId
,
Long
departmentId
,
Date
processTime
,
String
processDepartment
,
String
processResult
,
String
processAuditor
Cid
)
{
String
processDepartment
,
String
processResult
,
String
processAuditor
Name
)
{
FailureRepairlogDto
failureRepairlogDto
=
new
FailureRepairlogDto
();
FailureRepairlogDto
failureRepairlogDto
=
new
FailureRepairlogDto
();
failureRepairlogDto
.
setFaultId
(
faultId
);
failureRepairlogDto
.
setFaultId
(
faultId
);
failureRepairlogDto
.
setProcessAuditorId
(
processAuditorId
);
failureRepairlogDto
.
setProcessAuditorId
(
processAuditorId
);
...
@@ -160,7 +145,7 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
...
@@ -160,7 +145,7 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
failureRepairlogDto
.
setProcessTime
(
processTime
);
failureRepairlogDto
.
setProcessTime
(
processTime
);
failureRepairlogDto
.
setProcessDepartment
(
processDepartment
);
failureRepairlogDto
.
setProcessDepartment
(
processDepartment
);
failureRepairlogDto
.
setProcessResult
(
processResult
);
failureRepairlogDto
.
setProcessResult
(
processResult
);
failureRepairlogDto
.
setProcessAuditor
Cid
(
processAuditorCid
);
failureRepairlogDto
.
setProcessAuditor
Name
(
processAuditorName
);
failureRepairlogService
.
createWithModel
(
failureRepairlogDto
);
failureRepairlogService
.
createWithModel
(
failureRepairlogDto
);
if
(
ObjectUtils
.
isNotEmpty
(
failureRepairlogDto
))
{
if
(
ObjectUtils
.
isNotEmpty
(
failureRepairlogDto
))
{
return
true
;
return
true
;
...
...
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 @
a7795bcb
...
@@ -8,7 +8,6 @@ import java.util.HashMap;
...
@@ -8,7 +8,6 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Random
;
import
java.util.Random
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -18,7 +17,6 @@ import org.springframework.stereotype.Service;
...
@@ -18,7 +17,6 @@ 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.springframework.transaction.interceptor.TransactionAspectSupport
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
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.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
@@ -39,7 +37,6 @@ import com.yeejoin.amos.boot.module.common.api.service.IFailureAuditService;
...
@@ -39,7 +37,6 @@ import com.yeejoin.amos.boot.module.common.api.service.IFailureAuditService;
import
com.yeejoin.amos.boot.module.common.api.service.IFailureDetailsService
;
import
com.yeejoin.amos.boot.module.common.api.service.IFailureDetailsService
;
import
com.yeejoin.amos.boot.module.common.api.service.IFailureRepairlogService
;
import
com.yeejoin.amos.boot.module.common.api.service.IFailureRepairlogService
;
import
com.yeejoin.amos.boot.module.common.biz.constats.Constants
;
import
com.yeejoin.amos.boot.module.common.biz.constats.Constants
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
/**
/**
* 服务实现类
* 服务实现类
...
@@ -49,507 +46,516 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
...
@@ -49,507 +46,516 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
*/
*/
@Service
@Service
public
class
FailureDetailsServiceImpl
extends
BaseService
<
FailureDetailsDto
,
FailureDetails
,
FailureDetailsMapper
>
public
class
FailureDetailsServiceImpl
extends
BaseService
<
FailureDetailsDto
,
FailureDetails
,
FailureDetailsMapper
>
implements
IFailureDetailsService
{
implements
IFailureDetailsService
{
@Autowired
@Autowired
SourceFileServiceImpl
sourceFileServiceImpl
;
SourceFileServiceImpl
sourceFileServiceImpl
;
@Autowired
@Autowired
WorkflowFeignService
workflowFeignService
;
WorkflowFeignService
workflowFeignService
;
@Value
(
"${failure.work.flow.processDefinitionKey}"
)
@Value
(
"${failure.work.flow.processDefinitionKey}"
)
private
String
processDefinitionKey
;
private
String
processDefinitionKey
;
@Autowired
@Autowired
FailureAuditServiceImpl
failureAuditServiceImpl
;
FailureAuditServiceImpl
failureAuditServiceImpl
;
@Autowired
@Autowired
IFailureAuditService
failureAuditService
;
IFailureAuditService
failureAuditService
;
@Autowired
@Autowired
FailureRepairlogServiceImpl
failureRepairlogService
;
FailureRepairlogServiceImpl
failureRepairlogService
;
@Autowired
@Autowired
IFailureRepairlogService
failureRepairlog
;
IFailureRepairlogService
failureRepairlog
;
public
static
String
EMERGENCY_COMMAND
=
"应急指挥科"
;
public
static
String
[]
PROCESS_NAME
=
{
"提交维修单"
,
"审核"
,
"维修"
,
"验收"
,
"维修中"
};
public
static
String
EMERGENCY_COMMAND
=
"应急指挥科"
;
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
FailureDetailsServiceImpl
.
class
);
public
static
String
[]
PROCESS_NAME
=
{
"提交报修单"
,
"审核"
,
"维修"
,
"验收"
,
"维修中"
};
public
static
Integer
SELECY_ALL
=
6
;
public
static
Integer
SELECY_ALL
=
6
;
public
static
Integer
SELECY_STATUS
=
7
;
public
static
Integer
SELECY_STATUS
=
7
;
public
static
Integer
SELECY_ISUBMIT
=
8
;
public
static
Integer
SELECY_ISUBMIT
=
8
;
public
String
[]
roleName
=
{
""
,
""
}
;
/**
/**
* 分页查询
* 分页查询
*/
*/
public
IPage
<
FailureDetails
>
queryAllPage
(
long
size
,
long
current
)
{
public
IPage
<
FailureDetails
>
queryAllPage
(
long
size
,
long
current
)
{
/*QueryWrapper<FailureDetails> wrapper = new QueryWrapper<>();
Page
pages
=
new
Page
<>(
current
,
size
);
wrapper.orderByDesc("submission_time");
LambdaQueryWrapper
<
FailureDetails
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
();
IPage<FailureDetails> page = new Page<>(current, size);
lambdaQueryWrapper
.
orderByDesc
(
FailureDetails:
:
getSubmissionTime
);
return baseMapper.selectPage(page, wrapper);*/
return
page
(
pages
,
lambdaQueryWrapper
);
Page
pages
=
new
Page
<>(
current
,
size
);
LambdaQueryWrapper
<
FailureDetails
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
();
}
lambdaQueryWrapper
.
orderByDesc
(
FailureDetails:
:
getSubmissionTime
);
IPage
iPage
=
page
(
pages
,
lambdaQueryWrapper
);
public
IPage
<
FailureDetails
>
queryForFailureDetailsPage
(
Page
<
FailureDetails
>
page
,
ReginParams
userInfo
,
Page
<
FailureDetails
>
page
=
new
Page
();
Integer
type
)
{
page
.
setCurrent
(
current
);
if
(
type
.
equals
(
SELECY_ALL
))
{
page
.
setSize
(
size
);
return
this
.
baseMapper
.
selectAllPage
(
page
);
page
.
setRecords
(
iPage
.
getRecords
());
}
return
page
;
if
(
type
.
equals
(
SELECY_ISUBMIT
))
{
}
return
baseMapper
.
selectISubPage
(
page
,
userInfo
.
getUserModel
().
getUserId
());
}
public
IPage
<
FailureDetails
>
queryForFailureDetailsPage
(
Page
<
FailureDetails
>
page
,
ReginParams
userInfo
,
return
this
.
queryForWaitManage
(
page
,
userInfo
);
Integer
type
)
{
}
if
(
type
.
equals
(
SELECY_ALL
))
{
return
this
.
queryAllPage
(
page
.
getSize
(),
page
.
getCurrent
());
/**
}
* 我发起分页查询
if
(
type
.
equals
(
SELECY_ISUBMIT
))
{
*/
return
queryForPage
(
page
,
userInfo
.
getUserModel
().
getUserId
());
public
IPage
<
FailureDetails
>
queryForPage
(
Page
<
FailureDetails
>
page
,
String
submissionPid
)
{
}
if
(
submissionPid
==
null
)
{
return
this
.
queryForWaitManage
(
page
,
userInfo
.
getUserModel
().
getUserId
());
return
null
;
}
}
Page
pages
=
new
Page
<>(
page
.
getCurrent
(),
page
.
getSize
());
/**
LambdaQueryWrapper
<
FailureDetails
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
();
* 我发起分页查询
lambdaQueryWrapper
.
eq
(
FailureDetails:
:
getSubmissionPid
,
submissionPid
);
*/
lambdaQueryWrapper
.
orderByDesc
(
FailureDetails:
:
getSubmissionTime
);
public
IPage
<
FailureDetails
>
queryForPage
(
Page
<
FailureDetails
>
page
,
String
submissionPid
)
{
return
page
(
pages
,
lambdaQueryWrapper
);
if
(
submissionPid
==
null
)
{
}
return
null
;
}
/**
/* QueryWrapper<FailureDetails> wrapper = new QueryWrapper<>();
* 待处理分页查询
wrapper.eq("submission_pid", submissionPid);
*/
wrapper.orderByDesc("submission_time");
public
IPage
<
FailureDetails
>
queryForWaitManage
(
Page
<
FailureDetails
>
page
,
ReginParams
userInfo
)
{
IPage<FailureDetails> failureDetailsPage = new Page<>(page.getCurrent(), page.getSize());
/* if (userInfo.getRole().getRoleName().equals())*/
return baseMapper.selectPage(failureDetailsPage, wrapper);*/
/* if (submissionPid == null) {
return null;
Page
pages
=
new
Page
<>(
page
.
getCurrent
(),
page
.
getSize
());
}
LambdaQueryWrapper
<
FailureDetails
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
();
LambdaQueryWrapper<FailureDetails> lambdaQueryWrapper = new LambdaQueryWrapper();
lambdaQueryWrapper
.
eq
(
FailureDetails:
:
getSubmissionPid
,
submissionPid
);
lambdaQueryWrapper.notIn(FailureDetails::getCurrentStatus, FailureStatuEnum.REFUSE.getCode(), FailureStatuEnum.FINISH.getCode()
lambdaQueryWrapper
.
orderByDesc
(
FailureDetails:
:
getSubmissionTime
);
).orderByDesc(FailureDetails::getSubmissionTime);
return
page
(
pages
,
lambdaQueryWrapper
);
IPage<FailureDetails> failureDetailsPage = new Page<>(page.getCurrent(), page.getSize());
}
return baseMapper.selectPage(failureDetailsPage, lambdaQueryWrapper);*/
return
baseMapper
.
selectInProcessing
(
page
);
/**
}
* 待处理分页查询
*/
public
IPage
<
FailureDetails
>
queryForWaitManage
(
Page
<
FailureDetails
>
page
,
String
submissionPid
)
{
/**
if
(
submissionPid
==
null
)
{
* 列表查询 示例
return
null
;
*/
}
public
List
<
FailureDetailsDto
>
queryForFailureDetailsList
()
{
LambdaQueryWrapper
<
FailureDetails
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
();
return
this
.
queryForList
(
""
,
false
);
lambdaQueryWrapper
.
notIn
(
FailureDetails:
:
getCurrentStatus
,
FailureStatuEnum
.
REFUSE
.
getCode
(),
FailureStatuEnum
.
FINISH
.
getCode
()
}
).
orderByDesc
(
FailureDetails:
:
getSubmissionTime
);
/*QueryWrapper<FailureDetails> wrapper = new QueryWrapper<>();
/**
wrapper.eq("submission_pid", submissionPid);
* 根据状态查询
wrapper.notIn("current_status", FailureStatuEnum.REFUSE.getCode(), FailureStatuEnum.FINISH.getCode(),
*/
FailureStatuEnum.WAITING_AUDIT.getCode());
wrapper.orderByDesc("submission_time");*/
public
FailureDetailsDto
queryForOne
(
Long
sequenceNbr
)
{
IPage
<
FailureDetails
>
failureDetailsPage
=
new
Page
<>(
page
.
getCurrent
(),
page
.
getSize
());
FailureDetailsDto
failureDetailsDto
=
this
.
queryBySeq
(
sequenceNbr
);
return
baseMapper
.
selectPage
(
failureDetailsPage
,
lambdaQueryWrapper
);
failureDetailsDto
}
.
setCurrentStatusName
(
Constants
.
currentStatusNameMap
.
get
(
failureDetailsDto
.
getCurrentStatus
()));
List
<
SourceFile
>
sourceFiles
=
sourceFileServiceImpl
.
findBySourceId
(
sequenceNbr
);
failureDetailsDto
.
setAttachment
(
sourceFiles
);
/**
return
failureDetailsDto
;
* 列表查询 示例
}
*/
public
List
<
FailureDetailsDto
>
queryForFailureDetailsList
()
{
/**
return
this
.
queryForList
(
""
,
false
);
* 根据状态查询
}
*/
public
List
<
FailureDetails
>
queryForFailureStatus
(
Long
currentStatus
)
{
/**
String
status
=
new
String
();
* 根据状态查询
List
<
FailureStatuEnum
>
list
=
new
ArrayList
<>();
*/
list
.
add
(
FailureStatuEnum
.
WAITING_AUDIT
);
list
.
add
(
FailureStatuEnum
.
WAITING_SUBMIT
);
public
FailureDetailsDto
queryForOne
(
Long
sequenceNbr
)
{
list
.
add
(
FailureStatuEnum
.
WAITING_MAINTAIN
);
FailureDetailsDto
failureDetailsDto
=
this
.
queryBySeq
(
sequenceNbr
);
list
.
add
(
FailureStatuEnum
.
WAITING_ACCEPTANCE
);
failureDetailsDto
list
.
add
(
FailureStatuEnum
.
REFUSE
);
.
setCurrentStatusName
(
Constants
.
currentStatusNameMap
.
get
(
failureDetailsDto
.
getCurrentStatus
()));
list
.
add
(
FailureStatuEnum
.
FINISH
);
List
<
SourceFile
>
sourceFiles
=
sourceFileServiceImpl
.
findBySourceId
(
sequenceNbr
);
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
failureDetailsDto
.
setAttachment
(
sourceFiles
);
if
(
currentStatus
.
equals
(
list
.
get
(
i
).
getCode
()))
{
return
failureDetailsDto
;
status
=
list
.
get
(
i
).
getName
();
}
}
}
/**
QueryWrapper
<
FailureDetails
>
queryWrapper
=
new
QueryWrapper
<>();
* 根据状态查询
queryWrapper
.
eq
(
"current_status"
,
status
).
orderByDesc
(
"submission_time"
);
*/
return
baseMapper
.
selectList
(
queryWrapper
);
public
List
<
FailureDetails
>
queryForFailureStatus
(
Long
currentStatus
)
{
}
String
status
=
new
String
();
List
<
FailureStatuEnum
>
list
=
new
ArrayList
<>();
/**
list
.
add
(
FailureStatuEnum
.
WAITING_AUDIT
);
* 查询任务状态数量
list
.
add
(
FailureStatuEnum
.
WAITING_SUBMIT
);
*/
list
.
add
(
FailureStatuEnum
.
WAITING_MAINTAIN
);
public
List
<
FailureStatusCountDto
>
queryStatusCount
(
Integer
type
)
{
list
.
add
(
FailureStatuEnum
.
WAITING_ACCEPTANCE
);
List
<
FailureDetailsDto
>
failureDetailsDtos
=
new
ArrayList
<>();
list
.
add
(
FailureStatuEnum
.
REFUSE
);
if
(
type
.
equals
(
SELECY_ALL
))
{
list
.
add
(
FailureStatuEnum
.
FINISH
);
failureDetailsDtos
=
this
.
queryForFailureDetailsList
();
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
}
if
(
currentStatus
.
equals
(
list
.
get
(
i
).
getCode
()))
{
if
(
type
.
equals
(
SELECY_ISUBMIT
))
{
status
=
list
.
get
(
i
).
getName
();
failureDetailsDtos
=
this
.
queryForFailureDetailsList
();
}
}
;
int
auditStatus
=
0
;
}
int
submitStatus
=
0
;
/* FailureStatuEnum[] failureStatuEnums = new FailureStatuEnum []{}; */
int
maintainStatus
=
0
;
QueryWrapper
<
FailureDetails
>
queryWrapper
=
new
QueryWrapper
<>();
int
acceptanceStatus
=
0
;
queryWrapper
.
eq
(
"current_status"
,
status
).
orderByDesc
(
"submission_time"
);
int
refuseStatus
=
0
;
return
baseMapper
.
selectList
(
queryWrapper
);
int
finishStatus
=
0
;
int
inMaintenance
=
0
;
}
List
<
FailureStatusCountDto
>
list
=
new
ArrayList
<>();
List
<
String
>
statusName
=
new
ArrayList
<>();
/**
Collections
.
addAll
(
statusName
,
FailureStatuEnum
.
WAITING_AUDIT
.
getName
(),
* 查询任务状态数量
FailureStatuEnum
.
WAITING_SUBMIT
.
getName
(),
FailureStatuEnum
.
WAITING_MAINTAIN
.
getName
(),
*/
FailureStatuEnum
.
WAITING_ACCEPTANCE
.
getName
(),
FailureStatuEnum
.
REFUSE
.
getName
(),
public
List
<
FailureStatusCountDto
>
queryStatusCount
(
Integer
type
)
{
FailureStatuEnum
.
FINISH
.
getName
(),
FailureStatuEnum
.
IN_MAINTENANCE
.
getName
());
List
<
FailureDetailsDto
>
failureDetailsDtos
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
failureDetailsDtos
.
size
();
i
++)
{
if
(
type
.
equals
(
SELECY_ALL
))
{
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
WAITING_AUDIT
.
getCode
()))
{
failureDetailsDtos
=
this
.
queryForFailureDetailsList
();
auditStatus
++;
}
}
if
(
type
.
equals
(
SELECY_ISUBMIT
))
{
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
WAITING_SUBMIT
.
getCode
()))
{
failureDetailsDtos
=
this
.
queryForFailureDetailsList
();
submitStatus
++;
}
}
int
auditStatus
=
0
;
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
WAITING_MAINTAIN
.
getCode
()))
{
int
submitStatus
=
0
;
maintainStatus
++;
int
maintainStatus
=
0
;
}
int
acceptanceStatus
=
0
;
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
WAITING_ACCEPTANCE
.
getCode
()))
{
int
refuseStatus
=
0
;
acceptanceStatus
++;
int
finishStatus
=
0
;
}
int
inMaintenance
=
0
;
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
REFUSE
.
getCode
()))
{
refuseStatus
++;
List
<
FailureStatusCountDto
>
list
=
new
ArrayList
<>();
}
// String[] statusName = new String[]{"待审核", "待提交", "待维修", "待验收", "已拒绝", "已完结"};
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
FINISH
.
getCode
()))
{
List
<
String
>
statusName
=
new
ArrayList
<>();
finishStatus
++;
Collections
.
addAll
(
statusName
,
FailureStatuEnum
.
WAITING_AUDIT
.
getName
(),
}
FailureStatuEnum
.
WAITING_SUBMIT
.
getName
(),
FailureStatuEnum
.
WAITING_MAINTAIN
.
getName
(),
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
IN_MAINTENANCE
.
getCode
()))
{
FailureStatuEnum
.
WAITING_ACCEPTANCE
.
getName
(),
FailureStatuEnum
.
REFUSE
.
getName
(),
inMaintenance
++;
FailureStatuEnum
.
FINISH
.
getName
(),
FailureStatuEnum
.
IN_MAINTENANCE
.
getName
());
}
}
for
(
int
i
=
0
;
i
<
failureDetailsDtos
.
size
();
i
++)
{
int
[]
statusCount
=
{
auditStatus
,
submitStatus
,
maintainStatus
,
acceptanceStatus
,
refuseStatus
,
finishStatus
,
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
WAITING_AUDIT
.
getCode
()))
{
inMaintenance
};
auditStatus
++;
for
(
int
i
=
0
;
i
<
statusName
.
size
();
i
++)
{
}
FailureStatusCountDto
statusCountDto
=
new
FailureStatusCountDto
();
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
WAITING_SUBMIT
.
getCode
()))
{
statusCountDto
.
setStatus
(
statusName
.
get
(
i
));
submitStatus
++;
statusCountDto
.
setCount
(
statusCount
[
i
]);
}
list
.
add
(
statusCountDto
);
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
WAITING_MAINTAIN
.
getCode
()))
{
}
maintainStatus
++;
return
list
;
}
}
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
WAITING_ACCEPTANCE
.
getCode
()))
{
acceptanceStatus
++;
/**
}
* 发起故障保修单
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
REFUSE
.
getCode
()))
{
*
refuseStatus
++;
* @throws Exception
}
*/
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
FINISH
.
getCode
()))
{
@Transactional
finishStatus
++;
public
Object
savemodel
(
FailureDetailsDto
failureDetailsDto
,
ReginParams
userInfo
)
throws
Exception
{
}
if
(
null
!=
failureDetailsDto
.
getSequenceNbr
()){
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
IN_MAINTENANCE
.
getCode
()))
{
return
updatetoModel
(
failureDetailsDto
,
userInfo
);
inMaintenance
++;
}
}
}
String
businessKey
=
buildOrderNo
();
JSONObject
body
=
new
JSONObject
();
int
[]
statusCount
=
{
auditStatus
,
submitStatus
,
maintainStatus
,
acceptanceStatus
,
refuseStatus
,
finishStatus
,
body
.
put
(
"businessKey"
,
businessKey
);
inMaintenance
};
body
.
put
(
"processDefinitionKey"
,
processDefinitionKey
);
JSONObject
jsonObject
=
workflowFeignService
.
startByVariable
(
body
);
for
(
int
i
=
0
;
i
<
statusName
.
size
();
i
++)
{
if
(
jsonObject
==
null
)
{
FailureStatusCountDto
statusCountDto
=
new
FailureStatusCountDto
();
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
statusCountDto
.
setStatus
(
statusName
.
get
(
i
));
// return CommonResponseUtil.failure("启动流程失败");
statusCountDto
.
setCount
(
statusCount
[
i
]);
}
list
.
add
(
statusCountDto
);
JSONObject
instance
=
jsonObject
.
getJSONObject
(
"data"
);
}
if
(
instance
==
null
)
{
return
list
;
// return CommonResponseUtil.failure("无提交隐患权限");
}
}
failureDetailsDto
.
setCurrentStatus
(
FailureStatuEnum
.
WAITING_AUDIT
.
getCode
());
/**
// 拿到流程processId
* 发起故障保修单
failureDetailsDto
.
setProcessId
(
instance
.
getString
(
"id"
));
*
FailureDetailsDto
model
=
null
;
* @throws Exception
*/
// 发起主表流程 并添加至报修日志
@Transactional
failureDetailsDto
.
setSubmissionTime
(
new
Date
());
public
Object
savemodel
(
FailureDetailsDto
failureDetailsDto
,
ReginParams
userInfo
)
throws
Exception
{
failureDetailsDto
.
setFailureCode
(
buildOrderNo
());
String
businessKey
=
buildOrderNo
();
failureDetailsDto
.
setSubmissionName
(
userInfo
.
getUserModel
().
getRealName
());
JSONObject
body
=
new
JSONObject
();
failureDetailsDto
.
setBizCode
(
userInfo
.
getDepartment
().
getSequenceNbr
());
body
.
put
(
"businessKey"
,
businessKey
);
model
=
this
.
createWithModel
(
failureDetailsDto
);
body
.
put
(
"processDefinitionKey"
,
processDefinitionKey
);
JSONObject
jsonObject
=
workflowFeignService
.
startByVariable
(
body
);
if
(
ObjectUtils
.
isNotEmpty
(
failureDetailsDto
.
getAttachment
()))
{
if
(
jsonObject
==
null
)
{
sourceFileServiceImpl
.
saveSourceFile
(
failureDetailsDto
.
getSequenceNbr
(),
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
failureDetailsDto
.
getAttachment
());
// return CommonResponseUtil.failure("启动流程失败");
}
}
// 添加至报修日志
JSONObject
instance
=
jsonObject
.
getJSONObject
(
"data"
);
Long
faultId
=
model
.
getSequenceNbr
();
if
(
instance
==
null
)
{
Integer
processAuditorId
=
model
.
getSubmissionPid
();
// return CommonResponseUtil.failure("无提交隐患权限");
String
processResult
=
"提交报修单"
;
}
String
processDepartment
=
userInfo
.
getDepartment
().
getDepartmentName
();
failureDetailsDto
.
setCurrentStatus
(
FailureStatuEnum
.
WAITING_AUDIT
.
getCode
());
Long
departmentId
=
userInfo
.
getDepartment
().
getSequenceNbr
();
// 拿到流程processId
Date
processTime
=
model
.
getSubmissionTime
();
failureDetailsDto
.
setProcessId
(
instance
.
getString
(
"id"
));
String
processAuditorName
=
failureDetailsDto
.
getSubmissionName
();
FailureDetailsDto
model
=
null
;
repairlog
(
faultId
,
processAuditorId
,
departmentId
,
processTime
,
processDepartment
,
processResult
,
processAuditorName
);
if
(
excuteTask
(
instance
.
getString
(
"id"
),
userInfo
,
null
))
{
// 发起主表流程 并添加至报修日志
return
true
;
failureDetailsDto
.
setSubmissionTime
(
new
Date
());
}
else
{
failureDetailsDto
.
setFailureCode
(
buildOrderNo
());
throw
new
Exception
(
"执行流程失败"
);
failureDetailsDto
.
setBizCode
(
userInfo
.
getDepartment
().
getSequenceNbr
());
}
failureDetailsDto
.
setIsDelete
(
false
);
model
=
this
.
createWithModel
(
failureDetailsDto
);
}
if
(
ObjectUtils
.
isNotEmpty
(
failureDetailsDto
.
getAttachment
()))
{
/**
sourceFileServiceImpl
.
saveSourceFile
(
failureDetailsDto
.
getSequenceNbr
(),
* 更新故障保修单
failureDetailsDto
.
getAttachment
());
*/
}
// 添加至报修日志
public
Object
updatetoModel
(
FailureDetailsDto
failureDetailsDto
,
ReginParams
userInfo
)
throws
Exception
{
Long
faultId
=
model
.
getSequenceNbr
();
Integer
processAuditorId
=
model
.
getSubmissionPid
();
String
processResult
=
"提交报修单"
;
// 发起主表流程 并添加至报修日志
String
processDepartment
=
userInfo
.
getDepartment
().
getDepartmentName
();
failureDetailsDto
.
setSubmissionTime
(
new
Date
());
Long
departmentId
=
userInfo
.
getDepartment
().
getSequenceNbr
();
FailureDetailsDto
model
=
this
.
updateWithModel
(
failureDetailsDto
);
Date
processTime
=
model
.
getSubmissionTime
();
String
processAuditorCid
=
userInfo
.
getRole
().
getRoleName
();
if
(
ObjectUtils
.
isNotEmpty
(
failureDetailsDto
.
getAttachment
()))
{
repairlog
(
faultId
,
processAuditorId
,
departmentId
,
processTime
,
processDepartment
,
processResult
,
processAuditorCid
);
sourceFileServiceImpl
.
saveSourceFile
(
failureDetailsDto
.
getSequenceNbr
(),
failureDetailsDto
.
getAttachment
());
if
(
excuteTask
(
instance
.
getString
(
"id"
),
userInfo
,
null
)){
}
return
true
;
// 添加至报修日志
}
else
{
Long
faultId
=
model
.
getSequenceNbr
();
throw
new
Exception
(
"执行流程失败"
);
Integer
processAuditorId
=
model
.
getSubmissionPid
();
}
String
processResult
=
"重新提交报修单"
;
String
processDepartment
=
userInfo
.
getDepartment
().
getDepartmentName
();
}
Long
departmentId
=
userInfo
.
getDepartment
().
getSequenceNbr
();
Date
processTime
=
model
.
getSubmissionTime
();
/**
String
processAuditorName
=
failureDetailsDto
.
getSubmissionName
();
* 添加报修日志
repairlog
(
faultId
,
processAuditorId
,
departmentId
,
processTime
,
processDepartment
,
processResult
,
processAuditorName
);
*/
if
(
excuteTask
(
failureDetailsDto
.
getProcessId
(),
userInfo
,
null
))
{
@Transactional
return
true
;
public
Boolean
repairlog
(
Long
faultId
,
Integer
processAuditorId
,
Long
departmentId
,
}
else
{
Date
processTime
,
String
processDepartment
,
String
processResult
,
String
processAuditorCid
)
{
throw
new
Exception
(
"执行流程失败"
);
FailureRepairlogDto
failureRepairlogDto
=
new
FailureRepairlogDto
();
}
failureRepairlogDto
.
setFaultId
(
faultId
);
failureRepairlogDto
.
setProcessAuditorId
(
processAuditorId
);
}
failureRepairlogDto
.
setProcessDepartmentId
(
departmentId
);
failureRepairlogDto
.
setProcessTime
(
processTime
);
/**
failureRepairlogDto
.
setProcessDepartment
(
processDepartment
);
* 添加报修日志
failureRepairlogDto
.
setProcessResult
(
processResult
);
*/
failureRepairlogDto
.
setProcessAuditorCid
(
processAuditorCid
);
@Transactional
FailureRepairlogDto
repairlogModel
=
failureRepairlogService
.
createWithModel
(
failureRepairlogDto
);
public
Boolean
repairlog
(
Long
faultId
,
Integer
processAuditorId
,
Long
departmentId
,
if
(
ObjectUtils
.
isNotEmpty
(
repairlogModel
))
{
Date
processTime
,
String
processDepartment
,
String
processResult
,
String
processAuditorName
)
{
return
true
;
FailureRepairlogDto
failureRepairlogDto
=
new
FailureRepairlogDto
();
}
failureRepairlogDto
.
setFaultId
(
faultId
);
return
false
;
failureRepairlogDto
.
setProcessAuditorId
(
processAuditorId
);
}
failureRepairlogDto
.
setProcessDepartmentId
(
departmentId
);
failureRepairlogDto
.
setProcessTime
(
processTime
);
@Transactional
failureRepairlogDto
.
setProcessDepartment
(
processDepartment
);
public
boolean
excuteTask
(
Long
sequenceNbr
,
ReginParams
userInfo
,
String
condition
)
throws
Exception
{
failureRepairlogDto
.
setProcessResult
(
processResult
);
HashMap
<
String
,
Object
>
conditionMap
=
new
HashMap
<
String
,
Object
>();
failureRepairlogDto
.
setProcessAuditorName
(
processAuditorName
);
conditionMap
.
put
(
"condition"
,
Integer
.
parseInt
(
condition
));
FailureRepairlogDto
repairlogModel
=
failureRepairlogService
.
createWithModel
(
failureRepairlogDto
);
Map
<
String
,
Object
>
map
=
checkExcuteTaskAuthMap
(
sequenceNbr
,
userInfo
);
if
(
ObjectUtils
.
isNotEmpty
(
repairlogModel
))
{
if
(
Boolean
.
parseBoolean
(
map
.
get
(
"checkFlag"
).
toString
()))
{
return
true
;
if
(
map
.
get
(
"name"
).
toString
().
startsWith
(
PROCESS_NAME
[
4
]))
{
}
workflowFeignService
.
completeNoExecuteFromInstanceAdd
(
map
.
get
(
"taskId"
).
toString
(),
conditionMap
);
return
false
;
}
}
else
{
workflowFeignService
.
pickupAndCompleteTask
(
map
.
get
(
"taskId"
).
toString
(),
conditionMap
);
@Transactional
}
public
boolean
excuteTask
(
Long
sequenceNbr
,
ReginParams
userInfo
,
String
condition
)
throws
Exception
{
// 判断下一个节点是不是维修中,如果是则添加当前任务的执行人
HashMap
<
String
,
Object
>
conditionMap
=
new
HashMap
<
String
,
Object
>();
String
nextTaskId
=
checkIsInMaintenance
(
sequenceNbr
);
conditionMap
.
put
(
"condition"
,
Integer
.
parseInt
(
condition
));
if
(
nextTaskId
!=
null
)
{
Map
<
String
,
Object
>
map
=
checkExcuteTaskAuthMap
(
sequenceNbr
,
userInfo
);
workflowFeignService
.
pickuptask
(
nextTaskId
);
if
(
Boolean
.
parseBoolean
(
map
.
get
(
"checkFlag"
).
toString
()))
{
}
if
(
map
.
get
(
"name"
).
toString
().
startsWith
(
PROCESS_NAME
[
4
]))
{
}
workflowFeignService
.
completeNoExecuteFromInstanceAdd
(
map
.
get
(
"taskId"
).
toString
(),
conditionMap
);
return
true
;
}
}
else
{
workflowFeignService
.
pickupAndCompleteTask
(
map
.
get
(
"taskId"
).
toString
(),
conditionMap
);
/**
}
* 已经存在的操作人的任务执行,用于维修中节点完成任务
// 判断下一个节点是不是维修中,如果是则添加当前任务的执行人
*
String
nextTaskId
=
checkIsInMaintenance
(
sequenceNbr
);
* @param sequenceNbr
if
(
nextTaskId
!=
null
)
{
* @param userInfo
workflowFeignService
.
pickuptask
(
nextTaskId
);
}
* @return
}
*/
return
true
;
public
boolean
excuteTaskOnlyOperation
(
Long
sequenceNbr
,
ReginParams
userInfo
)
{
}
Map
<
String
,
Object
>
map
=
checkExcuteTaskAuthMap
(
sequenceNbr
,
userInfo
);
try
{
/**
* 已经存在的操作人的任务执行,用于维修中节点完成任务
if
(
Boolean
.
parseBoolean
(
map
.
get
(
"checkFlag"
).
toString
())
*
&&
map
.
get
(
"checkFlag"
).
toString
().
startsWith
(
PROCESS_NAME
[
4
]))
{
* @param sequenceNbr
workflowFeignService
.
completeByVariable
(
map
.
get
(
"taskId"
).
toString
(),
null
);
* @param userInfo
}
* @return
}
catch
(
Exception
e
)
{
*/
e
.
printStackTrace
();
public
boolean
excuteTaskOnlyOperation
(
Long
sequenceNbr
,
ReginParams
userInfo
)
{
return
false
;
Map
<
String
,
Object
>
map
=
checkExcuteTaskAuthMap
(
sequenceNbr
,
userInfo
);
}
try
{
return
true
;
}
if
(
Boolean
.
parseBoolean
(
map
.
get
(
"checkFlag"
).
toString
())
&&
map
.
get
(
"checkFlag"
).
toString
().
startsWith
(
PROCESS_NAME
[
4
]))
{
public
boolean
excuteTask
(
String
procressId
,
ReginParams
userInfo
,
String
condition
)
throws
Exception
{
workflowFeignService
.
completeByVariable
(
map
.
get
(
"taskId"
).
toString
(),
null
);
HashMap
<
String
,
Object
>
conditionMap
=
new
HashMap
<
String
,
Object
>();
}
conditionMap
.
put
(
"condition"
,
condition
);
}
catch
(
Exception
e
)
{
JSONObject
teskObject
=
workflowFeignService
.
getTaskList
(
procressId
);
e
.
printStackTrace
();
if
(
ObjectUtils
.
isNotEmpty
(
teskObject
))
{
return
false
;
JSONArray
taskDetailArray
=
teskObject
.
getJSONArray
(
"data"
);
}
for
(
Object
obj
:
taskDetailArray
)
{
return
true
;
JSONObject
detail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
obj
));
}
workflowFeignService
.
pickupAndCompleteTask
(
detail
.
getString
(
"id"
),
conditionMap
);
}
public
boolean
excuteTask
(
String
procressId
,
ReginParams
userInfo
,
String
condition
)
throws
Exception
{
}
HashMap
<
String
,
Object
>
conditionMap
=
new
HashMap
<
String
,
Object
>();
return
true
;
conditionMap
.
put
(
"condition"
,
condition
);
}
JSONObject
teskObject
=
workflowFeignService
.
getTaskList
(
procressId
);
if
(
ObjectUtils
.
isNotEmpty
(
teskObject
))
{
public
Object
getNextTaskGroupName
(
String
procressId
)
{
JSONArray
taskDetailArray
=
teskObject
.
getJSONArray
(
"data"
);
JSONObject
teskObject
=
workflowFeignService
.
getTaskList
(
procressId
);
for
(
Object
obj
:
taskDetailArray
)
{
JSONArray
taskDetailArray
=
teskObject
.
getJSONArray
(
"data"
);
JSONObject
detail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
obj
));
String
currentRoleName
=
""
;
workflowFeignService
.
pickupAndCompleteTask
(
detail
.
getString
(
"id"
),
conditionMap
);
for
(
Object
obj
:
taskDetailArray
)
{
}
JSONObject
detail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
obj
));
}
JSONObject
taskGroupNameObject
=
workflowFeignService
.
getTaskGroupName
(
detail
.
getString
(
"id"
));
return
true
;
for
(
Object
object
:
taskGroupNameObject
.
getJSONArray
(
"data"
))
{
}
JSONObject
taskGroupNameDetail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
object
));
currentRoleName
=
currentRoleName
+
taskGroupNameDetail
.
getString
(
"groupId"
)
+
","
;
public
Object
getNextTaskGroupName
(
String
procressId
)
{
}
JSONObject
teskObject
=
workflowFeignService
.
getTaskList
(
procressId
);
}
JSONArray
taskDetailArray
=
teskObject
.
getJSONArray
(
"data"
);
return
currentRoleName
;
String
currentRoleName
=
""
;
}
for
(
Object
obj
:
taskDetailArray
)
{
JSONObject
detail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
obj
));
public
boolean
checkExcuteTaskAuth
(
Long
sequenceNbr
,
ReginParams
userInfo
)
{
JSONObject
taskGroupNameObject
=
workflowFeignService
.
getTaskGroupName
(
detail
.
getString
(
"id"
));
Map
<
String
,
Object
>
map
=
this
.
checkExcuteTaskAuthMap
(
sequenceNbr
,
userInfo
);
for
(
Object
object
:
taskGroupNameObject
.
getJSONArray
(
"data"
))
{
return
Boolean
.
parseBoolean
(
map
.
get
(
"checkFlag"
).
toString
());
JSONObject
taskGroupNameDetail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
object
));
}
currentRoleName
=
currentRoleName
+
taskGroupNameDetail
.
getString
(
"groupId"
)
+
","
;
}
public
String
checkIsInMaintenance
(
Long
sequenceNbr
)
{
}
FailureDetails
details
=
this
.
baseMapper
.
selectById
(
sequenceNbr
);
return
currentRoleName
;
String
procressId
=
details
.
getProcessId
();
}
JSONObject
teskObject
=
workflowFeignService
.
getTaskList
(
procressId
);
if
(
ObjectUtils
.
isNotEmpty
(
teskObject
))
{
public
boolean
checkExcuteTaskAuth
(
Long
sequenceNbr
,
ReginParams
userInfo
)
{
JSONArray
taskDetailArray
=
teskObject
.
getJSONArray
(
"data"
);
Map
<
String
,
Object
>
map
=
this
.
checkExcuteTaskAuthMap
(
sequenceNbr
,
userInfo
);
for
(
Object
obj
:
taskDetailArray
)
{
return
Boolean
.
parseBoolean
(
map
.
get
(
"checkFlag"
).
toString
());
JSONObject
detail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
obj
));
}
String
name
=
detail
.
getString
(
"name"
);
if
(
name
.
startsWith
(
PROCESS_NAME
[
4
]))
{
public
String
checkIsInMaintenance
(
Long
sequenceNbr
)
{
String
id
=
detail
.
getString
(
"id"
);
FailureDetails
details
=
this
.
baseMapper
.
selectById
(
sequenceNbr
);
return
id
;
String
procressId
=
details
.
getProcessId
();
}
JSONObject
teskObject
=
workflowFeignService
.
getTaskList
(
procressId
);
}
if
(
ObjectUtils
.
isNotEmpty
(
teskObject
))
{
}
JSONArray
taskDetailArray
=
teskObject
.
getJSONArray
(
"data"
);
return
null
;
for
(
Object
obj
:
taskDetailArray
)
{
}
JSONObject
detail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
obj
));
String
name
=
detail
.
getString
(
"name"
);
public
Map
<
String
,
Object
>
checkExcuteTaskAuthMap
(
Long
sequenceNbr
,
ReginParams
userInfo
)
{
if
(
name
.
startsWith
(
PROCESS_NAME
[
4
]))
{
// 获取当前登录用户的角色
String
id
=
detail
.
getString
(
"id"
);
String
currentLoginUserRole
=
userInfo
.
getRole
().
getRoleName
();
return
id
;
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
}
map
.
put
(
"checkFlag"
,
false
);
}
FailureDetailsDto
failureDetailsDto
=
this
.
queryBySeq
(
sequenceNbr
);
}
// 获取送达部门的ID
return
null
;
Long
failureEquipmentId
=
failureDetailsDto
.
getSubmissionBranchId
();
}
FailureDetails
details
=
this
.
baseMapper
.
selectById
(
sequenceNbr
);
String
procressId
=
details
.
getProcessId
();
public
Map
<
String
,
Object
>
checkExcuteTaskAuthMap
(
Long
sequenceNbr
,
ReginParams
userInfo
)
{
Long
seq
=
userInfo
.
getDepartment
().
getSequenceNbr
();
// 获取当前登录用户的角色
JSONObject
teskObject
=
workflowFeignService
.
getTaskList
(
procressId
);
String
currentLoginUserRole
=
userInfo
.
getRole
().
getRoleName
();
if
(
ObjectUtils
.
isNotEmpty
(
teskObject
))
{
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
JSONArray
taskDetailArray
=
teskObject
.
getJSONArray
(
"data"
);
map
.
put
(
"checkFlag"
,
false
);
for
(
Object
obj
:
taskDetailArray
)
{
FailureDetailsDto
failureDetailsDto
=
this
.
queryBySeq
(
sequenceNbr
);
JSONObject
detail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
obj
));
// 获取送达部门的ID
String
name
=
detail
.
getString
(
"name"
);
Long
failureEquipmentId
=
failureDetailsDto
.
getSubmissionBranchId
();
JSONObject
taskGroupNameObject
=
workflowFeignService
.
getTaskGroupName
(
detail
.
getString
(
"id"
));
FailureDetails
details
=
this
.
baseMapper
.
selectById
(
sequenceNbr
);
// 获取流程中原本设置的当前节点的执行权限
String
procressId
=
details
.
getProcessId
();
JSONArray
taskGroupNameDetail
=
taskGroupNameObject
.
getJSONArray
(
"data"
);
Long
seq
=
userInfo
.
getDepartment
().
getSequenceNbr
();
// 如果拿不到当前任务的执行角色,则返回校验失败
JSONObject
teskObject
=
workflowFeignService
.
getTaskList
(
procressId
);
if
(
ObjectUtils
.
isEmpty
(
taskGroupNameDetail
))
{
if
(
ObjectUtils
.
isNotEmpty
(
teskObject
))
{
continue
;
JSONArray
taskDetailArray
=
teskObject
.
getJSONArray
(
"data"
);
}
for
(
Object
obj
:
taskDetailArray
)
{
String
defaultExecutionRoleProcess
=
taskGroupNameDetail
.
getJSONObject
(
0
).
getString
(
"groupId"
);
JSONObject
detail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
obj
));
// 判断当前登录人的角色是不是与流程中设置的当前任务节点权限一致,一致则执行,不一致则退出
String
name
=
detail
.
getString
(
"name"
);
if
(!
defaultExecutionRoleProcess
.
equals
(
currentLoginUserRole
))
{
JSONObject
taskGroupNameObject
=
workflowFeignService
.
getTaskGroupName
(
detail
.
getString
(
"id"
));
continue
;
// 获取流程中原本设置的当前节点的执行权限
}
JSONArray
taskGroupNameDetail
=
taskGroupNameObject
.
getJSONArray
(
"data"
);
// 当流程节点为应急指挥科时,需要判断当前用户所在的部门id和前面处理的用户部门id是否一致
// 如果拿不到当前任务的执行角色,则返回校验失败
if
(
name
.
contains
(
EMERGENCY_COMMAND
))
{
if
(
ObjectUtils
.
isEmpty
(
taskGroupNameDetail
))
{
FailureRepairlog
failureRepairlog
=
failureRepairlogService
.
findByFaultId
(
sequenceNbr
);
continue
;
Long
auditDepartmentId
=
failureRepairlog
.
getProcessDepartmentId
();
}
if
(
auditDepartmentId
.
intValue
()
==
seq
.
intValue
())
{
String
defaultExecutionRoleProcess
=
taskGroupNameDetail
.
getJSONObject
(
0
).
getString
(
"groupId"
);
map
.
put
(
"taskId"
,
detail
.
getString
(
"id"
));
// 判断当前登录人的角色是不是与流程中设置的当前任务节点权限一致,一致则执行,不一致则退出
map
.
put
(
"checkFlag"
,
true
);
if
(!
defaultExecutionRoleProcess
.
equals
(
currentLoginUserRole
))
{
map
.
put
(
"name"
,
detail
.
getString
(
"name"
));
continue
;
break
;
}
}
// 当流程节点为应急指挥科时,需要判断当前用户所在的部门id和前面处理的用户部门id是否一致
}
else
{
if
(
name
.
contains
(
EMERGENCY_COMMAND
))
{
// 判断当前节点任务属于送达部门节点时需要判断当前登录人所在的部门id是否与表单发起时设置的送达部门一致
FailureRepairlog
failureRepairlog
=
failureRepairlogService
.
findByFaultId
(
sequenceNbr
);
if
(
failureEquipmentId
.
intValue
()
==
seq
.
intValue
())
{
Long
auditDepartmentId
=
failureRepairlog
.
getProcessDepartmentId
();
map
.
put
(
"taskId"
,
detail
.
getString
(
"id"
));
if
(
auditDepartmentId
.
intValue
()
==
seq
.
intValue
())
{
map
.
put
(
"checkFlag"
,
true
);
map
.
put
(
"taskId"
,
detail
.
getString
(
"id"
));
map
.
put
(
"name"
,
detail
.
getString
(
"name"
));
map
.
put
(
"checkFlag"
,
true
);
break
;
map
.
put
(
"name"
,
detail
.
getString
(
"name"
));
}
break
;
}
}
}
}
else
{
}
// 判断当前节点任务属于送达部门节点时需要判断当前登录人所在的部门id是否与表单发起时设置的送达部门一致
return
map
;
if
(
failureEquipmentId
.
intValue
()
==
seq
.
intValue
())
{
}
map
.
put
(
"taskId"
,
detail
.
getString
(
"id"
));
map
.
put
(
"checkFlag"
,
true
);
/**
map
.
put
(
"name"
,
detail
.
getString
(
"name"
));
* 獲取待處理的任務數量
break
;
*
}
* @param userInfo
}
* @return
}
*/
}
public
int
getPendingCount
(
ReginParams
userInfo
)
{
return
map
;
int
countNum
=
0
;
}
// 获取当前登录人的部门id
Long
seq
=
userInfo
.
getDepartment
().
getSequenceNbr
();
/**
// 获取同角色信息的我的待办任务
* 獲取待處理的任務數量
JSONObject
taskListJson
=
workflowFeignService
.
getTasksNoAuth
(
processDefinitionKey
,
*
userInfo
.
getUserModel
().
getUserId
());
* @param userInfo
JSONArray
taskList
=
JSONArray
.
parseArray
(
JSONObject
.
toJSONString
(
taskListJson
.
getString
(
"data"
)));
* @return
for
(
Object
i
:
taskList
)
{
*/
JSONObject
task
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
i
));
public
int
getPendingCount
(
ReginParams
userInfo
)
{
String
procressId
=
task
.
getString
(
"processInstanceId"
);
int
countNum
=
0
;
// 通过流程ID查找当前的故障报修表ID 的信息
// 获取当前登录人的部门id
LambdaQueryWrapper
<
FailureDetails
>
wrapper
=
new
LambdaQueryWrapper
<
FailureDetails
>();
Long
seq
=
userInfo
.
getDepartment
().
getSequenceNbr
();
wrapper
.
eq
(
FailureDetails:
:
getProcessId
,
procressId
);
// 获取同角色信息的我的待办任务
FailureDetails
failureDetails
=
this
.
baseMapper
.
selectOne
(
wrapper
);
JSONObject
taskListJson
=
workflowFeignService
.
getTasksNoAuth
(
processDefinitionKey
,
// 通过故障报修单查找创建人的部门ID
userInfo
.
getUserModel
().
getUserId
());
FailureRepairlog
failureRepairlog
=
failureRepairlogService
.
findByFaultId
(
failureDetails
.
getSequenceNbr
());
JSONArray
taskList
=
JSONArray
.
parseArray
(
JSONObject
.
toJSONString
(
taskListJson
.
getString
(
"data"
)));
// 再去判断当前的任务节点信息是不是维修部门,是的话将于第一次填报保单的操作人部门id进行匹配,符合将视作为一条合法的待办任务
for
(
Object
i
:
taskList
)
{
if
(
task
.
getString
(
"name"
).
contains
(
EMERGENCY_COMMAND
))
{
JSONObject
task
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
i
));
Long
auditDepartmentId
=
failureRepairlog
.
getProcessDepartmentId
();
String
procressId
=
task
.
getString
(
"processInstanceId"
);
if
(
auditDepartmentId
.
intValue
()
==
seq
.
intValue
())
{
// 通过流程ID查找当前的故障报修表ID 的信息
countNum
++;
LambdaQueryWrapper
<
FailureDetails
>
wrapper
=
new
LambdaQueryWrapper
<
FailureDetails
>();
break
;
wrapper
.
eq
(
FailureDetails:
:
getProcessId
,
procressId
);
}
FailureDetails
failureDetails
=
this
.
baseMapper
.
selectOne
(
wrapper
);
}
else
{
// 通过故障报修单查找创建人的部门ID
// 判断当前节点任务属于送达部门节点时需要判断当前登录人所在的部门id是否与表单发起时设置的送达部门一致
FailureRepairlog
failureRepairlog
=
failureRepairlogService
.
findByFaultId
(
failureDetails
.
getSequenceNbr
());
if
(
failureDetails
.
getFailureEquipmentId
().
intValue
()
==
seq
.
intValue
())
{
// 再去判断当前的任务节点信息是不是维修部门,是的话将于第一次填报保单的操作人部门id进行匹配,符合将视作为一条合法的待办任务
countNum
++;
if
(
task
.
getString
(
"name"
).
contains
(
EMERGENCY_COMMAND
))
{
break
;
Long
auditDepartmentId
=
failureRepairlog
.
getProcessDepartmentId
();
}
if
(
auditDepartmentId
.
intValue
()
==
seq
.
intValue
())
{
}
countNum
++;
}
break
;
return
countNum
;
}
}
}
else
{
// 判断当前节点任务属于送达部门节点时需要判断当前登录人所在的部门id是否与表单发起时设置的送达部门一致
public
Object
getCurrentProcessHistoryTask
(
Long
id
)
{
if
(
failureDetails
.
getFailureEquipmentId
().
intValue
()
==
seq
.
intValue
())
{
FailureDetailsDto
failureDetailsDto
=
this
.
queryBySeq
(
id
);
countNum
++;
String
processId
=
failureDetailsDto
.
getProcessId
();
break
;
JSONObject
object
=
workflowFeignService
.
queryHistoryTaskListByProcessId
(
processId
);
}
JSONArray
datArray
=
null
;
}
if
(
ObjectUtils
.
isNotEmpty
(
object
))
{
}
datArray
=
object
.
getJSONArray
(
"data"
);
return
countNum
;
}
}
List
<
Object
>
list
=
new
ArrayList
<
Object
>();
public
Object
getCurrentProcessHistoryTask
(
Long
id
)
{
if
(
datArray
!=
null
)
{
FailureDetailsDto
failureDetailsDto
=
this
.
queryBySeq
(
id
);
for
(
Object
i
:
datArray
)
{
String
processId
=
failureDetailsDto
.
getProcessId
();
JSONObject
detail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
i
));
JSONObject
object
=
workflowFeignService
.
queryHistoryTaskListByProcessId
(
processId
);
if
(
detail
.
containsKey
(
"operator"
)
&&
!
detail
.
getString
(
"name"
).
contains
(
"维修中"
))
{
JSONArray
datArray
=
null
;
// 从流程记录表中拿到处理人的名称
if
(
ObjectUtils
.
isNotEmpty
(
object
))
{
FailureRepairlog
failureRepairlog
=
failureRepairlogService
datArray
=
object
.
getJSONArray
(
"data"
);
.
findByprocessAuditor
(
detail
.
getString
(
"operator"
));
}
if
(
failureRepairlog
!=
null
)
{
detail
.
replace
(
"operator"
,
failureRepairlog
.
getProcessAuditorName
()
==
null
?
""
List
<
Object
>
list
=
new
ArrayList
<
Object
>();
:
failureRepairlog
.
getProcessAuditorName
());
if
(
datArray
!=
null
)
{
}
for
(
Object
i
:
datArray
)
{
}
JSONObject
detail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
i
));
list
.
add
(
detail
);
if
(
detail
.
containsKey
(
"operator"
)
&&
!
detail
.
getString
(
"name"
).
contains
(
"维修中"
))
{
}
// 从流程记录表中拿到处理人的名称
FailureRepairlog
failureRepairlog
=
failureRepairlogService
.
findByprocessAuditor
(
detail
.
getString
(
"operator"
));
if
(
failureRepairlog
!=
null
)
{
detail
.
replace
(
"operator"
,
failureRepairlog
.
getProcessAuditorName
()
==
null
?
""
:
failureRepairlog
.
getProcessAuditorName
());
}
}
list
.
add
(
detail
);
}
// datArray.stream().forEach(i -> {
// datArray.stream().forEach(i -> {
// JSONObject detail = JSONObject.parseObject(JSONObject.toJSONString(i));
// JSONObject detail = JSONObject.parseObject(JSONObject.toJSONString(i));
// if (detail.containsKey("operator") && !detail.getString("name").equals("维修中")) {
// if (detail.containsKey("operator") && !detail.getString("name").equals("维修中")) {
...
@@ -560,99 +566,99 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -560,99 +566,99 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
// list.add(detail);
// list.add(detail);
// }
// }
// });
// });
}
}
return
list
;
return
list
;
}
}
public
static
String
buildOrderNo
()
{
public
static
String
buildOrderNo
()
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
String
newDate
=
sdf
.
format
(
new
Date
());
String
newDate
=
sdf
.
format
(
new
Date
());
String
result
=
""
;
String
result
=
""
;
Random
random
=
new
Random
();
Random
random
=
new
Random
();
for
(
int
i
=
0
;
i
<
3
;
i
++)
{
for
(
int
i
=
0
;
i
<
3
;
i
++)
{
result
+=
random
.
nextInt
(
10
);
result
+=
random
.
nextInt
(
10
);
}
}
return
newDate
+
result
;
return
newDate
+
result
;
}
}
/**
/**
* 获取当前登录人能够操作的任务执行Button类型
* 获取当前登录人能够操作的任务执行Button类型
*
*
* @param sequenceNbr
* @param sequenceNbr
* @param userInfo
* @param userInfo
* @return
* @return
*/
*/
public
Integer
getExcuteTaskAuthButton
(
Long
sequenceNbr
,
ReginParams
userInfo
)
{
public
Integer
getExcuteTaskAuthButton
(
Long
sequenceNbr
,
ReginParams
userInfo
)
{
int
flag
=
0
;
int
flag
=
0
;
Map
<
String
,
Object
>
map
=
this
.
checkExcuteTaskAuthMap
(
sequenceNbr
,
userInfo
);
Map
<
String
,
Object
>
map
=
this
.
checkExcuteTaskAuthMap
(
sequenceNbr
,
userInfo
);
if
(
Boolean
.
parseBoolean
(
map
.
get
(
"checkFlag"
).
toString
()))
{
if
(
Boolean
.
parseBoolean
(
map
.
get
(
"checkFlag"
).
toString
()))
{
String
buttonValueString
=
map
.
get
(
"name"
).
toString
();
String
buttonValueString
=
map
.
get
(
"name"
).
toString
();
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
;
flag
=
2
;
if
(
buttonValueString
.
startsWith
(
PROCESS_NAME
[
2
]))
{
if
(
buttonValueString
.
startsWith
(
PROCESS_NAME
[
2
]))
{
flag
=
3
;
flag
=
3
;
}
}
}
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
]))
{
// 验收
flag
=
5
;
flag
=
5
;
}
}
}
}
FailureDetails
details
=
this
.
baseMapper
.
selectById
(
sequenceNbr
);
FailureDetails
details
=
this
.
baseMapper
.
selectById
(
sequenceNbr
);
JSONObject
object
=
workflowFeignService
.
queryHistoryTasksByProcessInstanceId
(
details
.
getProcessId
());
JSONObject
object
=
workflowFeignService
.
queryHistoryTasksByProcessInstanceId
(
details
.
getProcessId
());
JSONArray
array
=
object
.
getJSONArray
(
"rows"
);
JSONArray
array
=
object
.
getJSONArray
(
"rows"
);
for
(
Object
historyDetail
:
array
)
{
for
(
Object
historyDetail
:
array
)
{
JSONObject
historyDetailJson
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
historyDetail
));
JSONObject
historyDetailJson
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
historyDetail
));
if
(
"rejected"
.
equals
(
historyDetailJson
.
getString
(
"activityId"
)))
{
if
(
"rejected"
.
equals
(
historyDetailJson
.
getString
(
"activityId"
)))
{
flag
=
6
;
flag
=
6
;
}
}
}
}
return
flag
;
return
flag
;
}
}
public
Object
getCurrentTask
(
Long
sequenceNbr
)
{
public
Object
getCurrentTask
(
Long
sequenceNbr
)
{
List
<
Map
<
String
,
String
>>
list
=
new
ArrayList
<
Map
<
String
,
String
>>();
List
<
Map
<
String
,
String
>>
list
=
new
ArrayList
<
Map
<
String
,
String
>>();
JSONArray
taskDetailArray
=
null
;
JSONArray
taskDetailArray
=
null
;
FailureDetails
details
=
this
.
baseMapper
.
selectById
(
sequenceNbr
);
FailureDetails
details
=
this
.
baseMapper
.
selectById
(
sequenceNbr
);
String
procressId
=
details
.
getProcessId
();
String
procressId
=
details
.
getProcessId
();
JSONObject
teskObject
=
workflowFeignService
.
getTaskList
(
procressId
);
JSONObject
teskObject
=
workflowFeignService
.
getTaskList
(
procressId
);
if
(
ObjectUtils
.
isNotEmpty
(
teskObject
))
{
if
(
ObjectUtils
.
isNotEmpty
(
teskObject
))
{
taskDetailArray
=
teskObject
.
getJSONArray
(
"data"
);
taskDetailArray
=
teskObject
.
getJSONArray
(
"data"
);
for
(
Object
obj
:
taskDetailArray
)
{
for
(
Object
obj
:
taskDetailArray
)
{
JSONObject
detail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
obj
));
JSONObject
detail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
obj
));
String
name
=
detail
.
getString
(
"name"
);
String
name
=
detail
.
getString
(
"name"
);
Map
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>();
Map
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>();
map
.
put
(
"name"
,
name
);
map
.
put
(
"name"
,
name
);
if
(
name
.
startsWith
(
PROCESS_NAME
[
4
]))
{
if
(
name
.
startsWith
(
PROCESS_NAME
[
4
]))
{
String
id
=
detail
.
getString
(
"id"
);
String
id
=
detail
.
getString
(
"id"
);
JSONObject
assignObject
=
workflowFeignService
.
getTaskAssign
(
id
);
JSONObject
assignObject
=
workflowFeignService
.
getTaskAssign
(
id
);
JSONObject
resultObject
=
assignObject
.
getJSONObject
(
"data"
);
JSONObject
resultObject
=
assignObject
.
getJSONObject
(
"data"
);
if
(
resultObject
!=
null
)
{
if
(
resultObject
!=
null
)
{
map
.
put
(
"name"
,
"维修部门维修人员 维修"
);
map
.
put
(
"name"
,
"维修部门维修人员 维修"
);
if
(
detail
.
containsKey
(
"informerList"
))
{
if
(
detail
.
containsKey
(
"informerList"
))
{
JSONArray
informerList
=
detail
.
getJSONArray
(
"informerList"
);
JSONArray
informerList
=
detail
.
getJSONArray
(
"informerList"
);
if
(
informerList
!=
null
&&
informerList
.
size
()
>
0
)
{
if
(
informerList
!=
null
&&
informerList
.
size
()
>
0
)
{
for
(
Object
informerDetail
:
informerList
)
{
for
(
Object
informerDetail
:
informerList
)
{
JSONObject
informerDetailJson
=
JSONObject
JSONObject
informerDetailJson
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
informerDetail
));
.
parseObject
(
JSONObject
.
toJSONString
(
informerDetail
));
if
(
informerDetailJson
.
getString
(
"userName"
)
if
(
informerDetailJson
.
getString
(
"userName"
)
.
equals
(
resultObject
.
getString
(
"assignee"
)))
{
.
equals
(
resultObject
.
getString
(
"assignee"
)))
{
map
.
put
(
"assignee"
,
informerDetailJson
.
getString
(
"realName"
));
map
.
put
(
"assignee"
,
informerDetailJson
.
getString
(
"realName"
));
break
;
break
;
}
}
}
}
}
}
}
}
}
}
}
}
list
.
add
(
map
);
list
.
add
(
map
);
}
}
}
}
return
list
;
return
list
;
}
}
}
}
\ No newline at end of file
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 @
a7795bcb
...
@@ -76,8 +76,6 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
...
@@ -76,8 +76,6 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
WorkflowFeignService
workflowFeignService
;
WorkflowFeignService
workflowFeignService
;
private
static
String
RECORE_TYPE
=
"维修记录"
;
private
static
String
RECORE_TYPE
=
"维修记录"
;
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
FailureMaintainServiceImpl
.
class
);
private
static
String
[]
MAINTENANCE_STATUS
=
{
"维修完成"
,
"维修中"
};
private
static
String
[]
MAINTENANCE_STATUS
=
{
"维修完成"
,
"维修中"
};
private
static
int
MAINTENANCE_COMPLETE
=
0
;
private
static
int
MAINTENANCE_COMPLETE
=
0
;
...
@@ -86,25 +84,7 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
...
@@ -86,25 +84,7 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
private
static
String
[]
PROCESS_RESULT
=
{
"验证通过"
,
"验证未通过"
};
private
static
String
[]
PROCESS_RESULT
=
{
"验证通过"
,
"验证未通过"
};
/**
* 分页查询
*/
public
Page
<
FailureMaintainDto
>
queryForFailureMaintainPage
(
Page
<
FailureMaintainDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
}
/**
* 列表查询 示例
*/
public
List
<
FailureMaintainDto
>
queryForFailureMaintainList
()
{
return
this
.
queryForList
(
""
,
false
);
}
/**
/**
* 添加维修记录
* 添加维修记录
...
@@ -132,10 +112,10 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
...
@@ -132,10 +112,10 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
// 添加报修日志
// 添加报修日志
String
processResult
=
MAINTENANCE_STATUS
[
1
];
// 维修中
String
processResult
=
MAINTENANCE_STATUS
[
1
];
// 维修中
Integer
processAuditorId
=
Integer
.
parseInt
(
failureMaintainDto
.
getRecUserId
());
Integer
processAuditorId
=
Integer
.
parseInt
(
failureMaintainDto
.
getRecUserId
());
String
processAuditor
Cid
=
userInfo
.
getRole
().
getRole
Name
();
String
processAuditor
Name
=
userInfo
.
getUserModel
().
getReal
Name
();
repairlog
(
failureMaintainDto
.
getFaultId
(),
processAuditorId
,
repairlog
(
failureMaintainDto
.
getFaultId
(),
processAuditorId
,
userInfo
.
getDepartment
().
getSequenceNbr
(),
failureMaintainDto
.
getMaintainTime
(),
userInfo
.
getDepartment
().
getSequenceNbr
(),
failureMaintainDto
.
getMaintainTime
(),
failureMaintainDto
.
getDepartment
(),
processResult
,
processAuditor
Cid
);
failureMaintainDto
.
getDepartment
(),
processResult
,
processAuditor
Name
);
if
(
ObjectUtils
.
isNotEmpty
(
failureMaintainDto
.
getAttachment
()))
{
if
(
ObjectUtils
.
isNotEmpty
(
failureMaintainDto
.
getAttachment
()))
{
sourceFileServiceImpl
.
saveSourceFile
(
failureMaintainDto
.
getSequenceNbr
(),
sourceFileServiceImpl
.
saveSourceFile
(
failureMaintainDto
.
getSequenceNbr
(),
failureMaintainDto
.
getAttachment
());
failureMaintainDto
.
getAttachment
());
...
@@ -179,10 +159,10 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
...
@@ -179,10 +159,10 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
// 添加报修日志
// 添加报修日志
String
processResult
=
MAINTENANCE_STATUS
[
0
];
// 维修完成
String
processResult
=
MAINTENANCE_STATUS
[
0
];
// 维修完成
Integer
processAuditorId
=
Integer
.
parseInt
(
failureMaintainDto
.
getRecUserId
());
Integer
processAuditorId
=
Integer
.
parseInt
(
failureMaintainDto
.
getRecUserId
());
String
processAuditor
Cid
=
userInfo
.
getRole
().
getRole
Name
();
String
processAuditor
Name
=
userInfo
.
getUserModel
().
getReal
Name
();
repairlog
(
failureMaintainDto
.
getFaultId
(),
processAuditorId
,
repairlog
(
failureMaintainDto
.
getFaultId
(),
processAuditorId
,
userInfo
.
getDepartment
().
getSequenceNbr
(),
failureMaintainDto
.
getMaintainTime
(),
userInfo
.
getDepartment
().
getSequenceNbr
(),
failureMaintainDto
.
getMaintainTime
(),
failureMaintainDto
.
getDepartment
(),
processResult
,
processAuditor
Cid
);
failureMaintainDto
.
getDepartment
(),
processResult
,
processAuditor
Name
);
if
(
ObjectUtils
.
isNotEmpty
(
failureMaintainDto
.
getAttachment
()))
{
if
(
ObjectUtils
.
isNotEmpty
(
failureMaintainDto
.
getAttachment
()))
{
sourceFileServiceImpl
.
saveSourceFile
(
failureMaintainDto
.
getSequenceNbr
(),
sourceFileServiceImpl
.
saveSourceFile
(
failureMaintainDto
.
getSequenceNbr
(),
failureMaintainDto
.
getAttachment
());
failureMaintainDto
.
getAttachment
());
...
@@ -195,55 +175,6 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
...
@@ -195,55 +175,6 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
return
true
;
return
true
;
}
}
/**
* 根据审核结果更新维修表
*/
public
Boolean
updateModel
(
FailureMaintainDto
failureMaintainDto
,
ReginParams
userInfo
)
throws
Exception
{
boolean
result
=
failureDetailsService
.
checkExcuteTaskAuth
(
failureMaintainDto
.
getFaultId
(),
userInfo
);
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
failureMaintainDto
.
getFaultId
());
if
(
result
)
{
this
.
updateWithModel
(
failureMaintainDto
);
// 根据status修改状态
String
processResult
=
new
String
();
String
condition
=
failureMaintainDto
.
getCondition
();
int
conditionStatus
=
Integer
.
parseInt
(
condition
);
if
(
conditionStatus
==
AuditResultEnum
.
AGREE
.
getCode
()
&&
userInfo
.
getDepartment
().
getSequenceNbr
()
==
failureDetailsDto
.
getBizCode
())
{
// 同意状态为已完结
processResult
=
PROCESS_RESULT
[
0
];
}
else
if
(
conditionStatus
==
AuditResultEnum
.
AGREE
.
getCode
())
{
// 同意状态为已完结
failureDetailsDto
.
setCurrentStatus
(
failureDetailsDto
.
getCurrentStatus
());
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
processResult
=
PROCESS_RESULT
[
0
];
}
else
if
(
conditionStatus
==
AuditResultEnum
.
REFUSE
.
getCode
()){
// 不同意状态为已拒绝
failureDetailsDto
.
setCurrentStatus
(
FailureStatuEnum
.
REFUSE
.
getCode
());
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
processResult
=
PROCESS_RESULT
[
1
];
}
// 添加报修日志
Integer
processAuditorId
=
Integer
.
parseInt
(
failureMaintainDto
.
getRecUserId
());
String
processAuditorCid
=
userInfo
.
getRole
().
getRoleName
();
Boolean
repairlog
=
repairlog
(
failureMaintainDto
.
getFaultId
(),
processAuditorId
,
userInfo
.
getDepartment
().
getSequenceNbr
(),
failureMaintainDto
.
getMaintainTime
(),
failureMaintainDto
.
getDepartment
(),
processResult
,
processAuditorCid
);
if
(
ObjectUtils
.
isEmpty
(
repairlog
)){
throw
new
RuntimeException
(
"验收添加报修日志出错"
);
}
if
(
failureDetailsService
.
excuteTask
(
failureMaintainDto
.
getFaultId
(),
userInfo
,
condition
)){
return
true
;
}
else
{
throw
new
RuntimeException
(
"验收执行流程失败"
);
}
}
return
false
;
}
/**
/**
* 根据FaultId查询
* 根据FaultId查询
...
@@ -273,9 +204,7 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
...
@@ -273,9 +204,7 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
* 添加报修日志
* 添加报修日志
*/
*/
public
Boolean
repairlog
(
Long
faultId
,
Integer
processAuditorId
,
Long
departmentId
,
public
Boolean
repairlog
(
Long
faultId
,
Integer
processAuditorId
,
Long
departmentId
,
Date
processTime
,
Date
processTime
,
String
processDepartment
,
String
processResult
,
String
processAuditorName
)
{
String
processDepartment
,
String
processResult
,
String
processAuditorCid
)
{
FailureRepairlogDto
failureRepairlogDto
=
new
FailureRepairlogDto
();
FailureRepairlogDto
failureRepairlogDto
=
new
FailureRepairlogDto
();
failureRepairlogDto
.
setFaultId
(
faultId
);
failureRepairlogDto
.
setFaultId
(
faultId
);
...
@@ -284,7 +213,7 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
...
@@ -284,7 +213,7 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
failureRepairlogDto
.
setProcessTime
(
processTime
);
failureRepairlogDto
.
setProcessTime
(
processTime
);
failureRepairlogDto
.
setProcessDepartment
(
processDepartment
);
failureRepairlogDto
.
setProcessDepartment
(
processDepartment
);
failureRepairlogDto
.
setProcessResult
(
processResult
);
failureRepairlogDto
.
setProcessResult
(
processResult
);
failureRepairlogDto
.
setProcessAuditor
Cid
(
processAuditorCid
);
failureRepairlogDto
.
setProcessAuditor
Name
(
processAuditorName
);
failureRepairlogService
.
createWithModel
(
failureRepairlogDto
);
failureRepairlogService
.
createWithModel
(
failureRepairlogDto
);
if
(
ObjectUtils
.
isNotEmpty
(
failureRepairlogDto
))
{
if
(
ObjectUtils
.
isNotEmpty
(
failureRepairlogDto
))
{
return
true
;
return
true
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/FailureVerifyServiceImpl.java
View file @
a7795bcb
...
@@ -66,33 +66,21 @@ public class FailureVerifyServiceImpl extends BaseService<FailureVerifyDto, Fail
...
@@ -66,33 +66,21 @@ public class FailureVerifyServiceImpl extends BaseService<FailureVerifyDto, Fail
}
}
Boolean
repairResult
=
null
;
Boolean
repairResult
=
null
;
//根据验收的结果进行业务操作
//根据验收的结果进行业务操作
/* if (condition == AuditResultEnum.AGREE.getCode() ) {
verifyResult = AuditResultEnum.AGREE.getCode();
Boolean repairResult = updateStatus(model, FailureStatuEnum.WAITING_ACCEPTANCE, userInfo, condition);
} else*/
if
(
condition
==
(
AuditResultEnum
.
REFUSE
.
getCode
()))
{
if
(
condition
==
(
AuditResultEnum
.
REFUSE
.
getCode
()))
{
verifyResult
=
AuditResultEnum
.
REFUSE
.
getCode
();
verifyResult
=
AuditResultEnum
.
REFUSE
.
getCode
();
repairResult
=
updateStatus
(
model
,
FailureStatuEnum
.
REFUSE
,
userInfo
,
condition
);
repairResult
=
updateStatus
(
model
,
FailureStatuEnum
.
REFUSE
,
userInfo
,
condition
);
}
/*else if (condition == (AuditResultEnum.SEND_BACK.getCode())) {
}
else
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
())
{
verifyResult = AuditResultEnum.SEND_BACK.getCode();
Boolean repairResult = updateStatus(model, FailureStatuEnum.WAITING_SUBMIT, userInfo, condition);
} */
else
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
())
{
verifyResult
=
AuditResultEnum
.
AGREE
.
getCode
();
verifyResult
=
AuditResultEnum
.
AGREE
.
getCode
();
repairResult
=
updateStatus
(
model
,
FailureStatuEnum
.
FINISH
,
userInfo
,
condition
);
repairResult
=
updateStatus
(
model
,
FailureStatuEnum
.
FINISH
,
userInfo
,
condition
);
}
}
model
.
setVerifyResult
(
verifyResult
);
model
.
setVerifyResult
(
verifyResult
);
List
<
FailureVerify
>
byfaultId
=
findByfaultId
(
failureDetailsDto
.
getSequenceNbr
());
/* if (byfaultId.size() == 0) {
this.createWithModel(model);
} else {*/
this
.
createWithModel
(
model
);
this
.
createWithModel
(
model
);
if
(!
failureDetailsService
.
excuteTask
(
failureDetailsDto
.
getSequenceNbr
(),
userInfo
,
condition
+
""
))
{
if
(!
failureDetailsService
.
excuteTask
(
failureDetailsDto
.
getSequenceNbr
(),
userInfo
,
condition
+
""
))
{
throw
new
Exception
(
"执行流程失败"
);
throw
new
Exception
(
"执行流程失败"
);
}
}
/* }*/
return
true
;
return
true
;
}
}
...
@@ -154,7 +142,7 @@ public class FailureVerifyServiceImpl extends BaseService<FailureVerifyDto, Fail
...
@@ -154,7 +142,7 @@ public class FailureVerifyServiceImpl extends BaseService<FailureVerifyDto, Fail
failureRepairlogDto
.
setProcessTime
(
processTime
);
failureRepairlogDto
.
setProcessTime
(
processTime
);
failureRepairlogDto
.
setProcessDepartment
(
processDepartment
);
failureRepairlogDto
.
setProcessDepartment
(
processDepartment
);
failureRepairlogDto
.
setProcessResult
(
processResult
);
failureRepairlogDto
.
setProcessResult
(
processResult
);
failureRepairlogDto
.
setProcessAuditor
Cid
(
processVerifyorCid
);
failureRepairlogDto
.
setProcessAuditor
Name
(
processVerifyorCid
);
failureRepairlogService
.
createWithModel
(
failureRepairlogDto
);
failureRepairlogService
.
createWithModel
(
failureRepairlogDto
);
if
(
ObjectUtils
.
isNotEmpty
(
failureRepairlogDto
))
{
if
(
ObjectUtils
.
isNotEmpty
(
failureRepairlogDto
))
{
return
true
;
return
true
;
...
@@ -166,7 +154,6 @@ public class FailureVerifyServiceImpl extends BaseService<FailureVerifyDto, Fail
...
@@ -166,7 +154,6 @@ public class FailureVerifyServiceImpl extends BaseService<FailureVerifyDto, Fail
* 根据FaultId查询
* 根据FaultId查询
*/
*/
public
List
<
FailureVerify
>
findByfaultId
(
Long
faultId
)
{
public
List
<
FailureVerify
>
findByfaultId
(
Long
faultId
)
{
Page
<
FailureVerify
>
page
=
new
Page
<>();
QueryWrapper
<
FailureVerify
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
FailureVerify
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"fault_id"
,
faultId
).
orderByDesc
(
"verify_time"
);
queryWrapper
.
eq
(
"fault_id"
,
faultId
).
orderByDesc
(
"verify_time"
);
return
baseMapper
.
selectList
(
queryWrapper
);
return
baseMapper
.
selectList
(
queryWrapper
);
...
...
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