李白
1 天以前 e7e6d39b095b6a763e54ab34631171c3de32ec9e
Merge remote-tracking branch 'origin/master'
6个文件已修改
13个文件已添加
947 ■■■■ 已修改文件
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/OutBoundAddDTO.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/OutSubjectMatterAddDTO.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/TaxCodeQueryDTO.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/Contract.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/ContractOutBound.java 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/TaxCode.java 134 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ContractOutBoundController.java 124 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/TaxCodeController.java 121 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ContractOutBoundMapper.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/TaxCodeMapper.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ContractOutBoundService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/TaxCodeService.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractOutBoundServiceImpl.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractPaymentScheduleProcessServiceImpl.java 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractServiceImpl.java 83 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/OutBoundServiceImpl.java 105 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/TaxCodeServiceImpl.java 106 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-biz/src/main/resources/mapper/ContractOutBoundMapper.xml 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-biz/src/main/resources/mapper/TaxCodeMapper.xml 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/OutBoundAddDTO.java
@@ -21,6 +21,12 @@
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date outBoundTime;
    @Schema(description = "单据名称")
    private String outBoundAttNames;
    @Schema(description = "单据路径")
    private String outBoundAttPaths;
    @Schema(description = "出库标的物")
    private List<OutSubjectMatterAddDTO> subjectMatterList;
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/OutSubjectMatterAddDTO.java
@@ -17,10 +17,4 @@
    @Schema(description = "出库数量")
    private BigDecimal outBoundNum;
    @Schema(description = "单据名称")
    private String outBoundAttNames;
    @Schema(description = "单据路径")
    private String outBoundAttPaths;
}
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/TaxCodeQueryDTO.java
New file
@@ -0,0 +1,12 @@
package com.by4cloud.platformx.business.dto;
import lombok.Data;
@Data
public class TaxCodeQueryDTO {
    private String mc;
    private Integer childNum;
}
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/Contract.java
@@ -139,6 +139,10 @@
    @Column(columnDefinition = "decimal(10,2) comment '已开票金额'")
    private BigDecimal billingAmout;
    @Schema(description = "下一阶段")
    @Column(columnDefinition = "VARCHAR(128) comment '下一阶段'")
    private String nextScheduleName;
    /**
     * 临时字段 - 用于接收审批人名称等关联查询结果
     */
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/ContractOutBound.java
New file
@@ -0,0 +1,64 @@
package com.by4cloud.platformx.business.entity;
import com.by4cloud.platformx.common.data.mybatis.BaseModel;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import lombok.Data;
import org.hibernate.annotations.Table;
import java.math.BigDecimal;
import java.util.Date;
/**
 * 2026年4月29日 10:46:07
 * syt
 */
@Data
@Entity//加了才能自动生成表
@Table(appliesTo="contract_out_bound",comment = "合同出库历史")//给表加注释
@jakarta.persistence.Table(name = "contract_out_bound")//数据库创建的表明
public class ContractOutBound extends BaseModel<ContractOutBound> {
    @Schema(description = "关联合同ID")
    @Column(columnDefinition = "bigint not null comment '关联合同ID'")
    private Long contractId;
    @Schema(description = "合同名称")
    @Column(columnDefinition = "VARCHAR(64) comment '合同名称'")
    private String contractName;
    @Schema(description = "客商名称")
    @Column(columnDefinition="VARCHAR(64) comment '客商名称'")
    private String busGuestName;
    @Schema(description = "客商ID")
    @Column(columnDefinition="bigint comment '客商ID'")
    private Long busGuestId;
    @Schema(description = "标的物名称")
    @Column(columnDefinition="VARCHAR(64) comment '标的物名称'")
    private String subjectMatterName;
    @Schema(description = "标的物编码")
    @Column(columnDefinition="VARCHAR(64) comment '标的物编码'")
    private String subjectMatterCode;
    @Schema(description = "出库数量")
    @Column(columnDefinition="decimal(10,0) comment '出库数量'")
    private BigDecimal outBoundNum;
    @Schema(description = "出库时间")
    @Column(columnDefinition="datetime comment '出库时间'")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date outBoundTime;
    @Schema(description = "单据名称")
    @Column(columnDefinition="text comment '单据名称'")
    private String outBoundAttNames;
    @Schema(description = "单据路径")
    @Column(columnDefinition="text comment '单据路径'")
    private String outBoundAttPaths;
}
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/TaxCode.java
New file
@@ -0,0 +1,134 @@
package com.by4cloud.platformx.business.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.by4cloud.platformx.common.data.mybatis.BaseModel;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Transient;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.Table;
import java.time.LocalDateTime;
import java.util.List;
/**
 * 税务编码
 *
 * @author syt
 * @date 2026-05-13 16:35:23
 */
@Data
@Entity//加了才能自动生成表
@Table(appliesTo="tax_code",comment = "税收编码")//给表加注释
@jakarta.persistence.Table(name = "tax_code")//数据库创建的表明
public class TaxCode extends BaseModel<TaxCode> {
    /**
    * 编码
    */
    @Schema(description="编码")
    private String bm;
    /**
    * 关键字
    */
    @Schema(description="关键字")
    @Column(columnDefinition = "text comment '说明'")
    private String gjz;
    /**
    * 国民统计代码
    */
    @Schema(description="国民统计代码")
    private String gmtjdm;
    /**
    * 名称
    */
    @Schema(description="名称")
    private String mc;
    /**
    * 上级编码
    */
    @Schema(description="上级编码")
    private String parentBm;
    /**
    * 省份
    */
    @Schema(description="省份")
    private String prov;
    /**
    * 税率
    */
    @Schema(description="税率")
    private String sl;
    /**
    * 说明
    */
    @Schema(description="说明")
    @Column(columnDefinition = "text comment '说明'")
    private String sm;
    /**
    * 商品货物简称
    */
    @Schema(description="商品货物简称")
    private String sphwjc;
    /**
    * 消费税管理
    */
    @Schema(description="消费税管理")
    private String xfsgl;
    /**
    * 消费税特殊管理代码
    */
    @Schema(description="消费税特殊管理代码")
    private String xfstsgldm;
    /**
    * 消费税政策依据
    */
    @Schema(description="消费税政策依据")
    private String xfszcyj;
    /**
    * 增值税特殊管理
    */
    @Schema(description="增值税特殊管理")
    private String zzstsgl;
    /**
    * 增值税特殊管理代码
    */
    @Schema(description="增值税特殊管理代码")
    private String zzstsgldm;
    /**
    * 增值税特殊依据
    */
    @Schema(description="增值税特殊依据")
    private String zzstsyj;
    /**
     * 子税目
     */
    @Transient
    @TableField(exist = false)
    private List<TaxCode> children;
    /**
     *有无子税目
     */
    @Transient
    @TableField(exist = false)
    private Integer childNum;
}
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ContractOutBoundController.java
New file
@@ -0,0 +1,124 @@
package com.by4cloud.platformx.business.controller;
import cn.hutool.core.util.StrUtil;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.by4cloud.platformx.common.core.util.R;
import com.by4cloud.platformx.common.log.annotation.SysLog;
import com.by4cloud.platformx.business.entity.ContractOutBound;
import com.by4cloud.platformx.business.service.ContractOutBoundService;
import org.springframework.security.access.prepost.PreAuthorize;
import com.by4cloud.platformx.common.excel.annotation.ResponseExcel;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import org.springdoc.core.annotations.ParameterObject;
import org.springframework.http.HttpHeaders;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Objects;
/**
 * 合同出库
 *
 * @author syt
 * @date 2026-05-14 09:21:54
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/contractOutBound" )
@Tag(description = "contractOutBound" , name = "合同出库管理" )
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class ContractOutBoundController {
    private final  ContractOutBoundService contractOutBoundService;
    /**
     * 分页查询
     * @param page 分页对象
     * @param contractOutBound 合同出库
     * @return
     */
    @Operation(summary = "分页查询" , description = "分页查询" )
    @GetMapping("/page" )
    @PreAuthorize("@pms.hasPermission('business_contractOutBound_view')" )
    public R getContractOutBoundPage(@ParameterObject Page page, @ParameterObject ContractOutBound contractOutBound) {
        LambdaQueryWrapper<ContractOutBound> wrapper = Wrappers.lambdaQuery();
        wrapper.like(StrUtil.isNotBlank(contractOutBound.getBusGuestName()),ContractOutBound::getBusGuestName,contractOutBound.getBusGuestName());
        wrapper.like(StrUtil.isNotBlank(contractOutBound.getContractName()),ContractOutBound::getContractName,contractOutBound.getContractName());
        wrapper.like(StrUtil.isNotBlank(contractOutBound.getSubjectMatterName()),ContractOutBound::getSubjectMatterName,contractOutBound.getSubjectMatterName());
        wrapper.orderByDesc(ContractOutBound::getCreateTime);
        return R.ok(contractOutBoundService.pageByScope(page, wrapper));
    }
    /**
     * 通过id查询合同出库
     * @param id id
     * @return R
     */
    @Operation(summary = "通过id查询" , description = "通过id查询" )
    @GetMapping("/{id}" )
    @PreAuthorize("@pms.hasPermission('business_contractOutBound_view')" )
    public R getById(@PathVariable("id" ) Long id) {
        return R.ok(contractOutBoundService.getById(id));
    }
    /**
     * 新增合同出库
     * @param contractOutBound 合同出库
     * @return R
     */
    @Operation(summary = "新增合同出库" , description = "新增合同出库" )
    @SysLog("新增合同出库" )
    @PostMapping
    @PreAuthorize("@pms.hasPermission('business_contractOutBound_add')" )
    public R save(@RequestBody ContractOutBound contractOutBound) {
        return R.ok(contractOutBoundService.save(contractOutBound));
    }
    /**
     * 修改合同出库
     * @param contractOutBound 合同出库
     * @return R
     */
    @Operation(summary = "修改合同出库" , description = "修改合同出库" )
    @SysLog("修改合同出库" )
    @PutMapping
    @PreAuthorize("@pms.hasPermission('business_contractOutBound_edit')" )
    public R updateById(@RequestBody ContractOutBound contractOutBound) {
        return R.ok(contractOutBoundService.updateById(contractOutBound));
    }
    /**
     * 通过id删除合同出库
     * @param ids id列表
     * @return R
     */
    @Operation(summary = "通过id删除合同出库" , description = "通过id删除合同出库" )
    @SysLog("通过id删除合同出库" )
    @DeleteMapping
    @PreAuthorize("@pms.hasPermission('business_contractOutBound_del')" )
    public R removeById(@RequestBody Long[] ids) {
        return R.ok(contractOutBoundService.removeBatchByIds(CollUtil.toList(ids)));
    }
    /**
     * 导出excel 表格
     * @param contractOutBound 查询条件
        * @param ids 导出指定ID
     * @return excel 文件流
     */
    @ResponseExcel
    @GetMapping("/export")
    @PreAuthorize("@pms.hasPermission('business_contractOutBound_export')" )
    public List<ContractOutBound> export(ContractOutBound contractOutBound,Long[] ids) {
        return contractOutBoundService.list(Wrappers.lambdaQuery(contractOutBound).in(ArrayUtil.isNotEmpty(ids), ContractOutBound::getId, ids));
    }
}
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/TaxCodeController.java
New file
@@ -0,0 +1,121 @@
package com.by4cloud.platformx.business.controller;
import cn.hutool.core.util.PageUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.by4cloud.platformx.business.dto.TaxCodeQueryDTO;
import com.by4cloud.platformx.common.core.util.R;
import com.by4cloud.platformx.common.log.annotation.SysLog;
import com.by4cloud.platformx.business.entity.TaxCode;
import com.by4cloud.platformx.business.service.TaxCodeService;
import org.springframework.security.access.prepost.PreAuthorize;
import com.by4cloud.platformx.common.excel.annotation.ResponseExcel;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import org.springdoc.core.annotations.ParameterObject;
import org.springframework.http.HttpHeaders;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Objects;
/**
 * 税务编码
 *
 * @author syt
 * @date 2026-05-13 16:35:23
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/taxCode" )
@Tag(description = "taxCode" , name = "税务编码管理" )
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class TaxCodeController {
    private final  TaxCodeService taxCodeService;
    /**
     * 分页查询
     * @param page 分页对象
     * @param queryDTO 税务编码
     * @return
     */
    @Operation(summary = "分页查询" , description = "分页查询" )
    @GetMapping("/page" )
    @PreAuthorize("@pms.hasPermission('business_taxCode_view')" )
    public R getTaxCodePage(@ParameterObject Page page, @ParameterObject TaxCodeQueryDTO queryDTO) {
        return R.ok(taxCodeService.pageNew(page, queryDTO));
    }
    /**
     * 通过id查询税务编码
     * @param id id
     * @return R
     */
    @Operation(summary = "通过id查询" , description = "通过id查询" )
    @GetMapping("/{id}" )
    @PreAuthorize("@pms.hasPermission('business_taxCode_view')" )
    public R getById(@PathVariable("id" ) Integer id) {
        return R.ok(taxCodeService.getById(id));
    }
    /**
     * 新增税务编码
     * @param taxCode 税务编码
     * @return R
     */
    @Operation(summary = "新增税务编码" , description = "新增税务编码" )
    @SysLog("新增税务编码" )
    @PostMapping
    @PreAuthorize("@pms.hasPermission('business_taxCode_add')" )
    public R save(@RequestBody TaxCode taxCode) {
        return R.ok(taxCodeService.save(taxCode));
    }
    /**
     * 修改税务编码
     * @param taxCode 税务编码
     * @return R
     */
    @Operation(summary = "修改税务编码" , description = "修改税务编码" )
    @SysLog("修改税务编码" )
    @PutMapping
    @PreAuthorize("@pms.hasPermission('business_taxCode_edit')" )
    public R updateById(@RequestBody TaxCode taxCode) {
        return R.ok(taxCodeService.updateById(taxCode));
    }
    /**
     * 通过id删除税务编码
     * @param ids id列表
     * @return R
     */
    @Operation(summary = "通过id删除税务编码" , description = "通过id删除税务编码" )
    @SysLog("通过id删除税务编码" )
    @DeleteMapping
    @PreAuthorize("@pms.hasPermission('business_taxCode_del')" )
    public R removeById(@RequestBody Integer[] ids) {
        return R.ok(taxCodeService.removeBatchByIds(CollUtil.toList(ids)));
    }
    /**
     * 导出excel 表格
     * @param taxCode 查询条件
        * @param ids 导出指定ID
     * @return excel 文件流
     */
    @ResponseExcel
    @GetMapping("/export")
    @PreAuthorize("@pms.hasPermission('business_taxCode_export')" )
    public List<TaxCode> export(TaxCode taxCode,Integer[] ids) {
        return taxCodeService.list(Wrappers.lambdaQuery(taxCode).in(ArrayUtil.isNotEmpty(ids), TaxCode::getId, ids));
    }
}
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ContractOutBoundMapper.java
New file
@@ -0,0 +1,11 @@
package com.by4cloud.platformx.business.mapper;
import com.by4cloud.platformx.common.data.datascope.PlatformxBaseMapper;
import com.by4cloud.platformx.business.entity.ContractOutBound;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface ContractOutBoundMapper extends PlatformxBaseMapper<ContractOutBound> {
}
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/TaxCodeMapper.java
New file
@@ -0,0 +1,11 @@
package com.by4cloud.platformx.business.mapper;
import com.by4cloud.platformx.common.data.datascope.PlatformxBaseMapper;
import com.by4cloud.platformx.business.entity.TaxCode;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface TaxCodeMapper extends PlatformxBaseMapper<TaxCode> {
}
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ContractOutBoundService.java
New file
@@ -0,0 +1,8 @@
package com.by4cloud.platformx.business.service;
import com.by4cloud.platformx.business.entity.ContractOutBound;
import com.by4cloud.platformx.common.data.mybatis.IIService;
public interface ContractOutBoundService extends IIService<ContractOutBound> {
}
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/TaxCodeService.java
New file
@@ -0,0 +1,11 @@
package com.by4cloud.platformx.business.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.by4cloud.platformx.business.dto.TaxCodeQueryDTO;
import com.by4cloud.platformx.business.entity.TaxCode;
public interface TaxCodeService extends IService<TaxCode> {
    Page pageNew(Page page, TaxCodeQueryDTO queryDTO);
}
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractOutBoundServiceImpl.java
New file
@@ -0,0 +1,16 @@
package com.by4cloud.platformx.business.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.by4cloud.platformx.business.entity.ContractOutBound;
import com.by4cloud.platformx.business.mapper.ContractOutBoundMapper;
import com.by4cloud.platformx.business.service.ContractOutBoundService;
import org.springframework.stereotype.Service;
/**
 * 合同出库
 *
 * @author syt
 * @date 2026-05-14 09:21:54
 */
@Service
public class ContractOutBoundServiceImpl extends ServiceImpl<ContractOutBoundMapper, ContractOutBound> implements ContractOutBoundService {
}
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractPaymentScheduleProcessServiceImpl.java
@@ -121,37 +121,51 @@
        if (ArrayUtil.isNotEmpty(afterSchedule.toArray())&&afterSchedule.size()==1){
            //最后阶段生效时间
            ContractPaymentSchedule endSchedule = afterSchedule.get(0);
            endSchedule.setEffectiveDate(DateUtil.offsetDay(addDTO.getProcessDate(),endSchedule.getAgreedDays()));
            endSchedule.setEffectiveEndDate(contract.getExpirationDate());
            contractPaymentScheduleMapper.updateById(endSchedule);
            //当前阶段生效时间
            schedule.setEffectiveDate(DateUtil.offsetDay(addDTO.getProcessDate(),schedule.getAgreedDays()));
            schedule.setEffectiveEndDate(endSchedule.getEffectiveDate());
            contractPaymentScheduleMapper.updateById(schedule);
            //最后阶段应收
            PaymentConfirm newConfim = new PaymentConfirm();
            newConfim.setBusinessType(endSchedule.getStageName()+"应收");
            newConfim.setBusGuestId(contract.getPartyAId());
            newConfim.setBusGuestName(contract.getPartyA());
            newConfim.setContractId(contract.getId());
            newConfim.setContractName(contract.getContractName());
            newConfim.setContractNo(contract.getContractNo());
            newConfim.setScheduleId(endSchedule.getId());
            newConfim.setScheduleName(schedule.getStageName());
            newConfim.setConfirmTime(addDTO.getProcessDate());
            newConfim.setTransationAmount(endSchedule.getPlannedAmount());
            newConfim.setReceivableAmount(endSchedule.getPlannedAmount());
            PaymentConfirm lastNewConfirm = paymentConfirmMapper.selectOne(Wrappers.<PaymentConfirm>lambdaQuery().eq(PaymentConfirm::getContractId,contract.getId())
                    .orderByDesc(PaymentConfirm::getCreateTime).last("limit 1"));
            BigDecimal lastNewTotal = new BigDecimal("0");
            if(ObjUtil.isNotNull(lastNewConfirm)){
                lastNewTotal = lastNewConfirm.getTotalAmount();
            if (StrUtil.equals(endSchedule.getStageName(),"质保金")) {
                endSchedule.setEffectiveDate(DateUtil.offsetDay(addDTO.getProcessDate(), endSchedule.getAgreedDays()));
                endSchedule.setEffectiveEndDate(contract.getExpirationDate());
                contractPaymentScheduleMapper.updateById(endSchedule);
                //当前阶段生效时间
                schedule.setEffectiveDate(DateUtil.offsetDay(addDTO.getProcessDate(), schedule.getAgreedDays()));
                schedule.setEffectiveEndDate(endSchedule.getEffectiveDate());
                contractPaymentScheduleMapper.updateById(schedule);
                //最后阶段应收
                PaymentConfirm newConfim = new PaymentConfirm();
                newConfim.setBusinessType(endSchedule.getStageName() + "应收");
                newConfim.setBusGuestId(contract.getPartyAId());
                newConfim.setBusGuestName(contract.getPartyA());
                newConfim.setContractId(contract.getId());
                newConfim.setContractName(contract.getContractName());
                newConfim.setContractNo(contract.getContractNo());
                newConfim.setScheduleId(endSchedule.getId());
                newConfim.setScheduleName(schedule.getStageName());
                newConfim.setConfirmTime(addDTO.getProcessDate());
                newConfim.setTransationAmount(endSchedule.getPlannedAmount());
                newConfim.setReceivableAmount(endSchedule.getPlannedAmount());
                PaymentConfirm lastNewConfirm = paymentConfirmMapper.selectOne(Wrappers.<PaymentConfirm>lambdaQuery().eq(PaymentConfirm::getContractId, contract.getId())
                        .orderByDesc(PaymentConfirm::getCreateTime).last("limit 1"));
                BigDecimal lastNewTotal = new BigDecimal("0");
                if (ObjUtil.isNotNull(lastNewConfirm)) {
                    lastNewTotal = lastNewConfirm.getTotalAmount();
                }
                newConfim.setTotalAmount(lastNewTotal.subtract(newConfim.getReceivableAmount()));
                paymentConfirmMapper.insert(newConfim);
            }
            newConfim.setTotalAmount(lastNewTotal.subtract(newConfim.getReceivableAmount()));
            paymentConfirmMapper.insert(newConfim);
        }else {
            //更新合同下个阶段
            contract.setNextScheduleName(endSchedule.getStageName());
            contractMapper.updateById(contract);
        }
        if(ArrayUtil.isNotEmpty(afterSchedule.toArray())&&afterSchedule.size()>1){
            //更新合同下个阶段
            contract.setNextScheduleName(afterSchedule.get(0).getStageName());
            contractMapper.updateById(contract);
        }
        if(ArrayUtil.isEmpty(afterSchedule.toArray())){
            schedule.setEffectiveEndDate(contract.getExpirationDate());
            contractPaymentScheduleMapper.updateById(schedule);
            //更新合同下个阶段
            contract.setNextScheduleName("无");
            contractMapper.updateById(contract);
        }
        return R.ok();
    }
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractServiceImpl.java
@@ -166,19 +166,6 @@
        baseMapper.updateById(contract);
        ContractPaymentSchedule fitstSchedule = contractPaymentScheduleMapper.selectOne(Wrappers.<ContractPaymentSchedule>lambdaQuery().eq(ContractPaymentSchedule::getContractId,contract.getId())
                .orderByAsc(ContractPaymentSchedule::getCreateTime).last("limit 1"));
//        PaymentConfirm entity = new PaymentConfirm();
//        entity.setContractId(contract.getId());
//        entity.setContractName(contract.getContractName());
//        entity.setContractNo(contract.getContractNo());
//        entity.setBusGuestId(contract.getPartyAId());
//        entity.setBusGuestName(contract.getPartyA());
//        entity.setBusinessType(fitstSchedule.getStageName()+"应收");
//        entity.setTransationAmount(new BigDecimal(fitstSchedule.getPlannedAmount()));
//        entity.setReceivableAmount(new BigDecimal(fitstSchedule.getPlannedAmount()));
//        entity.setTotalAmount(new BigDecimal("0").subtract(new BigDecimal(fitstSchedule.getPlannedAmount())));
//        entity.setConfirmTime(new Date());
//        paymentConfirmMapper.insert(entity);
        if (fitstSchedule.getStageName().equals("合同签订")){
            //新增应收
            PaymentConfirm paymentConfirm = new PaymentConfirm();
@@ -207,43 +194,57 @@
        //查询是否有后续阶段
        List<ContractPaymentSchedule> afterSchedule = contractPaymentScheduleMapper.selectList(Wrappers.<ContractPaymentSchedule>lambdaQuery()
                .eq(ContractPaymentSchedule::getContractId, fitstSchedule.getContractId())
                .gt(ContractPaymentSchedule::getStageOrder, fitstSchedule.getStageOrder()));
                .gt(ContractPaymentSchedule::getStageOrder, fitstSchedule.getStageOrder())
                .orderByAsc(ContractPaymentSchedule::getCreateTime));
        if (ArrayUtil.isNotEmpty(afterSchedule.toArray())&&afterSchedule.size()==1){
            //最后阶段生效时间
            ContractPaymentSchedule endSchedule = afterSchedule.get(0);
            endSchedule.setEffectiveDate(DateUtil.offsetDay(new Date(),endSchedule.getAgreedDays()));
            endSchedule.setEffectiveEndDate(contract.getExpirationDate());
            contractPaymentScheduleMapper.updateById(endSchedule);
            //第一阶段生效时间
            fitstSchedule.setEffectiveDate(DateUtil.offsetDay(new Date(),fitstSchedule.getAgreedDays()));
            fitstSchedule.setEffectiveEndDate(endSchedule.getEffectiveDate());
            contractPaymentScheduleMapper.updateById(fitstSchedule);
            if (StrUtil.equals(endSchedule.getStageName(),"质保金")){
                endSchedule.setEffectiveDate(DateUtil.offsetDay(new Date(),endSchedule.getAgreedDays()));
                endSchedule.setEffectiveEndDate(contract.getExpirationDate());
                contractPaymentScheduleMapper.updateById(endSchedule);
                //第一阶段生效时间
                fitstSchedule.setEffectiveDate(DateUtil.offsetDay(new Date(),fitstSchedule.getAgreedDays()));
                fitstSchedule.setEffectiveEndDate(endSchedule.getEffectiveDate());
                contractPaymentScheduleMapper.updateById(fitstSchedule);
            //最后阶段应收
            PaymentConfirm newConfim = new PaymentConfirm();
            newConfim.setBusinessType(endSchedule.getStageName()+"应收");
            newConfim.setBusGuestId(contract.getPartyAId());
            newConfim.setBusGuestName(contract.getPartyA());
            newConfim.setContractId(contract.getId());
            newConfim.setContractName(contract.getContractName());
            newConfim.setContractNo(contract.getContractNo());
            newConfim.setScheduleId(endSchedule.getId());
            newConfim.setScheduleName(endSchedule.getStageName());
            newConfim.setConfirmTime(new Date());
            newConfim.setTransationAmount(endSchedule.getPlannedAmount());
            newConfim.setReceivableAmount(endSchedule.getPlannedAmount());
            PaymentConfirm lastNewConfirm = paymentConfirmMapper.selectOne(Wrappers.<PaymentConfirm>lambdaQuery().eq(PaymentConfirm::getContractId,contract.getId())
                    .orderByDesc(PaymentConfirm::getCreateTime).last("limit 1"));
            BigDecimal lastNewTotal = new BigDecimal("0");
            if(ObjUtil.isNotNull(lastNewConfirm)){
                lastNewTotal = lastNewConfirm.getTotalAmount();
                //最后阶段应收
                PaymentConfirm newConfim = new PaymentConfirm();
                newConfim.setBusinessType(endSchedule.getStageName()+"应收");
                newConfim.setBusGuestId(contract.getPartyAId());
                newConfim.setBusGuestName(contract.getPartyA());
                newConfim.setContractId(contract.getId());
                newConfim.setContractName(contract.getContractName());
                newConfim.setContractNo(contract.getContractNo());
                newConfim.setScheduleId(endSchedule.getId());
                newConfim.setScheduleName(endSchedule.getStageName());
                newConfim.setConfirmTime(new Date());
                newConfim.setTransationAmount(endSchedule.getPlannedAmount());
                newConfim.setReceivableAmount(endSchedule.getPlannedAmount());
                PaymentConfirm lastNewConfirm = paymentConfirmMapper.selectOne(Wrappers.<PaymentConfirm>lambdaQuery().eq(PaymentConfirm::getContractId,contract.getId())
                        .orderByDesc(PaymentConfirm::getCreateTime).last("limit 1"));
                BigDecimal lastNewTotal = new BigDecimal("0");
                if(ObjUtil.isNotNull(lastNewConfirm)){
                    lastNewTotal = lastNewConfirm.getTotalAmount();
                }
                newConfim.setTotalAmount(lastNewTotal.subtract(newConfim.getReceivableAmount()));
                paymentConfirmMapper.insert(newConfim);
            }
            newConfim.setTotalAmount(lastNewTotal.subtract(newConfim.getReceivableAmount()));
            paymentConfirmMapper.insert(newConfim);
            //更新合同下个阶段
            contract.setNextScheduleName(endSchedule.getStageName());
            baseMapper.updateById(contract);
        }
        if(ArrayUtil.isNotEmpty(afterSchedule.toArray())&&afterSchedule.size()>1){
            //更新合同下个阶段
            contract.setNextScheduleName(afterSchedule.get(0).getStageName());
            baseMapper.updateById(contract);
        }
        if(ArrayUtil.isEmpty(afterSchedule.toArray())){
            fitstSchedule.setEffectiveEndDate(contract.getExpirationDate());
            contractPaymentScheduleMapper.updateById(fitstSchedule);
            //更新合同下个阶段
            contract.setNextScheduleName("无");
            baseMapper.updateById(contract);
        }
        return Boolean.TRUE;
    }
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/OutBoundServiceImpl.java
@@ -40,6 +40,7 @@
    private final PaymentConfirmMapper paymentConfirmMapper;
    private final ContractMapper contractMapper;
    private final ContractPaymentScheduleProcessMapper scheduleProcessMapper;
    private final ContractOutBoundMapper contractOutBoundMapper;
    @Override
    public R add(OutBoundAddDTO addDTO) {
@@ -49,6 +50,7 @@
        MPJLambdaWrapper<ContractSubjectMatter> wrapper = new MPJLambdaWrapper<ContractSubjectMatter>()
                .selectAll(ContractSubjectMatter.class)
                .ne(ContractSubjectMatter::getDeliveryStatus, 2)
                .in(ContractSubjectMatter::getMaterialCode,addDTO.getSubjectMatterList().stream().map(item->item.getSubjectMatterCode()).collect(Collectors.toList()))
                .exists(Contract.class, contractQuery ->
                        contractQuery.select(ContractSubjectMatter::getId)
                                .eq(Contract::getId, ContractSubjectMatter::getContractId)
@@ -80,7 +82,7 @@
        addDTO.getSubjectMatterList().stream().forEach(outSubjectMatterAddDTO -> {
            BigDecimal remainNum = outSubjectMatterAddDTO.getOutBoundNum();
            for (ContractSubjectMatter subjectMatter : subjectMatterList) {
                Contract contract = contractMapper.selectById(subjectMatter.getContractId());
                if (subjectMatter.getDeliveredQuantity().compareTo(new BigDecimal("0")) > 0) {
                    remainNum = remainNum.subtract(subjectMatter.getRemainingQuantity());
                    //部分交付状态下 全部出库
@@ -93,15 +95,19 @@
                        subjectMatter.setLastDeliveredQuantity(currentOut);
                        contractSubjectMatterMapper.updateById(subjectMatter);
                        currentOutList.add(subjectMatter);
                        //新增合同出库历史
                        saveContractOutBound(contract,addDTO,subjectMatter);
                    } else {
                        BigDecimal currentOut = remainNum.add(subjectMatter.getRemainingQuantity());
                        subjectMatter.setDeliveredQuantity(subjectMatter.getQuantity().add(remainNum));
                        subjectMatter.setRemainingQuantity(remainNum.multiply(new BigDecimal("-1")));
                        subjectMatter.setRemainingQuantity(subjectMatter.getRemainingQuantity().subtract(currentOut));
                        subjectMatter.setActualDeliveryDate(DateUtil.today());
                        subjectMatter.setDeliveryStatus(1);
                        subjectMatter.setLastDeliveredQuantity(currentOut);
                        contractSubjectMatterMapper.updateById(subjectMatter);
                        currentOutList.add(subjectMatter);
                        //新增合同出库历史
                        saveContractOutBound(contract,addDTO,subjectMatter);
                        break;
                    }
@@ -113,9 +119,11 @@
                        subjectMatter.setRemainingQuantity(new BigDecimal("0"));
                        subjectMatter.setActualDeliveryDate(DateUtil.today());
                        subjectMatter.setDeliveryStatus(2);
                        contractSubjectMatterMapper.updateById(subjectMatter);
                        subjectMatter.setLastDeliveredQuantity(subjectMatter.getQuantity());
                        contractSubjectMatterMapper.updateById(subjectMatter);
                        currentOutList.add(subjectMatter);
                        //新增合同出库历史
                        saveContractOutBound(contract,addDTO,subjectMatter);
                    } else {
                        BigDecimal currentOut = remainNum.add(subjectMatter.getQuantity());
                        subjectMatter.setDeliveredQuantity(subjectMatter.getQuantity().add(remainNum));
@@ -125,6 +133,8 @@
                        subjectMatter.setLastDeliveredQuantity(currentOut);
                        contractSubjectMatterMapper.updateById(subjectMatter);
                        currentOutList.add(subjectMatter);
                        //新增合同出库历史
                        saveContractOutBound(contract,addDTO,subjectMatter);
                        break;
                    }
                }
@@ -148,7 +158,7 @@
                //当前出库金额
                BigDecimal outPirce = value.stream()
                        .filter(item -> item.getLastDeliveredQuantity() != null && item.getUnitPrice() != null)
                        .map(item -> item.getLastDeliveredQuantity().multiply(item.getUnitPrice()))
                        .map(item ->(item.getDeliveryStatus()==1?item.getDeliveredQuantity():item.getQuantity()).multiply(item.getUnitPrice()))
                        .reduce(BigDecimal.ZERO, BigDecimal::add);
                //合同金额
                Contract contract = contractMapper.selectById(key);
@@ -162,7 +172,6 @@
                    contractMapper.updateById(contract);
                }
                if (ObjUtil.isNotNull(schedule)) {
                    //按出库资金比例 计算发货前应收更新资金明细
                    PaymentConfirm paymentConfirm = new PaymentConfirm();
                    paymentConfirm.setBusinessType("发货前应收");
@@ -215,43 +224,56 @@
                    //查询是否有后续阶段
                    List<ContractPaymentSchedule> afterSchedule = scheduleMapper.selectList(Wrappers.<ContractPaymentSchedule>lambdaQuery()
                            .eq(ContractPaymentSchedule::getContractId, schedule.getContractId())
                            .gt(ContractPaymentSchedule::getStageOrder, schedule.getStageOrder()));
                            .gt(ContractPaymentSchedule::getStageOrder, schedule.getStageOrder())
                            .orderByAsc(ContractPaymentSchedule::getCreateTime));
                    if (ArrayUtil.isNotEmpty(afterSchedule.toArray())&&afterSchedule.size()==1){
                        //最后阶段生效时间
                        ContractPaymentSchedule endSchedule = afterSchedule.get(0);
                        endSchedule.setEffectiveDate(DateUtil.offsetDay(addDTO.getOutBoundTime(),endSchedule.getAgreedDays()));
                        endSchedule.setEffectiveEndDate(contract.getExpirationDate());
                        scheduleMapper.updateById(endSchedule);
                        //当前阶段生效时间
                        schedule.setEffectiveDate(DateUtil.offsetDay(addDTO.getOutBoundTime(),schedule.getAgreedDays()));
                        schedule.setEffectiveEndDate(endSchedule.getEffectiveDate());
                        scheduleMapper.updateById(schedule);
                        //最后阶段应收
                        PaymentConfirm newConfim = new PaymentConfirm();
                        newConfim.setBusinessType(endSchedule.getStageName()+"应收");
                        newConfim.setBusGuestId(contract.getPartyAId());
                        newConfim.setBusGuestName(contract.getPartyA());
                        newConfim.setContractId(contract.getId());
                        newConfim.setContractName(contract.getContractName());
                        newConfim.setContractNo(contract.getContractNo());
                        newConfim.setScheduleId(endSchedule.getId());
                        newConfim.setScheduleName(schedule.getStageName());
                        newConfim.setConfirmTime(addDTO.getOutBoundTime());
                        newConfim.setTransationAmount(endSchedule.getPlannedAmount());
                        newConfim.setReceivableAmount(endSchedule.getPlannedAmount());
                        PaymentConfirm lastNewConfirm = paymentConfirmMapper.selectOne(Wrappers.<PaymentConfirm>lambdaQuery().eq(PaymentConfirm::getContractId,contract.getId())
                                .orderByDesc(PaymentConfirm::getCreateTime).last("limit 1"));
                        BigDecimal lastNewTotal = new BigDecimal("0");
                        if(ObjUtil.isNotNull(lastNewConfirm)){
                            lastNewTotal = lastNewConfirm.getTotalAmount();
                        if (StrUtil.equals(endSchedule.getStageName(),"质保金")) {
                            endSchedule.setEffectiveDate(DateUtil.offsetDay(addDTO.getOutBoundTime(), endSchedule.getAgreedDays()));
                            endSchedule.setEffectiveEndDate(contract.getExpirationDate());
                            scheduleMapper.updateById(endSchedule);
                            //当前阶段生效时间
                            schedule.setEffectiveDate(DateUtil.offsetDay(addDTO.getOutBoundTime(), schedule.getAgreedDays()));
                            schedule.setEffectiveEndDate(endSchedule.getEffectiveDate());
                            scheduleMapper.updateById(schedule);
                            //最后阶段应收
                            PaymentConfirm newConfim = new PaymentConfirm();
                            newConfim.setBusinessType(endSchedule.getStageName() + "应收");
                            newConfim.setBusGuestId(contract.getPartyAId());
                            newConfim.setBusGuestName(contract.getPartyA());
                            newConfim.setContractId(contract.getId());
                            newConfim.setContractName(contract.getContractName());
                            newConfim.setContractNo(contract.getContractNo());
                            newConfim.setScheduleId(endSchedule.getId());
                            newConfim.setScheduleName(schedule.getStageName());
                            newConfim.setConfirmTime(addDTO.getOutBoundTime());
                            newConfim.setTransationAmount(endSchedule.getPlannedAmount());
                            newConfim.setReceivableAmount(endSchedule.getPlannedAmount());
                            PaymentConfirm lastNewConfirm = paymentConfirmMapper.selectOne(Wrappers.<PaymentConfirm>lambdaQuery().eq(PaymentConfirm::getContractId, contract.getId())
                                    .orderByDesc(PaymentConfirm::getCreateTime).last("limit 1"));
                            BigDecimal lastNewTotal = new BigDecimal("0");
                            if (ObjUtil.isNotNull(lastNewConfirm)) {
                                lastNewTotal = lastNewConfirm.getTotalAmount();
                            }
                            newConfim.setTotalAmount(lastNewTotal.subtract(newConfim.getReceivableAmount()));
                            paymentConfirmMapper.insert(newConfim);
                        }
                        newConfim.setTotalAmount(lastNewTotal.subtract(newConfim.getReceivableAmount()));
                        paymentConfirmMapper.insert(newConfim);
                        //更新合同下个阶段
                        contract.setNextScheduleName(endSchedule.getStageName());
                        contractMapper.updateById(contract);
                    }
                    if(ArrayUtil.isNotEmpty(afterSchedule.toArray())&&afterSchedule.size()>1){
                        //更新合同下个阶段
                        contract.setNextScheduleName(afterSchedule.get(0).getStageName());
                        contractMapper.updateById(contract);
                    }
                    if(ArrayUtil.isEmpty(afterSchedule.toArray())){
                        schedule.setEffectiveEndDate(contract.getExpirationDate());
                        scheduleMapper.updateById(schedule);
                        //更新合同下个阶段
                        contract.setNextScheduleName("无");
                        contractMapper.updateById(contract);
                    }
                }
            });
@@ -259,4 +281,19 @@
        return R.ok();
    }
    private void saveContractOutBound(Contract contract, OutBoundAddDTO addDTO, ContractSubjectMatter subjectMatter) {
        ContractOutBound contractOutBound = new ContractOutBound();
        contractOutBound.setContractId(contract.getId());
        contractOutBound.setContractName(contract.getContractName());
        contractOutBound.setBusGuestId(contract.getPartyAId());
        contractOutBound.setBusGuestName(contract.getPartyA());
        contractOutBound.setSubjectMatterCode(subjectMatter.getMaterialCode());
        contractOutBound.setSubjectMatterName(subjectMatter.getMaterialInternalName());
        contractOutBound.setOutBoundTime(addDTO.getOutBoundTime());
        contractOutBound.setOutBoundNum(subjectMatter.getLastDeliveredQuantity());
        contractOutBound.setOutBoundAttNames(addDTO.getOutBoundAttNames());
        contractOutBound.setOutBoundAttPaths(addDTO.getOutBoundAttPaths());
        contractOutBoundMapper.insert(contractOutBound);
    }
}
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/TaxCodeServiceImpl.java
New file
@@ -0,0 +1,106 @@
package com.by4cloud.platformx.business.service.impl;
import cn.hutool.core.lang.tree.Tree;
import cn.hutool.core.lang.tree.TreeNode;
import cn.hutool.core.lang.tree.TreeUtil;
import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.by4cloud.platformx.admin.api.entity.SysDept;
import com.by4cloud.platformx.business.dto.TaxCodeQueryDTO;
import com.by4cloud.platformx.business.entity.TaxCode;
import com.by4cloud.platformx.business.mapper.TaxCodeMapper;
import com.by4cloud.platformx.business.service.TaxCodeService;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
 * 税务编码
 *
 * @author syt
 * @date 2026-05-13 16:35:23
 */
@Service
public class TaxCodeServiceImpl extends ServiceImpl<TaxCodeMapper, TaxCode> implements TaxCodeService {
    @Override
    public Page pageNew(Page page, TaxCodeQueryDTO queryDTO) {
        MPJLambdaWrapper<TaxCode> wrapper = new MPJLambdaWrapper<TaxCode>()
                .selectAll(TaxCode.class)
                .selectAs("(select count(1) from tax_code t1 where t1.parent_bm = t.bm)",TaxCode::getChildNum)
                .like(StrUtil.isNotBlank(queryDTO.getMc()),TaxCode::getMc,queryDTO.getMc());
        if (ObjUtil.isNotNull(queryDTO.getChildNum())){
            if (queryDTO.getChildNum()==0){
                wrapper.eq("(select count(1) from tax_code t1 where t1.parent_bm = t.bm)",0);
            }else {
                wrapper.gt("(select count(1) from tax_code t1 where t1.parent_bm = t.bm)",0);
            }
        }
//        List<TaxCode> taxCodeList = baseMapper.selectPage(wrapper);
//        List<TaxCode> treeList=buildTreeByStream(taxCodeList, "1");
        return baseMapper.selectPage(page,wrapper);
    }
    /**
     * 使用 Stream 递归构建树
     * @param allNodes 所有节点
     * @param parentId 当前层级的父ID
     * @return 树形列表
     */
    public static List<TaxCode> buildTreeByStream(List<TaxCode> allNodes, String parentId) {
        return allNodes.stream()
                .filter(node -> {
                    // 过滤出父编码等于当前 parentId 的节点
                    if (parentId == null) {
                        return node.getParentBm() == null || node.getParentBm().isEmpty();
                    }
                    return parentId.equals(node.getParentBm());
                })
                .peek(node -> {
                    // 递归设置子节点
                    node.setChildren(buildTreeByStream(allNodes, node.getBm()));
                })
                .collect(Collectors.toList());
    }
    public <T> Page<T> convert(List<T> dataList, Page<T> pageParam) {
        if (dataList == null) {
            dataList = java.util.Collections.emptyList();
        }
        long total = dataList.size();
        long current = pageParam.getCurrent();
        long size = pageParam.getSize();
        // 计算总页数
        long pages = (total + size - 1) / size;
        // 计算截取范围
        long startIndex = (current - 1) * size;
        long endIndex = Math.min(startIndex + size, total);
        List<T> records;
        if (startIndex >= total) {
            records = java.util.Collections.emptyList();
        } else {
            records = dataList.subList((int) startIndex, (int) endIndex);
        }
        // 设置结果
        pageParam.setRecords(records);
        pageParam.setTotal(total);
        pageParam.setPages(pages);
        return pageParam;
    }
}
platformx-business-finance-biz/src/main/resources/mapper/ContractOutBoundMapper.xml
New file
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.by4cloud.platformx.business.mapper.ContractOutBoundMapper">
  <resultMap id="contractOutBoundMap" type="com.by4cloud.platformx.business.entity.ContractOutBound">
        <id property="id" column="id"/>
        <result property="compId" column="comp_id"/>
        <result property="busGuestId" column="bus_guest_id"/>
        <result property="busGuestName" column="bus_guest_name"/>
        <result property="contractId" column="contract_id"/>
        <result property="contractName" column="contract_name"/>
        <result property="outBoundAttNames" column="out_bound_att_names"/>
        <result property="outBoundAttPaths" column="out_bound_att_paths"/>
        <result property="outBoundNum" column="out_bound_num"/>
        <result property="outBoundTime" column="out_bound_time"/>
        <result property="subjectMatterCode" column="subject_matter_code"/>
        <result property="subjectMatterName" column="subject_matter_name"/>
        <result property="createBy" column="create_by"/>
        <result property="createTime" column="create_time"/>
        <result property="updateBy" column="update_by"/>
        <result property="updateTime" column="update_time"/>
        <result property="delFlag" column="del_flag"/>
  </resultMap>
</mapper>
platformx-business-finance-biz/src/main/resources/mapper/TaxCodeMapper.xml
New file
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.by4cloud.platformx.business.mapper.TaxCodeMapper">
  <resultMap id="taxCodeMap" type="com.by4cloud.platformx.business.entity.TaxCode">
        <id property="id" column="id"/>
        <result property="compId" column="comp_id"/>
        <result property="bm" column="bm"/>
        <result property="gjz" column="gjz"/>
        <result property="gmtjdm" column="gmtjdm"/>
        <result property="mc" column="mc"/>
        <result property="parentBm" column="parent_bm"/>
        <result property="prov" column="prov"/>
        <result property="sl" column="sl"/>
        <result property="sm" column="sm"/>
        <result property="sphwjc" column="sphwjc"/>
        <result property="xfsgl" column="xfsgl"/>
        <result property="xfstsgldm" column="xfstsgldm"/>
        <result property="xfszcyj" column="xfszcyj"/>
        <result property="zzstsgl" column="zzstsgl"/>
        <result property="zzstsgldm" column="zzstsgldm"/>
        <result property="zzstsyj" column="zzstsyj"/>
        <result property="createBy" column="create_by"/>
        <result property="createTime" column="create_time"/>
        <result property="updateBy" column="update_by"/>
        <result property="updateTime" column="update_time"/>
        <result property="delFlag" column="del_flag"/>
  </resultMap>
</mapper>