b481e3f8 by 肖初晴

【DAOP-1.0】服务商维护

【功能点】功能开发
1 parent 93798d0e
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;
...@@ -17,7 +19,11 @@ import java.util.List; ...@@ -17,7 +19,11 @@ import java.util.List;
17 @Data 19 @Data
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);
126 // 发起审批流程或保存草稿 132 if(!"Y".equals(rqVO.getBizApproveState())){
127 AddApprovalDTO approvalDTO = getAddApprovalDTO(entity); 133 // 发起审批流程或保存草稿
128 super.startWorkFlow(rqVO, approvalDTO, entity::setBizApproveState); 134 AddApprovalDTO approvalDTO = getAddApprovalDTO(entity);
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,13 +159,7 @@ public class ServicerMaintainServiceImpl extends FlowAbstractImpl implements Ser ...@@ -151,13 +159,7 @@ 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);
154 // 发起审批流程或保存草稿 162 if("Y".equals(rqVO.getBizApproveState())){
155 AddApprovalDTO approvalDTO = getAddApprovalDTO(entity);
156 super.startOrRestartWorkFlow(rqVO, rqVO.getBizApproveState(), approvalDTO, entity::setBizApproveState);
157 if (rqVO.getIsRestart()) {
158 // 重新提交
159 againSubmitFlow(entity, rqVO, approvalDTO);
160 } else {
161 // 修改业务数据 163 // 修改业务数据
162 boolean flag = mfServicerMaintainService.updateById(entity); 164 boolean flag = mfServicerMaintainService.updateById(entity);
163 if (!flag) { 165 if (!flag) {
...@@ -166,6 +168,23 @@ public class ServicerMaintainServiceImpl extends FlowAbstractImpl implements Ser ...@@ -166,6 +168,23 @@ public class ServicerMaintainServiceImpl extends FlowAbstractImpl implements Ser
166 } 168 }
167 afterUpdate(entity, rqVO); 169 afterUpdate(entity, rqVO);
168 } 170 }
171 else{
172 // 发起审批流程或保存草稿
173 AddApprovalDTO approvalDTO = getAddApprovalDTO(entity);
174 super.startOrRestartWorkFlow(rqVO, rqVO.getBizApproveState(), approvalDTO, entity::setBizApproveState);
175 if (rqVO.getIsRestart()) {
176 // 重新提交
177 againSubmitFlow(entity, rqVO, approvalDTO);
178 } else {
179 // 修改业务数据
180 boolean flag = mfServicerMaintainService.updateById(entity);
181 if (!flag) {
182 throw new CsbrSystemException(SystemError.DATA_UPDATE_ERROR, rqVO.getImmediateApprove() ?
183 messageSourceUtil.submitMessage(FUNCTION_NAME) : messageSourceUtil.updateMessage(FUNCTION_NAME));
184 }
185 afterUpdate(entity, rqVO);
186 }
187 }
169 } 188 }
170 189
171 /** 190 /**
...@@ -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<>();
395 415 updateWrapper.eq(MfServicerMaintainDetail::getParentGuid,entity.getGuid());
396 //region 1.1.输出过滤与补充处理 416 mfServicerMaintainDetailService.remove(updateWrapper);
397 //endregion 1.1.输出过滤与补充处理 417
398 418 List<MfServicerMaintainDetail> details = JSON.parseArray(entity.getMaintainJson(),MfServicerMaintainDetail.class);
399 //endregion 1.输出特殊转换 419 for(MfServicerMaintainDetail item : details){
420 item.setGuid(CommonUtil.newGuid());
421 item.setTenantGuid(entity.getTenantGuid());
422 item.setParentGuid(entity.getGuid());
423 }
424 mfServicerMaintainDetailService.saveBatch(details);
400 } 425 }
401 426
402 427
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!