package com.pj.project.tb_fee_statistics;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.*;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.experimental.Accessors;

/**
 * Model: tb_fee_statistics -- 收费统计表
 * @author lzm 
 */
@Data
@Accessors(chain = true)
@TableName(TbFeeStatistics.TABLE_NAME)
@EqualsAndHashCode(callSuper = false)
public class TbFeeStatistics implements Serializable {

	// ---------- 模块常量 ----------
	/**
	 * 序列化版本id 
	 */
	private static final long serialVersionUID = 1L;	
	/**
	 * 此模块对应的表名 
	 */
	public static final String TABLE_NAME = "tb_fee_statistics";	
	/**
	 * 此模块对应的权限码 
	 */
	public static final String PERMISSION_CODE = "tb-fee-statistics";	


	// ---------- 表中字段 ----------
	/**
	 * 主键 
	 */
    private String id;

	/**
	 * 收费类型(1=核酸检测,2消杀作业,3=装卸作业,4=停车费,5=过磅费) 
	 */
    private Integer feeType;


	/**
	 * 业务类型id 
	 */
    private String itemTypeId;

	/**
	 * 业务类型 
	 */
    private String itemTypeName;

	/**
	 * 年份 
	 */
    private String year;

	/**
     * 月份
     */
    private String month;

    /**
     * 天
     */
    private String day;

	/**
	 * 日期 
	 */
    private Date dayTime;

	/**
	 * 数量 
	 */
    private Integer num = 0;

	/**
	 * 含税收入
	 */
    private BigDecimal taxMoney = new BigDecimal(0);

	/**
	 * 税率 
	 */
    private BigDecimal taxRate = new BigDecimal(0);

    /**
     * 税款
     */
    private BigDecimal taxes = new BigDecimal(0);

    /**
     * 不含税款
     */
    private BigDecimal noTaxMoney = new BigDecimal(0);

	/**
	 * 支付方式(1=微信支付) 
	 */
    private Integer payType;

    @TableField(exist = false)
    private BigDecimal statisticsMoney = new BigDecimal(0);

    @Getter
    @AllArgsConstructor
    //(1=核酸检测,2=消杀作业,3=装卸作业,4=停车费,5=过磅费)
    public static enum FeeTypeEnum{
        NUCLEIC_FEE(1,"核酸检测"),
        DISINFECT_FEE(2,"消杀作业"),
        STEVEDORE_FEE(3,"装卸作业"),
        PARK_FEE(4,"停车费"),
        WEIGHT_FEE(5,"过磅费"),
        MANAGE_FEE(6, "入场管理费"),
        CHARGE_FEE(7, "充电打冷作业");
        private int code;
        private String desc;
    }

    @Getter
    @AllArgsConstructor
    public static enum taxRate{
        PARK(0.09, "停车费税率"),
        BUSINESS(0.06, "业务费税率");
        private Double value;
        private String desc;
    }


	public static List<Map<String, Object>> getList() {
		List<Map<String, Object>> list = new ArrayList<>();
		for (TbFeeStatistics.FeeTypeEnum feeTypeEnum : TbFeeStatistics.FeeTypeEnum.values()) {
			Map<String, Object> map = new HashMap<>();
			map.put("id", feeTypeEnum.getCode());
			map.put("name", feeTypeEnum.getDesc());
			list.add(map);
		}
		return list;
	}


	


}
