feat:合同新增时显示供应属性 出库新增根据合同出库 资金账目新增时间条件检索 新增延期出货菜单
15个文件已修改
5个文件已添加
653 ■■■■■ 已修改文件
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/ContractDelayOutQueryDTO.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/OutBoundAddDTO.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/OutSubjectMatterAddDTO.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/PaymentConfirmQueryDTO.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/BipTaxEconomicMatters.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/ContractSubjectMatter.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/vo/ContractDelayOutPageVo.java 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ContractController.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ContractDelayOutController.java 123 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ContractSubjectMatterController.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/OutBoundController.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/PaymentConfirmController.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ContractDelayOutMapper.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ContractDelayOutService.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ContractSubjectMatterService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/OutBoundService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractDelayOutServiceImpl.java 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractSubjectMatterServiceImpl.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/OutBoundServiceImpl.java 278 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-biz/src/main/resources/mapper/ContractDelayOutMapper.xml 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/ContractDelayOutQueryDTO.java
New file
@@ -0,0 +1,14 @@
package com.by4cloud.platformx.business.dto;
import lombok.Data;
@Data
public class ContractDelayOutQueryDTO {
    private String partyA;
    private String partyB;
    private String contractName;
}
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/OutBoundAddDTO.java
@@ -17,8 +17,11 @@
    @Schema(description = "客商ID")
    private Long busGuestId;
    @Schema(description = "合同编号")
    private String contractNo;
    @Schema(description = "出库时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date outBoundTime;
    @Schema(description = "单据名称")
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/OutSubjectMatterAddDTO.java
@@ -8,6 +8,8 @@
@Data
public class OutSubjectMatterAddDTO {
    private Long id;
    @Schema(description = "标的物名称")
    private String subjectMatterName;
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/PaymentConfirmQueryDTO.java
New file
@@ -0,0 +1,28 @@
package com.by4cloud.platformx.business.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.Column;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
public class PaymentConfirmQueryDTO {
    @Schema(description = "客商名称")
    private String busGuestName;
    @Schema(description = "业务类型")
    private String businessType;
    @Schema(description = "合同名称")
    private String contractName;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;
}
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/BipTaxEconomicMatters.java
New file
@@ -0,0 +1,24 @@
package com.by4cloud.platformx.business.entity;
import com.by4cloud.platformx.common.data.mybatis.BaseModel;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import lombok.Data;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.Table;
@Data
@Entity
@jakarta.persistence.Table(name = "bip_tax_economic_matters")
@Table(appliesTo = "bip_tax_economic_matters")
@Comment("bip经济事项关联税收分类")
public class BipTaxEconomicMatters extends BaseModel<BipTaxEconomicMatters> {
    @Comment("税收分类编码")
    @Column(name="taxCode",length = 64)
    private String taxCode;
    @Comment("经济事项")
    @Column(name="economicMatters",length = 64)
    private String economicMatters;
}
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/ContractSubjectMatter.java
@@ -106,11 +106,11 @@
    @Column(columnDefinition = "date comment '计划交付日期'")
    private Date plannedDeliveryDate;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Schema(description = "实际交付日期")
    @Column(columnDefinition = "VARCHAR(64) comment '实际交付日期'")
    private String actualDeliveryDate;
    @Column(columnDefinition = "date comment '实际交付日期'")
    private Date actualDeliveryDate;
    @Schema(description = "交付状态(0-未交付 1-部分交付 2-已交付)")
    @Column(columnDefinition = "tinyint(2) default 0 comment '交付状态'")
platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/vo/ContractDelayOutPageVo.java
New file
@@ -0,0 +1,38 @@
package com.by4cloud.platformx.business.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Date;
@Data
public class ContractDelayOutPageVo {
    @Schema(description = "合同名称")
    private String contractName;
    @Schema(description = "合同名称甲方")
    private String partyA;
    @Schema(description = "合同名称乙方")
    private String partyB;
    @Schema(description = "延期天数")
    private Integer delayDay;
    @Schema(description = "延期单据名称")
    private String delayAttNames;
    @Schema(description = "延期单据路径")
    private String delayAttPaths;
    @Schema(description = "提交账号")
    private String applyName;
    @Schema(description = "提交时间")
    private Date applyTime;
    @Schema(description = "状态")
    private String delayStatus;
}
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ContractController.java
@@ -133,6 +133,14 @@
    }
    /**
     * list 下拉
     */
    @GetMapping("/list")
    public R list() {
        return R.ok(contractService.list(Wrappers.<Contract>lambdaQuery().eq(Contract::getContractStatus,2).orderByDesc(Contract::getCreateTime)));
    }
    /**
     * 启动审核流程
     * @param id id
     * @return R
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ContractDelayOutController.java
New file
@@ -0,0 +1,123 @@
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.business.dto.ContractDelayOutQueryDTO;
import com.by4cloud.platformx.common.core.util.R;
import com.by4cloud.platformx.common.log.annotation.SysLog;
import com.by4cloud.platformx.business.entity.ContractDelayOut;
import com.by4cloud.platformx.business.service.ContractDelayOutService;
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-06-17 08:44:56
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/contractDelayOut" )
@Tag(description = "contractDelayOut" , name = "延期出货管理" )
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class ContractDelayOutController {
    private final  ContractDelayOutService contractDelayOutService;
    /**
     * 分页查询
     * @param page 分页对象
     * @param queryDTO 延期出货
     * @return
     */
    @Operation(summary = "分页查询" , description = "分页查询" )
    @GetMapping("/page" )
    @PreAuthorize("@pms.hasPermission('business_contractDelayOut_view')" )
    public R getContractDelayOutPage(@ParameterObject Page page, @ParameterObject ContractDelayOutQueryDTO queryDTO) {
        LambdaQueryWrapper<ContractDelayOut> wrapper = Wrappers.lambdaQuery();
//        wrapper.eq(StrUtil.isNotBlank(contractDelayOut.getDelayAttNames()),ContractDelayOut::getDelayAttNames,contractDelayOut.getDelayAttNames());
//        wrapper.eq(StrUtil.isNotBlank(contractDelayOut.getDelayStatus()),ContractDelayOut::getDelayStatus,contractDelayOut.getDelayStatus());
        return R.ok(contractDelayOutService.pageNew(page, queryDTO));
    }
    /**
     * 通过id查询延期出货
     * @param id id
     * @return R
     */
    @Operation(summary = "通过id查询" , description = "通过id查询" )
    @GetMapping("/{id}" )
    @PreAuthorize("@pms.hasPermission('business_contractDelayOut_view')" )
    public R getById(@PathVariable("id" ) Long id) {
        return R.ok(contractDelayOutService.getById(id));
    }
    /**
     * 新增延期出货
     * @param contractDelayOut 延期出货
     * @return R
     */
    @Operation(summary = "新增延期出货" , description = "新增延期出货" )
    @SysLog("新增延期出货" )
    @PostMapping
    @PreAuthorize("@pms.hasPermission('business_contractDelayOut_add')" )
    public R save(@RequestBody ContractDelayOut contractDelayOut) {
        return R.ok(contractDelayOutService.save(contractDelayOut));
    }
    /**
     * 修改延期出货
     * @param contractDelayOut 延期出货
     * @return R
     */
    @Operation(summary = "修改延期出货" , description = "修改延期出货" )
    @SysLog("修改延期出货" )
    @PutMapping
    @PreAuthorize("@pms.hasPermission('business_contractDelayOut_edit')" )
    public R updateById(@RequestBody ContractDelayOut contractDelayOut) {
        return R.ok(contractDelayOutService.updateById(contractDelayOut));
    }
    /**
     * 通过id删除延期出货
     * @param ids id列表
     * @return R
     */
    @Operation(summary = "通过id删除延期出货" , description = "通过id删除延期出货" )
    @SysLog("通过id删除延期出货" )
    @DeleteMapping
    @PreAuthorize("@pms.hasPermission('business_contractDelayOut_del')" )
    public R removeById(@RequestBody Long[] ids) {
        return R.ok(contractDelayOutService.removeBatchByIds(CollUtil.toList(ids)));
    }
    /**
     * 导出excel 表格
     * @param contractDelayOut 查询条件
        * @param ids 导出指定ID
     * @return excel 文件流
     */
    @ResponseExcel
    @GetMapping("/export")
    @PreAuthorize("@pms.hasPermission('business_contractDelayOut_export')" )
    public List<ContractDelayOut> export(ContractDelayOut contractDelayOut,Long[] ids) {
        return contractDelayOutService.list(Wrappers.lambdaQuery(contractDelayOut).in(ArrayUtil.isNotEmpty(ids), ContractDelayOut::getId, ids));
    }
}
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ContractSubjectMatterController.java
@@ -126,4 +126,14 @@
    public R selectSubjectMatterProcess(@PathVariable("id" ) Long id) {
        return contractSubjectMatterService.selectSubjectMatterProcess(id);
    }
    /**
     * 通过合同id查询标的物履约进度
     * @param contractId id
     * @return R
     */
    @GetMapping("/selectSubjectMatter/{contractId}" )
    public R selectSubjectMatter(@PathVariable("contractId" ) Long contractId) {
        return contractSubjectMatterService.selectSubjectMatter(contractId);
    }
}
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/OutBoundController.java
@@ -82,6 +82,18 @@
        return outBoundService.add(addDTO);
    }
    /**
     * 新增合同出库记录
     * @param addDTO 合同出库记录
     * @return R
     */
    @Operation(summary = "新增合同出库记录" , description = "新增合同出库记录" )
    @SysLog("新增合同出库记录" )
    @PostMapping("/addContractOut")
    public R addContractOut(@RequestBody OutBoundAddDTO addDTO) {
        return outBoundService.addContractOut(addDTO);
    }
    /**
     * 修改EPR出库记录
     * @param outBound EPR出库记录
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/PaymentConfirmController.java
@@ -1,5 +1,6 @@
package com.by4cloud.platformx.business.controller;
import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.collection.CollUtil;
@@ -7,6 +8,7 @@
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.by4cloud.platformx.business.dto.PaymentConfirmAddDTO;
import com.by4cloud.platformx.business.dto.PaymentConfirmQueryDTO;
import com.by4cloud.platformx.common.core.util.R;
import com.by4cloud.platformx.common.log.annotation.SysLog;
import com.by4cloud.platformx.business.entity.PaymentConfirm;
@@ -42,17 +44,19 @@
    /**
     * 分页查询
     * @param page 分页对象
     * @param paymentConfirm 收款确认
     * @param queryDTO 收款确认
     * @return
     */
    @Operation(summary = "分页查询" , description = "分页查询" )
    @GetMapping("/page" )
    @PreAuthorize("@pms.hasPermission('business_paymentConfirm_view')" )
    public R getPaymentConfirmPage(@ParameterObject Page page, @ParameterObject PaymentConfirm paymentConfirm) {
    public R getPaymentConfirmPage(@ParameterObject Page page, @ParameterObject PaymentConfirmQueryDTO queryDTO) {
        LambdaQueryWrapper<PaymentConfirm> wrapper = Wrappers.lambdaQuery();
        wrapper.like(StrUtil.isNotBlank(paymentConfirm.getBusGuestName()),PaymentConfirm::getBusGuestName,paymentConfirm.getBusGuestName());
        wrapper.like(StrUtil.isNotBlank(paymentConfirm.getContractName()),PaymentConfirm::getContractName,paymentConfirm.getContractName());
        wrapper.like(StrUtil.isNotBlank(paymentConfirm.getBusinessType()),PaymentConfirm::getBusinessType,paymentConfirm.getBusinessType());
        wrapper.like(StrUtil.isNotBlank(queryDTO.getBusGuestName()),PaymentConfirm::getBusGuestName,queryDTO.getBusGuestName());
        wrapper.like(StrUtil.isNotBlank(queryDTO.getContractName()),PaymentConfirm::getContractName,queryDTO.getContractName());
        wrapper.like(StrUtil.isNotBlank(queryDTO.getBusinessType()),PaymentConfirm::getBusinessType,queryDTO.getBusinessType());
        wrapper.ge(ObjUtil.isNotNull(queryDTO.getStartTime()),PaymentConfirm::getConfirmTime,queryDTO.getStartTime());
        wrapper.le(ObjUtil.isNotNull(queryDTO.getEndTime()),PaymentConfirm::getConfirmTime,queryDTO.getEndTime());
        wrapper.orderByDesc(PaymentConfirm::getCreateTime);
        return R.ok(paymentConfirmService.pageByScope(page, wrapper));
    }
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ContractDelayOutMapper.java
@@ -1,11 +1,17 @@
package com.by4cloud.platformx.business.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.by4cloud.platformx.business.dto.ContractDelayOutQueryDTO;
import com.by4cloud.platformx.business.entity.ContractDelayOut;
import com.by4cloud.platformx.business.vo.ContractDelayOutPageVo;
import com.by4cloud.platformx.common.data.datascope.DataScope;
import com.by4cloud.platformx.common.data.datascope.PlatformxBaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface ContractDelayOutMapper extends PlatformxBaseMapper<ContractDelayOut> {
    Page<ContractDelayOutPageVo> pageNew(Page page, @Param("queryDTO") ContractDelayOutQueryDTO queryDTO, DataScope comp_id);
}
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ContractDelayOutService.java
@@ -1,7 +1,14 @@
package com.by4cloud.platformx.business.service;
public interface ContractDelayOutService {
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.by4cloud.platformx.business.dto.ContractDelayOutQueryDTO;
import com.by4cloud.platformx.business.entity.ContractDelayOut;
import com.by4cloud.platformx.common.data.mybatis.IIService;
public interface ContractDelayOutService extends IIService<ContractDelayOut> {
    void approvalPass(Long contractId);
    void refuseApproval(Long contractId);
}
    Page pageNew(Page page, ContractDelayOutQueryDTO queryDTO);
}
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ContractSubjectMatterService.java
@@ -7,4 +7,6 @@
public interface ContractSubjectMatterService extends IService<ContractSubjectMatter> {
    R selectSubjectMatterProcess(Long id);
    R selectSubjectMatter(Long contractId);
}
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/OutBoundService.java
@@ -8,4 +8,6 @@
public interface OutBoundService extends IIService<OutBound> {
    R add(OutBoundAddDTO addDTO);
    R addContractOut(OutBoundAddDTO addDTO);
}
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractDelayOutServiceImpl.java
@@ -1,23 +1,28 @@
package com.by4cloud.platformx.business.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjUtil;
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.business.dto.ContractDelayOutQueryDTO;
import com.by4cloud.platformx.business.entity.Contract;
import com.by4cloud.platformx.business.entity.ContractDelayOut;
import com.by4cloud.platformx.business.mapper.ContractDelayOutMapper;
import com.by4cloud.platformx.business.mapper.ContractMapper;
import com.by4cloud.platformx.business.service.ContractDelayOutService;
import com.by4cloud.platformx.common.data.datascope.DataScope;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Slf4j
/**
 * 延期出货
 *
 * @author syt
 * @date 2026-06-17 08:44:56
 */
@Service
@RequiredArgsConstructor
public class ContractDelayOutServiceImpl  extends ServiceImpl<ContractDelayOutMapper, ContractDelayOut> implements ContractDelayOutService {
public class ContractDelayOutServiceImpl extends ServiceImpl<ContractDelayOutMapper, ContractDelayOut> implements ContractDelayOutService {
    private final ContractMapper contractMapper;
@@ -51,4 +56,9 @@
        delayOut.setDelayStatus("2");
        baseMapper.updateById(delayOut);
    }
}
    @Override
    public Page pageNew(Page page, ContractDelayOutQueryDTO queryDTO) {
        return baseMapper.pageNew(page,queryDTO, DataScope.of("comp_id"));
    }
}
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractSubjectMatterServiceImpl.java
@@ -1,11 +1,14 @@
package com.by4cloud.platformx.business.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.by4cloud.platformx.business.entity.ContractSubjectMatter;
import com.by4cloud.platformx.business.mapper.ContractSubjectMatterMapper;
import com.by4cloud.platformx.business.service.ContractSubjectMatterService;
import com.by4cloud.platformx.business.vo.ContractSubjectMatterVo;
import com.by4cloud.platformx.common.core.util.R;
import com.by4cloud.platformx.common.data.datascope.DataScope;
import com.by4cloud.platformx.common.data.mybatis.BaseModel;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import org.springframework.stereotype.Service;
@@ -29,4 +32,10 @@
        List<ContractSubjectMatterVo> matterVoList = baseMapper.selectJoinList(ContractSubjectMatterVo.class,wrapper);
        return R.ok(matterVoList);
    }
    @Override
    public R selectSubjectMatter(Long contractId) {
        return R.ok(baseMapper.selectListByScope(Wrappers.<ContractSubjectMatter>lambdaQuery().eq(ContractSubjectMatter::getContractId,contractId)
                .orderByAsc(ContractSubjectMatter::getCreateTime), DataScope.of("comp_id")));
    }
}
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/OutBoundServiceImpl.java
@@ -53,7 +53,7 @@
                .in(ContractSubjectMatter::getMaterialCode, addDTO.getSubjectMatterList().stream().map(item -> item.getSubjectMatterCode()).collect(Collectors.toList()))
                .exists(Contract.class, contractQuery ->
                        contractQuery.select(ContractSubjectMatter::getId)
                                .eq(Contract::getContractStatus,2)
                                .eq(Contract::getContractStatus, 2)
                                .eq(Contract::getId, ContractSubjectMatter::getContractId)
                                .eq(StrUtil.isNotBlank(addDTO.getBusGuestName()), Contract::getPartyA, addDTO.getBusGuestName())
                                .eq(ObjUtil.isNotNull(addDTO.getBusGuestId()), Contract::getPartyAId, addDTO.getBusGuestId())
@@ -98,7 +98,7 @@
                            BigDecimal currentOut = subjectMatter.getRemainingQuantity();
                            subjectMatter.setDeliveredQuantity(subjectMatter.getQuantity());
                            subjectMatter.setRemainingQuantity(new BigDecimal("0"));
                            subjectMatter.setActualDeliveryDate(DateUtil.today());
                            subjectMatter.setActualDeliveryDate(addDTO.getOutBoundTime());
                            subjectMatter.setDeliveryStatus(2);
                            subjectMatter.setLastDeliveredQuantity(currentOut);
                            contractSubjectMatterMapper.updateById(subjectMatter);
@@ -109,7 +109,7 @@
                            BigDecimal currentOut = remainNum.add(subjectMatter.getRemainingQuantity());
                            subjectMatter.setDeliveredQuantity(subjectMatter.getQuantity().add(remainNum));
                            subjectMatter.setRemainingQuantity(subjectMatter.getRemainingQuantity().subtract(currentOut));
                            subjectMatter.setActualDeliveryDate(DateUtil.today());
                            subjectMatter.setActualDeliveryDate(addDTO.getOutBoundTime());
                            subjectMatter.setDeliveryStatus(1);
                            subjectMatter.setLastDeliveredQuantity(currentOut);
                            contractSubjectMatterMapper.updateById(subjectMatter);
@@ -125,7 +125,7 @@
                        if (remainNum.compareTo(new BigDecimal("0")) > 0) {
                            subjectMatter.setDeliveredQuantity(subjectMatter.getQuantity());
                            subjectMatter.setRemainingQuantity(new BigDecimal("0"));
                            subjectMatter.setActualDeliveryDate(DateUtil.today());
                            subjectMatter.setActualDeliveryDate(addDTO.getOutBoundTime());
                            subjectMatter.setDeliveryStatus(2);
                            subjectMatter.setLastDeliveredQuantity(subjectMatter.getQuantity());
                            contractSubjectMatterMapper.updateById(subjectMatter);
@@ -136,7 +136,7 @@
                            BigDecimal currentOut = remainNum.add(subjectMatter.getQuantity());
                            subjectMatter.setDeliveredQuantity(subjectMatter.getQuantity().add(remainNum));
                            subjectMatter.setRemainingQuantity(remainNum.multiply(new BigDecimal("-1")));
                            subjectMatter.setActualDeliveryDate(DateUtil.today());
                            subjectMatter.setActualDeliveryDate(addDTO.getOutBoundTime());
                            subjectMatter.setDeliveryStatus(1);
                            subjectMatter.setLastDeliveredQuantity(currentOut);
                            contractSubjectMatterMapper.updateById(subjectMatter);
@@ -257,9 +257,9 @@
                                    //更新当前阶段实际收款 和 收款状态
                                    schedule.setActualAmount(inConfirm.getTransationAmount());
                                    schedule.setPaymentStatus(2);
                                    if (inConfirm.getTotalAmount().compareTo(new BigDecimal("0")) > 0){
                                    if (inConfirm.getTotalAmount().compareTo(new BigDecimal("0")) > 0) {
                                        inConfirm.setAdvanceAmount(inConfirm.getTotalAmount());
                                    }else if (inConfirm.getTotalAmount().compareTo(new BigDecimal("0")) < 0) {
                                    } else if (inConfirm.getTotalAmount().compareTo(new BigDecimal("0")) < 0) {
                                        inConfirm.setReceivableAmount(inConfirm.getTotalAmount().multiply(new BigDecimal("-1")));
                                        schedule.setActualAmount(paymentConfirm.getTotalAmount().subtract(currentInSum));
                                        schedule.setPaymentStatus(1);
@@ -388,8 +388,8 @@
        contractOutBound.setInvoiceStatus("0");
        contractOutBound.setInvoiceNum(new BigDecimal("0"));
        contractOutBoundMapper.insert(contractOutBound);
        if (StrUtil.isEmpty(contract.getContractCategory())){
            if (DateUtil.compare(addDTO.getOutBoundTime(),contract.getExpirationDate())>0){
        if (StrUtil.isEmpty(contract.getContractCategory())) {
            if (DateUtil.compare(addDTO.getOutBoundTime(), contract.getExpirationDate()) > 0) {
                saveOverdueOutBound(contract, addDTO, subjectMatter);
            }
        }
@@ -406,7 +406,265 @@
        overdue.setMaterialCode(subjectMatter.getMaterialCode());
        overdue.setOverdueNum(subjectMatter.getLastDeliveredQuantity());
        overdue.setTotalAmount(subjectMatter.getUnitPrice().multiply(subjectMatter.getLastDeliveredQuantity()));
        overdue.setOverdueDuration(new BigDecimal(DateUtil.betweenDay(addDTO.getOutBoundTime(),contract.getExpirationDate(),true)));
        overdue.setOverdueDuration(new BigDecimal(DateUtil.betweenDay(addDTO.getOutBoundTime(), contract.getExpirationDate(), true)));
        deliveryOverdueMapper.insert(overdue);
    }
    @Override
    public R addContractOut(OutBoundAddDTO addDTO) {
        if (ArrayUtil.isEmpty(addDTO.getSubjectMatterList().toArray())) {
            return R.failed("出库标的物不能为空");
        }
        Contract contract = contractMapper.selectOne(Wrappers.<Contract>lambdaQuery().eq(Contract::getContractNo, addDTO.getContractNo()).eq(Contract::getContractStatus, 2)
                .last("limit 1"));
        if (ObjUtil.isNull(contract)) {
            return R.failed("合同信息查询失败");
        }
        //出库批次
        String batchNumber = DateUtil.format(new Date(), DatePattern.PURE_DATETIME_MS_PATTERN);
        addDTO.getSubjectMatterList().stream().forEach(outSubjectMatterAddDTO -> {
            ContractSubjectMatter subjectMatter = contractSubjectMatterMapper.selectById(outSubjectMatterAddDTO.getId());
            subjectMatter.setLastDeliveredQuantity(outSubjectMatterAddDTO.getOutBoundNum());
            if (subjectMatter.getDeliveryStatus() == 0) {
                subjectMatter.setDeliveredQuantity(outSubjectMatterAddDTO.getOutBoundNum());
                subjectMatter.setRemainingQuantity(subjectMatter.getQuantity().subtract(outSubjectMatterAddDTO.getOutBoundNum()));
            }
            if (subjectMatter.getDeliveryStatus() == 1) {
                subjectMatter.setDeliveredQuantity(subjectMatter.getDeliveredQuantity().add(outSubjectMatterAddDTO.getOutBoundNum()));
                subjectMatter.setRemainingQuantity(subjectMatter.getRemainingQuantity().subtract(outSubjectMatterAddDTO.getOutBoundNum()));
            }
            subjectMatter.setDeliveryStatus(1);
            if (subjectMatter.getRemainingQuantity().compareTo(new BigDecimal("0")) == 0) {
                subjectMatter.setDeliveryStatus(2);
            }
            subjectMatter.setActualDeliveryDate(addDTO.getOutBoundTime());
            contractSubjectMatterMapper.updateById(subjectMatter);
            //
            OutBound outBound = new OutBound();
            outBound.setBatchNumber(batchNumber);
            outBound.setOutBoundNum(outSubjectMatterAddDTO.getOutBoundNum());
            outBound.setOutBoundAttNames(addDTO.getOutBoundAttNames());
            outBound.setOutBoundAttPaths(addDTO.getOutBoundAttPaths());
            outBound.setBusGuestName(contract.getPartyA());
            outBound.setBusGuestId(contract.getPartyAId());
            outBound.setOutBoundTime(addDTO.getOutBoundTime());
            outBound.setSubjectMatterCode(outSubjectMatterAddDTO.getSubjectMatterCode());
            outBound.setSubjectMatterName(outSubjectMatterAddDTO.getSubjectMatterName());
            baseMapper.insert(outBound);
            //
            saveContractOutBound(contract, addDTO, subjectMatter, outBound.getId());
        });
        //当前出库合同出库标的物
        List<ContractSubjectMatter> contractSubjectMatterList = contractSubjectMatterMapper.selectList(Wrappers.<ContractSubjectMatter>lambdaQuery()
                .eq(ContractSubjectMatter::getContractId, contract.getId()).ne(ContractSubjectMatter::getDeliveryStatus, 0));
        //查询合同是否有出库阶段
        ContractPaymentSchedule schedule = scheduleMapper.selectOne(Wrappers.<ContractPaymentSchedule>lambdaQuery().eq(ContractPaymentSchedule::getContractId, contract.getId())
                .eq(ContractPaymentSchedule::getStageName, "发货前"));
        //存在出库阶段
        if (ObjUtil.isNotNull(schedule)) {
            //当前出库金额
            BigDecimal outPirce = contractSubjectMatterList.stream()
                    .map(item -> (item.getDeliveryStatus() == 1 ? item.getDeliveredQuantity().multiply(item.getUnitPrice()) : item.getQuantity().multiply(item.getUnitPrice())))
                    .reduce(BigDecimal.ZERO, BigDecimal::add);
            //出库是否完成
            if (outPirce.compareTo(contract.getAmount()) < 0) {
                contract.setBillingStatus("1");
                contractMapper.updateById(contract);
            }
            if (outPirce.compareTo(contract.getAmount()) == 0) {
                contract.setBillingStatus("2");
                contractMapper.updateById(contract);
            }
            //计算发货前应收更新资金明细
            PaymentConfirm paymentConfirm = new PaymentConfirm();
            paymentConfirm.setBusinessType("发货前应收");
            paymentConfirm.setBusGuestId(contract.getPartyAId());
            paymentConfirm.setBusGuestName(contract.getPartyA());
            paymentConfirm.setContractId(contract.getId());
            paymentConfirm.setContractName(contract.getContractName());
            paymentConfirm.setContractNo(contract.getContractNo());
            paymentConfirm.setScheduleId(schedule.getId());
            paymentConfirm.setScheduleName(schedule.getStageName());
            paymentConfirm.setConfirmTime(addDTO.getOutBoundTime());
            //按出库资金比例 计算发货前应收
            paymentConfirm.setTransationAmount(outPirce.divide(contract.getAmount(), 10, RoundingMode.HALF_UP).multiply(schedule.getPlannedAmount()));
            paymentConfirm.setReceivableAmount(paymentConfirm.getTransationAmount());
            //最近应收
            PaymentConfirm lastConfirm = paymentConfirmMapper.selectOne(Wrappers.<PaymentConfirm>lambdaQuery().eq(PaymentConfirm::getContractId, contract.getId())
                    .orderByDesc(PaymentConfirm::getCreateTime).last("limit 1"));
            if (ObjUtil.isNotNull(lastConfirm)) {
                //已存在发货应收
                if (StrUtil.equals(lastConfirm.getBusinessType(), paymentConfirm.getBusinessType())) {
                    //查询之前所有发货前应收
                    List<PaymentConfirm> fhConfirmList = paymentConfirmMapper.selectList(Wrappers.<PaymentConfirm>lambdaQuery().eq(PaymentConfirm::getContractId, contract.getId())
                            .eq(PaymentConfirm::getScheduleId, schedule.getId()).orderByDesc(PaymentConfirm::getCreateTime));
                    BigDecimal fhTotalAmount = fhConfirmList.stream().map(item -> item.getTransationAmount()).reduce(BigDecimal.ZERO, BigDecimal::add);
                    //本次发货前应收 出库总额 - 所有发货前应收
                    paymentConfirm.setTransationAmount(paymentConfirm.getTransationAmount().subtract(fhTotalAmount));
                    paymentConfirm.setReceivableAmount(paymentConfirm.getTransationAmount());
                    paymentConfirm.setTotalAmount(lastConfirm.getTotalAmount().subtract(paymentConfirm.getTransationAmount()));
                    if (schedule.getPaymentRatio().compareTo(new BigDecimal("0")) > 0) {
                        paymentConfirmMapper.insert(paymentConfirm);
                    }
                } else {
                    //不存在发货应收 出库总额
                    paymentConfirm.setTotalAmount(lastConfirm.getTotalAmount().subtract(paymentConfirm.getTransationAmount()));
                    if (schedule.getPaymentRatio().compareTo(new BigDecimal("0")) > 0) {
                        paymentConfirmMapper.insert(paymentConfirm);
                    }
                }
            } else {
                //无之前阶段应收
                paymentConfirm.setTotalAmount(paymentConfirm.getTransationAmount().multiply(new BigDecimal("-1")));
                if (schedule.getPaymentRatio().compareTo(new BigDecimal("0")) > 0) {
                    paymentConfirmMapper.insert(paymentConfirm);
                    //客户付款完成合同
                    List<Contract> customerCompleteContractList = contractMapper.selectList(Wrappers.<Contract>lambdaQuery().eq(Contract::getPartyAId, contract.getPartyAId())
                            .eq(Contract::getPartyBId, SecurityUtils.getUser().getCompId()).apply(" amount = paid_amount"));
                    if (ArrayUtil.isNotEmpty(customerCompleteContractList)) {
                        List<BigDecimal> outAmountList = new ArrayList<>();
                        for (Contract completeContract : customerCompleteContractList
                        ) {
                            PaymentConfirm contractLastConfirm = paymentConfirmMapper.selectOne(Wrappers.<PaymentConfirm>lambdaQuery().eq(PaymentConfirm::getContractId, completeContract.getId())
                                    .orderByDesc(PaymentConfirm::getCreateTime).last("limit 1"));
                            //查询客户付款完成合同中最后明细金额 有预收转入当前合同
                            if (contractLastConfirm.getTotalAmount().compareTo(new BigDecimal("0")) > 0) {
                                //新增完成付款合同 资金转出
                                PaymentConfirm outConfirm = BeanUtil.copyProperties(contractLastConfirm, PaymentConfirm.class, "id", "transationAmount",
                                        "advanceAmount", "receivableAmount", "overdueAmount", "totalAmount");
                                outConfirm.setBusinessType("资金转出");
                                outConfirm.setConfirmTime(new Date());
                                outConfirm.setTransationAmount(contractLastConfirm.getTotalAmount());
                                outConfirm.setTotalAmount(new BigDecimal("0"));
                                paymentConfirmMapper.insert(outConfirm);
                                outAmountList.add(outConfirm.getTransationAmount());
                            }
                        }
                        if (ArrayUtil.isNotEmpty(outAmountList.toArray())) {
                            BigDecimal currentInSum = outAmountList.stream().reduce(BigDecimal.ZERO, BigDecimal::add);
                            //新增当前合同 资金转入
                            PaymentConfirm inConfirm = BeanUtil.copyProperties(paymentConfirm, PaymentConfirm.class, "id", "transationAmount",
                                    "advanceAmount", "receivableAmount", "overdueAmount", "totalAmount");
                            inConfirm.setBusinessType("资金转入");
                            inConfirm.setConfirmTime(new Date());
                            inConfirm.setTransationAmount(currentInSum);
                            inConfirm.setTotalAmount(paymentConfirm.getTotalAmount().add(currentInSum));
                            //更新当前阶段实际收款 和 收款状态
                            schedule.setActualAmount(inConfirm.getTransationAmount());
                            schedule.setPaymentStatus(2);
                            if (inConfirm.getTotalAmount().compareTo(new BigDecimal("0")) > 0) {
                                inConfirm.setAdvanceAmount(inConfirm.getTotalAmount());
                            } else if (inConfirm.getTotalAmount().compareTo(new BigDecimal("0")) < 0) {
                                inConfirm.setReceivableAmount(inConfirm.getTotalAmount().multiply(new BigDecimal("-1")));
                                schedule.setActualAmount(paymentConfirm.getTotalAmount().subtract(currentInSum));
                                schedule.setPaymentStatus(1);
                            }
                            paymentConfirmMapper.insert(inConfirm);
                            //更新当前阶段实际收款 和 收款状态
                            scheduleMapper.updateById(schedule);
                        }
                    }
                }
            }
            //更新发货前收款生效时间
            if (ObjUtil.isNull(schedule.getEffectiveDate())) {
                schedule.setEffectiveEndDate(DateUtil.offsetDay(addDTO.getOutBoundTime(), schedule.getAgreedDays()));
                //查询是否有后续阶段
//                        List<ContractPaymentSchedule> afterSchedule = scheduleMapper.selectList(Wrappers.<ContractPaymentSchedule>lambdaQuery().eq(ContractPaymentSchedule::getContractId, contractId)
//                                .gt(ContractPaymentSchedule::getStageOrder, schedule.getStageOrder()));
//                        if (ArrayUtil.isEmpty(afterSchedule.toArray())) {
//                            schedule.setEffectiveEndDate(contract.getExpirationDate());
//                        }
                scheduleMapper.updateById(schedule);
                //查询是否有之前阶段
//                        ContractPaymentSchedule beforeSchedule = scheduleMapper.selectOne(Wrappers.<ContractPaymentSchedule>lambdaQuery().eq(ContractPaymentSchedule::getContractId, schedule.getContractId())
//                                .lt(ContractPaymentSchedule::getStageOrder, schedule.getStageOrder()).orderByDesc(ContractPaymentSchedule::getCreateTime).last("limit 1"));
//                        if (ObjUtil.isNotNull(beforeSchedule)) {
//                            beforeSchedule.setEffectiveEndDate(schedule.getEffectiveDate());
//                            scheduleMapper.updateById(beforeSchedule);
//                        }
                //更新履约
                ContractPaymentScheduleProcess contractPaymentScheduleProcess = new ContractPaymentScheduleProcess();
                contractPaymentScheduleProcess.setContractId(schedule.getContractId());
                contractPaymentScheduleProcess.setContractName(schedule.getContractName());
                contractPaymentScheduleProcess.setScheduleId(schedule.getId());
                contractPaymentScheduleProcess.setScheduleName(schedule.getStageName());
                contractPaymentScheduleProcess.setProcessDate(addDTO.getOutBoundTime());
                ContractPaymentScheduleProcess lastProcess = scheduleProcessMapper.selectOne(Wrappers.<ContractPaymentScheduleProcess>lambdaQuery().eq(ContractPaymentScheduleProcess::getContractId, schedule.getContractId())
                        .eq(ContractPaymentScheduleProcess::getScheduleId, schedule.getId()).last("limit 1"));
                if (ObjUtil.isNull(lastProcess)) {
                    scheduleProcessMapper.insert(contractPaymentScheduleProcess);
                }
            }
            //查询是否有后续阶段
            List<ContractPaymentSchedule> afterSchedule = scheduleMapper.selectList(Wrappers.<ContractPaymentSchedule>lambdaQuery()
                    .eq(ContractPaymentSchedule::getContractId, schedule.getContractId())
                    .gt(ContractPaymentSchedule::getStageOrder, schedule.getStageOrder())
                    .orderByAsc(ContractPaymentSchedule::getCreateTime));
            if (ArrayUtil.isNotEmpty(afterSchedule.toArray()) && afterSchedule.size() == 1) {
                //最后阶段生效时间
                ContractPaymentSchedule endSchedule = afterSchedule.get(0);
                if (StrUtil.equals(endSchedule.getStageName(), "质保金")) {
//                            endSchedule.setEffectiveEndDate(DateUtil.offsetDay(addDTO.getOutBoundTime(), endSchedule.getAgreedDays()));
//                            scheduleMapper.updateById(endSchedule);
                    //当前阶段生效时间
//                            schedule.setEffectiveEndDate(DateUtil.offsetDay(addDTO.getOutBoundTime(), schedule.getAgreedDays()));
//                            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()));
                    if (endSchedule.getPaymentRatio().compareTo(new BigDecimal("0")) > 0) {
                        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);
                //当前为合同最后阶段
                PaymentConfirm lastNewConfirm = paymentConfirmMapper.selectOne(Wrappers.<PaymentConfirm>lambdaQuery().eq(PaymentConfirm::getContractId, contract.getId())
                        .orderByDesc(PaymentConfirm::getCreateTime).last("limit 1"));
                if (lastNewConfirm.getTotalAmount().compareTo(new BigDecimal("0")) >= 0) {
                    //有预付且超过应收 关闭合同状态
                    contract.setContractStatus(3);
                    contractMapper.updateById(contract);
                }
            }
        }
        return R.ok();
    }
}
platformx-business-finance-biz/src/main/resources/mapper/ContractDelayOutMapper.xml
@@ -20,4 +20,41 @@
        <result property="updateTime" column="update_time"/>
        <result property="delFlag" column="del_flag"/>
    </resultMap>
    <select id="pageNew" resultType="com.by4cloud.platformx.business.vo.ContractDelayOutPageVo">
        SELECT
        t.id,
        t.contract_id,
        t1.contract_name,
        t.delay_day,
        t.delay_att_names,
        t.delay_att_paths,
        t.apply_name,
        t.apply_time,
        t.delay_status,
        t.create_by,
        t.update_by,
        t.create_time,
        t.update_time,
        t.del_flag,
        t.comp_id,
        t1.party_a,
        t1.party_b
        FROM
        contract_delay_out t
        LEFT JOIN contract t1 ON ( t1.id = t.contract_id AND t1.del_flag = '0' )
        LEFT JOIN business_customer t2 ON ( t2.id = t1.party_a_id AND t2.del_flag = '0' )
        WHERE
        t.del_flag = '0'
        <if test="queryDTO.partyA !=null and queryDTO.partyA !=''">
            and t1.party_a LIKE CONCAT('%', #{queryDTO.partyA}, '%')
        </if>
        <if test="queryDTO.partyB !=null and queryDTO.partyB !=''">
            and t1.party_b LIKE CONCAT('%', #{queryDTO.partyB}, '%')
        </if>
        <if test="queryDTO.contractName !=null and queryDTO.contractName !=''">
            and t1.contract_name LIKE CONCAT('%', #{queryDTO.contractName}, '%')
        </if>
        ORDER BY
        t.create_time DESC
    </select>
</mapper>