Commit 760d8b20 authored by hanbing's avatar hanbing

[add] 快速特勤,特勤详情

parent f18a7fc6
...@@ -3,7 +3,7 @@ package net.wanji.web.bo; ...@@ -3,7 +3,7 @@ package net.wanji.web.bo;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import net.wanji.web.vo.RouteElementVO; import net.wanji.web.vo.specialService.RouteElementVO;
import javax.validation.constraints.Pattern; import javax.validation.constraints.Pattern;
import java.util.List; import java.util.List;
...@@ -15,6 +15,8 @@ import java.util.List; ...@@ -15,6 +15,8 @@ import java.util.List;
@Data @Data
@ApiModel(value = "AddSpecialServiceBO", description = "快速特勤-添加特勤输入参数") @ApiModel(value = "AddSpecialServiceBO", description = "快速特勤-添加特勤输入参数")
public class AddSpecialServiceBO { public class AddSpecialServiceBO {
@ApiModelProperty(value = "特勤ID")
Integer id;
@ApiModelProperty(value = "特勤名称") @ApiModelProperty(value = "特勤名称")
@Pattern(regexp = "^[\\u4E00-\\u9FA5\\w\\-]{0,16}$", message = "只能包含中文、英文、数字、下划线和中横线,0~16个字符") @Pattern(regexp = "^[\\u4E00-\\u9FA5\\w\\-]{0,16}$", message = "只能包含中文、英文、数字、下划线和中横线,0~16个字符")
String name; String name;
......
package net.wanji.web.vo.specialService; package net.wanji.web.bo;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -9,8 +9,8 @@ import lombok.Data; ...@@ -9,8 +9,8 @@ import lombok.Data;
* @date 2022/11/8 13:18 * @date 2022/11/8 13:18
*/ */
@Data @Data
@ApiModel(value = "DeleteSpecialServiceBO", description = "快速特勤-删除特勤输入参数") @ApiModel(value = "SpecialServiceIdBO", description = "快速特勤-删除特勤输入参数")
public class DeleteSpecialServiceBO { public class SpecialServiceIdBO {
@ApiModelProperty(value = "特勤ID") @ApiModelProperty(value = "特勤ID")
Integer id; Integer id;
} }
...@@ -9,9 +9,10 @@ import net.wanji.common.enums.BaseEnum; ...@@ -9,9 +9,10 @@ import net.wanji.common.enums.BaseEnum;
import net.wanji.common.framework.rest.JsonViewObject; import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.web.bo.AddSpecialServiceBO; import net.wanji.web.bo.AddSpecialServiceBO;
import net.wanji.web.bo.IsValidPointBO; import net.wanji.web.bo.IsValidPointBO;
import net.wanji.web.bo.SpecialServiceIdBO;
import net.wanji.web.bo.SpecialServiceRouteBO; import net.wanji.web.bo.SpecialServiceRouteBO;
import net.wanji.web.service.SpecialServiceService; import net.wanji.web.service.SpecialServiceService;
import net.wanji.web.vo.RouteElementVO; import net.wanji.web.vo.specialService.RouteElementVO;
import net.wanji.web.vo.specialService.*; import net.wanji.web.vo.specialService.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -54,13 +55,13 @@ public class SpecialServiceController { ...@@ -54,13 +55,13 @@ public class SpecialServiceController {
return JsonViewObject.newInstance().success(res); return JsonViewObject.newInstance().success(res);
} }
@AspectLog(description = "添加特勤", operationType = BaseEnum.OperationTypeEnum.QUERY) @AspectLog(description = "添加/编辑特勤", operationType = BaseEnum.OperationTypeEnum.QUERY)
@ApiOperation(value = "添加特勤", notes = "添加特勤", response = JsonViewObject.class, @ApiOperation(value = "添加/编辑特勤", notes = "添加/编辑特勤", response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON) produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/addSpecialService", @PostMapping(value = "/addOrUpdateSpecialService",
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON) produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
public JsonViewObject addSpecialService(@RequestBody @Valid AddSpecialServiceBO addSpecialServiceBO) { public JsonViewObject addOrUpdateSpecialService(@RequestBody @Valid AddSpecialServiceBO addSpecialServiceBO) {
specialServiceService.addSpecialService(addSpecialServiceBO); specialServiceService.addOrUpdateSpecialService(addSpecialServiceBO);
JsonViewObject jsonViewObject = JsonViewObject.newInstance(); JsonViewObject jsonViewObject = JsonViewObject.newInstance();
return jsonViewObject.success(); return jsonViewObject.success();
...@@ -84,12 +85,22 @@ public class SpecialServiceController { ...@@ -84,12 +85,22 @@ public class SpecialServiceController {
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON) produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/deleteSpecialService", @PostMapping(value = "/deleteSpecialService",
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON) produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
public JsonViewObject deleteSpecialService(@RequestBody DeleteSpecialServiceBO deleteSpecialServiceBO) { public JsonViewObject deleteSpecialService(@RequestBody SpecialServiceIdBO specialServiceIdBO) {
Integer id = deleteSpecialServiceBO.getId(); Integer id = specialServiceIdBO.getId();
specialServiceService.deleteSpecialService(id); specialServiceService.deleteSpecialService(id);
return JsonViewObject.newInstance().success(); return JsonViewObject.newInstance().success();
} }
@AspectLog(description = "特勤详情", operationType = BaseEnum.OperationTypeEnum.UPDATE)
@ApiOperation(value = "特勤详情", notes = "特勤详情", response = SpecialServiceDetailVO.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/specialServiceDetail",
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
public JsonViewObject specialServiceDetail(@RequestBody SpecialServiceIdBO specialServiceIdBO) {
SpecialServiceDetailVO specialServiceDetailVO = specialServiceService.specialServiceDetail(specialServiceIdBO);
return JsonViewObject.newInstance().success(specialServiceDetailVO);
}
@AspectLog(description = "编辑特勤", operationType = BaseEnum.OperationTypeEnum.UPDATE) @AspectLog(description = "编辑特勤", operationType = BaseEnum.OperationTypeEnum.UPDATE)
@ApiOperation(value = "编辑特勤", notes = "编辑特勤", response = JsonViewObject.class, @ApiOperation(value = "编辑特勤", notes = "编辑特勤", response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON) produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
......
...@@ -31,4 +31,8 @@ public interface SpecialServiceMapper { ...@@ -31,4 +31,8 @@ public interface SpecialServiceMapper {
void updateStatusDisable(@Param("specialServiceId") Integer specialServiceId); void updateStatusDisable(@Param("specialServiceId") Integer specialServiceId);
List<SpecialServicePO> selectAll(); List<SpecialServicePO> selectAll();
SpecialServicePO selectById(Integer specialServiceId);
void updateOne(Integer specialServiceId, SpecialServicePO specialServicePO);
} }
...@@ -2,8 +2,9 @@ package net.wanji.web.service; ...@@ -2,8 +2,9 @@ package net.wanji.web.service;
import net.wanji.web.bo.AddSpecialServiceBO; import net.wanji.web.bo.AddSpecialServiceBO;
import net.wanji.web.bo.IsValidPointBO; import net.wanji.web.bo.IsValidPointBO;
import net.wanji.web.bo.SpecialServiceIdBO;
import net.wanji.web.bo.SpecialServiceRouteBO; import net.wanji.web.bo.SpecialServiceRouteBO;
import net.wanji.web.vo.RouteElementVO; import net.wanji.web.vo.specialService.RouteElementVO;
import net.wanji.web.vo.specialService.*; import net.wanji.web.vo.specialService.*;
import java.util.List; import java.util.List;
...@@ -14,7 +15,7 @@ import java.util.Set; ...@@ -14,7 +15,7 @@ import java.util.Set;
* @date 2022/11/8 11:06 * @date 2022/11/8 11:06
*/ */
public interface SpecialServiceService { public interface SpecialServiceService {
void addSpecialService(AddSpecialServiceBO addSpecialServiceBO); void addOrUpdateSpecialService(AddSpecialServiceBO addSpecialServiceBO);
List<ListSpecialServicesVO> listSpecialServices(); List<ListSpecialServicesVO> listSpecialServices();
...@@ -31,4 +32,6 @@ public interface SpecialServiceService { ...@@ -31,4 +32,6 @@ public interface SpecialServiceService {
List<List<RouteElementVO>> specialServiceRoute(SpecialServiceRouteBO specialServiceRouteBO); List<List<RouteElementVO>> specialServiceRoute(SpecialServiceRouteBO specialServiceRouteBO);
void isValidPoint(IsValidPointBO isValidPointBO); void isValidPoint(IsValidPointBO isValidPointBO);
SpecialServiceDetailVO specialServiceDetail(SpecialServiceIdBO specialServiceIdBO);
} }
...@@ -15,6 +15,7 @@ import net.wanji.databus.dao.mapper.RidInfoMapper; ...@@ -15,6 +15,7 @@ import net.wanji.databus.dao.mapper.RidInfoMapper;
import net.wanji.databus.po.BaseCrossInfoPO; import net.wanji.databus.po.BaseCrossInfoPO;
import net.wanji.web.bo.AddSpecialServiceBO; import net.wanji.web.bo.AddSpecialServiceBO;
import net.wanji.web.bo.IsValidPointBO; import net.wanji.web.bo.IsValidPointBO;
import net.wanji.web.bo.SpecialServiceIdBO;
import net.wanji.web.bo.SpecialServiceRouteBO; import net.wanji.web.bo.SpecialServiceRouteBO;
import net.wanji.web.common.enums.CrossDirEnum; import net.wanji.web.common.enums.CrossDirEnum;
import net.wanji.web.mapper.*; import net.wanji.web.mapper.*;
...@@ -22,11 +23,8 @@ import net.wanji.web.po.CrossDirTurnPO; ...@@ -22,11 +23,8 @@ import net.wanji.web.po.CrossDirTurnPO;
import net.wanji.web.po.SpecialServiceCrossPO; import net.wanji.web.po.SpecialServiceCrossPO;
import net.wanji.web.po.SpecialServicePO; import net.wanji.web.po.SpecialServicePO;
import net.wanji.web.service.SpecialServiceService; import net.wanji.web.service.SpecialServiceService;
import net.wanji.web.vo.RouteElementVO; import net.wanji.web.vo.specialService.RouteElementVO;
import net.wanji.web.vo.specialService.DeleteCrossInVO; import net.wanji.web.vo.specialService.*;
import net.wanji.web.vo.specialService.ListSpecialServicesVO;
import net.wanji.web.vo.specialService.UpdateCrossInVO;
import net.wanji.web.vo.specialService.UpdateSpecialServiceInVO;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.Geometry;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -66,7 +64,9 @@ public class SpecialServiceServiceImpl implements SpecialServiceService { ...@@ -66,7 +64,9 @@ public class SpecialServiceServiceImpl implements SpecialServiceService {
@Override @Override
@Transactional @Transactional
public void addSpecialService(AddSpecialServiceBO addSpecialServiceBO) { public void addOrUpdateSpecialService(AddSpecialServiceBO addSpecialServiceBO) {
Integer specialServiceId = addSpecialServiceBO.getId();
if (ObjectUtil.isEmpty(specialServiceId)) { // 不传ID为新增
// 插入特勤表 // 插入特勤表
SpecialServicePO specialServicePO = new SpecialServicePO(); SpecialServicePO specialServicePO = new SpecialServicePO();
specialServicePO.setName(addSpecialServiceBO.getName()); specialServicePO.setName(addSpecialServiceBO.getName());
...@@ -75,7 +75,7 @@ public class SpecialServiceServiceImpl implements SpecialServiceService { ...@@ -75,7 +75,7 @@ public class SpecialServiceServiceImpl implements SpecialServiceService {
specialServicePO.setEndLocation(addSpecialServiceBO.getEndLocation()); specialServicePO.setEndLocation(addSpecialServiceBO.getEndLocation());
specialServiceMapper.insertOne(specialServicePO); specialServiceMapper.insertOne(specialServicePO);
Integer specialServiceId = specialServicePO.getId(); Integer specialServiceIdGenerated = specialServicePO.getId();
// 插入特勤路口关系表 // 插入特勤路口关系表
List<RouteElementVO> route = addSpecialServiceBO.getRoute(); List<RouteElementVO> route = addSpecialServiceBO.getRoute();
...@@ -90,6 +90,100 @@ public class SpecialServiceServiceImpl implements SpecialServiceService { ...@@ -90,6 +90,100 @@ public class SpecialServiceServiceImpl implements SpecialServiceService {
String endCrossId = endCross.getId(); String endCrossId = endCross.getId();
RidInfoEntity ridInfoEntity = ridInfoMapper.selectByStartEnd(startCrossId, endCrossId);
if (i != route.size() - 1) { // 非结束路段
SpecialServiceCrossPO specialServiceCrossPO = new SpecialServiceCrossPO();
specialServiceCrossPO.setSpecialServiceId(specialServiceIdGenerated);
specialServiceCrossPO.setCrossId(startCrossId);
// 计算方向
if (i == 0) { // 开始路口
specialServiceCrossPO.setInDir(0);
Integer outDir = ridInfoEntity.getOutDir();
specialServiceCrossPO.setOutDir(outDir);
} else { // 中间路口
// 获取上一个路段
RouteElementVO preRoute = route.get(i - 1);
String preStartName = preRoute.getStartName();
BaseCrossInfoPO preStartCross = baseCrossInfoMapper.selectByName(preStartName);
String preStartCrossId = preStartCross.getId();
String preEndName = preRoute.getEndName();
BaseCrossInfoPO preEndCross = baseCrossInfoMapper.selectByName(preEndName);
String preEndCrossId = preEndCross.getId();
RidInfoEntity preRid = ridInfoMapper.selectByStartEnd(preStartCrossId, preEndCrossId);
// 当前路口驶入方向
Integer inDir = preRid.getInDir();
// 当前路口使出方向
Integer outDir = ridInfoEntity.getOutDir();
specialServiceCrossPO.setInDir(inDir);
specialServiceCrossPO.setOutDir(outDir);
}
specialServiceCrossPO.setSort(i + 1);
specialServiceCrossPO.setStatus(0);
specialServiceCrossPO.setAutoUnlock(0);
specialServiceCrossMapper.insertOne(specialServiceCrossPO);
} else { // 结束路段
// 开始路口
SpecialServiceCrossPO specialServiceCrossPO = new SpecialServiceCrossPO();
specialServiceCrossPO.setSpecialServiceId(specialServiceIdGenerated);
specialServiceCrossPO.setCrossId(startCrossId);
// 获取上一个路段
RouteElementVO preRoute = route.get(i - 1);
String preStartName = preRoute.getStartName();
BaseCrossInfoPO preStartCross = baseCrossInfoMapper.selectByName(preStartName);
String preStartCrossId = preStartCross.getId();
String preEndName = preRoute.getEndName();
BaseCrossInfoPO preEndCross = baseCrossInfoMapper.selectByName(preEndName);
String preEndCrossId = preEndCross.getId();
RidInfoEntity preRid = ridInfoMapper.selectByStartEnd(preStartCrossId, preEndCrossId);
// 当前路口驶入方向
Integer inDir = preRid.getInDir();
// 当前路口使出方向
Integer outDir = ridInfoEntity.getOutDir();
specialServiceCrossPO.setInDir(inDir);
specialServiceCrossPO.setOutDir(outDir);
specialServiceCrossPO.setSort(i + 1);
specialServiceCrossPO.setStatus(0);
specialServiceCrossPO.setAutoUnlock(0);
specialServiceCrossMapper.insertOne(specialServiceCrossPO);
// 结束路口
SpecialServiceCrossPO specialServiceCrossPOEnd = new SpecialServiceCrossPO();
specialServiceCrossPOEnd.setSpecialServiceId(specialServiceIdGenerated);
specialServiceCrossPOEnd.setCrossId(endCrossId);
Integer inDirEnd = ridInfoEntity.getInDir();
specialServiceCrossPOEnd.setInDir(inDirEnd);
specialServiceCrossPOEnd.setOutDir(0);
specialServiceCrossPOEnd.setSort(i + 2);
specialServiceCrossPOEnd.setStatus(0);
specialServiceCrossPOEnd.setAutoUnlock(0);
specialServiceCrossMapper.insertOne(specialServiceCrossPOEnd);
}
}
} else { // 传ID为修改
// 修改特勤表
SpecialServicePO specialServicePO = new SpecialServicePO();
specialServicePO.setName(addSpecialServiceBO.getName());
specialServicePO.setPlateNum(addSpecialServiceBO.getPlateNum());
specialServicePO.setStartLocation(addSpecialServiceBO.getStartLocation());
specialServicePO.setEndLocation(addSpecialServiceBO.getEndLocation());
specialServiceMapper.updateOne(specialServiceId, specialServicePO);
// 修改特勤路口关系表
specialServiceCrossMapper.deleteCrossBySpecialServiceId(specialServiceId);
List<RouteElementVO> route = addSpecialServiceBO.getRoute();
for (int i = 0; i < route.size(); i++) {
RouteElementVO routeElementVO = route.get(i);
String startName = routeElementVO.getStartName();
BaseCrossInfoPO startCross = baseCrossInfoMapper.selectByName(startName);
String startCrossId = startCross.getId();
String endName = routeElementVO.getEndName();
BaseCrossInfoPO endCross = baseCrossInfoMapper.selectByName(endName);
String endCrossId = endCross.getId();
RidInfoEntity ridInfoEntity = ridInfoMapper.selectByStartEnd(startCrossId, endCrossId); RidInfoEntity ridInfoEntity = ridInfoMapper.selectByStartEnd(startCrossId, endCrossId);
if (i != route.size() - 1) { // 非结束路段 if (i != route.size() - 1) { // 非结束路段
SpecialServiceCrossPO specialServiceCrossPO = new SpecialServiceCrossPO(); SpecialServiceCrossPO specialServiceCrossPO = new SpecialServiceCrossPO();
...@@ -161,6 +255,7 @@ public class SpecialServiceServiceImpl implements SpecialServiceService { ...@@ -161,6 +255,7 @@ public class SpecialServiceServiceImpl implements SpecialServiceService {
} }
} }
} }
}
@Override @Override
public List<ListSpecialServicesVO> listSpecialServices() { public List<ListSpecialServicesVO> listSpecialServices() {
...@@ -419,6 +514,90 @@ public class SpecialServiceServiceImpl implements SpecialServiceService { ...@@ -419,6 +514,90 @@ public class SpecialServiceServiceImpl implements SpecialServiceService {
} }
} }
@Override
public SpecialServiceDetailVO specialServiceDetail(SpecialServiceIdBO specialServiceIdBO) {
SpecialServiceDetailVO specialServiceDetailVO = new SpecialServiceDetailVO();
Integer specialServiceId = specialServiceIdBO.getId();
SpecialServicePO specialServicePO = specialServiceMapper.selectById(specialServiceId);
specialServiceDetailVO.setName(specialServicePO.getName());
List<SpecialServiceDetailVO.CrossListElement> crossList = buildCrossList(specialServiceId);
specialServiceDetailVO.setCrossList(crossList);
return specialServiceDetailVO;
}
private List<SpecialServiceDetailVO.CrossListElement> buildCrossList(Integer specialServiceId) {
List<SpecialServiceDetailVO.CrossListElement> crossList = new ArrayList<>();
List<SpecialServiceCrossPO> specialServiceCrossList =
specialServiceCrossMapper.selectBySpecialServiceId(specialServiceId);
for (int i = 0; i < specialServiceCrossList.size(); i++) {
SpecialServiceCrossPO currentCross = specialServiceCrossList.get(i);
String currentCrossId = currentCross.getCrossId();
SpecialServiceDetailVO.CrossListElement crossListElement = new SpecialServiceDetailVO.CrossListElement();
String crossId = currentCross.getCrossId();
BaseCrossInfoPO baseCrossInfoPO = baseCrossInfoMapper.selectById(crossId);
crossListElement.setCrossName(baseCrossInfoPO.getName());
crossListElement.setCrossId(crossId);
if (i == 0) { // 开始路口
crossListElement.setRouteStart("");
SpecialServiceCrossPO nextCross = specialServiceCrossList.get(i + 1);
String nextCrossId = nextCross.getCrossId();
// 构建路名+方向
RidInfoEntity ridInfoEntity = ridInfoMapper.selectByStartEnd(currentCrossId, nextCrossId);
String name = ridInfoEntity.getName(); // 西湖路:湘江中路@书院路路段
String[] split = name.split(":");
String streetName = split[0];
Integer outDir = ridInfoEntity.getOutDir();
String ourDirMsg = CrossDirEnum.getMsgByCode(outDir);
crossListElement.setRouteEnd(streetName + ourDirMsg);
} else if (i == specialServiceCrossList.size() - 1) { // 结束路口
crossListElement.setRouteEnd("");
SpecialServiceCrossPO preCross = specialServiceCrossList.get(i - 1);
String preCrossId = preCross.getCrossId();
// 构建路名+方向
RidInfoEntity ridInfoEntity = ridInfoMapper.selectByStartEnd(preCrossId, currentCrossId);
String name = ridInfoEntity.getName(); // 西湖路:湘江中路@书院路路段
String[] split = name.split(":");
String streetName = split[0];
Integer inDir = ridInfoEntity.getInDir();
String inDirMsg = CrossDirEnum.getMsgByCode(inDir);
crossListElement.setRouteStart(streetName + inDirMsg);
} else { // 中间路口
SpecialServiceCrossPO preCross = specialServiceCrossList.get(i - 1);
SpecialServiceCrossPO nextCross = specialServiceCrossList.get(i + 1);
String preCrossId = preCross.getCrossId();
String nextCrossId = nextCross.getCrossId();
// 路线起点
RidInfoEntity ridInfoEntity = ridInfoMapper.selectByStartEnd(preCrossId, currentCrossId);
String name = ridInfoEntity.getName(); // 西湖路:湘江中路@书院路路段
String[] split = name.split(":");
String streetName = split[0];
Integer inDir = ridInfoEntity.getInDir();
String inDirMsg = CrossDirEnum.getMsgByCode(inDir);
crossListElement.setRouteStart(streetName + inDirMsg);
// 路线终点
RidInfoEntity ridInfoEntity2 = ridInfoMapper.selectByStartEnd(currentCrossId, nextCrossId);
String name2 = ridInfoEntity2.getName(); // 西湖路:湘江中路@书院路路段
String[] split2 = name2.split(":");
String streetName2 = split2[0];
Integer outDir = ridInfoEntity2.getOutDir();
String ourDirMsg = CrossDirEnum.getMsgByCode(outDir);
crossListElement.setRouteEnd(streetName2 + ourDirMsg);
}
crossListElement.setStatus(currentCross.getStatus());
crossListElement.setSort(currentCross.getSort());
crossList.add(crossListElement);
}
return crossList;
}
@NotNull @NotNull
private List<BaseCrossInfoPO> getRouteList(BaseCrossInfoPO startCross, BaseCrossInfoPO endCross) { private List<BaseCrossInfoPO> getRouteList(BaseCrossInfoPO startCross, BaseCrossInfoPO endCross) {
String endCrossLonLatStr = getCrossLonLatStr(endCross); String endCrossLonLatStr = getCrossLonLatStr(endCross);
...@@ -459,8 +638,10 @@ public class SpecialServiceServiceImpl implements SpecialServiceService { ...@@ -459,8 +638,10 @@ public class SpecialServiceServiceImpl implements SpecialServiceService {
String secondLonLatStr = getCrossLonLatStr(secondCross); String secondLonLatStr = getCrossLonLatStr(secondCross);
routeElementVO.setStartLonLat(firstLonLatStr); routeElementVO.setStartLonLat(firstLonLatStr);
routeElementVO.setStartId(firstCross.getId());
routeElementVO.setStartName(firstCross.getName()); routeElementVO.setStartName(firstCross.getName());
routeElementVO.setEndLonLat(secondLonLatStr); routeElementVO.setEndLonLat(secondLonLatStr);
routeElementVO.setEndId(secondCross.getId());
routeElementVO.setEndName(secondCross.getName()); routeElementVO.setEndName(secondCross.getName());
// 获取路况,1为进口 // 获取路况,1为进口
......
package net.wanji.web.vo; package net.wanji.web.vo.specialService;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -13,10 +13,14 @@ import lombok.Data; ...@@ -13,10 +13,14 @@ import lombok.Data;
public class RouteElementVO { public class RouteElementVO {
@ApiModelProperty(value = "起点坐标") @ApiModelProperty(value = "起点坐标")
private String startLonLat; private String startLonLat;
@ApiModelProperty(value = "起点路口ID")
private String startId;
@ApiModelProperty(value = "起点路口名称") @ApiModelProperty(value = "起点路口名称")
private String startName; private String startName;
@ApiModelProperty(value = "终点坐标") @ApiModelProperty(value = "终点坐标")
private String endLonLat; private String endLonLat;
@ApiModelProperty(value = "终点路口ID")
private String endId;
@ApiModelProperty(value = "终点路口名称") @ApiModelProperty(value = "终点路口名称")
private String endName; private String endName;
@ApiModelProperty(value = "路况 1畅通;2缓行;3拥堵;4严重拥堵;5未知") @ApiModelProperty(value = "路况 1畅通;2缓行;3拥堵;4严重拥堵;5未知")
......
package net.wanji.web.vo.specialService;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* @author Kent HAN
* @date 2023/5/16 14:27
*/
@NoArgsConstructor
@Data
@ApiModel(value = "SpecialServiceDetailVO", description = "特勤详情")
public class SpecialServiceDetailVO {
@ApiModelProperty(value = "特勤名称")
private String name;
@ApiModelProperty(value = "路口列表")
private List<CrossListElement> crossList;
@NoArgsConstructor
@Data
public static class CrossListElement {
@ApiModelProperty(value = "路口名称")
private String crossName;
@ApiModelProperty(value = "路口ID")
private String crossId;
@ApiModelProperty(value = "路口路线起点")
private String routeStart;
@ApiModelProperty(value = "路口路线终点")
private String routeEnd;
@ApiModelProperty(value = "锁定状态:1锁定;0解锁")
private Integer status;
@ApiModelProperty(value = "路口顺序号")
private Integer sort;
}
}
...@@ -78,10 +78,8 @@ ...@@ -78,10 +78,8 @@
where special_service_id = #{specialServiceId} and sort = #{preSort} where special_service_id = #{specialServiceId} and sort = #{preSort}
</select> </select>
<select id="selectBySpecialServiceId" resultMap="BaseResultMap"> <select id="selectBySpecialServiceId" resultMap="BaseResultMap">
select id,special_service_id,cross_id,dir,turn,sort,status,gmt_create,gmt_modified select <include refid="Base_Column_List"></include>
from t_special_service_cross from t_special_service_cross
where special_service_id = #{specialServiceId} where special_service_id = #{specialServiceId}
order by sort order by sort
......
...@@ -64,6 +64,37 @@ ...@@ -64,6 +64,37 @@
where id = #{specialServiceId} where id = #{specialServiceId}
</update> </update>
<update id="updateOne">
update t_special_service_info
<set>
<if test="name != null and name != ''">
name = #{name},
</if>
<if test="plateNum != null and plateNum != ''">
plate_num = #{plateNum},
</if>
<if test="controlModel != null and controlModel != ''">
control_model = #{controlModel},
</if>
<if test="length != null and length != ''">
length = #{length},
</if>
<if test="status != null and status != ''">
status = #{status},
</if>
<if test="startLocation != null and startLocation != ''">
start_location = #{startLocation},
</if>
<if test="endLocation != null and endLocation != ''">
end_location = #{endLocation},
</if>
<if test="isDel != null and isDel != ''">
is_del = #{isDel},
</if>
</set>
where id = #{specialServiceId}
</update>
<select id="selectByAdCode" resultMap="BaseResultMap"> <select id="selectByAdCode" resultMap="BaseResultMap">
select select
id,name,control_model,length,is_del,status,gmt_create,gmt_modified id,name,control_model,length,is_del,status,gmt_create,gmt_modified
...@@ -84,4 +115,10 @@ ...@@ -84,4 +115,10 @@
order by gmt_modified desc order by gmt_modified desc
</select> </select>
<select id="selectById" resultType="net.wanji.web.po.SpecialServicePO">
select <include refid="Base_Column_List"></include>
from t_special_service_info
where id = #{specialServiceId}
</select>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment