|
@@ -43,6 +43,7 @@ import javax.validation.Valid;
|
|
|
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE;
|
|
import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE;
|
|
|
|
|
|
@@ -199,15 +200,14 @@ public class WbsTreeController extends BladeController {
|
|
@ApiOperationSupport(order = 8)
|
|
@ApiOperationSupport(order = 8)
|
|
@ApiOperation(value = "根据表单id查询所有元素", notes = "传入表单id")
|
|
@ApiOperation(value = "根据表单id查询所有元素", notes = "传入表单id")
|
|
@ApiImplicitParam(name = "id", value = "表单id", required = true)
|
|
@ApiImplicitParam(name = "id", value = "表单id", required = true)
|
|
- public R<List<WbsFormElementVO>> selectFormElements(@RequestParam("id") String id,Long nodeId) {
|
|
|
|
|
|
+ public R<List<WbsFormElementVO>> selectFormElements(@RequestParam("id") String id,Long nodeId,String search) {
|
|
List<WbsFormElementVO> wbsFormElements = null;
|
|
List<WbsFormElementVO> wbsFormElements = null;
|
|
-// TokenizerEngine engine = new HanLPEngine();
|
|
|
|
-// String text = "这是一段分词测试代码";
|
|
|
|
-// Result result = engine.parse(text);
|
|
|
|
-// String resultStr = CollUtil.join((Iterator<Word>)result, " ");
|
|
|
|
if (StringUtils.isNotEmpty(id)) {
|
|
if (StringUtils.isNotEmpty(id)) {
|
|
wbsFormElements = wbsTreeService.selectFormElements(id,nodeId);
|
|
wbsFormElements = wbsTreeService.selectFormElements(id,nodeId);
|
|
if (wbsFormElements.size() > 0) {
|
|
if (wbsFormElements.size() > 0) {
|
|
|
|
+ if(StringUtils.isNotEmpty(search)){
|
|
|
|
+ wbsFormElements=wbsFormElements.stream().filter(e->e.getEName().contains(search)).collect(Collectors.toList());
|
|
|
|
+ }
|
|
return R.data(wbsFormElements);
|
|
return R.data(wbsFormElements);
|
|
}
|
|
}
|
|
}
|
|
}
|