流程
This commit is contained in:
parent
d5baefb2cf
commit
19d41454dc
@ -132,11 +132,25 @@ public class ProcurementPlanController extends BladeController {
|
||||
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")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@ApiOperationSupport(order = 8)
|
||||
@Operation(summary = "逻辑删除", description = "传入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));
|
||||
|
||||
@ -62,4 +62,12 @@ public interface IProcurementPlanService extends BaseService<ProcurementPlan> {
|
||||
*/
|
||||
boolean submit(ProcurementPlanVO procurementPlanVO);
|
||||
|
||||
/**
|
||||
* 保存草稿(新增或修改,含明细,不触发流程引擎)
|
||||
*
|
||||
* @param procurementPlanVO 招采计划VO
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean saveDraft(ProcurementPlanVO procurementPlanVO);
|
||||
|
||||
}
|
||||
|
||||
@ -93,9 +93,35 @@ public class ProcurementPlanServiceImpl extends BaseServiceImpl<ProcurementPlanM
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
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())) {
|
||||
String billNo = billCodeService.generateBillCode("PROCUREMENT_PLAN");
|
||||
String billNo = billCodeService.generateBillCode("PROCUREMENT_PLAN" ,"NDZC");
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user