| | |
| | | |
| | | import com.lf.server.entity.all.StaticData; |
| | | import com.lf.server.entity.ctrl.DownloadReqEntity; |
| | | import com.lf.server.entity.data.MetaEntity; |
| | | import com.lf.server.entity.show.ApplyEntity; |
| | | import com.lf.server.entity.show.FlowEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | |
| | | ApplyEntity apply = new ApplyEntity(); |
| | | apply.setUserid(ue.getId()); |
| | | apply.setDepids(StringHelper.join(dr.getDepcodes(), ",")); |
| | | apply.setTabs(StringHelper.join(dr.getTabs(), ",")); |
| | | apply.setTabs(getTabs(dr)); |
| | | apply.setEntities(StringHelper.join(dr.getEntities(), ",")); |
| | | apply.setWkt(dr.getWkt()); |
| | | apply.setPwd(aesPwd); |
| | |
| | | apply.setFilters(dr.getFilter()); |
| | | |
| | | return apply; |
| | | } |
| | | |
| | | /** |
| | | * 获取表名 |
| | | */ |
| | | private String getTabs(DownloadReqEntity dr) { |
| | | if (!StaticData.SYS_META.equals(dr.getEntities())) { |
| | | return StringHelper.join(dr.getTabs(), ","); |
| | | } |
| | | |
| | | List<MetaEntity> list = metaService.selectMetaFiles(dr.getIds()); |
| | | if (null == list || list.isEmpty()) { |
| | | return "元数据表"; |
| | | } |
| | | |
| | | StringBuilder sb = new StringBuilder(); |
| | | for (MetaEntity me : list) { |
| | | sb.append(me.getName()).append(","); |
| | | if (sb.length() > StaticData.I1000) { |
| | | break; |
| | | } |
| | | } |
| | | if (sb.length() > 1) { |
| | | sb.deleteCharAt(sb.length() - 1); |
| | | } |
| | | |
| | | return sb.toString(); |
| | | } |
| | | |
| | | /** |
| | |
| | | dr.setPwd(pwd); |
| | | dr.setDepcode(entity.getDepcode()); |
| | | dr.setDirs(entity.getDircodes()); |
| | | dr.setIds(getIds(entity)); |
| | | dr.setIds(getIds(entity.getGids())); |
| | | dr.setFilter(entity.getFilters()); |
| | | |
| | | String guid = "sysmeta".equals(entity.getEntities()) ? metaService.downloadMeteReq(ue, dr) : dataLibService.downloadDbReq(ue, dr); |
| | | String guid = StaticData.SYS_META.equals(entity.getEntities()) ? metaService.downloadMeteReq(ue, dr) : dataLibService.downloadDbReq(ue, dr); |
| | | if (!StringHelper.isEmpty(guid)) { |
| | | entity.setGuid(guid); |
| | | update(entity); |
| | |
| | | /** |
| | | * 获取ID集合 |
| | | */ |
| | | private List<Integer> getIds(ApplyEntity entity) { |
| | | if (StringHelper.isEmpty(entity.getGids())) { |
| | | private List<Integer> getIds(String gids) { |
| | | if (StringHelper.isEmpty(gids)) { |
| | | return null; |
| | | } |
| | | |
| | | List<Integer> list = new ArrayList<>(); |
| | | for (String str : entity.getGids().split(StaticData.COMMA)) { |
| | | for (String str : gids.split(StaticData.COMMA)) { |
| | | list.add(Integer.parseInt(str)); |
| | | } |
| | | |