zhubaomin
2024-11-29 750d08105ea928e547ec721c367a70ac946a0aef
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
package com.dy.pipIrrIrrigate.irrigatePlan;
 
import com.dy.common.aop.SsoAop;
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.pipIrrGlobal.voIr.VoGroupSimple;
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;
 
import java.util.List;
 
/**
 * @author ZhuBaoMin
 * @date 2024-11-28 17:20
 * @LastEditTime 2024-11-28 17:20
 * @Description 灌溉计划控制类
 */
 
@Slf4j
@RestController
@RequestMapping(path = "irrigatePlan")
@RequiredArgsConstructor
public class IrrigatePlanCtrl {
    private final IrrigatePlanSv irrigatePlanSv;
 
    /**
     * 根据农户编号获取轮灌组列表
     * @return
     */
    @GetMapping(path = "/getGroups")
    @SsoAop()
    public BaseResponse<List<VoGroupSimple>> getGroups(@RequestParam("clientId") Long clientId) {
        try {
            return BaseResponseUtils.buildSuccess(irrigatePlanSv.getGroups(clientId));
        } catch (Exception e) {
            log.error("获取任务类型异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
    }
}