|
@@ -35,10 +35,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
import java.text.ParseException;
|
|
import java.text.ParseException;
|
|
-import java.util.ArrayList;
|
|
|
|
-import java.util.Collections;
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.Objects;
|
|
|
|
|
|
+import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@Service
|
|
@Service
|
|
@@ -270,6 +267,16 @@ public class WbsFormElementServiceImpl extends BaseServiceImpl<WbsFormElementMap
|
|
if (StringUtils.isEmpty(initTableName)) {
|
|
if (StringUtils.isEmpty(initTableName)) {
|
|
throw new ServiceException("未获取到initTableName对应实体表名称,操作失败");
|
|
throw new ServiceException("未获取到initTableName对应实体表名称,操作失败");
|
|
}
|
|
}
|
|
|
|
+ //校验,不能在同一个表单中,为多个字段配置相同的统计标识
|
|
|
|
+ Map<Integer, List<WbsFormElement>> collect = wbsFormElementList.stream()
|
|
|
|
+ .filter(l->Objects.nonNull(l.getDynamicDict()))
|
|
|
|
+ .filter(l-> l.getDynamicDict() != 0)
|
|
|
|
+ .collect(Collectors.groupingBy(WbsFormElement::getDynamicDict));
|
|
|
|
+ for (Integer integer : collect.keySet()) {
|
|
|
|
+ if (collect.get(integer).size() >= 2){
|
|
|
|
+ throw new ServiceException("不能在一张表中,为多个字段配置相同的统计标识,请重新配置");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
//修改元素基础信息
|
|
//修改元素基础信息
|
|
wbsFormElementList.forEach(obj -> obj.setStatus(1));
|
|
wbsFormElementList.forEach(obj -> obj.setStatus(1));
|