| | |
| | | import com.lf.server.helper.AesHelper; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.mapper.show.ApplyMapper; |
| | | import com.lf.server.service.data.MetaService; |
| | | import com.lf.server.service.sys.UserService; |
| | | import org.apache.commons.logging.Log; |
| | | import org.apache.commons.logging.LogFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | @Autowired |
| | | FlowService flowService; |
| | | |
| | | @Autowired |
| | | UserService userService; |
| | | |
| | | @Autowired |
| | | MetaService metaService; |
| | | |
| | | @Autowired |
| | | DataLibService dataLibService; |
| | |
| | | private ApplyEntity getApplyEntity(UserEntity ue, DownloadReqEntity dr) throws Exception { |
| | | // String dbPwd = Md5Helper.reverse(Md5Helper.generate(dr.getPwd())) |
| | | String aesPwd = AesHelper.encrypt(dr.getPwd()); |
| | | String gids = null == dr.getIds() || dr.getIds().isEmpty() ? null : StringHelper.join(dr.getIds(), ","); |
| | | |
| | | ApplyEntity apply = new ApplyEntity(); |
| | | apply.setUserid(ue.getId()); |
| | |
| | | apply.setCreateUser(ue.getId()); |
| | | apply.setDepcode(dr.getDepcode()); |
| | | apply.setDircodes(dr.getDirs()); |
| | | apply.setGids(StringHelper.join(dr.getIds(), ",")); |
| | | apply.setGids(gids); |
| | | apply.setFilters(dr.getFilter()); |
| | | |
| | | return apply; |
| | |
| | | for (String depcode : dr.getDepcodes()) { |
| | | UserEntity user = selectUserByDepcode(depcode); |
| | | if (null == user) { |
| | | continue; |
| | | user = userService.selectByUid(StaticData.ADMIN); |
| | | } |
| | | |
| | | FlowEntity flow = new FlowEntity(); |
| | | flow.setApplyid(applyId); |
| | | flow.setDepcode(user.getDepcode()); |
| | | flow.setDepcode(depcode); |
| | | flow.setUserid(user.getId()); |
| | | flow.setStatus(0); |
| | | flow.setDescr(null); |
| | |
| | | dr.setIds(getIds(entity)); |
| | | dr.setFilter(entity.getFilters()); |
| | | |
| | | dataLibService.downloadDbReq(ue, dr); |
| | | String guid = "sysmeta".equals(entity.getEntities()) ? metaService.downloadMeteReq(ue, dr) : dataLibService.downloadDbReq(ue, dr); |
| | | if (!StringHelper.isEmpty(guid)) { |
| | | entity.setGuid(guid); |
| | | update(entity); |
| | | } |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | |
| | | * 获取ID集合 |
| | | */ |
| | | private List<Integer> getIds(ApplyEntity entity) { |
| | | if (StringHelper.isEmpty(entity.getGids())) { |
| | | return null; |
| | | } |
| | | |
| | | List<Integer> list = new ArrayList<>(); |
| | | for (String str : entity.getGids().split(StaticData.COMMA)) { |
| | | list.add(Integer.parseInt(str)); |