package com.yuchen.saas.park.api.vo.park;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.*;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yuchen.saas.park.api.enums.SnapshotNewspaperEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.nest.springwrap.core.tenant.mp.TenantEntity;
import org.nest.springwrap.core.tool.utils.Func;

import java.util.Date;

/**
 * <p>
 * 随手拍管理表
 * </p>
 *
 * @author cxj
 * @since 2023-07-20
 */
@Data
@HeadStyle(horizontalAlignment = HorizontalAlignment.CENTER)
@HeadRowHeight(25)
@ContentStyle(horizontalAlignment = HorizontalAlignment.CENTER)
@ColumnWidth(12)
@ContentRowHeight(15)
@HeadFontStyle(fontHeightInPoints =9)
@ExcelIgnoreUnannotated
public class PmgBatParkSnapshotNewspaperExcel extends TenantEntity {


    @ExcelProperty("所在园区")
    @ApiModelProperty(name = "parkName", value = "所在园区")
    private String parkName;

    @ExcelProperty("拍报类型")
    @ApiModelProperty(name = "newspaperTypeName", value = "拍报类型:0其他,1违规停车占道,2设备异常故障,3环境卫生问题,4违规不良行为")
    private String newspaperTypeName;

    /**
     * 拍报类型:0其他,1违规停车占道,2设备异常故障,3环境卫生问题,4违规不良行为
     */
    @ApiModelProperty(name = "newspaperType", value = "拍报类型:0其他,1违规停车占道,2设备异常故障,3环境卫生问题,4违规不良行为")
    private Integer newspaperType;

    @ExcelProperty("描述信息")
    @ApiModelProperty(name = "newspaperRemark", value = "拍报反馈")
    private String newspaperRemark;


    @ExcelProperty("拍报时间")
    @DateTimeFormat(value = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;


    @ExcelProperty("拍报账号")
    @ApiModelProperty(name = "phone", value = "拍报账号")
    private String phone;

    /**
     * 处理状态:0待处理,1已处理
     */
    @ExcelProperty("处理状态")
    @ApiModelProperty(name = "handleState", value = "处理状态:0待处理,1已处理")
    private String handleStateStr;

    public String getHandleStateStr(){
        if(Func.isEmpty(handleState)){
            return "";
        }
        if(0==handleState){
            return "待处理";
        }else if(1==handleState){
            return "已处理";
        }
        return "";
    }

    /**
     * 处理状态:0待处理,1已处理
     */
    @ApiModelProperty(name = "handleState", value = "处理状态:0待处理,1已处理")
    private Integer handleState;

    @ExcelProperty("处理时间")
    @DateTimeFormat(value = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(name = "handleTime", value = "处理时间")
    private Date handleTime;

    @ExcelProperty("处理结果")
    @ApiModelProperty(name = "handleTypeStr", value = "处理结果:0无需处理,1已解决,2未解决")
    private String handleTypeStr;

    public String getHandleTypeStr(){
        if(Func.isEmpty(handleType)){
            return "";
        }
        if(0==handleType){
            return "无需处理";
        }else if(1==handleType){
            return "已解决";
        }else if(2==handleType){
            return "未解决";
        }
        return "";
    }

    /**
     * 处理结果:0无需处理,1已解决,2未解决
     */
    @ApiModelProperty(name = "handleType", value = "处理结果:0无需处理,1已解决,2未解决")
    private Integer handleType;

    @ExcelProperty("处理人")
    @ApiModelProperty(name = "handleUserName", value = "处理人名字")
    private String handleUserName;

    @ExcelProperty("处理备注")
    @ApiModelProperty(name = "handleRemark", value = "处理备注")
    private String handleRemark;
    /**
     * 处理图片地址 逗号隔开
     */
    @ApiModelProperty(name = "handleFile", value = "处理图片地址 逗号隔开")
    private String handleFile;
    /**
     * 处理人id
     */
    @ApiModelProperty(name = "handleUserId", value = "处理人id")
    private Long handleUserId;

    @ApiModelProperty(value = "openId")
    private String openId;

    @ApiModelProperty(name = "userDetailId", value = "创建人userDetailId")
    private Long userDetailId;

    public String getNewspaperTypeName(){
        return SnapshotNewspaperEnum.getDescByCode(newspaperType);
    }

}
