# ServiceRequestCenter.java

    package cloud.wconnect.it.entity.servicerequestcenter;

    import cloud.wconnect.commonlib.util.DateTimeUtils;
    import com.baomidou.mybatisplus.annotation.IdType;
    import com.baomidou.mybatisplus.annotation.TableField;
    import com.baomidou.mybatisplus.annotation.TableId;
    import com.baomidou.mybatisplus.annotation.TableName;
    import lombok.Getter;
    import lombok.Setter;
    import lombok.ToString;
    import lombok.experimental.Accessors;

    import java.io.Serializable;

    /**
     * <p>
     *
     * </p>
     *
     * @author yyt
     * @since 2025-12-16
     */
    @Getter
    @Setter
    @ToString
    @Accessors(chain = true)
    @TableName("service_request_center")
    public class ServiceRequestCenter implements Serializable {

        private static final long serialVersionUID = 1L;

        /**
         * 主键
         */
        @TableId(value = "id", type = IdType.AUTO)
        private Integer id;

        /**
         * 租户 id
         */
        private Integer tenantId;

        /**
         * service 编号，TKT-yyyyMMdd0001
         */
        private String serviceNumber;

        /**
         * 1.low 2.medium 3.high 4.urgent
         */
        private Integer priority;

        /**
         * 1.account 2.it 3.product
         */
        private Integer type;

        /**
         * 1.resolved 2.open 3.in progress 4.closed
         */
        private Integer status;

        /**
         * title
         */
        private String title;

        /**
         * 描述
         */
        private String description;

        /**
         * 选择模块
         */
        private String modules;

        /**
         * 选择功能
         */
        private String functionIds;

        /**
         * 选择资产，[{"id":"资产 id","name":"资产名称"}]
         */
        private String properties;

        /**
         * 部门
         */
        private String department;

        /**
         * 邮箱
         */
        private String contactEmail;

        /**
         * 附件
         */
        private String attachments;

        /**
         * 责任人
         */
        private Integer dutyUser;

        /**
         * 第一次变为【In-progress】时间
         */
        private Long firstInProgressTime;

        /**
         * 解决时间
         */
        private Long resolvedTime;

        /**
         * 关闭人，系统关闭时为0
         */
        private Integer closedBy;

        /**
         * 关闭时间
         */
        private Long closedTime;

        /**
         * 创建人
         */
        private Integer createdBy;

        /**
         * 创建日期（yyyyMMdd）
         */
        private Integer createdDate;

        /**
         * 创建时间
         */
        private Long createdTime;

        /**
         * 待分配时间
         */
        private Long pendingAllocationTime;

        /**
         * 响应时间
         */
        @TableField(exist = false)
        private Long responseMinutes;

        /**
         * 解决时间
         */
        @TableField(exist = false)
        private Long resolutionMinutes;

        public void calculateResponseMinutes() {
            // 第1次变为【In-progress】时间 - 创建时间
            this.setResponseMinutes(DateTimeUtils.getMinutes(this.getCreatedTime(), this.getFirstInProgressTime()));
        }

        public void calculateResolutionMinutes() {
            // 完成时间 - 第一次变为【In-progress】时间
            this.setResolutionMinutes(DateTimeUtils.getMinutes(this.getFirstInProgressTime(), this.getResolvedTime()));
        }
    }