1、新增维修记录
2、新增保养记录 3、新增港口码头主数据 4、新增铁路车站主数据 5、新增空港机场主数据 6、测试版nacos配置 7、测试版Harbor配置 8、其他配置修改
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
FROM bladex/alpine-java:openjdk17_cn_slim
|
||||
FROM ${docker.base.image}
|
||||
|
||||
LABEL maintainer="bladejava@qq.com"
|
||||
|
||||
@@ -12,4 +12,4 @@ COPY ./target/blade-desk.jar ./app.jar
|
||||
|
||||
ENTRYPOINT ["java", "--add-opens", "java.base/java.lang=ALL-UNNAMED", "--add-opens", "java.base/java.lang.reflect=ALL-UNNAMED", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"]
|
||||
|
||||
CMD ["--spring.profiles.active=test"]
|
||||
CMD ["--spring.profiles.active=prod"]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM bladex/alpine-java:openjdk17_cn_slim
|
||||
FROM ${docker.base.image}
|
||||
|
||||
LABEL maintainer="bladejava@qq.com"
|
||||
|
||||
@@ -12,4 +12,4 @@ COPY ./target/blade-system.jar ./app.jar
|
||||
|
||||
ENTRYPOINT ["java", "--add-opens", "java.base/java.lang=ALL-UNNAMED", "--add-opens", "java.base/java.lang.reflect=ALL-UNNAMED", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"]
|
||||
|
||||
CMD ["--spring.profiles.active=test"]
|
||||
CMD ["--spring.profiles.active=prod"]
|
||||
|
||||
@@ -0,0 +1,171 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.system.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
import org.springblade.core.excel.util.ExcelUtil;
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.secure.annotation.PreAuth;
|
||||
import org.springblade.core.tenant.annotation.NonDS;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.DateUtil;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springblade.system.excel.AirportMasterExcel;
|
||||
import org.springblade.system.excel.AirportMasterImporter;
|
||||
import org.springblade.system.pojo.entity.AirportMaster;
|
||||
import org.springblade.system.pojo.vo.AirportMasterVO;
|
||||
import org.springblade.system.service.IAirportMasterService;
|
||||
import org.springblade.system.wrapper.AirportMasterWrapper;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
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.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 空港机场主数据 控制器
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
@NonDS
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@PreAuth(menu = "airport_master")
|
||||
@RequestMapping("/airport-master")
|
||||
@Tag(name = "空港机场主数据", description = "空港机场主数据")
|
||||
public class AirportMasterController extends BladeController {
|
||||
|
||||
private final IAirportMasterService airportMasterService;
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入airportMaster")
|
||||
public R<AirportMasterVO> detail(AirportMaster airportMaster) {
|
||||
AirportMaster detail = airportMasterService.getOne(Condition.getQueryWrapper(airportMaster));
|
||||
return R.data(AirportMasterWrapper.build().entityVO(detail));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入airportMaster")
|
||||
public R<IPage<AirportMasterVO>> list(AirportMasterVO airportMaster, Query query) {
|
||||
IPage<AirportMasterVO> pages = airportMasterService.selectAirportMasterPage(Condition.getPage(query), airportMaster);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "新增或修改", description = "传入airportMaster")
|
||||
public R submit(@Valid @RequestBody AirportMaster airportMaster) {
|
||||
return R.status(airportMasterService.submit(airportMaster));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(airportMasterService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 启用或停用
|
||||
*/
|
||||
@PostMapping("/status")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "启用或停用", description = "传入id和status")
|
||||
public R status(@Parameter(description = "主键", required = true) @RequestParam Long id,
|
||||
@Parameter(description = "状态", required = true) @RequestParam Integer status) {
|
||||
return R.status(airportMasterService.changeStatus(id, status));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入空港机场主数据
|
||||
*/
|
||||
@PostMapping("/import-airport-master")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "导入空港机场主数据", description = "传入excel")
|
||||
public R importAirportMaster(MultipartFile file) {
|
||||
AirportMasterImporter airportMasterImporter = new AirportMasterImporter(airportMasterService);
|
||||
ExcelUtil.save(file, airportMasterImporter, AirportMasterExcel.class);
|
||||
return R.success("操作成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出空港机场主数据
|
||||
*/
|
||||
@GetMapping("/export-airport-master")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "导出空港机场主数据")
|
||||
public void exportAirportMaster(@Parameter(hidden = true) @RequestParam Map<String, Object> airportMaster, HttpServletResponse response) {
|
||||
Object ids = airportMaster.remove("ids");
|
||||
QueryWrapper<AirportMaster> queryWrapper = Condition.getQueryWrapper(airportMaster, AirportMaster.class);
|
||||
if (Func.isNotEmpty(ids)) {
|
||||
queryWrapper.lambda().in(AirportMaster::getId, Func.toLongList(ids.toString()));
|
||||
}
|
||||
List<AirportMasterExcel> list = airportMasterService.exportAirportMaster(queryWrapper);
|
||||
ExcelUtil.export(response, "空港机场主数据" + DateUtil.time(), "空港机场主数据表", list, AirportMasterExcel.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出模板
|
||||
*/
|
||||
@GetMapping("/export-template")
|
||||
@ApiOperationSupport(order = 8)
|
||||
@Operation(summary = "导出模板")
|
||||
public void exportTemplate(HttpServletResponse response) {
|
||||
List<AirportMasterExcel> list = new ArrayList<>();
|
||||
ExcelUtil.export(response, "空港机场主数据模板", "空港机场主数据表", list, AirportMasterExcel.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,181 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.system.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
import org.springblade.core.excel.util.ExcelUtil;
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.secure.annotation.PreAuth;
|
||||
import org.springblade.core.tenant.annotation.NonDS;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.DateUtil;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springblade.system.excel.PortTerminalExcel;
|
||||
import org.springblade.system.excel.PortTerminalImporter;
|
||||
import org.springblade.system.pojo.entity.PortTerminal;
|
||||
import org.springblade.system.pojo.vo.PortTerminalVO;
|
||||
import org.springblade.system.service.IPortTerminalService;
|
||||
import org.springblade.system.wrapper.PortTerminalWrapper;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
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.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 港口码头主数据 控制器
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
@NonDS
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@PreAuth(menu = "port_terminal")
|
||||
@RequestMapping("/port-terminal")
|
||||
@Tag(name = "港口码头主数据", description = "港口码头主数据")
|
||||
public class PortTerminalController extends BladeController {
|
||||
|
||||
private final IPortTerminalService portTerminalService;
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入portTerminal")
|
||||
public R<PortTerminalVO> detail(PortTerminal portTerminal) {
|
||||
PortTerminal detail = portTerminalService.getOne(Condition.getQueryWrapper(portTerminal));
|
||||
return R.data(PortTerminalWrapper.build().entityVO(detail));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入portTerminal")
|
||||
public R<IPage<PortTerminalVO>> list(PortTerminalVO portTerminal, Query query) {
|
||||
IPage<PortTerminalVO> pages = portTerminalService.selectPortTerminalPage(Condition.getPage(query), portTerminal);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "新增或修改", description = "传入portTerminal")
|
||||
public R submit(@Valid @RequestBody PortTerminal portTerminal) {
|
||||
return R.status(portTerminalService.submit(portTerminal));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(portTerminalService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 启用或停用
|
||||
*/
|
||||
@PostMapping("/status")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "启用或停用", description = "传入id和status")
|
||||
public R status(@Parameter(description = "主键", required = true) @RequestParam Long id,
|
||||
@Parameter(description = "状态", required = true) @RequestParam Integer status) {
|
||||
return R.status(portTerminalService.changeStatus(id, status));
|
||||
}
|
||||
|
||||
/**
|
||||
* 上级港口下拉数据源
|
||||
*/
|
||||
@GetMapping("/port-select")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "上级港口下拉数据源")
|
||||
public R<List<PortTerminal>> portSelect() {
|
||||
return R.data(portTerminalService.selectEnabledPorts());
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入港口码头主数据
|
||||
*/
|
||||
@PostMapping("/import-port-terminal")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "导入港口码头主数据", description = "传入excel")
|
||||
public R importPortTerminal(MultipartFile file) {
|
||||
PortTerminalImporter portTerminalImporter = new PortTerminalImporter(portTerminalService);
|
||||
ExcelUtil.save(file, portTerminalImporter, PortTerminalExcel.class);
|
||||
return R.success("操作成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出港口码头主数据
|
||||
*/
|
||||
@GetMapping("/export-port-terminal")
|
||||
@ApiOperationSupport(order = 8)
|
||||
@Operation(summary = "导出港口码头主数据")
|
||||
public void exportPortTerminal(@Parameter(hidden = true) @RequestParam Map<String, Object> portTerminal, HttpServletResponse response) {
|
||||
Object ids = portTerminal.remove("ids");
|
||||
QueryWrapper<PortTerminal> queryWrapper = Condition.getQueryWrapper(portTerminal, PortTerminal.class);
|
||||
if (Func.isNotEmpty(ids)) {
|
||||
queryWrapper.lambda().in(PortTerminal::getId, Func.toLongList(ids.toString()));
|
||||
}
|
||||
List<PortTerminalExcel> list = portTerminalService.exportPortTerminal(queryWrapper);
|
||||
ExcelUtil.export(response, "港口码头主数据" + DateUtil.time(), "港口码头主数据表", list, PortTerminalExcel.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出模板
|
||||
*/
|
||||
@GetMapping("/export-template")
|
||||
@ApiOperationSupport(order = 9)
|
||||
@Operation(summary = "导出模板")
|
||||
public void exportTemplate(HttpServletResponse response) {
|
||||
List<PortTerminalExcel> list = new ArrayList<>();
|
||||
ExcelUtil.export(response, "港口码头主数据模板", "港口码头主数据表", list, PortTerminalExcel.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.system.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
import org.springblade.core.excel.util.ExcelUtil;
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.secure.annotation.PreAuth;
|
||||
import org.springblade.core.tenant.annotation.NonDS;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.DateUtil;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springblade.system.excel.RailwayStationExcel;
|
||||
import org.springblade.system.excel.RailwayStationImporter;
|
||||
import org.springblade.system.pojo.entity.RailwayStation;
|
||||
import org.springblade.system.pojo.vo.RailwayStationVO;
|
||||
import org.springblade.system.service.IRailwayStationService;
|
||||
import org.springblade.system.wrapper.RailwayStationWrapper;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
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.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 铁路车站主数据 控制器
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
@NonDS
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@PreAuth(menu = "railway_station")
|
||||
@RequestMapping("/railway-station")
|
||||
@Tag(name = "铁路车站主数据", description = "铁路车站主数据")
|
||||
public class RailwayStationController extends BladeController {
|
||||
|
||||
private final IRailwayStationService railwayStationService;
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入railwayStation")
|
||||
public R<RailwayStationVO> detail(RailwayStation railwayStation) {
|
||||
RailwayStation detail = railwayStationService.getOne(Condition.getQueryWrapper(railwayStation));
|
||||
return R.data(RailwayStationWrapper.build().entityVO(detail));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入railwayStation")
|
||||
public R<IPage<RailwayStationVO>> list(RailwayStationVO railwayStation, Query query) {
|
||||
IPage<RailwayStationVO> pages = railwayStationService.selectRailwayStationPage(Condition.getPage(query), railwayStation);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "新增或修改", description = "传入railwayStation")
|
||||
public R submit(@Valid @RequestBody RailwayStation railwayStation) {
|
||||
return R.status(railwayStationService.submit(railwayStation));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(railwayStationService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 启用或停用
|
||||
*/
|
||||
@PostMapping("/status")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "启用或停用", description = "传入id和status")
|
||||
public R status(@Parameter(description = "主键", required = true) @RequestParam Long id,
|
||||
@Parameter(description = "状态", required = true) @RequestParam Integer status) {
|
||||
return R.status(railwayStationService.changeStatus(id, status));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入铁路车站主数据
|
||||
*/
|
||||
@PostMapping("/import-railway-station")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "导入铁路车站主数据", description = "传入excel")
|
||||
public R importRailwayStation(MultipartFile file) {
|
||||
RailwayStationImporter railwayStationImporter = new RailwayStationImporter(railwayStationService);
|
||||
ExcelUtil.save(file, railwayStationImporter, RailwayStationExcel.class);
|
||||
return R.success("操作成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出铁路车站主数据
|
||||
*/
|
||||
@GetMapping("/export-railway-station")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "导出铁路车站主数据")
|
||||
public void exportRailwayStation(@Parameter(hidden = true) @RequestParam Map<String, Object> railwayStation, HttpServletResponse response) {
|
||||
Object ids = railwayStation.remove("ids");
|
||||
QueryWrapper<RailwayStation> queryWrapper = Condition.getQueryWrapper(railwayStation, RailwayStation.class);
|
||||
if (Func.isNotEmpty(ids)) {
|
||||
queryWrapper.lambda().in(RailwayStation::getId, Func.toLongList(ids.toString()));
|
||||
}
|
||||
List<RailwayStationExcel> list = railwayStationService.exportRailwayStation(queryWrapper);
|
||||
ExcelUtil.export(response, "铁路车站主数据" + DateUtil.time(), "铁路车站主数据表", list, RailwayStationExcel.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出模板
|
||||
*/
|
||||
@GetMapping("/export-template")
|
||||
@ApiOperationSupport(order = 8)
|
||||
@Operation(summary = "导出模板")
|
||||
public void exportTemplate(HttpServletResponse response) {
|
||||
List<RailwayStationExcel> list = new ArrayList<>();
|
||||
ExcelUtil.export(response, "铁路车站主数据模板", "铁路车站主数据表", list, RailwayStationExcel.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.system.excel;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelIgnore;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import cn.idev.excel.annotation.write.style.ColumnWidth;
|
||||
import cn.idev.excel.annotation.write.style.ContentRowHeight;
|
||||
import cn.idev.excel.annotation.write.style.HeadRowHeight;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 空港机场主数据 Excel
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
@Data
|
||||
@ColumnWidth(18)
|
||||
@HeadRowHeight(20)
|
||||
@ContentRowHeight(18)
|
||||
public class AirportMasterExcel implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ExcelIgnore
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty("编码")
|
||||
private String code;
|
||||
|
||||
@ExcelProperty("IATA编码")
|
||||
private String iataCode;
|
||||
|
||||
@ExcelProperty("ICAO代码")
|
||||
private String icaoCode;
|
||||
|
||||
@ExcelProperty("机场标准名称")
|
||||
private String name;
|
||||
|
||||
@ExcelProperty("机场简称")
|
||||
private String shortName;
|
||||
|
||||
@ExcelProperty("所属省份")
|
||||
private String provinceName;
|
||||
|
||||
@ExcelProperty("所属城市")
|
||||
private String cityName;
|
||||
|
||||
@ExcelProperty("经度")
|
||||
private BigDecimal longitude;
|
||||
|
||||
@ExcelProperty("纬度")
|
||||
private BigDecimal latitude;
|
||||
|
||||
@ExcelProperty("数据来源")
|
||||
private String dataSource;
|
||||
|
||||
@ExcelProperty("状态")
|
||||
private String statusName;
|
||||
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@ExcelProperty("报错文案")
|
||||
private String errorMessage;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.system.excel;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springblade.core.excel.support.ExcelImporter;
|
||||
import org.springblade.system.service.IAirportMasterService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 空港机场主数据导入类
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public class AirportMasterImporter implements ExcelImporter<AirportMasterExcel> {
|
||||
|
||||
private final IAirportMasterService service;
|
||||
|
||||
@Override
|
||||
public void save(List<AirportMasterExcel> data) {
|
||||
service.importAirportMaster(data);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.system.excel;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelIgnore;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import cn.idev.excel.annotation.write.style.ColumnWidth;
|
||||
import cn.idev.excel.annotation.write.style.ContentRowHeight;
|
||||
import cn.idev.excel.annotation.write.style.HeadRowHeight;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 港口码头主数据 Excel
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
@Data
|
||||
@ColumnWidth(18)
|
||||
@HeadRowHeight(20)
|
||||
@ContentRowHeight(18)
|
||||
public class PortTerminalExcel implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ExcelIgnore
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty("编码")
|
||||
private String code;
|
||||
|
||||
@ExcelProperty("港口/码头名称")
|
||||
private String name;
|
||||
|
||||
@ExcelProperty("类型")
|
||||
private String category;
|
||||
|
||||
@ExcelProperty("上级港口")
|
||||
private String parentName;
|
||||
|
||||
@ExcelProperty("上级港口编码")
|
||||
private String parentCode;
|
||||
|
||||
@ExcelProperty("国家")
|
||||
private String country;
|
||||
|
||||
@ExcelProperty("城市")
|
||||
private String city;
|
||||
|
||||
@ExcelProperty("经度")
|
||||
private BigDecimal longitude;
|
||||
|
||||
@ExcelProperty("纬度")
|
||||
private BigDecimal latitude;
|
||||
|
||||
@ExcelProperty("数据来源")
|
||||
private String dataSource;
|
||||
|
||||
@ExcelProperty("状态")
|
||||
private String statusName;
|
||||
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@ExcelProperty("报错文案")
|
||||
private String errorMessage;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.system.excel;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springblade.core.excel.support.ExcelImporter;
|
||||
import org.springblade.system.service.IPortTerminalService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 港口码头主数据导入类
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public class PortTerminalImporter implements ExcelImporter<PortTerminalExcel> {
|
||||
|
||||
private final IPortTerminalService service;
|
||||
|
||||
@Override
|
||||
public void save(List<PortTerminalExcel> data) {
|
||||
service.importPortTerminal(data);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.system.excel;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelIgnore;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import cn.idev.excel.annotation.write.style.ColumnWidth;
|
||||
import cn.idev.excel.annotation.write.style.ContentRowHeight;
|
||||
import cn.idev.excel.annotation.write.style.HeadRowHeight;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 铁路车站主数据 Excel
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
@Data
|
||||
@ColumnWidth(18)
|
||||
@HeadRowHeight(20)
|
||||
@ContentRowHeight(18)
|
||||
public class RailwayStationExcel implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ExcelIgnore
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty("编码")
|
||||
private String code;
|
||||
|
||||
@ExcelProperty("TMIS国标编码")
|
||||
private String tmisCode;
|
||||
|
||||
@ExcelProperty("电报码")
|
||||
private String telegraphCode;
|
||||
|
||||
@ExcelProperty("车站名称")
|
||||
private String name;
|
||||
|
||||
@ExcelProperty("所属铁路线路")
|
||||
private String railwayLine;
|
||||
|
||||
@ExcelProperty("所属省份")
|
||||
private String provinceName;
|
||||
|
||||
@ExcelProperty("所属城市")
|
||||
private String cityName;
|
||||
|
||||
@ExcelProperty("经度")
|
||||
private BigDecimal longitude;
|
||||
|
||||
@ExcelProperty("纬度")
|
||||
private BigDecimal latitude;
|
||||
|
||||
@ExcelProperty("数据来源")
|
||||
private String dataSource;
|
||||
|
||||
@ExcelProperty("状态")
|
||||
private String statusName;
|
||||
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@ExcelProperty("报错文案")
|
||||
private String errorMessage;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.system.excel;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springblade.core.excel.support.ExcelImporter;
|
||||
import org.springblade.system.service.IRailwayStationService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 铁路车站主数据导入类
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public class RailwayStationImporter implements ExcelImporter<RailwayStationExcel> {
|
||||
|
||||
private final IRailwayStationService service;
|
||||
|
||||
@Override
|
||||
public void save(List<RailwayStationExcel> data) {
|
||||
service.importRailwayStation(data);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springblade.system.pojo.entity.AirportMaster;
|
||||
import org.springblade.system.pojo.vo.AirportMasterVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 空港机场主数据 Mapper 接口
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
public interface AirportMasterMapper extends BaseMapper<AirportMaster> {
|
||||
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param airportMaster 查询参数
|
||||
* @return 空港机场分页
|
||||
*/
|
||||
List<AirportMasterVO> selectAirportMasterPage(IPage<AirportMasterVO> page, @Param("airportMaster") AirportMasterVO airportMaster);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.springblade.system.mapper.AirportMasterMapper">
|
||||
|
||||
<resultMap id="airportMasterResultMap" type="org.springblade.system.pojo.vo.AirportMasterVO">
|
||||
<result column="id" property="id"/>
|
||||
<result column="create_user" property="createUser"/>
|
||||
<result column="create_dept" property="createDept"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_user" property="updateUser"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="is_deleted" property="isDeleted"/>
|
||||
<result column="code" property="code"/>
|
||||
<result column="iata_code" property="iataCode"/>
|
||||
<result column="icao_code" property="icaoCode"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="short_name" property="shortName"/>
|
||||
<result column="province_code" property="provinceCode"/>
|
||||
<result column="province_name" property="provinceName"/>
|
||||
<result column="city_code" property="cityCode"/>
|
||||
<result column="city_name" property="cityName"/>
|
||||
<result column="longitude" property="longitude"/>
|
||||
<result column="latitude" property="latitude"/>
|
||||
<result column="data_source" property="dataSource"/>
|
||||
<result column="remark" property="remark"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectAirportMasterPage" resultMap="airportMasterResultMap">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
blade_airport_master
|
||||
WHERE
|
||||
is_deleted = 0
|
||||
<if test="airportMaster.code != null and airportMaster.code != ''">
|
||||
<bind name="codeLike" value="'%' + airportMaster.code + '%'"/>
|
||||
AND code LIKE #{codeLike}
|
||||
</if>
|
||||
<if test="airportMaster.name != null and airportMaster.name != ''">
|
||||
<bind name="nameLike" value="'%' + airportMaster.name + '%'"/>
|
||||
AND name LIKE #{nameLike}
|
||||
</if>
|
||||
<if test="airportMaster.dataSource != null and airportMaster.dataSource != ''">
|
||||
AND data_source = #{airportMaster.dataSource}
|
||||
</if>
|
||||
<if test="airportMaster.status != null">
|
||||
AND status = #{airportMaster.status}
|
||||
</if>
|
||||
ORDER BY update_time DESC, create_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.system.pojo.entity.PortTerminal;
|
||||
import org.springblade.system.pojo.vo.PortTerminalVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 港口码头主数据 Mapper 接口
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
public interface PortTerminalMapper extends BaseMapper<PortTerminal> {
|
||||
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param portTerminal 查询参数
|
||||
* @return 港口码头列表
|
||||
*/
|
||||
List<PortTerminalVO> selectPortTerminalPage(IPage<PortTerminalVO> page, PortTerminalVO portTerminal);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.springblade.system.mapper.PortTerminalMapper">
|
||||
|
||||
<resultMap id="portTerminalResultMap" type="org.springblade.system.pojo.vo.PortTerminalVO">
|
||||
<result column="id" property="id"/>
|
||||
<result column="create_user" property="createUser"/>
|
||||
<result column="create_dept" property="createDept"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_user" property="updateUser"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="is_deleted" property="isDeleted"/>
|
||||
<result column="code" property="code"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="category" property="category"/>
|
||||
<result column="parent_id" property="parentId"/>
|
||||
<result column="parent_code" property="parentCode"/>
|
||||
<result column="parent_name" property="parentName"/>
|
||||
<result column="country" property="country"/>
|
||||
<result column="city" property="city"/>
|
||||
<result column="longitude" property="longitude"/>
|
||||
<result column="latitude" property="latitude"/>
|
||||
<result column="data_source" property="dataSource"/>
|
||||
<result column="remark" property="remark"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectPortTerminalPage" resultMap="portTerminalResultMap">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
blade_port_terminal
|
||||
WHERE
|
||||
is_deleted = 0
|
||||
<if test="portTerminal.code != null and portTerminal.code != ''">
|
||||
<bind name="codeLike" value="'%' + portTerminal.code + '%'"/>
|
||||
AND code LIKE #{codeLike}
|
||||
</if>
|
||||
<if test="portTerminal.name != null and portTerminal.name != ''">
|
||||
<bind name="nameLike" value="'%' + portTerminal.name + '%'"/>
|
||||
AND name LIKE #{nameLike}
|
||||
</if>
|
||||
<if test="portTerminal.category != null and portTerminal.category != ''">
|
||||
AND category = #{portTerminal.category}
|
||||
</if>
|
||||
<if test="portTerminal.dataSource != null and portTerminal.dataSource != ''">
|
||||
AND data_source = #{portTerminal.dataSource}
|
||||
</if>
|
||||
<if test="portTerminal.city != null and portTerminal.city != ''">
|
||||
AND city = #{portTerminal.city}
|
||||
</if>
|
||||
<if test="portTerminal.country != null and portTerminal.country != ''">
|
||||
AND country = #{portTerminal.country}
|
||||
</if>
|
||||
<if test="portTerminal.status != null">
|
||||
AND status = #{portTerminal.status}
|
||||
</if>
|
||||
ORDER BY update_time DESC, create_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,52 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springblade.system.pojo.entity.RailwayStation;
|
||||
import org.springblade.system.pojo.vo.RailwayStationVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 铁路车站主数据 Mapper 接口
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
public interface RailwayStationMapper extends BaseMapper<RailwayStation> {
|
||||
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param railwayStation 查询参数
|
||||
* @return 铁路车站分页
|
||||
*/
|
||||
List<RailwayStationVO> selectRailwayStationPage(IPage<RailwayStationVO> page, @Param("railwayStation") RailwayStationVO railwayStation);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.springblade.system.mapper.RailwayStationMapper">
|
||||
|
||||
<resultMap id="railwayStationResultMap" type="org.springblade.system.pojo.vo.RailwayStationVO">
|
||||
<result column="id" property="id"/>
|
||||
<result column="create_user" property="createUser"/>
|
||||
<result column="create_dept" property="createDept"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_user" property="updateUser"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="is_deleted" property="isDeleted"/>
|
||||
<result column="code" property="code"/>
|
||||
<result column="tmis_code" property="tmisCode"/>
|
||||
<result column="telegraph_code" property="telegraphCode"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="railway_line" property="railwayLine"/>
|
||||
<result column="province_code" property="provinceCode"/>
|
||||
<result column="province_name" property="provinceName"/>
|
||||
<result column="city_code" property="cityCode"/>
|
||||
<result column="city_name" property="cityName"/>
|
||||
<result column="longitude" property="longitude"/>
|
||||
<result column="latitude" property="latitude"/>
|
||||
<result column="data_source" property="dataSource"/>
|
||||
<result column="remark" property="remark"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectRailwayStationPage" resultMap="railwayStationResultMap">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
blade_railway_station
|
||||
WHERE
|
||||
is_deleted = 0
|
||||
<if test="railwayStation.code != null and railwayStation.code != ''">
|
||||
<bind name="codeLike" value="'%' + railwayStation.code + '%'"/>
|
||||
AND code LIKE #{codeLike}
|
||||
</if>
|
||||
<if test="railwayStation.name != null and railwayStation.name != ''">
|
||||
<bind name="nameLike" value="'%' + railwayStation.name + '%'"/>
|
||||
AND name LIKE #{nameLike}
|
||||
</if>
|
||||
<if test="railwayStation.dataSource != null and railwayStation.dataSource != ''">
|
||||
AND data_source = #{railwayStation.dataSource}
|
||||
</if>
|
||||
<if test="railwayStation.status != null">
|
||||
AND status = #{railwayStation.status}
|
||||
</if>
|
||||
ORDER BY update_time DESC, create_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,85 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseService;
|
||||
import org.springblade.system.excel.AirportMasterExcel;
|
||||
import org.springblade.system.pojo.entity.AirportMaster;
|
||||
import org.springblade.system.pojo.vo.AirportMasterVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 空港机场主数据 服务类
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
public interface IAirportMasterService extends BaseService<AirportMaster> {
|
||||
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param airportMaster 查询参数
|
||||
* @return 空港机场分页
|
||||
*/
|
||||
IPage<AirportMasterVO> selectAirportMasterPage(IPage<AirportMasterVO> page, AirportMasterVO airportMaster);
|
||||
|
||||
/**
|
||||
* 新增或修改空港机场
|
||||
*
|
||||
* @param airportMaster 空港机场
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean submit(AirportMaster airportMaster);
|
||||
|
||||
/**
|
||||
* 启用或停用
|
||||
*
|
||||
* @param id 主键
|
||||
* @param status 状态
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean changeStatus(Long id, Integer status);
|
||||
|
||||
/**
|
||||
* 导入空港机场
|
||||
*
|
||||
* @param data 导入数据
|
||||
*/
|
||||
void importAirportMaster(List<AirportMasterExcel> data);
|
||||
|
||||
/**
|
||||
* 导出空港机场
|
||||
*
|
||||
* @param queryWrapper 查询条件
|
||||
* @return 导出数据
|
||||
*/
|
||||
List<AirportMasterExcel> exportAirportMaster(Wrapper<AirportMaster> queryWrapper);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseService;
|
||||
import org.springblade.system.excel.PortTerminalExcel;
|
||||
import org.springblade.system.pojo.entity.PortTerminal;
|
||||
import org.springblade.system.pojo.vo.PortTerminalVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 港口码头主数据 服务类
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
public interface IPortTerminalService extends BaseService<PortTerminal> {
|
||||
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param portTerminal 查询参数
|
||||
* @return 港口码头分页
|
||||
*/
|
||||
IPage<PortTerminalVO> selectPortTerminalPage(IPage<PortTerminalVO> page, PortTerminalVO portTerminal);
|
||||
|
||||
/**
|
||||
* 新增或修改港口码头
|
||||
*
|
||||
* @param portTerminal 港口码头
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean submit(PortTerminal portTerminal);
|
||||
|
||||
/**
|
||||
* 启用或停用
|
||||
*
|
||||
* @param id 主键
|
||||
* @param status 状态
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean changeStatus(Long id, Integer status);
|
||||
|
||||
/**
|
||||
* 启用港口下拉数据源
|
||||
*
|
||||
* @return 港口列表
|
||||
*/
|
||||
List<PortTerminal> selectEnabledPorts();
|
||||
|
||||
/**
|
||||
* 导入港口码头
|
||||
*
|
||||
* @param data 导入数据
|
||||
*/
|
||||
void importPortTerminal(List<PortTerminalExcel> data);
|
||||
|
||||
/**
|
||||
* 导出港口码头
|
||||
*
|
||||
* @param queryWrapper 查询条件
|
||||
* @return 导出数据
|
||||
*/
|
||||
List<PortTerminalExcel> exportPortTerminal(Wrapper<PortTerminal> queryWrapper);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseService;
|
||||
import org.springblade.system.excel.RailwayStationExcel;
|
||||
import org.springblade.system.pojo.entity.RailwayStation;
|
||||
import org.springblade.system.pojo.vo.RailwayStationVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 铁路车站主数据 服务类
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
public interface IRailwayStationService extends BaseService<RailwayStation> {
|
||||
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param railwayStation 查询参数
|
||||
* @return 铁路车站分页
|
||||
*/
|
||||
IPage<RailwayStationVO> selectRailwayStationPage(IPage<RailwayStationVO> page, RailwayStationVO railwayStation);
|
||||
|
||||
/**
|
||||
* 新增或修改铁路车站
|
||||
*
|
||||
* @param railwayStation 铁路车站
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean submit(RailwayStation railwayStation);
|
||||
|
||||
/**
|
||||
* 启用或停用
|
||||
*
|
||||
* @param id 主键
|
||||
* @param status 状态
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean changeStatus(Long id, Integer status);
|
||||
|
||||
/**
|
||||
* 导入铁路车站
|
||||
*
|
||||
* @param data 导入数据
|
||||
*/
|
||||
void importRailwayStation(List<RailwayStationExcel> data);
|
||||
|
||||
/**
|
||||
* 导出铁路车站
|
||||
*
|
||||
* @param queryWrapper 查询条件
|
||||
* @return 导出数据
|
||||
*/
|
||||
List<RailwayStationExcel> exportRailwayStation(Wrapper<RailwayStation> queryWrapper);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,255 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.system.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springblade.core.log.exception.ServiceException;
|
||||
import org.springblade.core.mp.base.BaseServiceImpl;
|
||||
import org.springblade.core.tool.utils.BeanUtil;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springblade.system.excel.AirportMasterExcel;
|
||||
import org.springblade.system.mapper.AirportMasterMapper;
|
||||
import org.springblade.system.pojo.entity.AirportMaster;
|
||||
import org.springblade.system.pojo.entity.Region;
|
||||
import org.springblade.system.pojo.vo.AirportMasterVO;
|
||||
import org.springblade.system.service.IAirportMasterService;
|
||||
import org.springblade.system.service.IRegionService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* 空港机场主数据 服务实现类
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class AirportMasterServiceImpl extends BaseServiceImpl<AirportMasterMapper, AirportMaster> implements IAirportMasterService {
|
||||
|
||||
private static final String CODE_PREFIX = "JC-";
|
||||
private static final String SOURCE_BATCH = "批量导入";
|
||||
private static final String SOURCE_MANUAL = "手工导入";
|
||||
private static final int STATUS_ENABLED = 1;
|
||||
private static final int STATUS_DISABLED = 2;
|
||||
private static final int REMARK_MAX_LENGTH = 200;
|
||||
private static final Pattern IATA_CODE_PATTERN = Pattern.compile("^[A-Z]{3}$");
|
||||
private static final Pattern ICAO_CODE_PATTERN = Pattern.compile("^[A-Z]{4}$");
|
||||
private static final BigDecimal MIN_LONGITUDE = BigDecimal.valueOf(-180);
|
||||
private static final BigDecimal MAX_LONGITUDE = BigDecimal.valueOf(180);
|
||||
private static final BigDecimal MIN_LATITUDE = BigDecimal.valueOf(-90);
|
||||
private static final BigDecimal MAX_LATITUDE = BigDecimal.valueOf(90);
|
||||
|
||||
private final IRegionService regionService;
|
||||
|
||||
@Override
|
||||
public IPage<AirportMasterVO> selectAirportMasterPage(IPage<AirportMasterVO> page, AirportMasterVO airportMaster) {
|
||||
return page.setRecords(baseMapper.selectAirportMasterPage(page, airportMaster));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean submit(AirportMaster airportMaster) {
|
||||
prepare(airportMaster, SOURCE_MANUAL);
|
||||
validate(airportMaster);
|
||||
return saveOrUpdate(airportMaster);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean changeStatus(Long id, Integer status) {
|
||||
if (Func.isEmpty(id)) {
|
||||
throw new ServiceException("主键不能为空");
|
||||
}
|
||||
AirportMaster airportMaster = getById(id);
|
||||
if (Func.isEmpty(airportMaster)) {
|
||||
throw new ServiceException("空港机场不存在");
|
||||
}
|
||||
if (!Objects.equals(status, STATUS_ENABLED) && !Objects.equals(status, STATUS_DISABLED)) {
|
||||
throw new ServiceException("启停状态不正确");
|
||||
}
|
||||
AirportMaster update = new AirportMaster();
|
||||
update.setId(id);
|
||||
update.setStatus(status);
|
||||
return updateById(update);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void importAirportMaster(List<AirportMasterExcel> data) {
|
||||
List<String> errorList = new ArrayList<>();
|
||||
for (int index = 0; index < data.size(); index++) {
|
||||
AirportMasterExcel excel = data.get(index);
|
||||
try {
|
||||
AirportMaster airportMaster = Objects.requireNonNull(BeanUtil.copyProperties(excel, AirportMaster.class));
|
||||
airportMaster.setDataSource(SOURCE_BATCH);
|
||||
airportMaster.setStatus(STATUS_ENABLED);
|
||||
prepare(airportMaster, SOURCE_BATCH);
|
||||
validate(airportMaster);
|
||||
save(airportMaster);
|
||||
} catch (Exception exception) {
|
||||
String message = exception instanceof ServiceException ? exception.getMessage() : "导入失败";
|
||||
errorList.add("第" + (index + 2) + "行:" + message);
|
||||
}
|
||||
}
|
||||
if (Func.isNotEmpty(errorList)) {
|
||||
throw new ServiceException(String.join(";", errorList));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AirportMasterExcel> exportAirportMaster(Wrapper<AirportMaster> queryWrapper) {
|
||||
List<AirportMaster> airportMasterList = list(queryWrapper);
|
||||
return airportMasterList.stream().map(airportMaster -> {
|
||||
AirportMasterExcel excel = Objects.requireNonNull(BeanUtil.copyProperties(airportMaster, AirportMasterExcel.class));
|
||||
excel.setStatusName(Objects.equals(airportMaster.getStatus(), STATUS_ENABLED) ? "启用" : "停用");
|
||||
return excel;
|
||||
}).toList();
|
||||
}
|
||||
|
||||
private void prepare(AirportMaster airportMaster, String defaultDataSource) {
|
||||
airportMaster.setIataCode(trimToEmpty(airportMaster.getIataCode()).toUpperCase(Locale.ROOT));
|
||||
airportMaster.setCode(CODE_PREFIX + airportMaster.getIataCode());
|
||||
airportMaster.setIcaoCode(trimToEmpty(airportMaster.getIcaoCode()).toUpperCase(Locale.ROOT));
|
||||
airportMaster.setName(trimToEmpty(airportMaster.getName()));
|
||||
airportMaster.setShortName(trimToNull(airportMaster.getShortName()));
|
||||
airportMaster.setProvinceCode(trimToNull(airportMaster.getProvinceCode()));
|
||||
airportMaster.setProvinceName(trimToNull(airportMaster.getProvinceName()));
|
||||
airportMaster.setCityCode(trimToNull(airportMaster.getCityCode()));
|
||||
airportMaster.setCityName(trimToNull(airportMaster.getCityName()));
|
||||
airportMaster.setRemark(trimToNull(airportMaster.getRemark()));
|
||||
airportMaster.setDataSource(Func.toStrWithEmpty(airportMaster.getDataSource(), defaultDataSource));
|
||||
if (Func.isEmpty(airportMaster.getStatus())) {
|
||||
airportMaster.setStatus(STATUS_ENABLED);
|
||||
}
|
||||
fillRegion(airportMaster);
|
||||
}
|
||||
|
||||
private void validate(AirportMaster airportMaster) {
|
||||
if (Func.isEmpty(airportMaster.getIataCode())) {
|
||||
throw new ServiceException("IATA编码不能为空");
|
||||
}
|
||||
if (!IATA_CODE_PATTERN.matcher(airportMaster.getIataCode()).matches()) {
|
||||
throw new ServiceException("IATA编码为3位大写字母");
|
||||
}
|
||||
if (Func.isEmpty(airportMaster.getIcaoCode())) {
|
||||
throw new ServiceException("ICAO代码不能为空");
|
||||
}
|
||||
if (!ICAO_CODE_PATTERN.matcher(airportMaster.getIcaoCode()).matches()) {
|
||||
throw new ServiceException("ICAO代码为4位大写字母");
|
||||
}
|
||||
if (Func.isEmpty(airportMaster.getName())) {
|
||||
throw new ServiceException("机场标准名称不能为空");
|
||||
}
|
||||
if (Func.isEmpty(airportMaster.getProvinceCode()) || Func.isEmpty(airportMaster.getCityCode())) {
|
||||
throw new ServiceException("请选择省份和城市");
|
||||
}
|
||||
validateCoordinate(airportMaster.getLongitude(), MIN_LONGITUDE, MAX_LONGITUDE, "经度");
|
||||
validateCoordinate(airportMaster.getLatitude(), MIN_LATITUDE, MAX_LATITUDE, "纬度");
|
||||
if (Func.isNotEmpty(airportMaster.getRemark()) && airportMaster.getRemark().length() > REMARK_MAX_LENGTH) {
|
||||
throw new ServiceException("备注不能超过200字");
|
||||
}
|
||||
validateUnique(airportMaster, AirportMaster::getIataCode, airportMaster.getIataCode(), "该IATA编码已存在");
|
||||
validateUnique(airportMaster, AirportMaster::getIcaoCode, airportMaster.getIcaoCode(), "该ICAO代码已存在");
|
||||
validateUnique(airportMaster, AirportMaster::getCode, airportMaster.getCode(), "该编码已存在");
|
||||
}
|
||||
|
||||
private void fillRegion(AirportMaster airportMaster) {
|
||||
Region province = null;
|
||||
if (Func.isNotEmpty(airportMaster.getProvinceCode())) {
|
||||
province = regionService.getById(airportMaster.getProvinceCode());
|
||||
}
|
||||
if (Func.isEmpty(province) && Func.isNotEmpty(airportMaster.getProvinceName())) {
|
||||
province = regionService.getOne(Wrappers.<Region>lambdaQuery()
|
||||
.eq(Region::getParentCode, "00")
|
||||
.eq(Region::getName, airportMaster.getProvinceName()), false);
|
||||
}
|
||||
if (Func.isEmpty(province)) {
|
||||
throw new ServiceException("请选择省份");
|
||||
}
|
||||
|
||||
Region city = null;
|
||||
if (Func.isNotEmpty(airportMaster.getCityCode())) {
|
||||
city = regionService.getById(airportMaster.getCityCode());
|
||||
}
|
||||
if (Func.isEmpty(city) && Func.isNotEmpty(airportMaster.getCityName())) {
|
||||
city = regionService.getOne(Wrappers.<Region>lambdaQuery()
|
||||
.eq(Region::getParentCode, province.getCode())
|
||||
.eq(Region::getName, airportMaster.getCityName()), false);
|
||||
}
|
||||
if (Func.isEmpty(city)) {
|
||||
throw new ServiceException("请选择城市");
|
||||
}
|
||||
if (!Objects.equals(city.getParentCode(), province.getCode())) {
|
||||
throw new ServiceException("所属城市与所属省份不匹配");
|
||||
}
|
||||
airportMaster.setProvinceCode(province.getCode());
|
||||
airportMaster.setProvinceName(province.getName());
|
||||
airportMaster.setCityCode(city.getCode());
|
||||
airportMaster.setCityName(city.getName());
|
||||
}
|
||||
|
||||
private void validateCoordinate(BigDecimal value, BigDecimal min, BigDecimal max, String name) {
|
||||
if (value == null) {
|
||||
return;
|
||||
}
|
||||
if (value.compareTo(min) < 0 || value.compareTo(max) > 0) {
|
||||
throw new ServiceException(name + "范围不正确");
|
||||
}
|
||||
}
|
||||
|
||||
private void validateUnique(AirportMaster airportMaster, com.baomidou.mybatisplus.core.toolkit.support.SFunction<AirportMaster, ?> column, String value, String message) {
|
||||
LambdaQueryWrapper<AirportMaster> queryWrapper = Wrappers.<AirportMaster>lambdaQuery()
|
||||
.eq(column, value)
|
||||
.eq(AirportMaster::getIsDeleted, 0);
|
||||
if (Func.isNotEmpty(airportMaster.getId())) {
|
||||
queryWrapper.ne(AirportMaster::getId, airportMaster.getId());
|
||||
}
|
||||
if (count(queryWrapper) > 0L) {
|
||||
throw new ServiceException(message);
|
||||
}
|
||||
}
|
||||
|
||||
private String trimToEmpty(String value) {
|
||||
return value == null ? "" : value.trim();
|
||||
}
|
||||
|
||||
private String trimToNull(String value) {
|
||||
String trimValue = trimToEmpty(value);
|
||||
return trimValue.isEmpty() ? null : trimValue;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,237 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.system.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import org.springblade.core.log.exception.ServiceException;
|
||||
import org.springblade.core.mp.base.BaseServiceImpl;
|
||||
import org.springblade.core.tool.utils.BeanUtil;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springblade.system.excel.PortTerminalExcel;
|
||||
import org.springblade.system.mapper.PortTerminalMapper;
|
||||
import org.springblade.system.pojo.entity.PortTerminal;
|
||||
import org.springblade.system.pojo.vo.PortTerminalVO;
|
||||
import org.springblade.system.service.IPortTerminalService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* 港口码头主数据 服务实现类
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
@Service
|
||||
public class PortTerminalServiceImpl extends BaseServiceImpl<PortTerminalMapper, PortTerminal> implements IPortTerminalService {
|
||||
|
||||
private static final String CATEGORY_PORT = "港口";
|
||||
private static final String CATEGORY_TERMINAL = "码头";
|
||||
private static final String SOURCE_INITIAL = "初始导入";
|
||||
private static final String SOURCE_BATCH = "批量导入";
|
||||
private static final String SOURCE_MANUAL = "手工导入";
|
||||
private static final int STATUS_ENABLED = 1;
|
||||
private static final int STATUS_DISABLED = 2;
|
||||
private static final Pattern PORT_CODE_PATTERN = Pattern.compile("^[A-Z]{5}$");
|
||||
private static final Pattern TERMINAL_CODE_PATTERN = Pattern.compile("^[A-Z]{5}-[A-Z0-9]+$");
|
||||
|
||||
@Override
|
||||
public IPage<PortTerminalVO> selectPortTerminalPage(IPage<PortTerminalVO> page, PortTerminalVO portTerminal) {
|
||||
return page.setRecords(baseMapper.selectPortTerminalPage(page, portTerminal));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean submit(PortTerminal portTerminal) {
|
||||
prepare(portTerminal, SOURCE_MANUAL);
|
||||
validate(portTerminal);
|
||||
return saveOrUpdate(portTerminal);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean changeStatus(Long id, Integer status) {
|
||||
if (Func.isEmpty(id)) {
|
||||
throw new ServiceException("主键不能为空");
|
||||
}
|
||||
PortTerminal portTerminal = getById(id);
|
||||
if (Func.isEmpty(portTerminal)) {
|
||||
throw new ServiceException("港口码头不存在");
|
||||
}
|
||||
if (!Objects.equals(status, STATUS_ENABLED) && !Objects.equals(status, STATUS_DISABLED)) {
|
||||
throw new ServiceException("启停状态不正确");
|
||||
}
|
||||
if (Objects.equals(status, STATUS_DISABLED) && CATEGORY_PORT.equals(portTerminal.getCategory())) {
|
||||
validateEnabledTerminal(portTerminal.getId());
|
||||
}
|
||||
PortTerminal update = new PortTerminal();
|
||||
update.setId(id);
|
||||
update.setStatus(status);
|
||||
return updateById(update);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PortTerminal> selectEnabledPorts() {
|
||||
return list(Wrappers.<PortTerminal>lambdaQuery()
|
||||
.eq(PortTerminal::getCategory, CATEGORY_PORT)
|
||||
.eq(PortTerminal::getStatus, STATUS_ENABLED)
|
||||
.orderByAsc(PortTerminal::getCode));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void importPortTerminal(List<PortTerminalExcel> data) {
|
||||
List<String> errorList = new ArrayList<>();
|
||||
for (int index = 0; index < data.size(); index++) {
|
||||
PortTerminalExcel excel = data.get(index);
|
||||
try {
|
||||
PortTerminal portTerminal = Objects.requireNonNull(BeanUtil.copyProperties(excel, PortTerminal.class));
|
||||
portTerminal.setDataSource(SOURCE_BATCH);
|
||||
portTerminal.setStatus(STATUS_ENABLED);
|
||||
prepare(portTerminal, SOURCE_BATCH);
|
||||
validate(portTerminal);
|
||||
save(portTerminal);
|
||||
} catch (Exception exception) {
|
||||
String message = exception instanceof ServiceException ? exception.getMessage() : "导入失败";
|
||||
errorList.add("第" + (index + 2) + "行:" + message);
|
||||
}
|
||||
}
|
||||
if (Func.isNotEmpty(errorList)) {
|
||||
throw new ServiceException(String.join(";", errorList));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PortTerminalExcel> exportPortTerminal(Wrapper<PortTerminal> queryWrapper) {
|
||||
List<PortTerminal> portTerminalList = list(queryWrapper);
|
||||
return portTerminalList.stream().map(portTerminal -> {
|
||||
PortTerminalExcel excel = Objects.requireNonNull(BeanUtil.copyProperties(portTerminal, PortTerminalExcel.class));
|
||||
excel.setStatusName(Objects.equals(portTerminal.getStatus(), STATUS_ENABLED) ? "启用" : "停用");
|
||||
return excel;
|
||||
}).toList();
|
||||
}
|
||||
|
||||
private void prepare(PortTerminal portTerminal, String defaultDataSource) {
|
||||
portTerminal.setCode(trimToEmpty(portTerminal.getCode()).toUpperCase(Locale.ROOT));
|
||||
portTerminal.setCategory(trimToEmpty(portTerminal.getCategory()));
|
||||
portTerminal.setName(trimToEmpty(portTerminal.getName()));
|
||||
portTerminal.setDataSource(Func.toStrWithEmpty(portTerminal.getDataSource(), defaultDataSource));
|
||||
if (Func.isEmpty(portTerminal.getStatus())) {
|
||||
portTerminal.setStatus(STATUS_ENABLED);
|
||||
}
|
||||
if (CATEGORY_PORT.equals(portTerminal.getCategory())) {
|
||||
portTerminal.setParentId(null);
|
||||
portTerminal.setParentCode(null);
|
||||
portTerminal.setParentName(null);
|
||||
return;
|
||||
}
|
||||
fillParentPort(portTerminal);
|
||||
}
|
||||
|
||||
private void fillParentPort(PortTerminal portTerminal) {
|
||||
PortTerminal parent = null;
|
||||
if (Func.isNotEmpty(portTerminal.getParentId())) {
|
||||
parent = getById(portTerminal.getParentId());
|
||||
}
|
||||
if (Func.isEmpty(parent) && Func.isNotEmpty(portTerminal.getParentCode())) {
|
||||
parent = getOne(Wrappers.<PortTerminal>lambdaQuery()
|
||||
.eq(PortTerminal::getCode, trimToEmpty(portTerminal.getParentCode()).toUpperCase(Locale.ROOT))
|
||||
.eq(PortTerminal::getCategory, CATEGORY_PORT)
|
||||
.eq(PortTerminal::getIsDeleted, 0));
|
||||
}
|
||||
if (Func.isEmpty(parent)) {
|
||||
throw new ServiceException("码头必须选择上级港口");
|
||||
}
|
||||
if (!CATEGORY_PORT.equals(parent.getCategory())) {
|
||||
throw new ServiceException("上级港口类型不正确");
|
||||
}
|
||||
portTerminal.setParentId(parent.getId());
|
||||
portTerminal.setParentCode(parent.getCode());
|
||||
portTerminal.setParentName(parent.getName());
|
||||
portTerminal.setCountry(parent.getCountry());
|
||||
portTerminal.setCity(parent.getCity());
|
||||
}
|
||||
|
||||
private void validate(PortTerminal portTerminal) {
|
||||
if (!CATEGORY_PORT.equals(portTerminal.getCategory()) && !CATEGORY_TERMINAL.equals(portTerminal.getCategory())) {
|
||||
throw new ServiceException("类型只能为港口或码头");
|
||||
}
|
||||
if (Func.isEmpty(portTerminal.getCode())) {
|
||||
throw new ServiceException("编码不能为空");
|
||||
}
|
||||
if (CATEGORY_PORT.equals(portTerminal.getCategory()) && !PORT_CODE_PATTERN.matcher(portTerminal.getCode()).matches()) {
|
||||
throw new ServiceException("港口编码为5位大写字母");
|
||||
}
|
||||
if (CATEGORY_TERMINAL.equals(portTerminal.getCategory()) && !TERMINAL_CODE_PATTERN.matcher(portTerminal.getCode()).matches()) {
|
||||
throw new ServiceException("码头编码格式为港口编码-码头标识");
|
||||
}
|
||||
if (CATEGORY_TERMINAL.equals(portTerminal.getCategory()) && !portTerminal.getCode().startsWith(portTerminal.getParentCode() + "-")) {
|
||||
throw new ServiceException("码头编码必须以所属港口编码开头");
|
||||
}
|
||||
validateUniqueCode(portTerminal);
|
||||
if (Objects.equals(portTerminal.getStatus(), STATUS_DISABLED) && CATEGORY_PORT.equals(portTerminal.getCategory())) {
|
||||
validateEnabledTerminal(portTerminal.getId());
|
||||
}
|
||||
}
|
||||
|
||||
private void validateUniqueCode(PortTerminal portTerminal) {
|
||||
LambdaQueryWrapper<PortTerminal> queryWrapper = Wrappers.<PortTerminal>lambdaQuery()
|
||||
.eq(PortTerminal::getCode, portTerminal.getCode())
|
||||
.eq(PortTerminal::getIsDeleted, 0);
|
||||
if (Func.isNotEmpty(portTerminal.getId())) {
|
||||
queryWrapper.ne(PortTerminal::getId, portTerminal.getId());
|
||||
}
|
||||
if (count(queryWrapper) > 0L) {
|
||||
throw new ServiceException("该编码已存在");
|
||||
}
|
||||
}
|
||||
|
||||
private void validateEnabledTerminal(Long parentId) {
|
||||
if (Func.isEmpty(parentId)) {
|
||||
return;
|
||||
}
|
||||
long count = count(Wrappers.<PortTerminal>lambdaQuery()
|
||||
.eq(PortTerminal::getParentId, parentId)
|
||||
.eq(PortTerminal::getCategory, CATEGORY_TERMINAL)
|
||||
.eq(PortTerminal::getStatus, STATUS_ENABLED)
|
||||
.eq(PortTerminal::getIsDeleted, 0));
|
||||
if (count > 0L) {
|
||||
throw new ServiceException("该港口下存在已启用码头,请先停用码头");
|
||||
}
|
||||
}
|
||||
|
||||
private String trimToEmpty(String value) {
|
||||
return value == null ? "" : value.trim();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,255 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.system.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springblade.core.log.exception.ServiceException;
|
||||
import org.springblade.core.mp.base.BaseServiceImpl;
|
||||
import org.springblade.core.tool.utils.BeanUtil;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springblade.system.excel.RailwayStationExcel;
|
||||
import org.springblade.system.mapper.RailwayStationMapper;
|
||||
import org.springblade.system.pojo.entity.RailwayStation;
|
||||
import org.springblade.system.pojo.entity.Region;
|
||||
import org.springblade.system.pojo.vo.RailwayStationVO;
|
||||
import org.springblade.system.service.IRailwayStationService;
|
||||
import org.springblade.system.service.IRegionService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* 铁路车站主数据 服务实现类
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class RailwayStationServiceImpl extends BaseServiceImpl<RailwayStationMapper, RailwayStation> implements IRailwayStationService {
|
||||
|
||||
private static final String CODE_PREFIX = "TL";
|
||||
private static final String SOURCE_BATCH = "批量导入";
|
||||
private static final String SOURCE_MANUAL = "手工导入";
|
||||
private static final int STATUS_ENABLED = 1;
|
||||
private static final int STATUS_DISABLED = 2;
|
||||
private static final int REMARK_MAX_LENGTH = 200;
|
||||
private static final Pattern TMIS_CODE_PATTERN = Pattern.compile("^\\d{5}$");
|
||||
private static final Pattern TELEGRAPH_CODE_PATTERN = Pattern.compile("^[A-Z]{3}$");
|
||||
private static final BigDecimal MIN_LONGITUDE = BigDecimal.valueOf(-180);
|
||||
private static final BigDecimal MAX_LONGITUDE = BigDecimal.valueOf(180);
|
||||
private static final BigDecimal MIN_LATITUDE = BigDecimal.valueOf(-90);
|
||||
private static final BigDecimal MAX_LATITUDE = BigDecimal.valueOf(90);
|
||||
|
||||
private final IRegionService regionService;
|
||||
|
||||
@Override
|
||||
public IPage<RailwayStationVO> selectRailwayStationPage(IPage<RailwayStationVO> page, RailwayStationVO railwayStation) {
|
||||
return page.setRecords(baseMapper.selectRailwayStationPage(page, railwayStation));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean submit(RailwayStation railwayStation) {
|
||||
prepare(railwayStation, SOURCE_MANUAL);
|
||||
validate(railwayStation);
|
||||
return saveOrUpdate(railwayStation);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean changeStatus(Long id, Integer status) {
|
||||
if (Func.isEmpty(id)) {
|
||||
throw new ServiceException("主键不能为空");
|
||||
}
|
||||
RailwayStation railwayStation = getById(id);
|
||||
if (Func.isEmpty(railwayStation)) {
|
||||
throw new ServiceException("铁路车站不存在");
|
||||
}
|
||||
if (!Objects.equals(status, STATUS_ENABLED) && !Objects.equals(status, STATUS_DISABLED)) {
|
||||
throw new ServiceException("启停状态不正确");
|
||||
}
|
||||
RailwayStation update = new RailwayStation();
|
||||
update.setId(id);
|
||||
update.setStatus(status);
|
||||
return updateById(update);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void importRailwayStation(List<RailwayStationExcel> data) {
|
||||
List<String> errorList = new ArrayList<>();
|
||||
for (int index = 0; index < data.size(); index++) {
|
||||
RailwayStationExcel excel = data.get(index);
|
||||
try {
|
||||
RailwayStation railwayStation = Objects.requireNonNull(BeanUtil.copyProperties(excel, RailwayStation.class));
|
||||
railwayStation.setDataSource(SOURCE_BATCH);
|
||||
railwayStation.setStatus(STATUS_ENABLED);
|
||||
prepare(railwayStation, SOURCE_BATCH);
|
||||
validate(railwayStation);
|
||||
save(railwayStation);
|
||||
} catch (Exception exception) {
|
||||
String message = exception instanceof ServiceException ? exception.getMessage() : "导入失败";
|
||||
errorList.add("第" + (index + 2) + "行:" + message);
|
||||
}
|
||||
}
|
||||
if (Func.isNotEmpty(errorList)) {
|
||||
throw new ServiceException(String.join(";", errorList));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RailwayStationExcel> exportRailwayStation(Wrapper<RailwayStation> queryWrapper) {
|
||||
List<RailwayStation> railwayStationList = list(queryWrapper);
|
||||
return railwayStationList.stream().map(railwayStation -> {
|
||||
RailwayStationExcel excel = Objects.requireNonNull(BeanUtil.copyProperties(railwayStation, RailwayStationExcel.class));
|
||||
excel.setStatusName(Objects.equals(railwayStation.getStatus(), STATUS_ENABLED) ? "启用" : "停用");
|
||||
return excel;
|
||||
}).toList();
|
||||
}
|
||||
|
||||
private void prepare(RailwayStation railwayStation, String defaultDataSource) {
|
||||
railwayStation.setTmisCode(trimToEmpty(railwayStation.getTmisCode()));
|
||||
railwayStation.setCode(CODE_PREFIX + railwayStation.getTmisCode());
|
||||
railwayStation.setTelegraphCode(trimToEmpty(railwayStation.getTelegraphCode()).toUpperCase(Locale.ROOT));
|
||||
railwayStation.setName(trimToEmpty(railwayStation.getName()));
|
||||
railwayStation.setRailwayLine(trimToNull(railwayStation.getRailwayLine()));
|
||||
railwayStation.setProvinceCode(trimToNull(railwayStation.getProvinceCode()));
|
||||
railwayStation.setProvinceName(trimToNull(railwayStation.getProvinceName()));
|
||||
railwayStation.setCityCode(trimToNull(railwayStation.getCityCode()));
|
||||
railwayStation.setCityName(trimToNull(railwayStation.getCityName()));
|
||||
railwayStation.setRemark(trimToNull(railwayStation.getRemark()));
|
||||
railwayStation.setDataSource(Func.toStrWithEmpty(railwayStation.getDataSource(), defaultDataSource));
|
||||
if (Func.isEmpty(railwayStation.getStatus())) {
|
||||
railwayStation.setStatus(STATUS_ENABLED);
|
||||
}
|
||||
fillRegion(railwayStation);
|
||||
}
|
||||
|
||||
private void validate(RailwayStation railwayStation) {
|
||||
if (Func.isEmpty(railwayStation.getTmisCode())) {
|
||||
throw new ServiceException("TMIS国标编码不能为空");
|
||||
}
|
||||
if (!TMIS_CODE_PATTERN.matcher(railwayStation.getTmisCode()).matches()) {
|
||||
throw new ServiceException("TMIS国标编码为5位数字");
|
||||
}
|
||||
if (Func.isEmpty(railwayStation.getTelegraphCode())) {
|
||||
throw new ServiceException("电报码不能为空");
|
||||
}
|
||||
if (!TELEGRAPH_CODE_PATTERN.matcher(railwayStation.getTelegraphCode()).matches()) {
|
||||
throw new ServiceException("电报码为3位大写字母");
|
||||
}
|
||||
if (Func.isEmpty(railwayStation.getName())) {
|
||||
throw new ServiceException("车站名称不能为空");
|
||||
}
|
||||
if (Func.isEmpty(railwayStation.getProvinceCode()) || Func.isEmpty(railwayStation.getCityCode())) {
|
||||
throw new ServiceException("请选择省份和城市");
|
||||
}
|
||||
validateCoordinate(railwayStation.getLongitude(), MIN_LONGITUDE, MAX_LONGITUDE, "经度");
|
||||
validateCoordinate(railwayStation.getLatitude(), MIN_LATITUDE, MAX_LATITUDE, "纬度");
|
||||
if (Func.isNotEmpty(railwayStation.getRemark()) && railwayStation.getRemark().length() > REMARK_MAX_LENGTH) {
|
||||
throw new ServiceException("备注不能超过200字");
|
||||
}
|
||||
validateUnique(railwayStation, RailwayStation::getTmisCode, railwayStation.getTmisCode(), "该TMIS编码已存在");
|
||||
validateUnique(railwayStation, RailwayStation::getTelegraphCode, railwayStation.getTelegraphCode(), "该电报码已存在");
|
||||
validateUnique(railwayStation, RailwayStation::getCode, railwayStation.getCode(), "该编码已存在");
|
||||
}
|
||||
|
||||
private void fillRegion(RailwayStation railwayStation) {
|
||||
Region province = null;
|
||||
if (Func.isNotEmpty(railwayStation.getProvinceCode())) {
|
||||
province = regionService.getById(railwayStation.getProvinceCode());
|
||||
}
|
||||
if (Func.isEmpty(province) && Func.isNotEmpty(railwayStation.getProvinceName())) {
|
||||
province = regionService.getOne(Wrappers.<Region>lambdaQuery()
|
||||
.eq(Region::getParentCode, "00")
|
||||
.eq(Region::getName, railwayStation.getProvinceName()), false);
|
||||
}
|
||||
if (Func.isEmpty(province)) {
|
||||
throw new ServiceException("请选择省份");
|
||||
}
|
||||
|
||||
Region city = null;
|
||||
if (Func.isNotEmpty(railwayStation.getCityCode())) {
|
||||
city = regionService.getById(railwayStation.getCityCode());
|
||||
}
|
||||
if (Func.isEmpty(city) && Func.isNotEmpty(railwayStation.getCityName())) {
|
||||
city = regionService.getOne(Wrappers.<Region>lambdaQuery()
|
||||
.eq(Region::getParentCode, province.getCode())
|
||||
.eq(Region::getName, railwayStation.getCityName()), false);
|
||||
}
|
||||
if (Func.isEmpty(city)) {
|
||||
throw new ServiceException("请选择城市");
|
||||
}
|
||||
if (!Objects.equals(city.getParentCode(), province.getCode())) {
|
||||
throw new ServiceException("所属城市与所属省份不匹配");
|
||||
}
|
||||
railwayStation.setProvinceCode(province.getCode());
|
||||
railwayStation.setProvinceName(province.getName());
|
||||
railwayStation.setCityCode(city.getCode());
|
||||
railwayStation.setCityName(city.getName());
|
||||
}
|
||||
|
||||
private void validateCoordinate(BigDecimal value, BigDecimal min, BigDecimal max, String name) {
|
||||
if (value == null) {
|
||||
return;
|
||||
}
|
||||
if (value.compareTo(min) < 0 || value.compareTo(max) > 0) {
|
||||
throw new ServiceException(name + "范围不正确");
|
||||
}
|
||||
}
|
||||
|
||||
private void validateUnique(RailwayStation railwayStation, com.baomidou.mybatisplus.core.toolkit.support.SFunction<RailwayStation, ?> column, String value, String message) {
|
||||
LambdaQueryWrapper<RailwayStation> queryWrapper = Wrappers.<RailwayStation>lambdaQuery()
|
||||
.eq(column, value)
|
||||
.eq(RailwayStation::getIsDeleted, 0);
|
||||
if (Func.isNotEmpty(railwayStation.getId())) {
|
||||
queryWrapper.ne(RailwayStation::getId, railwayStation.getId());
|
||||
}
|
||||
if (count(queryWrapper) > 0L) {
|
||||
throw new ServiceException(message);
|
||||
}
|
||||
}
|
||||
|
||||
private String trimToEmpty(String value) {
|
||||
return value == null ? "" : value.trim();
|
||||
}
|
||||
|
||||
private String trimToNull(String value) {
|
||||
String trimValue = trimToEmpty(value);
|
||||
return trimValue.isEmpty() ? null : trimValue;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.system.wrapper;
|
||||
|
||||
import org.springblade.core.mp.support.BaseEntityWrapper;
|
||||
import org.springblade.core.tool.utils.BeanUtil;
|
||||
import org.springblade.system.pojo.entity.AirportMaster;
|
||||
import org.springblade.system.pojo.vo.AirportMasterVO;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 空港机场主数据包装类
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
public class AirportMasterWrapper extends BaseEntityWrapper<AirportMaster, AirportMasterVO> {
|
||||
|
||||
public static AirportMasterWrapper build() {
|
||||
return new AirportMasterWrapper();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AirportMasterVO entityVO(AirportMaster airportMaster) {
|
||||
return Objects.requireNonNull(BeanUtil.copyProperties(airportMaster, AirportMasterVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.system.wrapper;
|
||||
|
||||
import org.springblade.core.mp.support.BaseEntityWrapper;
|
||||
import org.springblade.core.tool.utils.BeanUtil;
|
||||
import org.springblade.system.pojo.entity.PortTerminal;
|
||||
import org.springblade.system.pojo.vo.PortTerminalVO;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 港口码头主数据包装类
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
public class PortTerminalWrapper extends BaseEntityWrapper<PortTerminal, PortTerminalVO> {
|
||||
|
||||
public static PortTerminalWrapper build() {
|
||||
return new PortTerminalWrapper();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PortTerminalVO entityVO(PortTerminal portTerminal) {
|
||||
return Objects.requireNonNull(BeanUtil.copyProperties(portTerminal, PortTerminalVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.system.wrapper;
|
||||
|
||||
import org.springblade.core.mp.support.BaseEntityWrapper;
|
||||
import org.springblade.core.tool.utils.BeanUtil;
|
||||
import org.springblade.system.pojo.entity.RailwayStation;
|
||||
import org.springblade.system.pojo.vo.RailwayStationVO;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 铁路车站主数据包装类
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
public class RailwayStationWrapper extends BaseEntityWrapper<RailwayStation, RailwayStationVO> {
|
||||
|
||||
public static RailwayStationWrapper build() {
|
||||
return new RailwayStationWrapper();
|
||||
}
|
||||
|
||||
@Override
|
||||
public RailwayStationVO entityVO(RailwayStation railwayStation) {
|
||||
return Objects.requireNonNull(BeanUtil.copyProperties(railwayStation, RailwayStationVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
15
blade-service/blade-transport/Dockerfile
Normal file
15
blade-service/blade-transport/Dockerfile
Normal file
@@ -0,0 +1,15 @@
|
||||
FROM ${docker.base.image}
|
||||
|
||||
LABEL maintainer="bladejava@qq.com"
|
||||
|
||||
RUN mkdir -p /blade/transport
|
||||
|
||||
WORKDIR /blade/transport
|
||||
|
||||
EXPOSE 8110
|
||||
|
||||
COPY ./target/blade-transport.jar ./app.jar
|
||||
|
||||
ENTRYPOINT ["java", "--add-opens", "java.base/java.lang=ALL-UNNAMED", "--add-opens", "java.base/java.lang.reflect=ALL-UNNAMED", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"]
|
||||
|
||||
CMD ["--spring.profiles.active=prod"]
|
||||
48
blade-service/blade-transport/pom.xml
Normal file
48
blade-service/blade-transport/pom.xml
Normal file
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0"?>
|
||||
<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">
|
||||
|
||||
<parent>
|
||||
<groupId>org.springblade</groupId>
|
||||
<artifactId>blade-service</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>blade-transport</artifactId>
|
||||
<name>${project.artifactId}</name>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springblade</groupId>
|
||||
<artifactId>blade-core-boot</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springblade</groupId>
|
||||
<artifactId>blade-starter-swagger</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springblade</groupId>
|
||||
<artifactId>blade-transport-api</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>io.fabric8</groupId>
|
||||
<artifactId>docker-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>${docker.fabric.skip}</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.transport;
|
||||
|
||||
import org.springblade.core.cloud.client.BladeCloudApplication;
|
||||
import org.springblade.core.launch.BladeApplication;
|
||||
|
||||
/**
|
||||
* 运输服务启动器
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
@BladeCloudApplication
|
||||
public class TransportApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
BladeApplication.run("blade-transport", TransportApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.transport.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.secure.annotation.PreAuth;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springblade.transport.pojo.entity.MaintenancePlan;
|
||||
import org.springblade.transport.pojo.vo.MaintenancePlanVO;
|
||||
import org.springblade.transport.service.IMaintenancePlanService;
|
||||
import org.springblade.transport.wrapper.MaintenancePlanWrapper;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
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.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 车辆保养计划 控制器
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@PreAuth(menu = "maintenance_plan")
|
||||
@RequestMapping("/maintenance-plan")
|
||||
@Tag(name = "车辆保养计划", description = "车辆保养计划")
|
||||
public class MaintenancePlanController extends BladeController {
|
||||
|
||||
private final IMaintenancePlanService maintenancePlanService;
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入maintenancePlan")
|
||||
public R<MaintenancePlanVO> detail(MaintenancePlan maintenancePlan) {
|
||||
MaintenancePlan detail = maintenancePlanService.getOne(Condition.getQueryWrapper(maintenancePlan));
|
||||
return R.data(MaintenancePlanWrapper.build().entityVO(detail));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入maintenancePlan")
|
||||
public R<IPage<MaintenancePlanVO>> list(MaintenancePlanVO maintenancePlan, Query query) {
|
||||
IPage<MaintenancePlanVO> pages = maintenancePlanService.selectMaintenancePlanPage(Condition.getPage(query), maintenancePlan);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "新增或修改", description = "传入maintenancePlan")
|
||||
public R submit(@Valid @RequestBody MaintenancePlan maintenancePlan) {
|
||||
if (Func.isEmpty(maintenancePlan.getMileageUnit())) {
|
||||
maintenancePlan.setMileageUnit("船舶".equals(maintenancePlan.getVehicleType()) ? "海里" : "公里");
|
||||
}
|
||||
return R.status(maintenancePlanService.saveOrUpdate(maintenancePlan));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(maintenancePlanService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.transport.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.secure.annotation.PreAuth;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springblade.transport.pojo.entity.MaintenanceRecord;
|
||||
import org.springblade.transport.pojo.vo.MaintenanceRecordVO;
|
||||
import org.springblade.transport.service.IMaintenanceRecordService;
|
||||
import org.springblade.transport.wrapper.MaintenanceRecordWrapper;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
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.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 车辆维修记录 控制器
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@PreAuth(menu = "maintenance_record")
|
||||
@RequestMapping("/maintenance-record")
|
||||
@Tag(name = "车辆维修记录", description = "车辆维修记录")
|
||||
public class MaintenanceRecordController extends BladeController {
|
||||
|
||||
private final IMaintenanceRecordService maintenanceRecordService;
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入maintenanceRecord")
|
||||
public R<MaintenanceRecordVO> detail(MaintenanceRecord maintenanceRecord) {
|
||||
MaintenanceRecord detail = maintenanceRecordService.getOne(Condition.getQueryWrapper(maintenanceRecord));
|
||||
return R.data(MaintenanceRecordWrapper.build().entityVO(detail));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入maintenanceRecord")
|
||||
public R<IPage<MaintenanceRecordVO>> list(MaintenanceRecordVO maintenanceRecord, Query query) {
|
||||
IPage<MaintenanceRecordVO> pages = maintenanceRecordService.selectMaintenanceRecordPage(Condition.getPage(query), maintenanceRecord);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "新增或修改", description = "传入maintenanceRecord")
|
||||
public R submit(@Valid @RequestBody MaintenanceRecord maintenanceRecord) {
|
||||
if (Func.isEmpty(maintenanceRecord.getMileageUnit())) {
|
||||
maintenanceRecord.setMileageUnit("船舶".equals(maintenanceRecord.getVehicleType()) ? "海里" : "公里");
|
||||
}
|
||||
return R.status(maintenanceRecordService.saveOrUpdate(maintenanceRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(maintenanceRecordService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.transport.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.transport.pojo.entity.MaintenancePlan;
|
||||
import org.springblade.transport.pojo.vo.MaintenancePlanVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车辆保养计划 Mapper 接口
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
public interface MaintenancePlanMapper extends BaseMapper<MaintenancePlan> {
|
||||
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param maintenancePlan 查询参数
|
||||
* @return 保养计划列表
|
||||
*/
|
||||
List<MaintenancePlanVO> selectMaintenancePlanPage(IPage<MaintenancePlanVO> page, MaintenancePlanVO maintenancePlan);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.springblade.transport.mapper.MaintenancePlanMapper">
|
||||
|
||||
<resultMap id="maintenancePlanResultMap" type="org.springblade.transport.pojo.vo.MaintenancePlanVO">
|
||||
<result column="id" property="id"/>
|
||||
<result column="tenant_id" property="tenantId"/>
|
||||
<result column="create_user" property="createUser"/>
|
||||
<result column="create_dept" property="createDept"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_user" property="updateUser"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="is_deleted" property="isDeleted"/>
|
||||
<result column="vehicle_type" property="vehicleType"/>
|
||||
<result column="vehicle_no" property="vehicleNo"/>
|
||||
<result column="maintainer" property="maintainer"/>
|
||||
<result column="maintenance_time" property="maintenanceTime"/>
|
||||
<result column="mileage" property="mileage"/>
|
||||
<result column="mileage_unit" property="mileageUnit"/>
|
||||
<result column="maintenance_item" property="maintenanceItem"/>
|
||||
<result column="cost" property="cost"/>
|
||||
<result column="store_name" property="storeName"/>
|
||||
<result column="contact_phone" property="contactPhone"/>
|
||||
<result column="address" property="address"/>
|
||||
<result column="next_maintenance_time" property="nextMaintenanceTime"/>
|
||||
<result column="next_maintenance_mileage" property="nextMaintenanceMileage"/>
|
||||
<result column="attachments" property="attachments"/>
|
||||
<result column="remark" property="remark"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectMaintenancePlanPage" resultMap="maintenancePlanResultMap">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
blade_vehicle_maintenance_plan
|
||||
WHERE
|
||||
is_deleted = 0
|
||||
<if test="maintenancePlan.vehicleType != null and maintenancePlan.vehicleType != ''">
|
||||
AND vehicle_type = #{maintenancePlan.vehicleType}
|
||||
</if>
|
||||
<if test="maintenancePlan.vehicleNo != null and maintenancePlan.vehicleNo != ''">
|
||||
<bind name="vehicleNoLike" value="'%' + maintenancePlan.vehicleNo + '%'"/>
|
||||
AND vehicle_no LIKE #{vehicleNoLike}
|
||||
</if>
|
||||
<if test="maintenancePlan.createTimeStart != null and maintenancePlan.createTimeStart != ''">
|
||||
AND create_time >= #{maintenancePlan.createTimeStart}
|
||||
</if>
|
||||
<if test="maintenancePlan.createTimeEnd != null and maintenancePlan.createTimeEnd != ''">
|
||||
AND create_time <= #{maintenancePlan.createTimeEnd}
|
||||
</if>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.transport.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.transport.pojo.entity.MaintenanceRecord;
|
||||
import org.springblade.transport.pojo.vo.MaintenanceRecordVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车辆维修记录 Mapper 接口
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
public interface MaintenanceRecordMapper extends BaseMapper<MaintenanceRecord> {
|
||||
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param maintenanceRecord 查询参数
|
||||
* @return 维修记录列表
|
||||
*/
|
||||
List<MaintenanceRecordVO> selectMaintenanceRecordPage(IPage<MaintenanceRecordVO> page, MaintenanceRecordVO maintenanceRecord);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.springblade.transport.mapper.MaintenanceRecordMapper">
|
||||
|
||||
<resultMap id="maintenanceRecordResultMap" type="org.springblade.transport.pojo.vo.MaintenanceRecordVO">
|
||||
<result column="id" property="id"/>
|
||||
<result column="tenant_id" property="tenantId"/>
|
||||
<result column="create_user" property="createUser"/>
|
||||
<result column="create_dept" property="createDept"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_user" property="updateUser"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="is_deleted" property="isDeleted"/>
|
||||
<result column="vehicle_type" property="vehicleType"/>
|
||||
<result column="vehicle_no" property="vehicleNo"/>
|
||||
<result column="maintainer" property="maintainer"/>
|
||||
<result column="maintenance_time" property="maintenanceTime"/>
|
||||
<result column="location" property="location"/>
|
||||
<result column="replaced_part" property="replacedPart"/>
|
||||
<result column="cost" property="cost"/>
|
||||
<result column="company" property="company"/>
|
||||
<result column="contact" property="contact"/>
|
||||
<result column="address" property="address"/>
|
||||
<result column="factory_time" property="factoryTime"/>
|
||||
<result column="mileage" property="mileage"/>
|
||||
<result column="mileage_unit" property="mileageUnit"/>
|
||||
<result column="attachments" property="attachments"/>
|
||||
<result column="remark" property="remark"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectMaintenanceRecordPage" resultMap="maintenanceRecordResultMap">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
blade_vehicle_maintenance_record
|
||||
WHERE
|
||||
is_deleted = 0
|
||||
<if test="maintenanceRecord.vehicleType != null and maintenanceRecord.vehicleType != ''">
|
||||
AND vehicle_type = #{maintenanceRecord.vehicleType}
|
||||
</if>
|
||||
<if test="maintenanceRecord.vehicleNo != null and maintenanceRecord.vehicleNo != ''">
|
||||
<bind name="vehicleNoLike" value="'%' + maintenanceRecord.vehicleNo + '%'"/>
|
||||
AND vehicle_no LIKE #{vehicleNoLike}
|
||||
</if>
|
||||
<if test="maintenanceRecord.createTimeStart != null and maintenanceRecord.createTimeStart != ''">
|
||||
AND create_time >= #{maintenanceRecord.createTimeStart}
|
||||
</if>
|
||||
<if test="maintenanceRecord.createTimeEnd != null and maintenanceRecord.createTimeEnd != ''">
|
||||
AND create_time <= #{maintenanceRecord.createTimeEnd}
|
||||
</if>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.transport.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseService;
|
||||
import org.springblade.transport.pojo.entity.MaintenancePlan;
|
||||
import org.springblade.transport.pojo.vo.MaintenancePlanVO;
|
||||
|
||||
/**
|
||||
* 车辆保养计划 服务类
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
public interface IMaintenancePlanService extends BaseService<MaintenancePlan> {
|
||||
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param maintenancePlan 查询参数
|
||||
* @return 保养计划分页
|
||||
*/
|
||||
IPage<MaintenancePlanVO> selectMaintenancePlanPage(IPage<MaintenancePlanVO> page, MaintenancePlanVO maintenancePlan);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.transport.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseService;
|
||||
import org.springblade.transport.pojo.entity.MaintenanceRecord;
|
||||
import org.springblade.transport.pojo.vo.MaintenanceRecordVO;
|
||||
|
||||
/**
|
||||
* 车辆维修记录 服务类
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
public interface IMaintenanceRecordService extends BaseService<MaintenanceRecord> {
|
||||
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param maintenanceRecord 查询参数
|
||||
* @return 维修记录分页
|
||||
*/
|
||||
IPage<MaintenanceRecordVO> selectMaintenanceRecordPage(IPage<MaintenanceRecordVO> page, MaintenanceRecordVO maintenanceRecord);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.transport.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseServiceImpl;
|
||||
import org.springblade.transport.mapper.MaintenancePlanMapper;
|
||||
import org.springblade.transport.pojo.entity.MaintenancePlan;
|
||||
import org.springblade.transport.pojo.vo.MaintenancePlanVO;
|
||||
import org.springblade.transport.service.IMaintenancePlanService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 车辆保养计划 服务实现类
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
@Service
|
||||
public class MaintenancePlanServiceImpl extends BaseServiceImpl<MaintenancePlanMapper, MaintenancePlan> implements IMaintenancePlanService {
|
||||
|
||||
@Override
|
||||
public IPage<MaintenancePlanVO> selectMaintenancePlanPage(IPage<MaintenancePlanVO> page, MaintenancePlanVO maintenancePlan) {
|
||||
return page.setRecords(baseMapper.selectMaintenancePlanPage(page, maintenancePlan));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.transport.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseServiceImpl;
|
||||
import org.springblade.transport.mapper.MaintenanceRecordMapper;
|
||||
import org.springblade.transport.pojo.entity.MaintenanceRecord;
|
||||
import org.springblade.transport.pojo.vo.MaintenanceRecordVO;
|
||||
import org.springblade.transport.service.IMaintenanceRecordService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 车辆维修记录 服务实现类
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
@Service
|
||||
public class MaintenanceRecordServiceImpl extends BaseServiceImpl<MaintenanceRecordMapper, MaintenanceRecord> implements IMaintenanceRecordService {
|
||||
|
||||
@Override
|
||||
public IPage<MaintenanceRecordVO> selectMaintenanceRecordPage(IPage<MaintenanceRecordVO> page, MaintenanceRecordVO maintenanceRecord) {
|
||||
return page.setRecords(baseMapper.selectMaintenanceRecordPage(page, maintenanceRecord));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.transport.wrapper;
|
||||
|
||||
import org.springblade.core.mp.support.BaseEntityWrapper;
|
||||
import org.springblade.core.tool.utils.BeanUtil;
|
||||
import org.springblade.transport.pojo.entity.MaintenancePlan;
|
||||
import org.springblade.transport.pojo.vo.MaintenancePlanVO;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 车辆保养计划包装类
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
public class MaintenancePlanWrapper extends BaseEntityWrapper<MaintenancePlan, MaintenancePlanVO> {
|
||||
|
||||
public static MaintenancePlanWrapper build() {
|
||||
return new MaintenancePlanWrapper();
|
||||
}
|
||||
|
||||
@Override
|
||||
public MaintenancePlanVO entityVO(MaintenancePlan maintenancePlan) {
|
||||
return Objects.requireNonNull(BeanUtil.copyProperties(maintenancePlan, MaintenancePlanVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.transport.wrapper;
|
||||
|
||||
import org.springblade.core.mp.support.BaseEntityWrapper;
|
||||
import org.springblade.core.tool.utils.BeanUtil;
|
||||
import org.springblade.transport.pojo.entity.MaintenanceRecord;
|
||||
import org.springblade.transport.pojo.vo.MaintenanceRecordVO;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 车辆维修记录包装类
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
public class MaintenanceRecordWrapper extends BaseEntityWrapper<MaintenanceRecord, MaintenanceRecordVO> {
|
||||
|
||||
public static MaintenanceRecordWrapper build() {
|
||||
return new MaintenanceRecordWrapper();
|
||||
}
|
||||
|
||||
@Override
|
||||
public MaintenanceRecordVO entityVO(MaintenanceRecord maintenanceRecord) {
|
||||
return Objects.requireNonNull(BeanUtil.copyProperties(maintenanceRecord, MaintenanceRecordVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#服务器端口
|
||||
server:
|
||||
port: 8110
|
||||
|
||||
#数据源配置
|
||||
spring:
|
||||
datasource:
|
||||
url: ${blade.datasource.dev.url}
|
||||
username: ${blade.datasource.dev.username}
|
||||
password: ${blade.datasource.dev.password}
|
||||
@@ -0,0 +1,10 @@
|
||||
#服务器端口
|
||||
server:
|
||||
port: 8110
|
||||
|
||||
#数据源配置
|
||||
spring:
|
||||
datasource:
|
||||
url: ${blade.datasource.prod.url}
|
||||
username: ${blade.datasource.prod.username}
|
||||
password: ${blade.datasource.prod.password}
|
||||
@@ -0,0 +1,10 @@
|
||||
#服务器端口
|
||||
server:
|
||||
port: 8110
|
||||
|
||||
#数据源配置
|
||||
spring:
|
||||
datasource:
|
||||
url: ${blade.datasource.test.url}
|
||||
username: ${blade.datasource.test.username}
|
||||
password: ${blade.datasource.test.password}
|
||||
@@ -19,6 +19,7 @@
|
||||
<modules>
|
||||
<module>blade-desk</module>
|
||||
<module>blade-system</module>
|
||||
<module>blade-transport</module>
|
||||
</modules>
|
||||
|
||||
<dependencies>
|
||||
|
||||
Reference in New Issue
Block a user