|
|
|
|
@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.bpm.service.definition;
|
|
|
|
|
import cn.hutool.core.lang.Assert;
|
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
|
|
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
|
|
|
|
|
import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils;
|
|
|
|
|
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form.BpmFormCreateReqVO;
|
|
|
|
|
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form.BpmFormPageReqVO;
|
|
|
|
|
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form.BpmFormUpdateReqVO;
|
|
|
|
|
@ -21,7 +20,8 @@ import javax.annotation.Resource;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
|
|
|
import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.*;
|
|
|
|
|
import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.FORM_NOT_EXISTS;
|
|
|
|
|
import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.MODEL_DEPLOY_FAIL_FORM_NOT_CONFIG;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 动态表单 Service 实现类
|
|
|
|
|
@ -107,17 +107,15 @@ public class BpmFormServiceImpl implements BpmFormService {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void checkKeyNCName(String key) {
|
|
|
|
|
if (!ValidationUtils.isXmlNCName(key)) {
|
|
|
|
|
throw exception(MODEL_KEY_VALID);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 校验 Field,避免 field 重复
|
|
|
|
|
*
|
|
|
|
|
* @param fields field 数组
|
|
|
|
|
*/
|
|
|
|
|
private void checkFields(List<String> fields) {
|
|
|
|
|
if (true) { // TODO 芋艿:兼容 Vue3 工作流:因为采用了新的表单设计器,所以暂时不校验
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
Map<String, String> fieldMap = new HashMap<>(); // key 是 vModel,value 是 label
|
|
|
|
|
for (String field : fields) {
|
|
|
|
|
BpmFormFieldRespDTO fieldDTO = JsonUtils.parseObject(field, BpmFormFieldRespDTO.class);
|
|
|
|
|
|