init
This commit is contained in:
		
							
								
								
									
										3
									
								
								sl-express-ms-transport-api/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								sl-express-ms-transport-api/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
			
		||||
.idea
 | 
			
		||||
target/
 | 
			
		||||
*.iml
 | 
			
		||||
							
								
								
									
										42
									
								
								sl-express-ms-transport-api/pom.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								sl-express-ms-transport-api/pom.xml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,42 @@
 | 
			
		||||
<?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.transport</groupId>
 | 
			
		||||
    <artifactId>sl-express-ms-transport-api</artifactId>
 | 
			
		||||
    <version>1.1-SNAPSHOT</version>
 | 
			
		||||
    <description>线路规划微服务 - api</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-transport-domain.version>1.1-SNAPSHOT</sl-express-ms-transport-domain.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.transport</groupId>
 | 
			
		||||
            <artifactId>sl-express-ms-transport-domain</artifactId>
 | 
			
		||||
            <version>${sl-express-ms-transport-domain.version}</version>
 | 
			
		||||
        </dependency>
 | 
			
		||||
        <dependency>
 | 
			
		||||
            <groupId>org.springframework.cloud</groupId>
 | 
			
		||||
            <artifactId>spring-cloud-starter-openfeign</artifactId>
 | 
			
		||||
        </dependency>
 | 
			
		||||
    </dependencies>
 | 
			
		||||
 | 
			
		||||
</project>
 | 
			
		||||
@@ -0,0 +1,37 @@
 | 
			
		||||
package com.sl.ms.transport.api;
 | 
			
		||||
 | 
			
		||||
import com.sl.transport.domain.CostConfigurationDTO;
 | 
			
		||||
import org.springframework.cloud.openfeign.FeignClient;
 | 
			
		||||
import org.springframework.web.bind.annotation.GetMapping;
 | 
			
		||||
import org.springframework.web.bind.annotation.PostMapping;
 | 
			
		||||
import org.springframework.web.bind.annotation.RequestBody;
 | 
			
		||||
import springfox.documentation.annotations.ApiIgnore;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 成本配置相关业务对外提供接口服务
 | 
			
		||||
 *
 | 
			
		||||
 * @author wxb
 | 
			
		||||
 * @version 1.0
 | 
			
		||||
 */
 | 
			
		||||
@FeignClient(name = "sl-express-transport", contextId = "CostConfiguration", path = "/cost-configuration")
 | 
			
		||||
@ApiIgnore
 | 
			
		||||
public interface CostConfigurationFeign {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询成本配置
 | 
			
		||||
     *
 | 
			
		||||
     * @return 成本配置
 | 
			
		||||
     */
 | 
			
		||||
    @GetMapping
 | 
			
		||||
    List<CostConfigurationDTO> findConfiguration();
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 保存成本配置
 | 
			
		||||
     *
 | 
			
		||||
     * @param dto 成本配置
 | 
			
		||||
     */
 | 
			
		||||
    @PostMapping
 | 
			
		||||
    void saveConfiguration(@RequestBody List<CostConfigurationDTO> dto);
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,35 @@
 | 
			
		||||
package com.sl.ms.transport.api;
 | 
			
		||||
 | 
			
		||||
import com.sl.transport.domain.DispatchConfigurationDTO;
 | 
			
		||||
import org.springframework.cloud.openfeign.FeignClient;
 | 
			
		||||
import org.springframework.web.bind.annotation.GetMapping;
 | 
			
		||||
import org.springframework.web.bind.annotation.PostMapping;
 | 
			
		||||
import org.springframework.web.bind.annotation.RequestBody;
 | 
			
		||||
import springfox.documentation.annotations.ApiIgnore;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 调度配置相关业务对外提供接口服务
 | 
			
		||||
 *
 | 
			
		||||
 * @author zzj
 | 
			
		||||
 * @version 1.0
 | 
			
		||||
 */
 | 
			
		||||
@FeignClient(name = "sl-express-transport", contextId = "DispatchConfiguration", path = "/dispatch-configuration")
 | 
			
		||||
@ApiIgnore
 | 
			
		||||
public interface DispatchConfigurationFeign {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询调度配置
 | 
			
		||||
     *
 | 
			
		||||
     * @return 调度配置
 | 
			
		||||
     */
 | 
			
		||||
    @GetMapping
 | 
			
		||||
    DispatchConfigurationDTO findConfiguration();
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 保存调度配置
 | 
			
		||||
     *
 | 
			
		||||
     * @param dto 调度配置
 | 
			
		||||
     */
 | 
			
		||||
    @PostMapping
 | 
			
		||||
    void saveConfiguration(@RequestBody DispatchConfigurationDTO dto);
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,57 @@
 | 
			
		||||
package com.sl.ms.transport.api;
 | 
			
		||||
 | 
			
		||||
import com.sl.transport.domain.OrganDTO;
 | 
			
		||||
import org.springframework.cloud.openfeign.FeignClient;
 | 
			
		||||
import org.springframework.web.bind.annotation.*;
 | 
			
		||||
import springfox.documentation.annotations.ApiIgnore;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
@FeignClient(name = "sl-express-transport", contextId = "Organ", path = "/organs")
 | 
			
		||||
@ApiIgnore
 | 
			
		||||
public interface OrganFeign {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据id查询机构数据
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 机构id
 | 
			
		||||
     * @return 机构数据
 | 
			
		||||
     */
 | 
			
		||||
    @GetMapping("{id}")
 | 
			
		||||
    OrganDTO queryById(@PathVariable("id") Long id);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据ids查询机构数据
 | 
			
		||||
     *
 | 
			
		||||
     * @param ids 机构id
 | 
			
		||||
     * @return 机构数据
 | 
			
		||||
     */
 | 
			
		||||
    @GetMapping("/ids")
 | 
			
		||||
    List<OrganDTO> queryByIds(@RequestParam("ids") List<Long> ids);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 更新机构数据,id、type参数是必填的
 | 
			
		||||
     *
 | 
			
		||||
     * @param organDTO 机构数据
 | 
			
		||||
     */
 | 
			
		||||
    @PutMapping
 | 
			
		||||
    void update(@RequestBody OrganDTO organDTO);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询所有的机构,如果name不为空的按照name模糊查询
 | 
			
		||||
     *
 | 
			
		||||
     * @param name 机构名称
 | 
			
		||||
     * @return 机构数据列表
 | 
			
		||||
     */
 | 
			
		||||
    @GetMapping("all")
 | 
			
		||||
    List<OrganDTO> findAll(@RequestParam(value = "name", required = false) String name);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询机构树
 | 
			
		||||
     *
 | 
			
		||||
     * @return 机构树,json格式,例如:[{"id":987328060552418593,"parentId":0,"name":"上海市转运中心","type":1,"status":true,"children":[{"id":987328165208692129,"parentId":987328060552418593,"name":"浦东新区分拣中心","type":2,"status":true,"children":[{"id":987328223597598241,"parentId":987328165208692129,"name":"航头营业部","type":3,"status":true}]}]},{"id":987327492140340001,"parentId":0,"name":"北京市转运中心","type":1,"latitude":39.762879,"longitude":116.390892,"status":true,"children":[{"id":987327680636556193,"parentId":987327492140340001,"name":"昌平区分拣中心","type":2,"status":true,"children":[{"id":987327807359063073,"parentId":987327680636556193,"name":"回龙观营业部","type":3,"status":true}]},{"id":987327971847083169,"parentId":987327492140340001,"name":"海淀区分拣中心","type":2,"latitude":39.959893,"longitude":116.2977,"status":true}]}]
 | 
			
		||||
     */
 | 
			
		||||
    @GetMapping("tree")
 | 
			
		||||
    String findAllTree();
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,97 @@
 | 
			
		||||
package com.sl.ms.transport.api;
 | 
			
		||||
 | 
			
		||||
import com.sl.transport.common.util.PageResponse;
 | 
			
		||||
import com.sl.transport.domain.TransportLineDTO;
 | 
			
		||||
import com.sl.transport.domain.TransportLineNodeDTO;
 | 
			
		||||
import com.sl.transport.domain.TransportLineSearchDTO;
 | 
			
		||||
import org.springframework.cloud.openfeign.FeignClient;
 | 
			
		||||
import org.springframework.web.bind.annotation.*;
 | 
			
		||||
import springfox.documentation.annotations.ApiIgnore;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
@FeignClient(name = "sl-express-transport", contextId = "TransportLine", path = "/transports")
 | 
			
		||||
@ApiIgnore
 | 
			
		||||
public interface TransportLineFeign {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询两个网点之间最短的路线,最大查询深度为:10
 | 
			
		||||
     *
 | 
			
		||||
     * @param startId 开始网点
 | 
			
		||||
     * @param endId   结束网点
 | 
			
		||||
     * @return 路线节点数据
 | 
			
		||||
     */
 | 
			
		||||
    @GetMapping("{startId}/{endId}")
 | 
			
		||||
    TransportLineNodeDTO queryShortestPath(@PathVariable("startId") Long startId, @PathVariable("endId") Long endId);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询两个网点之间成本最低的路线,最大查询深度为:10
 | 
			
		||||
     *
 | 
			
		||||
     * @param startId 开始网点
 | 
			
		||||
     * @param endId   结束网点
 | 
			
		||||
     * @return 路线节点数据
 | 
			
		||||
     */
 | 
			
		||||
    @GetMapping("lowest/{startId}/{endId}")
 | 
			
		||||
    TransportLineNodeDTO findLowestPath(@PathVariable("startId") Long startId, @PathVariable("endId") Long endId);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据调度策略查询路线
 | 
			
		||||
     *
 | 
			
		||||
     * @param startId 开始网点id
 | 
			
		||||
     * @param endId   结束网点id
 | 
			
		||||
     * @return 路线
 | 
			
		||||
     */
 | 
			
		||||
    @GetMapping("/dispatchMethod/{startId}/{endId}")
 | 
			
		||||
    TransportLineNodeDTO queryPathByDispatchMethod(@PathVariable("startId") Long startId, @PathVariable("endId") Long endId);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 新增路线,干线:起点终点无顺序,支线:起点必须是二级转运中心,接驳路线:起点必须是网点
 | 
			
		||||
     *
 | 
			
		||||
     * @param transportLineDTO 路线数据
 | 
			
		||||
     */
 | 
			
		||||
    @PostMapping
 | 
			
		||||
    void createLine(@RequestBody TransportLineDTO transportLineDTO);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 更新路线,可更新字段:cost、name、distance、time、extra,更新数据时id不能为空
 | 
			
		||||
     *
 | 
			
		||||
     * @param transportLineDTO 更新字段数据
 | 
			
		||||
     */
 | 
			
		||||
    @PutMapping
 | 
			
		||||
    void updateLine(@RequestBody TransportLineDTO transportLineDTO);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 删除路线,单向删除
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 路线id
 | 
			
		||||
     */
 | 
			
		||||
    @DeleteMapping("{id}")
 | 
			
		||||
    void deleteLine(@PathVariable("id") Long id);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据id查询
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 路线id
 | 
			
		||||
     * @return 路线信息
 | 
			
		||||
     */
 | 
			
		||||
    @GetMapping("{id}")
 | 
			
		||||
    TransportLineDTO queryById(@PathVariable("id") Long id);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据ids批量查询路线
 | 
			
		||||
     *
 | 
			
		||||
     * @param ids 路线id列表
 | 
			
		||||
     * @return 路线列表
 | 
			
		||||
     */
 | 
			
		||||
    @GetMapping("list")
 | 
			
		||||
    List<TransportLineDTO> queryByIds(@RequestParam("ids") Long... ids);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 分页查询路线,如果有条件就进行筛选查询
 | 
			
		||||
     *
 | 
			
		||||
     * @param transportLineSearchDTO 搜索参数
 | 
			
		||||
     * @return 分页数据
 | 
			
		||||
     */
 | 
			
		||||
    @PostMapping("page")
 | 
			
		||||
    PageResponse<TransportLineDTO> queryPageList(@RequestBody TransportLineSearchDTO transportLineSearchDTO);
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user