2a83e96652851ca20794278b9be3607bbe4186fa..3974fad5d836431e417e99220cc07bb5b0aba331
5 天以前 zhangback
提交
3974fa 对比 | 目录
5 天以前 zhangback
提交
90c4fb 对比 | 目录
9个文件已添加
18个文件已修改
1137 ■■■■■ 已修改文件
admin/config/prod/application-custom.yml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/config/test/application-custom.yml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/main/resources/application-custom.yml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/main/resources/application.yml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
framework/pom.xml 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
framework/src/main/java/com/ruoyi/framework/config/RabbitMqConfig.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tms/pom.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tms/src/main/java/com/ruoyi/tms/config/TmsRabbitConfig.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tms/src/main/java/com/ruoyi/tms/consumer/CarKeyExpireConsumer.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tms/src/main/java/com/ruoyi/tms/controller/TmsCarKeyDispatchController.java 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tms/src/main/java/com/ruoyi/tms/domain/TmsCarKeyDispatch.java 140 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tms/src/main/java/com/ruoyi/tms/domain/TmsContainer.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tms/src/main/java/com/ruoyi/tms/domain/TmsShelf.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tms/src/main/java/com/ruoyi/tms/mapper/TmsCarKeyDispatchMapper.java 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tms/src/main/java/com/ruoyi/tms/service/ITmsCarKeyDispatchService.java 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tms/src/main/java/com/ruoyi/tms/service/impl/TmsCarKeyDispatchServiceImpl.java 182 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tms/src/main/java/com/ruoyi/tms/service/impl/TmsTripServiceImpl.java 67 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tms/src/main/resources/mapper/tms/TmsCarKeyDispatchMapper.xml 169 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tms/src/main/resources/mapper/tms/TmsContainerMapper.xml 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tms/src/main/resources/mapper/tms/TmsShelfMapper.xml 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ui/admin-ui3/.env.development 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ui/admin-ui3/package.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ui/admin-ui3/src/assets/styles/element-ui.scss 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ui/admin-ui3/src/main.ts 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ui/admin-ui3/src/views/tms/tmsContainer/index.vue 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ui/admin-ui3/src/views/tms/tmsDispatchOrder/index.vue 53 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ui/admin-ui3/src/views/tms/tmsShelf/index.vue 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/config/prod/application-custom.yml
@@ -1,4 +1,11 @@
custom:
  rabbitmq:
    # 集群地址,用逗号分隔
    host: 172.16.24.14
    port: 5672
    virtual-host: GF_HOST
    username: admin
    password:
  serialNumber:
    cache:
      enabled: true
admin/config/test/application-custom.yml
@@ -1,4 +1,11 @@
custom:
  rabbitmq:
    # 集群地址,用逗号分隔
    host: 61.143.42.70
    port: 7008
    virtual-host: GF_HOST_TEST
    username: user_test
    password: testuser_&
  serialNumber:
    cache:
      enabled: true
admin/src/main/resources/application-custom.yml
@@ -57,6 +57,13 @@
        login-password: admin123
    filter:
      log-slow-sql: true  # 慢SQL记录
  rabbitmq:
    # 集群地址,用逗号分隔
    host: 192.168.1.100
    port: 5672
    virtual-host: ccyf_dev
    username: admin
    password: admin@123
  #redis 相关配置
  redis:
    host: localhost #访问地址
admin/src/main/resources/application.yml
@@ -50,6 +50,14 @@
# Spring配置
spring:
  rabbitmq:
    # 集群地址,用逗号分隔
    host: ${custom.rabbitmq.host}
    port: ${custom.rabbitmq.port}
    virtual-host: ${custom.rabbitmq.virtual-host}
    username: ${custom.rabbitmq.username}
    password: ${custom.rabbitmq.password}
    connection-timeout: 15000
  # 资源信息
  messages:
    # 国际化资源文件路径
framework/pom.xml
@@ -46,7 +46,10 @@
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-amqp</artifactId>
        </dependency>
        <!-- 获取系统信息 -->
        <dependency>
            <groupId>com.github.oshi</groupId>
framework/src/main/java/com/ruoyi/framework/config/RabbitMqConfig.java
New file
@@ -0,0 +1,15 @@
package com.ruoyi.framework.config;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class RabbitMqConfig {
    @Bean
    public RabbitTemplate rabbitTemplate( ConnectionFactory connectionFactory){
        return new RabbitTemplate(connectionFactory);
    }
}
tms/pom.xml
@@ -25,6 +25,14 @@
            <groupId>com.ruoyi</groupId>
            <artifactId>system</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.amqp</groupId>
            <artifactId>spring-amqp</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.amqp</groupId>
            <artifactId>spring-rabbit</artifactId>
        </dependency>
    </dependencies>
</project>
tms/src/main/java/com/ruoyi/tms/config/TmsRabbitConfig.java
New file
@@ -0,0 +1,50 @@
package com.ruoyi.tms.config;
import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class TmsRabbitConfig {
    // 延迟队列交换机
    @Bean
    public DirectExchange delayExchange() {
        return new DirectExchange("car_key_delay_exchange");
    }
    // 死信队列交换机
    @Bean
    public DirectExchange deadExchange() {
        return new DirectExchange("car_key_dead_exchange");
    }
    // 延迟队列
    @Bean
    public Queue delayQueue() {
        return QueueBuilder.durable("car_key_delay_queue")
                .withArgument("x-dead-letter-exchange", "car_key_dead_exchange")
                .withArgument("x-dead-letter-routing-key", "car_key_dead_routing_key")
                .build();
    }
    // 死信队列(实际消费队列)
    @Bean
    public Queue deadQueue() {
        return QueueBuilder.durable("car_key_dead_queue").build();
    }
    // 延迟队列绑定
    @Bean
    public Binding delayBinding() {
        return BindingBuilder.bind(delayQueue()).to(delayExchange()).with("car_key_delay");
    }
    // 死信队列绑定
    @Bean
    public Binding deadBinding() {
        return BindingBuilder.bind(deadQueue()).to(deadExchange()).with("car_key_dead_routing_key");
    }
}
tms/src/main/java/com/ruoyi/tms/consumer/CarKeyExpireConsumer.java
New file
@@ -0,0 +1,31 @@
package com.ruoyi.tms.consumer;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.ruoyi.tms.domain.TmsCarKeyDispatch;
import com.ruoyi.tms.mapper.TmsCarKeyDispatchMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@Slf4j
@Component
public class CarKeyExpireConsumer {
    @Resource
    private TmsCarKeyDispatchMapper tmsCarKeyDispatchMapper;
    @RabbitListener(queues = "car_key_dead_queue")
    public void handle(Integer carKeyId) {
        TmsCarKeyDispatch tmsCarKeyDispatch = tmsCarKeyDispatchMapper.selectTmsCarKeyDispatchById(carKeyId);
        if (tmsCarKeyDispatch != null && tmsCarKeyDispatch.getStatus() == 0){
            log.info("超时领取钥匙:{}", carKeyId);
            tmsCarKeyDispatchMapper.update(new LambdaUpdateWrapper<TmsCarKeyDispatch>()
                    .eq(TmsCarKeyDispatch::getId, carKeyId)
                    .set(TmsCarKeyDispatch::getStatus, 2)
            );
        }
    }
}
tms/src/main/java/com/ruoyi/tms/controller/TmsCarKeyDispatchController.java
New file
@@ -0,0 +1,108 @@
package com.ruoyi.tms.controller;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.utils.file.DownloadExportUtil;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.tms.domain.TmsCarKeyDispatch;
import com.ruoyi.tms.service.ITmsCarKeyDispatchService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
 * 车钥匙分发记录Controller
 *
 * @author ruoyi
 * @date 2025-12-08
 */
@RestController
@RequestMapping("/tms/tmsCarKeyDispatch")
public class TmsCarKeyDispatchController extends BaseController
{
    @Autowired
    private ITmsCarKeyDispatchService tmsCarKeyDispatchService;
    /**
     * 查询车钥匙分发记录列表
     */
    @PreAuthorize("@ss.hasPermi('tms:tmsCarKeyDispatch:list')")
    @GetMapping("/list")
    public TableDataInfo list(TmsCarKeyDispatch tmsCarKeyDispatch)
    {
        startPage();
        List<TmsCarKeyDispatch> list = tmsCarKeyDispatchService.selectTmsCarKeyDispatchList(tmsCarKeyDispatch);
        return getDataTable(list);
    }
    /**
     * 导出车钥匙分发记录列表
     * @param tmsCarKeyDispatch 查询条件对象
     */
    @PreAuthorize("@ss.hasPermi('tms:tmsCarKeyDispatch:export')")
    @Log(title = "车钥匙分发记录", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(TmsCarKeyDispatch tmsCarKeyDispatch,String exportKey)
    {
        tmsCarKeyDispatchService.export(tmsCarKeyDispatch,exportKey);
        return AjaxResult.success("导出请求成功,请稍后点击下载...!");
    }
    /**
     * 获取车钥匙分发记录详细信息
     */
    @PreAuthorize("@ss.hasPermi('tms:tmsCarKeyDispatch:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Integer id)
    {
        return AjaxResult.success(tmsCarKeyDispatchService.selectTmsCarKeyDispatchById(id));
    }
    /**
     * 新增车钥匙分发记录
     */
    @PreAuthorize("@ss.hasPermi('tms:tmsCarKeyDispatch:add')")
    @Log(title = "车钥匙分发记录", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody TmsCarKeyDispatch tmsCarKeyDispatch)
    {
        return toAjax(tmsCarKeyDispatchService.insertTmsCarKeyDispatch(tmsCarKeyDispatch));
    }
    /**
     * 修改车钥匙分发记录
     */
    @PreAuthorize("@ss.hasPermi('tms:tmsCarKeyDispatch:edit')")
    @Log(title = "车钥匙分发记录", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody TmsCarKeyDispatch tmsCarKeyDispatch)
    {
        return toAjax(tmsCarKeyDispatchService.updateTmsCarKeyDispatch(tmsCarKeyDispatch));
    }
    /**
     * 删除车钥匙分发记录
     */
    @PreAuthorize("@ss.hasPermi('tms:tmsCarKeyDispatch:remove')")
    @Log(title = "车钥匙分发记录", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Integer[] ids)
    {
        return toAjax(tmsCarKeyDispatchService.deleteTmsCarKeyDispatchByIds(ids));
    }
}
tms/src/main/java/com/ruoyi/tms/domain/TmsCarKeyDispatch.java
New file
@@ -0,0 +1,140 @@
package com.ruoyi.tms.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.util.Date;
import lombok.Data;
/**
 * 车钥匙分发记录对象 tms_car_key_dispatch
 *
 * @author ruoyi
 * @date 2025-12-08
 */
@Data
public class TmsCarKeyDispatch {
    /**
     * id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 调度单ID
     */
    @Excel(name = "调度单ID")
    @TableField("dispatch_order_id")
    private Integer dispatchOrderId;
    /**
     * 调度单号
     */
    @Excel(name = "调度单号")
    @TableField("dispatch_order_no")
    private String dispatchOrderNo;
    /**
     * 司机id
     */
    @Excel(name = "司机id")
    @TableField("driver_id")
    private Integer driverId;
    /**
     * 司机手机号
     */
    @Excel(name = "司机手机号")
    @TableField("driver_mobile")
    private String driverMobile;
    /**
     * 司机名称
     */
    @Excel(name = "司机名称")
    @TableField("driver_name")
    private String driverName;
    /**
     * 车辆id
     */
    @Excel(name = "车辆id")
    @TableField("vehicle_id")
    private Integer vehicleId;
    /**
     * 车牌号
     */
    @Excel(name = "车牌号")
    @TableField("vehicle_license_plate")
    private String vehicleLicensePlate;
    /**
     * 车钥匙柜号
     */
    @Excel(name = "车钥匙柜号")
    @TableField("vehicle_car_key_no")
    private String vehicleCarKeyNo;
    /**
     * 领钥匙截止时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "领钥匙截止时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @TableField("car_key_expiration_time")
    private Date carKeyExpirationTime;
    /**
     * 钥匙领取时间
     */
    @Excel(name = "钥匙领取时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("car_key_collection _time")
    private Date carKeyCollectionTime;
    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("create_time")
    private Date createTime;
    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("update_time")
    private Date updateTime;
    /**
     * 状态(0:待领取;1:已领取;2:已逾期;)
     */
    @Excel(name = "状态(0:待领取;1:已领取;2:已逾期;)")
    @TableField("status")
    private Integer status;
}
tms/src/main/java/com/ruoyi/tms/domain/TmsContainer.java
@@ -38,7 +38,11 @@
    @Excel(name = "系统编号")
    @TableField("system_code")
    private String systemCode;
    /**
     * 自营类型
     */
    @TableField("self_leas_type")
    private Integer selfLeasType;
    /**
     * 集装箱号
tms/src/main/java/com/ruoyi/tms/domain/TmsShelf.java
@@ -47,6 +47,11 @@
    @TableField("shelf_code")
    private String shelfCode;
    /**
     * 自营类型
     */
    @TableField("self_leas_type")
    private Integer selfLeasType;
    /**
     * 托架类型
tms/src/main/java/com/ruoyi/tms/mapper/TmsCarKeyDispatchMapper.java
New file
@@ -0,0 +1,87 @@
package com.ruoyi.tms.mapper;
import java.util.List;
import com.ruoyi.tms.domain.TmsCarKeyDispatch;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
 * 车钥匙分发记录Mapper接口
 *
 * @author ruoyi
 * @date 2025-12-08
 */
public interface TmsCarKeyDispatchMapper  extends BaseMapper<TmsCarKeyDispatch>
{
    /**
     * 查询车钥匙分发记录
     *
     * @param id 车钥匙分发记录ID
     * @return 车钥匙分发记录
     */
    public TmsCarKeyDispatch selectTmsCarKeyDispatchById(Integer id);
    /**
     * 查询车钥匙分发记录 记录数
     *
     * @param tmsCarKeyDispatch 车钥匙分发记录
     * @return 车钥匙分发记录集合
     */
    public int selectTmsCarKeyDispatchCount(TmsCarKeyDispatch tmsCarKeyDispatch);
    /**
     * 查询车钥匙分发记录列表
     *
     * @param tmsCarKeyDispatch 车钥匙分发记录
     * @return 车钥匙分发记录集合
     */
    public List<TmsCarKeyDispatch> selectTmsCarKeyDispatchList(TmsCarKeyDispatch tmsCarKeyDispatch);
    /**
     * 新增车钥匙分发记录
     *
     * @param tmsCarKeyDispatch 车钥匙分发记录
     * @return 结果
     */
    public int insertTmsCarKeyDispatch(TmsCarKeyDispatch tmsCarKeyDispatch);
    /**
     * 新增车钥匙分发记录[批量]
     *
     * @param tmsCarKeyDispatchs 车钥匙分发记录
     * @return 结果
     */
    public int insertTmsCarKeyDispatchBatch(List<TmsCarKeyDispatch> tmsCarKeyDispatchs);
    /**
     * 修改车钥匙分发记录
     *
     * @param tmsCarKeyDispatch 车钥匙分发记录
     * @return 结果
     */
    public int updateTmsCarKeyDispatch(TmsCarKeyDispatch tmsCarKeyDispatch);
    /**
     * 修改车钥匙分发记录[批量]
     *
     * @param tmsCarKeyDispatchs 车钥匙分发记录
     * @return 结果
     */
    public int updateTmsCarKeyDispatchBatch(List<TmsCarKeyDispatch> tmsCarKeyDispatchs);
    /**
     * 删除车钥匙分发记录
     *
     * @param id 车钥匙分发记录ID
     * @return 结果
     */
    public int deleteTmsCarKeyDispatchById(Integer id);
    /**
     * 批量删除车钥匙分发记录
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteTmsCarKeyDispatchByIds(Integer[] ids);
}
tms/src/main/java/com/ruoyi/tms/service/ITmsCarKeyDispatchService.java
New file
@@ -0,0 +1,102 @@
package com.ruoyi.tms.service;
import java.util.List;
import com.ruoyi.tms.domain.TmsCarKeyDispatch;
import com.baomidou.mybatisplus.extension.service.IService;
/**
 * 车钥匙分发记录Service接口
 *
 * @author ruoyi
 * @date 2025-12-08
 */
public interface ITmsCarKeyDispatchService extends IService<TmsCarKeyDispatch>
{
    /**
     * 查询车钥匙分发记录
     *
     * @param id 车钥匙分发记录ID
     * @return 车钥匙分发记录
     */
    public TmsCarKeyDispatch selectTmsCarKeyDispatchById(Integer id);
    /**
     * 查询车钥匙分发记录 记录数
     *
     * @param tmsCarKeyDispatch 车钥匙分发记录
     * @return 车钥匙分发记录集合
     */
    public int selectTmsCarKeyDispatchCount(TmsCarKeyDispatch tmsCarKeyDispatch);
    /**
     * 查询车钥匙分发记录列表
     *
     * @param tmsCarKeyDispatch 车钥匙分发记录
     * @return 车钥匙分发记录集合
     */
    public List<TmsCarKeyDispatch> selectTmsCarKeyDispatchList(TmsCarKeyDispatch tmsCarKeyDispatch);
    /**
     * 查询车钥匙分发记录列表 异步 导出
     *
     * @param tmsCarKeyDispatch 车钥匙分发记录
     * @param exportKey 导出功能的唯一标识
     * @return 车钥匙分发记录集合
     */
    public void export(TmsCarKeyDispatch tmsCarKeyDispatch, String exportKey) ;
    /**
     * 新增车钥匙分发记录
     *
     * @param tmsCarKeyDispatch 车钥匙分发记录
     * @return 结果
     */
    public int insertTmsCarKeyDispatch(TmsCarKeyDispatch tmsCarKeyDispatch);
    /**
     * 新增车钥匙分发记录[批量]
     *
     * @param tmsCarKeyDispatchs 车钥匙分发记录
     * @return 结果
     */
    public int insertTmsCarKeyDispatchBatch(List<TmsCarKeyDispatch> tmsCarKeyDispatchs);
    /**
     * 修改车钥匙分发记录
     *
     * @param tmsCarKeyDispatch 车钥匙分发记录
     * @return 结果
     */
    public int updateTmsCarKeyDispatch(TmsCarKeyDispatch tmsCarKeyDispatch);
    /**
     * 修改车钥匙分发记录[批量]
     *
     * @param tmsCarKeyDispatchs 车钥匙分发记录
     * @return 结果
     */
    public int updateTmsCarKeyDispatchBatch(List<TmsCarKeyDispatch> tmsCarKeyDispatchs);
    /**
     * 批量删除车钥匙分发记录
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteTmsCarKeyDispatchByIds(String ids);
    /**
     * 批量删除车钥匙分发记录
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteTmsCarKeyDispatchByIds(Integer[] ids);
    /**
     * 删除车钥匙分发记录信息
     *
     * @param id 车钥匙分发记录ID
     * @return 结果
     */
    public int deleteTmsCarKeyDispatchById(Integer id);
}
tms/src/main/java/com/ruoyi/tms/service/impl/TmsCarKeyDispatchServiceImpl.java
New file
@@ -0,0 +1,182 @@
package com.ruoyi.tms.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import javax.annotation.Resource;
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;
import com.ruoyi.common.core.service.BaseService;
import com.ruoyi.tms.mapper.TmsCarKeyDispatchMapper;
import com.ruoyi.tms.domain.TmsCarKeyDispatch;
import com.ruoyi.tms.service.ITmsCarKeyDispatchService;
import com.ruoyi.common.core.text.Convert;
/**
 * 车钥匙分发记录Service业务层处理
 *
 * @author ruoyi
 * @date 2025-12-08
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class TmsCarKeyDispatchServiceImpl  extends BaseService<TmsCarKeyDispatchMapper, TmsCarKeyDispatch> implements ITmsCarKeyDispatchService
{
    protected final Logger logger = LoggerFactory.getLogger(getClass());
    @Resource
    private TmsCarKeyDispatchMapper tmsCarKeyDispatchMapper;
    /**
     * 查询车钥匙分发记录
     *
     * @param id 车钥匙分发记录ID
     * @return 车钥匙分发记录
     */
    @DataSource(DataSourceType.SLAVE)
    @Override
    public TmsCarKeyDispatch selectTmsCarKeyDispatchById(Integer id)
    {
        return tmsCarKeyDispatchMapper.selectTmsCarKeyDispatchById(id);
    }
    /**
     * 查询车钥匙分发记录 记录数
     *
     * @param tmsCarKeyDispatch 车钥匙分发记录
     * @return 车钥匙分发记录集合
     */
    @DataSource(DataSourceType.SLAVE)
    @Override
    public int selectTmsCarKeyDispatchCount(TmsCarKeyDispatch tmsCarKeyDispatch)
    {
        return tmsCarKeyDispatchMapper.selectTmsCarKeyDispatchCount(tmsCarKeyDispatch);
    }
    /**
     * 查询车钥匙分发记录列表
     *
     * @param tmsCarKeyDispatch 车钥匙分发记录
     * @return 车钥匙分发记录
     */
    @DataSource(DataSourceType.SLAVE)
    @Override
    public List<TmsCarKeyDispatch> selectTmsCarKeyDispatchList(TmsCarKeyDispatch tmsCarKeyDispatch)
    {
        return tmsCarKeyDispatchMapper.selectTmsCarKeyDispatchList(tmsCarKeyDispatch);
    }
    /**
     * 查询车钥匙分发记录列表 异步 导出
     *
     * @param tmsCarKeyDispatch 车钥匙分发记录
     * @param exportKey 导出功能的唯一标识
     * @return 车钥匙分发记录集合
     */
    @DataSource(DataSourceType.SLAVE)
    @Async
    @Override
    public void export(TmsCarKeyDispatch tmsCarKeyDispatch,String exportKey) {
        super.export(TmsCarKeyDispatch.class,exportKey,"tmsCarKeyDispatchData",(pageNum)->{
            PageUtils.startPage(pageNum, Constants.EXPORT_PATE_SIZE);
            return selectTmsCarKeyDispatchList(tmsCarKeyDispatch);
        });
    }
    /**
     * 新增车钥匙分发记录
     *
     * @param tmsCarKeyDispatch 车钥匙分发记录
     * @return 结果
     */
    @Override
    public int insertTmsCarKeyDispatch(TmsCarKeyDispatch tmsCarKeyDispatch)
    {
        tmsCarKeyDispatch.setCreateTime(DateUtils.getNowDate());
        return tmsCarKeyDispatchMapper.insertTmsCarKeyDispatch(tmsCarKeyDispatch);
    }
    /**
     * 新增车钥匙分发记录[批量]
     *
     * @param tmsCarKeyDispatchs 车钥匙分发记录
     * @return 结果
     */
    @Override
    public int insertTmsCarKeyDispatchBatch(List<TmsCarKeyDispatch> tmsCarKeyDispatchs)
    {
        int rows = tmsCarKeyDispatchMapper.insertTmsCarKeyDispatchBatch(tmsCarKeyDispatchs);
        return rows;
    }
    /**
     * 修改车钥匙分发记录
     *
     * @param tmsCarKeyDispatch 车钥匙分发记录
     * @return 结果
     */
    @Override
    public int updateTmsCarKeyDispatch(TmsCarKeyDispatch tmsCarKeyDispatch)
    {
        tmsCarKeyDispatch.setUpdateTime(DateUtils.getNowDate());
        return tmsCarKeyDispatchMapper.updateTmsCarKeyDispatch(tmsCarKeyDispatch);
    }
    /**
     * 修改车钥匙分发记录[批量]
     *
     * @param tmsCarKeyDispatchs 车钥匙分发记录
     * @return 结果
     */
    @Override
    public int updateTmsCarKeyDispatchBatch(List<TmsCarKeyDispatch> tmsCarKeyDispatchs){
        return tmsCarKeyDispatchMapper.updateTmsCarKeyDispatchBatch(tmsCarKeyDispatchs);
    }
    /**
     * 删除车钥匙分发记录对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTmsCarKeyDispatchByIds(String ids)
    {
        return deleteTmsCarKeyDispatchByIds(Convert.toIntArray(ids));
    }
    /**
     * 删除车钥匙分发记录对象
     *
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTmsCarKeyDispatchByIds(Integer[] ids)
    {
        return tmsCarKeyDispatchMapper.deleteTmsCarKeyDispatchByIds(ids);
    }
    /**
     * 删除车钥匙分发记录信息
     *
     * @param id 车钥匙分发记录ID
     * @return 结果
     */
    @Override
    public int deleteTmsCarKeyDispatchById(Integer id)
    {
        return tmsCarKeyDispatchMapper.deleteTmsCarKeyDispatchById(id);
    }
}
tms/src/main/java/com/ruoyi/tms/service/impl/TmsTripServiceImpl.java
@@ -1,10 +1,9 @@
package com.ruoyi.tms.service.impl;
import java.io.File;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.*;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
@@ -18,11 +17,10 @@
import com.ruoyi.common.utils.uuid.Seq;
import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.tms.domain.*;
import com.ruoyi.tms.mapper.TmsDispatchOrderMapper;
import com.ruoyi.tms.mapper.TmsDriverDispatchMapper;
import com.ruoyi.tms.mapper.TmsDriverMapper;
import com.ruoyi.tms.mapper.*;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
@@ -35,7 +33,6 @@
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.core.service.BaseService;
import com.ruoyi.tms.mapper.TmsTripMapper;
import com.ruoyi.tms.service.ITmsTripService;
import com.ruoyi.common.core.text.Convert;
@@ -65,6 +62,10 @@
    private TmsDriverMapper tmsDriverMapper;
    @Autowired
    private TmsVehicleServiceImpl tmsVehicleServiceImpl;
    @Resource
    private TmsCarKeyDispatchMapper tmsCarKeyDispatchMapper;
    @Autowired
    private RabbitTemplate rabbitTemplate;
    @Autowired
    private AsyncPdfService asyncPdfService;
@@ -160,6 +161,7 @@
            throw new RuntimeException("未找到司机数据");
        }
        tmsDispatchOrder.setStatus(2);
        tmsDispatchOrderMapper.updateTmsDispatchOrder(tmsDispatchOrder);
        tmsTrip.setDriverName(tmsDispatchOrder.getMainDriverName());
@@ -171,8 +173,55 @@
        if (StringUtils.isNotEmpty(tmsTrip.getSignImg())){
            asyncPdfService.generateTripPdfAsync(tmsTrip,tmsDispatchOrder,tmsDriver);
        }
        // 完成身体检查
        if (tmsTrip.getTripType() == 1){
            // 添加 领钥匙 指令记录
            TmsVehicle tmsVehicle = tmsVehicleServiceImpl.selectTmsVehicleById(tmsDispatchOrder.getVehicleId());
            TmsCarKeyDispatch tmsCarKeyDispatch = new TmsCarKeyDispatch();
            tmsCarKeyDispatch.setDispatchOrderId(dispatchOrderId);
            tmsCarKeyDispatch.setDispatchOrderNo(tmsDispatchOrder.getDispatchNo());
            tmsCarKeyDispatch.setDriverId(tmsDriver.getId());
            tmsCarKeyDispatch.setDriverMobile(tmsDriver.getMobile());
            tmsCarKeyDispatch.setDriverName(tmsDriver.getDriverName());
            tmsCarKeyDispatch.setVehicleId(tmsDispatchOrder.getVehicleId());
            tmsCarKeyDispatch.setVehicleLicensePlate(tmsDispatchOrder.getLicensePlate());
            tmsCarKeyDispatch.setVehicleCarKeyNo(tmsVehicle.getCarKeyNo());
            LocalDateTime plus2Hours = LocalDateTime.now().plusHours(2);
            Date date = Date.from(plus2Hours.atZone(ZoneId.systemDefault()).toInstant());
            tmsCarKeyDispatch.setCarKeyExpirationTime(date);
            tmsCarKeyDispatch.setStatus(0);
            tmsCarKeyDispatchMapper.insertTmsCarKeyDispatch(tmsCarKeyDispatch);
            sendCarKeyDelayMessage(tmsCarKeyDispatch.getId(),  2 * 60 * 60 * 1000L);
        }
        return 1;
    }
    /**
     * 发送延迟消息
     * @param carKeyId car_key id
     * @param delayMillis 延迟毫秒数
     */
    public void sendCarKeyDelayMessage(Integer carKeyId, long delayMillis) {
        rabbitTemplate.convertAndSend(
                "car_key_delay_exchange",
                "car_key_delay",
                carKeyId,
                message -> {
                    message.getMessageProperties().setExpiration(String.valueOf(delayMillis));
                    return message;
                }
        );
    }
    @Override
    public AjaxResult submitDropHook(TmsTrip tmsTrip){
        Integer dispatchOrderId = tmsTrip.getDispatchOrderId();
@@ -229,7 +278,7 @@
        }
        TmsVehicle tmsVehicle = tmsVehicleServiceImpl.selectTmsVehicleById(driverDispatch.getDriverId());
        TmsVehicle tmsVehicle = tmsVehicleServiceImpl.selectTmsVehicleById(driverDispatch.getVehicleId());
        tmsDispatchOrderMapper.update(
                new LambdaUpdateWrapper<TmsDispatchOrder>()
tms/src/main/resources/mapper/tms/TmsCarKeyDispatchMapper.xml
New file
@@ -0,0 +1,169 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.tms.mapper.TmsCarKeyDispatchMapper">
    <resultMap type="com.ruoyi.tms.domain.TmsCarKeyDispatch" id="TmsCarKeyDispatchResult">
        <result property="id"    column="id"    />
        <result property="dispatchOrderId"    column="dispatch_order_id"    />
        <result property="dispatchOrderNo"    column="dispatch_order_no"    />
        <result property="driverId"    column="driver_id"    />
        <result property="driverMobile"    column="driver_mobile"    />
        <result property="driverName"    column="driver_name"    />
        <result property="vehicleId"    column="vehicle_id"    />
        <result property="vehicleLicensePlate"    column="vehicle_license_plate"    />
        <result property="vehicleCarKeyNo"    column="vehicle_car_key_no"    />
        <result property="carKeyExpirationTime"    column="car_key_expiration_time"    />
        <result property="carKeyCollectionTime"    column="car_key_collection_time"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateTime"    column="update_time"    />
        <result property="status"    column="status"    />
    </resultMap>
    <sql id="selectTmsCarKeyDispatchVo">
        select thisTab.id, thisTab.dispatch_order_id, thisTab.dispatch_order_no, thisTab.driver_id, thisTab.driver_mobile, thisTab.driver_name, thisTab.vehicle_id, thisTab.vehicle_license_plate, thisTab.vehicle_car_key_no, thisTab.car_key_expiration_time, thisTab.car_key_collection_time, thisTab.create_time, thisTab.update_time, thisTab.status from tms_car_key_dispatch AS thisTab
    </sql>
    <sql id="selectTmsCarKeyDispatchVoCount">
        select count(0) from tms_car_key_dispatch as thisTab
    </sql>
    <sql id="whereCondition">
        <if test="dispatchOrderId != null "> and thisTab.dispatch_order_id = #{dispatchOrderId}</if>
        <if test="dispatchOrderNo != null  and dispatchOrderNo != ''"> and thisTab.dispatch_order_no = #{dispatchOrderNo}</if>
        <if test="driverId != null "> and thisTab.driver_id = #{driverId}</if>
        <if test="driverMobile != null  and driverMobile != ''"> and thisTab.driver_mobile = #{driverMobile}</if>
        <if test="driverName != null  and driverName != ''"> and  thisTab.driver_name like concat('%', #{driverName}, '%')</if>
        <if test="vehicleId != null "> and thisTab.vehicle_id = #{vehicleId}</if>
        <if test="vehicleLicensePlate != null  and vehicleLicensePlate != ''"> and thisTab.vehicle_license_plate = #{vehicleLicensePlate}</if>
        <if test="vehicleCarKeyNo != null "> and thisTab.vehicle_car_key_no = #{vehicleCarKeyNo}</if>
        <if test="carKeyExpirationTime != null "> and thisTab.car_key_expiration_time = #{carKeyExpirationTime}</if>
        <if test="carKeyCollectionTime != null "> and thisTab.car_key_collection_time = #{carKeyCollectionTime}</if>
        <if test="status != null "> and thisTab.status = #{status}</if>
    </sql>
    <!--查询-->
    <select id="selectTmsCarKeyDispatchById" parameterType="Integer" resultMap="TmsCarKeyDispatchResult">
        <include refid="selectTmsCarKeyDispatchVo"/>
        where id = #{id}
    </select>
    <select id="selectTmsCarKeyDispatchCount" parameterType="com.ruoyi.tms.domain.TmsCarKeyDispatch" resultType="int">
        <include refid="selectTmsCarKeyDispatchVoCount"/>
        <where>
            <include refid="whereCondition"/>
        </where>
    </select>
    <select id="selectTmsCarKeyDispatchList" parameterType="com.ruoyi.tms.domain.TmsCarKeyDispatch" resultMap="TmsCarKeyDispatchResult">
        <include refid="selectTmsCarKeyDispatchVo"/>
        <where>
            <include refid="whereCondition"/>
        </where>
        order by thisTab.id desc
    </select>
    <!-- 新增 -->
    <insert id="insertTmsCarKeyDispatch" parameterType="com.ruoyi.tms.domain.TmsCarKeyDispatch" useGeneratedKeys="true" keyProperty="id">
        insert into tms_car_key_dispatch
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="dispatchOrderId != null">dispatch_order_id,</if>
            <if test="dispatchOrderNo != null">dispatch_order_no,</if>
            <if test="driverId != null">driver_id,</if>
            <if test="driverMobile != null and driverMobile != ''">driver_mobile,</if>
            <if test="driverName != null">driver_name,</if>
            <if test="vehicleId != null">vehicle_id,</if>
            <if test="vehicleLicensePlate != null">vehicle_license_plate,</if>
            <if test="vehicleCarKeyNo != null">vehicle_car_key_no,</if>
            <if test="carKeyExpirationTime != null">car_key_expiration_time,</if>
            <if test="carKeyCollectionTime != null">car_key_collection_time,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="status != null">status,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="dispatchOrderId != null">#{dispatchOrderId},</if>
            <if test="dispatchOrderNo != null">#{dispatchOrderNo},</if>
            <if test="driverId != null">#{driverId},</if>
            <if test="driverMobile != null and driverMobile != ''">#{driverMobile},</if>
            <if test="driverName != null">#{driverName},</if>
            <if test="vehicleId != null">#{vehicleId},</if>
            <if test="vehicleLicensePlate != null">#{vehicleLicensePlate},</if>
            <if test="vehicleCarKeyNo != null">#{vehicleCarKeyNo},</if>
            <if test="carKeyExpirationTime != null">#{carKeyExpirationTime},</if>
            <if test="carKeyCollectionTime != null">#{carKeyCollectionTime},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="status != null">#{status},</if>
         </trim>
    </insert>
    <insert id="insertTmsCarKeyDispatchBatch" parameterType="java.util.List" >
        insert into tms_car_key_dispatch
        <trim prefix="(" suffix=") values" suffixOverrides=",">
            id,dispatch_order_id,dispatch_order_no,driver_id,driver_mobile,driver_name,vehicle_id,vehicle_license_plate,vehicle_car_key_no,car_key_expiration_time,car_key_collection_time,create_time,update_time,status,
        </trim>
        <foreach item="item" index="index" collection="list" separator=",">
            <trim prefix="(" suffix=") " suffixOverrides=",">
                #{item.id},#{item.dispatchOrderId},#{item.dispatchOrderNo},#{item.driverId},#{item.driverMobile},#{item.driverName},#{item.vehicleId},#{item.vehicleLicensePlate},#{item.vehicleCarKeyNo},#{item.carKeyExpirationTime},#{item.carKeyCollectionTime},#{item.createTime},#{item.updateTime},#{item.status},
            </trim>
        </foreach>
    </insert>
    <!-- 修改 -->
    <update id="updateTmsCarKeyDispatch" parameterType="com.ruoyi.tms.domain.TmsCarKeyDispatch">
        update tms_car_key_dispatch
        <trim prefix="SET" suffixOverrides=",">
            <if test="dispatchOrderId != null">dispatch_order_id = #{dispatchOrderId},</if>
            <if test="dispatchOrderNo != null">dispatch_order_no = #{dispatchOrderNo},</if>
            <if test="driverId != null">driver_id = #{driverId},</if>
            <if test="driverMobile != null and driverMobile != ''">driver_mobile = #{driverMobile},</if>
            <if test="driverName != null">driver_name = #{driverName},</if>
            <if test="vehicleId != null">vehicle_id = #{vehicleId},</if>
            <if test="vehicleLicensePlate != null">vehicle_license_plate = #{vehicleLicensePlate},</if>
            <if test="vehicleCarKeyNo != null">vehicle_car_key_no = #{vehicleCarKeyNo},</if>
            <if test="carKeyExpirationTime != null">car_key_expiration_time = #{carKeyExpirationTime},</if>
            <if test="carKeyCollectionTime != null">car_key_collection_time = #{carKeyCollectionTime},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="status != null">status = #{status},</if>
        </trim>
        where id = #{id}
    </update>
    <!-- 修改 -->
    <update id="updateTmsCarKeyDispatchBatch" parameterType="java.util.List">
        <foreach collection="list" item="item" index="index" separator=";">
            update tms_car_key_dispatch
            <trim prefix="SET" suffixOverrides=",">
                <if test="item.dispatchOrderId != null">dispatch_order_id = #{item.dispatchOrderId},</if>
                <if test="item.dispatchOrderNo != null">dispatch_order_no = #{item.dispatchOrderNo},</if>
                <if test="item.driverId != null">driver_id = #{item.driverId},</if>
                <if test="item.driverMobile != null and item.driverMobile != ''">driver_mobile = #{item.driverMobile},</if>
                <if test="item.driverName != null">driver_name = #{item.driverName},</if>
                <if test="item.vehicleId != null">vehicle_id = #{item.vehicleId},</if>
                <if test="item.vehicleLicensePlate != null">vehicle_license_plate = #{item.vehicleLicensePlate},</if>
                <if test="item.vehicleCarKeyNo != null">vehicle_car_key_no = #{item.vehicleCarKeyNo},</if>
                <if test="item.carKeyExpirationTime != null">car_key_expiration_time = #{item.carKeyExpirationTime},</if>
                <if test="item.carKeyCollectionTime != null">car_key_collection_time = #{item.carKeyCollectionTime},</if>
                <if test="item.createTime != null">create_time = #{item.createTime},</if>
                <if test="item.updateTime != null">update_time = #{item.updateTime},</if>
                <if test="item.status != null">status = #{item.status},</if>
            </trim>
        where id = #{item.id}
        </foreach>
    </update>
    <!--删除-->
    <delete id="deleteTmsCarKeyDispatchById" parameterType="Integer">
        delete from tms_car_key_dispatch where id = #{id}
    </delete>
    <delete id="deleteTmsCarKeyDispatchByIds" parameterType="Integer">
        delete from tms_car_key_dispatch where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>
tms/src/main/resources/mapper/tms/TmsContainerMapper.xml
@@ -30,10 +30,12 @@
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="remark"    column="remark"    />
        <result property="selfLeasType"    column="self_leas_type"    />
    </resultMap>
    <sql id="selectTmsContainerVo">
        select thisTab.id, thisTab.system_code, thisTab.container_code, thisTab.container_use_type, thisTab.container_size, thisTab.owner_team_id, thisTab.owner_team_name, thisTab.manufacturer, thisTab.manufacture_date, thisTab.length_mm, thisTab.width_mm, thisTab.height_mm, thisTab.max_total_weight_kg, thisTab.max_load_kg, thisTab.volume_m3, thisTab.is_in_use, thisTab.maintenance_status, thisTab.last_maintenance_date, thisTab.next_maintenance_date, thisTab.status, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time, thisTab.remark from tms_container AS thisTab
        select thisTab.id, thisTab.system_code, thisTab.container_code, thisTab.container_use_type, thisTab.container_size, thisTab.owner_team_id, thisTab.owner_team_name, thisTab.manufacturer, thisTab.manufacture_date, thisTab.length_mm, thisTab.width_mm, thisTab.height_mm, thisTab.max_total_weight_kg, thisTab.max_load_kg, thisTab.volume_m3, thisTab.is_in_use, thisTab.maintenance_status, thisTab.last_maintenance_date, thisTab.next_maintenance_date, thisTab.status, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time, thisTab.remark ,thisTab.self_leas_type from tms_container AS thisTab
    </sql>
    <sql id="selectTmsContainerVoCount">
        select count(0) from tms_container as thisTab
@@ -49,6 +51,8 @@
        <if test="isInUse != null "> and thisTab.is_in_use = #{isInUse}</if>
        <if test="maintenanceStatus != null "> and thisTab.maintenance_status = #{maintenanceStatus}</if>
        <if test="status != null "> and thisTab.status = #{status}</if>
        <if test="selfLeasType != null "> and thisTab.self_leas_type = #{selfLeasType}</if>
    </sql>
    <!--查询-->
@@ -100,6 +104,8 @@
            <if test="updateBy != null">update_by,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="remark != null">remark,</if>
            <if test="selfLeasType != null">self_leas_type,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="systemCode != null and systemCode != ''">#{systemCode},</if>
@@ -126,17 +132,19 @@
            <if test="updateBy != null">#{updateBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="remark != null">#{remark},</if>
            <if test="selfLeasType != null">#{selfLeasType},</if>
        </trim>
    </insert>
    <insert id="insertTmsContainerBatch" parameterType="java.util.List"  useGeneratedKeys="true" keyProperty="id">
        insert into tms_container
        <trim prefix="(" suffix=") values" suffixOverrides=",">
            id,system_code,container_code,container_use_type,container_size,owner_team_id,owner_team_name,manufacturer,manufacture_date,length_mm,width_mm,height_mm,max_total_weight_kg,max_load_kg,volume_m3,is_in_use,maintenance_status,last_maintenance_date,next_maintenance_date,status,create_by,create_time,update_by,update_time,remark,
            id,system_code,container_code,container_use_type,container_size,owner_team_id,owner_team_name,manufacturer,manufacture_date,length_mm,width_mm,height_mm,max_total_weight_kg,max_load_kg,volume_m3,is_in_use,maintenance_status,last_maintenance_date,next_maintenance_date,status,create_by,create_time,update_by,update_time,remark,self_leas_type,
        </trim>
        <foreach item="item" index="index" collection="list" separator=",">
            <trim prefix="(" suffix=") " suffixOverrides=",">
                #{item.id},#{item.systemCode},#{item.containerCode},#{item.containerUseType},#{item.containerSize},#{item.ownerTeamId},#{item.ownerTeamName},#{item.manufacturer},#{item.manufactureDate},#{item.lengthMm},#{item.widthMm},#{item.heightMm},#{item.maxTotalWeightKg},#{item.maxLoadKg},#{item.volumeM3},#{item.isInUse},#{item.maintenanceStatus},#{item.lastMaintenanceDate},#{item.nextMaintenanceDate},#{item.status},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.remark},
                #{item.id},#{item.systemCode},#{item.containerCode},#{item.containerUseType},#{item.containerSize},#{item.ownerTeamId},#{item.ownerTeamName},#{item.manufacturer},#{item.manufactureDate},#{item.lengthMm},#{item.widthMm},#{item.heightMm},#{item.maxTotalWeightKg},#{item.maxLoadKg},#{item.volumeM3},#{item.isInUse},#{item.maintenanceStatus},#{item.lastMaintenanceDate},#{item.nextMaintenanceDate},#{item.status},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.remark},#{item.item.selfLeasType},
            </trim>
        </foreach>
    </insert>
@@ -169,6 +177,8 @@
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="remark != null">remark = #{remark},</if>
            <if test="selfLeasType != null">self_leas_type = #{selfLeasType},</if>
        </trim>
        where id = #{id}
    </update>
@@ -201,6 +211,7 @@
                <if test="item.updateBy != null">update_by = #{item.updateBy},</if>
                <if test="item.updateTime != null">update_time = #{item.updateTime},</if>
                <if test="item.remark != null">remark = #{item.remark},</if>
                <if test="item.selfLeasType != null">self_leas_type = #{item.selfLeasType},</if>
            </trim>
            where id = #{item.id}
        </foreach>
tms/src/main/resources/mapper/tms/TmsShelfMapper.xml
@@ -28,10 +28,11 @@
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="remark"    column="remark"    />
        <result property="selfLeasType"    column="self_leas_type"    />
    </resultMap>
    <sql id="selectTmsShelfVo">
        select thisTab.id, thisTab.system_code, thisTab.shelf_code, thisTab.shelf_type, thisTab.owner_team_id, thisTab.owner_team_name, thisTab.manufacturer, thisTab.manufacture_date, thisTab.length_mm, thisTab.width_mm, thisTab.height_mm, thisTab.max_load_kg, thisTab.compatible_container_type, thisTab.is_in_use, thisTab.maintenance_status, thisTab.last_maintenance_date, thisTab.next_maintenance_date, thisTab.status, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time, thisTab.remark from tms_shelf AS thisTab
        select thisTab.id, thisTab.system_code, thisTab.shelf_code, thisTab.shelf_type, thisTab.owner_team_id, thisTab.owner_team_name, thisTab.manufacturer, thisTab.manufacture_date, thisTab.length_mm, thisTab.width_mm, thisTab.height_mm, thisTab.max_load_kg, thisTab.compatible_container_type, thisTab.is_in_use, thisTab.maintenance_status, thisTab.last_maintenance_date, thisTab.next_maintenance_date, thisTab.status, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time, thisTab.remark ,thisTab.self_leas_type from tms_shelf AS thisTab
    </sql>
    <sql id="selectTmsShelfVoCount">
        select count(0) from tms_shelf as thisTab
@@ -48,6 +49,7 @@
        <if test="isInUse != null "> and thisTab.is_in_use = #{isInUse}</if>
        <if test="maintenanceStatus != null "> and thisTab.maintenance_status = #{maintenanceStatus}</if>
        <if test="status != null "> and thisTab.status = #{status}</if>
        <if test="selfLeasType != null "> and thisTab.self_leas_type = #{selfLeasType}</if>
    </sql>
    <!--查询-->
@@ -97,6 +99,7 @@
            <if test="updateBy != null">update_by,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="remark != null">remark,</if>
            <if test="selfLeasType != null">self_leas_type,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="systemCode != null and systemCode != ''">#{systemCode},</if>
@@ -121,17 +124,18 @@
            <if test="updateBy != null">#{updateBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="remark != null">#{remark},</if>
            <if test="selfLeasType != null">#{selfLeasType},</if>
        </trim>
    </insert>
    <insert id="insertTmsShelfBatch" parameterType="java.util.List"  useGeneratedKeys="true" keyProperty="id">
        insert into tms_shelf
        <trim prefix="(" suffix=") values" suffixOverrides=",">
            id,system_code,shelf_code,shelf_type,owner_team_id,owner_team_name,manufacturer,manufacture_date,length_mm,width_mm,height_mm,max_load_kg,compatible_container_type,is_in_use,maintenance_status,last_maintenance_date,next_maintenance_date,status,create_by,create_time,update_by,update_time,remark,
            id,system_code,shelf_code,shelf_type,owner_team_id,owner_team_name,manufacturer,manufacture_date,length_mm,width_mm,height_mm,max_load_kg,compatible_container_type,is_in_use,maintenance_status,last_maintenance_date,next_maintenance_date,status,create_by,create_time,update_by,update_time,remark,self_leas_type,
        </trim>
        <foreach item="item" index="index" collection="list" separator=",">
            <trim prefix="(" suffix=") " suffixOverrides=",">
                #{item.id},#{item.systemCode},#{item.shelfCode},#{item.shelfType},#{item.ownerTeamId},#{item.ownerTeamName},#{item.manufacturer},#{item.manufactureDate},#{item.lengthMm},#{item.widthMm},#{item.heightMm},#{item.maxLoadKg},#{item.compatibleContainerType},#{item.isInUse},#{item.maintenanceStatus},#{item.lastMaintenanceDate},#{item.nextMaintenanceDate},#{item.status},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.remark},
                #{item.id},#{item.systemCode},#{item.shelfCode},#{item.shelfType},#{item.ownerTeamId},#{item.ownerTeamName},#{item.manufacturer},#{item.manufactureDate},#{item.lengthMm},#{item.widthMm},#{item.heightMm},#{item.maxLoadKg},#{item.compatibleContainerType},#{item.isInUse},#{item.maintenanceStatus},#{item.lastMaintenanceDate},#{item.nextMaintenanceDate},#{item.status},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.remark},#{item.selfLeasType},
            </trim>
        </foreach>
    </insert>
@@ -162,6 +166,7 @@
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="remark != null">remark = #{remark},</if>
            <if test="selfLeasType != null">self_leas_type = #{selfLeasType},</if>
        </trim>
        where id = #{id}
    </update>
@@ -192,6 +197,7 @@
                <if test="item.updateBy != null">update_by = #{item.updateBy},</if>
                <if test="item.updateTime != null">update_time = #{item.updateTime},</if>
                <if test="item.remark != null">remark = #{item.remark},</if>
                <if test="item.selfLeasType != null">self_leas_type = #{item.selfLeasType},</if>
            </trim>
            where id = #{item.id}
        </foreach>
ui/admin-ui3/.env.development
@@ -10,7 +10,7 @@
# 列表操作按钮展示位置 left/right
VITE_APP_listOptFixed = 'left'
#后台接口地址
VITE_APP_BASE_SERVER_API = 'http://localhost:8080'
VITE_APP_BASE_SERVER_API = 'http://localhost:8060'
# 上下文
VITE_APP_BASE_URL = '/admin/'
ui/admin-ui3/package.json
@@ -5,7 +5,7 @@
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build:prod": "vue-tsc --noEmit --skipLibCheck && vite build",
    "build:prod": " vite build",
    "build:stage": "vite build --mode staging",
    "preview": "vite preview"
  },
ui/admin-ui3/src/assets/styles/element-ui.scss
@@ -93,4 +93,7 @@
.el-dropdown .el-dropdown-link{
  color: var(--el-color-primary) !important;
}
.el-table{
  --el-table-current-row-bg-color: var(--el-color-success-light-7) !important;
}
ui/admin-ui3/src/main.ts
@@ -61,6 +61,7 @@
        viewBtn: true,
        selection: true,
        searchSpan: 5,
        height: 600,
        props: {
            label: 'dictLabel',
            value: 'dictValue'
ui/admin-ui3/src/views/tms/tmsContainer/index.vue
@@ -114,6 +114,21 @@
            }
          ],
        },
        selfLeasType: {
          label: '自租类型',
          type: 'radio', dataType: 'string', dicUrl: '/system/dict/data/type/self_leas_type',
          addDisplay: true,
          editDisplay: true,minWidth:150,
          viewDisplay: true,
          hide: false,
          search: true,
          rules: [
            {
              required: true,
              message: "自租类型不能为空", trigger: "change"
            }
          ],
        },
        containerCode: {
          label: '集装箱号',
          addDisplay: true,
@@ -452,6 +467,12 @@
      hide: false,minWidth:150,
      search: true,
    },
    selfLeasType: {
      label: '自租类型',
      type: 'radio', dataType: 'string', dicUrl: '/system/dict/data/type/self_leas_type',
      hide: false,      display: false,
      search: true,
    },
    containerCode: {
      label: '集装箱号',
      display: false,
ui/admin-ui3/src/views/tms/tmsDispatchOrder/index.vue
@@ -126,26 +126,26 @@
        </el-link>
      </template>
      <template #shipperId-form>
      <template #shipperId-form="{disabled}">
        <div style="display:flex; align-items: center;justify-content: space-between">
          <avue-input-table :props="consignorProps"
                            :children="consignorOption"
                            :children="consignorOption" :disabled="disabled"
                            :on-load="onShipperLoad" suffixIcon="search"
                            v-model="form.shipperId" style="width: 80%"
                            @change="changeShipper"
                            placeholder="请选择装货点"></avue-input-table>
          <el-button icon="plus" @click="handleAddShipper"></el-button>
          <el-button icon="plus"  :disabled="disabled" @click="handleAddShipper"></el-button>
        </div>
      </template>
      <template #receiverId-form>
      <template #receiverId-form="{disabled}">
        <div style="display:flex; align-items: center;justify-content: space-between">
          <avue-input-table :props="consignorProps"
                            :children="consignorOption"
                            :on-load="onConsignorLoad" suffixIcon="search"
                            v-model="form.receiverId"
                            v-model="form.receiverId"  :disabled="disabled"
                            @change="changeReceiver" style="width: 80%"
                            placeholder="请选择卸货点"></avue-input-table>
          <el-button icon="plus" @click="handleAddReceiver"></el-button>
          <el-button icon="plus"  :disabled="disabled" @click="handleAddReceiver"></el-button>
        </div>
      </template>
@@ -412,11 +412,13 @@
          ],
          type: 'table', suffixIcon: 'search',dataType: 'string',
          change: (val: any) => {
            console.log(val)
            const table = crudRef.value?.getPropRef?.('quoteDetailId')?.$refs?.temp;
            if (!table) return;
            let active = table.active;
            if (Array.isArray(active)) active = active[0];
            if (active) {
              console.log(active)
              Object.assign(form.value, {
                quoteDetailId: active.quoteDetailId,
                transportLine: active.transportRoute,
@@ -717,7 +719,7 @@
          ],
        },
        isUrgent: {
          label: '是否紧急',
          label: '是否紧急',value: '1',
          display: true,
          type: 'radio', dicUrl: '/system/dict/data/type/sys_number_is', dataType: 'string',
          rules: [
@@ -784,12 +786,17 @@
            option.value.group.forEach((item: any) => {
              if (item.prop == 'pcxx') {
                item.column.commissionModel.display = value != 1;
                item.column.containerId.display = value != 1;
                item.column.shelfId.display = value != 1;
                item.column.vehicleProviderId.display = value == 1;
                item.column.containerNo.display = value == 1;
                item.column.shelfCode.display = value == 1;
                // item.column.vehicleProviderId.rules.forEach((cItem: any) => {
                //   cItem.required = value == 1;
                // });
              }
            })
          },
        },
        commissionModel:{
@@ -947,7 +954,7 @@
              listTmsDriver({
                pageSize: page.pageSize,
                pageNum: page.currentPage, ...data,
                carrierType: form.value.operationMode
                carrierType: form.value.operationMode,vehicleProviderId:form.value.vehicleProviderId
              }).then(res => {
                return callback({
                  total: res.total,
@@ -1012,7 +1019,7 @@
            } else {
              listTmsDriver({
                pageSize: page.pageSize,
                pageNum: page.currentPage, ...data,
                pageNum: page.currentPage, ...data,vehicleProviderId:form.value.vehicleProviderId,
                carrierType: form.value.operationMode
              }).then(res => {
                return callback({
@@ -1043,6 +1050,7 @@
              Object.assign(form.value, {
                vehicleId: active.id,
                licensePlate: active.licensePlate,
                actualVehicleType: active.vehicleType,
              });
            }
          },
@@ -1058,6 +1066,8 @@
              },
              vehicleType: {
                label: '车辆类型', minWidth: 120,
                type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/vehicle_type',
                search: true,
              },
              internalCode: {
@@ -1096,7 +1106,7 @@
              listTmsVehicle({
                pageSize: page.pageSize,
                pageNum: page.currentPage, ...data,
                carrierType: form.value.operationMode
                carrierType: form.value.operationMode,serviceProviderId:form.value.vehicleProviderId
              }).then(res => {
                return callback({
                  total: res.total,
@@ -1159,6 +1169,10 @@
          label: '卸货点联系方式',
          display: true, disabled: true
        },
        containerNo: {
          label: '集装箱号',
          display: false,
        },
        containerId: {
          label: '关联集装箱信息',
          display: true,
@@ -1187,6 +1201,11 @@
              containerUseType: {
                label: '集装箱用途类型', minWidth: 120,
                type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/container_use_type',
                search: true,
              },
              selfLeasType: {
                label: '自租类型', minWidth: 120,
                type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/self_leas_type',
                search: true,
              },
              containerSize: {
@@ -1224,6 +1243,10 @@
          }
        },
        shelfCode: {
          label: '托板号',
          display: false,
        },
        shelfId: {
          label: '托板号',
          display: true,
@@ -1250,7 +1273,13 @@
                search: true,
              },
              shelfType: {
                label: '托架类型', minWidth: 120,
                type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/shelf_type',
                search: true,
              },
              selfLeasType: {
                label: '自租类型', minWidth: 120,
                type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/self_leas_type',
                search: true,
              },
              compatibleContainerType: {
@@ -2657,7 +2686,7 @@
      pageF.isUploading = false;
    })
  }else if (optionType.value === 'customs') {
    customsOrder(form.value.id).then(res => {
    customsOrder({id:form.value.id}).then(res => {
      ElMessage({
        message: "提交成功!",
        type: 'success'
@@ -2668,7 +2697,7 @@
      pageF.isUploading = false;
    })
  }else if (optionType.value === 'loading') {
    loadingOrder(form.value.id).then(res => {
    loadingOrder({id:form.value.id}).then(res => {
      ElMessage({
        message: "提交成功!",
        type: 'success'
ui/admin-ui3/src/views/tms/tmsShelf/index.vue
@@ -114,6 +114,21 @@
            }
          ],
        },
        selfLeasType: {
          label: '自租类型',
          type: 'radio', dataType: 'string', dicUrl: '/system/dict/data/type/self_leas_type',
          addDisplay: true,
          editDisplay: true,minWidth:150,
          viewDisplay: true,
          hide: false,
          search: true,
          rules: [
            {
              required: true,
              message: "自租类型不能为空", trigger: "change"
            }
          ],
        },
        shelfCode: {
          label: '托架编号',
          addDisplay: true,
@@ -445,6 +460,12 @@
      hide: false,
      search: true,
    },
    selfLeasType: {
      label: '自营租赁类型',display: false,
      type: 'radio', dataType: 'string', dicUrl: '/system/dict/data/type/self_leas_type',
      hide: false,minWidth:150,
      search: true,
    },
    shelfType: {
      label: '托架类型',
      type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/shelf_type',
@@ -476,6 +497,7 @@
      hide: false,minWidth:150,
      search: true,
    },
    isInUse: {
      label: '是否在用',dataType: 'string',
      type: 'radio', dicUrl: '/system/dict/data/type/sys_number_is',