21个文件已修改
544 ■■■■ 已修改文件
tms/src/main/java/com/ruoyi/tms/controller/TmsApBillController.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tms/src/main/java/com/ruoyi/tms/controller/TmsArBillController.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tms/src/main/java/com/ruoyi/tms/controller/TmsDispatchOrderController.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tms/src/main/java/com/ruoyi/tms/domain/TmsApBill.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tms/src/main/java/com/ruoyi/tms/domain/TmsArBill.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tms/src/main/java/com/ruoyi/tms/service/ITmsApBillService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tms/src/main/java/com/ruoyi/tms/service/ITmsArBillService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tms/src/main/java/com/ruoyi/tms/service/ITmsDispatchOrderService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tms/src/main/java/com/ruoyi/tms/service/impl/TmsApBillServiceImpl.java 80 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tms/src/main/java/com/ruoyi/tms/service/impl/TmsArBillServiceImpl.java 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tms/src/main/java/com/ruoyi/tms/service/impl/TmsDispatchOrderServiceImpl.java 67 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tms/src/main/java/com/ruoyi/tms/service/impl/TmsPayableFeeServiceImpl.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tms/src/main/java/com/ruoyi/tms/service/impl/TmsReceivableFeeServiceImpl.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tms/src/main/resources/mapper/tms/TmsApBillMapper.xml 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tms/src/main/resources/mapper/tms/TmsArBillMapper.xml 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ui/admin-ui3/src/api/tms/tmsApBill.ts 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ui/admin-ui3/src/api/tms/tmsArBill.ts 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ui/admin-ui3/src/api/tms/tmsDispatchOrder.ts 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ui/admin-ui3/src/views/tms/tmsApBill/index.vue 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ui/admin-ui3/src/views/tms/tmsArBill/index.vue 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ui/admin-ui3/src/views/tms/tmsDispatchOrder/index.vue 138 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tms/src/main/java/com/ruoyi/tms/controller/TmsApBillController.java
@@ -119,6 +119,18 @@
    }
    /**
     * 手动推送应付账单作废到外部系统
     */
    @PreAuthorize("@ss.hasPermi('tms:tmsApBill:edit')")
    @Log(title = "应付账单", businessType = BusinessType.UPDATE)
    @PostMapping("/cancelPush/{id}")
    public AjaxResult cancelPush(@PathVariable("id") Integer id)
    {
        tmsApBillService.cancelPushToExternalSystem(id);
        return AjaxResult.success("作废推送请求已提交,请稍后查看推送状态");
    }
    /**
     * 接收外部系统推送状态
     */
    @PostMapping("/updatePushStatus")
tms/src/main/java/com/ruoyi/tms/controller/TmsArBillController.java
@@ -142,6 +142,18 @@
    }
    /**
     * 手动推送应收账单作废到外部系统
     */
    @PreAuthorize("@ss.hasPermi('tms:tmsArBill:edit')")
    @Log(title = "应收账单", businessType = BusinessType.UPDATE)
    @PostMapping("/cancelPush/{id}")
    public AjaxResult cancelPush(@PathVariable("id") Integer id)
    {
        tmsArBillService.cancelPushToExternalSystem(id);
        return AjaxResult.success("作废推送请求已提交,请稍后查看推送状态");
    }
    /**
     * 接收外部系统推送状态
     */
    @PostMapping("/updatePushStatus")
tms/src/main/java/com/ruoyi/tms/controller/TmsDispatchOrderController.java
@@ -155,15 +155,15 @@
    @PreAuthorize("@ss.hasPermi('tms:tmsDispatchOrder:customsOrder')")
    @PostMapping(value = "/customsOrder")
    public AjaxResult customsOrder(@RequestBody TmsDispatchOrder tmsDispatchOrder)
    public AjaxResult customsOrder(@RequestBody List<TmsDispatchOrder> tmsDispatchOrders)
    {
        return toAjax(tmsDispatchOrderService.customsOrder(tmsDispatchOrder));
        return toAjax(tmsDispatchOrderService.customsOrder(tmsDispatchOrders));
    }
    @PreAuthorize("@ss.hasPermi('tms:tmsDispatchOrder:loadingOrder')")
    @PostMapping(value = "/loadingOrder")
    public AjaxResult loadingOrder(@RequestBody TmsDispatchOrder tmsDispatchOrder)
    public AjaxResult loadingOrder(@RequestBody List<TmsDispatchOrder> tmsDispatchOrders)
    {
        return toAjax(tmsDispatchOrderService.loadingOrder(tmsDispatchOrder));
        return toAjax(tmsDispatchOrderService.loadingOrder(tmsDispatchOrders));
    }
    /**
tms/src/main/java/com/ruoyi/tms/domain/TmsApBill.java
@@ -148,7 +148,11 @@
    @TableField("push_time")
    private Date pushTime;
    /**
     * 来源系统id
     */
    @TableField("source_system_id")
    private Integer sourceSystemId;
    /**
     *
tms/src/main/java/com/ruoyi/tms/domain/TmsArBill.java
@@ -160,7 +160,11 @@
    @TableField("push_time")
    private Date pushTime;
    /**
     * 来源系统id
     */
    @TableField("source_system_id")
    private Integer sourceSystemId;
    @TableField(exist = false)
    private List<TmsReceivableFee> tmsReceivableFees;
tms/src/main/java/com/ruoyi/tms/service/ITmsApBillService.java
@@ -109,6 +109,14 @@
    public void manualPushToExternalSystem(Integer id);
    
    /**
     * 手动推送应付账单作废到外部系统
     *
     * @param id 应付账单ID
     * @return 结果
     */
    public void cancelPushToExternalSystem(Integer id);
    /**
     * 更新推送状态
     *
     * @param id 应付账单ID
tms/src/main/java/com/ruoyi/tms/service/ITmsArBillService.java
@@ -120,6 +120,14 @@
    public void manualPushToExternalSystem(Integer id);
    
    /**
     * 手动推送应收账单作废到外部系统
     *
     * @param id 应收账单ID
     * @return 结果
     */
    public void cancelPushToExternalSystem(Integer id);
    /**
     * 更新推送状态
     *
     * @param id 应收账单ID
tms/src/main/java/com/ruoyi/tms/service/ITmsDispatchOrderService.java
@@ -32,8 +32,8 @@
    public AjaxResult close(Integer id);
    public AjaxResult connectHang(TmsDriverDispatch driverDispatch);
    public AjaxResult closeOrder(TmsDispatchOrder order);
    public int customsOrder(TmsDispatchOrder tmsDispatchOrder);
    public int loadingOrder(TmsDispatchOrder tmsDispatchOrder);
    public int customsOrder(List<TmsDispatchOrder> tmsDispatchOrders);
    public int loadingOrder(List<TmsDispatchOrder> tmsDispatchOrders);
    /**
tms/src/main/java/com/ruoyi/tms/service/impl/TmsApBillServiceImpl.java
@@ -2,6 +2,7 @@
import java.util.List;
import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.common.utils.DateUtils;
import javax.annotation.Resource;
@@ -253,6 +254,69 @@
        executor.execute(() -> pushPayableToExternalSystem(tmsApBill, tmsPayableFeeList));
    }
    @Override
    public void cancelPushToExternalSystem(Integer id) {
        TmsApBill tmsApBill = tmsApBillMapper.selectTmsApBillById(id);
        if (tmsApBill == null) {
            throw new RuntimeException("应付账单不存在");
        }
        // 异步推送作废请求
        AsyncTaskExecutor executor = new SimpleAsyncTaskExecutor();
        executor.execute(() -> pushCancelToExternalSystem(tmsApBill));
    }
    /**
     * 向外部系统推送应付数据作废
     * @param tmsApBill 应付账单
     */
    @Async
    protected void pushCancelToExternalSystem(TmsApBill tmsApBill) {
        java.util.Map<String, Object> requestBody = new java.util.HashMap<>();
        try {
            // 构建请求体
            String apiUrl = url+"/cancelPayableBill";
            // 构建请求体,只需要sourceSystemId
            requestBody.put("sourceSystemId", tmsApBill.getSourceSystemId());
            // 设置HTTP头
            HttpHeaders headers = new HttpHeaders();
            headers.setContentType(MediaType.APPLICATION_JSON);
            HttpEntity<String> entity = new HttpEntity<>(JSON.toJSONString(requestBody), headers);
            // 发送API请求
            ResponseEntity<String> response = restTemplate.exchange(apiUrl, HttpMethod.POST, entity, String.class);
            logger.info("推送应付数据作废到外部系统成功,响应: {}", response.getBody());
            // 更新推送状态为成功
            tmsApBill.setPushStatus(2);
            tmsApBill.setStatus(3); // 设置账单状态为作废
            tmsApBill.setPushTime(DateUtils.getNowDate());
            tmsApBillMapper.updateTmsApBill(tmsApBill);
            // 重置关联的应付费用状态为待确认
            tmsPayableFeeMapper.update(new com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper<TmsPayableFee>()
                    .set(TmsPayableFee::getStatus, 0)
                    .set(TmsPayableFee::getBillPayableId, null)
                    .set(TmsPayableFee::getBillPayableNo, null)
                    .eq(TmsPayableFee::getBillPayableId, tmsApBill.getId())
            );
            logger.info("重置应付费用状态成功,账单ID: {}", tmsApBill.getId());
        } catch (Exception e) {
            logger.error("推送应付数据作废到外部系统失败,账单ID: {}, 供应商: {}",
                tmsApBill.getId(), tmsApBill.getServiceProviderName(), e);
            logger.debug("推送失败的请求数据: {}", JSON.toJSONString(requestBody));
            // 更新推送状态为失败
            tmsApBill.setPushStatus(3);
            tmsApBill.setPushTime(DateUtils.getNowDate());
            tmsApBillMapper.updateTmsApBill(tmsApBill);
        }
    }
    /**
     * 更新推送状态
     *
@@ -288,10 +352,7 @@
    protected void pushPayableToExternalSystem(TmsApBill tmsApBill, List<TmsPayableFee> tmsPayableFeeList) {
        java.util.Map<String, Object> requestBody = new java.util.HashMap<>();
        try {
            // 更新推送状态为推送中
            tmsApBill.setPushStatus(1);
            tmsApBill.setPushTime(DateUtils.getNowDate());
            tmsApBillMapper.updateTmsApBill(tmsApBill);
            // 构建请求体
            String apiUrl = url+"/addPayableBill";
@@ -391,6 +452,17 @@
            ResponseEntity<String> response = restTemplate.exchange(apiUrl, HttpMethod.POST, entity, String.class);
            logger.info("推送应付数据到外部系统成功,响应: {}", response.getBody());
            // 解析响应,获取sourceSystemId
            try {
                JSONObject result = JSONObject.parseObject(response.getBody());
                String sourceSystemId = result.getString("sourceSystemId");
                if (sourceSystemId != null) {
                    tmsApBill.setSourceSystemId(Integer.parseInt(sourceSystemId));
                }
            } catch (Exception e) {
                logger.error("解析外部系统响应失败: {}", e.getMessage());
            }
            // 更新推送状态为成功
            tmsApBill.setPushStatus(2);
            tmsApBill.setPushTime(DateUtils.getNowDate());
tms/src/main/java/com/ruoyi/tms/service/impl/TmsArBillServiceImpl.java
@@ -1,7 +1,5 @@
package com.ruoyi.tms.service.impl;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.redis.RedisCache;
@@ -47,6 +45,7 @@
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
/**
 * 应收账单Service业务层处理
@@ -291,6 +290,69 @@
        executor.execute(() -> pushToExternalSystem(tmsArBill, tmsReceivableFees));
    }
    @Override
    public void cancelPushToExternalSystem(Integer id) {
        TmsArBill tmsArBill = tmsArBillMapper.selectTmsArBillById(id);
        if (tmsArBill == null) {
            throw new RuntimeException("应收账单不存在");
        }
        // 异步推送作废请求
        AsyncTaskExecutor executor = new SimpleAsyncTaskExecutor();
        executor.execute(() -> pushCancelToExternalSystem(tmsArBill));
    }
    /**
     * 向外部系统推送应收数据作废
     * @param tmsArBill 应收账单
     */
    @Async
    protected void pushCancelToExternalSystem(TmsArBill tmsArBill) {
        java.util.Map<String, Object> requestBody = new java.util.HashMap<>();
        try {
    ;
            // 构建请求体
            String apiUrl = url+"/cancelBill";
            // 构建请求体,只需要sourceSystemId
            requestBody.put("sourceSystemId", tmsArBill.getSourceSystemId());
            // 设置HTTP头
            HttpHeaders headers = new HttpHeaders();
            headers.setContentType(MediaType.APPLICATION_JSON);
            HttpEntity<String> entity = new HttpEntity<>(JSON.toJSONString(requestBody), headers);
            // 发送API请求
            ResponseEntity<String> response = restTemplate.exchange(apiUrl, HttpMethod.POST, entity, String.class);
            logger.info("推送应收数据作废到外部系统成功,响应: {}", response.getBody());
            // 更新推送状态为成功
            tmsArBill.setStatus(3); // 设置账单状态为作废
            tmsArBillMapper.updateTmsArBill(tmsArBill);
            // 重置关联的应收费用状态为待确认
            tmsReceivableFeeMapper.update(new com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper<TmsReceivableFee>()
                    .set(TmsReceivableFee::getStatus, 0)
                    .set(TmsReceivableFee::getBillRelationId, null)
                    .set(TmsReceivableFee::getBillRelationNo, null)
                    .eq(TmsReceivableFee::getBillRelationId, tmsArBill.getId())
            );
            logger.info("重置应收费用状态成功,账单ID: {}", tmsArBill.getId());
        } catch (Exception e) {
            logger.error("推送应收数据作废到外部系统失败,账单ID: {}, 客户: {}",
                tmsArBill.getId(), tmsArBill.getCustomerName(), e);
            logger.debug("推送失败的请求数据: {}", JSON.toJSONString(requestBody));
            // 更新推送状态为失败
            tmsArBill.setPushStatus(3);
            tmsArBill.setPushTime(DateUtils.getNowDate());
            tmsArBillMapper.updateTmsArBill(tmsArBill);
        }
    }
    /**
     * 更新推送状态
     *
@@ -430,6 +492,17 @@
            ResponseEntity<String> response = restTemplate.exchange(apiUrl, HttpMethod.POST, entity, String.class);
            logger.info("推送数据到外部系统成功,响应: {}", response.getBody());
            // 解析响应,获取sourceSystemId
            try {
                JSONObject result = JSONObject.parseObject(response.getBody());
                String sourceSystemId = result.getString("sourceSystemId");
                if (sourceSystemId != null) {
                    tmsArBill.setSourceSystemId(Integer.parseInt(sourceSystemId));
                }
            } catch (Exception e) {
                logger.error("解析外部系统响应失败: {}", e.getMessage());
            }
            // 更新推送状态为成功
            tmsArBill.setPushStatus(2);
            tmsArBill.setPushTime(DateUtils.getNowDate());
tms/src/main/java/com/ruoyi/tms/service/impl/TmsDispatchOrderServiceImpl.java
@@ -300,47 +300,52 @@
    //填写委托报关信息
    @Override
    public int customsOrder(TmsDispatchOrder tmsDispatchOrder) {
        int result = tmsDispatchOrderMapper.update(new LambdaUpdateWrapper<TmsDispatchOrder>()
                .eq(TmsDispatchOrder::getId, tmsDispatchOrder.getId())
                .set(TmsDispatchOrder::getCustomsServiceProviderId, tmsDispatchOrder.getCustomsServiceProviderId())
                .set(TmsDispatchOrder::getCustomsServiceProviderName, tmsDispatchOrder.getCustomsServiceProviderName())
        );
    public int customsOrder(List<TmsDispatchOrder> tmsDispatchOrders) {
        int totalResult = 0;
        for (TmsDispatchOrder tmsDispatchOrder : tmsDispatchOrders) {
            int result = tmsDispatchOrderMapper.update(new LambdaUpdateWrapper<TmsDispatchOrder>()
                    .eq(TmsDispatchOrder::getId, tmsDispatchOrder.getId())
                    .set(TmsDispatchOrder::getCustomsServiceProviderId, tmsDispatchOrder.getCustomsServiceProviderId())
                    .set(TmsDispatchOrder::getCustomsServiceProviderName, tmsDispatchOrder.getCustomsServiceProviderName())
            );
            totalResult += result;
        if (result > 0) {
            TmsDispatchOrderLog log = new TmsDispatchOrderLog();
            log.setHeadId(tmsDispatchOrder.getId());
            log.setCreateBy(SecurityUtils.getUsername());
            log.setCreateTime(DateUtils.getNowDate());
            log.setNode("填写委托报关信息");
            if (result > 0) {
                TmsDispatchOrderLog log = new TmsDispatchOrderLog();
                log.setHeadId(tmsDispatchOrder.getId());
                log.setCreateBy(SecurityUtils.getUsername());
                log.setCreateTime(DateUtils.getNowDate());
                log.setNode("填写委托报关信息");
            tmsDispatchOrderLogService.insertTmsDispatchOrderLog(log);
                tmsDispatchOrderLogService.insertTmsDispatchOrderLog(log);
            }
        }
        return result;
        return totalResult;
    }
    //填写委托装卸信息
    @Override
    public int loadingOrder(TmsDispatchOrder tmsDispatchOrder) {
        int result = tmsDispatchOrderMapper.update(new LambdaUpdateWrapper<TmsDispatchOrder>()
                .eq(TmsDispatchOrder::getId, tmsDispatchOrder.getId())
                .set(TmsDispatchOrder::getLoadingServiceProviderId, tmsDispatchOrder.getLoadingServiceProviderId())
                .set(TmsDispatchOrder::getLoadingServiceProviderName, tmsDispatchOrder.getLoadingServiceProviderName())
        );
    public int loadingOrder(List<TmsDispatchOrder> tmsDispatchOrders) {
        int totalResult = 0;
        for (TmsDispatchOrder tmsDispatchOrder : tmsDispatchOrders) {
            int result = tmsDispatchOrderMapper.update(new LambdaUpdateWrapper<TmsDispatchOrder>()
                    .eq(TmsDispatchOrder::getId, tmsDispatchOrder.getId())
                    .set(TmsDispatchOrder::getLoadingServiceProviderId, tmsDispatchOrder.getLoadingServiceProviderId())
                    .set(TmsDispatchOrder::getLoadingServiceProviderName, tmsDispatchOrder.getLoadingServiceProviderName())
            );
            totalResult += result;
        if (result > 0) {
            TmsDispatchOrderLog log = new TmsDispatchOrderLog();
            log.setHeadId(tmsDispatchOrder.getId());
            log.setCreateBy(SecurityUtils.getUsername());
            log.setCreateTime(DateUtils.getNowDate());
            log.setNode("填写委托装卸信息");
            if (result > 0) {
                TmsDispatchOrderLog log = new TmsDispatchOrderLog();
                log.setHeadId(tmsDispatchOrder.getId());
                log.setCreateBy(SecurityUtils.getUsername());
                log.setCreateTime(DateUtils.getNowDate());
                log.setNode("填写委托装卸信息");
            tmsDispatchOrderLogService.insertTmsDispatchOrderLog(log);
                tmsDispatchOrderLogService.insertTmsDispatchOrderLog(log);
            }
        }
        return result;
        return totalResult;
    }
    @Override
tms/src/main/java/com/ruoyi/tms/service/impl/TmsPayableFeeServiceImpl.java
@@ -34,6 +34,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.common.utils.PageUtils;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.annotation.DataSource;
@@ -444,6 +445,17 @@
            ResponseEntity<String> response = restTemplate.exchange(apiUrl, HttpMethod.POST, entity, String.class);
            logger.info("推送应付数据到外部系统成功,响应: {}", response.getBody());
            
            // 解析响应,获取sourceSystemId
            try {
                JSONObject result = JSONObject.parseObject(response.getBody());
                String sourceSystemId = result.getString("sourceSystemId");
                if (sourceSystemId != null) {
                    tmsApBill.setSourceSystemId(Integer.parseInt(sourceSystemId));
                }
            } catch (Exception e) {
                logger.error("解析外部系统响应失败: {}", e.getMessage());
            }
            // 更新推送状态为成功
            tmsApBill.setPushStatus(2);
            tmsApBill.setPushTime(DateUtils.getNowDate());
tms/src/main/java/com/ruoyi/tms/service/impl/TmsReceivableFeeServiceImpl.java
@@ -13,6 +13,7 @@
import java.util.Set;
import java.util.stream.Collectors;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.redis.RedisCache;
@@ -483,6 +484,18 @@
            ResponseEntity<String> response = restTemplate.exchange(apiUrl, HttpMethod.POST, entity, String.class);
            logger.info("推送数据到外部系统成功,响应: {}", response.getBody());
            
            // 解析响应,获取sourceSystemId
            try {
                JSONObject result = JSONObject.parseObject(response.getBody());
                String sourceSystemId = result.getString("sourceSystemId");
                if (sourceSystemId != null) {
                    tmsArBill.setSourceSystemId(Integer.parseInt(sourceSystemId));
                }
            } catch (Exception e) {
                logger.error("解析外部系统响应失败: {}", e.getMessage());
            }
            // 更新推送状态为成功
            tmsArBill.setPushStatus(2);
            tmsArBill.setPushTime(DateUtils.getNowDate());
tms/src/main/resources/mapper/tms/TmsApBillMapper.xml
@@ -25,10 +25,11 @@
        <result property="serviceProviderType"    column="service_provider_type"    />
        <result property="pushStatus"    column="push_status"    />
        <result property="pushTime"    column="push_time"    />
        <result property="sourceSystemId"    column="source_system_id"    />
    </resultMap>
    <sql id="selectTmsApBillVo">
        select thisTab.id, thisTab.system_no, thisTab.bill_name, thisTab.settle_amount, thisTab.settle_rate, thisTab.dispatch_count, thisTab.settled_amount, thisTab.invoice_status, thisTab.status, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time,  thisTab.deduction_amount, thisTab.actual_settlement_amount, thisTab.service_provider_id, thisTab.service_provider_name, thisTab.service_provider_type, thisTab.push_status, thisTab.push_time from tms_ap_bill AS thisTab
        select thisTab.id, thisTab.system_no, thisTab.bill_name, thisTab.settle_amount, thisTab.settle_rate, thisTab.dispatch_count, thisTab.settled_amount, thisTab.invoice_status, thisTab.status, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time,  thisTab.deduction_amount, thisTab.actual_settlement_amount, thisTab.service_provider_id, thisTab.service_provider_name, thisTab.service_provider_type, thisTab.push_status, thisTab.push_time, thisTab.source_system_id from tms_ap_bill AS thisTab
    </sql>
    <sql id="selectTmsApBillVoCount">
        select count(0) from tms_ap_bill as thisTab
@@ -49,6 +50,7 @@
        <if test="deductionAmount != null "> and thisTab.deduction_amount = #{deductionAmount}</if>
        <if test="actualSettlementAmount != null "> and thisTab.actual_settlement_amount = #{actualSettlementAmount}</if>
        <if test="pushStatus != null "> and thisTab.push_status = #{pushStatus}</if>
        <if test="sourceSystemId != null "> and thisTab.source_system_id = #{sourceSystemId}</if>
    </sql>
    <!--查询-->
@@ -95,6 +97,7 @@
            <if test="serviceProviderType != null and serviceProviderType != ''">service_provider_type,</if>
            <if test="pushStatus != null">push_status,</if>
            <if test="pushTime != null">push_time,</if>
            <if test="sourceSystemId != null">source_system_id,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -117,6 +120,7 @@
            <if test="serviceProviderType != null and serviceProviderType != ''">#{serviceProviderType},</if>
            <if test="pushStatus != null">#{pushStatus},</if>
            <if test="pushTime != null">#{pushTime},</if>
            <if test="sourceSystemId != null">#{sourceSystemId},</if>
        </trim>
    </insert>
@@ -124,11 +128,11 @@
    <insert id="insertTmsApBillBatch" parameterType="java.util.List"  useGeneratedKeys="true" keyProperty="id">
        insert into tms_ap_bill
        <trim prefix="(" suffix=") values" suffixOverrides=",">
            system_no,bill_name,settle_amount,settle_rate,dispatch_count,settled_amount,invoice_status,status,create_by,create_time,update_by,update_time,deduction_amount,actual_settlement_amount,push_status,push_time,
            system_no,bill_name,settle_amount,settle_rate,dispatch_count,settled_amount,invoice_status,status,create_by,create_time,update_by,update_time,deduction_amount,actual_settlement_amount,push_status,push_time,source_system_id,
        </trim>
        <foreach item="item" index="index" collection="list" separator=",">
            <trim prefix="(" suffix=") " suffixOverrides=",">
                #{item.systemNo},#{item.billName},#{item.settleAmount},#{item.settleRate},#{item.dispatchCount},#{item.settledAmount},#{item.invoiceStatus},#{item.status},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.deductionAmount},#{item.actualSettlementAmount},#{item.pushStatus},#{item.pushTime},
                #{item.systemNo},#{item.billName},#{item.settleAmount},#{item.settleRate},#{item.dispatchCount},#{item.settledAmount},#{item.invoiceStatus},#{item.status},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.deductionAmount},#{item.actualSettlementAmount},#{item.pushStatus},#{item.pushTime},#{item.sourceSystemId},
            </trim>
        </foreach>
    </insert>
@@ -156,6 +160,7 @@
            <if test="serviceProviderType != null and serviceProviderType != ''">service_provider_type = #{serviceProviderType},</if>
            <if test="pushStatus != null">push_status = #{pushStatus},</if>
            <if test="pushTime != null">push_time = #{pushTime},</if>
            <if test="sourceSystemId != null">source_system_id = #{sourceSystemId},</if>
        </trim>
        where id = #{id}
@@ -184,6 +189,7 @@
                <if test="item.serviceProviderType != null and item.serviceProviderType != ''">service_provider_type = #{item.serviceProviderType},</if>
                <if test="item.pushStatus != null">push_status = #{item.pushStatus},</if>
                <if test="item.pushTime != null">push_time = #{item.pushTime},</if>
                <if test="item.sourceSystemId != null">source_system_id = #{item.sourceSystemId},</if>
            </trim>
        where id = #{item.id}
tms/src/main/resources/mapper/tms/TmsArBillMapper.xml
@@ -24,10 +24,11 @@
        <result property="actualSettlementAmount"    column="actual_settlement_amount"    />
        <result property="pushStatus"    column="push_status"    />
        <result property="pushTime"    column="push_time"    />
        <result property="sourceSystemId"    column="source_system_id"    />
    </resultMap>
    <sql id="selectTmsArBillVo">
        select thisTab.id, thisTab.system_no, thisTab.bill_name, thisTab.customer_id, thisTab.customer_name, thisTab.settle_amount, thisTab.settle_rate, thisTab.dispatch_count, thisTab.settled_amount, thisTab.invoice_status, thisTab.status, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time, thisTab.deduction_amount, thisTab.actual_settlement_amount, thisTab.push_status, thisTab.push_time from tms_ar_bill AS thisTab
        select thisTab.id, thisTab.system_no, thisTab.bill_name, thisTab.customer_id, thisTab.customer_name, thisTab.settle_amount, thisTab.settle_rate, thisTab.dispatch_count, thisTab.settled_amount, thisTab.invoice_status, thisTab.status, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time, thisTab.deduction_amount, thisTab.actual_settlement_amount, thisTab.push_status, thisTab.push_time, thisTab.source_system_id from tms_ar_bill AS thisTab
    </sql>
    <sql id="selectTmsArBillVoCount">
        select count(0) from tms_ar_bill as thisTab
@@ -47,6 +48,7 @@
        <if test="deductionAmount != null "> and thisTab.deduction_amount = #{deductionAmount}</if>
        <if test="actualSettlementAmount != null "> and thisTab.actual_settlement_amount = #{actualSettlementAmount}</if>
        <if test="pushStatus != null "> and thisTab.push_status = #{pushStatus}</if>
        <if test="sourceSystemId != null "> and thisTab.source_system_id = #{sourceSystemId}</if>
    </sql>
    <!--查询-->
@@ -92,6 +94,7 @@
            <if test="actualSettlementAmount != null">actual_settlement_amount,</if>
            <if test="pushStatus != null">push_status,</if>
            <if test="pushTime != null">push_time,</if>
            <if test="sourceSystemId != null">source_system_id,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="systemNo != null and systemNo != ''">#{systemNo},</if>
@@ -112,17 +115,18 @@
            <if test="actualSettlementAmount != null">#{actualSettlementAmount},</if>
            <if test="pushStatus != null">#{pushStatus},</if>
            <if test="pushTime != null">#{pushTime},</if>
            <if test="sourceSystemId != null">#{sourceSystemId},</if>
         </trim>
    </insert>
    <insert id="insertTmsArBillBatch" parameterType="java.util.List"  useGeneratedKeys="true" keyProperty="id">
        insert into tms_ar_bill
        <trim prefix="(" suffix=") values" suffixOverrides=",">
            id,system_no,bill_name,customer_name,settle_amount,settle_rate,dispatch_count,settled_amount,invoice_status,status,create_by,create_time,update_by,update_time,customer_id,deduction_amount,actual_settlement_amount,push_status,push_time,
            id,system_no,bill_name,customer_name,settle_amount,settle_rate,dispatch_count,settled_amount,invoice_status,status,create_by,create_time,update_by,update_time,customer_id,deduction_amount,actual_settlement_amount,push_status,push_time,source_system_id,
        </trim>
        <foreach item="item" index="index" collection="list" separator=",">
            <trim prefix="(" suffix=") " suffixOverrides=",">
                #{item.id},#{item.systemNo},#{item.billName},#{item.customerName},#{item.settleAmount},#{item.settleRate},#{item.dispatchCount},#{item.settledAmount},#{item.invoiceStatus},#{item.status},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.customerId},#{item.deductionAmount},#{item.actualSettlementAmount},#{item.pushStatus},#{item.pushTime},
                #{item.id},#{item.systemNo},#{item.billName},#{item.customerName},#{item.settleAmount},#{item.settleRate},#{item.dispatchCount},#{item.settledAmount},#{item.invoiceStatus},#{item.status},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.customerId},#{item.deductionAmount},#{item.actualSettlementAmount},#{item.pushStatus},#{item.pushTime},#{item.sourceSystemId},
            </trim>
        </foreach>
    </insert>
@@ -149,6 +153,7 @@
            <if test="actualSettlementAmount != null">actual_settlement_amount = #{actualSettlementAmount},</if>
            <if test="pushStatus != null">push_status = #{pushStatus},</if>
            <if test="pushTime != null">push_time = #{pushTime},</if>
            <if test="sourceSystemId != null">source_system_id = #{sourceSystemId},</if>
        </trim>
        where id = #{id}
    </update>
@@ -175,6 +180,7 @@
                <if test="item.actualSettlementAmount != null">actual_settlement_amount = #{item.actualSettlementAmount},</if>
                <if test="item.pushStatus != null">push_status = #{item.pushStatus},</if>
                <if test="item.pushTime != null">push_time = #{item.pushTime},</if>
                <if test="item.sourceSystemId != null">source_system_id = #{item.sourceSystemId},</if>
            </trim>
        where id = #{item.id}
        </foreach>
ui/admin-ui3/src/api/tms/tmsApBill.ts
@@ -103,4 +103,13 @@
        method:'get',
         params: query
    })
}
}
/**
 * 作废应付账单
 */
export const tmsApBillCancelPush: requestType = (id) => {
    return request({
        url: '/tms/tmsApBill/cancelPush/' + id,
        method: 'post',
    })
}
ui/admin-ui3/src/api/tms/tmsArBill.ts
@@ -120,4 +120,14 @@
        method:'get',
        params:query
    })
}
/**
 * 作废
 */
export const tmsArBillCancelPush: requestType = (id) => {
    return request({
        url: '/tms/tmsArBill/cancelPush/' + id,
        method: 'post',
    })
}
ui/admin-ui3/src/api/tms/tmsDispatchOrder.ts
@@ -260,6 +260,8 @@
        data
    })
}
export const loadingOrder: requestType = (data) => {
    return request({
        url: '/tms/tmsDispatchOrder/loadingOrder',
@@ -267,7 +269,6 @@
        data
    })
}
/**
 * 导出调度单管理
ui/admin-ui3/src/views/tms/tmsApBill/index.vue
@@ -32,6 +32,10 @@
        <el-link size="small" type="primary" v-if="row.pushStatus == 3 || row.pushStatus == 4|| row.pushStatus == 0"
          @click="handleManualPush(row)" class="link-btn" underline="never" icon="el-icon-upload">手动推送
        </el-link>
           <el-link size="small" type="primary" v-if="[0, 2].includes(row.status)" @click="handleClose(row)"
            class="link-btn" v-hasPermi="['tms:tmsApBill:closeOrder']" underline="never" icon="el-icon-close">
            作废
          </el-link>
        <el-link size="small" type="primary" v-if="row.status == 0" @click="handleEdit(row)" class="link-btn"
          :underline="false" icon="el-icon-edit">账单确认
        </el-link>
@@ -132,7 +136,7 @@
  exportTmsApBill,
  getTmsApBill,
  listTmsApBill,
  updateTmsApBill, manualPushTmsApBill,getPayableAuditLog
  updateTmsApBill, manualPushTmsApBill,getPayableAuditLog,tmsApBillCancelPush
} from "@/api/tms/tmsApBill";
import useCurrentInstance from "@/utils/useCurrentInstance";
import { computed, reactive, ref, toRefs } from "vue";
@@ -470,4 +474,21 @@
  })
}
const handleClose = (row: any) => {
  ElMessageBox.confirm("是否对应付账单" + row.systemNo + "进行作废?", '系统提示', {
    confirmButtonText: '确定',
    cancelButtonText: '取消',
    type: 'warning'
  }).then(() => {
    return tmsApBillCancelPush(row.id);
  }).then(() => {
    onLoad(page.value);
    ElMessage({
      message: "操作成功!",
      type: 'success'
    })
  });
}
</script>
ui/admin-ui3/src/views/tms/tmsArBill/index.vue
@@ -47,6 +47,10 @@
        <el-link size="small" type="primary" @click="handleEdit(row)" class="link-btn" underline="never"
          icon="el-icon-edit">修改
        </el-link>
           <el-link size="small" type="primary" v-if="[0, 2].includes(row.status)" @click="handleClose(row)"
            class="link-btn" v-hasPermi="['tms:tmsArBill:closeOrder']" underline="never" icon="el-icon-close">
            作废
          </el-link>
        <el-link size="small" type="primary" @click="handleLog(row)" class="link-btn" underline="never"
          icon="el-icon-tickets">日志
        </el-link>
@@ -144,7 +148,7 @@
  getTmsArBill,
  listTmsArBill,
  updateTmsArBill, cancelArBill,
  exportArBillFormat,manualPushTmsArBill,listReceivableAuditLog
  exportArBillFormat,manualPushTmsArBill,listReceivableAuditLog,tmsArBillCancelPush
} from "@/api/tms/tmsArBill";
import useCurrentInstance from "@/utils/useCurrentInstance";
import { computed, reactive, ref, toRefs } from "vue";
@@ -535,5 +539,19 @@
  })
}
const handleClose = (row: any) => {
  ElMessageBox.confirm("是否对应收账单" + row.systemNo + "进行作废?", '系统提示', {
    confirmButtonText: '确定',
    cancelButtonText: '取消',
    type: 'warning'
  }).then(() => {
    return tmsArBillCancelPush(row.id);
  }).then(() => {
    onLoad(page.value);
    ElMessage({
      message: "操作成功!",
      type: 'success'
    })
  });
}
</script>
ui/admin-ui3/src/views/tms/tmsDispatchOrder/index.vue
@@ -23,7 +23,8 @@
          <span>{{ dictFormat(order_type, row?.orderType || form?.orderType) }}</span>
        </template>
        <template v-else>
          <el-select v-model="form.orderType" placeholder="请选择订单类型"  @change="(val) => handleOrderTypeChange(val)" style="width: 100%" clearable>
          <el-select v-model="form.orderType" placeholder="请选择订单类型" @change="(val) => handleOrderTypeChange(val)"
            style="width: 100%" clearable>
            <el-option v-for="item in order_type" :key="item.value" :label="item.label" :value="parseInt(item.value)" />
          </el-select>
        </template>
@@ -78,11 +79,10 @@
        <el-button type="primary" icon="Male" :disabled="pageF.single" @click="handleConnectHang"
          v-hasPermi="['tms:tmsDispatchOrder:connectHang']">接挂
        </el-button>
        <el-button type="warning" icon="Avatar" :disabled="!(isCustoms == 0)" @click="handleCustoms"
        <el-button type="warning" icon="Avatar" :disabled="selectionList.length === 0" @click="handleCustoms"
          v-hasPermi="['tms:tmsDispatchOrder:customs']">委托报关信息
        </el-button>
        <el-button type="primary" icon="UserFilled" :disabled="!(isLoad == 0)" @click="handleLoading"
        <el-button type="primary" icon="UserFilled" :disabled="selectionList.length === 0" @click="handleLoading"
          v-hasPermi="['tms:tmsDispatchOrder:loading']">委托卸货信息
        </el-button>
        <el-button type="primary" icon="UserFilled" :disabled="pageF.single" @click="handleZZ"
@@ -299,26 +299,40 @@
      </div>
      <div v-if="optionType == 'customs'">
        <el-descriptions style="margin-bottom: 20px" :column="2" border>
        <el-descriptions v-if="optionNum == 'radio'" style="margin-bottom: 20px" :column="2" border>
          <el-descriptions-item label="调度单号">{{ form.dispatchNo }}</el-descriptions-item>
          <el-descriptions-item label="客户">{{ form.customerName }}</el-descriptions-item>
          <el-descriptions-item label="项目名称">{{ form.projectName }}</el-descriptions-item>
          <el-descriptions-item label="运输路线">{{ form.transportLine }}</el-descriptions-item>
        </el-descriptions>
        <el-table v-if="optionNum == 'checkbox'" :data="clearanceList" border size="small"
          style="width: 100%; margin-bottom: 20px">
          <el-table-column prop="dispatchNo" label="调度单号" width="150" />
          <el-table-column prop="customerName" label="客户" min-width="120" show-overflow-tooltip />
          <el-table-column prop="projectName" label="项目名称" min-width="120" show-overflow-tooltip />
          <el-table-column prop="transportLine" label="运输路线" min-width="150" show-overflow-tooltip />
        </el-table>
        <avue-form v-model="form" ref="boxFormRef" :option="boxFormOption">
        </avue-form>
      </div>
      <div v-if="optionType == 'loading'">
        <el-descriptions style="margin-bottom: 20px" :column="2" border>
            <el-descriptions v-if="optionNum == 'radio'" style="margin-bottom: 20px" :column="2" border>
          <el-descriptions-item label="调度单号">{{ form.dispatchNo }}</el-descriptions-item>
          <el-descriptions-item label="客户">{{ form.customerName }}</el-descriptions-item>
          <el-descriptions-item label="项目名称">{{ form.projectName }}</el-descriptions-item>
          <el-descriptions-item label="运输路线">{{ form.transportLine }}</el-descriptions-item>
        </el-descriptions>
        <el-table v-if="optionNum == 'checkbox'" :data="clearanceList" border size="small"
          style="width: 100%; margin-bottom: 20px">
          <el-table-column prop="dispatchNo" label="调度单号" width="150" />
          <el-table-column prop="customerName" label="客户" min-width="120" show-overflow-tooltip />
          <el-table-column prop="projectName" label="项目名称" min-width="120" show-overflow-tooltip />
          <el-table-column prop="transportLine" label="运输路线" min-width="150" show-overflow-tooltip />
        </el-table>
        <avue-form v-model="form" ref="boxFormRef" :option="boxFormOption">
        </avue-form>
      </div>
      <template #footer>
@@ -665,7 +679,7 @@
  importTemplateTmsDispatchOrder, ypdddjSumbit,
  tmsTmsDispatchOrderImportLog,
  saveTmsFinanceDetail2,
  getLastLicensePlate
  getLastLicensePlate,
} from "@/api/tms/tmsDispatchOrder";
import useCurrentInstance from "@/utils/useCurrentInstance";
import { computed, onMounted, onBeforeUnmount, reactive, ref, toRefs, watch, getCurrentInstance, nextTick } from "vue";
@@ -3199,9 +3213,9 @@
  }
});
const zzItemsTableData = ref();
/* 报关列表 */
const clearanceList = ref([]);
const optionNum = ref(''); // 用于区分是报关还是装卸
const {
  tableData,
@@ -3237,6 +3251,7 @@
  },
  handleSelectionChangeFunc: (selection: any) => {
    selectionList.value = selection;
    clearanceList.value = selection;
    if (selection.length > 0) {
      isCustoms.value = selection[0].isCustoms;
      isLoad.value = selection[0].isLoad;
@@ -3538,11 +3553,24 @@
      pageF.isUploading = false;
    })
  } else if (optionType.value === 'customs') {
    customsOrder({
      id: form.value.id,
      customsServiceProviderId: form.value.customsServiceProviderId,
      customsServiceProviderName: form.value.customsServiceProviderName,
    }).then(res => {
    let result = <any>[];
    if (optionNum.value == 'checkbox') {
      result = clearanceList.value.map(item => {
        return {
          id: item.id,
          customsServiceProviderId: form.value.customsServiceProviderId,
          customsServiceProviderName: form.value.customsServiceProviderName
        };
      });
    }else if (optionNum.value == 'radio') {
      result = [{
        id: form.value.id,
        customsServiceProviderId: form.value.customsServiceProviderId,
        customsServiceProviderName: form.value.customsServiceProviderName
      }]
    }
    customsOrder(result).then(res => {
      ElMessage({
        message: "提交成功!",
        type: 'success'
@@ -3553,11 +3581,25 @@
      pageF.isUploading = false;
    })
  } else if (optionType.value === 'loading') {
    loadingOrder({
      id: form.value.id,
      loadingServiceProviderId: form.value.loadingServiceProviderId,
      loadingServiceProviderName: form.value.loadingServiceProviderName,
    }).then(res => {
       let result = <any>[];
    if (optionNum.value == 'checkbox') {
      result = clearanceList.value.map(item => {
        return {
          id: item.id,
          loadingServiceProviderId: form.value.loadingServiceProviderId,
          loadingServiceProviderName: form.value.loadingServiceProviderName
        };
      });
    }else if (optionNum.value == 'radio') {
      result = [{
        id: form.value.id,
        loadingServiceProviderId: form.value.loadingServiceProviderId,
        loadingServiceProviderName: form.value.loadingServiceProviderName
      }]
    }
    loadingOrder(result).then(res => {
      ElMessage({
        message: "提交成功!",
        type: 'success'
@@ -4194,17 +4236,32 @@
const handleCustoms = () => {
  title.value = '补充委托报关信息';
  open.value = true;
  form.value = selectionList.value[0];
  form.value = clearanceList.value[0];
  optionType.value = 'customs';
  optionNum.value = 'checkbox'
  boxFormOption.value = customsOption.value;
}
const handleCustomsAdd = (selectionList) => {
const handleCustomsAdd = (row) => {
  title.value = '补充委托装卸信息';
   clearanceList.value = [];
  // 2. 清除表格视觉上的选中状态
  if (crudRef.value) {
    crudRef.value.clearSelection();
  }
  // 3. 重置表单
  form.value = {};
  // 4. 将当前点击的行数据赋值给 form,用于弹窗编辑
  Object.assign(form.value, row);
  open.value = true;
  form.value = selectionList;
  optionType.value = 'loading';
  optionNum.value = 'radio';
  boxFormOption.value = loadingOption.value;
}
const handleLoading = () => {
@@ -4212,14 +4269,33 @@
  open.value = true;
  form.value = selectionList.value[0];
  optionType.value = 'loading';
  optionNum.value = 'checkbox'
  boxFormOption.value = loadingOption.value;
}
const handleLoadingAdd = (selectionList) => {
  title.value = '补充委托装卸信息';
const handleLoadingAdd = (row: any) => {
  // 1. 清空批量选中的数据列表,导致顶部按钮 disabled (length === 0)
  clearanceList.value = [];
  // 2. 清除表格视觉上的选中状态
  if (crudRef.value) {
    crudRef.value.clearSelection();
  }
  // 3. 重置表单
  form.value = {};
  // 4. 将当前点击的行数据赋值给 form,用于弹窗编辑
  Object.assign(form.value, row);
  // 5. 设置弹窗配置
  title.value = '补充委托报关信息';
  optionType.value = 'customs';
  optionNum.value = 'radio';
  boxFormOption.value = customsOption.value;
  // 6. 打开弹窗
  open.value = true;
  form.value = selectionList;
  optionType.value = 'loading';
  boxFormOption.value = loadingOption.value;
  // 【调试】此时打印,长度应为 0
}
const quotationItems = ref();
const getQuotationItems = async () => {
@@ -4959,7 +5035,7 @@
const handleOrderTypeChange = (value: any) => {
  // 防止 value 为 null 或 undefined 时出错 (当清空选择时)
  if (value === null || value === undefined) {
     return;
    return;
  }
  option.value.group.forEach((item: any) => {
@@ -4970,7 +5046,7 @@
          cItem.required = !(value == 1);
        });
      }
      // 处理卸货点必填规则
      if (item.column.receiverId && item.column.receiverId.rules) {
        item.column.receiverId.rules.forEach((cItem: any) => {