package com.brilliance.isc.vo.automatic;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;

import java.util.List;

/**
 * 对复核结果ResultVo的包装，用于自动化
 */
@JsonIgnoreProperties(ignoreUnknown = true)
@Data
public class TrnrelResultVo {
    private String respCode;

    private String respMsg;

    private boolean confirm;

    private boolean success;

    private List confirmMsg;

    private static final String FAIL_CODE = "999999";
    private static final String CODE_SUCCESS="AAAAAA";

    public  void reset(){
        this.respCode="";
        this.respMsg="";
        this.success=false;
    }

    public static TrnrelResultVo fail(String message) {
        TrnrelResultVo TrnrelResultVo = new TrnrelResultVo();
        TrnrelResultVo.setRespCode(FAIL_CODE);
        TrnrelResultVo.setRespMsg(message);
        TrnrelResultVo.setSuccess(false);
        return TrnrelResultVo;
    }

    public static TrnrelResultVo fail(String failCode,String message) {
        TrnrelResultVo TrnrelResultVo = new TrnrelResultVo();
        TrnrelResultVo.setRespCode(failCode);
        TrnrelResultVo.setRespMsg(message);
        TrnrelResultVo.setSuccess(false);
        return TrnrelResultVo;
    }

    public static TrnrelResultVo success(String message) {
        TrnrelResultVo TrnrelResultVo = new TrnrelResultVo();
        TrnrelResultVo.setRespCode(CODE_SUCCESS);
        TrnrelResultVo.setRespMsg(message);
        TrnrelResultVo.setSuccess(true);
        return TrnrelResultVo;
    }
    public static TrnrelResultVo success() {
        TrnrelResultVo TrnrelResultVo = new TrnrelResultVo();
        TrnrelResultVo.setRespCode(CODE_SUCCESS);
        TrnrelResultVo.setSuccess(true);
        return TrnrelResultVo;
    }
}
