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
d5da3cb6
Commit
d5da3cb6
authored
Aug 17, 2021
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
补充代码
parent
9957995b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
38 deletions
+46
-38
FailureMaintainDto.java
...n/amos/boot/module/common/api/dto/FailureMaintainDto.java
+2
-2
Constants.java
...ejoin/amos/boot/module/common/biz/constats/Constants.java
+1
-0
FailureDetailsServiceImpl.java
...le/common/biz/service/impl/FailureDetailsServiceImpl.java
+1
-1
FailureMaintainServiceImpl.java
...e/common/biz/service/impl/FailureMaintainServiceImpl.java
+42
-35
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/FailureMaintainDto.java
View file @
d5da3cb6
...
...
@@ -32,7 +32,7 @@ public class FailureMaintainDto extends BaseDto {
private
Long
maintainPhone
;
@ApiModelProperty
(
value
=
"所属部门ID"
)
private
Stri
ng
bizId
;
private
Lo
ng
bizId
;
@ApiModelProperty
(
value
=
"所属部门"
)
private
String
department
;
...
...
@@ -52,7 +52,7 @@ public class FailureMaintainDto extends BaseDto {
@ApiModelProperty
(
value
=
"附件"
)
private
List
<
SourceFile
>
attachment
;
@ApiModelProperty
(
value
=
"审核结果条件判断,0
同意,1拒绝,2驳回
"
)
@ApiModelProperty
(
value
=
"审核结果条件判断,0
完成,1保存
"
)
private
String
condition
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/constats/Constants.java
View file @
d5da3cb6
...
...
@@ -14,5 +14,6 @@ public class Constants {
currentStatusNameMap
.
put
(
3
,
"待验收"
);
currentStatusNameMap
.
put
(
4
,
"已拒绝"
);
currentStatusNameMap
.
put
(
5
,
"已完结"
);
currentStatusNameMap
.
put
(
6
,
"维修中"
);
}
}
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 @
d5da3cb6
...
...
@@ -526,7 +526,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
}
public
static
String
buildOrderNo
()
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy
MMddHHmm
ss"
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy
-MM-dd HH:mm:
ss"
);
String
newDate
=
sdf
.
format
(
new
Date
());
String
result
=
""
;
Random
random
=
new
Random
();
...
...
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 @
d5da3cb6
...
...
@@ -46,6 +46,8 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
FailureMaintainServiceImpl
.
class
);
private
static
String
[]
MAINTENANCE_STATUS
=
{
"维修完成"
,
"维修中"
};
private
static
int
MAINTENANCE_COMPLETE
=
0
;
private
static
int
MAINTENANCE_ADD
=
1
;
private
static
String
[]
PROCESS_RESULT
=
{
"验证通过"
,
"验证未通过"
};
/**
...
...
@@ -66,43 +68,48 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
* 添加维修记录
*/
public
Object
savemodel
(
FailureMaintainDto
failureMaintainDto
,
ReginParams
userInfo
)
{
String
condition
=
failureMaintainDto
.
getCondition
();
int
conditionStatus
=
Integer
.
parseInt
(
condition
);
if
(
conditionStatus
==
MAINTENANCE_ADD
){
boolean
result
=
failureDetailsService
.
checkExcuteTaskAuth
(
failureMaintainDto
.
getFaultId
(),
userInfo
);
if
(!
result
){
return
false
;
}
try
{
failureMaintainDto
.
setMaintainMan
(
userInfo
.
getUserModel
().
getUserName
());
failureMaintainDto
.
setMaintainTime
(
new
Date
());
failureMaintainDto
.
setDepartment
(
userInfo
.
getDepartment
().
getDepartmentName
());
failureMaintainDto
.
setBizId
(
userInfo
.
getDepartment
().
getSequenceNbr
());
failureMaintainDto
.
setRecoreType
(
RECORE_TYPE
);
this
.
createWithModel
(
failureMaintainDto
);
//添加完成后修改保修单状态为待验收
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
failureMaintainDto
.
getFaultId
());
failureDetailsDto
.
setCurrentStatus
(
FailureStatuEnum
.
IN_MAINTENANCE
.
getCode
());
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
boolean
result
=
failureDetailsService
.
checkExcuteTaskAuth
(
failureMaintainDto
.
getFaultId
(),
userInfo
);
if
(!
result
){
return
false
;
}
try
{
failureMaintainDto
.
setMaintainMan
(
userInfo
.
getUserModel
().
getUserName
());
failureMaintainDto
.
setMaintainTime
(
new
Date
());
failureMaintainDto
.
setDepartment
(
userInfo
.
getDepartment
().
getDepartmentName
());
failureMaintainDto
.
setBizId
(
userInfo
.
getDepartment
().
getSequenceNbr
());
failureMaintainDto
.
setRecoreType
(
RECORE_TYPE
);
this
.
createWithModel
(
failureMaintainDto
);
//添加完成后修改保修单状态为待验收
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
failureMaintainDto
.
getFaultId
());
failureDetailsDto
.
setCurrentStatus
(
FailureStatuEnum
.
WAITING_ACCEPTANCE
.
getCode
());
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
//添加报修日志
String
processResult
=
MAINTENANCE_STATUS
[
1
];
//维修中
Integer
processAuditorId
=
Integer
.
parseInt
(
failureMaintainDto
.
getRecUserId
());
String
processAuditorCid
=
userInfo
.
getUserModel
().
getUserName
();
repairlog
(
failureMaintainDto
.
getFaultId
(),
failureMaintainDto
.
getMaintainMan
(),
processAuditorId
,
userInfo
.
getDepartment
().
getSequenceNbr
(),
failureMaintainDto
.
getMaintainTime
(),
failureMaintainDto
.
getDepartment
(),
processResult
,
processAuditorCid
);
if
(
ObjectUtils
.
isNotEmpty
(
failureMaintainDto
.
getAttachment
())){
sourceFileServiceImpl
.
saveSourceFile
(
failureMaintainDto
.
getSequenceNbr
(),
failureMaintainDto
.
getAttachment
());
//添加报修日志
String
processResult
=
MAINTENANCE_STATUS
[
1
];
//维修中
Integer
processAuditorId
=
Integer
.
parseInt
(
failureMaintainDto
.
getRecUserId
());
String
processAuditorCid
=
userInfo
.
getUserModel
().
getUserName
();
repairlog
(
failureMaintainDto
.
getFaultId
(),
failureMaintainDto
.
getMaintainMan
(),
processAuditorId
,
userInfo
.
getDepartment
().
getSequenceNbr
(),
failureMaintainDto
.
getMaintainTime
(),
failureMaintainDto
.
getDepartment
(),
processResult
,
processAuditorCid
);
if
(
ObjectUtils
.
isNotEmpty
(
failureMaintainDto
.
getAttachment
())){
sourceFileServiceImpl
.
saveSourceFile
(
failureMaintainDto
.
getSequenceNbr
(),
failureMaintainDto
.
getAttachment
());
}
failureDetailsService
.
excuteTask
(
failureMaintainDto
.
getFaultId
(),
userInfo
,
condition
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
e
.
printStackTrace
();
logger
.
info
(
"添加故障维修信息到数据库失败"
);
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
return
false
;
}
failureDetailsService
.
excuteTask
(
failureMaintainDto
.
getFaultId
(),
userInfo
,
failureMaintainDto
.
getCondition
());
}
catch
(
Exception
e
){
e
.
printStackTrace
();
e
.
printStackTrace
();
logger
.
info
(
"添加故障维修信息到数据库失败"
);
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
return
false
;
return
true
;
}
return
true
;
return
this
.
updateStatus
(
failureMaintainDto
,
userInfo
)
;
}
...
...
@@ -113,7 +120,7 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
public
Boolean
updateStatus
(
FailureMaintainDto
failureMaintainDto
,
ReginParams
userInfo
)
{
try
{
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
failureMaintainDto
.
getFaultId
());
failureDetailsDto
.
setCurrentStatus
(
FailureStatuEnum
.
IN_MAINTEN
ANCE
.
getCode
());
failureDetailsDto
.
setCurrentStatus
(
FailureStatuEnum
.
WAITING_ACCEPT
ANCE
.
getCode
());
this
.
updateWithModel
(
failureMaintainDto
);
//添加报修日志
...
...
@@ -133,7 +140,6 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
return
false
;
}
return
true
;
}
...
...
@@ -145,6 +151,7 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
boolean
result
=
failureDetailsService
.
checkExcuteTaskAuth
(
failureMaintainDto
.
getFaultId
(),
userInfo
);
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
failureMaintainDto
.
getFaultId
());
if
(
result
){
this
.
updateWithModel
(
failureMaintainDto
);
//根据status修改状态
String
processResult
=
new
String
();
...
...
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