package org.dromara.safety.constant;

import org.dromara.common.core.utils.DateUtils;
import org.dromara.safety.domain.HseSafetyInspection;

import java.text.SimpleDateFormat;

/**
 * @author lcj
 * @date 2025/4/16 23:09
 */
public interface HseSafetyConstant {

    String SAFETY_INSPECTION_TYPE = "safety_inspection_type";

    String SAFETY_INSPECTION_CHECK_TYPE = "safety_inspection_check_type";

    String SAFETY_INSPECTION_VIOLATION_TYPE = "safety_inspection_violation_type";

    String SAFETY_INSPECTION_FILE_URL = "docs/safety/inspection/";

    String SAFETY_INSPECTION_TEMPLATE_PATH = "template/安全生产监督检查通知书模版.docx";

    static String getSafetyInspectionFileUrl(HseSafetyInspection safetyInspection) {
        String timestamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(safetyInspection.getUpdateTime());
        return String.format("%s%s/%s", SAFETY_INSPECTION_FILE_URL, safetyInspection.getId(), timestamp);
    }

    static String getSafetyInspectionFileName(HseSafetyInspection safetyInspection) {
        String createDate = DateUtils.formatDate(safetyInspection.getCreateTime());
        return String.format("安全生产监督检查通知书（%s）.docx", createDate);
    }

}
