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
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
618 additions
and
134 deletions
+618
-134
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
+0
-0
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
This diff is collapsed.
Click to expand it.
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