@RemoteMethod
  public ListRange findAll(BpmConfigDto filter, SortField[] sortFields, int start, int limit) {
    // TODO同步流程信息
    bpmFlowService.saveBpmFlowDesign();

    // 需要form_name
    String msql =
        "SELECT b.*, f.name form_name,f.id form_id FROM tbl_bpm_config b,tbl_formbuild_formentity f WHERE (b.deleted ='N' OR b.deleted IS NULL) and b.formEntity_id=f.id ORDER BY b.id DESC LIMIT 100 ";
    List l1 = baseDao.findBySql(msql);
    List<BpmConfigDto> list = Copy.listMap2ListModel(l1, BpmConfigDto.class);
    int count = list.size();

    Collection<BpmConfigDto> bpmConfigDtoList = new ArrayList<BpmConfigDto>();
    BpmTemplateDto bpmTemplateDto = null;

    for (BpmConfigDto bpmConfigDto : list) {
      bpmConfigDto.setRangeJson(this.getRangeStr(bpmConfigDto.getRangeJson()));
      bpmTemplateDto = esbService.getBpmTemplateDto(bpmConfigDto.getFlow_code());
      if (bpmTemplateDto != null) bpmConfigDto.setFlow_code(bpmTemplateDto.getTemplateName());
      bpmConfigDtoList.add(bpmConfigDto);
    }
    ListRange lr = new ListRange();
    lr.setData((List<BpmConfigDto>) bpmConfigDtoList);
    lr.setTotalSize(count);
    return lr;
  }
 /** 根据ID查询 */
 @RemoteMethod
 public BpmConfigDto findById(String id) {
   BpmConfig bpmConfig = bpmConfigDaoImpl.findById(id);
   BpmConfigDto templateConfigDto = dozerAssembly.bean2Dto(bpmConfig, BpmConfigDto.class);
   templateConfigDto.setBpmTemplateDto(esbService.getBpmTemplateDto(bpmConfig.getFlow_code()));
   // templateConfigDto.setFlow_code(DictionaryUtils.getItemNameByGroupCode("flow",
   // templateConfigDto.getFlow_code()));
   if (bpmConfig.getFormEntity() != null && bpmConfig.getFormEntity().getFormTree() != null) {
     FormTree formTree = bpmConfig.getFormEntity().getFormTree();
     TreeDto treeDto = new TreeDto();
     treeDto.setId(formTree.getId());
     treeDto.setText(formTreeService.getParentText(formTree.getId()) + "/" + formTree.getText());
     treeDto.setPath(
         formTreeService.getParentPath(formTree.getId()) + "/" + formTree.getId() + "/");
     templateConfigDto.setTreeDto(treeDto);
   }
   return templateConfigDto;
 }