d8f4fcc10b735c808f748e4eeae8b2bb6d7f2e9d..55dffef68aa4c67ab0ca4c2832ac34b9a7671755
2025-08-13 wujianwei
新增定时任务
55dffe 对比 | 目录
2025-08-12 wujianwei
新增定时任务
969878 对比 | 目录
2025-08-12 wujianwei
新增定时任务
93ab73 对比 | 目录
11个文件已修改
3个文件已添加
690 ■■■■■ 已修改文件
quartz/pom.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
quartz/src/main/java/com/ruoyi/quartz/task/SettlementTask.java 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/controller/PendingSettlementBusinessController.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/domain/EstimatedReceivable.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/domain/EstimatedReceivableBill.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/domain/PendingSettlementBusiness.java 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/domain/ReceivableLineTruckPriceRule.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/domain/vo/CreateBillVo.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/mapper/EstimatedReceivableMapper.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/mapper/PendingSettlementBusinessMapper.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/service/IPendingSettlementBusinessService.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/service/impl/PendingSettlementBusinessServiceImpl.java 198 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/resources/mapper/cwgl/EstimatedReceivableMapper.xml 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/resources/mapper/cwgl/PendingSettlementBusinessMapper.xml 173 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
quartz/pom.xml
@@ -35,6 +35,10 @@
            <artifactId>common</artifactId>
        </dependency>
        <dependency>
            <groupId>com.ruoyi</groupId>
            <artifactId>service</artifactId>
        </dependency>
    </dependencies>
</project>
quartz/src/main/java/com/ruoyi/quartz/task/SettlementTask.java
New file
@@ -0,0 +1,98 @@
package com.ruoyi.quartz.task;
import cn.hutool.core.collection.CollectionUtil;
import com.ruoyi.common.utils.RandomUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.cwgl.domain.EstimatedReceivable;
import com.ruoyi.cwgl.domain.PendingSettlementBusiness;
import com.ruoyi.cwgl.domain.ReceivableLineTruckPriceRule;
import com.ruoyi.cwgl.service.IEstimatedReceivableService;
import com.ruoyi.cwgl.service.IPendingSettlementBusinessService;
import com.ruoyi.cwgl.service.impl.ExactPricingRuleMatcher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
 * 定时任务调度测试
 *
 * @author ruoyi
 */
@Component("settlementTask")
public class SettlementTask
{
    @Autowired
    private IPendingSettlementBusinessService pendingSettlementBusinessService;
    @Autowired
    private IEstimatedReceivableService estimatedReceivableService;
    public void insertPendingSettlement()
    {
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyMMdd");
        Date date = new Date();
        String datePart = dateFormat.format(date);
        List<PendingSettlementBusiness> pendingSettlementBusinesses = pendingSettlementBusinessService.selectPendingSettlement2Cw();
        //应收规则
        List<ReceivableLineTruckPriceRule> receivableLineTruckPriceRules = pendingSettlementBusinessService.selectReceivableLineTruckPriceRule();
        //应付规则
        List<ReceivableLineTruckPriceRule> payableLineTruckPriceRules= pendingSettlementBusinessService.selectPayableLineTruckPriceRule();
        List<EstimatedReceivable> estimatedReceivables = new ArrayList<>();
        for (PendingSettlementBusiness pendingSettlementBusiness : pendingSettlementBusinesses) {
            ReceivableLineTruckPriceRule exactMatchingRule = ExactPricingRuleMatcher.findExactMatchingRule(receivableLineTruckPriceRules, pendingSettlementBusiness.getCustomerName(), pendingSettlementBusiness.getDepartureLocation(), pendingSettlementBusiness.getArrivalLocation(), pendingSettlementBusiness.getVehicleType());
            if (exactMatchingRule!=null) {
                //应收数据
                pendingSettlementBusiness.setEstimatedTotalIncome(exactMatchingRule.getFreight());
                pendingSettlementBusiness.setCreateTime(date);
                EstimatedReceivable estimatedReceivable = new EstimatedReceivable();
                estimatedReceivable.setFeeSystemNo("YS"+datePart+RandomUtils.random(5));
                estimatedReceivable.setDispatchNo(pendingSettlementBusiness.getDispatchNo());
                estimatedReceivable.setCustomerName(pendingSettlementBusiness.getCustomerName());
                estimatedReceivable.setProjectName(pendingSettlementBusiness.getProjectName());
                estimatedReceivable.setOrderDate(pendingSettlementBusiness.getCreatedTime());
                estimatedReceivable.setFeeName("运费");
                estimatedReceivable.setEstimatedAmount(exactMatchingRule.getFreight());
                estimatedReceivable.setCurrency("人民币");
                estimatedReceivable.setIsConfirmed(1);
                estimatedReceivable.setFeeType(0);
                estimatedReceivables.add(estimatedReceivable);
            }
            ReceivableLineTruckPriceRule exactMatchingRule2 = ExactPricingRuleMatcher.findExactMatchingRule(payableLineTruckPriceRules, pendingSettlementBusiness.getCarrierName(), pendingSettlementBusiness.getDepartureLocation(), pendingSettlementBusiness.getArrivalLocation(), pendingSettlementBusiness.getVehicleType());
            if (exactMatchingRule2!=null) {
                pendingSettlementBusiness.setEstimatedTotalCost(exactMatchingRule2.getFreight());
                pendingSettlementBusiness.setCreateTime(date);
                EstimatedReceivable estimatedReceivable = new EstimatedReceivable();
                estimatedReceivable.setFeeSystemNo("YF"+datePart+RandomUtils.random(5));
                estimatedReceivable.setDispatchNo(pendingSettlementBusiness.getDispatchNo());
                estimatedReceivable.setCustomerName(pendingSettlementBusiness.getCustomerName());
                estimatedReceivable.setProjectName(pendingSettlementBusiness.getProjectName());
                estimatedReceivable.setOrderDate(pendingSettlementBusiness.getCreatedTime());
                estimatedReceivable.setFeeName("运费");
                estimatedReceivable.setEstimatedAmount(exactMatchingRule2.getFreight());
                estimatedReceivable.setCurrency("人民币");
                estimatedReceivable.setIsConfirmed(1);
                estimatedReceivable.setFeeType(0);
                estimatedReceivables.add(estimatedReceivable);
            }
        }
        if (CollectionUtil.isNotEmpty(estimatedReceivables)){
            estimatedReceivableService.insertEstimatedReceivableBatch(estimatedReceivables);
        }
        pendingSettlementBusinessService.insertPendingSettlement(pendingSettlementBusinesses);
    }
}
service/src/main/java/com/ruoyi/cwgl/controller/PendingSettlementBusinessController.java
@@ -1,6 +1,8 @@
package com.ruoyi.cwgl.controller;
import java.util.List;
import com.ruoyi.cwgl.domain.vo.CreateBillVo;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@@ -105,4 +107,37 @@
    {
        return toAjax(pendingSettlementBusinessService.deletePendingSettlementBusinessByIds(ids));
    }
    /**
     * 查询入账业务
     */
    @GetMapping("bill/{ids}")
    public AjaxResult billIds(@PathVariable Integer[] ids)
    {
        return AjaxResult.success(pendingSettlementBusinessService.billIds(ids));
    }
    /**
     * 查询入账业务
     */
    @GetMapping("bill/list")
    public AjaxResult billList(PendingSettlementBusiness pendingSettlementBusiness)
    {
        return AjaxResult.success(pendingSettlementBusinessService.billList(pendingSettlementBusiness));
    }
    @GetMapping("create/bill/{ids}")
    public AjaxResult createBillIds(@PathVariable Integer[] ids, @RequestBody CreateBillVo createBillVo)
    {
        return toAjax(pendingSettlementBusinessService.createBillIds(ids,createBillVo));
    }
    @GetMapping("create/bill/list")
    public AjaxResult createBillList(PendingSettlementBusiness pendingSettlementBusiness)
    {
        return toAjax(pendingSettlementBusinessService.createBillList(pendingSettlementBusiness));
    }
    @GetMapping("select/customName")
    public AjaxResult selectCustomName()
    {
        return AjaxResult.success(pendingSettlementBusinessService.selectCustomName());
    }
}
service/src/main/java/com/ruoyi/cwgl/domain/EstimatedReceivable.java
@@ -64,12 +64,18 @@
        @TableField("fee_name")
    private String feeName;
    /** 费用类型 */
//    @Excel(name = "费用类型")
        @TableField("fee_type")
    private Integer feeType;
    /** 预估费用金额 */
    @Excel(name = "预估费用金额")
        @TableField("estimated_amount")
    private BigDecimal estimatedAmount;
    private Long estimatedAmount;
    /** 币制 */
service/src/main/java/com/ruoyi/cwgl/domain/EstimatedReceivableBill.java
@@ -54,14 +54,14 @@
    @Excel(name = "应结算金额")
        @TableField("total_amount")
    private BigDecimal totalAmount;
    private Long totalAmount;
    /** 已结算金额 */
    @Excel(name = "已结算金额")
        @TableField("settled_amount")
    private BigDecimal settledAmount;
    private Long settledAmount;
    /** 开票状态 */
service/src/main/java/com/ruoyi/cwgl/domain/PendingSettlementBusiness.java
@@ -167,21 +167,21 @@
    @Excel(name = "预估总收入")
        @TableField("estimated_total_income")
    private BigDecimal estimatedTotalIncome;
    private Long estimatedTotalIncome;
    /** 预估总成本 */
    @Excel(name = "预估总成本")
        @TableField("estimated_total_cost")
    private BigDecimal estimatedTotalCost;
    private Long estimatedTotalCost;
    /** 预估利润 */
    @Excel(name = "预估利润")
        @TableField("estimated_profit")
    private BigDecimal estimatedProfit;
    private Long estimatedProfit;
    /** 电子锁 */
@@ -364,6 +364,22 @@
        /**业务id修改用*/
        @TableField(exist = false)
     private Integer serviceId;
    /**
     * 是否生成过入账0否1是
     */
    @TableField("is_create")
    private Integer isCreate;
    /**
     * 关联账单id
     */
    @TableField("bill_id")
    private Integer billId;
    /**
     * 关联账单id
     */
    @TableField("bill_name")
    private String billName;
    public String getActualDepartureTimeBegin() {
        return actualDepartureTimeBegin;
service/src/main/java/com/ruoyi/cwgl/domain/ReceivableLineTruckPriceRule.java
New file
@@ -0,0 +1,42 @@
package com.ruoyi.cwgl.domain;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
 * 应收线路整车价格规则实体类
 */
@Data
public class ReceivableLineTruckPriceRule {
    private Long id; // 规则ID
    private String feeType; // 费用类型
    private String customerName; // 客户名称
    private String departureCity; // 发货市名称
    private String departureDistrict; // 发货区名称
    private String arrivalCity; // 收货市名称
    private String arrivalDistrict; // 收货区名称
    private String vehicleType; // 车型名称
    private Long freight; // 运费
    private Date createdTime; // 创建时间
    @Override
    public String toString() {
        return "ReceivableLineTruckPriceRule{" +
                "id=" + id +
                ", feeType='" + feeType + '\'' +
                ", customerName='" + customerName + '\'' +
                ", departureCity='" + departureCity + '\'' +
                ", departureDistrict='" + departureDistrict + '\'' +
                ", arrivalCity='" + arrivalCity + '\'' +
                ", arrivalDistrict='" + arrivalDistrict + '\'' +
                ", vehicleType='" + vehicleType + '\'' +
                ", freight=" + freight +
                ", createdTime=" + createdTime +
                '}';
    }
}
service/src/main/java/com/ruoyi/cwgl/domain/vo/CreateBillVo.java
New file
@@ -0,0 +1,32 @@
package com.ruoyi.cwgl.domain.vo;
import lombok.Data;
/**
 * 创建账单vo
 */
@Data
public class CreateBillVo {
    /**
     * 账单名称
     */
    private String billName;
    /**
     * 客户名称
     */
    private String customerName;
    /**
     * 账单数量
     */
    private Integer count;
    /**
     * 结算金额
     */
    private Long price;
}
service/src/main/java/com/ruoyi/cwgl/mapper/EstimatedReceivableMapper.java
@@ -3,6 +3,7 @@
import java.util.List;
import com.ruoyi.cwgl.domain.EstimatedReceivable;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
/**
service/src/main/java/com/ruoyi/cwgl/mapper/PendingSettlementBusinessMapper.java
@@ -3,6 +3,8 @@
import java.util.List;
import com.ruoyi.cwgl.domain.PendingSettlementBusiness;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.cwgl.domain.ReceivableLineTruckPriceRule;
import org.apache.ibatis.annotations.Param;
/**
@@ -84,4 +86,19 @@
     * @return 结果
     */
    public int deletePendingSettlementBusinessByIds(Integer[] ids);
    /**
     * 查询财务库入账数据库数据
     * @return
     */
    List<PendingSettlementBusiness> selectPendingSettlement2Cw();
    int updeteCwData(Integer[] ids);
    List<ReceivableLineTruckPriceRule> selectReceivableLineTruckPriceRule();
    List<ReceivableLineTruckPriceRule> selectPayableLineTruckPriceRule();
    int updatePendingSettlementBusinessIsCreate(@Param("list") List<String> list,@Param("id")Integer id,@Param("billName")String billName);
    List<String> selectCustomName();
}
service/src/main/java/com/ruoyi/cwgl/service/IPendingSettlementBusinessService.java
@@ -3,6 +3,9 @@
import java.util.List;
import com.ruoyi.cwgl.domain.PendingSettlementBusiness;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.cwgl.domain.ReceivableLineTruckPriceRule;
import com.ruoyi.cwgl.domain.vo.CreateBillVo;
/**
 * 待入账业务Service接口
 * 
@@ -99,4 +102,43 @@
     * @return 结果
     */
    public int deletePendingSettlementBusinessById(Integer id);
    /**
     * 新增待入账数据
     */
    void insertPendingSettlement(List<PendingSettlementBusiness> pendingSettlementBusinesses );
    /**
     * 查询财务库入账数据
     * @return
     */
    List<PendingSettlementBusiness> selectPendingSettlement2Cw();
    /**
     * 修改财务数据库数据为已同步
     * @param ids
     * @return
     */
    int updateCwData(Integer [] ids);
    /**
     * 应收线路整车价格
     * @return
     */
    List<ReceivableLineTruckPriceRule> selectReceivableLineTruckPriceRule();
    /**
     * 应付线路整车价格
     * @return
     */
    List<ReceivableLineTruckPriceRule> selectPayableLineTruckPriceRule();
    CreateBillVo billIds(Integer[] ids);
    int createBillIds(Integer[] ids, CreateBillVo createBillVo);
    CreateBillVo billList(PendingSettlementBusiness pendingSettlementBusiness);
    int createBillList(PendingSettlementBusiness pendingSettlementBusiness);
    List<String> selectCustomName();
}
service/src/main/java/com/ruoyi/cwgl/service/impl/PendingSettlementBusinessServiceImpl.java
@@ -1,15 +1,29 @@
package com.ruoyi.cwgl.service.impl;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import com.ruoyi.common.utils.DateUtils;
import cn.hutool.core.collection.CollectionUtil;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.*;
import javax.annotation.Resource;
import com.ruoyi.cwgl.domain.EstimatedReceivableBill;
import com.ruoyi.cwgl.domain.ReceivableLineTruckPriceRule;
import com.ruoyi.cwgl.domain.vo.CreateBillVo;
import com.ruoyi.cwgl.mapper.EstimatedReceivableBillMapper;
import com.ruoyi.cwgl.mapper.EstimatedReceivableMapper;
import com.ruoyi.cwgl.service.IEstimatedReceivableBillService;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.stereotype.Service;
import org.springframework.scheduling.annotation.Async;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.ruoyi.common.utils.PageUtils;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
@@ -33,7 +47,10 @@
    protected final Logger logger = LoggerFactory.getLogger(getClass());
    @Resource
    private PendingSettlementBusinessMapper pendingSettlementBusinessMapper;
    @Resource
    private EstimatedReceivableBillMapper estimatedReceivableBillMapper;
    @Resource
    private EstimatedReceivableMapper estimatedReceivableMapper;
    /**
     * 查询待入账业务
@@ -179,4 +196,179 @@
    {
        return pendingSettlementBusinessMapper.deletePendingSettlementBusinessById(id);
    }
    @Override
    public void insertPendingSettlement(List<PendingSettlementBusiness> pendingSettlementBusinesses ) {
        if (CollectionUtil.isNotEmpty(pendingSettlementBusinesses)) {
            pendingSettlementBusinessMapper.insertPendingSettlementBusinessBatch(pendingSettlementBusinesses);
        }
    }
    @DataSource(DataSourceType.CWSJ)
    @Override
    public List<PendingSettlementBusiness> selectPendingSettlement2Cw() {
        List<PendingSettlementBusiness> pendingSettlementBusinesses = pendingSettlementBusinessMapper.selectPendingSettlement2Cw();
        //更新同步状态用
       /*     Integer[] ids = pendingSettlementBusinesses.stream().map(PendingSettlementBusiness::getServiceId).toArray(Integer[]::new);
            int i = pendingSettlementBusinessMapper.updeteCwData(ids);
            if (i>0){
                logger.info("同步状态更新成功");
            }*/
        return pendingSettlementBusinesses;
    }
    @DataSource(DataSourceType.CWSJ)
    @Override
    public int updateCwData(Integer[] ids) {
        return pendingSettlementBusinessMapper.updeteCwData(ids);
    }
    @DataSource(DataSourceType.CWSJ)
    @Override
    public List<ReceivableLineTruckPriceRule> selectReceivableLineTruckPriceRule() {
        return pendingSettlementBusinessMapper.selectReceivableLineTruckPriceRule();
    }
    @DataSource(DataSourceType.CWSJ)
    @Override
    public List<ReceivableLineTruckPriceRule> selectPayableLineTruckPriceRule() {
        return pendingSettlementBusinessMapper.selectPayableLineTruckPriceRule();
    }
    @Override
    public CreateBillVo billIds(Integer[] ids) {
        List<PendingSettlementBusiness> pendingSettlementBusinesses = pendingSettlementBusinessMapper.selectBatchIds(Arrays.asList(ids));
        if (CollectionUtil.isEmpty(pendingSettlementBusinesses)){
            throw new ServiceException("账单不存在");
        }
        CreateBillVo createBillVo = new CreateBillVo();
        String customerName = pendingSettlementBusinesses.get(0).getCustomerName();
        createBillVo.setCustomerName(customerName);
        createBillVo.setCount(pendingSettlementBusinesses.size());
        long priceTotal = 0L;
        for (PendingSettlementBusiness pendingSettlementBusiness : pendingSettlementBusinesses) {
            if (pendingSettlementBusiness.getIsCreate().equals(1)){
                throw new ServiceException(pendingSettlementBusiness.getDispatchNo()+"已入账");
            }
                if (!pendingSettlementBusiness.getCustomerName().equals(customerName)){
                    throw new ServiceException("只能选择相同客户名称的数据");
                }
                priceTotal += pendingSettlementBusiness.getEstimatedTotalIncome()==null?0L:pendingSettlementBusiness.getEstimatedTotalIncome();
        }
        createBillVo.setPrice(priceTotal);
        return createBillVo;
    }
    @Override
    public CreateBillVo billList(PendingSettlementBusiness pendingSettlementBusiness) {
        String customerName = pendingSettlementBusiness.getCustomerName();
        if (StringUtils.isEmpty(customerName)){
            throw new ServiceException("客户名称不能为空");
        }
        pendingSettlementBusiness.setIsCreate(0);
        List<PendingSettlementBusiness> pendingSettlementBusinesses = pendingSettlementBusinessMapper.selectPendingSettlementBusinessList(pendingSettlementBusiness);
        long priceTotal = pendingSettlementBusinesses.stream()
                .mapToLong(b -> Optional.ofNullable(b.getEstimatedTotalIncome()).orElse(0L))
                .sum();
        CreateBillVo createBillVo = new CreateBillVo();
        createBillVo.setCustomerName(customerName);
        createBillVo.setCount(pendingSettlementBusinesses.size());
        createBillVo.setPrice(priceTotal);
        return createBillVo;
    }
    @Override
    public int createBillIds(Integer[] ids, CreateBillVo createBillVo) {
        String username = SecurityUtils.getUsername();
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyMMdd");
        Date date = new Date();
        String datePart = dateFormat.format(date);
        List<PendingSettlementBusiness> pendingSettlementBusinesses = pendingSettlementBusinessMapper.selectBatchIds(Arrays.asList(ids));
        if (CollectionUtil.isEmpty(pendingSettlementBusinesses)){
            throw new ServiceException("账单不存在");
        }
        for (PendingSettlementBusiness pendingSettlementBusiness : pendingSettlementBusinesses) {
            if (pendingSettlementBusiness.getIsCreate().equals(1)){
                throw new ServiceException(pendingSettlementBusiness.getDispatchNo()+"已入账");
            }
            String customerName = pendingSettlementBusinesses.get(0).getCustomerName();
            if (!pendingSettlementBusiness.getCustomerName().equals(customerName)){
                throw new ServiceException("只能选择相同客户名称的数据");
            }
        }
        //调度单集合
        List<String> collect = pendingSettlementBusinesses.stream().map(PendingSettlementBusiness::getDispatchNo).collect(Collectors.toList());
        EstimatedReceivableBill estimatedReceivableBill = new EstimatedReceivableBill();
        estimatedReceivableBill.setCreateTime(date);
        estimatedReceivableBill.setBillSystemNo("ZD"+datePart+RandomUtils.random(4));
        estimatedReceivableBill.setBillName(createBillVo.getBillName());
        estimatedReceivableBill.setCustomerName(createBillVo.getCustomerName());
        estimatedReceivableBill.setDispatchCount(createBillVo.getCount());
        estimatedReceivableBill.setTotalAmount(createBillVo.getPrice());
        estimatedReceivableBill.setSettledAmount(0L);
        estimatedReceivableBill.setInvoiceStatus(0);
        estimatedReceivableBill.setStatus(0);
        estimatedReceivableBill.setCreateBy(username);
        estimatedReceivableBillMapper.insertEstimatedReceivableBill(estimatedReceivableBill);
        //修改调度单为已创建账单
        return  pendingSettlementBusinessMapper.updatePendingSettlementBusinessIsCreate(collect,estimatedReceivableBill.getId(),createBillVo.getBillName());
    }
    @Override
    public int createBillList(PendingSettlementBusiness pendingSettlementBusiness) {
        String customerName = pendingSettlementBusiness.getCustomerName();
        if (StringUtils.isEmpty(customerName)){
            throw new ServiceException("客户名称不能为空");
        }
        String billName = pendingSettlementBusiness.getBillName();
        if (StringUtils.isEmpty(billName)){
            throw new ServiceException("账单名称不能为空");
        }
        pendingSettlementBusiness.setIsCreate(0);
        List<PendingSettlementBusiness> pendingSettlementBusinesses = pendingSettlementBusinessMapper.selectPendingSettlementBusinessList(pendingSettlementBusiness);
        if (CollectionUtil.isEmpty(pendingSettlementBusinesses)){
            throw new ServiceException("填写的客户没有能入账数据");
        }
        String username = SecurityUtils.getUsername();
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyMMdd");
        Date date = new Date();
        String datePart = dateFormat.format(date);
        long priceTotal = pendingSettlementBusinesses.stream()
                .mapToLong(b -> Optional.ofNullable(b.getEstimatedTotalIncome()).orElse(0L))
                .sum();
        //调度单集合
        List<String> collect = pendingSettlementBusinesses.stream().map(PendingSettlementBusiness::getDispatchNo).collect(Collectors.toList());
        EstimatedReceivableBill estimatedReceivableBill = new EstimatedReceivableBill();
        estimatedReceivableBill.setCreateTime(date);
        estimatedReceivableBill.setBillSystemNo("ZD"+datePart+RandomUtils.random(4));
        estimatedReceivableBill.setBillName(billName);
        estimatedReceivableBill.setCustomerName(customerName);
        estimatedReceivableBill.setDispatchCount(pendingSettlementBusinesses.size());
        estimatedReceivableBill.setTotalAmount(priceTotal);
        estimatedReceivableBill.setSettledAmount(0L);
        estimatedReceivableBill.setInvoiceStatus(0);
        estimatedReceivableBill.setStatus(0);
        estimatedReceivableBill.setCreateBy(username);
        estimatedReceivableBillMapper.insertEstimatedReceivableBill(estimatedReceivableBill);
        //修改调度单为已创建账单
        return  pendingSettlementBusinessMapper.updatePendingSettlementBusinessIsCreate(collect,estimatedReceivableBill.getId(),billName);
    }
    @Override
    public List<String> selectCustomName() {
        return pendingSettlementBusinessMapper.selectCustomName();
    }
}
service/src/main/resources/mapper/cwgl/EstimatedReceivableMapper.xml
@@ -25,10 +25,11 @@
        <result property="createTime"    column="create_time"    />
        <result property="updateTime"    column="update_time"    />
        <result property="deleted"    column="deleted"    />
        <result property="feeType"    column="fee_type"    />
    </resultMap>
    <sql id="selectEstimatedReceivableVo">
        select thisTab.id, thisTab.fee_system_no, thisTab.dispatch_no, thisTab.customer_name, thisTab.project_name, thisTab.order_date, thisTab.fee_name, thisTab.estimated_amount, thisTab.currency, thisTab.related_bill_name, thisTab.related_bill_status, thisTab.is_confirmed, thisTab.confirm_by, thisTab.confirm_time, thisTab.remark, thisTab.create_by, thisTab.update_by, thisTab.create_time, thisTab.update_time, thisTab.deleted from estimated_receivable AS thisTab
        select thisTab.id, thisTab.fee_system_no, thisTab.dispatch_no, thisTab.customer_name, thisTab.project_name, thisTab.order_date, thisTab.fee_name, thisTab.estimated_amount, thisTab.currency, thisTab.related_bill_name, thisTab.related_bill_status, thisTab.is_confirmed, thisTab.confirm_by, thisTab.confirm_time, thisTab.remark, thisTab.create_by, thisTab.update_by, thisTab.create_time, thisTab.update_time, thisTab.deleted , thisTab.fee_type from estimated_receivable AS thisTab
    </sql>
    <sql id="selectEstimatedReceivableVoCount">
        select count(0) from estimated_receivable as thisTab
@@ -49,6 +50,7 @@
        <if test="confirmBy != null  and confirmBy != ''"> and thisTab.confirm_by = #{confirmBy}</if>
        <if test="confirmTime != null "> and thisTab.confirm_time = #{confirmTime}</if>
        <if test="deleted != null "> and thisTab.deleted = #{deleted}</if>
        <if test="feeType != null "> and thisTab.fee_type = #{feeType}</if>
    </sql>
    <!--查询-->
@@ -95,6 +97,7 @@
            <if test="createTime != null">create_time,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="deleted != null">deleted,</if>
            <if test="feeType != null">fee_type,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="feeSystemNo != null and feeSystemNo != ''">#{feeSystemNo},</if>
@@ -116,17 +119,18 @@
            <if test="createTime != null">#{createTime},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="deleted != null">#{deleted},</if>
            <if test="feeType != null">#{feeType},</if>
         </trim>
    </insert>
    <insert id="insertEstimatedReceivableBatch" parameterType="java.util.List"  useGeneratedKeys="true" keyProperty="id">
    <insert id="insertEstimatedReceivableBatch" parameterType="java.util.List"  >
        insert into estimated_receivable
        <trim prefix="(" suffix=") values" suffixOverrides=",">
            id,fee_system_no,dispatch_no,customer_name,project_name,order_date,fee_name,estimated_amount,currency,related_bill_name,related_bill_status,is_confirmed,confirm_by,confirm_time,remark,create_by,update_by,create_time,update_time,deleted,
           fee_system_no,dispatch_no,customer_name,project_name,order_date,fee_name,estimated_amount,currency,related_bill_name,related_bill_status,is_confirmed,confirm_by,confirm_time,remark,create_by,update_by,create_time,update_time,deleted,fee_type,
        </trim>
        <foreach item="item" index="index" collection="list" separator=",">
            <trim prefix="(" suffix=") " suffixOverrides=",">
                #{item.id},#{item.feeSystemNo},#{item.dispatchNo},#{item.customerName},#{item.projectName},#{item.orderDate},#{item.feeName},#{item.estimatedAmount},#{item.currency},#{item.relatedBillName},#{item.relatedBillStatus},#{item.isConfirmed},#{item.confirmBy},#{item.confirmTime},#{item.remark},#{item.createBy},#{item.updateBy},#{item.createTime},#{item.updateTime},#{item.deleted},
                #{item.feeSystemNo},#{item.dispatchNo},#{item.customerName},#{item.projectName},#{item.orderDate},#{item.feeName},#{item.estimatedAmount},#{item.currency},#{item.relatedBillName},#{item.relatedBillStatus},#{item.isConfirmed},#{item.confirmBy},#{item.confirmTime},#{item.remark},#{item.createBy},#{item.updateBy},#{item.createTime},#{item.updateTime},#{item.deleted},#{item.feeType},
            </trim>
        </foreach>
    </insert>
@@ -154,6 +158,7 @@
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="deleted != null">deleted = #{deleted},</if>
            <if test="feeType != null">fee_type = #{feeType},</if>
        </trim>
        where id = #{id}
    </update>
@@ -181,6 +186,7 @@
                <if test="item.createTime != null">create_time = #{item.createTime},</if>
                <if test="item.updateTime != null">update_time = #{item.updateTime},</if>
                <if test="item.deleted != null">deleted = #{item.deleted},</if>
                <if test="item.feeType != null">fee_type = #{item.feeType},</if>
            </trim>
        where id = #{item.id}
        </foreach>
service/src/main/resources/mapper/cwgl/PendingSettlementBusinessMapper.xml
@@ -53,10 +53,13 @@
        <result property="settlementStatus"    column="settlement_status"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateTime"    column="update_time"    />
        <result property="isCreate"    column="is_create"    />
        <result property="billId"    column="bill_id"    />
        <result property="billId"    column="bill_name"    />
    </resultMap>
    <sql id="selectPendingSettlementBusinessVo">
        select thisTab.id, thisTab.booking_no, thisTab.customer_id, thisTab.carrier_id, thisTab.project_name, thisTab.dispatch_no, thisTab.created_time, thisTab.transport_mode, thisTab.product_id, thisTab.customer_name, thisTab.operation_mode, thisTab.carrier_name, thisTab.departure_location, thisTab.arrival_location, thisTab.vehicle_id, thisTab.license_plate_number, thisTab.vehicle_type, thisTab.main_driver, thisTab.assistant_driver, thisTab.point_num, thisTab.business_contact, thisTab.estimated_total_income, thisTab.estimated_total_cost, thisTab.estimated_profit, thisTab.electronic_lock, thisTab.re_weighing_weight, thisTab.quantity, thisTab.actual_departure_time, thisTab.required_arrival_time, thisTab.actual_arrival_time, thisTab.be_return, thisTab.dispatch_quantity, thisTab.dispatch_weight, thisTab.dispatch_volume, thisTab.empty_mileage, thisTab.empty_fuel, thisTab.heavy_mileage, thisTab.heavy_fuel, thisTab.be_scheduled, thisTab.tracking_no, thisTab.seal_no, thisTab.schedule_no, thisTab.transport_status, thisTab.estimated_bill_id, thisTab.settlement_bill_id, thisTab.settlement_status, thisTab.create_time, thisTab.update_time from pending_settlement_business AS thisTab
        select thisTab.id, thisTab.booking_no, thisTab.customer_id, thisTab.carrier_id, thisTab.project_name, thisTab.dispatch_no, thisTab.created_time, thisTab.transport_mode, thisTab.product_id, thisTab.customer_name, thisTab.operation_mode, thisTab.carrier_name, thisTab.departure_location, thisTab.arrival_location, thisTab.vehicle_id, thisTab.license_plate_number, thisTab.vehicle_type, thisTab.main_driver, thisTab.assistant_driver, thisTab.point_num, thisTab.business_contact, thisTab.estimated_total_income, thisTab.estimated_total_cost, thisTab.estimated_profit, thisTab.electronic_lock, thisTab.re_weighing_weight, thisTab.quantity, thisTab.actual_departure_time, thisTab.required_arrival_time, thisTab.actual_arrival_time, thisTab.be_return, thisTab.dispatch_quantity, thisTab.dispatch_weight, thisTab.dispatch_volume, thisTab.empty_mileage, thisTab.empty_fuel, thisTab.heavy_mileage, thisTab.heavy_fuel, thisTab.be_scheduled, thisTab.tracking_no, thisTab.seal_no, thisTab.schedule_no, thisTab.transport_status, thisTab.estimated_bill_id, thisTab.settlement_bill_id, thisTab.settlement_status, thisTab.create_time, thisTab.update_time, thisTab.is_create, thisTab.bill_name from pending_settlement_business AS thisTab
    </sql>
    <sql id="selectPendingSettlementBusinessVoCount">
        select count(0) from pending_settlement_business as thisTab
@@ -98,6 +101,8 @@
        <if test="dispatchVolume != null "> and thisTab.dispatch_volume = #{dispatchVolume}</if>
        <if test="emptyMileage != null "> and thisTab.empty_mileage = #{emptyMileage}</if>
        <if test="emptyFuel != null "> and thisTab.empty_fuel = #{emptyFuel}</if>
        <if test="isCreate != null "> and thisTab.is_create = #{isCreate}</if>
        <if test="billId != null "> and thisTab.bill_id = #{billId}</if>
        <if test="heavyMileage != null "> and thisTab.heavy_mileage = #{heavyMileage}</if>
        <if test="heavyFuel != null "> and thisTab.heavy_fuel = #{heavyFuel}</if>
        <if test="beScheduled != null  and beScheduled != ''"> and thisTab.be_scheduled = #{beScheduled}</if>
@@ -129,6 +134,145 @@
            <include refid="whereCondition"/>
        </where>
        order by thisTab.id desc
    </select>
    <select id="selectPendingSettlement2Cw" resultType="com.ruoyi.cwgl.domain.PendingSettlementBusiness">
SELECT
-- ord.BOOKING_NO '客户订单号',
-- ord.CUSTOMER_ID,
-- ts.CARRIER_ID,
ts.ID as serviceId,
brd.PROJECT_NAME as projectName,
ts.DISPATCH_NO as dispatchNo,
ts.CREATED_TIME as createdTime,
-- ts.TRANSPORT_MODE '运输方式',
-- ts.PRODUCT_ID '服务产品',
customer.NAME as customerName,
        case when ts.CARRIER_ID=50 then
        '自营'
        else '外协'
        end as  operationMode,
bp.NAME as carrierName,
location_d.NAME_TREE as departureLocation,
location_a.NAME_TREE as arrivalLocation,
-- ts.VEHICLE_ID '运输工具ID',
vhc.LICENSE_PLATE_NUMBER as licensePlateNumber,
bvt.NAME as vehicleType,
driver_m.NAME as mainDriver,
ts.POINT_NUM as pointNum,
        ts.CREATOR as businessContact,
-- ts.ELECTRONIC_LOCK '电子锁',
-- ts.RE_WEIGHING_WEIGHT '复磅重量',
ts.QUANTITY as quantity,
driver_a.NAME as assistantDriver,
ts.ACTUAL_DEPARTURE_TIME as actualDepartureTime,
ts.REQUIRED_ARRIVAL_TIME as requiredArrivalTime,
ts.ACTUAL_ARRIVAL_TIME as actualArrivalTime,
ts.BE_RETURN as beReturn,
ts.DISPATCH_QUANTITY as dispatchQuantity,
ts.DISPATCH_WEIGHT as dispatchWeight,
ts.DISPATCH_VOLUME as dispatchVolume,
-- ts.EMPTY_MILEAGE '空载里程(公里)',
-- ts.EMPTY_FUEL '空载油耗(升)',
-- ts.HEAVY_MILEAGE '重载里程(公里)',
-- ts.HEAVY_FUEL '重载油耗(升)',
-- ts.BE_SCHEDULED '是否按班次',
-- ts.TRACKING_NO '快递单号',
-- ts.SEAL_NO '铅封号',
-- ts.SCHEDULE_NO '班次号',
CASE ts.STATUS
        WHEN 'A' THEN '生效'
        WHEN 'O' THEN '打开'
        WHEN 'J' THEN '已接单'
        WHEN 'K' THEN '已到库'
        WHEN 'Z' THEN '已装车'
        WHEN 'T' THEN '在途'
        WHEN 'F' THEN '已复磅'
        WHEN 'D' THEN '已运抵'
        ELSE '未知状态'
    END AS transportStatus
        FROM
    tms_shipment ts
-- 订单表
     LEFT JOIN oms_order ord ON ts.DISPATCH_NO = ord.DISPATCH_CODE
        -- 客户表
    LEFT join base_customer customer on customer.ID=ord.CUSTOMER_ID
    -- 运输工具表
    left join tms_vehicle  vhc on ts.VEHICLE_ID=vhc.id
    -- 车型数据表
    LEFT JOIN base_vehicle_type bvt on bvt.ID=vhc.VEHICLE_TYPE_ID
    -- 承运商表
    left join base_provider bp on bp.ID=ts.CARRIER_ID
    -- 司机表
    left join tms_driver driver_m on driver_m.ID=ts.MAIN_DRIVER_ID
-- 司机表
    left join tms_driver driver_a on driver_a.ID=ts.ASSISTANT_DRIVER_ID
    -- 地区表
    left join base_location location_a on location_a.ID =ts.ARRIVAL_LOCATION_ID
    -- 地区表
    left join base_location location_d on location_d.ID =ts.DEPARTURE_LOCATION_ID
        -- 路线详情表表
    left join base_plan_road_detail prd on prd.ID =ts.PLAN_ROAD_DETAIL_ID
        -- 路线表
    LEFT join base_road_survey brd on brd.ID = prd.ROAD_SURVEY_ID
    where  ts.STATUS='D'
    and ts.IS_SYNC = 0
    </select>
    <select id="selectReceivableLineTruckPriceRule"
            resultType="com.ruoyi.cwgl.domain.ReceivableLineTruckPriceRule">
        SELECT
    rtd.id as id,
    rtd.REFERENCE1 as feeType,
    rtd.REFERENCE2 as customerName,
    rtd.REFERENCE3 as departureCity,
    rtd.REFERENCE4 as departureDistrict,
    rtd.REFERENCE5 as arrivalCity,
    rtd.REFERENCE6 as arrivalDistrict,
    rtd.REFERENCE7 as vehicleType,
    rtd.VALUE1 as freight,
    rtd.CREATED_TIME as createdTime
FROM
    thorn_rule_table_detail rtd
    LEFT JOIN thorn_rule_version rv ON rtd.VERSION_ID = rv.id
    LEFT JOIN thorn_rule_table rt ON rv.RULE_TABLE_ID = rt.id
WHERE
    rt.STATUS = 'ACTIVE'
    AND rt.NAME = '应收线路整车价格' and rtd.REFERENCE1='运费'
    </select>
    <select id="selectPayableLineTruckPriceRule"
            resultType="com.ruoyi.cwgl.domain.ReceivableLineTruckPriceRule">
        SELECT
    rtd.id as id,
    rtd.REFERENCE1 as feeType,
    rtd.REFERENCE2 as customerName,
    rtd.REFERENCE3 as departureCity,
    rtd.REFERENCE4 as departureDistrict,
    rtd.REFERENCE5 as arrivalCity,
    rtd.REFERENCE6 as arrivalDistrict,
    rtd.REFERENCE7 as vehicleType,
    rtd.VALUE1 as freight,
    rtd.CREATED_TIME as createdTime
FROM
    thorn_rule_table_detail rtd
    LEFT JOIN thorn_rule_version rv ON rtd.VERSION_ID = rv.id
    LEFT JOIN thorn_rule_table rt ON rv.RULE_TABLE_ID = rt.id
WHERE
    rt.STATUS = 'ACTIVE'
    AND rt.NAME = '应付线路整车价格' and rtd.REFERENCE1='运费'
    </select>
    <select id="selectCustomName" resultType="java.lang.String">
        SELECT customer_name from pending_settlement_business group by customer_name
    </select>
    <!-- 新增 -->
@@ -182,6 +326,7 @@
            <if test="settlementStatus != null">settlement_status,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="isCreate != null">is_create,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="bookingNo != null">#{bookingNo},</if>
@@ -231,17 +376,18 @@
            <if test="settlementStatus != null">#{settlementStatus},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="isCreate != null">#{isCreate},</if>
         </trim>
    </insert>
    <insert id="insertPendingSettlementBusinessBatch" parameterType="java.util.List"  useGeneratedKeys="true" keyProperty="id">
    <insert id="insertPendingSettlementBusinessBatch" parameterType="java.util.List">
        insert into pending_settlement_business
        <trim prefix="(" suffix=") values" suffixOverrides=",">
            id,booking_no,customer_id,carrier_id,project_name,dispatch_no,created_time,transport_mode,product_id,customer_name,operation_mode,carrier_name,departure_location,arrival_location,vehicle_id,license_plate_number,vehicle_type,main_driver,assistant_driver,point_num,business_contact,estimated_total_income,estimated_total_cost,estimated_profit,electronic_lock,re_weighing_weight,quantity,actual_departure_time,required_arrival_time,actual_arrival_time,be_return,dispatch_quantity,dispatch_weight,dispatch_volume,empty_mileage,empty_fuel,heavy_mileage,heavy_fuel,be_scheduled,tracking_no,seal_no,schedule_no,transport_status,estimated_bill_id,settlement_bill_id,settlement_status,create_time,update_time,
            booking_no,customer_id,carrier_id,project_name,dispatch_no,created_time,transport_mode,product_id,customer_name,operation_mode,carrier_name,departure_location,arrival_location,vehicle_id,license_plate_number,vehicle_type,main_driver,assistant_driver,point_num,business_contact,estimated_total_income,estimated_total_cost,estimated_profit,electronic_lock,re_weighing_weight,quantity,actual_departure_time,required_arrival_time,actual_arrival_time,be_return,dispatch_quantity,dispatch_weight,dispatch_volume,empty_mileage,empty_fuel,heavy_mileage,heavy_fuel,be_scheduled,tracking_no,seal_no,schedule_no,transport_status,estimated_bill_id,settlement_bill_id,settlement_status,create_time,update_time,is_create,
        </trim>
        <foreach item="item" index="index" collection="list" separator=",">
            <trim prefix="(" suffix=") " suffixOverrides=",">
                #{item.id},#{item.bookingNo},#{item.customerId},#{item.carrierId},#{item.projectName},#{item.dispatchNo},#{item.createdTime},#{item.transportMode},#{item.productId},#{item.customerName},#{item.operationMode},#{item.carrierName},#{item.departureLocation},#{item.arrivalLocation},#{item.vehicleId},#{item.licensePlateNumber},#{item.vehicleType},#{item.mainDriver},#{item.assistantDriver},#{item.pointNum},#{item.businessContact},#{item.estimatedTotalIncome},#{item.estimatedTotalCost},#{item.estimatedProfit},#{item.electronicLock},#{item.reWeighingWeight},#{item.quantity},#{item.actualDepartureTime},#{item.requiredArrivalTime},#{item.actualArrivalTime},#{item.beReturn},#{item.dispatchQuantity},#{item.dispatchWeight},#{item.dispatchVolume},#{item.emptyMileage},#{item.emptyFuel},#{item.heavyMileage},#{item.heavyFuel},#{item.beScheduled},#{item.trackingNo},#{item.sealNo},#{item.scheduleNo},#{item.transportStatus},#{item.estimatedBillId},#{item.settlementBillId},#{item.settlementStatus},#{item.createTime},#{item.updateTime},
                #{item.bookingNo},#{item.customerId},#{item.carrierId},#{item.projectName},#{item.dispatchNo},#{item.createdTime},#{item.transportMode},#{item.productId},#{item.customerName},#{item.operationMode},#{item.carrierName},#{item.departureLocation},#{item.arrivalLocation},#{item.vehicleId},#{item.licensePlateNumber},#{item.vehicleType},#{item.mainDriver},#{item.assistantDriver},#{item.pointNum},#{item.businessContact},#{item.estimatedTotalIncome},#{item.estimatedTotalCost},#{item.estimatedProfit},#{item.electronicLock},#{item.reWeighingWeight},#{item.quantity},#{item.actualDepartureTime},#{item.requiredArrivalTime},#{item.actualArrivalTime},#{item.beReturn},#{item.dispatchQuantity},#{item.dispatchWeight},#{item.dispatchVolume},#{item.emptyMileage},#{item.emptyFuel},#{item.heavyMileage},#{item.heavyFuel},#{item.beScheduled},#{item.trackingNo},#{item.sealNo},#{item.scheduleNo},#{item.transportStatus},#{item.estimatedBillId},#{item.settlementBillId},#{item.settlementStatus},#{item.createTime},#{item.updateTime},#{item.isCreate},
            </trim>
        </foreach>
    </insert>
@@ -297,6 +443,7 @@
            <if test="settlementStatus != null">settlement_status = #{settlementStatus},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="isCreate != null">is_create = #{isCreate},</if>
        </trim>
        where id = #{id}
    </update>
@@ -352,10 +499,28 @@
                <if test="item.settlementStatus != null">settlement_status = #{item.settlementStatus},</if>
                <if test="item.createTime != null">create_time = #{item.createTime},</if>
                <if test="item.updateTime != null">update_time = #{item.updateTime},</if>
                <if test="item.isCreate != null">is_create = #{item.isCreate},</if>
            </trim>
        where id = #{item.id}
        </foreach>
    </update>
    <update id="updeteCwData">
        update pending_settlement_business set IS_SYNC = 1
        where ID in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </update>
    <update id="updatePendingSettlementBusinessIsCreate">
        UPDATE pending_settlement_business
        SET is_create = 1 ,bill_id = #{id},bill_name = #{billName}
        WHERE dispatch_no IN
        <foreach item="item" collection="list" open="(" separator="," close=")">
            #{item}
        </foreach>
    </update>
    <!--删除-->
    <delete id="deletePendingSettlementBusinessById" parameterType="Integer">