This commit is contained in:
jinbooks_dev
2025-07-03 17:23:21 +08:00
parent a80f1bb243
commit 61219a6817
4 changed files with 229 additions and 1 deletions

View File

@ -28,7 +28,7 @@ import java.io.Serializable;
import java.math.BigDecimal;
/**
* 科目余额报表 jbx_statement_subject_balance
* 科目余额 jbx_statement_subject_balance
*
* @author wuyan
* {@code @date} 2025-02-03

View File

@ -0,0 +1,188 @@
/*
* 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;
}

View File

@ -0,0 +1,27 @@
/*
* 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<StatementSubjectBalanceOpeningMapper, StatementSubjectBalanceOpening, StatementSubjectBalanceOpening> {
}

View File

@ -31,6 +31,7 @@ import com.jinbooks.entity.base.AssistAcc;
import com.jinbooks.entity.book.BookSubject;
import com.jinbooks.entity.book.Settlement;
import com.jinbooks.entity.statement.StatementSubjectBalance;
import com.jinbooks.entity.statement.StatementSubjectBalanceOpening;
import com.jinbooks.entity.voucher.VoucherAuxiliary;
import com.jinbooks.entity.voucher.VoucherItem;
import com.jinbooks.enums.StatementPeriodTypeEnum;
@ -40,9 +41,12 @@ import com.jinbooks.enums.YesNoEnum;
import com.jinbooks.persistence.mapper.AssistAccMapper;
import com.jinbooks.persistence.mapper.BookSubjectMapper;
import com.jinbooks.persistence.mapper.StatementSubjectBalanceMapper;
import com.jinbooks.persistence.mapper.StatementSubjectBalanceOpeningMapper;
import com.jinbooks.persistence.mapper.VoucherItemMapper;
import com.jinbooks.persistence.service.ConfigSysService;
import com.jinbooks.persistence.service.StatementSubjectBalanceService;
import cn.hutool.core.bean.BeanUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@ -66,6 +70,7 @@ public class StatementSubjectBalanceServiceImpl implements StatementSubjectBalan
private final AssistAccMapper assistAccMapper;
private final IdentifierGenerator identifierGenerator;
private final VoucherItemMapper voucherItemMapper;
private final StatementSubjectBalanceOpeningMapper statementSubjectBalanceOpeningMapper;
@Override
public StatementSubjectBalance getSubjectBalance(String bookId, String subjectCode) {
@ -454,6 +459,14 @@ public class StatementSubjectBalanceServiceImpl implements StatementSubjectBalan
statementSubjectBalance.setId(currentId);
}
subjectBalanceMapper.insertBatch(subjectBalanceList);
List<StatementSubjectBalanceOpening> subjectBalanceOpeningList = new ArrayList<>();
for( StatementSubjectBalance statementSubjectBalance: subjectBalanceList) {
StatementSubjectBalanceOpening statementSubjectBalanceOpening = new StatementSubjectBalanceOpening();
BeanUtil.copyProperties(statementSubjectBalance, statementSubjectBalanceOpening);
subjectBalanceOpeningList.add(statementSubjectBalanceOpening);
}
statementSubjectBalanceOpeningMapper.insertBatch(subjectBalanceOpeningList);
return true;
}