From fc236fc10f2bda6aa9419753c5cb284155026fa2 Mon Sep 17 00:00:00 2001
From: wujianwei <wjw@11.com>
Date: 星期一, 19 一月 2026 18:00:04 +0800
Subject: [PATCH] 新增位运算
---
service/src/main/java/com/ruoyi/cwgl/domain/VoucherSubjectSetting.java | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 104 insertions(+), 2 deletions(-)
diff --git a/service/src/main/java/com/ruoyi/cwgl/domain/VoucherSubjectSetting.java b/service/src/main/java/com/ruoyi/cwgl/domain/VoucherSubjectSetting.java
index 06e3025..05f3c73 100644
--- a/service/src/main/java/com/ruoyi/cwgl/domain/VoucherSubjectSetting.java
+++ b/service/src/main/java/com/ruoyi/cwgl/domain/VoucherSubjectSetting.java
@@ -3,7 +3,10 @@
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
@@ -76,11 +79,11 @@
private String balanceDirection;
- /** 鏍哥畻椤圭洰 */
+ /** 鏍哥畻椤圭洰锛堜綅杩愮畻鍊硷級 */
@Excel(name = "鏍哥畻椤圭洰")
@TableField("accounting_items")
- private String accountingItems;
+ private Integer accountingItems;
/** 鏁伴噺閲戦鏍哥畻锛�1鏄� 0鍚︼級 */
@@ -193,5 +196,104 @@
@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);
+ }
+ }
}
--
Gitblit v1.8.0