package com.ltgk.boat.domain.dto;

import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.lang.reflect.Field;
import java.math.BigDecimal;

/**
 * @Author: wan kun
 * @Description: 新增修改检验证书
 * @Date: 2024/12/24 17:55
 * @Version: 1.0
 */
@Data
public class SaveBoatExamineReq {
    @ApiModelProperty(value = "渔船检验信息唯一标识")
    @JsonProperty(value = "id")
    private String id;
    @ApiModelProperty("渔船信息唯一标识")
    @JsonProperty(value = "boatId")
    @NotBlank(message = "渔船信息唯一标识不能为空")
    private String boatId;
    @ApiModelProperty("渔船所属地区代码")
    @JsonProperty(value = "areaCode")
    private String areaCode;
    @ApiModelProperty("渔船所属地区名称")
    @JsonProperty(value = "areaName")
    private String areaName;
    @ApiModelProperty("渔船检验证书编号")
    @JsonProperty(value = "examineCode")
    private String examineCode;
    @ApiModelProperty("船舶检验登记号")
    @JsonProperty(value = "examineRegisterCode")
    private String examineRegisterCode;
    @ApiModelProperty("检验申请日期")
    @JsonProperty(value = "applyDate")
    private String applyDate;
    @ApiModelProperty("检验类型")
    @JsonProperty(value = "examineType")
    private String examineType;
    @ApiModelProperty("检验类型执行标准")
    @JsonProperty(value = "examineStandard")
    private String examineStandard;
    @ApiModelProperty("船型代号")
    @JsonProperty(value = "shipTypeCode")
    private String shipTypeCode;
    @ApiModelProperty("设计航速")
    @JsonProperty(value = "designSog")
    private String designSog;
    @ApiModelProperty("最大航速")
    @JsonProperty(value = "maxSog")
    private String maxSog;
    @ApiModelProperty("主机1转速")
    @JsonProperty(value = "mainOneSpeed")
    private String mainOneSpeed;
    @ApiModelProperty("主机2转速")
    @JsonProperty(value = "mainTwoSpeed")
    private String mainTwoSpeed;
    @ApiModelProperty("主机3转速")
    @JsonProperty(value = "mainThreeSpeed")
    private String mainThreeSpeed;
    @ApiModelProperty("总长")
    @JsonProperty(value = "totalLength")
    private String totalLength;
    @ApiModelProperty("上甲板长度")
    @JsonProperty(value = "upperDeckLength")
    private String upperDeckLength;
    @ApiModelProperty("龙骨安放日期")
    @JsonProperty(value = "keelLayDate")
    private String keelLayDate;
    @ApiModelProperty("船舶定员总人数")
    @JsonProperty(value = "staffNum")
    private String staffNum;
    @ApiModelProperty("检验开始日期")
    @JsonProperty(value = "examineStartTime")
    private String examineStartTime;
    @ApiModelProperty("检验完成日期")
    @JsonProperty(value = "examineEndTime")
    private String examineEndTime;
    @ApiModelProperty("检验部门")
    @JsonProperty(value = "examineDept")
    private String examineDept;
    @ApiModelProperty("渔业船舶检验证书有效期")
    @JsonProperty(value = "examineValidity")
    private String examineValidity;
    @ApiModelProperty("展期有效期")
    @JsonProperty(value = "extensionValidity")
    private String extensionValidity;
    @ApiModelProperty("上次签证有效期")
    @JsonProperty(value = "lastVisaValidity")
    private String lastVisaValidity;
    @ApiModelProperty("检验地点")
    @JsonProperty(value = "examineAddr")
    private String examineAddr;
    @ApiModelProperty("渔业船舶检验证书发证地点")
    @JsonProperty(value = "issuanceAddr")
    private String issuanceAddr;
    @ApiModelProperty("下次检验类型")
    @JsonProperty(value = "nextExamineType")
    private String nextExamineType;
    @ApiModelProperty("下次检验日期")
    @JsonProperty(value = "nextExamineDate")
    private String nextExamineDate;
    @ApiModelProperty("设计吃水")
    @JsonProperty(value = "designedDraft")
    private String designedDraft;
    @ApiModelProperty("设计排水量")
    @JsonProperty(value = "designedDrainage")
    private String designedDrainage;
    @ApiModelProperty("准许该船从事")
    @JsonProperty(value = "boatDo")
    private String boatDo;
    @ApiModelProperty("准许该船航行与作业区域")
    @JsonProperty(value = "boatWordPlace")
    private String boatWordPlace;
    @ApiModelProperty("渔业船舶检验证书发证日期")
    @JsonProperty(value = "examineIssuanceDate")
    private String examineIssuanceDate;
    @ApiModelProperty("造船厂名称")
    @JsonProperty(value = "shipyardName")
    private String shipyardName;
    @ApiModelProperty("造船厂名称英文")
    @JsonProperty(value = "shipyardNameEn")
    private String shipyardNameEn;
    @ApiModelProperty("造船厂地址")
    @JsonProperty(value = "shipyardAddr")
    private String shipyardAddr;
    @ApiModelProperty("造船厂电话")
    @JsonProperty(value = "shipyardPhone")
    private String shipyardPhone;
    @ApiModelProperty("航行区域")
    @JsonProperty(value = "navigate")
    private String navigate;
    @ApiModelProperty("抗风等级")
    @JsonProperty(value = "windLoading")
    private String windLoading;
    @ApiModelProperty("核载人数")
    @JsonProperty(value = "peopleNum")
    private BigDecimal peopleNum;
    @ApiModelProperty("检验记事")
    @JsonProperty(value = "inspectionNotes")
    private String inspectionNotes;
    @ApiModelProperty("救生设备可用总人数")
    @JsonProperty(value = "lifesavingPeopleNum")
    private BigDecimal lifesavingPeopleNum;
    @ApiModelProperty("左舷救生艇型式")
    @JsonProperty(value = "leftLifeboatType")
    private String leftLifeboatType;
    @ApiModelProperty("左舷救生艇数量")
    @JsonProperty(value = "leftLifeboatNum")
    private BigDecimal leftLifeboatNum;
    @ApiModelProperty("左舷救生艇共载人数")
    @JsonProperty(value = "leftLifeboatPeopleNum")
    private BigDecimal leftLifeboatPeopleNum;
    @ApiModelProperty("右舷救生艇型式")
    @JsonProperty(value = "rightLifeboatType")
    private String rightLifeboatType;
    @ApiModelProperty("右舷救生艇数量")
    @JsonProperty(value = "rightLifeboatNum")
    private BigDecimal rightLifeboatNum;
    @ApiModelProperty("右舷救生艇共载人数")
    @JsonProperty(value = "rightLifeboatPeopleNum")
    private BigDecimal rightLifeboatPeopleNum;
    @ApiModelProperty("救生筏型式1")
    @JsonProperty(value = "lifeRaftOneType")
    private String lifeRaftOneType;
    @ApiModelProperty("救生筏定员1")
    @JsonProperty(value = "lifeRaftOnePeople")
    private BigDecimal lifeRaftOnePeople;
    @ApiModelProperty("救生筏数量1")
    @JsonProperty(value = "lifeRaftOneNum")
    private BigDecimal lifeRaftOneNum;
    @ApiModelProperty("救生筏型式2")
    @JsonProperty(value = "lifeRaftTwoType")
    private String lifeRaftTwoType;
    @ApiModelProperty("救生筏定员2")
    @JsonProperty(value = "lifeRaftTwoPeople")
    private BigDecimal lifeRaftTwoPeople;
    @ApiModelProperty("救生筏数量2")
    @JsonProperty(value = "lifeRaftTwoNum")
    private BigDecimal lifeRaftTwoNum;
    @ApiModelProperty("救生浮具型式")
    @JsonProperty(value = "buoyantApparatusType")
    private String buoyantApparatusType;
    @ApiModelProperty("救生浮具定员")
    @JsonProperty(value = "buoyantApparatusPeople")
    private BigDecimal buoyantApparatusPeople;
    @ApiModelProperty("救生浮具数量")
    @JsonProperty(value = "buoyantApparatusNum")
    private BigDecimal buoyantApparatusNum;
    @ApiModelProperty("救生圈型式")
    @JsonProperty(value = "lifeBuoyType")
    private String lifeBuoyType;
    @ApiModelProperty("救生圈数量")
    @JsonProperty(value = "lifeBuoyNum")
    private BigDecimal lifeBuoyNum;
    @ApiModelProperty("救生衣型式")
    @JsonProperty(value = "lifeJacketType")
    private String lifeJacketType;
    @ApiModelProperty("救生衣数量")
    @JsonProperty(value = "lifeJacketNum")
    private BigDecimal lifeJacketNum;
    @ApiModelProperty("应急电源原动机型号")
    @JsonProperty(value = "emergencySupplyType")
    private String emergencySupplyType;
    @ApiModelProperty("应急电源原动机型号英文")
    @JsonProperty(value = "emergencySupplyTypeEn")
    private String emergencySupplyTypeEn;
    @ApiModelProperty("应急电源原动机启动方式")
    @JsonProperty(value = "emergencySupplyStartType")
    private String emergencySupplyStartType;
    @ApiModelProperty("应急电源原动机启动方式英文")
    @JsonProperty(value = "emergencySupplyStartTypeEn")
    private String emergencySupplyStartTypeEn;
    @ApiModelProperty("船名")
    @JsonProperty(value = "boatName")
    private String boatName;
    @ApiModelProperty("鱼舱数量")
    @JsonProperty(value = "fishholdNum")
    private BigDecimal fishholdNum;
    @ApiModelProperty("船网工具指标批准书编号")
    @JsonProperty(value = "networkApprovalNum")
    private String networkApprovalNum;
    @ApiModelProperty("核准船长")
    @JsonProperty(value = "approvalLength")
    private BigDecimal approvalLength;
    @ApiModelProperty("核准总吨")
    @JsonProperty(value = "approvalTonnage")
    private BigDecimal approvalTonnage;
    @ApiModelProperty("甲板层数")
    @JsonProperty(value = "deckNum")
    private BigDecimal deckNum;
    @ApiModelProperty("操作说明")
    @JsonProperty(value = "remark")
    private String remark;

    public void checkoutData() throws IllegalAccessException {
        Field[] fields = SaveBoatExamineReq.class.getDeclaredFields();
        for (Field field : fields) {
            Object object = field.get(this);
            if (ObjectUtils.isEmpty(object)) {
                field.set(this, null);
            }
        }

    }
}
