From 214b89230c88a98caea101f072e6b5e94c037caa Mon Sep 17 00:00:00 2001 From: jinbooks_dev Date: Fri, 4 Jul 2025 16:46:00 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=91=E7=9B=AE=E4=BD=99=E9=A2=9D=E8=A1=A8?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=8A=E6=9C=88=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../statement/StatementSubjectBalance.java | 36 ++++ .../StatementSubjectBalanceOpening.java | 188 ------------------ .../StatementSubjectBalanceOpeningMapper.java | 27 --- .../impl/BookInitBalanceServiceImpl.java | 11 +- .../StatementSubjectBalanceServiceImpl.java | 22 +- sql/jinbooks_v1.0.1-add.sql | 10 + 6 files changed, 66 insertions(+), 228 deletions(-) delete mode 100644 jinbooks/jinbooks-core/src/main/java/com/jinbooks/entity/statement/StatementSubjectBalanceOpening.java delete mode 100644 jinbooks/jinbooks-persistence/src/main/java/com/jinbooks/persistence/mapper/StatementSubjectBalanceOpeningMapper.java diff --git a/jinbooks/jinbooks-core/src/main/java/com/jinbooks/entity/statement/StatementSubjectBalance.java b/jinbooks/jinbooks-core/src/main/java/com/jinbooks/entity/statement/StatementSubjectBalance.java index c1b0168..5d88883 100644 --- a/jinbooks/jinbooks-core/src/main/java/com/jinbooks/entity/statement/StatementSubjectBalance.java +++ b/jinbooks/jinbooks-core/src/main/java/com/jinbooks/entity/statement/StatementSubjectBalance.java @@ -168,6 +168,42 @@ public class StatementSubjectBalance extends BaseEntity implements Serializable @Schema(name = "closingBalanceCredit", description = "期末余额(贷方)") private BigDecimal closingBalanceCredit; + /** + * 上月末余额 + */ + @Schema(name = "prevbalance", description = "上月余额") + @TableField(fill = FieldFill.INSERT) + private BigDecimal prevBalance; + + + /** + * 上月期末余额(借方) + */ + @Schema(name = "prevClosingBalanceDebit", description = "上月期末余额(借方)") + @TableField(fill = FieldFill.INSERT) + private BigDecimal prevClosingBalanceDebit; + + /** + * 上月期末余额(贷方) + */ + @Schema(name = "prevClosingBalanceCredit", description = "上月期末余额(贷方)") + @TableField(fill = FieldFill.INSERT) + private BigDecimal prevClosingBalanceCredit; + + /** + * 上月本年累计发生额(借方) + */ + @Schema(name = "prevYearToDateDebit", description = "上月本年累计发生额(借方)") + @TableField(fill = FieldFill.INSERT) + private BigDecimal prevYearToDateDebit; + + /** + * 上月本年累计发生额(贷方) + */ + @Schema(name = "prevYearToDateCredit", description = "上月本年累计发生额(贷方)") + @TableField(fill = FieldFill.INSERT) + private BigDecimal prevYearToDateCredit; + /** * 是否辅助核算项:n-否;y-是 */ diff --git a/jinbooks/jinbooks-core/src/main/java/com/jinbooks/entity/statement/StatementSubjectBalanceOpening.java b/jinbooks/jinbooks-core/src/main/java/com/jinbooks/entity/statement/StatementSubjectBalanceOpening.java deleted file mode 100644 index 6252d7d..0000000 --- a/jinbooks/jinbooks-core/src/main/java/com/jinbooks/entity/statement/StatementSubjectBalanceOpening.java +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Copyright [2025] [JinBooks of copyright http://www.jinbooks.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - - -package com.jinbooks.entity.statement; - -import com.baomidou.mybatisplus.annotation.*; -import com.jinbooks.entity.BaseEntity; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; - -import java.io.Serializable; -import java.math.BigDecimal; - -/** - * 科目余额期初数据 jbx_statement_subject_balance_opening - * - * @author wuyan - * {@code @date} 2025-02-03 - */ - -@EqualsAndHashCode(callSuper = true) -@Data -@TableName("jbx_statement_subject_balance_opening") -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class StatementSubjectBalanceOpening extends BaseEntity implements Serializable { - - /** - * - */ - private static final long serialVersionUID = -3640591095573870104L; - - /** - * 主键 - */ - @TableId(type = IdType.ASSIGN_ID) - private String id; - - /** - * 账套ID - */ - @Schema(name = "bookId", description = "所属账套") - private String bookId; - - @Schema(name = "yearPeriod", description = "期间") - private String yearPeriod; - - /** - * 报表周期(如:month、quarter、year) - */ - @Schema(name = "periodType", description = "报表周期(如:月、季、年)") - private String periodType; - - /** - * 排序序号 - */ - @Schema(name = "sortIndex", description = "排序序号") - private Integer sortIndex; - - /** - * 原始数据id - */ - @Schema(name = "sourceId", description = "原始数据id") - private String sourceId; - - /** - * 父级科目id - */ - @Schema(name = "parentId", description = "父级科目id") - private String parentId; - - /** - * 科目编码 - */ - @Schema(name = "subjectCode", description = "科目编码") - private String subjectCode; - - /** - * 科目名称 - */ - @Schema(name = "subjectName", description = "科目名称") - private String subjectName; - - /** - * 借贷方向 - */ - @Schema(name = "direction", description = "借贷方向") - String direction; - - /** - * 余额 - */ - @Schema(name = "balance", description = "余额") - private BigDecimal balance; - - /** - * 期初余额(借方) - */ - @Schema(name = "openingBalanceDebit", description = "期初余额(借方)") - private BigDecimal openingBalanceDebit; - - /** - * 期初余额(贷方) - */ - @Schema(name = "openingBalanceCredit", description = "期初余额(贷方)") - private BigDecimal openingBalanceCredit; - - /** - * 年初余额(借方) - */ - @Schema(name = "openingYearBalanceDebit", description = "年初余额(借方)") - private BigDecimal openingYearBalanceDebit; - - /** - * 年初余额(贷方) - */ - @Schema(name = "openingYearBalanceCredit", description = "年初余额(贷方)") - private BigDecimal openingYearBalanceCredit; - - /** - * 本期发生额(借方) - */ - @Schema(name = "currentPeriodDebit", description = "本期发生额(借方)") - private BigDecimal currentPeriodDebit; - - /** - * 本期发生额(贷方) - */ - @Schema(name = "currentPeriodCredit", description = "本期发生额(贷方)") - private BigDecimal currentPeriodCredit; - - /** - * 本年累计发生额(借方) - */ - @Schema(name = "yearToDateDebit", description = "本年累计发生额(借方)") - private BigDecimal yearToDateDebit; - - /** - * 本年累计发生额(贷方) - */ - @Schema(name = "yearToDateCredit", description = "本年累计发生额(贷方)") - private BigDecimal yearToDateCredit; - - /** - * 期末余额(借方) - */ - @Schema(name = "closingBalanceDebit", description = "期末余额(借方)") - private BigDecimal closingBalanceDebit; - - /** - * 期末余额(贷方) - */ - @Schema(name = "closingBalanceCredit", description = "期末余额(贷方)") - private BigDecimal closingBalanceCredit; - - /** - * 是否辅助核算项:n-否;y-是 - */ - private String isAuxiliary; - - /** - * 当前期是否使用:n-否;y-是 - */ - private String isVoucher; - - /** - * 删除标记,默认为 'n' (未删除),如果为 'y' 表示已删除 - */ - @TableField(fill = FieldFill.INSERT) - @TableLogic(value = "n", delval = "y") - private String deleted; -} diff --git a/jinbooks/jinbooks-persistence/src/main/java/com/jinbooks/persistence/mapper/StatementSubjectBalanceOpeningMapper.java b/jinbooks/jinbooks-persistence/src/main/java/com/jinbooks/persistence/mapper/StatementSubjectBalanceOpeningMapper.java deleted file mode 100644 index 0f9a16f..0000000 --- a/jinbooks/jinbooks-persistence/src/main/java/com/jinbooks/persistence/mapper/StatementSubjectBalanceOpeningMapper.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright [2025] [JinBooks of copyright http://www.jinbooks.com] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - - -package com.jinbooks.persistence.mapper; - -import com.jinbooks.entity.statement.StatementSubjectBalanceOpening; -import com.jinbooks.mapper.BaseMapperPlus; -import org.apache.ibatis.annotations.Mapper; - -@Mapper -public interface StatementSubjectBalanceOpeningMapper extends BaseMapperPlus { -} diff --git a/jinbooks/jinbooks-persistence/src/main/java/com/jinbooks/persistence/service/impl/BookInitBalanceServiceImpl.java b/jinbooks/jinbooks-persistence/src/main/java/com/jinbooks/persistence/service/impl/BookInitBalanceServiceImpl.java index 658b70d..86e1454 100644 --- a/jinbooks/jinbooks-persistence/src/main/java/com/jinbooks/persistence/service/impl/BookInitBalanceServiceImpl.java +++ b/jinbooks/jinbooks-persistence/src/main/java/com/jinbooks/persistence/service/impl/BookInitBalanceServiceImpl.java @@ -267,7 +267,16 @@ public class BookInitBalanceServiceImpl extends ServiceImpl subjectBalanceOpeningList = new ArrayList<>(); - - for( StatementSubjectBalance statementSubjectBalance: subjectBalanceList) { - StatementSubjectBalanceOpening statementSubjectBalanceOpening = new StatementSubjectBalanceOpening(); - BeanUtil.copyProperties(statementSubjectBalance, statementSubjectBalanceOpening); - subjectBalanceOpeningList.add(statementSubjectBalanceOpening); - } - statementSubjectBalanceOpeningMapper.insertBatch(subjectBalanceOpeningList); + return true; } diff --git a/sql/jinbooks_v1.0.1-add.sql b/sql/jinbooks_v1.0.1-add.sql index 82ccba7..607c351 100644 --- a/sql/jinbooks_v1.0.1-add.sql +++ b/sql/jinbooks_v1.0.1-add.sql @@ -17,3 +17,13 @@ DROP TABLE `jinbooks`.`jbx_employee_salary_voucher_rule_template`, `jinbooks`.`j ALTER TABLE `jinbooks`.`jbx_voucher_template` ADD COLUMN `voucher_date` SMALLINT NULL DEFAULT 0 COMMENT '默认凭证日期,为月份的第几天,0为月末' AFTER `voucher_type`; + + +-- 上月数据 + +ALTER TABLE `jinbooks`.`jbx_statement_subject_balance` +ADD COLUMN `prev_balance` DECIMAL(18,2) NOT NULL DEFAULT '0.00' COMMENT '上月末余额' AFTER `closing_balance_credit`, +ADD COLUMN `prev_closing_balance_debit` DECIMAL(18,2) NOT NULL DEFAULT '0.00' COMMENT '上月期末余额(借方)' AFTER `prev_balance`, +ADD COLUMN `prev_closing_balance_credit` DECIMAL(18,2) NOT NULL DEFAULT '0.00' COMMENT '上月期末余额(贷方)' AFTER `prev_closing_balance_debit`, +ADD COLUMN `prev_year_to_date_debit` DECIMAL(18,2) NOT NULL DEFAULT '0.00' COMMENT '上月本年累计发生额(借方)' AFTER `prev_closing_balance_credit`, +ADD COLUMN `prev_year_to_date_credit` DECIMAL(18,2) NOT NULL DEFAULT '0.00' COMMENT '上月本年累计发生额(贷方)' AFTER `prev_year_to_date_debit`; \ No newline at end of file