@Log(context = "资源管理", object = "App管理", action = 4, detail = "删除App") public void deleteApp(String ids) { String[] idArray = ids.split(","); for (String id : idArray) { if (StringUtilsCustom.isNotBlank(id)) { App item = appDao.findOne(Long.valueOf(id)); appDao.delete(item); } } }
@Log(context = "资源管理", object = "App管理", action = 2, detail = "查询App") public Page<App> getAllApp( int pageNumber, int pageSize, String sortType, Map<String, Object> searchParams) { PageRequest pageRequest = buildPageRequest(pageNumber, pageSize, sortType); Specification<App> spec = buildSpecification(searchParams, App.class); return appDao.findAll(spec, pageRequest); }
private synchronized void refreshAppList(boolean auto) { try { updating = true; Set<String> imgSet = getImgs(); List<Machine> machines = MachineUtils.getMachineList(); appDao.deleteAutoUpdatedRecords(); HashSet<String> set = new HashSet<String>(); for (Machine machine : machines) { String data = thirdAppService.getAppData(machine.getCode(), "3.0"); AppVO appVO = jsonMapper.fromJson(data, AppVO.class); if (appVO.getState().equals("0000")) { for (AppInfo appInfo : appVO.getZone()) { App app = new App(); app.setActionUrl(jsonMapper.toJson(appInfo.getData())); app.setUrl1080(upload(appInfo.getIcon())); app.setClientType(machine.getCode()); app.setTitle(jsonMapper.toJson(new String[] {appInfo.getName()})); app.setUpdateRefer("app:1"); if (auto) { User user = new User(); user.setId(1L); app.setUser(user); } else { app.setUser(UserUtils.getUser()); } appDao.save(app); set.add(app.getUpdateRefer()); } } } for (String ur : set) { templateService.evictTplByUpdateRefer(ur); } } catch (Exception e) { throw new RuntimeException(e); } finally { updating = false; } }
public String getUpdatedDate() { Date date = appDao.recentUpdatedDate(); if (date != null) { return DateUtilsCustom.formatDate(date, "yyyy年MM月dd日 HH:mm:ss"); } else { return ""; } }
private Set<String> getImgs() { Set<String> imgSet = new HashSet<String>(); List<App> apps = appDao.findAutoUpdatedList(); for (App app : apps) { String url1080 = app.getUrl1080(); if (url1080 != null && !url1080.equals("")) { imgSet.add(app.getUrl1080()); } } return imgSet; }
@Log(context = "资源管理", object = "App管理", action = 4, detail = "删除App") public void deleteApp(Long id) { appDao.deleteById(id); }
@Log(context = "资源管理", object = "App管理", action = 2, detail = "查询指定App") public App getApp(Long id) { return appDao.findOne(id); }
@Log(context = "资源管理", object = "App管理", action = 1, detail = "保存App") public void saveApp(App app) { appDao.save(app); }