package org.security.trans.prevent.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.security.common.Constant;
import org.security.flow.core.constant.ProcessConstant;
import org.security.ht.vo.common.UploadVO;
import org.security.trans.prevent.entity.PreventRisk;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.DateUtil;

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

/**
 * 风险提示表视图实体类
 *
 * @author BladeX
 * @since 2022-07-07
 */
@Data
@ApiModel(value = "PreventRiskVO对象", description = "风险提示表")
public class PreventRiskVO extends PreventRisk {
	private static final long serialVersionUID = 1L;

	@ApiModelProperty(value = "机构名称")
	private String deptName;

	private List<UploadVO> fileList;

	private boolean editable;


	public boolean isEditable() {
		if ((Constant.HANDIN_STATE_DRAFT.equals(this.getState()) || Constant.HANDIN_STATE_REFUSE.equals(this.getState()) || ProcessConstant.CANCEL_STATE.equals(this.getState())) && String.valueOf(AuthUtil.getUserId()).equals(this.getCreatedBy()) ) {
			return true;
		}
		return false;
	}
}
