package com.ltgk.catches.domain.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @Author: wan kun
 * @Description: 捕捞日志新增
 * @Date: 2025/1/18 16:50
 * @Version: 1.0
 */
@Data
public class FishLogAddReq {
    /**
     * 船舶id
     */
    @NotBlank(message = "船舶id不能为空")
    @JsonProperty(value = "boatId")
    @ApiModelProperty(value = "船舶id")
    private String boatId;

    /**
     * 捕捞日志日期
     */
    @NotNull(message = "捕捞日志日期不能为空")
    @JsonProperty(value = "date")
    @ApiModelProperty(value = "捕捞日志日期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date date;
    /**
     * 行政区域编码
     */
    @JsonProperty(value = "areaCode")
    @ApiModelProperty(value = "行政区域编码")
    private String areaCode;

    /**
     * 行政区域名称
     */
    @JsonProperty(value = "areaName")
    @ApiModelProperty(value = "行政区域名称")
    private String areaName;

    @JsonProperty(value = "netList")
    @ApiModelProperty(value = "网序列表")
    private List<NetList> netList;

    /**
     * 网序参数
     */
    @Data
    public static class NetList {
        /**
         * 网序序号
         */
        @NotNull(message = "网序序号不能为空")
        @JsonProperty(value = "netNum")
        @ApiModelProperty(value = "网序序号")
        private String netNum;

        /**
         * 放网时间
         */
        @NotBlank(message = "放网时间不能为空")
        @JsonProperty(value = "putNetTime")
        @ApiModelProperty(value = "放网时间")
        private String putNetTime;

        /**
         * 起网时间
         */
        @NotBlank(message = "起网时间不能为空")
        @JsonProperty(value = "riseNetTime")
        @ApiModelProperty(value = "起网时间")
        private String riseNetTime;

        /**
         * 放网经度
         */
        @NotBlank(message = "放网经度不能为空")
        @JsonProperty(value = "putNetLongitude")
        @ApiModelProperty(value = "放网经度")
        private BigDecimal putNetLongitude;

        /**
         * 放网纬度
         */
        @NotBlank(message = "放网纬度不能为空")
        @JsonProperty(value = "putNetLatitude")
        @ApiModelProperty(value = "放网纬度")
        private BigDecimal putNetLatitude;

        /**
         * 起网经度
         */
        @NotBlank(message = "起网经度不能为空")
        @JsonProperty(value = "riseNetLongitude")
        @ApiModelProperty(value = "起网经度")
        private BigDecimal riseNetLongitude;

        /**
         * 放网纬度
         */
        @NotBlank(message = "起网纬度不能为空")
        @JsonProperty(value = "riseNetLatitude")
        @ApiModelProperty(value = "放网纬度")
        private BigDecimal riseNetLatitude;

        /**
         * 网次产量 kg
         */
        @NotBlank(message = "网次产量不能为空")
        @JsonProperty(value = "netYield")
        @ApiModelProperty(value = "网次产量 kg")
        private BigDecimal netYield;
        /**
         * 网次渔获物品种产量
         */
        @JsonProperty(value = "netYieldDetails")
        @ApiModelProperty(value = "网次渔获物品种产量")
        private List<NetYieldDetail> netYieldDetails;
    }

    @Data
    public static class NetYieldDetail {
        @JsonProperty(value = "aquaticDictId")
        @ApiModelProperty(value = "水产字典表id")
        private String aquaticDictId;

        @JsonProperty(value = "yield")
        @ApiModelProperty(value = "产量kg")
        private BigDecimal yield;
    }
}
