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
1a8ff43c
Commit
1a8ff43c
authored
Aug 13, 2021
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改代码
parent
bb89e684
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
90 additions
and
34 deletions
+90
-34
FailureDetailsController.java
...odule/common/biz/controller/FailureDetailsController.java
+18
-14
FailureAuditServiceImpl.java
...dule/common/biz/service/impl/FailureAuditServiceImpl.java
+4
-0
FailureDetailsServiceImpl.java
...le/common/biz/service/impl/FailureDetailsServiceImpl.java
+68
-20
No files found.
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 @
1a8ff43c
...
@@ -4,6 +4,8 @@ import java.util.List;
...
@@ -4,6 +4,8 @@ import java.util.List;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureStatusCountDto
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -17,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestBody;
...
@@ -17,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
...
@@ -60,7 +63,7 @@ public class FailureDetailsController extends BaseController {
...
@@ -60,7 +63,7 @@ public class FailureDetailsController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
public
ResponseModel
<
Object
>
save
(
@RequestBody
FailureDetailsDto
model
)
{
public
ResponseModel
<
Object
>
save
(
@RequestBody
FailureDetailsDto
model
)
{
Object
result
;
Object
result
;
try
{
try
{
result
=
failureDetailsServiceImpl
.
savemodel
(
model
,
getSelectedOrgInfo
());
result
=
failureDetailsServiceImpl
.
savemodel
(
model
,
getSelectedOrgInfo
());
...
@@ -123,12 +126,12 @@ public class FailureDetailsController extends BaseController {
...
@@ -123,12 +126,12 @@ public class FailureDetailsController extends BaseController {
@GetMapping
(
value
=
"/page"
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"分页查询"
,
notes
=
"分页查询"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"分页查询"
,
notes
=
"分页查询"
)
public
ResponseModel
<
Page
<
FailureDetailsDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
public
ResponseModel
<
Page
<
FailureDetailsDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
@RequestParam
Long
currentStatus
,
@RequestParam
Integer
type
)
{
(
value
=
"size"
)
int
size
,
@RequestParam
Integer
type
)
{
Page
<
FailureDetailsDto
>
page
=
new
Page
<
FailureDetailsDto
>();
Page
<
FailureDetailsDto
>
page
=
new
Page
<
FailureDetailsDto
>();
page
.
setCurrent
(
current
);
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
page
.
setSize
(
size
);
final
AgencyUserModel
userInfo
=
getUserInfo
();
final
AgencyUserModel
userInfo
=
getUserInfo
();
return
ResponseHelper
.
buildResponse
(
failureDetailsServiceImpl
.
queryForFailureDetailsPage
(
page
,
currentStatus
,
userInfo
,
type
));
return
ResponseHelper
.
buildResponse
(
failureDetailsServiceImpl
.
queryForFailureDetailsPage
(
page
,
userInfo
,
type
));
}
}
/**
/**
...
@@ -163,27 +166,28 @@ public class FailureDetailsController extends BaseController {
...
@@ -163,27 +166,28 @@ public class FailureDetailsController extends BaseController {
*/
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询当前状态任务数量"
,
notes
=
"查询当前状态任务数量"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询当前状态任务数量"
,
notes
=
"查询当前状态任务数量"
)
@GetMapping
(
value
=
"/list/count
/{currentStatus}
"
)
@GetMapping
(
value
=
"/list/count"
)
public
ResponseModel
<
Integer
>
selectStatusCount
(
@RequestParam
Long
currentStatus
)
{
public
ResponseModel
<
List
<
FailureStatusCountDto
>>
selectStatusCount
(
@RequestParam
Integer
type
)
{
return
ResponseHelper
.
buildResponse
(
failureDetailsServiceImpl
.
queryStatusCount
(
currentStatus
));
return
ResponseHelper
.
buildResponse
(
failureDetailsServiceImpl
.
queryStatusCount
(
type
));
}
}
/* *//**
/* *//**
c
*
查询我提交状态任务数量
*
待处理Test
*
*
* @return
* @return
*//*
/* *//**/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation(httpMethod = "GET",value = "
查询我提交状态任务数量", notes = "查询我提交状态任务数量
")
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"
待处理"
,
notes
=
"待处理
"
)
@GetMapping(value = "/list/
userID
")
@GetMapping
(
value
=
"/list/
daichuli
"
)
public
ResponseModel
<
Page
<
FailureDetailsDto
>>
selectISubmit
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
public
ResponseModel
<
Page
<
FailureDetailsDto
>>
selectISubmit
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(value = "size") int size) {
(
value
=
"size"
)
int
size
,
@RequestParam
Long
currentStatus
)
{
Page
<
FailureDetailsDto
>
page
=
new
Page
<
FailureDetailsDto
>();
Page
<
FailureDetailsDto
>
page
=
new
Page
<
FailureDetailsDto
>();
page
.
setCurrent
(
current
);
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
page
.
setSize
(
size
);
String
userId
=
getUserInfo
().
getUserId
();
String
userId
=
getUserInfo
().
getUserId
();
return ResponseHelper.buildResponse(failureDetailsServiceImpl.queryForPage(page,userId));
return
ResponseHelper
.
buildResponse
(
failureDetailsServiceImpl
.
queryForMe
(
page
,
userId
,
currentStatus
));
}*/
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"流程信息"
,
notes
=
"流程信息"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"流程信息"
,
notes
=
"流程信息"
)
@GetMapping
(
value
=
"/processHistory"
)
@GetMapping
(
value
=
"/processHistory"
)
...
...
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 @
1a8ff43c
...
@@ -5,6 +5,7 @@ import java.util.List;
...
@@ -5,6 +5,7 @@ import java.util.List;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
@@ -52,6 +53,7 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
...
@@ -52,6 +53,7 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
/**
/**
* 发起审核
* 发起审核
*/
*/
@Transactional
public
FailureAuditDto
savemodel
(
FailureAuditDto
model
,
ReginParams
userInfo
)
throws
Exception
{
public
FailureAuditDto
savemodel
(
FailureAuditDto
model
,
ReginParams
userInfo
)
throws
Exception
{
if
(
model
.
getAuditResult
().
equals
(
5
))
{
if
(
model
.
getAuditResult
().
equals
(
5
))
{
...
@@ -75,6 +77,7 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
...
@@ -75,6 +77,7 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
/**
/**
* 修改故障保修单任务状态
* 修改故障保修单任务状态
*/
*/
@Transactional
FailureDetailsDto
updateStatus
(
FailureAuditDto
model
,
Integer
status
,
ReginParams
userInfo
)
throws
Exception
{
FailureDetailsDto
updateStatus
(
FailureAuditDto
model
,
Integer
status
,
ReginParams
userInfo
)
throws
Exception
{
failureDetailsService
.
checkExcuteTaskAuthMap
(
model
.
getSequenceNbr
(),
userInfo
);
failureDetailsService
.
checkExcuteTaskAuthMap
(
model
.
getSequenceNbr
(),
userInfo
);
...
@@ -104,6 +107,7 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
...
@@ -104,6 +107,7 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
/**
/**
* 添加报修日志
* 添加报修日志
*/
*/
@Transactional
public
void
repairlog
(
Long
faultId
,
String
processAuditor
,
Date
processTime
,
String
processDepartment
,
String
processResult
)
{
public
void
repairlog
(
Long
faultId
,
String
processAuditor
,
Date
processTime
,
String
processDepartment
,
String
processResult
)
{
FailureRepairlogDto
failureRepairlogDto
=
new
FailureRepairlogDto
();
FailureRepairlogDto
failureRepairlogDto
=
new
FailureRepairlogDto
();
failureRepairlogDto
.
setFaultId
(
faultId
);
failureRepairlogDto
.
setFaultId
(
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/FailureDetailsServiceImpl.java
View file @
1a8ff43c
...
@@ -8,6 +8,7 @@ import java.util.List;
...
@@ -8,6 +8,7 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Random
;
import
java.util.Random
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureStatusCountDto
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -87,32 +88,43 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -87,32 +88,43 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
return
this
.
queryForPage
(
page
,
"submission_time"
,
true
,
currentStatus
);
return
this
.
queryForPage
(
page
,
"submission_time"
,
true
,
currentStatus
);
}
}
public
Page
<
FailureDetailsDto
>
queryForFailureDetailsPage
(
Page
<
FailureDetailsDto
>
page
,
Long
currentStatus
,
public
Page
<
FailureDetailsDto
>
queryForFailureDetailsPage
(
Page
<
FailureDetailsDto
>
page
,
AgencyUserModel
userInfo
,
Integer
type
)
{
AgencyUserModel
userInfo
,
Integer
type
)
{
if
(
currentStatus
==
null
||
type
.
equals
(
SELECY_ALL
)
)
{
if
(
type
.
equals
(
SELECY_ALL
)
)
{
return
this
.
queryForPage
(
page
,
"submission_time"
,
true
);
return
this
.
queryForPage
(
page
,
"submission_time"
,
true
);
}
}
if
(
type
.
equals
(
SELECY_ISUBMIT
))
{
if
(
type
.
equals
(
SELECY_ISUBMIT
))
{
if
(
currentStatus
==
null
||
ObjectUtils
.
isNotEmpty
(
userInfo
))
{
if
(
ObjectUtils
.
isNotEmpty
(
userInfo
))
{
String
submissionPid
=
userInfo
.
getUserId
();
String
submissionPid
=
userInfo
.
getUserId
();
queryForPage
(
page
,
submissionPid
);
return
queryForPage
(
page
,
submissionPid
);
}
}
return
null
;
}
}
return
this
.
queryForPage
(
page
,
"submission_time"
,
true
,
currentStatus
);
return
this
.
queryForPage
(
page
,
"submission_time"
,
true
);
}
}
/**
/**
* 我发起分页查询
* 我发起分页查询
*/
*/
public
Page
<
FailureDetailsDto
>
queryForPage
(
Page
<
FailureDetailsDto
>
page
,
String
userId
)
{
public
Page
<
FailureDetailsDto
>
queryForPage
(
Page
<
FailureDetailsDto
>
page
,
String
submissionPid
)
{
if
(
submissionPid
==
null
)
{
return
null
;
}
return
this
.
queryForPage
(
page
,
"submission_time"
,
true
,
submissionPid
);
}
/**
* 待处理分页查询
*/
public
Page
<
FailureDetailsDto
>
queryForMe
(
Page
<
FailureDetailsDto
>
page
,
String
userId
,
Long
currentStatus
)
{
if
(
userId
==
null
)
{
if
(
userId
==
null
)
{
return
null
;
return
null
;
}
}
return
this
.
queryForPage
(
page
,
"submission_time"
,
true
,
userId
);
return
this
.
queryForPage
(
page
,
"submission_time"
,
true
,
userId
,
currentStatus
);
}
}
/**
/**
* 列表查询 示例
* 列表查询 示例
*/
*/
...
@@ -130,21 +142,57 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -130,21 +142,57 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
}
}
/**
* 流程日志
*/
public
List
<
Map
>
repairLog
(
Long
currentStatus
)
{
return
null
;
}
/**
/**
* 查询任务状态数量
* 查询任务状态数量
*/
*/
public
Integer
queryStatusCount
(
Long
currentStatus
)
{
public
List
<
FailureStatusCountDto
>
queryStatusCount
(
Integer
type
)
{
QueryWrapper
<
FailureDetails
>
queryWrapper
=
new
QueryWrapper
<>();
List
<
FailureDetailsDto
>
failureDetailsDtos
=
new
ArrayList
<>();
queryWrapper
.
eq
(
"current_status"
,
currentStatus
);
if
(
type
.
equals
(
SELECY_ALL
))
{
return
baseMapper
.
selectCount
(
queryWrapper
);
failureDetailsDtos
=
this
.
queryForFailureDetailsList
();
}
if
(
type
.
equals
(
SELECY_ISUBMIT
))
{
failureDetailsDtos
=
this
.
queryForFailureDetailsList
();
}
int
auditStatus
=
0
;
int
submitStatus
=
0
;
int
maintainStatus
=
0
;
int
acceptanceStatus
=
0
;
int
refuseStatus
=
0
;
int
finishStatus
=
0
;
List
<
FailureStatusCountDto
>
list
=
new
ArrayList
<>();
String
[]
statusName
={
"待审核"
,
"待提交"
,
"待维修"
,
"待验收"
,
"已拒绝"
,
"已完结"
};
for
(
int
i
=
0
;
i
<
failureDetailsDtos
.
size
();
i
++)
{
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
WAITING_AUDIT
.
getCode
())){
auditStatus
++;
}
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
WAITING_SUBMIT
.
getCode
())){
submitStatus
++;
}
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
WAITING_MAINTAIN
.
getCode
())){
maintainStatus
++;
}
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
WAITING_ACCEPTANCE
.
getCode
())){
acceptanceStatus
++;
}
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
REFUSE
.
getCode
())){
refuseStatus
++;
}
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
FINISH
.
getCode
())){
finishStatus
++;
}
int
[]
statusCount
=
{
auditStatus
,
submitStatus
,
maintainStatus
,
acceptanceStatus
,
refuseStatus
,
finishStatus
};
for
(
int
j
=
0
;
j
<
5
;
j
++)
{
FailureStatusCountDto
statusCountDto
=
new
FailureStatusCountDto
();
statusCountDto
.
setStatus
(
statusName
[
i
]);
statusCountDto
.
setCount
(
statusCount
[
i
]);
list
.
add
(
statusCountDto
);
}
}
return
list
;
}
}
/**
/**
...
@@ -182,7 +230,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -182,7 +230,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
Long
faultId
=
model
.
getSequenceNbr
();
Long
faultId
=
model
.
getSequenceNbr
();
String
processAuditor
=
model
.
getRecUserName
();
String
processAuditor
=
model
.
getRecUserName
();
String
processResult
=
"提交报修单"
;
String
processResult
=
"提交报修单"
;
String
processDepartment
=
"1111"
;
String
processDepartment
=
userInfo
.
getDepartment
().
getDepartmentName
()
;
Date
processTime
=
model
.
getSubmissionTime
();
Date
processTime
=
model
.
getSubmissionTime
();
repairlog
(
faultId
,
processAuditor
,
processTime
,
processDepartment
,
processResult
);
repairlog
(
faultId
,
processAuditor
,
processTime
,
processDepartment
,
processResult
);
...
...
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