This commit is contained in:
liuyaxin 2026-06-26 15:11:08 +08:00
parent d5baefb2cf
commit 19d41454dc
3 changed files with 50 additions and 9 deletions

View File

@ -132,11 +132,25 @@ public class ProcurementPlanController extends BladeController {
return R.status(procurementPlanService.submit(procurementPlanVO)); return R.status(procurementPlanService.submit(procurementPlanVO));
} }
/**
* 保存草稿不触发流程引擎
*/
@PostMapping("/draft/save")
@ApiOperationSupport(order = 7)
@Operation(summary = "保存草稿", description = "传入procurementPlan不触发流程引擎")
public R<Long> saveDraft(@RequestBody ProcurementPlanVO procurementPlanVO) {
boolean result = procurementPlanService.saveDraft(procurementPlanVO);
if (result) {
return R.data(procurementPlanVO.getId());
}
return R.fail("保存草稿失败");
}
/** /**
* 删除 * 删除
*/ */
@PostMapping("/remove") @PostMapping("/remove")
@ApiOperationSupport(order = 7) @ApiOperationSupport(order = 8)
@Operation(summary = "逻辑删除", description = "传入ids") @Operation(summary = "逻辑删除", description = "传入ids")
public R remove(@Parameter(name = "ids", description = "主键集合", in = ParameterIn.QUERY, schema = @Schema(type = "string")) @RequestParam String ids) { public R remove(@Parameter(name = "ids", description = "主键集合", in = ParameterIn.QUERY, schema = @Schema(type = "string")) @RequestParam String ids) {
boolean temp = procurementPlanService.deleteLogic(Func.toLongList(ids)); boolean temp = procurementPlanService.deleteLogic(Func.toLongList(ids));

View File

@ -62,4 +62,12 @@ public interface IProcurementPlanService extends BaseService<ProcurementPlan> {
*/ */
boolean submit(ProcurementPlanVO procurementPlanVO); boolean submit(ProcurementPlanVO procurementPlanVO);
/**
* 保存草稿新增或修改含明细不触发流程引擎
*
* @param procurementPlanVO 招采计划VO
* @return 是否成功
*/
boolean saveDraft(ProcurementPlanVO procurementPlanVO);
} }

View File

@ -93,9 +93,35 @@ public class ProcurementPlanServiceImpl extends BaseServiceImpl<ProcurementPlanM
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean submit(ProcurementPlanVO procurementPlanVO) { public boolean submit(ProcurementPlanVO procurementPlanVO) {
// 提交状态
procurementPlanVO.setFlowStatus("SUBMITTED");
boolean result = this.saveProcurementPlan(procurementPlanVO);
// TODO: 接入 blade-flow 流程引擎
// R<BladeFlow> result = flowClient.startProcessInstanceById(
// processDefinitionId,
// FlowUtil.getBusinessKey("zc_procurement_plan", String.valueOf(planId)),
// variables
// );
return result;
}
@Override
@Transactional(rollbackFor = Exception.class)
public boolean saveDraft(ProcurementPlanVO procurementPlanVO) {
// 草稿状态
procurementPlanVO.setFlowStatus("DRAFT");
return this.saveProcurementPlan(procurementPlanVO);
}
/**
* 公共保存逻辑提交和草稿复用
*/
private boolean saveProcurementPlan(ProcurementPlanVO procurementPlanVO) {
// 新建时生成单据号 // 新建时生成单据号
if (procurementPlanVO.getId() == null && !StringUtils.hasText(procurementPlanVO.getBillNo())) { if (procurementPlanVO.getId() == null && !StringUtils.hasText(procurementPlanVO.getBillNo())) {
String billNo = billCodeService.generateBillCode("PROCUREMENT_PLAN"); String billNo = billCodeService.generateBillCode("PROCUREMENT_PLAN" ,"NDZC");
procurementPlanVO.setBillNo(billNo); procurementPlanVO.setBillNo(billNo);
} }
@ -143,13 +169,6 @@ public class ProcurementPlanServiceImpl extends BaseServiceImpl<ProcurementPlanM
} }
} }
// TODO: 接入 blade-flow 流程引擎
// R<BladeFlow> result = flowClient.startProcessInstanceById(
// processDefinitionId,
// FlowUtil.getBusinessKey("zc_procurement_plan", String.valueOf(planId)),
// variables
// );
return result; return result;
} }