Commit 3d78d8df958563f4215411e51dceb50717f5c395

Authored by YunaiV
1 parent 16e0bebd

[BUG] BPM:动态表单必填字段可绕过——OA 请假必填项全留空仍可发起成功,脏单审批时 500- #1245

#1245#1247
yudao-module-bpm/src/main/java/cn/iocoder/yudao/module/bpm/service/task/BpmProcessInstanceServiceImpl.java
... ... @@ -772,10 +772,9 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService
772 772 }
773 773  
774 774 /**
775   - * 校验动态表单(formType=10 流程表单)的必填字段
  775 + * 校验动态表单的必填字段
776 776 *
777   - * 注意:仅校验接口发起(VO 路径)入口。内部业务链路(DTO 路径,例如 OA 请假)
778   - * 由业务代码自行组装变量,不经过本校验,避免误伤。
  777 + * @see <a href="https://github.com/YunaiV/ruoyi-vue-pro/pull/1245">相关 issue</a>
779 778 */
780 779 private void validateDynamicFormRequiredFields(ProcessDefinition definition, Map<String, Object> variables) {
781 780 BpmProcessDefinitionInfoDO processDefinitionInfo = processDefinitionService
... ... @@ -806,8 +805,7 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService
806 805 }
807 806 Object value = variables == null ? null : variables.get(fieldId);
808 807 if (value == null || (value instanceof String && StrUtil.isBlank((String) value))) {
809   - throw exception(PROCESS_INSTANCE_START_FORM_FIELD_REQUIRED,
810   - Convert.toStr(field.get("title"), fieldId));
  808 + throw exception(PROCESS_INSTANCE_START_FORM_FIELD_REQUIRED, Convert.toStr(field.get("title"), fieldId));
811 809 }
812 810 }
813 811 }
... ...