package com.pj.project.tb_goods;

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

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;

import lombok.Data;
import lombok.Getter;
import lombok.experimental.Accessors;

/**
 * Model: tb_goods -- 商品管理
 * @author qzy 
 */
@Data
@Accessors(chain = true)
@TableName(TbGoods.TABLE_NAME)
@EqualsAndHashCode(callSuper = false)
public class TbGoods extends Model<TbGoods> implements Serializable {

	// ---------- 模块常量 ----------
	/**
	 * 序列化版本id 
	 */
	private static final long serialVersionUID = 1L;	
	/**
	 * 此模块对应的表名 
	 */
	public static final String TABLE_NAME = "tb_goods";	
	/**
	 * 此模块对应的权限码 
	 */
	public static final String PERMISSION_CODE = "tb-goods";	
	public static final String PERMISSION_CODE_ADD = "tb-goods-add";
	public static final String PERMISSION_CODE_EDIT = "tb-goods-edit";
	public static final String PERMISSION_CODE_DEL = "tb-goods-del";


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

	/**
	 * 编号 
	 */
	private String code;	

	/**
	 * 名称 
	 */
	private String name;	

	/**
	 * 状态(1=禁用,2=启用) 
	 */
	private int status;

	/**
	 * 创建时间 
	 */
	private Date createTime;
	private String needIds;
	private String noNeedIds;
	private Integer businessType=2;

	/**
	 * 载重是否必填(1=是,0=否)
	 */
	private Integer needWeight;

	/**
	 * 规格是否必填(1=是,0=否)
	 */
	private Integer needCarSize;

	/**
	 * 申报单是否必填(1=是,0=否)
	 */
	private Integer needDeclare;

	/**
	 * 申报时间是否必填(1=是,0=否)
	 */
	private Integer needOperateTime=1;
	private Integer payStep=2;
	private Integer chinaCarPay=1;
	private Integer vietnamCarPay=1;
	private Integer chinaCarLeave=1;
	private Integer vietnamCarLeave=1;





	@Getter
	@AllArgsConstructor
	public static enum PayStep {
		BEFORE_CONFIRM(1,"下单后"),
		AFTER_CONFIRM(2,"确认订单后");
		private Integer code;
		private String desc;
		public static List<Map<String, Object>> getList() {
			List<Map<String, Object>> list = new ArrayList<>();
			for (PayStep tbItem : PayStep.values()) {
				Map<String, Object> map = new HashMap<>();
				map.put("id", tbItem.getCode());
				map.put("name", tbItem.getDesc());
				list.add(map);
			}
			return list;
		}
	}
	@Getter
	@AllArgsConstructor
	public static enum LeaveEnum {
		PART_MONEY(1,"只交停车费"),
		BUSINESS_MONEY(2,"只交业务费"),
		APART_BUSINESS(3,"停车费+业务费");
		private Integer code;
		private String desc;
		public static List<Map<String, Object>> getList() {
			List<Map<String, Object>> list = new ArrayList<>();
			for (LeaveEnum tbItem : LeaveEnum.values()) {
				Map<String, Object> map = new HashMap<>();
				map.put("id", tbItem.getCode());
				map.put("name", tbItem.getDesc());
				list.add(map);
			}
			return list;
		}
	}






}
