wujianwei
2026-03-20 1e89b00b0919a19504f32b56fb1ef80298799ec4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
package com.ruoyi.cwgl.domain;
 
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.ruoyi.cwgl.enums.AccountingItemEnum;
import java.util.Date;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
/**
 * 凭证科目设置对象 voucher_subject_setting
 *
 * @author ruoyi
 * @date 2026-01-19
 */
@Data
public class VoucherSubjectSetting{
 
 
    /** 科目ID */
        @TableField("id")
    private Integer id;
 
 
    /** 父科目ID */
    @Excel(name = "父科目ID")
 
        @TableField("parent_id")
    private Integer parentId;
 
    /** 上级科目代码 */
    @Excel(name = "上级科目代码")
 
        @TableField("parent_subject_code")
    private String parentSubjectCode;
 
    /** 上级科目名称 */
    @Excel(name = "上级科目名称")
 
        @TableField("parent_subject_name")
    private String parentSubjectName;
 
 
    /** 祖级列表 */
    @Excel(name = "祖级列表")
 
        @TableField("ancestors")
    private String ancestors;
 
 
    /** 账套 */
    @Excel(name = "账套")
 
        @TableField("account_set")
    private String accountSet;
 
 
    /** 科目代码 */
    @Excel(name = "科目代码")
 
        @TableField("subject_code")
    private String subjectCode;
 
 
    /** 科目名称 */
    @Excel(name = "科目名称")
 
        @TableField("subject_name")
    private String subjectName;
 
 
    /** 科目类别 */
    @Excel(name = "科目类别",dictType = "sys_subject_category")
 
        @TableField("subject_type")
    private String subjectType;
 
 
    /** 启用(1启用 0停用) */
    @Excel(name = "启用", readConverterExp = "1=启用,0=停用")
 
        @TableField("enabled")
    private String enabled;
 
 
    /** 余额方向(借/贷) */
    @Excel(name = "余额方向", dictType = "sys_balance_direction")
 
        @TableField("balance_direction")
    private String balanceDirection;
 
 
    /** 核算项目(位运算值) */
    @Excel(name = "核算项目",dictType = "sys_accounting_item_name")
 
        @TableField("accounting_items")
    private Integer accountingItems;
 
    /** 往来单位(0否 1是) */
    @Excel(name = "往来单位", readConverterExp = "0=否,1=是")
 
        @TableField("contact_unit")
    private String contactUnit;
 
    /** 部门(0否 1是) */
    @Excel(name = "部门", readConverterExp = "0=否,1=是")
 
        @TableField("department")
    private String department;
 
    /** 品名(0否 1是) */
    @Excel(name = "品名", readConverterExp = "0=否,1=是")
 
        @TableField("product_name")
    private String productName;
 
 
    /** 数量金额核算(1是 0否) */
    @Excel(name = "数量金额核算", readConverterExp = "1=是,0=否")
 
        @TableField("quantity_amount_accounting")
    private String quantityAmountAccounting;
 
 
    /** 现金科目(1是 0否) */
    @Excel(name = "现金科目", readConverterExp = "1=是,0=否")
 
        @TableField("cash_subject")
    private String cashSubject;
 
 
    /** 银行科目(1是 0否) */
    @Excel(name = "银行科目", readConverterExp = "1=是,0=否")
 
        @TableField("bank_subject")
    private String bankSubject;
 
 
    /** 现金流量科目(1是 0否) */
    @Excel(name = "现金流量科目", readConverterExp = "1=是,0=否")
 
        @TableField("cash_flow_subject")
    private String cashFlowSubject;
 
 
    /** 费用名称 */
    @Excel(name = "费用名称")
 
        @TableField("expense_name")
    private String expenseName;
 
 
    /** 助记码 */
    @Excel(name = "助记码")
 
        @TableField("mnemonic_code")
    private String mnemonicCode;
 
 
    /** 外币核算(1是 0否) */
    @Excel(name = "外币核算", readConverterExp = "1=是,0=否")
 
        @TableField("foreign_currency_accounting")
    private String foreignCurrencyAccounting;
 
 
    /** 计量单位 */
    @Excel(name = "计量单位")
 
        @TableField("unit_of_measurement")
    private String unitOfMeasurement;
 
 
    /** 显示顺序 */
    @Excel(name = "显示顺序")
 
        @TableField("order_num")
    private Integer orderNum;
 
 
    /** 状态(0正常 1停用) */
    @Excel(name = "状态", readConverterExp = "0=正常,1=停用")
 
        @TableField("status")
    private String status;
 
 
    /** 删除标志(0代表存在 2代表删除) */
        @TableField("del_flag")
    private String delFlag;
 
 
    /** 创建者 */
        @TableField("create_by")
    private String createBy;
 
 
    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        @TableField("create_time")
    private Date createTime;
 
 
    /** 更新者 */
        @TableField("update_by")
    private String updateBy;
 
 
    /** 更新时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        @TableField("update_time")
    private Date updateTime;
 
 
    /** 备注 */
    @Excel(name = "备注")
 
        @TableField("remark")
    private String remark;
 
 
    /** 帐套类型(0珠海汇畅,1广珠物流) */
    @Excel(name = "帐套类型", dictType = "sys_accounting_typ")
 
        @TableField("type")
    private String type;
 
    /** 核算项目描述(非数据库字段) */
    @TableField(exist = false)
    private String accountingItemsDesc;
 
    /** 核算项目列表(非数据库字段) */
    @TableField(exist = false)
    private List<String> accountingItemList;
 
    /** 核算项目包含查询(非数据库字段) */
    @TableField(exist = false)
    private Integer accountingItemsContains;
 
    /** 核算项目任意包含查询(非数据库字段) */
    @TableField(exist = false)
    private Integer accountingItemsAny;
 
    /**
     * 获取核算项目的描述字符串
     */
    public String getAccountingItemsDesc() {
        if (accountingItems == null) {
            return "";
        }
        return AccountingItemEnum.getDescriptions(accountingItems);
    }
 
    /**
     * 设置核算项目描述字符串
     */
    public void setAccountingItemsDesc(String accountingItemsDesc) {
        this.accountingItemsDesc = accountingItemsDesc;
        if (accountingItemsDesc != null && !accountingItemsDesc.trim().isEmpty()) {
            this.accountingItems = AccountingItemEnum.getValueByDescriptions(accountingItemsDesc);
        }
    }
 
    /**
     * 获取核算项目列表
     */
    public List<String> getAccountingItemList() {
        if (accountingItems == null) {
            return new ArrayList<>();
        }
        List<String> list = new ArrayList<>();
        for (AccountingItemEnum item : AccountingItemEnum.values()) {
            if (AccountingItemEnum.contains(accountingItems, item)) {
                list.add(item.getDescription());
            }
        }
        return list;
    }
 
    /**
     * 设置核算项目列表
     */
    public void setAccountingItemList(List<String> accountingItemList) {
        this.accountingItemList = accountingItemList;
        if (accountingItemList != null && !accountingItemList.isEmpty()) {
            int value = 0;
            for (String desc : accountingItemList) {
                for (AccountingItemEnum item : AccountingItemEnum.values()) {
                    if (item.getDescription().equals(desc.trim())) {
                        value = AccountingItemEnum.addItem(value, item);
                        break;
                    }
                }
            }
            this.accountingItems = value;
        }
    }
 
    /**
     * 检查是否包含某个核算项目
     */
    public boolean containsAccountingItem(AccountingItemEnum item) {
        if (accountingItems == null) {
            return false;
        }
        return AccountingItemEnum.contains(accountingItems, item);
    }
 
    /**
     * 添加核算项目
     */
    public void addAccountingItem(AccountingItemEnum item) {
        if (accountingItems == null) {
            accountingItems = 0;
        }
        accountingItems = AccountingItemEnum.addItem(accountingItems, item);
    }
 
    /**
     * 移除核算项目
     */
    public void removeAccountingItem(AccountingItemEnum item) {
        if (accountingItems != null) {
            accountingItems = AccountingItemEnum.removeItem(accountingItems, item);
        }
    }
 
}