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
aa10143a
Commit
aa10143a
authored
Aug 19, 2021
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加验收接口
parent
610dcaa1
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
855 additions
and
483 deletions
+855
-483
FailureVerifyDto.java
...oin/amos/boot/module/common/api/dto/FailureVerifyDto.java
+49
-0
FailureVerify.java
...oin/amos/boot/module/common/api/entity/FailureVerify.java
+67
-0
FailureVerifyMapper.java
...os/boot/module/common/api/mapper/FailureVerifyMapper.java
+14
-0
IFailureVerifyService.java
...boot/module/common/api/service/IFailureVerifyService.java
+12
-0
FailureVerifyMapper.xml
...mon-api/src/main/resources/mapper/FailureVerifyMapper.xml
+5
-0
FailureAuditController.java
.../module/common/biz/controller/FailureAuditController.java
+8
-3
FailureDetailsController.java
...odule/common/biz/controller/FailureDetailsController.java
+9
-3
FailureMaintainController.java
...dule/common/biz/controller/FailureMaintainController.java
+40
-44
FailureVerifyController.java
...module/common/biz/controller/FailureVerifyController.java
+135
-0
FailureAuditServiceImpl.java
...dule/common/biz/service/impl/FailureAuditServiceImpl.java
+45
-42
FailureDetailsServiceImpl.java
...le/common/biz/service/impl/FailureDetailsServiceImpl.java
+48
-42
FailureMaintainServiceImpl.java
...e/common/biz/service/impl/FailureMaintainServiceImpl.java
+237
-349
FailureVerifyServiceImpl.java
...ule/common/biz/service/impl/FailureVerifyServiceImpl.java
+186
-0
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/FailureVerifyDto.java
0 → 100644
View file @
aa10143a
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.util.Date
;
/**
* 故障报修验收记录
*
* @author system_generator
* @date 2021-08-18
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"FailureVerifyDto"
,
description
=
"故障报修验收记录"
)
public
class
FailureVerifyDto
extends
BaseDto
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"验收人"
)
private
String
acceptor
;
@ApiModelProperty
(
value
=
"验收部门"
)
private
String
verifyDepartment
;
@ApiModelProperty
(
value
=
"验收部门的id"
)
private
Long
verifyDepartmentId
;
@ApiModelProperty
(
value
=
"审核结果 0:同意 1:拒绝 "
)
private
Integer
verifyResult
;
@ApiModelProperty
(
value
=
"验收时间"
)
private
Date
verifyTime
;
@ApiModelProperty
(
value
=
"验收意见"
)
private
String
verifyOpinion
;
@ApiModelProperty
(
value
=
"设备故障报修单id"
)
private
Long
faultId
;
@ApiModelProperty
(
value
=
"审核结果条件判断,0同意,1拒绝"
)
private
String
condition
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/entity/FailureVerify.java
0 → 100644
View file @
aa10143a
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
java.util.Date
;
/**
* 故障报修验收记录
*
* @author system_generator
* @date 2021-08-18
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"cb_failure_verify"
)
public
class
FailureVerify
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 验收人
*/
@TableField
(
"acceptor"
)
private
String
acceptor
;
/**
* 验收部门
*/
@TableField
(
"verify_department"
)
private
String
verifyDepartment
;
/**
* 验收部门的id
*/
@TableField
(
"verify_department_id"
)
private
Long
verifyDepartmentId
;
/**
* 审核结果 0:同意 1:拒绝
*/
@TableField
(
"verify_result"
)
private
Integer
verifyResult
;
/**
* 验收时间
*/
@TableField
(
"verify_time"
)
private
Date
verifyTime
;
/**
* 验收意见
*/
@TableField
(
"verify_opinion"
)
private
String
verifyOpinion
;
/**
* 设备故障报修单id
*/
@TableField
(
"fault_id"
)
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/FailureVerifyMapper.java
0 → 100644
View file @
aa10143a
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
mapper
;
import
com.yeejoin.amos.boot.module.common.api.entity.FailureVerify
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* 故障报修验收记录 Mapper 接口
*
* @author system_generator
* @date 2021-08-18
*/
public
interface
FailureVerifyMapper
extends
BaseMapper
<
FailureVerify
>
{
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/service/IFailureVerifyService.java
0 → 100644
View file @
aa10143a
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
service
;
/**
* 故障报修验收记录接口类
*
* @author system_generator
* @date 2021-08-18
*/
public
interface
IFailureVerifyService
{
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/FailureVerifyMapper.xml
0 → 100644
View file @
aa10143a
<?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">
<mapper
namespace=
"com.yeejoin.amos.boot.module.common.api.mapper.FailureVerifyMapper"
>
</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 @
aa10143a
...
@@ -40,8 +40,13 @@ public class FailureAuditController extends BaseController {
...
@@ -40,8 +40,13 @@ 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
<
Object
>
save
(
@RequestBody
FailureAuditDto
model
)
throws
Exception
{
public
ResponseModel
<
Object
>
save
(
@RequestBody
FailureAuditDto
model
)
{
return
ResponseHelper
.
buildResponse
(
failureAuditServiceImpl
.
savemodel
(
model
,
getSelectedOrgInfo
()));
try
{
return
ResponseHelper
.
buildResponse
(
failureAuditServiceImpl
.
savemodel
(
model
,
getSelectedOrgInfo
()));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
ResponseHelper
.
buildResponse
(
false
);
}
}
}
...
@@ -97,7 +102,7 @@ public class FailureAuditController extends BaseController {
...
@@ -97,7 +102,7 @@ public class FailureAuditController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"审核列表记录查询"
,
notes
=
"审核列表记录查询"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"审核列表记录查询"
,
notes
=
"审核列表记录查询"
)
@GetMapping
(
value
=
"/list/{faultId}"
)
@GetMapping
(
value
=
"/list/{faultId}"
)
public
ResponseModel
<
List
<
FailureAudit
>>
findByFaultIDFotList
(
@
RequestParam
long
faultId
)
{
public
ResponseModel
<
List
<
FailureAudit
>>
findByFaultIDFotList
(
@
PathVariable
long
faultId
)
{
return
ResponseHelper
.
buildResponse
(
failureAuditServiceImpl
.
findByfaultId
(
faultId
));
return
ResponseHelper
.
buildResponse
(
failureAuditServiceImpl
.
findByfaultId
(
faultId
));
}
}
...
...
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 @
aa10143a
...
@@ -5,6 +5,7 @@ import java.util.List;
...
@@ -5,6 +5,7 @@ import java.util.List;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
...
@@ -62,8 +63,13 @@ public class FailureDetailsController extends BaseController {
...
@@ -62,8 +63,13 @@ 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
)
throws
Exception
{
public
ResponseModel
<
Object
>
save
(
@RequestBody
FailureDetailsDto
model
)
{
return
ResponseHelper
.
buildResponse
(
failureDetailsServiceImpl
.
savemodel
(
model
,
getSelectedOrgInfo
()));
try
{
return
ResponseHelper
.
buildResponse
(
failureDetailsServiceImpl
.
savemodel
(
model
,
getSelectedOrgInfo
()));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
ResponseHelper
.
buildResponse
(
false
);
}
}
}
...
@@ -123,7 +129,7 @@ public class FailureDetailsController extends BaseController {
...
@@ -123,7 +129,7 @@ public class FailureDetailsController extends BaseController {
Page
<
FailureDetails
>
page
=
new
Page
<
FailureDetails
>();
Page
<
FailureDetails
>
page
=
new
Page
<
FailureDetails
>();
page
.
setCurrent
(
current
);
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
page
.
setSize
(
size
);
final
AgencyUserModel
userInfo
=
getUser
Info
();
ReginParams
userInfo
=
getSelectedOrg
Info
();
IPage
<
FailureDetailsDto
>
failureDetailDTOsIPage
=
new
Page
<>();
IPage
<
FailureDetailsDto
>
failureDetailDTOsIPage
=
new
Page
<>();
IPage
<
FailureDetails
>
failureDetailsIPage
=
failureDetailsServiceImpl
.
queryForFailureDetailsPage
(
page
,
userInfo
,
type
);
IPage
<
FailureDetails
>
failureDetailsIPage
=
failureDetailsServiceImpl
.
queryForFailureDetailsPage
(
page
,
userInfo
,
type
);
BeanUtils
.
copyProperties
(
failureDetailsIPage
,
FailureDetailsDto
.
class
);
BeanUtils
.
copyProperties
(
failureDetailsIPage
,
FailureDetailsDto
.
class
);
...
...
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 @
aa10143a
...
@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.common.biz.controller;
...
@@ -2,6 +2,8 @@ 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
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
;
...
@@ -46,70 +48,60 @@ public class FailureMaintainController extends BaseController {
...
@@ -46,70 +48,60 @@ 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
<
Object
>
save
(
@RequestBody
FailureMaintainDto
model
)
{
public
ResponseModel
<
Object
>
save
(
@RequestBody
FailureMaintainDto
model
)
{
return
ResponseHelper
.
buildResponse
(
failureMaintainServiceImpl
.
savemodel
(
model
,
getSelectedOrgInfo
()));
try
{
return
ResponseHelper
.
buildResponse
(
failureMaintainServiceImpl
.
savemodel
(
model
,
getSelectedOrgInfo
()));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
ResponseHelper
.
buildResponse
(
false
);
}
}
}
/**
/**
* 根据sequenceNbr更新
* 根据sequenceNbr更新
* 根据传递的Status状态确认验收状态
* 根据传递的Status状态确认验收状态
*
*
*
@param sequenceNbr 主键
*
* @return
* @return
*/
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/
{sequenceNbr}
"
)
@PutMapping
(
value
=
"/
verify
"
)
@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
)
{
public
Object
updateBySequenceNbrFailureMaintain
(
@RequestBody
FailureMaintainDto
model
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
try
{
return
ResponseHelper
.
buildResponse
(
failureMaintainServiceImpl
.
updateModel
(
model
,
status
,
getSelectedOrgInfo
()));
return
ResponseHelper
.
buildResponse
(
failureMaintainServiceImpl
.
updateModel
(
model
,
getSelectedOrgInfo
()));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
ResponseHelper
.
buildResponse
(
false
);
}
}
}
/**
/*
*/
/**
* 根据sequenceNbr更新
* 根据sequenceNbr更新
* 根据传递的Status状态确认验收状态
* 根据传递的Status状态确认验收状态
*
*
* @param sequenceNbr 主键
* @param sequenceNbr 主键
* @return
* @return
*/
*//*
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/update/{sequenceNbr}")
@PutMapping(value = "/update/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "维修完成", notes = "根据sequenceNbr更新")
@ApiOperation(httpMethod = "PUT", value = "维修完成", notes = "根据sequenceNbr更新")
public
Object
updateByFailureMaintain
(
@RequestBody
FailureMaintainDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
public Object updateByFailureMaintain(@RequestBody FailureMaintainDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr)
{
model.setSequenceNbr(sequenceNbr);
model.setSequenceNbr(sequenceNbr);
return
ResponseHelper
.
buildResponse
(
failureMaintainServiceImpl
.
updateStatus
(
model
,
getSelectedOrgInfo
()));
try {
return ResponseHelper.buildResponse(failureMaintainServiceImpl.updateStatus(model,getSelectedOrgInfo()));
} catch (Exception e) {
return ResponseHelper.buildResponse(false);
}
}
}
/*
*/
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*//*
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除", notes = "根据sequenceNbr删除")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(failureMaintainServiceImpl.removeById(sequenceNbr));
}
*/
*/
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个"
,
notes
=
"根据sequenceNbr查询单个"
)
public
ResponseModel
<
FailureMaintainDto
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
failureMaintainServiceImpl
.
queryBySeq
(
sequenceNbr
));
}
/**
/**
...
@@ -130,18 +122,22 @@ public class FailureMaintainController extends BaseController {
...
@@ -130,18 +122,22 @@ public class FailureMaintainController extends BaseController {
return
ResponseHelper
.
buildResponse
(
failureMaintainServiceImpl
.
queryForFailureMaintainPage
(
page
));
return
ResponseHelper
.
buildResponse
(
failureMaintainServiceImpl
.
queryForFailureMaintainPage
(
page
));
}
}
/**
/**
*
列表全部数据
查询
*
维修列表记录
查询
*
*根据关联主表faultId查询
* @return
* @return
*/
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"
列表全部数据查询"
,
notes
=
"列表全部数据
查询"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"
维修列表记录查询"
,
notes
=
"维修列表记录
查询"
)
@GetMapping
(
value
=
"/list"
)
@GetMapping
(
value
=
"/list
/{faultId}
"
)
public
ResponseModel
<
List
<
FailureMaintain
Dto
>>
selectForList
(
)
{
public
ResponseModel
<
List
<
FailureMaintain
>>
findByFaultIDFotList
(
@PathVariable
long
faultId
)
{
return
ResponseHelper
.
buildResponse
(
failureMaintainServiceImpl
.
queryForFailureMaintainList
(
));
return
ResponseHelper
.
buildResponse
(
failureMaintainServiceImpl
.
findByfaultId
(
faultId
));
}
}
/**
/**
* 查询历史流程审核信息记录
* 查询历史流程审核信息记录
*
*
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/FailureVerifyController.java
0 → 100644
View file @
aa10143a
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
controller
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureAuditDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.FailureAudit
;
import
com.yeejoin.amos.boot.module.common.api.entity.FailureVerify
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
java.util.List
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.FailureVerifyServiceImpl
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
javax.servlet.http.HttpServletRequest
;
import
org.springframework.web.bind.annotation.*
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureVerifyDto
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
/**
* 故障报修验收记录
*
* @author system_generator
* @date 2021-08-18
*/
@RestController
@Api
(
tags
=
"故障报修验收记录Api"
)
@RequestMapping
(
value
=
"/common/failure-verify"
)
public
class
FailureVerifyController
extends
BaseController
{
@Autowired
FailureVerifyServiceImpl
failureVerifyServiceImpl
;
/**
* 新增故障报修验收记录
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
public
ResponseModel
<
Object
>
save
(
@RequestBody
FailureVerifyDto
model
)
{
try
{
return
ResponseHelper
.
buildResponse
(
failureVerifyServiceImpl
.
savemodel
(
model
,
getSelectedOrgInfo
()));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
ResponseHelper
.
buildResponse
(
false
);
}
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新故障报修验收记录"
,
notes
=
"根据sequenceNbr更新故障报修验收记录"
)
public
ResponseModel
<
FailureVerifyDto
>
updateBySequenceNbrFailureVerify
(
@RequestBody
FailureVerifyDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
failureVerifyServiceImpl
.
updateWithModel
(
model
));
}
/*
*/
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*//*
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个故障报修验收记录", notes = "根据sequenceNbr查询单个故障报修验收记录")
public ResponseModel<FailureVerifyDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(failureVerifyServiceImpl.queryBySeq(sequenceNbr));
}
*/
/* *//**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*//*
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "故障报修验收记录分页查询", notes = "故障报修验收记录分页查询")
public ResponseModel<Page<FailureVerifyDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<FailureVerifyDto> page = new Page<FailureVerifyDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(failureVerifyServiceImpl.queryForFailureVerifyPage(page));
}*/
/*
*/
/**
* 列表全部数据查询
*
* @return
*//*
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "故障报修验收记录列表全部数据查询", notes = "故障报修验收记录列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<FailureVerifyDto>> selectForList() {
return ResponseHelper.buildResponse(failureVerifyServiceImpl.queryForFailureVerifyList());
}
*/
/**
* 审核列表记录查询
*根据关联主表faultId查询
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"审核列表记录查询"
,
notes
=
"审核列表记录查询"
)
@GetMapping
(
value
=
"/list/{faultId}"
)
public
ResponseModel
<
List
<
FailureVerify
>>
findByFaultIDFotList
(
@PathVariable
long
faultId
)
{
return
ResponseHelper
.
buildResponse
(
failureVerifyServiceImpl
.
findByfaultId
(
faultId
));
}
}
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 @
aa10143a
...
@@ -64,7 +64,7 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
...
@@ -64,7 +64,7 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
* 发起审核
* 发起审核
*/
*/
@Transactional
@Transactional
public
Object
savemodel
(
FailureAuditDto
model
,
ReginParams
userInfo
)
{
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
.
setAuditTime
(
new
Date
());
...
@@ -73,83 +73,86 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
...
@@ -73,83 +73,86 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
model
.
setAuditDepartment
(
userInfo
.
getDepartment
().
getDepartmentName
());
model
.
setAuditDepartment
(
userInfo
.
getDepartment
().
getDepartmentName
());
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
model
.
getFaultId
());
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
model
.
getFaultId
());
try
{
//根据审核的结果进行业务操作
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
()
&&
userInfo
.
getDepartment
().
getSequenceNbr
().
equals
(
failureDetailsDto
.
getBizCode
()))
{
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_AUDIT
,
userInfo
,
condition
);
}
else
if
(
condition
==
(
AuditResultEnum
.
REFUSE
.
getCode
()))
{
updateStatus
(
model
,
FailureStatuEnum
.
REFUSE
,
userInfo
,
condition
);
}
else
if
(
condition
==
(
AuditResultEnum
.
SEND_BACK
.
getCode
()))
{
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_SUBMIT
,
userInfo
,
condition
);
}
else
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
()
)
{
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_MAINTAIN
,
userInfo
,
condition
);
}
FailureAuditDto
withModel
=
this
.
createWithModel
(
model
);
int
auditResult
=
0
;
}
catch
(
Exception
e
){
e
.
printStackTrace
();
//根据审核的结果进行业务操作
e
.
printStackTrace
();
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
()
&&
userInfo
.
getDepartment
().
getSequenceNbr
().
equals
(
failureDetailsDto
.
getBizCode
()))
{
logger
.
info
(
"添加故障审核信息到数据库失败"
);
auditResult
=
AuditResultEnum
.
AGREE
.
getCode
();
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
Boolean
repairResult
=
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_AUDIT
,
userInfo
,
condition
);
return
false
;
}
else
if
(
condition
==
(
AuditResultEnum
.
REFUSE
.
getCode
()))
{
auditResult
=
AuditResultEnum
.
REFUSE
.
getCode
();
Boolean
repairResult
=
updateStatus
(
model
,
FailureStatuEnum
.
REFUSE
,
userInfo
,
condition
);
}
else
if
(
condition
==
(
AuditResultEnum
.
SEND_BACK
.
getCode
()))
{
auditResult
=
AuditResultEnum
.
SEND_BACK
.
getCode
();
Boolean
repairResult
=
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_SUBMIT
,
userInfo
,
condition
);
}
else
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
())
{
auditResult
=
AuditResultEnum
.
AGREE
.
getCode
();
Boolean
repairResult
=
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_MAINTAIN
,
userInfo
,
condition
);
}
if
(
ObjectUtils
.
isEmpty
(
auditResult
))
{
throw
new
Exception
(
"添加报修日志失败"
);
}
}
model
.
setAuditResult
(
auditResult
);
FailureAuditDto
failureAuditDto
=
this
.
createWithModel
(
model
);
if
(
ObjectUtils
.
isEmpty
(
failureAuditDto
)){
return
false
;
}
return
true
;
return
true
;
}
}
/**
/**
* 修改故障保修单任务状态
* 修改故障保修单任务状态
*/
*/
@Transactional
@Transactional
public
Boolean
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为应急指挥科的时候 并且同意时 不修改主表状态 依然为待审核
//当前角色部门id为维修部门的时候 修改状态
//当前角色部门id为维修部门的时候 修改状态
/*Map<String, Object> stringObjectMap = failureDetailsService.checkExcuteTaskAuthMap(failureDetailsDto.getSequenceNbr(), userInfo);
String name = stringObjectMap.get("name").toString();
if (name.contains(EMERGENCY_COMMAND)) {
failureDetailsDto.setCurrentStatus(failureDetailsDto.getCurrentStatus());
}*/
failureDetailsDto
.
setCurrentStatus
(
status
.
getCode
());
failureDetailsDto
.
setCurrentStatus
(
status
.
getCode
());
failureDetailsDto
.
setSequenceNbr
(
model
.
getFaultId
());
failureDetailsDto
.
setSequenceNbr
(
model
.
getFaultId
());
FailureDetailsDto
failureDetailsDtos
=
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
FailureDetailsDto
failureDetailsDtos
=
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
System
.
out
.
println
(
failureDetailsDtos
);
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
();
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
())
;
String
processAuditorCid
=
userInfo
.
getUserModel
().
getUserName
();
String
processAuditorCid
=
userInfo
.
getUserModel
().
getUserName
();
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
,
processAuditorCid
);
repairlog
(
faultId
,
processAuditor
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
,
processAuditorCid
);
}
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
,
processAuditor
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
,
processAuditorCid
);
repairlog
(
faultId
,
processAuditor
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
,
processAuditorCid
);
}
else
if
(
condition
==
AuditResultEnum
.
REFUSE
.
getCode
()){
}
else
if
(
condition
==
AuditResultEnum
.
REFUSE
.
getCode
())
{
conditionText
=
AuditResultEnum
.
REFUSE
.
getName
();
conditionText
=
AuditResultEnum
.
REFUSE
.
getName
();
repairlog
(
faultId
,
processAuditor
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
,
processAuditorCid
);
repairlog
(
faultId
,
processAuditor
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
,
processAuditorCid
);
}
if
(
failureDetailsService
.
excuteTask
(
failureDetailsDto
.
getProcessId
(),
userInfo
,
condition
+
""
)){
return
true
;
}
else
{
throw
new
Exception
(
"执行流程失败"
);
}
}
failureDetailsService
.
excuteTask
(
failureDetailsDto
.
getProcessId
(),
userInfo
,
condition
+
""
);
return
true
;
}
}
return
false
;
return
false
;
}
}
/**
/**
* 添加报修日志
* 添加报修日志
*/
*/
@Transactional
@Transactional
public
Boolean
repairlog
(
Long
faultId
,
String
processAuditor
,
Integer
processAuditorId
,
Long
departmentId
,
Date
processTime
,
public
Boolean
repairlog
(
Long
faultId
,
String
processAuditor
,
Integer
processAuditorId
,
Long
departmentId
,
Date
processTime
,
String
processDepartment
,
String
processResult
,
String
processAuditorCid
)
{
String
processDepartment
,
String
processResult
,
String
processAuditorCid
)
{
FailureRepairlogDto
failureRepairlogDto
=
new
FailureRepairlogDto
();
FailureRepairlogDto
failureRepairlogDto
=
new
FailureRepairlogDto
();
failureRepairlogDto
.
setFaultId
(
faultId
);
failureRepairlogDto
.
setFaultId
(
faultId
);
failureRepairlogDto
.
setProcessAuditor
(
processAuditor
);
failureRepairlogDto
.
setProcessAuditor
(
processAuditor
);
...
@@ -160,7 +163,7 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
...
@@ -160,7 +163,7 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
failureRepairlogDto
.
setProcessResult
(
processResult
);
failureRepairlogDto
.
setProcessResult
(
processResult
);
failureRepairlogDto
.
setProcessAuditorCid
(
processAuditorCid
);
failureRepairlogDto
.
setProcessAuditorCid
(
processAuditorCid
);
failureRepairlogService
.
createWithModel
(
failureRepairlogDto
);
failureRepairlogService
.
createWithModel
(
failureRepairlogDto
);
if
(
ObjectUtils
.
isNotEmpty
(
failureRepairlogDto
)){
if
(
ObjectUtils
.
isNotEmpty
(
failureRepairlogDto
))
{
return
true
;
return
true
;
}
}
return
false
;
return
false
;
...
@@ -172,7 +175,7 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
...
@@ -172,7 +175,7 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
public
List
<
FailureAudit
>
findByfaultId
(
Long
faultId
)
{
public
List
<
FailureAudit
>
findByfaultId
(
Long
faultId
)
{
Page
<
FailureAudit
>
page
=
new
Page
<>();
Page
<
FailureAudit
>
page
=
new
Page
<>();
QueryWrapper
<
FailureAudit
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
FailureAudit
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"fault_id"
,
faultId
).
orderByDesc
(
"
submission
_time"
);
queryWrapper
.
eq
(
"fault_id"
,
faultId
).
orderByDesc
(
"
audit
_time"
);
return
baseMapper
.
selectList
(
queryWrapper
);
return
baseMapper
.
selectList
(
queryWrapper
);
}
}
...
...
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 @
aa10143a
...
@@ -85,25 +85,30 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -85,25 +85,30 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
* 分页查询
* 分页查询
*/
*/
public
IPage
<
FailureDetails
>
queryAllPage
(
long
size
,
long
current
)
{
public
IPage
<
FailureDetails
>
queryAllPage
(
long
size
,
long
current
)
{
QueryWrapper
<
FailureDetails
>
wrapper
=
new
QueryWrapper
<>();
/*
QueryWrapper<FailureDetails> wrapper = new QueryWrapper<>();
wrapper.orderByDesc("submission_time");
wrapper.orderByDesc("submission_time");
IPage<FailureDetails> page = new Page<>(current, size);
IPage<FailureDetails> page = new Page<>(current, size);
return
baseMapper
.
selectPage
(
page
,
wrapper
);
return baseMapper.selectPage(page, wrapper);*/
Page
pages
=
new
Page
<>(
current
,
size
);
LambdaQueryWrapper
<
FailureDetails
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
();
lambdaQueryWrapper
.
orderByDesc
(
FailureDetails:
:
getSubmissionTime
);
IPage
iPage
=
page
(
pages
,
lambdaQueryWrapper
);
Page
<
FailureDetails
>
page
=
new
Page
();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
page
.
setRecords
(
iPage
.
getRecords
());
return
page
;
}
}
public
IPage
<
FailureDetails
>
queryForFailureDetailsPage
(
Page
<
FailureDetails
>
page
,
AgencyUserModel
userInfo
,
public
IPage
<
FailureDetails
>
queryForFailureDetailsPage
(
Page
<
FailureDetails
>
page
,
ReginParams
userInfo
,
Integer
type
)
{
Integer
type
)
{
if
(
type
.
equals
(
SELECY_ALL
))
{
if
(
type
.
equals
(
SELECY_ALL
))
{
return
this
.
queryAllPage
(
page
.
getSize
(),
page
.
getCurrent
());
return
this
.
queryAllPage
(
page
.
getSize
(),
page
.
getCurrent
());
}
}
if
(
type
.
equals
(
SELECY_ISUBMIT
))
{
if
(
type
.
equals
(
SELECY_ISUBMIT
))
{
return
queryForPage
(
page
,
userInfo
.
getUserModel
().
getUserId
());
return
queryForPage
(
page
,
userInfo
.
getUserId
());
}
}
return
this
.
queryForWaitManage
(
page
,
userInfo
.
getUserId
());
return
this
.
queryForWaitManage
(
page
,
userInfo
.
getUser
Model
().
getUser
Id
());
}
}
/**
/**
...
@@ -113,11 +118,17 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -113,11 +118,17 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
if
(
submissionPid
==
null
)
{
if
(
submissionPid
==
null
)
{
return
null
;
return
null
;
}
}
QueryWrapper
<
FailureDetails
>
wrapper
=
new
QueryWrapper
<>();
/*
QueryWrapper<FailureDetails> wrapper = new QueryWrapper<>();
wrapper.eq("submission_pid", submissionPid);
wrapper.eq("submission_pid", submissionPid);
wrapper.orderByDesc("submission_time");
wrapper.orderByDesc("submission_time");
IPage<FailureDetails> failureDetailsPage = new Page<>(page.getCurrent(), page.getSize());
IPage<FailureDetails> failureDetailsPage = new Page<>(page.getCurrent(), page.getSize());
return
baseMapper
.
selectPage
(
failureDetailsPage
,
wrapper
);
return baseMapper.selectPage(failureDetailsPage, wrapper);*/
Page
pages
=
new
Page
<>(
page
.
getCurrent
(),
page
.
getSize
());
LambdaQueryWrapper
<
FailureDetails
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
();
lambdaQueryWrapper
.
eq
(
FailureDetails:
:
getSubmissionPid
,
submissionPid
);
lambdaQueryWrapper
.
orderByDesc
(
FailureDetails:
:
getSubmissionTime
);
return
page
(
pages
,
lambdaQueryWrapper
);
}
}
/**
/**
...
@@ -127,15 +138,19 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -127,15 +138,19 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
if
(
submissionPid
==
null
)
{
if
(
submissionPid
==
null
)
{
return
null
;
return
null
;
}
}
QueryWrapper
<
FailureDetails
>
wrapper
=
new
QueryWrapper
<>();
LambdaQueryWrapper
<
FailureDetails
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
();
lambdaQueryWrapper
.
notIn
(
FailureDetails:
:
getCurrentStatus
,
FailureStatuEnum
.
REFUSE
.
getCode
(),
FailureStatuEnum
.
FINISH
.
getCode
()
).
orderByDesc
(
FailureDetails:
:
getSubmissionTime
);
/*QueryWrapper<FailureDetails> wrapper = new QueryWrapper<>();
wrapper.eq("submission_pid", submissionPid);
wrapper.eq("submission_pid", submissionPid);
wrapper.notIn("current_status", FailureStatuEnum.REFUSE.getCode(), FailureStatuEnum.FINISH.getCode(),
wrapper.notIn("current_status", FailureStatuEnum.REFUSE.getCode(), FailureStatuEnum.FINISH.getCode(),
FailureStatuEnum.WAITING_AUDIT.getCode());
FailureStatuEnum.WAITING_AUDIT.getCode());
wrapper
.
orderByDesc
(
"submission_time"
);
wrapper.orderByDesc("submission_time");
*/
IPage
<
FailureDetails
>
failureDetailsPage
=
new
Page
<>(
page
.
getCurrent
(),
page
.
getSize
());
IPage
<
FailureDetails
>
failureDetailsPage
=
new
Page
<>(
page
.
getCurrent
(),
page
.
getSize
());
return
baseMapper
.
selectPage
(
failureDetailsPage
,
w
rapper
);
return
baseMapper
.
selectPage
(
failureDetailsPage
,
lambdaQueryW
rapper
);
}
}
/**
/**
* 列表查询 示例
* 列表查询 示例
*/
*/
...
@@ -181,6 +196,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -181,6 +196,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
}
}
/**
/**
* 查询任务状态数量
* 查询任务状态数量
*/
*/
...
@@ -201,7 +217,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -201,7 +217,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
int
inMaintenance
=
0
;
int
inMaintenance
=
0
;
List
<
FailureStatusCountDto
>
list
=
new
ArrayList
<>();
List
<
FailureStatusCountDto
>
list
=
new
ArrayList
<>();
//
String[] statusName = new String[]{"待审核", "待提交", "待维修", "待验收", "已拒绝", "已完结"};
//
String[] statusName = new String[]{"待审核", "待提交", "待维修", "待验收", "已拒绝", "已完结"};
List
<
String
>
statusName
=
new
ArrayList
<>();
List
<
String
>
statusName
=
new
ArrayList
<>();
Collections
.
addAll
(
statusName
,
FailureStatuEnum
.
WAITING_AUDIT
.
getName
(),
Collections
.
addAll
(
statusName
,
FailureStatuEnum
.
WAITING_AUDIT
.
getName
(),
FailureStatuEnum
.
WAITING_SUBMIT
.
getName
(),
FailureStatuEnum
.
WAITING_MAINTAIN
.
getName
(),
FailureStatuEnum
.
WAITING_SUBMIT
.
getName
(),
FailureStatuEnum
.
WAITING_MAINTAIN
.
getName
(),
...
@@ -249,7 +265,8 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -249,7 +265,8 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
*
*
* @throws Exception
* @throws Exception
*/
*/
public
Object
savemodel
(
FailureDetailsDto
failureDetailsDto
,
ReginParams
userInfo
)
{
@Transactional
public
Object
savemodel
(
FailureDetailsDto
failureDetailsDto
,
ReginParams
userInfo
)
throws
Exception
{
String
businessKey
=
buildOrderNo
();
String
businessKey
=
buildOrderNo
();
JSONObject
body
=
new
JSONObject
();
JSONObject
body
=
new
JSONObject
();
body
.
put
(
"businessKey"
,
businessKey
);
body
.
put
(
"businessKey"
,
businessKey
);
...
@@ -267,7 +284,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -267,7 +284,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
// 拿到流程processId
// 拿到流程processId
failureDetailsDto
.
setProcessId
(
instance
.
getString
(
"id"
));
failureDetailsDto
.
setProcessId
(
instance
.
getString
(
"id"
));
FailureDetailsDto
model
=
null
;
FailureDetailsDto
model
=
null
;
try
{
// 发起主表流程 并添加至报修日志
// 发起主表流程 并添加至报修日志
failureDetailsDto
.
setSubmissionTime
(
new
Date
());
failureDetailsDto
.
setSubmissionTime
(
new
Date
());
failureDetailsDto
.
setFailureCode
(
buildOrderNo
());
failureDetailsDto
.
setFailureCode
(
buildOrderNo
());
...
@@ -280,7 +297,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -280,7 +297,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
failureDetailsDto
.
getAttachment
());
failureDetailsDto
.
getAttachment
());
}
}
// 添加至报修日志
// 添加至报修日志
try
{
Long
faultId
=
model
.
getSequenceNbr
();
Long
faultId
=
model
.
getSequenceNbr
();
String
processAuditor
=
model
.
getRecUserName
();
String
processAuditor
=
model
.
getRecUserName
();
Integer
processAuditorId
=
model
.
getSubmissionPid
();
Integer
processAuditorId
=
model
.
getSubmissionPid
();
...
@@ -289,30 +306,14 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -289,30 +306,14 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
Long
departmentId
=
userInfo
.
getDepartment
().
getSequenceNbr
();
Long
departmentId
=
userInfo
.
getDepartment
().
getSequenceNbr
();
Date
processTime
=
model
.
getSubmissionTime
();
Date
processTime
=
model
.
getSubmissionTime
();
String
processAuditorCid
=
userInfo
.
getUserModel
().
getUserName
();
String
processAuditorCid
=
userInfo
.
getUserModel
().
getUserName
();
repairlog
(
faultId
,
processAuditor
,
processAuditorId
,
departmentId
,
processTime
,
processDepartment
,
repairlog
(
faultId
,
processAuditor
,
processAuditorId
,
departmentId
,
processTime
,
processDepartment
,
processResult
,
processAuditorCid
);
processResult
,
processAuditorCid
);
}
catch
(
Exception
e
)
{
if
(
excuteTask
(
instance
.
getString
(
"id"
),
userInfo
,
null
)){
e
.
printStackTrace
();
return
true
;
logger
.
info
(
"添加流程日志到数据库失败"
);
}
else
{
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
throw
new
Exception
(
"执行流程失败"
);
return
false
;
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
logger
.
info
(
"添加故障维修信息到数据库失败"
);
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
return
false
;
// return CommonResponseUtil.failure("添加失败");
}
try
{
if
(
ObjectUtils
.
isNotEmpty
(
model
))
{
excuteTask
(
instance
.
getString
(
"id"
),
userInfo
,
null
);
}
}
catch
(
Exception
e
)
{
return
false
;
}
return
true
;
}
}
/**
/**
...
@@ -349,6 +350,11 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -349,6 +350,11 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
}
else
{
}
else
{
workflowFeignService
.
pickupAndCompleteTask
(
map
.
get
(
"taskId"
).
toString
(),
conditionMap
);
workflowFeignService
.
pickupAndCompleteTask
(
map
.
get
(
"taskId"
).
toString
(),
conditionMap
);
}
}
// 判断下一个节点是不是维修中,如果是则添加当前任务的执行人
String
nextTaskId
=
checkIsInMaintenance
(
sequenceNbr
);
if
(
nextTaskId
!=
null
)
{
workflowFeignService
.
pickuptask
(
nextTaskId
);
}
}
}
return
true
;
return
true
;
}
}
...
@@ -358,7 +364,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -358,7 +364,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
*
*
* @param sequenceNbr
* @param sequenceNbr
* @param userInfo
* @param userInfo
* @param condition
* @return
* @return
*/
*/
public
boolean
excuteTaskOnlyOperation
(
Long
sequenceNbr
,
ReginParams
userInfo
)
{
public
boolean
excuteTaskOnlyOperation
(
Long
sequenceNbr
,
ReginParams
userInfo
)
{
...
...
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 @
aa10143a
...
@@ -4,8 +4,10 @@ import java.util.Date;
...
@@ -4,8 +4,10 @@ import java.util.Date;
import
java.util.List
;
import
java.util.List
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureAuditDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureAuditDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.FailureAudit
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
...
@@ -45,15 +47,10 @@ import com.yeejoin.amos.boot.module.common.api.mapper.FailureMaintainMapper;
...
@@ -45,15 +47,10 @@ import com.yeejoin.amos.boot.module.common.api.mapper.FailureMaintainMapper;
import
com.yeejoin.amos.boot.module.common.api.service.IFailureMaintainService
;
import
com.yeejoin.amos.boot.module.common.api.service.IFailureMaintainService
;
/**
/**
*
* 服务实现类
* 服务实现类
*
*
*
*
* @author system_generator
* @author system_generator
*
* @date 2021-08-04
* @date 2021-08-04
*
*/
*/
@Service
@Service
...
@@ -61,349 +58,240 @@ import com.yeejoin.amos.boot.module.common.api.service.IFailureMaintainService;
...
@@ -61,349 +58,240 @@ import com.yeejoin.amos.boot.module.common.api.service.IFailureMaintainService;
@Transactional
@Transactional
public
class
FailureMaintainServiceImpl
extends
BaseService
<
FailureMaintainDto
,
FailureMaintain
,
FailureMaintainMapper
>
public
class
FailureMaintainServiceImpl
extends
BaseService
<
FailureMaintainDto
,
FailureMaintain
,
FailureMaintainMapper
>
implements
IFailureMaintainService
{
implements
IFailureMaintainService
{
@Autowired
@Autowired
SourceFileServiceImpl
sourceFileServiceImpl
;
SourceFileServiceImpl
sourceFileServiceImpl
;
@Autowired
@Autowired
FailureDetailsServiceImpl
failureDetailsService
;
FailureDetailsServiceImpl
failureDetailsService
;
@Autowired
@Autowired
FailureRepairlogServiceImpl
failureRepairlogService
;
FailureRepairlogServiceImpl
failureRepairlogService
;
@Autowired
@Autowired
WorkflowFeignService
workflowFeignService
;
WorkflowFeignService
workflowFeignService
;
private
static
String
RECORE_TYPE
=
"维修记录"
;
private
static
String
RECORE_TYPE
=
"维修记录"
;
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
FailureMaintainServiceImpl
.
class
);
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
;
private
static
int
MAINTENANCE_ADD
=
1
;
private
static
int
MAINTENANCE_ADD
=
1
;
private
static
String
[]
PROCESS_RESULT
=
{
"验证通过"
,
"验证未通过"
};
private
static
String
[]
PROCESS_RESULT
=
{
"验证通过"
,
"验证未通过"
};
/**
/**
*
* 分页查询
* 分页查询
*/
*
*/
public
Page
<
FailureMaintainDto
>
queryForFailureMaintainPage
(
Page
<
FailureMaintainDto
>
page
)
{
public
Page
<
FailureMaintainDto
>
queryForFailureMaintainPage
(
Page
<
FailureMaintainDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
return
this
.
queryForPage
(
page
,
null
,
false
);
}
}
/**
* 列表查询 示例
/**
*/
*
* 列表查询 示例
public
List
<
FailureMaintainDto
>
queryForFailureMaintainList
()
{
*
*/
return
this
.
queryForList
(
""
,
false
);
public
List
<
FailureMaintainDto
>
queryForFailureMaintainList
()
{
}
return
this
.
queryForList
(
""
,
false
);
/**
* 添加维修记录
}
*/
/**
public
Object
savemodel
(
FailureMaintainDto
failureMaintainDto
,
ReginParams
userInfo
)
throws
Exception
{
*
* 添加维修记录
String
condition
=
failureMaintainDto
.
getCondition
();
*
int
conditionStatus
=
Integer
.
parseInt
(
condition
);
*/
if
(
conditionStatus
==
MAINTENANCE_ADD
)
{
boolean
result
=
failureDetailsService
.
checkExcuteTaskAuth
(
failureMaintainDto
.
getFaultId
(),
userInfo
);
public
Object
savemodel
(
FailureMaintainDto
failureMaintainDto
,
ReginParams
userInfo
)
{
if
(!
result
)
{
return
false
;
String
condition
=
failureMaintainDto
.
getCondition
();
}
failureMaintainDto
.
setMaintainMan
(
userInfo
.
getUserModel
().
getUserName
());
int
conditionStatus
=
Integer
.
parseInt
(
condition
);
failureMaintainDto
.
setMaintainTime
(
new
Date
());
failureMaintainDto
.
setDepartment
(
userInfo
.
getDepartment
().
getDepartmentName
());
if
(
conditionStatus
==
MAINTENANCE_ADD
)
{
failureMaintainDto
.
setBizId
(
userInfo
.
getDepartment
().
getSequenceNbr
());
failureMaintainDto
.
setRecoreType
(
RECORE_TYPE
);
boolean
result
=
failureDetailsService
.
checkExcuteTaskAuth
(
failureMaintainDto
.
getFaultId
(),
userInfo
);
this
.
createWithModel
(
failureMaintainDto
);
// 添加完成后修改保修单状态为维修中
if
(!
result
)
{
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
failureMaintainDto
.
getFaultId
());
failureDetailsDto
.
setCurrentStatus
(
FailureStatuEnum
.
IN_MAINTENANCE
.
getCode
());
return
false
;
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
// 添加报修日志
}
String
processResult
=
MAINTENANCE_STATUS
[
1
];
// 维修中
Integer
processAuditorId
=
Integer
.
parseInt
(
failureMaintainDto
.
getRecUserId
());
try
{
String
processAuditorCid
=
userInfo
.
getUserModel
().
getUserName
();
repairlog
(
failureMaintainDto
.
getFaultId
(),
failureMaintainDto
.
getMaintainMan
(),
processAuditorId
,
failureMaintainDto
.
setMaintainMan
(
userInfo
.
getUserModel
().
getUserName
());
userInfo
.
getDepartment
().
getSequenceNbr
(),
failureMaintainDto
.
getMaintainTime
(),
failureMaintainDto
.
getDepartment
(),
processResult
,
processAuditorCid
);
failureMaintainDto
.
setMaintainTime
(
new
Date
());
if
(
ObjectUtils
.
isNotEmpty
(
failureMaintainDto
.
getAttachment
()))
{
sourceFileServiceImpl
.
saveSourceFile
(
failureMaintainDto
.
getSequenceNbr
(),
failureMaintainDto
.
setDepartment
(
userInfo
.
getDepartment
().
getDepartmentName
());
failureMaintainDto
.
getAttachment
());
}
failureMaintainDto
.
setBizId
(
userInfo
.
getDepartment
().
getSequenceNbr
());
String
nextTaskId
=
failureDetailsService
.
checkIsInMaintenance
(
failureDetailsDto
.
getSequenceNbr
());
if
(
nextTaskId
==
null
)
{
failureMaintainDto
.
setRecoreType
(
RECORE_TYPE
);
if
(
failureDetailsService
.
excuteTask
(
failureMaintainDto
.
getFaultId
(),
userInfo
,
condition
))
{
}
else
{
this
.
createWithModel
(
failureMaintainDto
);
throw
new
RuntimeException
(
"执行维修中流程失败"
);
}
// 添加完成后修改保修单状态为维修中
}
else
{
// 判断下一个节点是不是维修中,如果是则添加当前任务的执行人
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
failureMaintainDto
.
getFaultId
());
workflowFeignService
.
pickuptask
(
nextTaskId
);
}
failureDetailsDto
.
setCurrentStatus
(
FailureStatuEnum
.
IN_MAINTENANCE
.
getCode
());
return
true
;
}
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
return
this
.
updateStatus
(
failureMaintainDto
,
userInfo
);
}
// 添加报修日志
/**
* 更新状态维修完成
String
processResult
=
MAINTENANCE_STATUS
[
1
];
// 维修中
*/
Integer
processAuditorId
=
Integer
.
parseInt
(
failureMaintainDto
.
getRecUserId
());
public
Boolean
updateStatus
(
FailureMaintainDto
failureMaintainDto
,
ReginParams
userInfo
)
throws
Exception
{
String
condition
=
failureMaintainDto
.
getCondition
();
String
processAuditorCid
=
userInfo
.
getUserModel
().
getUserName
();
int
conditionStatus
=
Integer
.
parseInt
(
condition
);
if
(
conditionStatus
==
MAINTENANCE_COMPLETE
)
{
repairlog
(
failureMaintainDto
.
getFaultId
(),
failureMaintainDto
.
getMaintainMan
(),
processAuditorId
,
boolean
result
=
failureDetailsService
.
checkExcuteTaskAuth
(
failureMaintainDto
.
getFaultId
(),
userInfo
);
userInfo
.
getDepartment
().
getSequenceNbr
(),
failureMaintainDto
.
getMaintainTime
(),
if
(!
result
)
{
return
false
;
failureMaintainDto
.
getDepartment
(),
processResult
,
processAuditorCid
);
}
failureMaintainDto
.
setMaintainMan
(
userInfo
.
getUserModel
().
getUserName
());
if
(
ObjectUtils
.
isNotEmpty
(
failureMaintainDto
.
getAttachment
()))
{
failureMaintainDto
.
setMaintainTime
(
new
Date
());
failureMaintainDto
.
setDepartment
(
userInfo
.
getDepartment
().
getDepartmentName
());
sourceFileServiceImpl
.
saveSourceFile
(
failureMaintainDto
.
getSequenceNbr
(),
failureMaintainDto
.
setBizId
(
userInfo
.
getDepartment
().
getSequenceNbr
());
failureMaintainDto
.
getAttachment
());
failureMaintainDto
.
setRecoreType
(
RECORE_TYPE
);
this
.
createWithModel
(
failureMaintainDto
);
}
// 添加完成后修改保修单状态为维修完成
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
failureMaintainDto
.
getFaultId
());
String
nextTaskId
=
failureDetailsService
.
checkIsInMaintenance
(
failureDetailsDto
.
getSequenceNbr
());
failureDetailsDto
.
setCurrentStatus
(
FailureStatuEnum
.
WAITING_ACCEPTANCE
.
getCode
());
if
(
nextTaskId
==
null
)
{
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
try
{
// 添加报修日志
failureDetailsService
.
excuteTask
(
failureMaintainDto
.
getFaultId
(),
userInfo
,
condition
);
String
processResult
=
MAINTENANCE_STATUS
[
0
];
// 维修完成
}
catch
(
Exception
e
)
{
Integer
processAuditorId
=
Integer
.
parseInt
(
failureMaintainDto
.
getRecUserId
());
return
false
;
String
processAuditorCid
=
userInfo
.
getUserModel
().
getUserName
();
}
repairlog
(
failureMaintainDto
.
getFaultId
(),
failureMaintainDto
.
getMaintainMan
(),
processAuditorId
,
userInfo
.
getDepartment
().
getSequenceNbr
(),
failureMaintainDto
.
getMaintainTime
(),
}
else
{
failureMaintainDto
.
getDepartment
(),
processResult
,
processAuditorCid
);
// 判断下一个节点是不是维修中,如果是则添加当前任务的执行人
if
(
ObjectUtils
.
isNotEmpty
(
failureMaintainDto
.
getAttachment
()))
{
workflowFeignService
.
pickuptask
(
nextTaskId
);
sourceFileServiceImpl
.
saveSourceFile
(
failureMaintainDto
.
getSequenceNbr
(),
}
failureMaintainDto
.
getAttachment
());
}
}
catch
(
Exception
e
)
{
if
(
failureDetailsService
.
excuteTask
(
failureMaintainDto
.
getFaultId
(),
userInfo
,
condition
))
{
logger
.
info
(
"添加故障维修信息到数据库失败"
);
}
else
{
throw
new
RuntimeException
(
"执行维修完成流程失败"
);
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
}
}
return
false
;
return
true
;
}
}
/**
return
true
;
* 根据审核结果更新维修表
*/
}
public
Boolean
updateModel
(
FailureMaintainDto
failureMaintainDto
,
ReginParams
userInfo
)
throws
Exception
{
return
this
.
updateStatus
(
failureMaintainDto
,
userInfo
);
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
);
public
Boolean
updateStatus
(
FailureMaintainDto
failureMaintainDto
,
ReginParams
userInfo
)
{
if
(
conditionStatus
==
AuditResultEnum
.
AGREE
.
getCode
()
&&
userInfo
.
getDepartment
().
getSequenceNbr
()
==
failureDetailsDto
.
getBizCode
())
{
// 同意状态为已完结
try
{
processResult
=
PROCESS_RESULT
[
0
];
}
else
if
(
conditionStatus
==
AuditResultEnum
.
AGREE
.
getCode
())
{
// 同意状态为已完结
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
failureMaintainDto
.
getFaultId
());
failureDetailsDto
.
setCurrentStatus
(
failureDetailsDto
.
getCurrentStatus
());
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
failureDetailsDto
.
setCurrentStatus
(
FailureStatuEnum
.
WAITING_ACCEPTANCE
.
getCode
());
processResult
=
PROCESS_RESULT
[
0
];
}
else
if
(
conditionStatus
==
AuditResultEnum
.
REFUSE
.
getCode
()){
// 不同意状态为已拒绝
this
.
updateWithModel
(
failureMaintainDto
);
failureDetailsDto
.
setCurrentStatus
(
FailureStatuEnum
.
REFUSE
.
getCode
());
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
// 添加报修日志
processResult
=
PROCESS_RESULT
[
1
];
}
String
processResult
=
MAINTENANCE_STATUS
[
0
];
// 维修完成
// 添加报修日志
Integer
processAuditorId
=
Integer
.
parseInt
(
failureMaintainDto
.
getRecUserId
());
Integer
processAuditorId
=
Integer
.
parseInt
(
failureMaintainDto
.
getRecUserId
());
String
processAuditorCid
=
userInfo
.
getUserModel
().
getUserName
();
String
processAuditorCid
=
userInfo
.
getUserModel
().
getUserName
();
Boolean
repairlog
=
repairlog
(
failureMaintainDto
.
getFaultId
(),
failureMaintainDto
.
getMaintainMan
(),
processAuditorId
,
repairlog
(
failureMaintainDto
.
getFaultId
(),
failureMaintainDto
.
getMaintainMan
(),
processAuditorId
,
userInfo
.
getDepartment
().
getSequenceNbr
(),
failureMaintainDto
.
getMaintainTime
(),
userInfo
.
getDepartment
().
getSequenceNbr
(),
failureMaintainDto
.
getMaintainTime
(),
failureMaintainDto
.
getDepartment
(),
processResult
,
processAuditorCid
);
if
(
ObjectUtils
.
isEmpty
(
repairlog
)){
failureMaintainDto
.
getDepartment
(),
processResult
,
processAuditorCid
);
throw
new
RuntimeException
(
"验收添加报修日志出错"
);
}
if
(
ObjectUtils
.
isNotEmpty
(
failureMaintainDto
.
getAttachment
()))
{
if
(
failureDetailsService
.
excuteTask
(
failureMaintainDto
.
getFaultId
(),
userInfo
,
condition
)){
sourceFileServiceImpl
.
saveSourceFile
(
failureMaintainDto
.
getSequenceNbr
(),
return
true
;
failureMaintainDto
.
getAttachment
());
}
else
{
throw
new
RuntimeException
(
"验收执行流程失败"
);
}
}
try
{
}
failureDetailsService
.
excuteTask
(
failureMaintainDto
.
getFaultId
(),
userInfo
,
return
false
;
failureMaintainDto
.
getCondition
());
}
catch
(
Exception
e
)
{
}
return
false
;
}
/**
* 根据FaultId查询
}
catch
(
Exception
e
)
{
*/
public
List
<
FailureMaintain
>
findByfaultId
(
Long
faultId
)
{
logger
.
info
(
"更新故障验收信息到数据库失败"
);
LambdaQueryWrapper
<
FailureMaintain
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
lambdaQueryWrapper
.
eq
(
FailureMaintain:
:
getFaultId
,
faultId
).
orderByDesc
(
FailureMaintain:
:
getMaintainTime
);
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
return
baseMapper
.
selectList
(
lambdaQueryWrapper
);
}
return
false
;
/**
}
* 查询当前故障报修单的流程的审批历史节点
*
return
true
;
* @param sequenceNbr
* @return
}
*/
/**
public
List
<
Object
>
getProcessHistoryList
(
Long
sequenceNbr
)
{
*
* 根据审核结果更新维修表
// TODO Auto-generated method stub
*
*/
return
null
;
public
Boolean
updateModel
(
FailureMaintainDto
failureMaintainDto
,
Integer
status
,
ReginParams
userInfo
)
{
}
boolean
result
=
failureDetailsService
.
checkExcuteTaskAuth
(
failureMaintainDto
.
getFaultId
(),
userInfo
);
/**
* 添加报修日志
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
failureMaintainDto
.
getFaultId
());
*/
public
Boolean
repairlog
(
Long
faultId
,
String
processAuditor
,
Integer
processAuditorId
,
Long
departmentId
,
if
(
result
)
{
Date
processTime
,
this
.
updateWithModel
(
failureMaintainDto
);
String
processDepartment
,
String
processResult
,
String
processAuditorCid
)
{
// 根据status修改状态
FailureRepairlogDto
failureRepairlogDto
=
new
FailureRepairlogDto
();
failureRepairlogDto
.
setFaultId
(
faultId
);
String
processResult
=
new
String
();
failureRepairlogDto
.
setProcessAuditor
(
processAuditor
);
failureRepairlogDto
.
setProcessAuditorId
(
processAuditorId
);
String
condition
=
new
String
();
failureRepairlogDto
.
setProcessDepartmentId
(
departmentId
);
failureRepairlogDto
.
setProcessTime
(
processTime
);
if
(
status
==
AuditResultEnum
.
AGREE
.
getCode
()
&&
userInfo
.
getDepartment
().
getSequenceNbr
()
failureRepairlogDto
.
setProcessDepartment
(
processDepartment
);
failureRepairlogDto
.
setProcessResult
(
processResult
);
==
failureDetailsDto
.
getBizCode
())
{
// 同意状态为已完结
failureRepairlogDto
.
setProcessAuditorCid
(
processAuditorCid
);
failureRepairlogService
.
createWithModel
(
failureRepairlogDto
);
failureDetailsDto
.
setCurrentStatus
(
failureDetailsDto
.
getCurrentStatus
());
if
(
ObjectUtils
.
isNotEmpty
(
failureRepairlogDto
))
{
return
true
;
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
}
return
false
;
processResult
=
PROCESS_RESULT
[
0
];
}
condition
=
AuditResultEnum
.
AGREE
.
getName
();
}
else
if
(
status
==
AuditResultEnum
.
AGREE
.
getCode
())
{
// 同意状态为已完结
failureDetailsDto
.
setCurrentStatus
(
failureDetailsDto
.
getCurrentStatus
());
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
processResult
=
PROCESS_RESULT
[
0
];
condition
=
AuditResultEnum
.
AGREE
.
getName
();
}
else
{
// 不同意状态为已拒绝
failureDetailsDto
.
setCurrentStatus
(
FailureStatuEnum
.
REFUSE
.
getCode
());
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
processResult
=
PROCESS_RESULT
[
1
];
condition
=
AuditResultEnum
.
REFUSE
.
getName
();
}
// 添加报修日志
Integer
processAuditorId
=
Integer
.
parseInt
(
failureMaintainDto
.
getRecUserId
());
String
processAuditorCid
=
userInfo
.
getUserModel
().
getUserName
();
repairlog
(
failureMaintainDto
.
getFaultId
(),
failureMaintainDto
.
getMaintainMan
(),
processAuditorId
,
userInfo
.
getDepartment
().
getSequenceNbr
(),
failureMaintainDto
.
getMaintainTime
(),
failureMaintainDto
.
getDepartment
(),
processResult
,
processAuditorCid
);
try
{
failureDetailsService
.
excuteTask
(
failureMaintainDto
.
getFaultId
(),
userInfo
,
condition
);
}
catch
(
Exception
e
)
{
return
false
;
}
return
true
;
}
return
false
;
}
/**
*
* 查询当前故障报修单的流程的审批历史节点
*
* @param sequenceNbr
*
* @return
*
*/
public
List
<
Object
>
getProcessHistoryList
(
Long
sequenceNbr
)
{
// TODO Auto-generated method stub
return
null
;
}
/**
*
* 添加报修日志
*
*/
@Transactional
public
Boolean
repairlog
(
Long
faultId
,
String
processAuditor
,
Integer
processAuditorId
,
Long
departmentId
,
Date
processTime
,
String
processDepartment
,
String
processResult
,
String
processAuditorCid
)
{
FailureRepairlogDto
failureRepairlogDto
=
new
FailureRepairlogDto
();
failureRepairlogDto
.
setFaultId
(
faultId
);
failureRepairlogDto
.
setProcessAuditor
(
processAuditor
);
failureRepairlogDto
.
setProcessAuditorId
(
processAuditorId
);
failureRepairlogDto
.
setProcessDepartmentId
(
departmentId
);
failureRepairlogDto
.
setProcessTime
(
processTime
);
failureRepairlogDto
.
setProcessDepartment
(
processDepartment
);
failureRepairlogDto
.
setProcessResult
(
processResult
);
failureRepairlogDto
.
setProcessAuditorCid
(
processAuditorCid
);
failureRepairlogService
.
createWithModel
(
failureRepairlogDto
);
if
(
ObjectUtils
.
isNotEmpty
(
failureRepairlogDto
))
{
return
true
;
}
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/FailureVerifyServiceImpl.java
0 → 100644
View file @
aa10143a
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureVerifyDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureRepairlogDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.FailureVerify
;
import
com.yeejoin.amos.boot.module.common.api.enums.AuditResultEnum
;
import
com.yeejoin.amos.boot.module.common.api.enums.FailureStatuEnum
;
import
com.yeejoin.amos.boot.module.common.api.mapper.FailureVerifyMapper
;
import
com.yeejoin.amos.boot.module.common.api.service.IFailureVerifyService
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
java.util.Date
;
import
java.util.List
;
/**
* 故障报修验收记录服务实现类
*
* @author system_generator
* @date 2021-08-18
*/
@Service
public
class
FailureVerifyServiceImpl
extends
BaseService
<
FailureVerifyDto
,
FailureVerify
,
FailureVerifyMapper
>
implements
IFailureVerifyService
{
@Autowired
FailureDetailsServiceImpl
failureDetailsService
;
@Autowired
FailureRepairlogServiceImpl
failureRepairlogService
;
/**
* 分页查询
*/
public
Page
<
FailureVerifyDto
>
queryForFailureVerifyPage
(
Page
<
FailureVerifyDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
}
/**
* 列表查询 示例
*/
public
List
<
FailureVerifyDto
>
queryForFailureVerifyList
()
{
return
this
.
queryForList
(
""
,
false
);
}
@Transactional
public
Object
savemodel
(
FailureVerifyDto
model
,
ReginParams
userInfo
)
throws
Exception
{
int
condition
=
Integer
.
parseInt
(
model
.
getCondition
());
model
.
setVerifyTime
(
new
Date
());
model
.
setVerifyDepartmentId
(
userInfo
.
getDepartment
().
getSequenceNbr
());
model
.
setAcceptor
(
userInfo
.
getUserModel
().
getUserName
());
model
.
setVerifyDepartment
(
userInfo
.
getDepartment
().
getDepartmentName
());
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
model
.
getFaultId
());
int
verifyResult
=
0
;
boolean
result
=
failureDetailsService
.
checkExcuteTaskAuth
(
failureDetailsDto
.
getSequenceNbr
(),
userInfo
);
if
(!
result
)
{
return
new
RuntimeException
(
"无权限"
);
}
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
()))
{
verifyResult
=
AuditResultEnum
.
REFUSE
.
getCode
();
repairResult
=
updateStatus
(
model
,
FailureStatuEnum
.
REFUSE
,
userInfo
,
condition
);
}
/*else if (condition == (AuditResultEnum.SEND_BACK.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
();
repairResult
=
updateStatus
(
model
,
FailureStatuEnum
.
FINISH
,
userInfo
,
condition
);
}
model
.
setVerifyResult
(
verifyResult
);
List
<
FailureVerify
>
byfaultId
=
findByfaultId
(
failureDetailsDto
.
getSequenceNbr
());
/* if (byfaultId.size() == 0) {
this.createWithModel(model);
} else {*/
this
.
createWithModel
(
model
);
if
(!
failureDetailsService
.
excuteTask
(
failureDetailsDto
.
getProcessId
(),
userInfo
,
condition
+
""
))
{
throw
new
Exception
(
"执行流程失败"
);
}
/* }*/
return
true
;
}
/**
* 修改故障保修单任务状态
*/
@Transactional
public
Boolean
updateStatus
(
FailureVerifyDto
model
,
FailureStatuEnum
status
,
ReginParams
userInfo
,
int
condition
)
throws
Exception
{
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
model
.
getFaultId
());
//当前角色部门id为应急指挥科的时候 并且同意时 不修改主表状态 依然为待验收
//当前角色部门id为维修部门的时候 修改状态
List
<
FailureVerify
>
byfaultId
=
findByfaultId
(
failureDetailsDto
.
getSequenceNbr
());
if
(
byfaultId
.
size
()
!=
0
)
{
failureDetailsDto
.
setCurrentStatus
(
status
.
getCode
());
}
failureDetailsDto
.
setSequenceNbr
(
model
.
getFaultId
());
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
String
conditionText
;
//添加报修日志
Long
faultId
=
model
.
getFaultId
();
Date
processTime
=
model
.
getVerifyTime
();
String
processDepartment
=
model
.
getVerifyDepartment
();
Integer
processAuditorId
=
Integer
.
parseInt
(
userInfo
.
getUserModel
().
getUserId
());
String
processVerifyor
=
model
.
getAcceptor
();
String
processAuditorCid
=
userInfo
.
getUserModel
().
getUserName
();
Long
auditDepartmentId
=
(
userInfo
.
getDepartment
().
getSequenceNbr
());
Boolean
repairlog
=
null
;
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
())
{
conditionText
=
AuditResultEnum
.
AGREE
.
getName
();
repairlog
=
repairlog
(
faultId
,
processVerifyor
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
,
processAuditorCid
);
}
else
if
(
condition
==
AuditResultEnum
.
REFUSE
.
getCode
())
{
conditionText
=
AuditResultEnum
.
REFUSE
.
getName
();
repairlog
=
repairlog
(
faultId
,
processVerifyor
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
,
processAuditorCid
);
}
if
(!
repairlog
)
{
throw
new
Exception
(
"执行流程失败"
);
}
else
{
return
true
;
}
}
/**
* 添加报修日志
*/
@Transactional
public
Boolean
repairlog
(
Long
faultId
,
String
processAuditor
,
Integer
processAuditorId
,
Long
departmentId
,
Date
processTime
,
String
processDepartment
,
String
processResult
,
String
processVerifyorCid
)
{
FailureRepairlogDto
failureRepairlogDto
=
new
FailureRepairlogDto
();
failureRepairlogDto
.
setFaultId
(
faultId
);
failureRepairlogDto
.
setProcessAuditor
(
processAuditor
);
failureRepairlogDto
.
setProcessAuditorId
(
processAuditorId
);
failureRepairlogDto
.
setProcessDepartmentId
(
departmentId
);
failureRepairlogDto
.
setProcessTime
(
processTime
);
failureRepairlogDto
.
setProcessDepartment
(
processDepartment
);
failureRepairlogDto
.
setProcessResult
(
processResult
);
failureRepairlogDto
.
setProcessAuditorCid
(
processVerifyorCid
);
failureRepairlogService
.
createWithModel
(
failureRepairlogDto
);
if
(
ObjectUtils
.
isNotEmpty
(
failureRepairlogDto
))
{
return
true
;
}
return
false
;
}
/**
* 根据FaultId查询
*/
public
List
<
FailureVerify
>
findByfaultId
(
Long
faultId
)
{
Page
<
FailureVerify
>
page
=
new
Page
<>();
QueryWrapper
<
FailureVerify
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"fault_id"
,
faultId
).
orderByDesc
(
"verify_time"
);
return
baseMapper
.
selectList
(
queryWrapper
);
}
public
FailureVerify
findByFaultId
(
Long
faultId
)
{
LambdaQueryWrapper
<
FailureVerify
>
wrapper
=
new
LambdaQueryWrapper
<
FailureVerify
>();
wrapper
.
eq
(
FailureVerify:
:
getIsDelete
,
false
);
wrapper
.
eq
(
FailureVerify:
:
getFaultId
,
faultId
);
wrapper
.
orderByAsc
(
FailureVerify:
:
getVerifyTime
);
wrapper
.
last
(
"LIMIT 1"
);
return
this
.
baseMapper
.
selectOne
(
wrapper
);
}
}
\ No newline at end of file
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