| | |
| | | |
| | | @GetMapping(path = "bind_units") |
| | | @SsoAop() |
| | | public BaseResponse<Map> getGroupBindUnits(Long id) { |
| | | public BaseResponse<List<String>> getGroupBindUnits(Long id) { |
| | | try { |
| | | List<Long> res = irrigateGroupSv.getGroupBindUnits(id); |
| | | HashMap<Integer, String> map = new HashMap<>(); |
| | | ArrayList<Object> list = new ArrayList<>(); |
| | | for (int i = 0; i < res.size(); i++) { |
| | | String aLong = res.get(i).toString(); |
| | | map.put(i,aLong); |
| | | list.add(aLong); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(map); |
| | | return BaseResponseUtils.buildSuccess(list); |
| | | } catch (Exception e) { |
| | | log.error("获取一个轮灌组绑定灌溉单元记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | |
| | | |
| | | @GetMapping(path = "notBind_units") |
| | | @SsoAop() |
| | | public BaseResponse<Map> getNotBindUnits() { |
| | | public BaseResponse<List<String>> getNotBindUnits() { |
| | | try { |
| | | List<Long> res = irrigateGroupSv.getNotBindUnits(); |
| | | HashMap<Integer, String> map = new HashMap<>(); |
| | | ArrayList<Object> list = new ArrayList<>(); |
| | | for (int i = 0; i < res.size(); i++) { |
| | | String aLong = res.get(i).toString(); |
| | | map.put(i,aLong); |
| | | list.add(aLong); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(map); |
| | | return BaseResponseUtils.buildSuccess(list); |
| | | } catch (Exception e) { |
| | | log.error("获取未绑定轮灌组的灌溉单元id记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |