package org.dromara.payment.merchant.domain.bo;

import cn.hutool.json.JSONUtil;
import org.dromara.payment.merchant.domain.BusMerchantProduct;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 商户产品表业务对象 bus_merchant_product
 *
 * @author LionLi
 * @date 2024-04-03
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = BusMerchantProduct.class, reverseConvertGenerate = false)
public class BusMerchantProductBo extends BaseEntity {

    /**
     * 主键
     */
    @NotNull(message = "主键不能为空", groups = { EditGroup.class })
    private Long id;

    /**
     * 结算中心id
     */
    @NotNull(message = "结算中心id不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long sydId;

    /**
     * 结算中心编号
     */
    @NotBlank(message = "结算中心编号不能为空", groups = { AddGroup.class, EditGroup.class })
    private String sydNo;

    /**
     * 业务类型(1:委托代征，2:自然人代开，3:个体户注册 4:临时税务登记 5：资金代发 6：派遣&外包
     */
    @NotNull(message = "业务类型", groups = { AddGroup.class, EditGroup.class })
    private Long busType;

    /**
     * 产品编号
     */
    @NotBlank(message = "产品编号不能为空", groups = { AddGroup.class, EditGroup.class })
    private String proNo;

    /**
     * 产品id
     */
    @NotNull(message = "产品id不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long proId;

    /**
     * 运营商编号
     */
    @NotBlank(message = "运营商编号不能为空", groups = { AddGroup.class, EditGroup.class })
    private String opNo;

    /**
     * 运营商id
     */
    @NotNull(message = "运营商id不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long opId;

    /**
     * 代理商服务费率(%)
     */
    @NotNull(message = "代理商服务费率(%)不能为空", groups = { AddGroup.class, EditGroup.class })
    private BigDecimal costServiceCharge;

    /**
     * 商户服务费率(%)
     */
    private BigDecimal serviceCharge;

    /**
     * 代理商id
     */
    @NotNull(message = "代理商id不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long channelId;

    /**
     * 代理商编号
     */
    @NotBlank(message = "代理商编号不能为空", groups = { AddGroup.class, EditGroup.class })
    private String channelNo;

    /**
     * 商户id
     */
    @NotNull(message = "商户id不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long merId;

    /**
     * 商户编号
     */
    @NotBlank(message = "商户编号不能为空", groups = { AddGroup.class, EditGroup.class })
    private String merNo;

    /**
     * 代理商上下级关系编码
     */
    private String channelCode;

    /**
     * 计费模式(1:个人应得计费、2:开票金额计费)
     */
    @NotNull(message = "计费模式", groups = { AddGroup.class, EditGroup.class })
    private Integer chargeMode;

    public Integer getSettlementStyle() {
        return settlementStyle;
    }

    public void setSettlementStyle(Integer settlementStyle) {
        this.settlementStyle = settlementStyle;
    }

    /**
     * 结算方式（1：到卡 2：余额）
     */
    @NotNull(message = "结算方式不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer settlementStyle;

    /**
     * 单月发放上限（分）
     */
    @NotNull(message = "单月发放上限不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long maxMonth;

    /**
     * 开票类型（1：增值税专用发票 2：增值税普通发票 3：差额票）
     */
    @NotNull(message = "开票类型不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer invoiceType;

    /**
     * 开票类目名称
     */
//    @NotBlank(message = "开票类目名称不能为空", groups = { AddGroup.class, EditGroup.class })
    private String invoiceItems;

    /**
     * 状态（1：上架 2：下架）
     */
    @NotNull(message = "状态不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer proStatus;

    /*
     * @Param
     * @Return
     * @Author sunzexing
     * @Date 2024-04-25 14:04
     * 说明：修改后的服务费率（T+1 生效）
     **/
    private BigDecimal mdyServiceCharge;


    public static void main(String[] args) {

        Map map = new HashMap();
        map.put("merId",3);
        map.put("merNo","A10109-B10534-M32085");
        map.put("busType",1);

        List list = new ArrayList();
        BusMerchantProductBo bo = new BusMerchantProductBo();

        bo.setBusType(1L);
        bo.setProNo("P1722211926");
        bo.setCostServiceCharge( new BigDecimal("1.00"));
        bo.setServiceCharge( new BigDecimal("1.50"));
        bo.setBusType(1L);
        bo.setChargeMode(1);
        bo.setInvoiceType(1);
        bo.setMaxMonth(500000L);
        bo.setProStatus(1);
        bo.setSettlementStyle(1);
        bo.setInvoiceItems("dsafdsa");

        list.add(bo);

        map.put("boList",list);

        System.out.println(JSONUtil.toJsonStr(map));


    }


}
