package com.yeejoin.amos.boot.module.jg.api.dto;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import org.springframework.util.StringUtils;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author system_generator
 * @date 2023-12-12
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "JgInstallationNoticeDto", description = "")
public class JgInstallationNoticeDto extends BaseDto {

    private static final long serialVersionUID = 1L;


    @ApiModelProperty(value = "告知单编号")
    private String applyNo;

    @ApiModelProperty(value = "设备种类")
    private String equList;

    @ApiModelProperty(value = "告知状态编号")
    private String noticeStatus;

    @ApiModelProperty(value = "告知状态描述")
    private String noticeStatusDesc;

    @ApiModelProperty(value = "设备数量")
    private Integer deviceNum;

    @ApiModelProperty(value = "安装单位id")
    private String installUnitId;

    @ApiModelProperty(value = "安装许可证编号")
    private String installLicenseNo;

    @ApiModelProperty(value = "安装单位名称")
    private String installUnitName;

    @ApiModelProperty(value = "安装许可有效期")
    private Date installLicenseExpirationDate;

    @ApiModelProperty(value = "安装地点-区域代码")
    private String regionNo;

    @ApiModelProperty(value = "安装地点_省")
    private String province;

    @ApiModelProperty(value = "安装地点_市")
    private String city;

    @ApiModelProperty(value = "设备使用地点_区（县）")
    private String county;

    @ApiModelProperty(value = "安装地点_街道（镇）")
    private String street;

    @ApiModelProperty(value = "设备详细使用地址")
    private String address;

    @ApiModelProperty(value = "安装负责人ID")
    private String installLeaderId;

    @ApiModelProperty(value = "安装负责人")
    private String installLeaderName;

    @ApiModelProperty(value = "安装负责人手机")
    private String installLeaderPhone;

    @ApiModelProperty(value = "安装开始日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date installStartDate;

    @ApiModelProperty(value = "安装竣工日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date installEndDate;

    @ApiModelProperty(value = "产权单位id")
    private String propertyUnitId;

    @ApiModelProperty(value = "产权单位")
    private String propertyUnitName;

    @ApiModelProperty(value = "使用单位id")
    private String useUnitId;

    @ApiModelProperty(value = "使用单位")
    private String useUnitName;

    @ApiModelProperty(value = "接收机构ID")
    private String receiveOrgId;

    @ApiModelProperty(value = "接收机构")
    private String receiveOrgName;

    @ApiModelProperty(value = "安装类型")
    private String installType;

    @ApiModelProperty(value = "委托单位")
    private String entrustingUnitName;

    @ApiModelProperty(value = "安装方案")
    private String installPlan;

    @ApiModelProperty(value = "流程建议")
    private String processAdvice;

    @ApiModelProperty(value = "撤销原由")
    private String cancelReason;

    @ApiModelProperty(value = "撤销说明")
    private String cancelRemark;

    @ApiModelProperty(value = "撤销处理截止日期")
    private Date cancelHandleDeadline;

    @ApiModelProperty(value = "撤销流水号")
    private String cancelProcessNo;

    @ApiModelProperty(value = "施工合同是否本单位与甲方直接签署")
    private String isSignedWithA;

    @ApiModelProperty(value = "检验单位代码")
    private String inspectUnitId;

    @ApiModelProperty(value = "检验单位")
    private String inspectUnitName;

    @ApiModelProperty(value = "是否已报检")
    private String isInspected;

    @ApiModelProperty(value = "设备安装质量证明书编号")
    private String installCertNo;

    @ApiModelProperty(value = "审核通过时间")
    private Date receiveTime;

    @ApiModelProperty(value = "状态")
    private String status;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "创建人ID")
    private String createUserId;

    @ApiModelProperty(value = "创建时间")
    private Date createDate;

    @ApiModelProperty(value = "录入单位ID")
    private String inputUnitNo;

    @ApiModelProperty(value = "安装委托书图片")
    private List<Map<String, String>> proxyStatementAttachmentList;

    @ApiModelProperty(value = "安装合同照片")
    private List<Map<String, String>> installContractAttachmentList;

    @ApiModelProperty(value = "安装委托书图片")
    private String proxyStatementAttachment;

    @ApiModelProperty(value = "安装合同照片")
    private String installContractAttachment;

    @ApiModelProperty(value = "是否西咸")
    private String isXixian;

    @ApiModelProperty(value = "告知日期")
    private Date noticeDate;

    @ApiModelProperty(value = "流程实例id")
    private String instanceId;

    @ApiModelProperty(value = "区名字")
    private String countyName;

    @ApiModelProperty(value = "市名字")
    private String cityName;

    @ApiModelProperty(value = "省名字")
    private String provinceName;

    @ApiModelProperty(value = "完整地址")
    private String fullAddress;

    @TableField(exist = false)
    @ApiModelProperty(value = "告知设备列表")
    private List<Map<String, Object>> deviceList;

    public String getFullAddress() {
        return (StringUtils.isEmpty(this.provinceName) ? "" : this.provinceName)
                + (StringUtils.isEmpty(this.cityName) ? "" : this.cityName)
                + (StringUtils.isEmpty(this.countyName) ? "" : this.countyName)
                + (StringUtils.isEmpty(this.address) ? "" : this.address);
    }
}
