Commit 727eb89c authored by hanbing's avatar hanbing

[update] 快速特勤,批量返回路口进出列表

parent 3eb761c2
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/9 17:21 * @date 2022/11/9 17:21
*/ */
@Data @Data
@ApiModel(value = "CrossIdVO") @ApiModel(value = "CrossIdBO")
public class CrossIdVO { public class CrossIdBO {
@ApiModelProperty( value = "路口ID",notes = "") @ApiModelProperty( value = "路口ID",notes = "")
private String crossId ; private String crossId ;
} }
...@@ -116,23 +116,23 @@ public class SpecialServiceController { ...@@ -116,23 +116,23 @@ public class SpecialServiceController {
} }
@AspectLog(description = "获取路口驶入方向列表", operationType = BaseEnum.OperationTypeEnum.UPDATE) @AspectLog(description = "获取路口驶入方向列表", operationType = BaseEnum.OperationTypeEnum.UPDATE)
@ApiOperation(value = "获取路口驶入方向列表", notes = "获取路口驶入方向列表", response = JsonViewObject.class, @ApiOperation(value = "获取路口驶入方向列表", notes = "获取路口驶入方向列表", response = SpecialDirListVO.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON) produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/getInDirList", @PostMapping(value = "/getInDirList",
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON) produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
public JsonViewObject getInDirList(@RequestBody CrossIdVO crossIdVO) { public JsonViewObject getInDirList(@RequestBody List<CrossIdBO> crossIdBOList) {
List<String> inDirList = specialServiceService.getInDirList(crossIdVO); List<SpecialDirListVO> specialDirListVOList = specialServiceService.getInDirList(crossIdBOList);
return JsonViewObject.newInstance().success(inDirList); return JsonViewObject.newInstance().success(specialDirListVOList);
} }
@AspectLog(description = "获取路口驶出方向列表", operationType = BaseEnum.OperationTypeEnum.UPDATE) @AspectLog(description = "获取路口驶出方向列表", operationType = BaseEnum.OperationTypeEnum.UPDATE)
@ApiOperation(value = "获取路口驶出方向列表", notes = "获取路口驶出方向列表", response = JsonViewObject.class, @ApiOperation(value = "获取路口驶出方向列表", notes = "获取路口驶出方向列表", response = SpecialDirListVO.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON) produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/getOutDirList", @PostMapping(value = "/getOutDirList",
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON) produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
public JsonViewObject getOutDirList(@RequestBody CrossIdVO crossIdVO) { public JsonViewObject getOutDirList(@RequestBody List<CrossIdBO> crossIdBOList) {
List<String> outDirList = specialServiceService.getOutDirList(crossIdVO); List<SpecialDirListVO> specialDirListVOList = specialServiceService.getOutDirList(crossIdBOList);
return JsonViewObject.newInstance().success(outDirList); return JsonViewObject.newInstance().success(specialDirListVOList);
} }
@AspectLog(description = "分组列表", operationType = BaseEnum.OperationTypeEnum.UPDATE) @AspectLog(description = "分组列表", operationType = BaseEnum.OperationTypeEnum.UPDATE)
......
...@@ -27,9 +27,9 @@ public interface SpecialServiceService { ...@@ -27,9 +27,9 @@ public interface SpecialServiceService {
void updateSpecialServiceDetail(UpdateSpecialServiceBO updateSpecialServiceBO); void updateSpecialServiceDetail(UpdateSpecialServiceBO updateSpecialServiceBO);
List<String> getInDirList(CrossIdVO crossIdVO); List<SpecialDirListVO> getInDirList(List<CrossIdBO> crossIdBOList);
List<String> getOutDirList(CrossIdVO crossIdVO); List<SpecialDirListVO> getOutDirList(List<CrossIdBO> crossIdBOList);
void batchLock(List<LockControlVO> lockControlVOList); void batchLock(List<LockControlVO> lockControlVOList);
......
...@@ -559,24 +559,48 @@ public class SpecialServiceServiceImpl implements SpecialServiceService { ...@@ -559,24 +559,48 @@ public class SpecialServiceServiceImpl implements SpecialServiceService {
} }
@Override @Override
public List<String> getInDirList(CrossIdVO crossIdVO) { public List<SpecialDirListVO> getInDirList(List<CrossIdBO> crossIdBOList) {
List<String> res = new ArrayList<>(); List<SpecialDirListVO> res = new ArrayList<>();
String crossId = crossIdVO.getCrossId(); for (CrossIdBO crossIdBO : crossIdBOList) {
SpecialDirListVO specialDirListVO = new SpecialDirListVO();
String crossId = crossIdBO.getCrossId();
specialDirListVO.setCrossId(crossId);
List<String> specialDirList = buildInSpecialDirList(crossId);
specialDirListVO.setSpecialDirList(specialDirList);
res.add(specialDirListVO);
}
return res;
}
private List<String> buildInSpecialDirList(String crossId) {
List<String> specialDirList = new ArrayList<>();
List<RidInfoEntity> ridList = ridInfoMapper.selectByEndCross(crossId); List<RidInfoEntity> ridList = ridInfoMapper.selectByEndCross(crossId);
for (RidInfoEntity ridInfoEntity : ridList) { for (RidInfoEntity ridInfoEntity : ridList) {
String name = ridInfoEntity.getName(); // 湘江中路:白沙路@劳动西路路段 String name = ridInfoEntity.getName(); // 湘江中路:白沙路@劳动西路路段
String streetName = name.split(":")[0]; String streetName = name.split(":")[0];
Integer inDir = ridInfoEntity.getInDir(); Integer inDir = ridInfoEntity.getInDir();
String msgByCode = CrossDirEnum.getMsgByCode(inDir); String msgByCode = CrossDirEnum.getMsgByCode(inDir);
res.add(streetName + msgByCode); specialDirList.add(streetName + msgByCode);
} }
return res; return specialDirList;
} }
@Override @Override
public List<String> getOutDirList(CrossIdVO crossIdVO) { public List<SpecialDirListVO> getOutDirList(List<CrossIdBO> crossIdBOList) {
List<SpecialDirListVO> res = new ArrayList<>();
for (CrossIdBO crossIdBO : crossIdBOList) {
SpecialDirListVO specialDirListVO = new SpecialDirListVO();
String crossId = crossIdBO.getCrossId();
specialDirListVO.setCrossId(crossId);
List<String> specialDirList = buildOutSpecialDirList(crossId);
specialDirListVO.setSpecialDirList(specialDirList);
res.add(specialDirListVO);
}
return res;
}
private List<String> buildOutSpecialDirList(String crossId) {
List<String> res = new ArrayList<>(); List<String> res = new ArrayList<>();
String crossId = crossIdVO.getCrossId();
List<RidInfoEntity> ridList = ridInfoMapper.selectByStartCross(crossId); List<RidInfoEntity> ridList = ridInfoMapper.selectByStartCross(crossId);
for (RidInfoEntity ridInfoEntity : ridList) { for (RidInfoEntity ridInfoEntity : ridList) {
String name = ridInfoEntity.getName(); // 湘江中路:白沙路@劳动西路路段 String name = ridInfoEntity.getName(); // 湘江中路:白沙路@劳动西路路段
......
package net.wanji.web.vo.specialService;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author Kent HAN
* @date 2023/5/19 17:08
*/
@Data
public class SpecialDirListVO {
@ApiModelProperty(value = "路口ID")
private String crossId;
@ApiModelProperty(value = "路名方向列表")
List<String> specialDirList;
}
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