package cn.iocoder.yudao.module.pms.controller.admin.iotrddailyreport.vo;

import cn.iocoder.yudao.module.pms.controller.admin.iotprojecttask.vo.IotProjectTaskPlatformVO;
import cn.iocoder.yudao.module.pms.controller.admin.iotrddailyreportdetail.vo.IotRdDailyReportDetailRespVO;
import cn.iocoder.yudao.module.pms.controller.admin.vo.IotDeviceSimpleRespVO;
import cn.iocoder.yudao.module.pms.dal.dataobject.iotattachment.IotAttachmentDO;
import cn.iocoder.yudao.module.pms.dal.dataobject.iotdailyreportattrs.IotDailyReportAttrsDO;
import cn.iocoder.yudao.module.pms.dal.dataobject.iotdailyreportfuel.IotDailyReportFuelDO;
import cn.iocoder.yudao.module.pms.dal.dataobject.iotprojecttaskattrs.IotTaskAttrModelProperty;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.List;
import java.util.Set;

@Schema(description = "管理后台 - 瑞都日报 Response VO")
@Data
@ExcelIgnoreUnannotated
public class IotRdDailyReportRespVO {

    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    @Schema(description = "创建时间")
    @ExcelProperty("创建时间")
    private String createTimeStr;

    @Schema(description = "部门名称", example = "压裂二队,压裂五队")
    @ExcelProperty("施工队伍")
    private String deptName;

    @Schema(description = "合同/项目名称", example = "酸化压裂合同")
    @ExcelProperty("项目")
    private String contractName;

    @Schema(description = "任务 井号", example = "YS45-211平台")
    @ExcelProperty("任务")
    private String taskName;

    @Schema(description = "任务 施工地点", example = "山西兴县")
    @ExcelProperty("施工地点")
    private String location;

    @Schema(description = "施工状态(动迁上井/动迁下井/施工准备/施工...)", example = "1")
    @ExcelProperty("施工状态")
    private String rdStatusLabel;

    @Schema(description = "带班干部id集合", example = "[123,345...]")
    private Set<Long> responsiblePerson;

    @Schema(description = "带班干部姓名", example = "张三,李四...")
    @ExcelProperty("带班干部")
    private String responsiblePersonNames;

    @Schema(description = "填报人姓名", example = "张三,李四...")
    @ExcelProperty("填报人")
    private String submitterNames;

    @Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "13853")
    private Long id;

    @Schema(description = "施工队伍id", example = "22577")
    private Long deptId;

    @Schema(description = "施工队伍所属上级项目部id", example = "32587")
    private Long projectDeptId;

    @Schema(description = "平台井标识 2非平台井 1平台井 0默认值", example = "1")
    private Integer platformWell;

    @Schema(description = "平台井组", example = "463e3996-be48-4758-8229-c1351cbf3e37")
    private String platformGroup;

    @Schema(description = "任务平台井标识", example = "463e3996-be48-4758-8229-c1351cbf3e37")
    private String taskPlatform;

    @Schema(description = "日报名称", example = "西南压裂项目部/2025-10-17日报填报")
    @ExcelProperty("日报名称")
    private String reportName;

    @Schema(description = "项目id", example = "32587")
    private Long projectId;

    @Schema(description = "任务id", example = "15678")
    private Long taskId;

    @Schema(description = "项目类别(钻井 修井 注氮 酸化压裂... )")
    private String projectClassification;

    @Schema(description = "施工工艺([123,233])")
    private Set<Long> techniqueIds;

    @Schema(description = "施工设备([123,233])")
    private Set<Long> deviceIds;

    @Schema(description = "时间节点-开始")
    private LocalTime startTime;

    @Schema(description = "时间节点-结束")
    private LocalTime endTime;

    @Schema(description = "累计施工井")
    @ExcelProperty("累计施工井")
    private BigDecimal cumulativeWorkingWell;

    @Schema(description = "累计施工层")
    @ExcelProperty("累计施工层")
    private BigDecimal cumulativeWorkingLayers;

    @Schema(description = "当日泵车台次")
    @ExcelProperty("当日泵车台次")
    private BigDecimal dailyPumpTrips;

    @Schema(description = "当日仪表/混砂")
    @ExcelProperty("当日仪表/混砂")
    private BigDecimal dailyToolsSand;

    @Schema(description = "趟数", example = "29453")
    @ExcelProperty("趟数")
    private BigDecimal runCount;

    @Schema(description = "桥塞")
    @ExcelProperty("桥塞")
    private BigDecimal bridgePlug;

    @Schema(description = "水方量")
    @ExcelProperty("水方量")
    private BigDecimal waterVolume;

    @Schema(description = "时间H", example = "5062")
    @ExcelProperty("时间H")
    private BigDecimal hourCount;

    @Schema(description = "当日油耗(L)")
    @ExcelProperty("当日油耗(L)")
    private BigDecimal dailyFuel;

    @Schema(description = "当日用电量(kWh)")
    private BigDecimal dailyPowerUsage;

    @Schema(description = "生产时间(H)")
    private BigDecimal productionTime;

    @Schema(description = "非生产时间(H)")
    private BigDecimal nonProductionTime;

    @Schema(description = "非生产时间原因", example = "不喜欢")
    private String rdNptReason;

    @Schema(description = "非生产时效")
    @ExcelProperty("非生产时效")
    private String nonProductionRateFormat;

    @Schema(description = "事故非生产时间(H)")
    @ExcelProperty("工程质量H")
    private BigDecimal accidentTime;

    @Schema(description = "修理非生产时间(H)")
    @ExcelProperty("设备故障H")
    private BigDecimal repairTime;

    @Schema(description = "自停非生产时间(H)")
    @ExcelProperty("设备保养H")
    private BigDecimal selfStopTime;

    @Schema(description = "复杂非生产时间(H)")
    @ExcelProperty("技术受限H")
    private BigDecimal complexityTime;

    @Schema(description = "搬迁非生产时间(H)")
    @ExcelProperty("生产配合H")
    private BigDecimal relocationTime;

    @Schema(description = "整改非生产时间(H)")
    @ExcelProperty("生产组织H")
    private BigDecimal rectificationTime;

    @Schema(description = "等停非生产时间(H)")
    @ExcelProperty("不可抗力H")
    private BigDecimal waitingStopTime;

    @Schema(description = "冬休非生产时间(H)")
    @ExcelProperty("待命T")
    private BigDecimal winterBreakTime;

    @Schema(description = "甲方设计-非生产时间")
    @ExcelProperty("甲方设计H")
    private BigDecimal partyaDesign;

    @Schema(description = "甲方准备-非生产时间")
    @ExcelProperty("甲方准备H")
    private BigDecimal partyaPrepare;

    @Schema(description = "甲方资源-非生产时间")
    @ExcelProperty("甲方资源H")
    private BigDecimal partyaResource;

    @Schema(description = "其它非生产时间")
    @ExcelProperty("其它非生产时间H")
    private BigDecimal otherNptTime;

    @Schema(description = "其它非生产时间原因")
    @ExcelProperty("其它非生产时间原因")
    private String otherNptReason;

    @Schema(description = "非生产时间填写标识 true false")
    private Boolean nonProductFlag = false;

    @Schema(description = "施工开始日期")
    private LocalDateTime constructionStartDate;

    @Schema(description = "施工结束日期")
    private LocalDateTime constructionEndDate;

    @Schema(description = "当日生产情况生产动态", example = "2")
    @ExcelProperty("当日生产动态")
    private String productionStatus;

    @Schema(description = "外租情况(可能有附件)")
    @ExcelProperty("外租情况")
    private String externalRental;

    @Schema(description = "下步工作计划")
    @ExcelProperty("下步工作计划")
    private String nextPlan;

    @Schema(description = "施工简报")
    @ExcelProperty("施工简报")
    private String constructionBrief;

    @Schema(description = "施工状态(动迁上井/动迁下井/施工准备/施工...)", example = "1")
    private String rdStatus;

    @Schema(description = "故障情况")
    @ExcelProperty("故障情况")
    private String malfunction;

    @Schema(description = "故障误工h")
    @ExcelProperty("故障误工h")
    private BigDecimal faultDowntime;

    @Schema(description = "人员情况")
    private String personnel;

    @Schema(description = "全员数量")
    private BigDecimal totalStaffNum;

    @Schema(description = "休假人员数量")
    private BigDecimal leaveStaffNum;

    @Schema(description = "不同专业公司的扩展属性值")
    private List<IotTaskAttrModelProperty> extProperty;

    @Schema(description = "排序值")
    private Integer sort;

    @Schema(description = "备注", example = "随便")
    @ExcelProperty("备注")
    private String remark;

    @Schema(description = "状态(0启用 1禁用)", example = "2")
    private Integer status;

    @Schema(description = "流程实例id", example = "16415")
    private String processInstanceId;

    @Schema(description = "审批状态 未提交、审批中、审批通过、审批不通过、已取消", example = "1")
    private Integer auditStatus;

    @Schema(description = "审批意见", example = "审核通过")
    private String opinion;

    @Schema(description = "日报填写时间")
    private LocalDateTime fillTime;

    @Schema(description = "审批时间")
    private LocalDateTime approvalTime;

    /**
     * 扩展字段
     */
    @Schema(description = "时间节点区域 startTime-endTime", example = "8:00 - 8:00")
    private String timeRange;

    @Schema(description = "井号", example = "YS45-211平台")
    private String wellName;

    @Schema(description = "客户名称", example = "YS45-211平台-山西兴县")
    private String manufactureName;

    @Schema(description = "施工工艺(多个逗号分隔)", example = "压裂大包,主压裂车...")
    private String techniqueNames;

    @Schema(description = "设备配置", example = "黑EN9500,黑EN7958...")
    private String deviceNames;



    @Schema(description = "公司id", example = "125")
    private Long companyId;

    @Schema(description = "工作量属性", example = "累计施工-层,当日泵车台次...")
    private List<IotDailyReportAttrsDO> dailyReportAttrs;

    @Schema(description = "搬迁日期", example = "125")
    private String relocationDate;

    @Schema(description = "开工日期", example = "125")
    private String commencementDate;

    @Schema(description = "完工日期", example = "125")
    private String completionDate;

    @Schema(description = "施工周期D", example = "125")
    private String constructionPeriod;

    @Schema(description = "停待时间D", example = "12")
    private String idleTime;

    /**
     * 扩展属性
     */
    @Schema(description = "附件列表", example = "https://aims.deepoil.cc/admin-api/infra/file/29/get/人力资源.png")
    private List<IotAttachmentDO> attachments;

    @Schema(description = "施工设备列表", example = "https://aims.deepoil.cc/admin-api/infra/file/29/get/人力资源.png")
    private List<IotDeviceSimpleRespVO> selectedDevices;

    @Schema(description = "平台井列表", example = "[]")
    private List<IotProjectTaskPlatformVO> platforms;

    @Schema(description = "已经施工完成的 平台井列表", example = "[]")
    private List<IotProjectTaskPlatformVO> finishedPlatforms;

    @Schema(description = "虚拟项目标识", example = "Y N")
    private String virtualProject;

    @Schema(description = "日报关联的油耗记录")
    private List<IotDailyReportFuelDO> reportFuels;

    @Schema(description = "日报关联的已经填报的油耗记录")
    private List<IotDailyReportFuelDO> reportedFuels;

    @Schema(description = "工作量", example = "1 井次")
    private String workloadDesign;

    @Schema(description = "任务施工进度", example = "施工准备2025-12-01 -> 施工2025-12-02")
    private List<IotRdDailyReportTaskProgressVO> taskProgresses;

    @Schema(description = "小组内累计 桥塞(个数)")
    private BigDecimal groupIdBridgePlug;
    @Schema(description = "小组内累计 趟数")
    private BigDecimal groupIdRunCount;
    @Schema(description = "小组内累计 井数")
    private BigDecimal groupIdCumulativeWorkingWell;
    @Schema(description = "小组内累计 小时H")
    private BigDecimal groupIdHourCount;

    @Schema(description = "小组内累计 油耗")
    private BigDecimal groupIdFuel;
    @Schema(description = "小组内累计 水方量(方)")
    private BigDecimal groupIdWaterVolume;
    @Schema(description = "小组内累计 泵车台次")
    private BigDecimal groupIdPumpTrips;
    @Schema(description = "小组内累计 段数  累计施工-层")
    private BigDecimal groupIdCumulativeWorkingLayers;
    @Schema(description = "小组内累计 台次 当日仪表/混砂")
    private BigDecimal groupIdMixSand;

    @Schema(description = "小组内最后1条记录标识 true false")
    private boolean lastGroupIdFlag = false;

    @Schema(description = "非生产时效")
    private BigDecimal nonProductionRate;

    @Schema(description = "生产动态明细")
    private List<IotRdDailyReportDetailRespVO> reportDetails;

    @Schema(description = "队伍排序值")
    private Integer teamSort;

    @Schema(description = "项目部排序值")
    private Integer projectSort;

    @Schema(description = "项目部名称")
    private String projectName;
}