/*
 *    Copyright (c) 2018-2025, hnqz All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: hnqz
 */

package com.qunzhixinxi.hnqz.daemon.quartz.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.qunzhixinxi.hnqz.daemon.quartz.enums.CategoryEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.DecimalMin;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 结算表
 *
 * @author pigx code generator
 * @date 2021-01-26 15:44:49
 */
@Data
@TableName("wm_score_package_settle_note")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "")
public class WmScorePackageSettleNote extends Model<WmScorePackageSettleNote> {
	private static final long serialVersionUID = 1L;

	/**
	 *
	 */
	@TableId
	@ApiModelProperty(value = "")
	private Integer id;

	/**
	 *
	 */
	@ApiModelProperty(value = "")
	private String packageId;

	/**
	 *
	 */
	@ApiModelProperty(value = "")
	private String packageStatusId;

	/**
	 *
	 */
	@ApiModelProperty(value = "")
	private String taskId;
	/**
	 *
	 */
	@ApiModelProperty(value = "")
	@DecimalMin("0")
	private BigDecimal settleAmount;
	/**
	 *
	 */
	@ApiModelProperty(value = "")
	private String userId;

	/**
	 *
	 */
	@ApiModelProperty(value = "")
	private Integer invoiceType;
	/**
	 *
	 */
	@ApiModelProperty(value = "")
	private String settleNo;
	/**
	 *
	 */
	@ApiModelProperty(value = "")
	private BigDecimal discount;
	/**
	 *
	 */
	@ApiModelProperty(value = "")
	private Integer settleNoteStatus;

	/**
	 *
	 */
	@ApiModelProperty(value = "")
	private String categoryName;

	private String remark;

	private LocalDateTime createTime;

	private LocalDateTime updateTime;

	private LocalDateTime subTime;

	private LocalDateTime notifyTime;

	private String streamId;

	private String idCardNumber;

	private String subType;

	@TableField(exist = false)
	private String realName;

	@TableField(exist = false)
	private String idStr;

	/**
	 * @Modify: start
	 * @Version: 2021.4.16
	 * @Author: ryz
	 * @Date: 2021/4/22
	 */
	public String toCategoryName() {

		if (CategoryEnum.CATEGORY_1.getCode().equals(invoiceType)) {
			return CategoryEnum.CATEGORY_1.getDesc();
		} else if (CategoryEnum.CATEGORY_2.getCode().equals(invoiceType)) {
			return CategoryEnum.CATEGORY_2.getDesc();
		} else if (CategoryEnum.CATEGORY_3.getCode().equals(invoiceType)) {
			return CategoryEnum.CATEGORY_3.getDesc();
		} else if (CategoryEnum.CATEGORY_4.getCode().equals(invoiceType)) {
			return CategoryEnum.CATEGORY_4.getDesc();
		}

		return "";
	}
}
