package com.huimv.admin.controller;


import com.huimv.admin.common.utils.Result;
import com.huimv.admin.service.IEartagHourActService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.text.ParseException;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author author
 * @since 2023-09-19
 */
@RestController
@RequestMapping("/eartag-hour-act")
@CrossOrigin
public class EartagHourActController {
    @Autowired
    private IEartagHourActService eartagHourActService;

    @RequestMapping(value = "/getAct",method = RequestMethod.POST)
    public Result list(@RequestBody Map<String, Object> paramsMap) throws ParseException {
        String farmCode = "";
        if (paramsMap.get("farmId") != null) {
            farmCode = paramsMap.get("farmId")+"";
        }
        String startDate = "";
        if (paramsMap.get("startDate") != null) {
            startDate = paramsMap.get("startDate")+"";
        }
        String endDate = "";
        if (paramsMap.get("endDate") != null) {
            endDate = paramsMap.get("endDate")+"";
        }
        String earmark = "";
        if (paramsMap.get("earmark") != null) {
            earmark = paramsMap.get("earmark")+"";
        }
        return eartagHourActService.getHourAct(farmCode,startDate,endDate,earmark);
    }
}
