package com.engine.salary.entity.salaryitem.dto;

import com.cloudstore.eccom.pc.table.WeaTableType;
import com.engine.salary.annotation.SalaryTable;
import com.engine.salary.annotation.SalaryTableColumn;
import com.engine.salary.annotation.SalaryTableOperate;
import com.engine.salary.annotation.TableTitle;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 字段管理列表
 * <p>Copyright: Copyright (c) 2022</p>
 * <p>Company: 泛微软件</p>
 *
 * @author qiantao
 * @version 1.0
 **/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@SalaryTable(pageId = "a4f85287-e3f9-ab21-adn9-7d06e54y6r98", tableType = WeaTableType.CHECKBOX, operates = {@SalaryTableOperate(text = "编辑", index = "0"), @SalaryTableOperate(text = "删除", index = "1")})
public class SalaryFieldListDTO {

    @JsonSerialize(using = ToStringSerializer.class)
    @SalaryTableColumn(column = "id", display = false)
    private Long id;

    @SalaryTableColumn(text = "名称", width = "10%", column = "name")
    @TableTitle(title = "名称",dataIndex = "name",key = "name")
    private String name;

    //默认使用
    @SalaryTableColumn(text = "默认使用", width = "10%", column = "useDefault")
    @TableTitle(title = "默认使用",dataIndex = "useDefault",key = "useDefault")
    private Integer useDefault;

    //核算时隐藏
    @SalaryTableColumn(text = "核算时隐藏", width = "10%", column = "hideDefault")
    @TableTitle(title = "核算时隐藏",dataIndex = "hideDefault",key = "hideDefault")
    private Integer hideDefault;

    //进位规则
    @SalaryTableColumn(text = "进位规则", width = "10%", column = "roundingMode",transmethod = "com.engine.salary.transmethod.TransMethod.roundingMode")
    @TableTitle(title = "进位规则",dataIndex = "roundingMode",key = "roundingMode")
    private String roundingMode;

    //保留小数位
    @SalaryTableColumn(text = "保留小数位", width = "10%", column = "pattern")
    @TableTitle(title = "保留小数位",dataIndex = "pattern",key = "pattern")
    private Integer pattern;

    //取值方式
    @SalaryTableColumn(text = "取值方式", width = "10%", column = "valueType",transmethod = "com.engine.salary.transmethod.TransMethod.datasource")
    @TableTitle(title = "取值方式",dataIndex = "valueType",key = "valueType")
    private String valueType;

    //公式id
    private Long formulaId;

    //公式内容
    private String formulaContent;

    //备注
    @SalaryTableColumn(text = "备注", width = "10%", column = "description")
    @TableTitle(title = "备注",dataIndex = "description",key = "description")
    private String description;


    //是否可以编辑
    private Boolean canEdit;

    //是否可以删除
    private Boolean canDelete;

    @SalaryTableColumn(text = "显示顺序", width = "10%", column = "sortedIndex")
    @TableTitle(title = "显示顺序",dataIndex = "sortedIndex",key = "sortedIndex")
    private String sortedIndex;

    @SalaryTableColumn(text = "操作", width = "20%", column = "operate")
    private String operate;
}
