Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
csbr-daop
/
ms-data-circulation-portal-service
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
b481e3f8
authored
2024-12-31 19:11:05 +0800
by
肖初晴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
【DAOP-1.0】服务商维护
【功能点】功能开发
1 parent
93798d0e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
24 deletions
src/main/java/com/csbr/qingcloud/portal/domain/vo/ServicerMaintainQueryVO.java
src/main/java/com/csbr/qingcloud/portal/domain/vo/ServicerMaintainRQVO.java
src/main/java/com/csbr/qingcloud/portal/service/impl/ServicerMaintainServiceImpl.java
src/main/java/com/csbr/qingcloud/portal/domain/vo/ServicerMaintainQueryVO.java
View file @
b481e3f
package
com
.
csbr
.
qingcloud
.
portal
.
domain
.
vo
;
import
com.csbr.cloud.mybatis.annotations.LikeQuery
;
import
com.csbr.cloud.mybatis.enums.LikeQueryEnum
;
import
com.csbr.cloud.workflow.domain.dto.appove.FlowBizGuidQueryDTO
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.EqualsAndHashCode
;
...
...
@@ -17,7 +19,11 @@ import java.util.List;
@Data
@Schema
(
title
=
"服务商维护查询参数"
)
public
class
ServicerMaintainQueryVO
extends
FlowBizGuidQueryDTO
{
@Schema
(
description
=
"公司名称"
)
@LikeQuery
(
type
=
LikeQueryEnum
.
ALL
)
private
String
tenantName
;
/**
* 业务审批状态【N 草稿中,A 审批中,Y 已通过,R 驳回,C 已撤销,D 已废弃】
*/
...
...
src/main/java/com/csbr/qingcloud/portal/domain/vo/ServicerMaintainRQVO.java
View file @
b481e3f
...
...
@@ -56,7 +56,7 @@ public class ServicerMaintainRQVO extends FlowRQBaseVO {
/**
* 业务审批状态【N 草稿中,A 审批中,Y 已通过,R 驳回,C 已撤销,D 已废弃; 默认 N】
*/
@Schema
(
description
=
"业务审批状态【N 草稿中,A 审批中,Y 已通过,R 驳回,C 已撤销,D 已废弃; 默认 N】"
)
@Schema
(
description
=
"业务审批状态
(传Y表示不走审批流)
【N 草稿中,A 审批中,Y 已通过,R 驳回,C 已撤销,D 已废弃; 默认 N】"
)
private
String
bizApproveState
;
/**
...
...
src/main/java/com/csbr/qingcloud/portal/service/impl/ServicerMaintainServiceImpl.java
View file @
b481e3f
package
com
.
csbr
.
qingcloud
.
portal
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.csbr.cloud.common.enums.SystemError
;
import
com.csbr.cloud.common.enums.WorkFlowBizEnum
;
import
com.csbr.qingcloud.portal.mybatis.entity.MfServicerMaintainDetail
;
import
com.csbr.qingcloud.portal.mybatis.service.MfServicerMaintainDetailService
;
import
csbr.cloud.entity.enums.ApprovalStateEnum
;
import
com.csbr.cloud.common.exception.CsbrSystemException
;
import
com.csbr.cloud.common.util.CommonUtil
;
...
...
@@ -57,6 +60,9 @@ public class ServicerMaintainServiceImpl extends FlowAbstractImpl implements Ser
private
MfServicerMaintainService
mfServicerMaintainService
;
@Resource
private
MfServicerMaintainDetailService
mfServicerMaintainDetailService
;
@Resource
private
CsbrBeanUtil
csbrBeanUtil
;
@Resource
...
...
@@ -123,9 +129,11 @@ public class ServicerMaintainServiceImpl extends FlowAbstractImpl implements Ser
ServicerMaintainRQVO
rqVO
=
(
ServicerMaintainRQVO
)
flowBaseVO
;
beforeSave
(
rqVO
);
MfServicerMaintain
entity
=
convertToEntity
(
rqVO
);
// 发起审批流程或保存草稿
AddApprovalDTO
approvalDTO
=
getAddApprovalDTO
(
entity
);
super
.
startWorkFlow
(
rqVO
,
approvalDTO
,
entity:
:
setBizApproveState
);
if
(!
"Y"
.
equals
(
rqVO
.
getBizApproveState
())){
// 发起审批流程或保存草稿
AddApprovalDTO
approvalDTO
=
getAddApprovalDTO
(
entity
);
super
.
startWorkFlow
(
rqVO
,
approvalDTO
,
entity:
:
setBizApproveState
);
}
// 业务数据保存
boolean
flag
=
mfServicerMaintainService
.
save
(
entity
);
if
(!
flag
)
{
...
...
@@ -151,13 +159,7 @@ public class ServicerMaintainServiceImpl extends FlowAbstractImpl implements Ser
// MfServicerMaintain oldEntity = mfServicerMaintainService.getById(rqVO.getGuid());
beforeUpdate
(
rqVO
);
MfServicerMaintain
entity
=
convertToEntity
(
rqVO
);
// 发起审批流程或保存草稿
AddApprovalDTO
approvalDTO
=
getAddApprovalDTO
(
entity
);
super
.
startOrRestartWorkFlow
(
rqVO
,
rqVO
.
getBizApproveState
(),
approvalDTO
,
entity:
:
setBizApproveState
);
if
(
rqVO
.
getIsRestart
())
{
// 重新提交
againSubmitFlow
(
entity
,
rqVO
,
approvalDTO
);
}
else
{
if
(
"Y"
.
equals
(
rqVO
.
getBizApproveState
())){
// 修改业务数据
boolean
flag
=
mfServicerMaintainService
.
updateById
(
entity
);
if
(!
flag
)
{
...
...
@@ -166,6 +168,23 @@ public class ServicerMaintainServiceImpl extends FlowAbstractImpl implements Ser
}
afterUpdate
(
entity
,
rqVO
);
}
else
{
// 发起审批流程或保存草稿
AddApprovalDTO
approvalDTO
=
getAddApprovalDTO
(
entity
);
super
.
startOrRestartWorkFlow
(
rqVO
,
rqVO
.
getBizApproveState
(),
approvalDTO
,
entity:
:
setBizApproveState
);
if
(
rqVO
.
getIsRestart
())
{
// 重新提交
againSubmitFlow
(
entity
,
rqVO
,
approvalDTO
);
}
else
{
// 修改业务数据
boolean
flag
=
mfServicerMaintainService
.
updateById
(
entity
);
if
(!
flag
)
{
throw
new
CsbrSystemException
(
SystemError
.
DATA_UPDATE_ERROR
,
rqVO
.
getImmediateApprove
()
?
messageSourceUtil
.
submitMessage
(
FUNCTION_NAME
)
:
messageSourceUtil
.
updateMessage
(
FUNCTION_NAME
));
}
afterUpdate
(
entity
,
rqVO
);
}
}
}
/**
...
...
@@ -321,12 +340,13 @@ public class ServicerMaintainServiceImpl extends FlowAbstractImpl implements Ser
* @return void
*/
private
void
afterSave
(
MfServicerMaintain
entity
,
ServicerMaintainRQVO
rqVO
)
{
//region 1.输出特殊转换
//region 1.1.输出过滤与补充处理
//endregion 1.1.输出过滤与补充处理
//endregion 1.输出特殊转换
List
<
MfServicerMaintainDetail
>
details
=
JSON
.
parseArray
(
entity
.
getMaintainJson
(),
MfServicerMaintainDetail
.
class
);
for
(
MfServicerMaintainDetail
item
:
details
){
item
.
setGuid
(
CommonUtil
.
newGuid
());
item
.
setTenantGuid
(
entity
.
getTenantGuid
());
item
.
setParentGuid
(
entity
.
getGuid
());
}
mfServicerMaintainDetailService
.
saveBatch
(
details
);
}
/**
...
...
@@ -391,12 +411,17 @@ public class ServicerMaintainServiceImpl extends FlowAbstractImpl implements Ser
* @return void
*/
protected
void
afterUpdate
(
MfServicerMaintain
entity
,
ServicerMaintainRQVO
rqVO
)
{
//region 1.输出特殊转换
//region 1.1.输出过滤与补充处理
//endregion 1.1.输出过滤与补充处理
//endregion 1.输出特殊转换
LambdaUpdateWrapper
<
MfServicerMaintainDetail
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
MfServicerMaintainDetail:
:
getParentGuid
,
entity
.
getGuid
());
mfServicerMaintainDetailService
.
remove
(
updateWrapper
);
List
<
MfServicerMaintainDetail
>
details
=
JSON
.
parseArray
(
entity
.
getMaintainJson
(),
MfServicerMaintainDetail
.
class
);
for
(
MfServicerMaintainDetail
item
:
details
){
item
.
setGuid
(
CommonUtil
.
newGuid
());
item
.
setTenantGuid
(
entity
.
getTenantGuid
());
item
.
setParentGuid
(
entity
.
getGuid
());
}
mfServicerMaintainDetailService
.
saveBatch
(
details
);
}
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment