init
This commit is contained in:
		
							
								
								
									
										3
									
								
								sl-express-ms-web-driver/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								sl-express-ms-web-driver/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
			
		||||
.idea
 | 
			
		||||
target/
 | 
			
		||||
*.iml
 | 
			
		||||
							
								
								
									
										13
									
								
								sl-express-ms-web-driver/Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								sl-express-ms-web-driver/Dockerfile
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,13 @@
 | 
			
		||||
FROM openjdk:11-jdk
 | 
			
		||||
LABEL maintainer="研究院研发组 <research@itcast.cn>"
 | 
			
		||||
 
 | 
			
		||||
# 时区修改为东八区
 | 
			
		||||
ENV TZ=Asia/Shanghai
 | 
			
		||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
 | 
			
		||||
 
 | 
			
		||||
WORKDIR /app
 | 
			
		||||
ARG JAR_FILE=target/*.jar
 | 
			
		||||
ADD ${JAR_FILE} app.jar
 | 
			
		||||
 | 
			
		||||
EXPOSE 8080
 | 
			
		||||
ENTRYPOINT ["sh","-c","java -Djava.security.egd=file:/dev/./urandom -jar $JAVA_OPTS app.jar"]
 | 
			
		||||
							
								
								
									
										65
									
								
								sl-express-ms-web-driver/README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										65
									
								
								sl-express-ms-web-driver/README.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,65 @@
 | 
			
		||||
# sl-express-ms-web-driver使用手册
 | 
			
		||||
## 1.说明
 | 
			
		||||
**该模块为司机端web微服务,主要提供司机端APP各项服务。**<br />主要功能:
 | 
			
		||||
 | 
			
		||||
- 司机账号登录
 | 
			
		||||
- 用户个人信息、绑定车辆信息、任务数据(任务数量、里程统计)
 | 
			
		||||
- 司机任务查询、延迟提货、提货、交付、回车登记、联系调度中心
 | 
			
		||||
- 公告、系统通知的消息通知
 | 
			
		||||
 | 
			
		||||
## 2.服务配置
 | 
			
		||||
### 2.1配置信息
 | 
			
		||||
- 服务需要接入权限系统,所以需要配置权限系统应用id
 | 
			
		||||
- 司机取消任务需要联系调度员,所以需要配置调度员角色id
 | 
			
		||||
- 司机提货、交付、回车登记需要上传图片,所以需要配置阿里云oss
 | 
			
		||||
 | 
			
		||||
```properties
 | 
			
		||||
#权限系统应用id
 | 
			
		||||
authority.applicationId = 981194468570960001
 | 
			
		||||
 | 
			
		||||
#角色id
 | 
			
		||||
role.manager = 986227712144197857,989278284569131905,996045142395786081,996045927523359809
 | 
			
		||||
role.driver = 989559028277315009
 | 
			
		||||
role.courier = 989559057641637825
 | 
			
		||||
role.dispatcher = 996045927523359809
 | 
			
		||||
 | 
			
		||||
#阿里云OSS
 | 
			
		||||
#yourEndpoint填写Bucket所在地域对应的Endpoint。以华东1(杭州)为例,Endpoint填写为 oss-cn-hangzhou.aliyuncs.com。
 | 
			
		||||
spring.alioss.endpoint = yourEndpoint
 | 
			
		||||
#阿里云账号AccessKey拥有所有API的访问权限,风险很高。强烈建议您创建并使用RAM用户进行API访问或日常运维,请登录RAM控制台创建RAM用户。
 | 
			
		||||
spring.alioss.accessKeyId = yourAccessKeyId
 | 
			
		||||
spring.alioss.accessKeySecret = yourAccessKeySecret
 | 
			
		||||
# 自定义的存储bucket名称
 | 
			
		||||
spring.alioss.bucketName = yjy-slwl-oss
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
### 2.2依赖引入
 | 
			
		||||
 | 
			
		||||
| 依赖服务                        | 版本           | 参考文档                                               |
 | 
			
		||||
|-----------------------------|--------------|----------------------------------------------------|
 | 
			
		||||
| sl-express-common           | 1.1-SNAPSHOT | [sl-express-common](/zh-cn/new-function.md)        |
 | 
			
		||||
| sl-express-ms-base-api      | 1.0-SNAPSHOT | [基础微服务](/zh-cn/modules/sl-express-ms-base.md)      |
 | 
			
		||||
| sl-express-ms-work-api      | 1.0-SNAPSHOT | [work微服务](/zh-cn/modules/sl-express-ms-work.md)    |
 | 
			
		||||
| sl-express-ms-transport-api | 1.0-SNAPSHOT | [运输微服务](/zh-cn/modules/sl-express-ms-transport.md) |
 | 
			
		||||
| sl-express-ms-driver-api    | 1.0-SNAPSHOT | [司机微服务](/zh-cn/modules/sl-express-ms-driver.md)    |
 | 
			
		||||
 | 
			
		||||
## 3.技术方案
 | 
			
		||||
阿里云OSS:
 | 
			
		||||
[阿里云OSS-SDK示例](https://help.aliyun.com/document_detail/84781.htm?spm=a2c4g.11186623.0.0.56636ac1wg2W0I#t22269.html)
 | 
			
		||||
 | 
			
		||||
## 4.使用
 | 
			
		||||
概述:司机的每个任务要经过三个阶段:`提货-->交付-->回车登记`,只有三个阶段完全完成才可以进行下一个任务。
 | 
			
		||||
 | 
			
		||||
### 4.1待提货说明
 | 
			
		||||
1. 司机只有不存在在途或者已交付任务时才可以提货
 | 
			
		||||
2. 司机有且只能有一个任务可以提货,而且最早提货时间的任务
 | 
			
		||||
3. 提货时必须上传回单凭证和货品图片
 | 
			
		||||
 | 
			
		||||
### 4.2交付说明
 | 
			
		||||
1. 交付任务任何时候最多只有一个
 | 
			
		||||
2. 交付时必须上传回单凭证和货品图片
 | 
			
		||||
 | 
			
		||||
### 4.3回车登记说明
 | 
			
		||||
1. 任务交付完成之后还必须进行回车登记,否则无法开启下一个任务
 | 
			
		||||
2. 回车登记必须填写是否违章、是否故障、是否事故信息
 | 
			
		||||
3. 回车登记默认车辆是可用状态,如果车辆不可用,`是否可用`选项必选`是`
 | 
			
		||||
							
								
								
									
										110
									
								
								sl-express-ms-web-driver/pom.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										110
									
								
								sl-express-ms-web-driver/pom.xml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,110 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
 | 
			
		||||
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 | 
			
		||||
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 | 
			
		||||
    <modelVersion>4.0.0</modelVersion>
 | 
			
		||||
    
 | 
			
		||||
    <parent>
 | 
			
		||||
        <groupId>com.sl-express</groupId>
 | 
			
		||||
        <artifactId>sl-express-parent</artifactId>
 | 
			
		||||
        <version>1.4</version>
 | 
			
		||||
    </parent>
 | 
			
		||||
 | 
			
		||||
    <groupId>com.sl-express.ms.web</groupId>
 | 
			
		||||
    <artifactId>sl-express-ms-web-driver</artifactId>
 | 
			
		||||
    <version>1.1-SNAPSHOT</version>
 | 
			
		||||
    <description>司机端接口层微服务</description>
 | 
			
		||||
 | 
			
		||||
    <properties>
 | 
			
		||||
        <maven.compiler.source>11</maven.compiler.source>
 | 
			
		||||
        <maven.compiler.target>11</maven.compiler.target>
 | 
			
		||||
        <sl-express-common.version>1.2-SNAPSHOT</sl-express-common.version>
 | 
			
		||||
        <sl-express-ms-base-api.version>1.1-SNAPSHOT</sl-express-ms-base-api.version>
 | 
			
		||||
        <sl-express-ms-work-api.version>1.1-SNAPSHOT</sl-express-ms-work-api.version>
 | 
			
		||||
        <sl-express-ms-transport-api.version>1.1-SNAPSHOT</sl-express-ms-transport-api.version>
 | 
			
		||||
        <sl-express-ms-driver-api.version>1.1-SNAPSHOT</sl-express-ms-driver-api.version>
 | 
			
		||||
        <sl-express-ms-track-api.version>1.1-SNAPSHOT</sl-express-ms-track-api.version>
 | 
			
		||||
    </properties>
 | 
			
		||||
 | 
			
		||||
    <dependencies>
 | 
			
		||||
        <dependency>
 | 
			
		||||
            <groupId>com.sl-express.common</groupId>
 | 
			
		||||
            <artifactId>sl-express-common</artifactId>
 | 
			
		||||
            <version>${sl-express-common.version}</version>
 | 
			
		||||
        </dependency>
 | 
			
		||||
        <dependency>
 | 
			
		||||
            <groupId>com.sl-express.ms.base</groupId>
 | 
			
		||||
            <artifactId>sl-express-ms-base-api</artifactId>
 | 
			
		||||
            <version>${sl-express-ms-base-api.version}</version>
 | 
			
		||||
        </dependency>
 | 
			
		||||
        <dependency>
 | 
			
		||||
            <groupId>com.sl-express.ms.work</groupId>
 | 
			
		||||
            <artifactId>sl-express-ms-work-api</artifactId>
 | 
			
		||||
            <version>${sl-express-ms-work-api.version}</version>
 | 
			
		||||
        </dependency>
 | 
			
		||||
        <dependency>
 | 
			
		||||
            <groupId>com.sl-express.ms.transport</groupId>
 | 
			
		||||
            <artifactId>sl-express-ms-transport-api</artifactId>
 | 
			
		||||
            <version>${sl-express-ms-transport-api.version}</version>
 | 
			
		||||
        </dependency>
 | 
			
		||||
        <dependency>
 | 
			
		||||
            <groupId>com.sl-express.ms.driver</groupId>
 | 
			
		||||
            <artifactId>sl-express-ms-driver-api</artifactId>
 | 
			
		||||
            <version>${sl-express-ms-driver-api.version}</version>
 | 
			
		||||
        </dependency>
 | 
			
		||||
        <dependency>
 | 
			
		||||
            <groupId>com.sl-express.ms.track</groupId>
 | 
			
		||||
            <artifactId>sl-express-ms-track-api</artifactId>
 | 
			
		||||
            <version>${sl-express-ms-track-api.version}</version>
 | 
			
		||||
        </dependency>
 | 
			
		||||
        <dependency>
 | 
			
		||||
            <groupId>org.springframework.boot</groupId>
 | 
			
		||||
            <artifactId>spring-boot-starter-web</artifactId>
 | 
			
		||||
        </dependency>
 | 
			
		||||
        <dependency>
 | 
			
		||||
            <groupId>com.alibaba.cloud</groupId>
 | 
			
		||||
            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
 | 
			
		||||
        </dependency>
 | 
			
		||||
        <dependency>
 | 
			
		||||
            <groupId>com.alibaba.cloud</groupId>
 | 
			
		||||
            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
 | 
			
		||||
        </dependency>
 | 
			
		||||
        <dependency>
 | 
			
		||||
            <groupId>org.springframework.cloud</groupId>
 | 
			
		||||
            <artifactId>spring-cloud-starter-loadbalancer</artifactId>
 | 
			
		||||
        </dependency>
 | 
			
		||||
        <dependency>
 | 
			
		||||
            <groupId>org.springframework.cloud</groupId>
 | 
			
		||||
            <artifactId>spring-cloud-starter-openfeign</artifactId>
 | 
			
		||||
        </dependency>
 | 
			
		||||
        <dependency>
 | 
			
		||||
            <groupId>com.itheima.em.auth</groupId>
 | 
			
		||||
            <artifactId>itcast-auth-spring-boot-starter</artifactId>
 | 
			
		||||
        </dependency>
 | 
			
		||||
        <dependency>
 | 
			
		||||
            <groupId>com.alibaba.cloud</groupId>
 | 
			
		||||
            <artifactId>spring-cloud-starter-alibaba-seata</artifactId>
 | 
			
		||||
        </dependency>
 | 
			
		||||
    </dependencies>
 | 
			
		||||
 | 
			
		||||
    <build>
 | 
			
		||||
        <plugins>
 | 
			
		||||
            <plugin>
 | 
			
		||||
                <groupId>org.springframework.boot</groupId>
 | 
			
		||||
                <artifactId>spring-boot-maven-plugin</artifactId>
 | 
			
		||||
                <executions>
 | 
			
		||||
                    <execution>
 | 
			
		||||
                        <goals>
 | 
			
		||||
                            <goal>repackage</goal>
 | 
			
		||||
                            <goal>build-info</goal>
 | 
			
		||||
                        </goals>
 | 
			
		||||
                    </execution>
 | 
			
		||||
                </executions>
 | 
			
		||||
                <configuration>
 | 
			
		||||
                    <!--指定主类-->
 | 
			
		||||
                    <mainClass>com.sl.WebDriverApplication</mainClass>
 | 
			
		||||
                </configuration>
 | 
			
		||||
            </plugin>
 | 
			
		||||
        </plugins>
 | 
			
		||||
    </build>
 | 
			
		||||
</project>
 | 
			
		||||
@@ -0,0 +1,16 @@
 | 
			
		||||
package com.sl;
 | 
			
		||||
 | 
			
		||||
import org.springframework.boot.SpringApplication;
 | 
			
		||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
 | 
			
		||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 | 
			
		||||
import org.springframework.cloud.openfeign.EnableFeignClients;
 | 
			
		||||
 | 
			
		||||
@SpringBootApplication
 | 
			
		||||
@EnableDiscoveryClient
 | 
			
		||||
@EnableFeignClients
 | 
			
		||||
public class WebDriverApplication {
 | 
			
		||||
    public static void main(String[] args) {
 | 
			
		||||
        SpringApplication.run(WebDriverApplication.class, args);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,39 @@
 | 
			
		||||
package com.sl.ms.web.driver.config;
 | 
			
		||||
 | 
			
		||||
import com.sl.transport.common.interceptor.TokenInterceptor;
 | 
			
		||||
import com.sl.transport.common.interceptor.UserInterceptor;
 | 
			
		||||
import lombok.extern.slf4j.Slf4j;
 | 
			
		||||
import org.springframework.context.annotation.Configuration;
 | 
			
		||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
 | 
			
		||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 | 
			
		||||
 | 
			
		||||
import javax.annotation.Resource;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 司机端配置拦截器
 | 
			
		||||
 */
 | 
			
		||||
@Configuration
 | 
			
		||||
@Slf4j
 | 
			
		||||
public class DriverWebConfig implements WebMvcConfigurer {
 | 
			
		||||
 | 
			
		||||
    @Resource
 | 
			
		||||
    private UserInterceptor userInterceptor;
 | 
			
		||||
 | 
			
		||||
    @Resource
 | 
			
		||||
    private TokenInterceptor tokenInterceptor;
 | 
			
		||||
 | 
			
		||||
    private static final String[] EXCLUDE_PATH_PATTERNS = new String[]{
 | 
			
		||||
            "/swagger-ui.html",
 | 
			
		||||
            "/webjars/**",
 | 
			
		||||
            "/swagger-resources",
 | 
			
		||||
            "/v2/api-docs",
 | 
			
		||||
            "/login/**"};
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void addInterceptors(InterceptorRegistry registry) {
 | 
			
		||||
        //拦截的时候过滤掉swagger相关路径和登录相关接口
 | 
			
		||||
        registry.addInterceptor(userInterceptor).excludePathPatterns(EXCLUDE_PATH_PATTERNS).addPathPatterns("/**");
 | 
			
		||||
        registry.addInterceptor(tokenInterceptor).excludePathPatterns(EXCLUDE_PATH_PATTERNS).addPathPatterns("/**");
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,28 @@
 | 
			
		||||
package com.sl.ms.web.driver.config;
 | 
			
		||||
 | 
			
		||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 | 
			
		||||
import org.springframework.cloud.client.loadbalancer.LoadBalancerClientsProperties;
 | 
			
		||||
import org.springframework.cloud.loadbalancer.support.LoadBalancerClientFactory;
 | 
			
		||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
 | 
			
		||||
import org.springframework.context.annotation.Bean;
 | 
			
		||||
import org.springframework.context.annotation.Configuration;
 | 
			
		||||
 | 
			
		||||
@Configuration
 | 
			
		||||
public class LoadBalanceConfig {
 | 
			
		||||
 | 
			
		||||
    @Bean
 | 
			
		||||
    @ConditionalOnMissingBean
 | 
			
		||||
    public LoadBalancerClientFactory loadBalancerClientFactory(LoadBalancerClientsProperties properties) {
 | 
			
		||||
        return new LoadBalancerClientFactory(properties) {
 | 
			
		||||
            @Override
 | 
			
		||||
            protected AnnotationConfigApplicationContext createContext(String name) {
 | 
			
		||||
                // FIXME: temporary switch classloader to use the correct one when creating the context
 | 
			
		||||
                ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();
 | 
			
		||||
                Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
 | 
			
		||||
                AnnotationConfigApplicationContext context = super.createContext(name);
 | 
			
		||||
                Thread.currentThread().setContextClassLoader(originalClassLoader);
 | 
			
		||||
                return context;
 | 
			
		||||
            }
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,29 @@
 | 
			
		||||
package com.sl.ms.web.driver.config;
 | 
			
		||||
 | 
			
		||||
import com.sl.transport.common.properties.AliOSSProperties;
 | 
			
		||||
import com.sl.transport.common.service.AliOssService;
 | 
			
		||||
import lombok.extern.slf4j.Slf4j;
 | 
			
		||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 | 
			
		||||
import org.springframework.context.annotation.Bean;
 | 
			
		||||
import org.springframework.context.annotation.Configuration;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 配置对象存储工具类
 | 
			
		||||
 * 主要用于上传图片和文件
 | 
			
		||||
 */
 | 
			
		||||
@Configuration
 | 
			
		||||
@Slf4j
 | 
			
		||||
public class OSSConfiguration {
 | 
			
		||||
 | 
			
		||||
    @Bean
 | 
			
		||||
    @ConditionalOnMissingBean
 | 
			
		||||
    public AliOssService aliOSSUtil(AliOSSProperties aliOSSProperties) {
 | 
			
		||||
        log.info("创建阿里云OSS工具类...");
 | 
			
		||||
 | 
			
		||||
        return new AliOssService(
 | 
			
		||||
                aliOSSProperties.getEndpoint(),
 | 
			
		||||
                aliOSSProperties.getAccessKeyId(),
 | 
			
		||||
                aliOSSProperties.getAccessKeySecret(),
 | 
			
		||||
                aliOSSProperties.getBucketName());
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,20 @@
 | 
			
		||||
package com.sl.ms.web.driver.config;
 | 
			
		||||
 | 
			
		||||
import com.sl.transport.common.config.FeignErrorDecoder;
 | 
			
		||||
import com.sl.transport.common.exception.SLWebException;
 | 
			
		||||
import org.springframework.context.annotation.Configuration;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * web调用feign失败解码器实现
 | 
			
		||||
 *
 | 
			
		||||
 * @author zzj
 | 
			
		||||
 * @version 1.0
 | 
			
		||||
 */
 | 
			
		||||
@Configuration
 | 
			
		||||
public class WebFeignErrorDecoder extends FeignErrorDecoder {
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public Exception call(int status, int code, String msg) {
 | 
			
		||||
        return new SLWebException(msg);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,37 @@
 | 
			
		||||
package com.sl.ms.web.driver.controller;
 | 
			
		||||
 | 
			
		||||
import com.sl.transport.common.service.AliOssService;
 | 
			
		||||
import com.sl.transport.common.vo.R;
 | 
			
		||||
import io.swagger.annotations.Api;
 | 
			
		||||
import io.swagger.annotations.ApiOperation;
 | 
			
		||||
import org.springframework.web.bind.annotation.PostMapping;
 | 
			
		||||
import org.springframework.web.bind.annotation.RequestMapping;
 | 
			
		||||
import org.springframework.web.bind.annotation.RequestPart;
 | 
			
		||||
import org.springframework.web.bind.annotation.RestController;
 | 
			
		||||
import org.springframework.web.multipart.MultipartFile;
 | 
			
		||||
 | 
			
		||||
import javax.annotation.Resource;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 文件上传服务
 | 
			
		||||
 */
 | 
			
		||||
@RestController
 | 
			
		||||
@RequestMapping("/files")
 | 
			
		||||
@Api(value = "File", tags = "文件上传相关接口")
 | 
			
		||||
public class FileUploadController {
 | 
			
		||||
 | 
			
		||||
    @Resource
 | 
			
		||||
    private AliOssService aliOssService;
 | 
			
		||||
 | 
			
		||||
    @ApiOperation(value = "文件上传")
 | 
			
		||||
    @PostMapping("/upload")
 | 
			
		||||
    public R<String> upload(@RequestPart("file") MultipartFile file) {
 | 
			
		||||
        return R.success(aliOssService.upload(file));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @ApiOperation(value = "图片上传")
 | 
			
		||||
    @PostMapping("/imageUpload")
 | 
			
		||||
    public R<String> imageUpload(@RequestPart("file") MultipartFile file) {
 | 
			
		||||
        return R.success(aliOssService.uploadImage(file));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,28 @@
 | 
			
		||||
package com.sl.ms.web.driver.controller;
 | 
			
		||||
 | 
			
		||||
import com.sl.ms.web.driver.service.LoginService;
 | 
			
		||||
import com.sl.ms.web.driver.vo.request.AccountLoginVO;
 | 
			
		||||
import com.sl.transport.common.vo.R;
 | 
			
		||||
import io.swagger.annotations.Api;
 | 
			
		||||
import io.swagger.annotations.ApiOperation;
 | 
			
		||||
import org.springframework.web.bind.annotation.PostMapping;
 | 
			
		||||
import org.springframework.web.bind.annotation.RequestBody;
 | 
			
		||||
import org.springframework.web.bind.annotation.RequestMapping;
 | 
			
		||||
import org.springframework.web.bind.annotation.RestController;
 | 
			
		||||
 | 
			
		||||
import javax.annotation.Resource;
 | 
			
		||||
 | 
			
		||||
@Api(tags = "登录相关接口")
 | 
			
		||||
@RestController
 | 
			
		||||
@RequestMapping("/login")
 | 
			
		||||
public class LoginController {
 | 
			
		||||
 | 
			
		||||
    @Resource
 | 
			
		||||
    private LoginService loginService;
 | 
			
		||||
 | 
			
		||||
    @ApiOperation(value = "账号登录", notes = "登录")
 | 
			
		||||
    @PostMapping(value = "/account")
 | 
			
		||||
    public R<String> accountLogin(@RequestBody AccountLoginVO accountLoginVO) {
 | 
			
		||||
        return R.success(loginService.accountLogin(accountLoginVO));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,52 @@
 | 
			
		||||
package com.sl.ms.web.driver.controller;
 | 
			
		||||
 | 
			
		||||
import com.sl.ms.web.driver.service.MessageService;
 | 
			
		||||
import com.sl.ms.web.driver.vo.response.MessageVO;
 | 
			
		||||
import com.sl.transport.common.util.PageResponse;
 | 
			
		||||
import com.sl.transport.common.vo.R;
 | 
			
		||||
import io.swagger.annotations.Api;
 | 
			
		||||
import io.swagger.annotations.ApiImplicitParam;
 | 
			
		||||
import io.swagger.annotations.ApiImplicitParams;
 | 
			
		||||
import io.swagger.annotations.ApiOperation;
 | 
			
		||||
import org.springframework.web.bind.annotation.*;
 | 
			
		||||
 | 
			
		||||
import javax.annotation.Resource;
 | 
			
		||||
 | 
			
		||||
@Api(tags = "消息相关接口")
 | 
			
		||||
@RestController
 | 
			
		||||
@RequestMapping("/messages")
 | 
			
		||||
public class MessageController {
 | 
			
		||||
 | 
			
		||||
    @Resource
 | 
			
		||||
    private MessageService messageService;
 | 
			
		||||
 | 
			
		||||
    @GetMapping("/page")
 | 
			
		||||
    @ApiOperation(value = "分页查询消息列表")
 | 
			
		||||
    @ApiImplicitParams({
 | 
			
		||||
            @ApiImplicitParam(name = "contentType", value = "消息类型,200:司机端公告,201:司机端系统通知", required = true, dataTypeClass = Integer.class),
 | 
			
		||||
            @ApiImplicitParam(name = "page", value = "页码", example = "1", required = true, dataTypeClass = Integer.class),
 | 
			
		||||
            @ApiImplicitParam(name = "pageSize", value = "页面大小", example = "10", required = true, dataTypeClass = Integer.class)
 | 
			
		||||
    })
 | 
			
		||||
    public R<PageResponse<MessageVO>> page(@RequestParam("contentType") Integer contentType,
 | 
			
		||||
                                           @RequestParam(name = "page", defaultValue = "1") Integer page,
 | 
			
		||||
                                           @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
 | 
			
		||||
        return R.success(messageService.page(contentType, page, pageSize));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @PutMapping("/{id}")
 | 
			
		||||
    @ApiOperation(value = "标记已读")
 | 
			
		||||
    public R<Void> update2Read(@PathVariable("id") Long id) {
 | 
			
		||||
        messageService.update2Read(id);
 | 
			
		||||
        return R.success();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @GetMapping("/countType/{contentType}")
 | 
			
		||||
    @ApiOperation(value = "根据类型查询未读消息数量")
 | 
			
		||||
    @ApiImplicitParams({
 | 
			
		||||
            @ApiImplicitParam(name = "contentType", value = "消息类型,200:司机端公告,201:司机端系统通知;特别的,0代表查询全部未读", defaultValue = "0", required = true, dataTypeClass = Integer.class)
 | 
			
		||||
    })
 | 
			
		||||
    public R<Integer> countType(@PathVariable("contentType") Integer contentType) {
 | 
			
		||||
        return R.success(messageService.countType(contentType));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,106 @@
 | 
			
		||||
package com.sl.ms.web.driver.controller;
 | 
			
		||||
 | 
			
		||||
import com.sl.ms.web.driver.service.TaskService;
 | 
			
		||||
import com.sl.ms.web.driver.vo.request.DriverDelayDeliveryVO;
 | 
			
		||||
import com.sl.ms.web.driver.vo.request.DriverDeliverVO;
 | 
			
		||||
import com.sl.ms.web.driver.vo.request.DriverPickUpVO;
 | 
			
		||||
import com.sl.ms.web.driver.vo.request.DriverReturnRegisterVO;
 | 
			
		||||
import com.sl.ms.web.driver.vo.response.DriverJobDetailVO;
 | 
			
		||||
import com.sl.ms.web.driver.vo.response.DriverJobVO;
 | 
			
		||||
import com.sl.ms.web.driver.vo.response.TransportOrderVO;
 | 
			
		||||
import com.sl.transport.common.util.PageResponse;
 | 
			
		||||
import com.sl.transport.common.vo.R;
 | 
			
		||||
import io.swagger.annotations.Api;
 | 
			
		||||
import io.swagger.annotations.ApiImplicitParam;
 | 
			
		||||
import io.swagger.annotations.ApiImplicitParams;
 | 
			
		||||
import io.swagger.annotations.ApiOperation;
 | 
			
		||||
import org.springframework.web.bind.annotation.*;
 | 
			
		||||
 | 
			
		||||
import javax.annotation.Resource;
 | 
			
		||||
 | 
			
		||||
@Api(tags = "任务相关接口")
 | 
			
		||||
@RestController
 | 
			
		||||
@RequestMapping("/tasks")
 | 
			
		||||
public class TaskController {
 | 
			
		||||
    @Resource
 | 
			
		||||
    private TaskService taskService;
 | 
			
		||||
 | 
			
		||||
    @GetMapping(value = "/list")
 | 
			
		||||
    @ApiOperation(value = "任务列表", notes = "分页查询任务列表")
 | 
			
		||||
    @ApiImplicitParams({
 | 
			
		||||
            @ApiImplicitParam(name = "page", value = "页码", required = true, dataTypeClass = Integer.class),
 | 
			
		||||
            @ApiImplicitParam(name = "pageSize", value = "页面大小", required = true, dataTypeClass = Integer.class),
 | 
			
		||||
            @ApiImplicitParam(name = "status", value = "作业状态,1为待提货)、2为在途(在途和已交付)、3为改派、5为已作废、6为已完成(已回车登记)", required = true, dataTypeClass = Integer.class),
 | 
			
		||||
            @ApiImplicitParam(name = "startTime", value = "开始时间", example = "2022-06-12", dataTypeClass = String.class),
 | 
			
		||||
            @ApiImplicitParam(name = "endTime", value = "结束时间", example = "2022-07-12", dataTypeClass = String.class),
 | 
			
		||||
            @ApiImplicitParam(name = "transportTaskId", value = "运输任务id", dataTypeClass = String.class)
 | 
			
		||||
    })
 | 
			
		||||
    public R<PageResponse<DriverJobVO>> pageQuery(@RequestParam(name = "page", defaultValue = "1") Integer page,
 | 
			
		||||
                                                  @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
 | 
			
		||||
                                                  @RequestParam("status") Integer status,
 | 
			
		||||
                                                  @RequestParam(name = "startTime", required = false) String startTime,
 | 
			
		||||
                                                  @RequestParam(name = "endTime", required = false) String endTime,
 | 
			
		||||
                                                  @RequestParam(name = "transportTaskId", required = false) String transportTaskId) {
 | 
			
		||||
        PageResponse<DriverJobVO> pageResponse = taskService.pageQuery(page, pageSize, status, startTime, endTime, transportTaskId);
 | 
			
		||||
        return R.success(pageResponse);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @GetMapping("details/{jobId}")
 | 
			
		||||
    @ApiOperation(value = "任务详情", notes = "获取任务详情")
 | 
			
		||||
    @ApiImplicitParams({
 | 
			
		||||
            @ApiImplicitParam(name = "jobId", value = "作业id", required = true, dataTypeClass = String.class)
 | 
			
		||||
    })
 | 
			
		||||
    public R<DriverJobDetailVO> details(@PathVariable("jobId") String jobId) {
 | 
			
		||||
        return R.success(taskService.details(jobId));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @GetMapping("orders")
 | 
			
		||||
    @ApiOperation(value = "条件查询货物信息列表", notes = "根据运输任务id分页查询运单列表")
 | 
			
		||||
    @ApiImplicitParams({
 | 
			
		||||
            @ApiImplicitParam(name = "page", value = "页码", required = true, example = "1", dataTypeClass = Integer.class),
 | 
			
		||||
            @ApiImplicitParam(name = "pageSize", value = "页面大小", required = true, example = "10", dataTypeClass = Integer.class),
 | 
			
		||||
            @ApiImplicitParam(name = "taskId", value = "运输任务id", required = true, dataTypeClass = String.class),
 | 
			
		||||
            @ApiImplicitParam(name = "transportOrderId", value = "运单id", dataTypeClass = String.class)
 | 
			
		||||
    })
 | 
			
		||||
    public R<PageResponse<TransportOrderVO>> pageQueryTransportOrder(@RequestParam(name = "page", defaultValue = "1") Integer page,
 | 
			
		||||
                                                                     @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
 | 
			
		||||
                                                                     @RequestParam("taskId") String taskId,
 | 
			
		||||
                                                                     @RequestParam(name = "transportOrderId", required = false) String transportOrderId) {
 | 
			
		||||
        return R.success(taskService.pageQueryTransportOrder(page, pageSize, taskId, transportOrderId));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    @PostMapping("takeDelivery")
 | 
			
		||||
    @ApiOperation(value = "提货", notes = "提货需要更新关联司机作业单、运输任务")
 | 
			
		||||
    public R<Void> takeDelivery(@RequestBody DriverPickUpVO driverPickUpVO) {
 | 
			
		||||
        taskService.takeDelivery(driverPickUpVO);
 | 
			
		||||
        return R.success();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @PutMapping("delay")
 | 
			
		||||
    @ApiOperation(value = "延迟提货", notes = "延迟时间以提货时间往后推最多不超过2小时")
 | 
			
		||||
    public R<Void> delayedDelivery(@RequestBody DriverDelayDeliveryVO driverDelayDeliveryVO) {
 | 
			
		||||
        taskService.delayedDelivery(driverDelayDeliveryVO);
 | 
			
		||||
        return R.success();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @PostMapping("deliver")
 | 
			
		||||
    @ApiOperation(value = "交付", notes = "交付需要更新关联司机作业单、运输任务")
 | 
			
		||||
    public R<Void> deliver(@RequestBody DriverDeliverVO driverDeliverVO) {
 | 
			
		||||
        taskService.deliver(driverDeliverVO);
 | 
			
		||||
        return R.success();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @PostMapping("truckRegistration")
 | 
			
		||||
    @ApiOperation(value = "回车登记", notes = "回车登记,并根据是否可用设置车辆状态")
 | 
			
		||||
    public R<Void> truckRegistration(@RequestBody DriverReturnRegisterVO driverDeliverVO) {
 | 
			
		||||
        taskService.truckRegistration(driverDeliverVO);
 | 
			
		||||
        return R.success();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @GetMapping("dispatchCenterPhone")
 | 
			
		||||
    @ApiOperation(value = "联系调度中心", notes = "司机无法主动取消任务,需要联系调度中心")
 | 
			
		||||
    public R<String> dispatchCenterPhone() {
 | 
			
		||||
        return R.success(taskService.dispatchCenterPhone());
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,32 @@
 | 
			
		||||
package com.sl.ms.web.driver.controller;
 | 
			
		||||
 | 
			
		||||
import com.sl.ms.web.driver.service.TrackService;
 | 
			
		||||
import com.sl.transport.common.vo.R;
 | 
			
		||||
import io.swagger.annotations.Api;
 | 
			
		||||
import io.swagger.annotations.ApiImplicitParam;
 | 
			
		||||
import io.swagger.annotations.ApiImplicitParams;
 | 
			
		||||
import io.swagger.annotations.ApiOperation;
 | 
			
		||||
import org.springframework.web.bind.annotation.PutMapping;
 | 
			
		||||
import org.springframework.web.bind.annotation.RequestMapping;
 | 
			
		||||
import org.springframework.web.bind.annotation.RequestParam;
 | 
			
		||||
import org.springframework.web.bind.annotation.RestController;
 | 
			
		||||
 | 
			
		||||
import javax.annotation.Resource;
 | 
			
		||||
 | 
			
		||||
@Api(tags = "运输轨迹相关接口")
 | 
			
		||||
@RestController
 | 
			
		||||
@RequestMapping("/track")
 | 
			
		||||
public class TrackController {
 | 
			
		||||
    @Resource
 | 
			
		||||
    private TrackService trackService;
 | 
			
		||||
 | 
			
		||||
    @PutMapping("upload")
 | 
			
		||||
    @ApiOperation(value = "车辆上报位置", notes = "车辆上报位置")
 | 
			
		||||
    @ApiImplicitParams({
 | 
			
		||||
            @ApiImplicitParam(name = "lng", value = "经度", required = true, dataTypeClass = String.class),
 | 
			
		||||
            @ApiImplicitParam(name = "lat", value = "纬度", required = true, dataTypeClass = String.class)})
 | 
			
		||||
    public R<Boolean> uploadLocation(@RequestParam("lng") String lng,
 | 
			
		||||
                                     @RequestParam("lat") String lat) {
 | 
			
		||||
        return R.success(trackService.uploadLocation(lng, lat));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,47 @@
 | 
			
		||||
package com.sl.ms.web.driver.controller;
 | 
			
		||||
 | 
			
		||||
import com.sl.ms.web.driver.service.UserService;
 | 
			
		||||
import com.sl.ms.web.driver.vo.response.TaskReportVO;
 | 
			
		||||
import com.sl.ms.web.driver.vo.response.TruckDetailVO;
 | 
			
		||||
import com.sl.ms.web.driver.vo.response.UserDetailVO;
 | 
			
		||||
import com.sl.transport.common.vo.R;
 | 
			
		||||
import io.swagger.annotations.Api;
 | 
			
		||||
import io.swagger.annotations.ApiImplicitParam;
 | 
			
		||||
import io.swagger.annotations.ApiImplicitParams;
 | 
			
		||||
import io.swagger.annotations.ApiOperation;
 | 
			
		||||
import org.springframework.web.bind.annotation.GetMapping;
 | 
			
		||||
import org.springframework.web.bind.annotation.RequestMapping;
 | 
			
		||||
import org.springframework.web.bind.annotation.RequestParam;
 | 
			
		||||
import org.springframework.web.bind.annotation.RestController;
 | 
			
		||||
 | 
			
		||||
import javax.annotation.Resource;
 | 
			
		||||
 | 
			
		||||
@Api(tags = "我的相关接口")
 | 
			
		||||
@RestController
 | 
			
		||||
@RequestMapping("/users")
 | 
			
		||||
public class UserController {
 | 
			
		||||
    @Resource
 | 
			
		||||
    private UserService userService;
 | 
			
		||||
 | 
			
		||||
    @GetMapping
 | 
			
		||||
    @ApiOperation(value = "用户信息", notes = "获取当前用户信息")
 | 
			
		||||
    public R<UserDetailVO> userDetail() {
 | 
			
		||||
        return R.success(userService.userDetail());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @GetMapping("truck")
 | 
			
		||||
    @ApiOperation(value = "车辆信息", notes = "获取关联用户的车辆信息")
 | 
			
		||||
    public R<TruckDetailVO> truckDetail() {
 | 
			
		||||
        return R.success(userService.truckDetail());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @GetMapping("taskReport")
 | 
			
		||||
    @ApiOperation(value = "任务数据", notes = "统计任务数量及每日里程数据")
 | 
			
		||||
    @ApiImplicitParams({
 | 
			
		||||
            @ApiImplicitParam(name = "year", value = "年份", required = true, example = "2022", dataTypeClass = String.class),
 | 
			
		||||
            @ApiImplicitParam(name = "month", value = "月份", required = true, example = "07", dataTypeClass = String.class)
 | 
			
		||||
    })
 | 
			
		||||
    public R<TaskReportVO> taskReport(@RequestParam("year") String year, @RequestParam("month") String month) {
 | 
			
		||||
        return R.success(userService.taskReport(year, month));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,13 @@
 | 
			
		||||
package com.sl.ms.web.driver.service;
 | 
			
		||||
 | 
			
		||||
import com.sl.ms.web.driver.vo.request.AccountLoginVO;
 | 
			
		||||
 | 
			
		||||
public interface LoginService {
 | 
			
		||||
    /**
 | 
			
		||||
     * 账号登录
 | 
			
		||||
     *
 | 
			
		||||
     * @param accountLoginVO 账号登录请求
 | 
			
		||||
     * @return token
 | 
			
		||||
     */
 | 
			
		||||
    String accountLogin(AccountLoginVO accountLoginVO);
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,32 @@
 | 
			
		||||
package com.sl.ms.web.driver.service;
 | 
			
		||||
 | 
			
		||||
import com.sl.ms.web.driver.vo.response.MessageVO;
 | 
			
		||||
import com.sl.transport.common.util.PageResponse;
 | 
			
		||||
 | 
			
		||||
public interface MessageService {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 分页查询消息列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param contentType 消息类型,200:司机端公告,201:司机端系统通知
 | 
			
		||||
     * @param page        页码
 | 
			
		||||
     * @param pageSize    页面大小
 | 
			
		||||
     * @return 分页数据
 | 
			
		||||
     */
 | 
			
		||||
    PageResponse<MessageVO> page(Integer contentType, Integer page, Integer pageSize);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 标记已读
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 消息id
 | 
			
		||||
     */
 | 
			
		||||
    void update2Read(Long id);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据类型查询未读消息数量
 | 
			
		||||
     *
 | 
			
		||||
     * @param contentType 消息类型,200:司机端公告,201:司机端系统通知;特别的,0代表查询全部未读
 | 
			
		||||
     * @return 未读消息条数
 | 
			
		||||
     */
 | 
			
		||||
    Integer countType(Integer contentType);
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,80 @@
 | 
			
		||||
package com.sl.ms.web.driver.service;
 | 
			
		||||
 | 
			
		||||
import com.sl.ms.web.driver.vo.request.DriverDelayDeliveryVO;
 | 
			
		||||
import com.sl.ms.web.driver.vo.request.DriverDeliverVO;
 | 
			
		||||
import com.sl.ms.web.driver.vo.request.DriverPickUpVO;
 | 
			
		||||
import com.sl.ms.web.driver.vo.request.DriverReturnRegisterVO;
 | 
			
		||||
import com.sl.ms.web.driver.vo.response.DriverJobDetailVO;
 | 
			
		||||
import com.sl.ms.web.driver.vo.response.DriverJobVO;
 | 
			
		||||
import com.sl.ms.web.driver.vo.response.TransportOrderVO;
 | 
			
		||||
import com.sl.transport.common.util.PageResponse;
 | 
			
		||||
 | 
			
		||||
public interface TaskService {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 分页查询任务列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param page            页码
 | 
			
		||||
     * @param pageSize        页面大小
 | 
			
		||||
     * @param status          作业状态,1为待提货)、2为在途(在途和已交付)、3为改派、5为已作废、6为已完成(已回车登记)
 | 
			
		||||
     * @param startTime       开始时间
 | 
			
		||||
     * @param endTime         结束时间
 | 
			
		||||
     * @param transportTaskId 运输任务id
 | 
			
		||||
     * @return 分页数据
 | 
			
		||||
     */
 | 
			
		||||
    PageResponse<DriverJobVO> pageQuery(Integer page, Integer pageSize, Integer status, String startTime, String endTime, String transportTaskId);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取任务详情
 | 
			
		||||
     *
 | 
			
		||||
     * @param jobId 作业id
 | 
			
		||||
     * @return 任务详情
 | 
			
		||||
     */
 | 
			
		||||
    DriverJobDetailVO details(String jobId);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据运输任务id分页查询运单信息
 | 
			
		||||
     *
 | 
			
		||||
     * @param page             页码
 | 
			
		||||
     * @param pageSize         页面大小
 | 
			
		||||
     * @param taskId           运输任务id
 | 
			
		||||
     * @param transportOrderId 运单id
 | 
			
		||||
     * @return 运单对象分页数据
 | 
			
		||||
     */
 | 
			
		||||
    PageResponse<TransportOrderVO> pageQueryTransportOrder(Integer page, Integer pageSize, String taskId, String transportOrderId);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 提货
 | 
			
		||||
     *
 | 
			
		||||
     * @param driverPickUpVO 提货对象(作业id、提货凭证、提货图片)
 | 
			
		||||
     */
 | 
			
		||||
    void takeDelivery(DriverPickUpVO driverPickUpVO);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 延迟提货
 | 
			
		||||
     *
 | 
			
		||||
     * @param driverDelayDeliveryVO 延迟提货对象
 | 
			
		||||
     */
 | 
			
		||||
    void delayedDelivery(DriverDelayDeliveryVO driverDelayDeliveryVO);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 交付
 | 
			
		||||
     *
 | 
			
		||||
     * @param driverDeliverVO 提货对象(作业id、交付凭证、交付图片)
 | 
			
		||||
     */
 | 
			
		||||
    void deliver(DriverDeliverVO driverDeliverVO);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 回车登记
 | 
			
		||||
     *
 | 
			
		||||
     * @param driverDeliverVO 回车登记信息
 | 
			
		||||
     */
 | 
			
		||||
    void truckRegistration(DriverReturnRegisterVO driverDeliverVO);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 联系调度中心
 | 
			
		||||
     *
 | 
			
		||||
     * @return 调度中心电话
 | 
			
		||||
     */
 | 
			
		||||
    String dispatchCenterPhone();
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,13 @@
 | 
			
		||||
package com.sl.ms.web.driver.service;
 | 
			
		||||
 | 
			
		||||
public interface TrackService {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 车辆上报位置
 | 
			
		||||
     *
 | 
			
		||||
     * @param lng 经度
 | 
			
		||||
     * @param lat 纬度
 | 
			
		||||
     * @return 是否成功
 | 
			
		||||
     */
 | 
			
		||||
    Boolean uploadLocation(String lng, String lat);
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,30 @@
 | 
			
		||||
package com.sl.ms.web.driver.service;
 | 
			
		||||
 | 
			
		||||
import com.sl.ms.web.driver.vo.response.TaskReportVO;
 | 
			
		||||
import com.sl.ms.web.driver.vo.response.TruckDetailVO;
 | 
			
		||||
import com.sl.ms.web.driver.vo.response.UserDetailVO;
 | 
			
		||||
 | 
			
		||||
public interface UserService {
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取用户信息
 | 
			
		||||
     *
 | 
			
		||||
     * @return 用户信息
 | 
			
		||||
     */
 | 
			
		||||
    UserDetailVO userDetail();
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取车辆信息
 | 
			
		||||
     *
 | 
			
		||||
     * @return 车辆信息
 | 
			
		||||
     */
 | 
			
		||||
    TruckDetailVO truckDetail();
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 任务数据
 | 
			
		||||
     *
 | 
			
		||||
     * @param year  年份
 | 
			
		||||
     * @param month 月份
 | 
			
		||||
     * @return 任务相关统计
 | 
			
		||||
     */
 | 
			
		||||
    TaskReportVO taskReport(String year, String month);
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,29 @@
 | 
			
		||||
package com.sl.ms.web.driver.service.impl;
 | 
			
		||||
 | 
			
		||||
import com.itheima.auth.sdk.AuthTemplate;
 | 
			
		||||
import com.itheima.auth.sdk.common.Result;
 | 
			
		||||
import com.itheima.auth.sdk.dto.LoginDTO;
 | 
			
		||||
import com.sl.ms.web.driver.service.LoginService;
 | 
			
		||||
import com.sl.ms.web.driver.vo.request.AccountLoginVO;
 | 
			
		||||
import com.sl.transport.common.exception.SLWebException;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
 | 
			
		||||
import javax.annotation.Resource;
 | 
			
		||||
 | 
			
		||||
@Service
 | 
			
		||||
public class LoginServiceImpl implements LoginService {
 | 
			
		||||
    @Resource
 | 
			
		||||
    private AuthTemplate authTemplate;
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String accountLogin(AccountLoginVO accountLoginVO) {
 | 
			
		||||
        //账号密码登录
 | 
			
		||||
        Result<LoginDTO> loginResult = authTemplate.opsForLogin().token(accountLoginVO.getAccount(), accountLoginVO.getPassword());
 | 
			
		||||
 | 
			
		||||
        //校验登录是否成功
 | 
			
		||||
        if (loginResult.getCode() != Result.success().getCode()) {
 | 
			
		||||
            throw new SLWebException("登录失败");
 | 
			
		||||
        }
 | 
			
		||||
        return loginResult.getData().getToken().getToken();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,79 @@
 | 
			
		||||
package com.sl.ms.web.driver.service.impl;
 | 
			
		||||
 | 
			
		||||
import cn.hutool.core.util.ObjectUtil;
 | 
			
		||||
import com.sl.ms.base.api.common.MessageFeign;
 | 
			
		||||
import com.sl.ms.base.domain.base.MessageDTO;
 | 
			
		||||
import com.sl.ms.base.domain.base.MessageQueryDTO;
 | 
			
		||||
import com.sl.ms.base.domain.constants.MessageConstants;
 | 
			
		||||
import com.sl.ms.base.domain.enums.MessageBussinessTypeEnum;
 | 
			
		||||
import com.sl.ms.web.driver.service.MessageService;
 | 
			
		||||
import com.sl.ms.web.driver.vo.response.MessageVO;
 | 
			
		||||
import com.sl.transport.common.util.PageResponse;
 | 
			
		||||
import com.sl.transport.common.util.UserThreadLocal;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
 | 
			
		||||
import javax.annotation.Resource;
 | 
			
		||||
 | 
			
		||||
@Service
 | 
			
		||||
public class MessageServiceImpl implements MessageService {
 | 
			
		||||
    @Resource
 | 
			
		||||
    private MessageFeign messageFeign;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 分页查询消息列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param contentType 消息类型,200:司机端公告,201:司机端系统通知
 | 
			
		||||
     * @param page        页码
 | 
			
		||||
     * @param pageSize    页面大小
 | 
			
		||||
     * @return 分页数据
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public PageResponse<MessageVO> page(Integer contentType, Integer page, Integer pageSize) {
 | 
			
		||||
        //构建查询条件
 | 
			
		||||
        MessageQueryDTO messageQueryDTO = new MessageQueryDTO();
 | 
			
		||||
        messageQueryDTO.setPage(page);
 | 
			
		||||
        messageQueryDTO.setPageSize(pageSize);
 | 
			
		||||
        messageQueryDTO.setBussinessType(MessageBussinessTypeEnum.DRIVER.getCode());
 | 
			
		||||
        messageQueryDTO.setContentType(contentType);
 | 
			
		||||
        messageQueryDTO.setUserId(UserThreadLocal.getUserId());
 | 
			
		||||
 | 
			
		||||
        //查询消息数据
 | 
			
		||||
        PageResponse<MessageDTO> pageResponse = messageFeign.page(messageQueryDTO);
 | 
			
		||||
 | 
			
		||||
        //dto转为vo.组装分页数据
 | 
			
		||||
        return PageResponse.of(pageResponse, MessageVO.class);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 标记已读
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 消息id
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public void update2Read(Long id) {
 | 
			
		||||
        messageFeign.update2Read(id);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据类型查询未读消息数量
 | 
			
		||||
     *
 | 
			
		||||
     * @param contentType 消息类型,200:司机端公告,201:司机端系统通知;特别的,0代表查询全部未读
 | 
			
		||||
     * @return 未读消息条数
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public Integer countType(Integer contentType) {
 | 
			
		||||
        //构件查询条件
 | 
			
		||||
        MessageQueryDTO messageQueryDTO = new MessageQueryDTO();
 | 
			
		||||
        messageQueryDTO.setBussinessType(MessageBussinessTypeEnum.DRIVER.getCode());
 | 
			
		||||
        messageQueryDTO.setUserId(UserThreadLocal.getUserId());
 | 
			
		||||
        messageQueryDTO.setIsRead(MessageConstants.UNREAD);
 | 
			
		||||
 | 
			
		||||
        //0代表查询全部未读,否则传入具体类型
 | 
			
		||||
        if (ObjectUtil.notEqual(contentType, 0)) {
 | 
			
		||||
            messageQueryDTO.setContentType(contentType);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        //查询未读消息条数
 | 
			
		||||
        return messageFeign.countType(messageQueryDTO);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,390 @@
 | 
			
		||||
package com.sl.ms.web.driver.service.impl;
 | 
			
		||||
 | 
			
		||||
import cn.hutool.core.bean.BeanUtil;
 | 
			
		||||
import cn.hutool.core.collection.CollUtil;
 | 
			
		||||
import cn.hutool.core.date.DatePattern;
 | 
			
		||||
import cn.hutool.core.date.LocalDateTimeUtil;
 | 
			
		||||
import cn.hutool.core.text.CharSequenceUtil;
 | 
			
		||||
import cn.hutool.core.util.ObjectUtil;
 | 
			
		||||
import cn.hutool.json.JSONUtil;
 | 
			
		||||
import com.itheima.auth.sdk.AuthTemplate;
 | 
			
		||||
import com.itheima.auth.sdk.common.Result;
 | 
			
		||||
import com.itheima.auth.sdk.dto.PageDTO;
 | 
			
		||||
import com.itheima.auth.sdk.dto.UserDTO;
 | 
			
		||||
import com.itheima.auth.sdk.dto.UserPageDTO;
 | 
			
		||||
import com.sl.ms.base.api.truck.TruckFeign;
 | 
			
		||||
import com.sl.ms.base.domain.truck.TruckDto;
 | 
			
		||||
import com.sl.ms.driver.api.DriverJobFeign;
 | 
			
		||||
import com.sl.ms.driver.domain.dto.request.*;
 | 
			
		||||
import com.sl.ms.driver.domain.dto.response.DriverJobDTO;
 | 
			
		||||
import com.sl.ms.driver.domain.enums.DriverJobStatus;
 | 
			
		||||
import com.sl.ms.transport.api.OrganFeign;
 | 
			
		||||
import com.sl.ms.web.driver.service.TaskService;
 | 
			
		||||
import com.sl.ms.web.driver.vo.AreaVO;
 | 
			
		||||
import com.sl.ms.web.driver.vo.request.DriverDelayDeliveryVO;
 | 
			
		||||
import com.sl.ms.web.driver.vo.request.DriverDeliverVO;
 | 
			
		||||
import com.sl.ms.web.driver.vo.request.DriverPickUpVO;
 | 
			
		||||
import com.sl.ms.web.driver.vo.request.DriverReturnRegisterVO;
 | 
			
		||||
import com.sl.ms.web.driver.vo.response.DriverJobDetailVO;
 | 
			
		||||
import com.sl.ms.web.driver.vo.response.DriverJobVO;
 | 
			
		||||
import com.sl.ms.web.driver.vo.response.TransportOrderVO;
 | 
			
		||||
import com.sl.ms.work.api.TransportOrderFeign;
 | 
			
		||||
import com.sl.ms.work.api.TransportTaskFeign;
 | 
			
		||||
import com.sl.ms.work.domain.dto.TransportOrderDTO;
 | 
			
		||||
import com.sl.ms.work.domain.dto.TransportTaskDTO;
 | 
			
		||||
import com.sl.transport.common.exception.SLWebException;
 | 
			
		||||
import com.sl.transport.common.util.AuthTemplateThreadLocal;
 | 
			
		||||
import com.sl.transport.common.util.PageResponse;
 | 
			
		||||
import com.sl.transport.common.util.UserThreadLocal;
 | 
			
		||||
import com.sl.transport.domain.OrganDTO;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Value;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
 | 
			
		||||
import javax.annotation.Resource;
 | 
			
		||||
import java.time.LocalDateTime;
 | 
			
		||||
import java.util.ArrayList;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
import java.util.Map;
 | 
			
		||||
import java.util.concurrent.CompletableFuture;
 | 
			
		||||
import java.util.stream.Collectors;
 | 
			
		||||
 | 
			
		||||
@Service
 | 
			
		||||
public class TaskServiceImpl implements TaskService {
 | 
			
		||||
    @Resource
 | 
			
		||||
    private DriverJobFeign driverJobFeign;
 | 
			
		||||
    @Resource
 | 
			
		||||
    private OrganFeign organFeign;
 | 
			
		||||
    @Resource
 | 
			
		||||
    private TransportOrderFeign transportOrderFeign;
 | 
			
		||||
    @Resource
 | 
			
		||||
    private TransportTaskFeign transportTaskFeign;
 | 
			
		||||
    @Resource
 | 
			
		||||
    private TruckFeign truckFeign;
 | 
			
		||||
    @Value("${role.dispatcher}")
 | 
			
		||||
    private String dispatcherRoleId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 入参为2,前端tab的在途任务列表,对应数据库死记作业单状态为:在途和已交付
 | 
			
		||||
     */
 | 
			
		||||
    private static final Integer PROCESSING_STATUS_TAB = 2;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 分页查询任务列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param page            页码
 | 
			
		||||
     * @param pageSize        页面大小
 | 
			
		||||
     * @param status          作业状态,1为待提货、2为(在途和已交付)、3为改派、4为已交付)、5为已作废、6为已完成(已回车登记)
 | 
			
		||||
     * @param startTime       开始时间
 | 
			
		||||
     * @param endTime         结束时间
 | 
			
		||||
     * @param transportTaskId 运输任务id
 | 
			
		||||
     * @return 分页数据
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public PageResponse<DriverJobVO> pageQuery(Integer page, Integer pageSize, Integer status, String startTime, String endTime, String transportTaskId) {
 | 
			
		||||
        //当前司机id
 | 
			
		||||
        Long userId = UserThreadLocal.getUserId();
 | 
			
		||||
        //开始时间,可以传null。标准入参格式:2022-07-13,此处转换为:2022-07-13 00:00:00
 | 
			
		||||
        LocalDateTime taskStartTime = LocalDateTimeUtil.parse(startTime, DatePattern.NORM_DATE_PATTERN);
 | 
			
		||||
        //结束时间,同开始时间格式
 | 
			
		||||
        LocalDateTime taskEndTime = CharSequenceUtil.isBlank(endTime) ? null : LocalDateTimeUtil.endOfDay(LocalDateTimeUtil.parse(endTime, DatePattern.NORM_DATE_PATTERN));
 | 
			
		||||
 | 
			
		||||
        //状态为2需要查询在途和已交付两种状态
 | 
			
		||||
        List<DriverJobStatus> statusList = new ArrayList<>();
 | 
			
		||||
        if (status.equals(PROCESSING_STATUS_TAB)) {
 | 
			
		||||
            statusList.add(DriverJobStatus.PROCESSING);
 | 
			
		||||
            statusList.add(DriverJobStatus.DELIVERED);
 | 
			
		||||
        } else {
 | 
			
		||||
            statusList.add(DriverJobStatus.codeOf(status));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        //构造查询条件
 | 
			
		||||
        DriverJobPageQueryDTO driverJobPageQueryDTO = DriverJobPageQueryDTO.builder()
 | 
			
		||||
                .page(page)
 | 
			
		||||
                .pageSize(pageSize)
 | 
			
		||||
                .statusList(statusList)
 | 
			
		||||
                .driverId(userId)
 | 
			
		||||
                .minTaskTime(taskStartTime)
 | 
			
		||||
                .maxTaskTime(taskEndTime)
 | 
			
		||||
                .transportTaskId(CharSequenceUtil.isBlank(transportTaskId) ? null : Long.valueOf(transportTaskId))
 | 
			
		||||
                .build();
 | 
			
		||||
 | 
			
		||||
        //条件分页查询
 | 
			
		||||
        PageResponse<DriverJobDTO> pageResponse = driverJobFeign.pageQuery(driverJobPageQueryDTO);
 | 
			
		||||
        if (ObjectUtil.isEmpty(pageResponse.getItems())) {
 | 
			
		||||
            return PageResponse.of(pageResponse, DriverJobVO.class);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        //批量查询出分页结果中涉及的起止机构信息
 | 
			
		||||
        List<Long> agencyIds = new ArrayList<>();
 | 
			
		||||
        pageResponse.getItems().forEach(dto -> {
 | 
			
		||||
            agencyIds.add(dto.getStartAgencyId());
 | 
			
		||||
            agencyIds.add(dto.getEndAgencyId());
 | 
			
		||||
        });
 | 
			
		||||
        List<OrganDTO> organDTOS = organFeign.queryByIds(agencyIds);
 | 
			
		||||
        Map<Long, OrganDTO> organMap = organDTOS.stream().collect(Collectors.toMap(OrganDTO::getId, dto -> dto));
 | 
			
		||||
 | 
			
		||||
        //dto转换为vo(组装起止机构详细地址)
 | 
			
		||||
        return PageResponse.of(pageResponse, DriverJobVO.class, (dto, vo) -> {
 | 
			
		||||
            //通过机构id获取详细地址
 | 
			
		||||
            String startAddress = parse2AreaVO(dto.getStartAgencyId(), organMap);
 | 
			
		||||
            String endAddress = parse2AreaVO(dto.getEndAgencyId(), organMap);
 | 
			
		||||
 | 
			
		||||
            vo.setStartAddress(startAddress);
 | 
			
		||||
            vo.setEndAddress(endAddress);
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 通过机构id获取详细地址
 | 
			
		||||
     *
 | 
			
		||||
     * @param agencyId 机构id
 | 
			
		||||
     * @return 机构地址
 | 
			
		||||
     */
 | 
			
		||||
    private String parse2AreaVO(Long agencyId, Map<Long, OrganDTO> organMap) {
 | 
			
		||||
        OrganDTO organDTO = organMap.get(agencyId);
 | 
			
		||||
        AreaVO areaVO = JSONUtil.toBean(organDTO.getAddress(), AreaVO.class);
 | 
			
		||||
        return CharSequenceUtil.strBuilder(areaVO.getProvince().getName(), areaVO.getCity().getName(), areaVO.getCounty().getName(), areaVO.getAddress()).toString();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取任务详情
 | 
			
		||||
     *
 | 
			
		||||
     * @param jobId 作业id
 | 
			
		||||
     * @return 任务详情
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public DriverJobDetailVO details(String jobId) {
 | 
			
		||||
        //司机作业单相关
 | 
			
		||||
        DriverJobDTO driverJobDTO = driverJobFeign.findById(Long.valueOf(jobId));
 | 
			
		||||
        DriverJobDetailVO driverJobDetailVO = BeanUtil.toBean(driverJobDTO, DriverJobDetailVO.class);
 | 
			
		||||
 | 
			
		||||
        //异步任务编排:
 | 
			
		||||
        //任务1:获取起止机构信息-->起始机构数据提取、目的机构数据提取
 | 
			
		||||
        //任务2:获取运输任务信息-->提取提货交货图片、获取车辆相关信息
 | 
			
		||||
        //任务3:关联运输任务的司机
 | 
			
		||||
        //3项任务全部完成,返回结果
 | 
			
		||||
 | 
			
		||||
        //任务1:获取起止机构信息
 | 
			
		||||
        CompletableFuture<List<OrganDTO>> organFuture =
 | 
			
		||||
                CompletableFuture.supplyAsync(() -> organFeign.queryByIds(List.of(driverJobDTO.getStartAgencyId(), driverJobDTO.getEndAgencyId())));
 | 
			
		||||
 | 
			
		||||
        //任务1.1:起始机构数据提取
 | 
			
		||||
        CompletableFuture<Void> startOrganFuture =
 | 
			
		||||
                organFuture.thenAcceptAsync(organDTOS -> assembleStartOrgan(driverJobDTO.getStartAgencyId(), driverJobDetailVO, organDTOS));
 | 
			
		||||
 | 
			
		||||
        //任务1.2:目的机构数据提取
 | 
			
		||||
        CompletableFuture<Void> endOrganFuture =
 | 
			
		||||
                organFuture.thenAccept(organDTOS -> assembleEndOrgan(driverJobDTO.getEndAgencyId(), driverJobDetailVO, organDTOS));
 | 
			
		||||
 | 
			
		||||
        //任务2:获取运输任务信息
 | 
			
		||||
        CompletableFuture<TransportTaskDTO> transportTaskFuture =
 | 
			
		||||
                CompletableFuture.supplyAsync(() -> transportTaskFeign.findById(driverJobDTO.getTransportTaskId()));
 | 
			
		||||
 | 
			
		||||
        //任务2.1:提取提货交货图片
 | 
			
		||||
        CompletableFuture<Void> pictureFuture =
 | 
			
		||||
                transportTaskFuture.thenAcceptAsync(transportTaskDTO -> assemblePicture(driverJobDetailVO, transportTaskDTO));
 | 
			
		||||
 | 
			
		||||
        //任务2.2:获取车辆相关信息
 | 
			
		||||
        CompletableFuture<Void> truckFuture = transportTaskFuture.thenAcceptAsync(transportTaskDTO -> {
 | 
			
		||||
            //车辆相关
 | 
			
		||||
            TruckDto truckDto = truckFeign.fineById(transportTaskDTO.getTruckId());
 | 
			
		||||
            driverJobDetailVO.setLicensePlate(truckDto.getLicensePlate());
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        //任务3:关联运输任务的司机
 | 
			
		||||
        AuthTemplate authTemplate = AuthTemplateThreadLocal.get();
 | 
			
		||||
        CompletableFuture<Void> driverNameFuture =
 | 
			
		||||
                CompletableFuture.runAsync(() -> assembleDriverName(driverJobDTO.getTransportTaskId(), driverJobDetailVO, authTemplate));
 | 
			
		||||
 | 
			
		||||
        //等待所有任务完成
 | 
			
		||||
        CompletableFuture.allOf(startOrganFuture, endOrganFuture, pictureFuture, truckFuture, driverNameFuture).join();
 | 
			
		||||
        return driverJobDetailVO;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 运输任务的司机信息封装到司机作业单详情
 | 
			
		||||
     *
 | 
			
		||||
     * @param transportTaskId   运输任务id
 | 
			
		||||
     * @param driverJobDetailVO 司机作业单详情
 | 
			
		||||
     * @param authTemplate      权限系统client
 | 
			
		||||
     */
 | 
			
		||||
    private void assembleDriverName(Long transportTaskId, DriverJobDetailVO driverJobDetailVO, AuthTemplate authTemplate) {
 | 
			
		||||
        //关联运输任务的司机作业单
 | 
			
		||||
        DriverJobPageQueryDTO driverJobPageQueryDTO = DriverJobPageQueryDTO.builder().page(1).pageSize(999).transportTaskId(transportTaskId).build();
 | 
			
		||||
        PageResponse<DriverJobDTO> pageResponse = driverJobFeign.pageQuery(driverJobPageQueryDTO);
 | 
			
		||||
        //关联车辆的司机id列表
 | 
			
		||||
        List<Long> driverIds = pageResponse.getItems().stream().map(DriverJobDTO::getDriverId).collect(Collectors.toList());
 | 
			
		||||
        //关联车辆的司机姓名列表
 | 
			
		||||
        List<String> driverNameList = driverIds.stream().map(x -> authTemplate.opsForUser().getUserById(x).getData().getName()).collect(Collectors.toList());
 | 
			
		||||
        //司机姓名列表转换为逗号隔开的字符串
 | 
			
		||||
        String driverNamesStr = CollUtil.join(driverNameList, ",");
 | 
			
		||||
        driverJobDetailVO.setDriverName(driverNamesStr);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 提货、交付图片信息封装到司机作业单详情
 | 
			
		||||
     *
 | 
			
		||||
     * @param driverJobDetailVO 司机作业单详情
 | 
			
		||||
     * @param transportTaskDTO  运输任务
 | 
			
		||||
     */
 | 
			
		||||
    private static void assemblePicture(DriverJobDetailVO driverJobDetailVO, TransportTaskDTO transportTaskDTO) {
 | 
			
		||||
        //提货凭证
 | 
			
		||||
        List<String> cargoPickUpPicture = CharSequenceUtil.split(transportTaskDTO.getCargoPickUpPicture(), ",");
 | 
			
		||||
        //提货图片
 | 
			
		||||
        List<String> cargoPicture = CharSequenceUtil.split(transportTaskDTO.getCargoPicture(), ",");
 | 
			
		||||
        //回单凭证
 | 
			
		||||
        List<String> transportCertificate = CharSequenceUtil.split(transportTaskDTO.getTransportCertificate(), ",");
 | 
			
		||||
        //回单图片
 | 
			
		||||
        List<String> deliverPicture = CharSequenceUtil.split(transportTaskDTO.getDeliverPicture(), ",");
 | 
			
		||||
 | 
			
		||||
        driverJobDetailVO.setCargoPickUpPicture(cargoPickUpPicture);
 | 
			
		||||
        driverJobDetailVO.setCargoPicture(cargoPicture);
 | 
			
		||||
        driverJobDetailVO.setTransportCertificate(transportCertificate);
 | 
			
		||||
        driverJobDetailVO.setDeliverPicture(deliverPicture);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 目的机构信息封装到司机作业单详情
 | 
			
		||||
     *
 | 
			
		||||
     * @param endAgencyId       目的机构id
 | 
			
		||||
     * @param driverJobDetailVO 司机作业单详情
 | 
			
		||||
     * @param organDTOS         起止机构
 | 
			
		||||
     */
 | 
			
		||||
    private static void assembleEndOrgan(Long endAgencyId, DriverJobDetailVO driverJobDetailVO, List<OrganDTO> organDTOS) {
 | 
			
		||||
        //目的机构相关
 | 
			
		||||
        OrganDTO endOrganDTO = organDTOS.stream().filter(dto -> dto.getId().equals(endAgencyId)).findFirst().orElse(null);
 | 
			
		||||
        //目的机构地址对象
 | 
			
		||||
        AreaVO endAreaVO = JSONUtil.toBean(endOrganDTO.getAddress(), AreaVO.class);
 | 
			
		||||
        //目的机构详细地址
 | 
			
		||||
        String endAddress = CharSequenceUtil.builder(endAreaVO.getProvince().getName(), endAreaVO.getCity().getName(), endAreaVO.getCounty().getName(), endAreaVO.getAddress()).toString();
 | 
			
		||||
        driverJobDetailVO.setEndProvince(endAreaVO.getProvince().getName());
 | 
			
		||||
        driverJobDetailVO.setEndCity(endAreaVO.getCity().getName());
 | 
			
		||||
        driverJobDetailVO.setEndAddress(endAddress);
 | 
			
		||||
        driverJobDetailVO.setFinishHandover(endOrganDTO.getManagerName());
 | 
			
		||||
        driverJobDetailVO.setFinishHandoverPhone(endOrganDTO.getPhone());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 起始机构信息封装到司机作业单详情
 | 
			
		||||
     *
 | 
			
		||||
     * @param startAgencyId     起始机构id
 | 
			
		||||
     * @param driverJobDetailVO 司机作业单详情
 | 
			
		||||
     * @param organDTOS         起止机构
 | 
			
		||||
     */
 | 
			
		||||
    private static void assembleStartOrgan(Long startAgencyId, DriverJobDetailVO driverJobDetailVO, List<OrganDTO> organDTOS) {
 | 
			
		||||
        //起始机构相关
 | 
			
		||||
        OrganDTO startOrganDTO = organDTOS.stream().filter(dto -> dto.getId().equals(startAgencyId)).findFirst().orElse(null);
 | 
			
		||||
        //起始机构地址对象
 | 
			
		||||
        AreaVO startAreaVO = JSONUtil.toBean(startOrganDTO.getAddress(), AreaVO.class);
 | 
			
		||||
        //起始机构详细地址
 | 
			
		||||
        String startAddress = CharSequenceUtil.builder(startAreaVO.getProvince().getName(), startAreaVO.getCity().getName(), startAreaVO.getCounty().getName(), startAreaVO.getAddress()).toString();
 | 
			
		||||
        driverJobDetailVO.setStartProvince(startAreaVO.getProvince().getName());
 | 
			
		||||
        driverJobDetailVO.setStartCity(startAreaVO.getCity().getName());
 | 
			
		||||
        driverJobDetailVO.setStartAddress(startAddress);
 | 
			
		||||
        driverJobDetailVO.setStartHandover(startOrganDTO.getManagerName());
 | 
			
		||||
        driverJobDetailVO.setStartHandoverPhone(startOrganDTO.getPhone());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据运输任务id分页查询运单信息
 | 
			
		||||
     *
 | 
			
		||||
     * @param page             页码
 | 
			
		||||
     * @param pageSize         页面大小
 | 
			
		||||
     * @param taskId           运输任务id
 | 
			
		||||
     * @param transportOrderId 运单id
 | 
			
		||||
     * @return 运单对象分页数据
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public PageResponse<TransportOrderVO> pageQueryTransportOrder(Integer page, Integer pageSize, String taskId, String transportOrderId) {
 | 
			
		||||
        //根据运输任务id分页查询运单信息,并模糊查询运单id
 | 
			
		||||
        PageResponse<TransportOrderDTO> pageResponse = transportOrderFeign.pageQueryByTaskId(page, pageSize, taskId, transportOrderId);
 | 
			
		||||
 | 
			
		||||
        //将dto转为vo
 | 
			
		||||
        return PageResponse.of(pageResponse, TransportOrderVO.class);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 提货
 | 
			
		||||
     *
 | 
			
		||||
     * @param driverPickUpVO 提货对象(作业id、提货凭证、提货图片)
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public void takeDelivery(DriverPickUpVO driverPickUpVO) {
 | 
			
		||||
        DriverPickUpDTO driverPickUpDTO = BeanUtil.toBean(driverPickUpVO, DriverPickUpDTO.class);
 | 
			
		||||
        driverJobFeign.outStorage(driverPickUpDTO);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 延迟提货
 | 
			
		||||
     *
 | 
			
		||||
     * @param driverDelayDeliveryVO 延迟提货对象
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public void delayedDelivery(DriverDelayDeliveryVO driverDelayDeliveryVO) {
 | 
			
		||||
        DriverDelayDeliveryDTO driverDelayDeliveryDTO = BeanUtil.toBean(driverDelayDeliveryVO, DriverDelayDeliveryDTO.class);
 | 
			
		||||
        driverJobFeign.delayedDelivery(driverDelayDeliveryDTO);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 交付
 | 
			
		||||
     *
 | 
			
		||||
     * @param driverDeliverVO 提货对象(作业id、交付凭证、交付图片)
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public void deliver(DriverDeliverVO driverDeliverVO) {
 | 
			
		||||
        DriverDeliverDTO driverDeliverDTO = BeanUtil.toBean(driverDeliverVO, DriverDeliverDTO.class);
 | 
			
		||||
        driverJobFeign.intoStorage(driverDeliverDTO);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 回车登记
 | 
			
		||||
     *
 | 
			
		||||
     * @param driverReturnRegisterVO 回车登记信息
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public void truckRegistration(DriverReturnRegisterVO driverReturnRegisterVO) {
 | 
			
		||||
        //构建回车登记对象
 | 
			
		||||
        DriverReturnRegisterDTO driverReturnRegisterDTO = BeanUtil.toBean(driverReturnRegisterVO, DriverReturnRegisterDTO.class);
 | 
			
		||||
        driverReturnRegisterDTO.setOutStorageTime(driverReturnRegisterVO.getStartTime());
 | 
			
		||||
        driverReturnRegisterDTO.setIntoStorageTime(driverReturnRegisterVO.getEndTime());
 | 
			
		||||
 | 
			
		||||
        //车辆没有违章,则没有违章类型、不罚款、不扣分
 | 
			
		||||
        if (driverReturnRegisterVO.getIsBreakRules().equals(false)) {
 | 
			
		||||
            driverReturnRegisterDTO.setBreakRulesType(null);
 | 
			
		||||
            driverReturnRegisterDTO.setPenaltyAmount(null);
 | 
			
		||||
            driverReturnRegisterDTO.setDeductPoints(null);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        //车辆没有故障,则没有故障类型
 | 
			
		||||
        if (driverReturnRegisterVO.getIsFault().equals(false)) {
 | 
			
		||||
            driverReturnRegisterDTO.setFaultType(null);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        //车辆没有发生事故,则没有事故类型
 | 
			
		||||
        if (driverReturnRegisterVO.getIsAccident().equals(false)) {
 | 
			
		||||
            driverReturnRegisterDTO.setAccidentType(null);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        //回车登记
 | 
			
		||||
        driverJobFeign.returnRegister(driverReturnRegisterDTO);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 联系调度中心
 | 
			
		||||
     *
 | 
			
		||||
     * @return 调度中心电话
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public String dispatchCenterPhone() {
 | 
			
		||||
        //从权限系统查询调度员
 | 
			
		||||
        UserPageDTO userPageDTO = new UserPageDTO(1, 1, null, null, null, null);
 | 
			
		||||
        userPageDTO.setRoleId(dispatcherRoleId);
 | 
			
		||||
        Result<PageDTO<UserDTO>> result = AuthTemplateThreadLocal.get().opsForUser().getUserByPage(userPageDTO);
 | 
			
		||||
 | 
			
		||||
        PageDTO<UserDTO> pageDTO = result.getData();
 | 
			
		||||
        if (CollUtil.isEmpty(pageDTO.getRecords())) {
 | 
			
		||||
            throw new SLWebException("系统中没有调度员!");
 | 
			
		||||
        }
 | 
			
		||||
        return pageDTO.getRecords().get(0).getMobile();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,51 @@
 | 
			
		||||
package com.sl.ms.web.driver.service.impl;
 | 
			
		||||
 | 
			
		||||
import cn.hutool.core.collection.CollUtil;
 | 
			
		||||
import com.sl.ms.driver.api.DriverJobFeign;
 | 
			
		||||
import com.sl.ms.driver.domain.dto.request.DriverJobPageQueryDTO;
 | 
			
		||||
import com.sl.ms.driver.domain.dto.response.DriverJobDTO;
 | 
			
		||||
import com.sl.ms.driver.domain.enums.DriverJobStatus;
 | 
			
		||||
import com.sl.ms.track.api.TrackFeign;
 | 
			
		||||
import com.sl.ms.web.driver.service.TrackService;
 | 
			
		||||
import com.sl.transport.common.util.PageResponse;
 | 
			
		||||
import com.sl.transport.common.util.UserThreadLocal;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
 | 
			
		||||
import javax.annotation.Resource;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
@Service
 | 
			
		||||
public class TrackServiceImpl implements TrackService {
 | 
			
		||||
    @Resource
 | 
			
		||||
    private DriverJobFeign driverJobFeign;
 | 
			
		||||
    @Resource
 | 
			
		||||
    private TrackFeign trackFeign;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 车辆上报位置
 | 
			
		||||
     *
 | 
			
		||||
     * @param lng 经度
 | 
			
		||||
     * @param lat 纬度
 | 
			
		||||
     * @return 是否成功
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public Boolean uploadLocation(String lng, String lat) {
 | 
			
		||||
        //1. 获取当前用户id
 | 
			
		||||
        Long userId = UserThreadLocal.getUserId();
 | 
			
		||||
 | 
			
		||||
        //2. 查询司机id关联的在途状态司机作业单
 | 
			
		||||
        DriverJobPageQueryDTO pageQueryDTO = DriverJobPageQueryDTO.builder()
 | 
			
		||||
                .page(1)
 | 
			
		||||
                .pageSize(1)
 | 
			
		||||
                .driverId(userId)
 | 
			
		||||
                .statusList(List.of(DriverJobStatus.PROCESSING))
 | 
			
		||||
                .build();
 | 
			
		||||
        PageResponse<DriverJobDTO> pageResponse = driverJobFeign.pageQuery(pageQueryDTO);
 | 
			
		||||
        if (CollUtil.isEmpty(pageResponse.getItems())) {
 | 
			
		||||
            return true;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        //3. 对关联的运输任务上报位置
 | 
			
		||||
        return trackFeign.uploadFromTruck(pageResponse.getItems().get(0).getTransportTaskId(), Double.parseDouble(lng), Double.parseDouble(lat));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,93 @@
 | 
			
		||||
package com.sl.ms.web.driver.service.impl;
 | 
			
		||||
 | 
			
		||||
import cn.hutool.core.bean.BeanUtil;
 | 
			
		||||
import com.itheima.auth.sdk.common.Result;
 | 
			
		||||
import com.itheima.auth.sdk.dto.UserDTO;
 | 
			
		||||
import com.sl.ms.base.api.truck.TruckFeign;
 | 
			
		||||
import com.sl.ms.base.api.truck.TruckTypeFeign;
 | 
			
		||||
import com.sl.ms.base.api.user.DriverFeign;
 | 
			
		||||
import com.sl.ms.base.domain.truck.TruckDto;
 | 
			
		||||
import com.sl.ms.base.domain.truck.TruckTypeDto;
 | 
			
		||||
import com.sl.ms.base.domain.user.TruckDriverDto;
 | 
			
		||||
import com.sl.ms.driver.api.DriverJobFeign;
 | 
			
		||||
import com.sl.ms.driver.domain.dto.response.DriverJobStatisticsDTO;
 | 
			
		||||
import com.sl.ms.web.driver.service.UserService;
 | 
			
		||||
import com.sl.ms.web.driver.vo.response.TaskReportVO;
 | 
			
		||||
import com.sl.ms.web.driver.vo.response.TruckDetailVO;
 | 
			
		||||
import com.sl.ms.web.driver.vo.response.UserDetailVO;
 | 
			
		||||
import com.sl.transport.common.util.AuthTemplateThreadLocal;
 | 
			
		||||
import com.sl.transport.common.util.UserThreadLocal;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
 | 
			
		||||
import javax.annotation.Resource;
 | 
			
		||||
 | 
			
		||||
@Service
 | 
			
		||||
public class UserServiceImpl implements UserService {
 | 
			
		||||
    @Resource
 | 
			
		||||
    private DriverFeign driverFeign;
 | 
			
		||||
    @Resource
 | 
			
		||||
    private TruckFeign truckFeign;
 | 
			
		||||
    @Resource
 | 
			
		||||
    private TruckTypeFeign truckTypeFeign;
 | 
			
		||||
    @Resource
 | 
			
		||||
    private DriverJobFeign driverJobFeign;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取用户信息
 | 
			
		||||
     *
 | 
			
		||||
     * @return 用户信息
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public UserDetailVO userDetail() {
 | 
			
		||||
        //获取用户id
 | 
			
		||||
        Long userId = UserThreadLocal.getUserId();
 | 
			
		||||
 | 
			
		||||
        //根据用户id获取用户详细信息
 | 
			
		||||
        Result<UserDTO> result = AuthTemplateThreadLocal.get().opsForUser().getUserById(userId);
 | 
			
		||||
 | 
			
		||||
        //将用户信息封装到vo
 | 
			
		||||
        UserDTO userDTO = result.getData();
 | 
			
		||||
        UserDetailVO userDetailVO = BeanUtil.toBean(userDTO, UserDetailVO.class);
 | 
			
		||||
        userDetailVO.setNumber(String.valueOf(userId));
 | 
			
		||||
        userDetailVO.setPhone(userDTO.getMobile());
 | 
			
		||||
        return userDetailVO;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取车辆信息
 | 
			
		||||
     *
 | 
			
		||||
     * @return 车辆信息
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public TruckDetailVO truckDetail() {
 | 
			
		||||
        //获取用户id
 | 
			
		||||
        Long userId = UserThreadLocal.getUserId();
 | 
			
		||||
        //根据用户id查询司机相关信息
 | 
			
		||||
        TruckDriverDto truckDriverDto = driverFeign.findOneDriver(userId);
 | 
			
		||||
        //根据车辆id查询车辆信息
 | 
			
		||||
        TruckDto truckDto = truckFeign.fineById(truckDriverDto.getTruckId());
 | 
			
		||||
        //根据车型id查询车型信息
 | 
			
		||||
        TruckTypeDto truckTypeDto = truckTypeFeign.fineById(truckDto.getTruckTypeId());
 | 
			
		||||
 | 
			
		||||
        //车辆信息封装为vo
 | 
			
		||||
        TruckDetailVO truckDetailVO = BeanUtil.toBean(truckDto, TruckDetailVO.class);
 | 
			
		||||
        truckDetailVO.setTruckType(truckTypeDto.getName());
 | 
			
		||||
        return truckDetailVO;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 任务数据
 | 
			
		||||
     *
 | 
			
		||||
     * @param year  年份
 | 
			
		||||
     * @param month 月份
 | 
			
		||||
     * @return 任务相关统计
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public TaskReportVO taskReport(String year, String month) {
 | 
			
		||||
        Long userId = UserThreadLocal.getUserId();
 | 
			
		||||
 | 
			
		||||
        String dateTime = year + "-" + month;
 | 
			
		||||
        DriverJobStatisticsDTO driverJobStatisticsDTO = driverJobFeign.jobMonthlyStatistics(String.valueOf(userId), dateTime);
 | 
			
		||||
        return BeanUtil.toBean(driverJobStatisticsDTO, TaskReportVO.class);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,28 @@
 | 
			
		||||
package com.sl.ms.web.driver.vo;
 | 
			
		||||
 | 
			
		||||
import io.swagger.annotations.ApiModel;
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
import java.util.Map;
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
@ApiModel(value = "行政区域简要信息")
 | 
			
		||||
public class AreaSimpleVO {
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "id")
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "行政名称")
 | 
			
		||||
    private String name;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "经度")
 | 
			
		||||
    private String lng;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "纬度")
 | 
			
		||||
    private String lat;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "多边形经纬度坐标集合")
 | 
			
		||||
    private List<List<Map<String, String>>> mutiPoints;
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,19 @@
 | 
			
		||||
package com.sl.ms.web.driver.vo;
 | 
			
		||||
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
public class AreaVO {
 | 
			
		||||
    @ApiModelProperty(value = "所属省份")
 | 
			
		||||
    private AreaSimpleVO province;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "所属城市")
 | 
			
		||||
    private AreaSimpleVO city;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "所属区县")
 | 
			
		||||
    private AreaSimpleVO county;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "地址", required = true)
 | 
			
		||||
    private String address;
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,20 @@
 | 
			
		||||
package com.sl.ms.web.driver.vo.request;
 | 
			
		||||
 | 
			
		||||
import io.swagger.annotations.ApiModel;
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import javax.validation.constraints.NotNull;
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
@ApiModel("账号登录请求")
 | 
			
		||||
public class AccountLoginVO {
 | 
			
		||||
    @ApiModelProperty(value = "登录账号", required = true)
 | 
			
		||||
    @NotNull(message = "登录账号不能为空")
 | 
			
		||||
    private String account;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "登录密码", required = true)
 | 
			
		||||
    @NotNull(message = "登录密码不能为空")
 | 
			
		||||
    private String password;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,23 @@
 | 
			
		||||
package com.sl.ms.web.driver.vo.request;
 | 
			
		||||
 | 
			
		||||
import io.swagger.annotations.ApiModel;
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import javax.validation.constraints.NotNull;
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
@ApiModel("延迟提货对象")
 | 
			
		||||
public class DriverDelayDeliveryVO {
 | 
			
		||||
    @ApiModelProperty(value = "司机作业单id", required = true)
 | 
			
		||||
    @NotNull(message = "司机作业单id不能为空")
 | 
			
		||||
    private String id;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "延迟时间", required = true, example = "2022-07-18 15:20:00")
 | 
			
		||||
    @NotNull(message = "延迟时间不能为空")
 | 
			
		||||
    private String delayTime;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "延迟原因", required = true)
 | 
			
		||||
    @NotNull(message = "延迟原因不能为空")
 | 
			
		||||
    private String delayReason;
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,23 @@
 | 
			
		||||
package com.sl.ms.web.driver.vo.request;
 | 
			
		||||
 | 
			
		||||
import io.swagger.annotations.ApiModel;
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import javax.validation.constraints.NotNull;
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
@ApiModel("司机交付对象")
 | 
			
		||||
public class DriverDeliverVO {
 | 
			
		||||
    @ApiModelProperty(value = "司机作业id", required = true)
 | 
			
		||||
    @NotNull
 | 
			
		||||
    private String id;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "交付凭证,多个图片url以逗号分隔", required = true)
 | 
			
		||||
    @NotNull
 | 
			
		||||
    private String transportCertificate;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "交付图片,多个图片url以逗号分隔", required = true)
 | 
			
		||||
    @NotNull
 | 
			
		||||
    private String deliverPicture;
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,23 @@
 | 
			
		||||
package com.sl.ms.web.driver.vo.request;
 | 
			
		||||
 | 
			
		||||
import io.swagger.annotations.ApiModel;
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import javax.validation.constraints.NotNull;
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
@ApiModel("提货对象")
 | 
			
		||||
public class DriverPickUpVO {
 | 
			
		||||
    @ApiModelProperty(value = "司机作业id", required = true)
 | 
			
		||||
    @NotNull
 | 
			
		||||
    private String id;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "提货凭证,多个图片url以逗号分隔", required = true)
 | 
			
		||||
    @NotNull
 | 
			
		||||
    private String cargoPickUpPicture;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "货物照片,多个图片url以逗号分隔", required = true)
 | 
			
		||||
    @NotNull
 | 
			
		||||
    private String cargoPicture;
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,65 @@
 | 
			
		||||
package com.sl.ms.web.driver.vo.request;
 | 
			
		||||
 | 
			
		||||
import com.sl.ms.base.domain.enums.TruckAccidentTypeEnum;
 | 
			
		||||
import com.sl.ms.base.domain.enums.TruckBreakRulesTypeEnum;
 | 
			
		||||
import com.sl.ms.base.domain.enums.TruckFaultTypeEnum;
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import java.math.BigDecimal;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
public class DriverReturnRegisterVO {
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "运输任务id", required = true)
 | 
			
		||||
    private String id;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "出车时间", required = true, example = "2022-07-18 17:00:00")
 | 
			
		||||
    private String startTime;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "回车时间", required = true, example = "2022-07-18 17:00:00")
 | 
			
		||||
    private String endTime;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "车辆是否违章", required = true)
 | 
			
		||||
    private Boolean isBreakRules;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "违章类型,1-闯红灯,2-无证驾驶,3-超载,4-酒后驾驶,5-超速行驶,6-其他")
 | 
			
		||||
    private TruckBreakRulesTypeEnum breakRulesType;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "违章说明,类型为“其他”时填写")
 | 
			
		||||
    private String breakRulesDescription;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "罚款金额")
 | 
			
		||||
    private BigDecimal penaltyAmount;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "扣分数据")
 | 
			
		||||
    private Integer deductPoints;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "车辆是否故障", required = true)
 | 
			
		||||
    private Boolean isFault;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "车辆是否可用")
 | 
			
		||||
    private Boolean isAvailable;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "故障类型,1-发动机启动困难,2-不着车,3-漏油,4-漏水,5-照明失灵,6-有异响,7-排烟异常,8-温度异常,9-其他")
 | 
			
		||||
    private TruckFaultTypeEnum faultType;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "故障说明,类型为“其他”时填写")
 | 
			
		||||
    private String faultDescription;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "故障图片")
 | 
			
		||||
    private String faultImages;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "是否出现事故", required = true)
 | 
			
		||||
    private Boolean isAccident;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "事故类型,1-直行事故,2-追尾事故,3-超车事故,4-左转弯事故,5-右转弯事故,6-弯道事故,7-坡道事故,8-会车事故,9-其他")
 | 
			
		||||
    private TruckAccidentTypeEnum accidentType;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "事故说明,类型为“其他”时填写")
 | 
			
		||||
    private String accidentDescription;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "事故图片")
 | 
			
		||||
    private String accidentImages;
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,108 @@
 | 
			
		||||
package com.sl.ms.web.driver.vo.response;
 | 
			
		||||
 | 
			
		||||
import com.fasterxml.jackson.annotation.JsonFormat;
 | 
			
		||||
import io.swagger.annotations.ApiModel;
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import java.time.LocalDateTime;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 司机作业单详情
 | 
			
		||||
 * @author ZJL
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
@ApiModel("司机作业单详情")
 | 
			
		||||
public class DriverJobDetailVO {
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "司机作业单id")
 | 
			
		||||
    private String id;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "起始机构id")
 | 
			
		||||
    private String startAgencyId;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "起始省份")
 | 
			
		||||
    private String startProvince;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "起始市")
 | 
			
		||||
    private String startCity;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "起始机构详细地址")
 | 
			
		||||
    private String startAddress;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "目的机构id")
 | 
			
		||||
    private String endAgencyId;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "目的省份")
 | 
			
		||||
    private String endProvince;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "目的市")
 | 
			
		||||
    private String endAddress;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "目的机构详细地址")
 | 
			
		||||
    private String endCity;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "作业状态,1为待提货)、2为在途)、3为改派)、4为已交付)、5为已作废")
 | 
			
		||||
    private Integer status;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "司机id")
 | 
			
		||||
    private String driverId;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "运输任务id")
 | 
			
		||||
    private String transportTaskId;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "提货对接人")
 | 
			
		||||
    private String startHandover;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "提货对接人电话")
 | 
			
		||||
    private String startHandoverPhone;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "交付对接人")
 | 
			
		||||
    private String finishHandover;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "交付对接人电话")
 | 
			
		||||
    private String finishHandoverPhone;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "计划发车时间")
 | 
			
		||||
    @JsonFormat(
 | 
			
		||||
            pattern = "yyyy-MM-dd HH:mm:ss"
 | 
			
		||||
    )
 | 
			
		||||
    private LocalDateTime planDepartureTime;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "实际发车时间")
 | 
			
		||||
    @JsonFormat(
 | 
			
		||||
            pattern = "yyyy-MM-dd HH:mm:ss"
 | 
			
		||||
    )
 | 
			
		||||
    private LocalDateTime actualDepartureTime;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "计划到达时间")
 | 
			
		||||
    @JsonFormat(
 | 
			
		||||
            pattern = "yyyy-MM-dd HH:mm:ss"
 | 
			
		||||
    )
 | 
			
		||||
    private LocalDateTime planArrivalTime;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "实际到达时间")
 | 
			
		||||
    @JsonFormat(
 | 
			
		||||
            pattern = "yyyy-MM-dd HH:mm:ss"
 | 
			
		||||
    )
 | 
			
		||||
    private LocalDateTime actualArrivalTime;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "车牌号码")
 | 
			
		||||
    private String licensePlate;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "司机姓名")
 | 
			
		||||
    private String driverName;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "提货凭证")
 | 
			
		||||
    private List<String> cargoPickUpPicture;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "提货图片")
 | 
			
		||||
    private List<String> cargoPicture;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "回单凭证")
 | 
			
		||||
    private List<String> transportCertificate;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "回单图片")
 | 
			
		||||
    private List<String> deliverPicture;
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,80 @@
 | 
			
		||||
package com.sl.ms.web.driver.vo.response;
 | 
			
		||||
 | 
			
		||||
import com.fasterxml.jackson.annotation.JsonFormat;
 | 
			
		||||
import com.sl.ms.driver.domain.enums.DriverJobStatus;
 | 
			
		||||
import io.swagger.annotations.ApiModel;
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import java.time.LocalDateTime;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 司机作业单
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
@ApiModel("司机作业单")
 | 
			
		||||
public class DriverJobVO {
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "司机作业单id")
 | 
			
		||||
    private String id;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "起始机构id")
 | 
			
		||||
    private Long startAgencyId;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "起始机构地址")
 | 
			
		||||
    private String startAddress;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "目的机构id")
 | 
			
		||||
    private Long endAgencyId;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "目的机构地址")
 | 
			
		||||
    private String endAddress;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "作业状态,1为待提货)、2为在途)、3为改派)、4为已交付)、5为已作废")
 | 
			
		||||
    private DriverJobStatus status;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "司机id")
 | 
			
		||||
    private String driverId;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "运输任务id")
 | 
			
		||||
    private String transportTaskId;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "提货对接人")
 | 
			
		||||
    private String startHandover;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "交付对接人")
 | 
			
		||||
    private String finishHandover;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "计划发车时间")
 | 
			
		||||
    @JsonFormat(
 | 
			
		||||
            pattern = "yyyy-MM-dd HH:mm:ss"
 | 
			
		||||
    )
 | 
			
		||||
    private LocalDateTime planDepartureTime;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "实际发车时间")
 | 
			
		||||
    @JsonFormat(
 | 
			
		||||
            pattern = "yyyy-MM-dd HH:mm:ss"
 | 
			
		||||
    )
 | 
			
		||||
    private LocalDateTime actualDepartureTime;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "计划到达时间")
 | 
			
		||||
    @JsonFormat(
 | 
			
		||||
            pattern = "yyyy-MM-dd HH:mm:ss"
 | 
			
		||||
    )
 | 
			
		||||
    private LocalDateTime planArrivalTime;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "实际到达时间")
 | 
			
		||||
    @JsonFormat(
 | 
			
		||||
            pattern = "yyyy-MM-dd HH:mm:ss"
 | 
			
		||||
    )
 | 
			
		||||
    private LocalDateTime actualArrivalTime;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "创建时间")
 | 
			
		||||
    @JsonFormat(
 | 
			
		||||
            pattern = "yyyy-MM-dd HH:mm:ss"
 | 
			
		||||
    )
 | 
			
		||||
    private LocalDateTime created;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "是否可提货")
 | 
			
		||||
    private Boolean enablePickUp = false;
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,54 @@
 | 
			
		||||
package com.sl.ms.web.driver.vo.response;
 | 
			
		||||
 | 
			
		||||
import io.swagger.annotations.ApiModel;
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import java.time.LocalDateTime;
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
@ApiModel("消息")
 | 
			
		||||
public class MessageVO {
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty("主键")
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty("消息标题")
 | 
			
		||||
    private String title;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty("消息内容")
 | 
			
		||||
    private String content;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "1:用户端,2:司机端,3:快递员端,4:后台管理系统")
 | 
			
		||||
    private Integer bussinessType;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty("消息接受者")
 | 
			
		||||
    private Long userId;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty("消息类型,300:快递员端公告,301:寄件相关消息,302:签收相关消息,303:快件取消消息,200:司机端公告,201:司机端系统通知")
 | 
			
		||||
    private Integer contentType;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty("消息是否已读,0:未读,1:已读")
 | 
			
		||||
    private Integer isRead;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 读时间
 | 
			
		||||
     */
 | 
			
		||||
    @ApiModelProperty("读时间")
 | 
			
		||||
    private LocalDateTime readTime;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty("相关id")
 | 
			
		||||
    private Long relevantId;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty("创建者")
 | 
			
		||||
    private Long createUser;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty("创建时间")
 | 
			
		||||
    private LocalDateTime created;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty("更新者")
 | 
			
		||||
    private Long updateUser;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty("更新时间")
 | 
			
		||||
    private LocalDateTime updated;
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,24 @@
 | 
			
		||||
package com.sl.ms.web.driver.vo.response;
 | 
			
		||||
 | 
			
		||||
import com.sl.ms.driver.domain.dto.response.DailyMileageDTO;
 | 
			
		||||
import io.swagger.annotations.ApiModel;
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
@ApiModel("任务数据统计")
 | 
			
		||||
public class TaskReportVO {
 | 
			
		||||
    @ApiModelProperty("任务数量,基于计划完成时间统计")
 | 
			
		||||
    private Integer taskAmounts;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty("完成任务数量,基于实际完成时间统计")
 | 
			
		||||
    private Integer completedAmounts;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty("运输里程,单位:公里,基于实际完成时间统计")
 | 
			
		||||
    private Long transportMileage;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty("每日里程,基于实际完成时间统计")
 | 
			
		||||
    private List<DailyMileageDTO> dailyMileage;
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,25 @@
 | 
			
		||||
package com.sl.ms.web.driver.vo.response;
 | 
			
		||||
 | 
			
		||||
import io.swagger.annotations.ApiModel;
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import java.math.BigDecimal;
 | 
			
		||||
import java.time.LocalDateTime;
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
@ApiModel("运单")
 | 
			
		||||
public class TransportOrderVO {
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "运单id")
 | 
			
		||||
    private String id;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "货品总重量")
 | 
			
		||||
    private BigDecimal totalWeight;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "数量")
 | 
			
		||||
    private Integer count = 1;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(value = "创建时间")
 | 
			
		||||
    private LocalDateTime createTime;
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,24 @@
 | 
			
		||||
package com.sl.ms.web.driver.vo.response;
 | 
			
		||||
 | 
			
		||||
import io.swagger.annotations.ApiModel;
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
@ApiModel("车辆信息")
 | 
			
		||||
public class TruckDetailVO {
 | 
			
		||||
    @ApiModelProperty("车辆编号")
 | 
			
		||||
    private String id;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty("车牌号码")
 | 
			
		||||
    private String licensePlate;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty("车辆类型名称")
 | 
			
		||||
    private String truckType;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty("载重")
 | 
			
		||||
    private String allowableLoad;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty("图片")
 | 
			
		||||
    private String picture;
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,21 @@
 | 
			
		||||
package com.sl.ms.web.driver.vo.response;
 | 
			
		||||
 | 
			
		||||
import io.swagger.annotations.ApiModel;
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
@ApiModel("用户信息")
 | 
			
		||||
public class UserDetailVO {
 | 
			
		||||
    @ApiModelProperty("司机编号")
 | 
			
		||||
    private String number;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty("头像")
 | 
			
		||||
    private String avatar;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty("姓名")
 | 
			
		||||
    private String name;
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty("手机号")
 | 
			
		||||
    private String phone;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										7
									
								
								sl-express-ms-web-driver/src/main/resources/banner.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								sl-express-ms-web-driver/src/main/resources/banner.txt
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,7 @@
 | 
			
		||||
 | 
			
		||||
       _                                                     ${spring.application.name} ${application.version}
 | 
			
		||||
  ___ | |         ___ __  __ _ __   _ __  ___  ___  ___      Port: ${server.port}
 | 
			
		||||
 / __|| | _____  / _ \\ \/ /| '_ \ | '__|/ _ \/ __|/ __|     Pid: ${pid}  Profile(s): ${AnsiColor.GREEN}${spring.profiles.active}${AnsiColor.DEFAULT}
 | 
			
		||||
 \__ \| ||_____||  __/ >  < | |_) || |  |  __/\__ \\__ \
 | 
			
		||||
 |___/|_|        \___|/_/\_\| .__/ |_|   \___||___/|___/     https://sl-express.itheima.net/
 | 
			
		||||
                            |_|
 | 
			
		||||
@@ -0,0 +1,25 @@
 | 
			
		||||
server:
 | 
			
		||||
  port: 18092
 | 
			
		||||
  tomcat:
 | 
			
		||||
    uri-encoding: UTF-8
 | 
			
		||||
    threads:
 | 
			
		||||
      max: 1000
 | 
			
		||||
      min-spare: 30
 | 
			
		||||
spring:
 | 
			
		||||
  cloud:
 | 
			
		||||
    nacos:
 | 
			
		||||
      username: nacos
 | 
			
		||||
      password: nacos
 | 
			
		||||
      server-addr: 192.168.150.101:8848
 | 
			
		||||
      discovery:
 | 
			
		||||
        namespace: ecae68ba-7b43-4473-a980-4ddeb6157bdc
 | 
			
		||||
        ip: 192.168.150.1
 | 
			
		||||
      config:
 | 
			
		||||
        namespace: ecae68ba-7b43-4473-a980-4ddeb6157bdc
 | 
			
		||||
        shared-configs: #共享配置
 | 
			
		||||
          - data-id: shared-spring-seata.yml
 | 
			
		||||
            group: SHARED_GROUP
 | 
			
		||||
            refresh: false
 | 
			
		||||
          - data-id: shared-spring-authority.yml
 | 
			
		||||
            group: SHARED_GROUP
 | 
			
		||||
            refresh: false
 | 
			
		||||
@@ -0,0 +1,24 @@
 | 
			
		||||
server:
 | 
			
		||||
  port: 18092
 | 
			
		||||
  tomcat:
 | 
			
		||||
    uri-encoding: UTF-8
 | 
			
		||||
    threads:
 | 
			
		||||
      max: 1000
 | 
			
		||||
      min-spare: 30
 | 
			
		||||
spring:
 | 
			
		||||
  cloud:
 | 
			
		||||
    nacos:
 | 
			
		||||
      username: nacos
 | 
			
		||||
      password: vO5/dZ9,iL
 | 
			
		||||
      server-addr: nacos-service.yjy-public-slwl-java-prod.svc.cluster.local:8848
 | 
			
		||||
      discovery:
 | 
			
		||||
        namespace: 92312ba8-1119-440f-81af-c29618df303b
 | 
			
		||||
      config:
 | 
			
		||||
        namespace: 92312ba8-1119-440f-81af-c29618df303b
 | 
			
		||||
        shared-configs: #共享配置
 | 
			
		||||
          - data-id: shared-spring-seata.yml
 | 
			
		||||
            group: SHARED_GROUP
 | 
			
		||||
            refresh: false
 | 
			
		||||
          - data-id: shared-spring-authority.yml
 | 
			
		||||
            group: SHARED_GROUP
 | 
			
		||||
            refresh: false
 | 
			
		||||
@@ -0,0 +1,24 @@
 | 
			
		||||
server:
 | 
			
		||||
  port: 18092
 | 
			
		||||
  tomcat:
 | 
			
		||||
    uri-encoding: UTF-8
 | 
			
		||||
    threads:
 | 
			
		||||
      max: 1000
 | 
			
		||||
      min-spare: 30
 | 
			
		||||
spring:
 | 
			
		||||
  cloud:
 | 
			
		||||
    nacos:
 | 
			
		||||
      username: nacos
 | 
			
		||||
      password: nacos
 | 
			
		||||
      server-addr: 192.168.150.101:8848
 | 
			
		||||
      discovery:
 | 
			
		||||
        namespace: ecae68ba-7b43-4473-a980-4ddeb6157bdc
 | 
			
		||||
      config:
 | 
			
		||||
        namespace: ecae68ba-7b43-4473-a980-4ddeb6157bdc
 | 
			
		||||
        shared-configs: #共享配置
 | 
			
		||||
          - data-id: shared-spring-seata.yml
 | 
			
		||||
            group: SHARED_GROUP
 | 
			
		||||
            refresh: false
 | 
			
		||||
          - data-id: shared-spring-authority.yml
 | 
			
		||||
            group: SHARED_GROUP
 | 
			
		||||
            refresh: false
 | 
			
		||||
@@ -0,0 +1,24 @@
 | 
			
		||||
server:
 | 
			
		||||
  port: 18092
 | 
			
		||||
  tomcat:
 | 
			
		||||
    uri-encoding: UTF-8
 | 
			
		||||
    threads:
 | 
			
		||||
      max: 1000
 | 
			
		||||
      min-spare: 30
 | 
			
		||||
spring:
 | 
			
		||||
  cloud:
 | 
			
		||||
    nacos:
 | 
			
		||||
      username: nacos
 | 
			
		||||
      password: nacos
 | 
			
		||||
      server-addr: nacos-service.yjy-public-slwl-java.svc.cluster.local:8848
 | 
			
		||||
      discovery:
 | 
			
		||||
        namespace: 92312ba8-1119-440f-81af-c29618df303b
 | 
			
		||||
      config:
 | 
			
		||||
        namespace: 92312ba8-1119-440f-81af-c29618df303b
 | 
			
		||||
        shared-configs: #共享配置
 | 
			
		||||
          - data-id: shared-spring-seata.yml
 | 
			
		||||
            group: SHARED_GROUP
 | 
			
		||||
            refresh: false
 | 
			
		||||
          - data-id: shared-spring-authority.yml
 | 
			
		||||
            group: SHARED_GROUP
 | 
			
		||||
            refresh: false
 | 
			
		||||
							
								
								
									
										26
									
								
								sl-express-ms-web-driver/src/main/resources/bootstrap.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								sl-express-ms-web-driver/src/main/resources/bootstrap.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,26 @@
 | 
			
		||||
application:
 | 
			
		||||
  version: v1.0
 | 
			
		||||
logging:
 | 
			
		||||
  config: classpath:logback-spring.xml
 | 
			
		||||
spring:
 | 
			
		||||
  application:
 | 
			
		||||
    name: sl-express-ms-web-driver
 | 
			
		||||
  profiles:
 | 
			
		||||
    active: local
 | 
			
		||||
  main:
 | 
			
		||||
    allow-bean-definition-overriding: true
 | 
			
		||||
  mvc:
 | 
			
		||||
    pathmatch:
 | 
			
		||||
      #解决异常:swagger Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException
 | 
			
		||||
      #因为Springfox使用的路径匹配是基于AntPathMatcher的,而Spring Boot 2.6.X使用的是PathPatternMatcher
 | 
			
		||||
      matching-strategy: ant_path_matcher
 | 
			
		||||
sl:
 | 
			
		||||
  swagger:
 | 
			
		||||
    package-path: com.sl.ms.web.driver.controller
 | 
			
		||||
    title: 神领物流 - 司机端接口文档
 | 
			
		||||
    description: 该服务用于司机端
 | 
			
		||||
    contact-name: 传智教育·研究院
 | 
			
		||||
    contact-url: http://www.itcast.cn/
 | 
			
		||||
    contact-email: yjy@itcast.cn
 | 
			
		||||
    version: ${application.version}
 | 
			
		||||
 | 
			
		||||
@@ -0,0 +1,41 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<!--scan: 当此属性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true。-->
 | 
			
		||||
<!--scanPeriod: 设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。-->
 | 
			
		||||
<!--debug: 当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。-->
 | 
			
		||||
<configuration debug="false" scan="false" scanPeriod="60 seconds">
 | 
			
		||||
    <springProperty scope="context" name="appName" source="spring.application.name"/>
 | 
			
		||||
    <!--文件名-->
 | 
			
		||||
    <property name="logback.appname" value="${appName}"/>
 | 
			
		||||
    <!--文件位置-->
 | 
			
		||||
    <property name="logback.logdir" value="/data/logs"/>
 | 
			
		||||
 | 
			
		||||
    <!-- 定义控制台输出 -->
 | 
			
		||||
    <appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
 | 
			
		||||
        <layout class="ch.qos.logback.classic.PatternLayout">
 | 
			
		||||
            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} - [%thread] - %-5level - %logger{50} - %msg%n</pattern>
 | 
			
		||||
        </layout>
 | 
			
		||||
    </appender>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
 | 
			
		||||
        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
 | 
			
		||||
            <level>DEBUG</level>
 | 
			
		||||
        </filter>
 | 
			
		||||
        <File>${logback.logdir}/${logback.appname}/${logback.appname}.log</File>
 | 
			
		||||
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
 | 
			
		||||
            <FileNamePattern>${logback.logdir}/${logback.appname}/${logback.appname}.%d{yyyy-MM-dd}.log.zip</FileNamePattern>
 | 
			
		||||
            <maxHistory>90</maxHistory>
 | 
			
		||||
        </rollingPolicy>
 | 
			
		||||
        <encoder>
 | 
			
		||||
            <charset>UTF-8</charset>
 | 
			
		||||
            <pattern>%d [%thread] %-5level %logger{36} %line - %msg%n</pattern>
 | 
			
		||||
        </encoder>
 | 
			
		||||
    </appender>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    <!--evel:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF,-->
 | 
			
		||||
    <!--不能设置为INHERITED或者同义词NULL。默认是DEBUG。-->
 | 
			
		||||
    <root level="INFO">
 | 
			
		||||
        <appender-ref ref="stdout"/>
 | 
			
		||||
    </root>
 | 
			
		||||
</configuration>
 | 
			
		||||
		Reference in New Issue
	
	Block a user