|  |  | 
 |  |  | import com.dy.common.webUtil.BaseResponse; | 
 |  |  | import com.dy.common.webUtil.BaseResponseUtils; | 
 |  |  | import com.dy.common.webUtil.QueryResultVo; | 
 |  |  | import com.dy.pipIrrGlobal.voIr.VoGroupIntakes; | 
 |  |  | import com.dy.pipIrrGlobal.voIr.VoGroupSimple; | 
 |  |  | import com.dy.pipIrrGlobal.voIr.VoProjectSimple; | 
 |  |  | import com.dy.pipIrrWechat.irrigation.qo.QoGroup; | 
 |  |  | 
 |  |  | import lombok.extern.slf4j.Slf4j; | 
 |  |  | import org.springframework.web.bind.annotation.GetMapping; | 
 |  |  | import org.springframework.web.bind.annotation.RequestMapping; | 
 |  |  | import org.springframework.web.bind.annotation.RequestParam; | 
 |  |  | import org.springframework.web.bind.annotation.RestController; | 
 |  |  |  | 
 |  |  | import java.util.List; | 
 |  |  | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     @GetMapping(path = "/getSimpleProjects") | 
 |  |  |     public BaseResponse<QueryResultVo<List<VoProjectSimple>>> getSimpleProjects(QoProject qo) { | 
 |  |  |     public BaseResponse<List<VoProjectSimple>> getSimpleProjects(QoProject qo) { | 
 |  |  |         try { | 
 |  |  |             QueryResultVo<List<VoProjectSimple>> res = irrigationSv.getSimpleProjects(qo); | 
 |  |  |             return BaseResponseUtils.buildSuccess(res); | 
 |  |  |             return BaseResponseUtils.buildSuccess(irrigationSv.getSimpleProjects(qo)); | 
 |  |  |         } catch (Exception e) { | 
 |  |  |             log.error("获取项目记录异常", e); | 
 |  |  |             return BaseResponseUtils.buildException(e.getMessage()); | 
 |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @GetMapping(path = "/getSimpleGroups") | 
 |  |  |     public BaseResponse<QueryResultVo<List<VoGroupSimple>>> getSimpleGroups(QoGroup qo) { | 
 |  |  |     public BaseResponse<List<VoGroupSimple>> getSimpleGroups(QoGroup qo) { | 
 |  |  |         if(qo.getProjectId() == null) { | 
 |  |  |             return BaseResponseUtils.buildErrorMsg("请选择项目"); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         try { | 
 |  |  |             QueryResultVo<List<VoGroupSimple>> res = irrigationSv.getSimpleGroups(qo); | 
 |  |  |             return BaseResponseUtils.buildSuccess(res); | 
 |  |  |             //QueryResultVo<List<VoGroupSimple>> res = irrigationSv.getSimpleGroups(qo); | 
 |  |  |             return BaseResponseUtils.buildSuccess(irrigationSv.getSimpleGroups(qo)); | 
 |  |  |         } catch (Exception e) { | 
 |  |  |             log.error("获取轮灌组记录异常", e); | 
 |  |  |             return BaseResponseUtils.buildException(e.getMessage()); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 根据轮灌组ID获取轮灌组详情 | 
 |  |  |      * @param groupId | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     @GetMapping(path = "/getGroupDetails") | 
 |  |  |     public BaseResponse<VoGroupIntakes> getGroupDetails(@RequestParam Long groupId) { | 
 |  |  |         if(groupId == null) { | 
 |  |  |             return BaseResponseUtils.buildErrorMsg("轮灌组ID不能为空"); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         try { | 
 |  |  |             return BaseResponseUtils.buildSuccess(irrigationSv.getGroupDetails(groupId).get("content")); | 
 |  |  |         } catch (Exception e) { | 
 |  |  |             log.error("获取轮灌组详情异常", e); | 
 |  |  |             return BaseResponseUtils.buildException(e.getMessage()); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  | } |