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
88979a75
Commit
88979a75
authored
Aug 12, 2021
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*) 增加报修日志端口
parent
86ac4bcd
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
451 additions
and
76 deletions
+451
-76
FailureRepairlogDto.java
.../amos/boot/module/common/api/dto/FailureRepairlogDto.java
+39
-0
FailureRepairlog.java
.../amos/boot/module/common/api/entity/FailureRepairlog.java
+55
-0
FailureRepairlogMapper.java
...boot/module/common/api/mapper/FailureRepairlogMapper.java
+14
-0
IFailureRepairlogService.java
...t/module/common/api/service/IFailureRepairlogService.java
+12
-0
FailureRepairlogMapper.xml
...-api/src/main/resources/mapper/FailureRepairlogMapper.xml
+5
-0
FailureAuditController.java
.../module/common/biz/controller/FailureAuditController.java
+5
-2
FailureDetailsController.java
...odule/common/biz/controller/FailureDetailsController.java
+5
-5
FailureRepairlogController.java
...ule/common/biz/controller/FailureRepairlogController.java
+116
-0
FailureAuditServiceImpl.java
...dule/common/biz/service/impl/FailureAuditServiceImpl.java
+92
-62
FailureDetailsServiceImpl.java
...le/common/biz/service/impl/FailureDetailsServiceImpl.java
+56
-7
FailureMaintainServiceImpl.java
...e/common/biz/service/impl/FailureMaintainServiceImpl.java
+18
-0
FailureRepairlogServiceImpl.java
.../common/biz/service/impl/FailureRepairlogServiceImpl.java
+34
-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/FailureRepairlogDto.java
0 → 100644
View file @
88979a75
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-12
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"FailureRepairlogDto"
,
description
=
"流程日志"
)
public
class
FailureRepairlogDto
extends
BaseDto
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"流程处理人"
)
private
String
processAuditor
;
@ApiModelProperty
(
value
=
"处理人所属部门"
)
private
String
processDepartment
;
@ApiModelProperty
(
value
=
"流程处理结果"
)
private
String
processResult
;
@ApiModelProperty
(
value
=
"流程处理时间"
)
private
Date
processTime
;
@ApiModelProperty
(
value
=
"设备故障报修主表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/entity/FailureRepairlog.java
0 → 100644
View file @
88979a75
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-12
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"cb_failure_repairlog"
)
public
class
FailureRepairlog
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 流程处理人
*/
@TableField
(
"process_auditor"
)
private
String
processAuditor
;
/**
* 处理人所属部门
*/
@TableField
(
"process_department"
)
private
String
processDepartment
;
/**
* 流程处理结果
*/
@TableField
(
"process_result"
)
private
String
processResult
;
/**
* 流程处理时间
*/
@TableField
(
"process_time"
)
private
Date
processTime
;
/**
* 设备故障报修主表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/FailureRepairlogMapper.java
0 → 100644
View file @
88979a75
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
mapper
;
import
com.yeejoin.amos.boot.module.common.api.entity.FailureRepairlog
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* 流程日志 Mapper 接口
*
* @author system_generator
* @date 2021-08-12
*/
public
interface
FailureRepairlogMapper
extends
BaseMapper
<
FailureRepairlog
>
{
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/service/IFailureRepairlogService.java
0 → 100644
View file @
88979a75
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
service
;
/**
* 流程日志接口类
*
* @author system_generator
* @date 2021-08-12
*/
public
interface
IFailureRepairlogService
{
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/FailureRepairlogMapper.xml
0 → 100644
View file @
88979a75
<?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.FailureRepairlogMapper"
>
</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 @
88979a75
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
controller
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
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.biz.service.impl.FailureAuditServiceImpl
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -38,8 +40,9 @@ public class FailureAuditController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
public
ResponseModel
<
FailureAuditDto
>
save
(
@RequestBody
FailureAuditDto
model
)
{
model
=
failureAuditServiceImpl
.
savemodel
(
model
);
public
ResponseModel
<
FailureAuditDto
>
save
(
@RequestBody
FailureAuditDto
model
,
ReginParams
userInfo
)
throws
Exception
{
model
=
failureAuditServiceImpl
.
savemodel
(
model
,
userInfo
);
return
ResponseHelper
.
buildResponse
(
model
);
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/FailureDetailsController.java
View file @
88979a75
...
...
@@ -122,12 +122,12 @@ public class FailureDetailsController extends BaseController {
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"分页查询"
,
notes
=
"分页查询"
)
public
ResponseModel
<
Page
<
FailureDetailsDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
@RequestParam
Long
currentStatus
)
{
(
value
=
"size"
)
int
size
,
@RequestParam
Long
currentStatus
,
@RequestParam
Integer
type
)
{
Page
<
FailureDetailsDto
>
page
=
new
Page
<
FailureDetailsDto
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
final
AgencyUserModel
userInfo
=
getUserInfo
();
return
ResponseHelper
.
buildResponse
(
failureDetailsServiceImpl
.
queryForFailureDetailsPage
(
page
,
currentStatus
,
userInfo
));
return
ResponseHelper
.
buildResponse
(
failureDetailsServiceImpl
.
queryForFailureDetailsPage
(
page
,
currentStatus
,
userInfo
,
type
));
}
/**
...
...
@@ -167,11 +167,11 @@ public class FailureDetailsController extends BaseController {
return
ResponseHelper
.
buildResponse
(
failureDetailsServiceImpl
.
queryStatusCount
(
currentStatus
));
}
/**
/* */
/**
* 查询我提交状态任务数量
*
* @return
*/
*/
/*
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "查询我提交状态任务数量", notes = "查询我提交状态任务数量")
@GetMapping(value = "/list/userID")
...
...
@@ -182,6 +182,6 @@ public class FailureDetailsController extends BaseController {
page.setSize(size);
String userId = getUserInfo().getUserId();
return ResponseHelper.buildResponse(failureDetailsServiceImpl.queryForPage(page,userId));
}
}
*/
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/FailureRepairlogController.java
0 → 100644
View file @
88979a75
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
controller
;
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.FailureRepairlogServiceImpl
;
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.FailureRepairlogDto
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
/**
* 流程日志
*
* @author system_generator
* @date 2021-08-12
*/
@RestController
@Api
(
tags
=
"流程日志Api"
)
@RequestMapping
(
value
=
"/common/failure-repairlog"
)
public
class
FailureRepairlogController
extends
BaseController
{
@Autowired
FailureRepairlogServiceImpl
failureRepairlogServiceImpl
;
/**
* 新增流程日志
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增流程日志"
,
notes
=
"新增流程日志"
)
public
ResponseModel
<
FailureRepairlogDto
>
save
(
@RequestBody
FailureRepairlogDto
model
)
{
model
=
failureRepairlogServiceImpl
.
createWithModel
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新流程日志"
,
notes
=
"根据sequenceNbr更新流程日志"
)
public
ResponseModel
<
FailureRepairlogDto
>
updateBySequenceNbrFailureRepairlog
(
@RequestBody
FailureRepairlogDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
failureRepairlogServiceImpl
.
updateWithModel
(
model
));
}
/**
* 根据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
(
failureRepairlogServiceImpl
.
removeById
(
sequenceNbr
));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个流程日志"
,
notes
=
"根据sequenceNbr查询单个流程日志"
)
public
ResponseModel
<
FailureRepairlogDto
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
failureRepairlogServiceImpl
.
queryBySeq
(
sequenceNbr
));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"流程日志分页查询"
,
notes
=
"流程日志分页查询"
)
public
ResponseModel
<
Page
<
FailureRepairlogDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
Page
<
FailureRepairlogDto
>
page
=
new
Page
<
FailureRepairlogDto
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
failureRepairlogServiceImpl
.
queryForFailureRepairlogPage
(
page
));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"流程日志列表全部数据查询"
,
notes
=
"流程日志列表全部数据查询"
)
@GetMapping
(
value
=
"/list"
)
public
ResponseModel
<
List
<
FailureRepairlogDto
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
failureRepairlogServiceImpl
.
queryForFailureRepairlogList
());
}
}
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 @
88979a75
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
service
.
impl
;
import
java.util.Date
;
import
java.util.List
;
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.FailureRepairlogDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.FailureDetails
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
...
...
@@ -27,73 +31,100 @@ import com.yeejoin.amos.boot.module.common.api.service.IFailureAuditService;
*/
@Service
public
class
FailureAuditServiceImpl
extends
BaseService
<
FailureAuditDto
,
FailureAudit
,
FailureAuditMapper
>
implements
IFailureAuditService
{
@Autowired
FailureDetailsServiceImpl
failureDetailsService
;
// @Autowired
// RemoteWorkFlowService remoteWorkFlowService;
implements
IFailureAuditService
{
@Autowired
FailureDetailsServiceImpl
failureDetailsService
;
/**
* 分页查询
*/
public
Page
<
FailureAuditDto
>
queryForFailureAuditPage
(
Page
<
FailureAuditDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
}
@Autowired
FailureRepairlogServiceImpl
failureRepairlogService
;
/**
* 列表查询 示例
*/
public
List
<
FailureAuditDto
>
queryForFailureAuditList
(
)
{
return
this
.
queryForList
(
""
,
false
);
}
/**
* 分页查询
*/
public
Page
<
FailureAuditDto
>
queryForFailureAuditPage
(
Page
<
FailureAuditDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
}
/**
* 发起审核
*/
public
FailureAuditDto
savemodel
(
FailureAuditDto
model
)
{
/**
* 列表查询 示例
*/
public
List
<
FailureAuditDto
>
queryForFailureAuditList
()
{
return
this
.
queryForList
(
""
,
false
);
}
// remoteWorkFlowService.currentTask();
/**
* 发起审核
*/
public
FailureAuditDto
savemodel
(
FailureAuditDto
model
,
ReginParams
userInfo
)
throws
Exception
{
this
.
createWithModel
(
model
);
Integer
auditResult
=
model
.
getAuditResult
();
if
(
auditResult
.
equals
(
AuditResultEnum
.
AGREE
.
getCode
()))
{
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_MAINTAIN
.
getCode
(),
userInfo
);
}
else
if
(
auditResult
.
equals
(
AuditResultEnum
.
REFUSE
.
getCode
()))
{
updateStatus
(
model
,
FailureStatuEnum
.
REFUSE
.
getCode
(),
userInfo
);
}
else
if
(
auditResult
.
equals
(
AuditResultEnum
.
SEND_BACK
.
getCode
()))
{
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_SUBMIT
.
getCode
(),
userInfo
);
}
return
model
;
}
this
.
createWithModel
(
model
);
Integer
auditResult
=
model
.
getAuditResult
();
if
(
auditResult
.
equals
(
AuditResultEnum
.
AGREE
.
getCode
()))
{
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_MAINTAIN
.
getCode
());
}
else
if
(
auditResult
.
equals
(
AuditResultEnum
.
REFUSE
.
getCode
()))
{
updateStatus
(
model
,
FailureStatuEnum
.
REFUSE
.
getCode
());
}
else
if
(
auditResult
.
equals
(
AuditResultEnum
.
SEND_BACK
.
getCode
()))
{
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_SUBMIT
.
getCode
());
}
return
model
;
}
/**
* 修改故障保修单任务状态
*/
FailureDetailsDto
updateStatus
(
FailureAuditDto
model
,
Integer
status
,
ReginParams
userInfo
)
throws
Exception
{
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
model
.
getFaultId
());
failureDetailsDto
.
setCurrentStatus
(
status
);
failureDetailsDto
.
setSequenceNbr
(
model
.
getFaultId
());
String
condition
;
/**
* 修改故障保修单任务状态
*/
FailureDetailsDto
updateStatus
(
FailureAuditDto
model
,
Integer
status
)
{
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
model
.
getFaultId
());
failureDetailsDto
.
setCurrentStatus
(
status
);
failureDetailsDto
.
setSequenceNbr
(
model
.
getFaultId
());
return
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
}
//添加报修日志
Long
faultId
=
model
.
getFaultId
();
Date
processTime
=
model
.
getAuditTime
();
String
processDepartment
=
model
.
getAuditDepartment
();
String
processAuditor
=
model
.
getAuditor
();
if
(
status
.
equals
(
AuditResultEnum
.
AGREE
))
{
condition
=
AuditResultEnum
.
AGREE
.
getName
();
repairlog
(
faultId
,
processAuditor
,
processTime
,
processDepartment
,
condition
);
}
condition
=
AuditResultEnum
.
REFUSE
.
getName
();
repairlog
(
faultId
,
processAuditor
,
processTime
,
processDepartment
,
condition
);
/**
* 根据FaultId查询
*/
public
List
<
FailureAudit
>
findByfaultId
(
Long
faultId
)
{
Page
<
FailureAudit
>
page
=
new
Page
<>();
QueryWrapper
<
FailureAudit
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"fault_id"
,
faultId
).
orderByDesc
(
"submission_time"
);
return
baseMapper
.
selectList
(
queryWrapper
);
}
failureDetailsService
.
excuteTask
(
failureDetailsDto
.
getProcessId
(),
userInfo
,
condition
);
Object
nextTaskGroupName
=
failureDetailsService
.
getNextTaskGroupName
(
failureDetailsDto
.
getProcessId
());
failureDetailsDto
.
setCurrentRole
(
nextTaskGroupName
.
toString
());
return
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
}
/**
* 添加报修日志
*/
public
void
repairlog
(
Long
faultId
,
String
processAuditor
,
Date
processTime
,
String
processDepartment
,
String
processResult
)
{
FailureRepairlogDto
failureRepairlogDto
=
new
FailureRepairlogDto
();
failureRepairlogDto
.
setFaultId
(
faultId
);
failureRepairlogDto
.
setProcessAuditor
(
processAuditor
);
failureRepairlogDto
.
setProcessTime
(
processTime
);
failureRepairlogDto
.
setProcessDepartment
(
processDepartment
);
failureRepairlogDto
.
setProcessResult
(
processResult
);
failureRepairlogService
.
createWithModel
(
failureRepairlogDto
);
}
/**
* 根据FaultId查询
*/
public
List
<
FailureAudit
>
findByfaultId
(
Long
faultId
)
{
Page
<
FailureAudit
>
page
=
new
Page
<>();
QueryWrapper
<
FailureAudit
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"fault_id"
,
faultId
).
orderByDesc
(
"submission_time"
);
return
baseMapper
.
selectList
(
queryWrapper
);
}
public
FailureAudit
findByFaultId
(
Long
faultId
)
{
LambdaQueryWrapper
<
FailureAudit
>
wrapper
=
new
LambdaQueryWrapper
<
FailureAudit
>();
wrapper
.
eq
(
FailureAudit:
:
getIsDelete
,
false
);
wrapper
.
eq
(
FailureAudit:
:
getFaultId
,
faultId
);
wrapper
.
orderByAsc
(
FailureAudit:
:
getAuditTime
);
wrapper
.
last
(
"LIMIT 1"
);
return
this
.
baseMapper
.
selectOne
(
wrapper
);
}
public
FailureAudit
findByFaultId
(
Long
faultId
)
{
LambdaQueryWrapper
<
FailureAudit
>
wrapper
=
new
LambdaQueryWrapper
<
FailureAudit
>();
wrapper
.
eq
(
FailureAudit:
:
getIsDelete
,
false
);
wrapper
.
eq
(
FailureAudit:
:
getFaultId
,
faultId
);
wrapper
.
orderByAsc
(
FailureAudit:
:
getAuditTime
);
wrapper
.
last
(
"LIMIT 1"
);
return
this
.
baseMapper
.
selectOne
(
wrapper
);
}
}
\ No newline at end of file
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/FailureDetailsServiceImpl.java
View file @
88979a75
...
...
@@ -7,6 +7,7 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Random
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureRepairlogDto
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -59,28 +60,44 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
@Autowired
IFailureAuditService
failureAuditService
;
@Autowired
FailureRepairlogServiceImpl
failureRepairlogService
;
public
static
String
EMERGENCY_COMMAND
=
"应急指挥科"
;
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
FailureDetailsServiceImpl
.
class
);
public
static
Integer
SELECY_ALL
=
6
;
public
static
Integer
SELECY_STATUS
=
7
;
public
static
Integer
SELECY_ISUBMIT
=
8
;
/**
* 分页查询
*/
public
Page
<
FailureDetailsDto
>
queryForFailureDetailsPage
(
Page
<
FailureDetailsDto
>
page
,
Long
currentStatus
,
AgencyUserModel
userInfo
)
{
if
(
currentStatus
==
null
){
public
Page
<
FailureDetailsDto
>
queryForFailureDetailsPage
(
Page
<
FailureDetailsDto
>
page
,
Long
currentStatus
,
AgencyUserModel
userInfo
,
Integer
type
)
{
if
(
currentStatus
==
null
||
type
.
equals
(
SELECY_ALL
)){
return
this
.
queryForPage
(
page
,
"submission_time"
,
true
);
}
if
(
type
.
equals
(
SELECY_ISUBMIT
))
{
if
(
currentStatus
==
null
||
ObjectUtils
.
isNotEmpty
(
userInfo
))
{
String
submissionPid
=
userInfo
.
getUserId
();
queryForPage
(
page
,
submissionPid
);
}
return
null
;
}
return
this
.
queryForPage
(
page
,
"submission_time"
,
true
,
currentStatus
);
}
/**
* 我发起分页查询
*/
public
Page
<
FailureDetailsDto
>
queryForPage
(
Page
<
FailureDetailsDto
>
page
,
String
userI
d
)
{
if
(
userI
d
==
null
){
public
Page
<
FailureDetailsDto
>
queryForPage
(
Page
<
FailureDetailsDto
>
page
,
String
submissionPi
d
)
{
if
(
submissionPi
d
==
null
){
return
null
;
}
return
this
.
queryForPage
(
page
,
"submission_time"
,
true
,
userI
d
);
return
this
.
queryForPage
(
page
,
"submission_time"
,
true
,
submissionPi
d
);
}
/**
...
...
@@ -101,6 +118,15 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
}
/**
* 流程日志
*/
public
List
<
Map
>
repairLog
(
Long
currentStatus
)
{
return
null
;
}
/**
* 查询任务状态数量
*/
public
Integer
queryStatusCount
(
Long
currentStatus
)
{
...
...
@@ -139,13 +165,20 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
failureDetailsDto
.
getAttachment
());
}
/*failureDetailsDto.set*/
//发起主表流程 并添加至报修日志
model
=
this
.
createWithModel
(
failureDetailsDto
);
Long
faultId
=
model
.
getSequenceNbr
();
String
processAuditor
=
model
.
getRecUserName
();
String
processResult
=
"提交报修单"
;
String
processDepartment
=
null
;
Date
processTime
=
model
.
getSubmissionTime
();
repairlog
(
faultId
,
processAuditor
,
processTime
,
processDepartment
,
processResult
);
FailureAuditDto
failureAuditDto
=
new
FailureAuditDto
();
failureAuditDto
.
setAuditor
(
model
.
getRecUserName
());
failureAuditDto
.
setFaultId
(
model
.
getSequenceNbr
());
failureAuditDto
.
setAuditOpinion
(
"已发起"
);
failureAuditServiceImpl
.
savemodel
(
failureAuditDto
);
failureAuditServiceImpl
.
savemodel
(
failureAuditDto
,
null
);
}
catch
(
Exception
e
)
{
logger
.
info
(
"添加故障维修信息到数据库失败"
);
return
false
;
...
...
@@ -157,6 +190,19 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
return
true
;
}
/**
* 添加报修日志
*/
public
void
repairlog
(
Long
faultId
,
String
processAuditor
,
Date
processTime
,
String
processDepartment
,
String
processResult
)
{
FailureRepairlogDto
failureRepairlogDto
=
new
FailureRepairlogDto
();
failureRepairlogDto
.
setFaultId
(
faultId
);
failureRepairlogDto
.
setProcessAuditor
(
processAuditor
);
failureRepairlogDto
.
setProcessTime
(
processTime
);
failureRepairlogDto
.
setProcessDepartment
(
processDepartment
);
failureRepairlogDto
.
setProcessResult
(
processResult
);
failureRepairlogService
.
createWithModel
(
failureRepairlogDto
);
}
public
boolean
excuteTask
(
Long
sequenceNbr
,
ReginParams
userInfo
,
String
condition
)
{
HashMap
<
String
,
Object
>
conditionMap
=
new
HashMap
<
String
,
Object
>();
conditionMap
.
put
(
"condition"
,
condition
);
...
...
@@ -270,7 +316,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
String
currentLoginUserRole
=
userInfo
.
getRole
().
getRoleName
();
LambdaQueryWrapper
<
FailureDetails
>
wrapper
=
new
LambdaQueryWrapper
<
FailureDetails
>();
String
[]
arr
=
{
"结束"
,
"拒绝"
};
wrapper
.
like
Right
(
FailureDetails:
:
getCurrentRole
,
currentLoginUserRole
);
wrapper
.
like
(
FailureDetails:
:
getCurrentRole
,
currentLoginUserRole
);
wrapper
.
notIn
(
FailureDetails:
:
getCurrentStatus
,
arr
);
//根据当前用户的执行角色来获取所有的任务
List
<
FailureDetails
>
list
=
this
.
baseMapper
.
selectList
(
wrapper
);
...
...
@@ -319,4 +365,6 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
}
return
newDate
+
result
;
}
}
\ No newline at end of file
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/FailureMaintainServiceImpl.java
View file @
88979a75
...
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureMaintainDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureRepairlogDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.FailureAudit
;
import
com.yeejoin.amos.boot.module.common.api.entity.FailureMaintain
;
import
com.yeejoin.amos.boot.module.common.api.enums.AuditResultEnum
;
...
...
@@ -14,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
java.util.Date
;
import
java.util.List
;
/**
...
...
@@ -28,6 +30,8 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
SourceFileServiceImpl
sourceFileServiceImpl
;
@Autowired
FailureDetailsServiceImpl
failureDetailsService
;
@Autowired
FailureRepairlogServiceImpl
failureRepairlogService
;
/**
* 分页查询
...
...
@@ -94,4 +98,17 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
// TODO Auto-generated method stub
return
null
;
}
/**
* 添加报修日志
*/
public
void
repairlog
(
Long
faultId
,
String
processAuditor
,
Date
processTime
,
String
processDepartment
,
String
processResult
)
{
FailureRepairlogDto
failureRepairlogDto
=
new
FailureRepairlogDto
();
failureRepairlogDto
.
setFaultId
(
faultId
);
failureRepairlogDto
.
setProcessAuditor
(
processAuditor
);
failureRepairlogDto
.
setProcessTime
(
processTime
);
failureRepairlogDto
.
setProcessDepartment
(
processDepartment
);
failureRepairlogDto
.
setProcessResult
(
processResult
);
failureRepairlogService
.
createWithModel
(
failureRepairlogDto
);
}
}
\ No newline at end of file
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/FailureRepairlogServiceImpl.java
0 → 100644
View file @
88979a75
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
service
.
impl
;
import
com.yeejoin.amos.boot.module.common.api.entity.FailureRepairlog
;
import
com.yeejoin.amos.boot.module.common.api.mapper.FailureRepairlogMapper
;
import
com.yeejoin.amos.boot.module.common.api.service.IFailureRepairlogService
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureRepairlogDto
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
java.util.List
;
/**
* 流程日志服务实现类
*
* @author system_generator
* @date 2021-08-12
*/
@Service
public
class
FailureRepairlogServiceImpl
extends
BaseService
<
FailureRepairlogDto
,
FailureRepairlog
,
FailureRepairlogMapper
>
implements
IFailureRepairlogService
{
/**
* 分页查询
*/
public
Page
<
FailureRepairlogDto
>
queryForFailureRepairlogPage
(
Page
<
FailureRepairlogDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
}
/**
* 列表查询 示例
*/
public
List
<
FailureRepairlogDto
>
queryForFailureRepairlogList
()
{
return
this
.
queryForList
(
""
,
false
);
}
}
\ 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