ff9873a9 by 肖初晴

【DAOP-1.0】数据需求

【功能点】测试问题处理
1 parent 8e5d6d76
......@@ -184,11 +184,7 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService
MfDemand entity = convertToEntity(rqVO);
// 发起审批流程或保存草稿
AddApprovalDTO approvalDTO = getAddApprovalDTO(entity);
super.restartWorkFlow(rqVO, rqVO.getBizApproveState(), approvalDTO, null, oldEntity::setBizApproveState);
if (rqVO.getIsRestart()) {
// 重新提交
againSubmitFlow(entity, rqVO, approvalDTO);
} else {
super.restartWorkFlow(rqVO, oldEntity.getBizApproveState(), approvalDTO, this::saveDemand, entity::setBizApproveState);
// 修改业务数据
boolean flag = mfDemandService.updateById(entity);
if (!flag) {
......@@ -197,32 +193,6 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService
}
afterUpdate(entity, rqVO);
}
}
/**
* 重新提交数据需求
* @author xcq
* @date 2024-12-31 18:46
* @param entity
* @param rqVO
* @param approvalDTO
* @return void
*/
private void againSubmitFlow(MfDemand entity, DemandRQVO rqVO, AddApprovalDTO approvalDTO) {
// 重新提交的数据重置相关字段
entity.setGuid(CommonUtil.newGuid());
mfDemandService.csbrBaseEntity(entity);
// 保存新数据
boolean flag = mfDemandService.save(entity);
if (!flag) {
throw new CsbrSystemException(SystemError.DATA_ADD_ERROR, messageSourceUtil.addMessage(String.format("重新提交%s",FUNCTION_NAME)));
}
// 发起新的流程
approvalDTO.setGuid(entity.getGuid());
approvalDTO.setBizGuid(entity.getGuid());
approvalFlowUtil.addApproval(approvalDTO);
afterSave(entity, rqVO);
}
/**
* 数据需求数据删除、并有相关的处理操作
......
......@@ -318,16 +318,12 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris
public void updateEnterprise(FlowRQBaseVO flowBaseVO) {
EnterpriseRQVO rqVO = (EnterpriseRQVO) flowBaseVO;
// 将修改前数据查出来缓存下来,传入到修改后方法中,用于一些特殊逻辑处理,如某个值变化才进行
// MfEnterprise oldEntity = mfEnterpriseService.getById(rqVO.getGuid());
MfEnterprise oldEntity = mfEnterpriseService.getById(rqVO.getGuid());
beforeUpdate(rqVO);
MfEnterprise entity = convertToEntity(rqVO);
// 发起审批流程或保存草稿
AddApprovalDTO approvalDTO = getAddApprovalDTO(entity);
super.restartWorkFlow(rqVO, rqVO.getBizApproveState(), approvalDTO,null, entity::setBizApproveState);
if (rqVO.getIsRestart()) {
// 重新提交
againSubmitFlow(entity, rqVO, approvalDTO);
} else {
super.restartWorkFlow(rqVO, oldEntity.getBizApproveState(), approvalDTO, this::saveEnterprise, entity::setBizApproveState);
// 修改业务数据
boolean flag = mfEnterpriseService.updateById(entity);
if (!flag) {
......@@ -336,31 +332,6 @@ public class EnterpriseServiceImpl extends FlowAbstractImpl implements Enterpris
}
afterUpdate(entity, rqVO);
}
}
/**
* 重新提交企业信息
* @author xcq
* @date 2024-12-26 16:18
* @param entity
* @param rqVO
* @param approvalDTO
* @return void
*/
private void againSubmitFlow(MfEnterprise entity, EnterpriseRQVO rqVO, AddApprovalDTO approvalDTO) {
// 重新提交的数据重置相关字段
entity.setGuid(CommonUtil.newGuid());
mfEnterpriseService.csbrBaseEntity(entity);
// 保存新数据
boolean flag = mfEnterpriseService.save(entity);
if (!flag) {
throw new CsbrSystemException(SystemError.DATA_ADD_ERROR, messageSourceUtil.addMessage(String.format("重新提交%s",FUNCTION_NAME)));
}
// 发起新的流程
approvalDTO.setGuid(entity.getGuid());
approvalFlowUtil.addApproval(approvalDTO);
afterSave(entity, rqVO);
}
/**
* 企业信息数据删除、并有相关的处理操作
......
......@@ -161,7 +161,7 @@ public class ServicerMaintainServiceImpl extends FlowAbstractImpl implements Ser
public void updateServicerMaintain(FlowRQBaseVO flowBaseVO) {
ServicerMaintainRQVO rqVO = (ServicerMaintainRQVO) flowBaseVO;
// 将修改前数据查出来缓存下来,传入到修改后方法中,用于一些特殊逻辑处理,如某个值变化才进行
// MfServicerMaintain oldEntity = mfServicerMaintainService.getById(rqVO.getGuid());
MfServicerMaintain oldEntity = mfServicerMaintainService.getById(rqVO.getGuid());
beforeUpdate(rqVO);
MfServicerMaintain entity = convertToEntity(rqVO);
if("Y".equals(rqVO.getBizApproveState())){
......@@ -176,11 +176,7 @@ public class ServicerMaintainServiceImpl extends FlowAbstractImpl implements Ser
else{
// 发起审批流程或保存草稿
AddApprovalDTO approvalDTO = getAddApprovalDTO(entity);
super.restartWorkFlow(rqVO, rqVO.getBizApproveState(), approvalDTO,null, entity::setBizApproveState);
if (rqVO.getIsRestart()) {
// 重新提交
againSubmitFlow(entity, rqVO, approvalDTO);
} else {
super.restartWorkFlow(rqVO, oldEntity.getBizApproveState(), approvalDTO, this::saveServicerMaintain, entity::setBizApproveState);
// 修改业务数据
boolean flag = mfServicerMaintainService.updateById(entity);
if (!flag) {
......@@ -190,31 +186,6 @@ public class ServicerMaintainServiceImpl extends FlowAbstractImpl implements Ser
afterUpdate(entity, rqVO);
}
}
}
/**
* 重新提交服务商维护
* @author xcq
* @date 2024-12-31 18:49
* @param entity
* @param rqVO
* @param approvalDTO
* @return void
*/
private void againSubmitFlow(MfServicerMaintain entity, ServicerMaintainRQVO rqVO, AddApprovalDTO approvalDTO) {
// 重新提交的数据重置相关字段
entity.setGuid(CommonUtil.newGuid());
mfServicerMaintainService.csbrBaseEntity(entity);
// 保存新数据
boolean flag = mfServicerMaintainService.save(entity);
if (!flag) {
throw new CsbrSystemException(SystemError.DATA_ADD_ERROR, messageSourceUtil.addMessage(String.format("重新提交%s",FUNCTION_NAME)));
}
// 发起新的流程
approvalDTO.setGuid(entity.getGuid());
approvalFlowUtil.addApproval(approvalDTO);
afterSave(entity, rqVO);
}
/**
* 服务商维护数据删除、并有相关的处理操作
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!