zhubaomin
18 小时以前 cd7fd2ea35de966cfd1c6f3038e593097d7a6dec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package com.dy.pipIrrIrrigate.irrigation;
 
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.pipIrrGlobal.voIr.VoGroupIntakes;
import lombok.RequiredArgsConstructor;
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;
 
/**
 * @author ZhuBaoMin
 * @date 2025-07-03 10:58
 * @LastEditTime 2025-07-03 10:58
 * @Description
 */
 
@Slf4j
@RestController
@RequestMapping(path = "irrigation")
@RequiredArgsConstructor
public class IrrigationCtrl {
    private final IrrigationSv irrigationSv;
 
    /**
     * 根据轮灌组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());
        }
    }
}