【DAOP-1.0】服务商维护
【功能点】功能开发
Showing
3 changed files
with
43 additions
and
12 deletions
1 | package com.csbr.qingcloud.portal.domain.vo; | 1 | package com.csbr.qingcloud.portal.domain.vo; |
2 | 2 | ||
3 | import com.csbr.cloud.mybatis.annotations.LikeQuery; | ||
4 | import com.csbr.cloud.mybatis.enums.LikeQueryEnum; | ||
3 | import com.csbr.cloud.workflow.domain.dto.appove.FlowBizGuidQueryDTO; | 5 | import com.csbr.cloud.workflow.domain.dto.appove.FlowBizGuidQueryDTO; |
4 | import io.swagger.v3.oas.annotations.media.Schema; | 6 | import io.swagger.v3.oas.annotations.media.Schema; |
5 | import lombok.EqualsAndHashCode; | 7 | import lombok.EqualsAndHashCode; |
... | @@ -18,6 +20,10 @@ import java.util.List; | ... | @@ -18,6 +20,10 @@ import java.util.List; |
18 | @Schema(title = "服务商维护查询参数") | 20 | @Schema(title = "服务商维护查询参数") |
19 | public class ServicerMaintainQueryVO extends FlowBizGuidQueryDTO { | 21 | public class ServicerMaintainQueryVO extends FlowBizGuidQueryDTO { |
20 | 22 | ||
23 | @Schema(description = "公司名称") | ||
24 | @LikeQuery(type = LikeQueryEnum.ALL) | ||
25 | private String tenantName; | ||
26 | |||
21 | /** | 27 | /** |
22 | * 业务审批状态【N 草稿中,A 审批中,Y 已通过,R 驳回,C 已撤销,D 已废弃】 | 28 | * 业务审批状态【N 草稿中,A 审批中,Y 已通过,R 驳回,C 已撤销,D 已废弃】 |
23 | */ | 29 | */ | ... | ... |
... | @@ -56,7 +56,7 @@ public class ServicerMaintainRQVO extends FlowRQBaseVO { | ... | @@ -56,7 +56,7 @@ public class ServicerMaintainRQVO extends FlowRQBaseVO { |
56 | /** | 56 | /** |
57 | * 业务审批状态【N 草稿中,A 审批中,Y 已通过,R 驳回,C 已撤销,D 已废弃; 默认 N】 | 57 | * 业务审批状态【N 草稿中,A 审批中,Y 已通过,R 驳回,C 已撤销,D 已废弃; 默认 N】 |
58 | */ | 58 | */ |
59 | @Schema(description = "业务审批状态【N 草稿中,A 审批中,Y 已通过,R 驳回,C 已撤销,D 已废弃; 默认 N】") | 59 | @Schema(description = "业务审批状态(传Y表示不走审批流)【N 草稿中,A 审批中,Y 已通过,R 驳回,C 已撤销,D 已废弃; 默认 N】") |
60 | private String bizApproveState; | 60 | private String bizApproveState; |
61 | 61 | ||
62 | /** | 62 | /** | ... | ... |
1 | package com.csbr.qingcloud.portal.service.impl; | 1 | package com.csbr.qingcloud.portal.service.impl; |
2 | 2 | ||
3 | import com.alibaba.fastjson.JSON; | ||
3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 4 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
4 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | 5 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
5 | import com.csbr.cloud.common.enums.SystemError; | 6 | import com.csbr.cloud.common.enums.SystemError; |
6 | import com.csbr.cloud.common.enums.WorkFlowBizEnum; | 7 | import com.csbr.cloud.common.enums.WorkFlowBizEnum; |
8 | import com.csbr.qingcloud.portal.mybatis.entity.MfServicerMaintainDetail; | ||
9 | import com.csbr.qingcloud.portal.mybatis.service.MfServicerMaintainDetailService; | ||
7 | import csbr.cloud.entity.enums.ApprovalStateEnum; | 10 | import csbr.cloud.entity.enums.ApprovalStateEnum; |
8 | import com.csbr.cloud.common.exception.CsbrSystemException; | 11 | import com.csbr.cloud.common.exception.CsbrSystemException; |
9 | import com.csbr.cloud.common.util.CommonUtil; | 12 | import com.csbr.cloud.common.util.CommonUtil; |
... | @@ -57,6 +60,9 @@ public class ServicerMaintainServiceImpl extends FlowAbstractImpl implements Ser | ... | @@ -57,6 +60,9 @@ public class ServicerMaintainServiceImpl extends FlowAbstractImpl implements Ser |
57 | private MfServicerMaintainService mfServicerMaintainService; | 60 | private MfServicerMaintainService mfServicerMaintainService; |
58 | 61 | ||
59 | @Resource | 62 | @Resource |
63 | private MfServicerMaintainDetailService mfServicerMaintainDetailService; | ||
64 | |||
65 | @Resource | ||
60 | private CsbrBeanUtil csbrBeanUtil; | 66 | private CsbrBeanUtil csbrBeanUtil; |
61 | 67 | ||
62 | @Resource | 68 | @Resource |
... | @@ -123,9 +129,11 @@ public class ServicerMaintainServiceImpl extends FlowAbstractImpl implements Ser | ... | @@ -123,9 +129,11 @@ public class ServicerMaintainServiceImpl extends FlowAbstractImpl implements Ser |
123 | ServicerMaintainRQVO rqVO = (ServicerMaintainRQVO) flowBaseVO; | 129 | ServicerMaintainRQVO rqVO = (ServicerMaintainRQVO) flowBaseVO; |
124 | beforeSave(rqVO); | 130 | beforeSave(rqVO); |
125 | MfServicerMaintain entity = convertToEntity(rqVO); | 131 | MfServicerMaintain entity = convertToEntity(rqVO); |
132 | if(!"Y".equals(rqVO.getBizApproveState())){ | ||
126 | // 发起审批流程或保存草稿 | 133 | // 发起审批流程或保存草稿 |
127 | AddApprovalDTO approvalDTO = getAddApprovalDTO(entity); | 134 | AddApprovalDTO approvalDTO = getAddApprovalDTO(entity); |
128 | super.startWorkFlow(rqVO, approvalDTO, entity::setBizApproveState); | 135 | super.startWorkFlow(rqVO, approvalDTO, entity::setBizApproveState); |
136 | } | ||
129 | // 业务数据保存 | 137 | // 业务数据保存 |
130 | boolean flag = mfServicerMaintainService.save(entity); | 138 | boolean flag = mfServicerMaintainService.save(entity); |
131 | if (!flag) { | 139 | if (!flag) { |
... | @@ -151,6 +159,16 @@ public class ServicerMaintainServiceImpl extends FlowAbstractImpl implements Ser | ... | @@ -151,6 +159,16 @@ public class ServicerMaintainServiceImpl extends FlowAbstractImpl implements Ser |
151 | // MfServicerMaintain oldEntity = mfServicerMaintainService.getById(rqVO.getGuid()); | 159 | // MfServicerMaintain oldEntity = mfServicerMaintainService.getById(rqVO.getGuid()); |
152 | beforeUpdate(rqVO); | 160 | beforeUpdate(rqVO); |
153 | MfServicerMaintain entity = convertToEntity(rqVO); | 161 | MfServicerMaintain entity = convertToEntity(rqVO); |
162 | if("Y".equals(rqVO.getBizApproveState())){ | ||
163 | // 修改业务数据 | ||
164 | boolean flag = mfServicerMaintainService.updateById(entity); | ||
165 | if (!flag) { | ||
166 | throw new CsbrSystemException(SystemError.DATA_UPDATE_ERROR, rqVO.getImmediateApprove() ? | ||
167 | messageSourceUtil.submitMessage(FUNCTION_NAME) : messageSourceUtil.updateMessage(FUNCTION_NAME)); | ||
168 | } | ||
169 | afterUpdate(entity, rqVO); | ||
170 | } | ||
171 | else{ | ||
154 | // 发起审批流程或保存草稿 | 172 | // 发起审批流程或保存草稿 |
155 | AddApprovalDTO approvalDTO = getAddApprovalDTO(entity); | 173 | AddApprovalDTO approvalDTO = getAddApprovalDTO(entity); |
156 | super.startOrRestartWorkFlow(rqVO, rqVO.getBizApproveState(), approvalDTO, entity::setBizApproveState); | 174 | super.startOrRestartWorkFlow(rqVO, rqVO.getBizApproveState(), approvalDTO, entity::setBizApproveState); |
... | @@ -167,6 +185,7 @@ public class ServicerMaintainServiceImpl extends FlowAbstractImpl implements Ser | ... | @@ -167,6 +185,7 @@ public class ServicerMaintainServiceImpl extends FlowAbstractImpl implements Ser |
167 | afterUpdate(entity, rqVO); | 185 | afterUpdate(entity, rqVO); |
168 | } | 186 | } |
169 | } | 187 | } |
188 | } | ||
170 | 189 | ||
171 | /** | 190 | /** |
172 | * 重新提交服务商维护 | 191 | * 重新提交服务商维护 |
... | @@ -321,12 +340,13 @@ public class ServicerMaintainServiceImpl extends FlowAbstractImpl implements Ser | ... | @@ -321,12 +340,13 @@ public class ServicerMaintainServiceImpl extends FlowAbstractImpl implements Ser |
321 | * @return void | 340 | * @return void |
322 | */ | 341 | */ |
323 | private void afterSave(MfServicerMaintain entity, ServicerMaintainRQVO rqVO) { | 342 | private void afterSave(MfServicerMaintain entity, ServicerMaintainRQVO rqVO) { |
324 | //region 1.输出特殊转换 | 343 | List<MfServicerMaintainDetail> details = JSON.parseArray(entity.getMaintainJson(),MfServicerMaintainDetail.class); |
325 | 344 | for(MfServicerMaintainDetail item : details){ | |
326 | //region 1.1.输出过滤与补充处理 | 345 | item.setGuid(CommonUtil.newGuid()); |
327 | //endregion 1.1.输出过滤与补充处理 | 346 | item.setTenantGuid(entity.getTenantGuid()); |
328 | 347 | item.setParentGuid(entity.getGuid()); | |
329 | //endregion 1.输出特殊转换 | 348 | } |
349 | mfServicerMaintainDetailService.saveBatch(details); | ||
330 | } | 350 | } |
331 | 351 | ||
332 | /** | 352 | /** |
... | @@ -391,12 +411,17 @@ public class ServicerMaintainServiceImpl extends FlowAbstractImpl implements Ser | ... | @@ -391,12 +411,17 @@ public class ServicerMaintainServiceImpl extends FlowAbstractImpl implements Ser |
391 | * @return void | 411 | * @return void |
392 | */ | 412 | */ |
393 | protected void afterUpdate(MfServicerMaintain entity, ServicerMaintainRQVO rqVO) { | 413 | protected void afterUpdate(MfServicerMaintain entity, ServicerMaintainRQVO rqVO) { |
394 | //region 1.输出特殊转换 | 414 | LambdaUpdateWrapper<MfServicerMaintainDetail> updateWrapper = new LambdaUpdateWrapper<>(); |
415 | updateWrapper.eq(MfServicerMaintainDetail::getParentGuid,entity.getGuid()); | ||
416 | mfServicerMaintainDetailService.remove(updateWrapper); | ||
395 | 417 | ||
396 | //region 1.1.输出过滤与补充处理 | 418 | List<MfServicerMaintainDetail> details = JSON.parseArray(entity.getMaintainJson(),MfServicerMaintainDetail.class); |
397 | //endregion 1.1.输出过滤与补充处理 | 419 | for(MfServicerMaintainDetail item : details){ |
398 | 420 | item.setGuid(CommonUtil.newGuid()); | |
399 | //endregion 1.输出特殊转换 | 421 | item.setTenantGuid(entity.getTenantGuid()); |
422 | item.setParentGuid(entity.getGuid()); | ||
423 | } | ||
424 | mfServicerMaintainDetailService.saveBatch(details); | ||
400 | } | 425 | } |
401 | 426 | ||
402 | 427 | ... | ... |
-
Please register or sign in to post a comment