Commit c6e24b57 authored by duanruiming's avatar duanruiming

Merge remote-tracking branch 'origin/master'

parents cb6d7567 22014ac8
...@@ -23,10 +23,12 @@ import javax.ws.rs.core.MediaType; ...@@ -23,10 +23,12 @@ import javax.ws.rs.core.MediaType;
@RequestMapping("/crossConfig") @RequestMapping("/crossConfig")
@RestController @RestController
public class CrossConfigController { public class CrossConfigController {
private final CrossConfigServiceImpl crossConfigServiceImpl;
public CrossConfigController(CrossConfigServiceImpl crossConfigServiceImpl) {
this.crossConfigServiceImpl = crossConfigServiceImpl; private final CrossConfigServiceImpl crossConfigService;
public CrossConfigController(CrossConfigServiceImpl crossConfigService) {
this.crossConfigService = crossConfigService;
} }
@ApiOperation(value = "保存渠化配置", notes = "保存渠化配置", response = JsonViewObject.class, @ApiOperation(value = "保存渠化配置", notes = "保存渠化配置", response = JsonViewObject.class,
...@@ -37,7 +39,7 @@ public class CrossConfigController { ...@@ -37,7 +39,7 @@ public class CrossConfigController {
@ApiResponse(code = 200, message = "OK", response = JsonViewObject.class), @ApiResponse(code = 200, message = "OK", response = JsonViewObject.class),
}) })
public JsonViewObject saveLaneInfo(@RequestBody SaveLaneInfoDTO saveLaneInfoDTO) { public JsonViewObject saveLaneInfo(@RequestBody SaveLaneInfoDTO saveLaneInfoDTO) {
crossConfigServiceImpl.saveLaneInfo(saveLaneInfoDTO); crossConfigService.saveLaneInfo(saveLaneInfoDTO);
JsonViewObject jsonViewObject = JsonViewObject.newInstance(); JsonViewObject jsonViewObject = JsonViewObject.newInstance();
return jsonViewObject.success(); return jsonViewObject.success();
...@@ -48,10 +50,10 @@ public class CrossConfigController { ...@@ -48,10 +50,10 @@ public class CrossConfigController {
@PostMapping(value = "/listLaneInfo", @PostMapping(value = "/listLaneInfo",
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON) produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@ApiResponses({ @ApiResponses({
@ApiResponse(code = 200, message = "OK", response = JsonViewObject.class), @ApiResponse(code = 200, message = "OK", response = SaveLaneInfoDTO.class),
}) })
public JsonViewObject listLaneInfo(@RequestBody CrossIdDTO crossIdDTO) { public JsonViewObject listLaneInfo(@RequestBody CrossIdDTO crossIdDTO) {
SaveLaneInfoDTO saveLaneInfoDTO = crossConfigServiceImpl.listLaneInfo(crossIdDTO); SaveLaneInfoDTO saveLaneInfoDTO = crossConfigService.listLaneInfo(crossIdDTO);
JsonViewObject jsonViewObject = JsonViewObject.newInstance(); JsonViewObject jsonViewObject = JsonViewObject.newInstance();
return jsonViewObject.success(saveLaneInfoDTO); return jsonViewObject.success(saveLaneInfoDTO);
......
package net.wanji.web.controller.scheme;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import net.wanji.web.common.entity.JsonViewObject;
import net.wanji.web.dto.CrossIdDTO;
import net.wanji.web.dto.SaveLightsInfoDTO;
import net.wanji.web.service.scheme.impl.LightsConfigServiceImpl;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.ws.rs.core.MediaType;
/**
* @author Kent HAN
* @date 2022/12/20 10:14
*/
@Api(value = "LightsConfigController", description = "方案管理-灯组配置")
@RequestMapping("/lightsConfig")
@RestController
public class LightsConfigController {
private final LightsConfigServiceImpl lightsConfigService;
public LightsConfigController(LightsConfigServiceImpl lightsConfigService) {
this.lightsConfigService = lightsConfigService;
}
@ApiOperation(value = "保存灯组配置", notes = "保存灯组配置", response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/saveLightsInfo",
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = JsonViewObject.class),
})
public JsonViewObject saveLightsInfo(@RequestBody SaveLightsInfoDTO saveLightsInfoDTO) {
lightsConfigService.saveLightsInfo(saveLightsInfoDTO);
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
return jsonViewObject.success();
}
@ApiOperation(value = "灯组配置列表", notes = "灯组配置列表", response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/listLightsInfo",
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = SaveLightsInfoDTO.class),
})
public JsonViewObject listLightsInfo(@RequestBody CrossIdDTO crossIdDTO) {
SaveLightsInfoDTO saveLightsInfoDTO = lightsConfigService.listLightsInfo(crossIdDTO);
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
return jsonViewObject.success(saveLightsInfoDTO);
}
}
...@@ -7,8 +7,6 @@ import lombok.NoArgsConstructor; ...@@ -7,8 +7,6 @@ import lombok.NoArgsConstructor;
import java.util.List; import java.util.List;
/** /**
* 方案管理-路口配置-保存渠化配置输入参数
*
* @author Kent HAN * @author Kent HAN
* @date 2022/12/20 10:17 * @date 2022/12/20 10:17
*/ */
......
package net.wanji.web.dto;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author Kent HAN
* @date 2023/1/3 10:22
*/
@NoArgsConstructor
@Data
public class SaveLightsInfoDTO {
}
package net.wanji.web.mapper.scheme;
/**
* 灯组基础信息;(t_base_cross_lights)表数据库访问层
* @author : hanbing
* @date : 2023-1-3
*/
public interface CrossLightsMapper {
}
package net.wanji.web.mapper.scheme;
import io.lettuce.core.dynamic.annotation.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @author Kent HAN
* @date 2022/12/20 10:32
*/
@Repository
public interface LaneSegmentMapper {
void deleteByLaneIds(@Param("laneIds") List<String> laneIds);
}
package net.wanji.web.mapper.scheme;
/**
* 相位灯组关系;(t_base_cross_phase_lights)表数据库访问层
* @author : hanbing
* @date : 2023-1-3
*/
public interface PhaseLightsMapper {
}
package net.wanji.web.po.scheme;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author Kent HAN
* @date 2023/1/3 9:40
*/
@Data
public class CrossLightsPO {
/** 灯组ID */
@ApiModelProperty(name = "灯组ID",notes = "")
private Integer id ;
/** 灯组号 */
@ApiModelProperty(name = "灯组号",notes = "")
private String lightsNo ;
/** 灯组类型:机动车(1圆饼灯;2左转灯;3直行灯;4右转灯;5掉头灯;);非机动车(10非机动车灯;11左转灯;12直行灯;13右转灯;14掉头灯);20行人灯;21行人进口灯;22行人出口灯;30公交专用灯 */
@ApiModelProperty(name = "灯组类型:机动车(1圆饼灯;2左转灯;3直行灯;4右转灯;5掉头灯;);非机动车(10非机动车灯;11左转灯;12直行灯;13右转灯;14掉头灯);20行人灯;21行人进口灯;22行人出口灯;30公交专用灯",notes = "")
private Integer type ;
/** 灯组放行方向:1北;2东北;3东;4东南;5南;6西南;7西;8西北 */
@ApiModelProperty(name = "灯组放行方向:1北;2东北;3东;4东南;5南;6西南;7西;8西北",notes = "")
private Integer dir ;
/** 灯组序号 */
@ApiModelProperty(name = "灯组序号",notes = "")
private Integer sort ;
/** 路口ID */
@ApiModelProperty(name = "路口ID",notes = "")
private String crossId ;
/** 创建时间 */
@ApiModelProperty(name = "创建时间",notes = "")
private Date gmtCreate ;
/** 修改时间 */
@ApiModelProperty(name = "修改时间",notes = "")
private Date gmtModified ;
}
package net.wanji.web.po.scheme;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author Kent HAN
* @date 2023/1/3 9:12
*/
@Data
public class LaneSegmentPO {
/** 车道段ID */
@ApiModelProperty(name = "车道段ID",notes = "")
private Integer id ;
/** 车道段序号 */
@ApiModelProperty(name = "车道段序号",notes = "")
private Integer sort ;
/** 车道ID */
@ApiModelProperty(name = "车道ID",notes = "")
private String laneId ;
/** 交通状态:1畅通;2缓行;3拥堵;4严重拥堵;5无交通流 */
@ApiModelProperty(name = "交通状态:1畅通;2缓行;3拥堵;4严重拥堵;5无交通流",notes = "")
private Integer status ;
/** 空间对象 */
@ApiModelProperty(name = "空间对象",notes = "")
private String wkt ;
/** 创建时间 */
@ApiModelProperty(name = "创建时间",notes = "")
private Date gmtCreate ;
/** 修改时间 */
@ApiModelProperty(name = "修改时间",notes = "")
private Date gmtModified ;
}
package net.wanji.web.po.scheme;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author Kent HAN
* @date 2023/1/3 9:51
*/
@Data
public class PhaseLightsPO {
/** 主键 */
@ApiModelProperty(name = "主键",notes = "")
private Integer id ;
/** 灯组ID */
@ApiModelProperty(name = "灯组ID",notes = "")
private Integer lightsId ;
/** 相位ID */
@ApiModelProperty(name = "相位ID",notes = "")
private Integer phaseId ;
/** 路口ID */
@ApiModelProperty(name = "路口ID",notes = "")
private String crossId ;
/** 创建时间 */
@ApiModelProperty(name = "创建时间",notes = "")
private Date gmtCreate ;
/** 修改时间 */
@ApiModelProperty(name = "修改时间",notes = "")
private Date gmtModified ;
}
package net.wanji.web.service.scheme;
import net.wanji.web.dto.CrossIdDTO;
import net.wanji.web.dto.SaveLightsInfoDTO;
/**
* @author Kent HAN
* @date 2023/1/3 9:59
*/
public interface LightsConfigService {
void saveLightsInfo(SaveLightsInfoDTO saveLightsInfoDTO);
SaveLightsInfoDTO listLightsInfo(CrossIdDTO crossIdDTO);
}
...@@ -7,6 +7,7 @@ import net.wanji.web.dto.SaveLaneInfoDTO; ...@@ -7,6 +7,7 @@ import net.wanji.web.dto.SaveLaneInfoDTO;
import net.wanji.web.mapper.scheme.CrossDirInfoMapper; import net.wanji.web.mapper.scheme.CrossDirInfoMapper;
import net.wanji.web.mapper.scheme.CrossLaneLightsMapper; import net.wanji.web.mapper.scheme.CrossLaneLightsMapper;
import net.wanji.web.mapper.scheme.LaneInfoMapper; import net.wanji.web.mapper.scheme.LaneInfoMapper;
import net.wanji.web.mapper.scheme.LaneSegmentMapper;
import net.wanji.web.po.scheme.CrossDirInfoPO; import net.wanji.web.po.scheme.CrossDirInfoPO;
import net.wanji.web.po.scheme.LaneInfoPO; import net.wanji.web.po.scheme.LaneInfoPO;
import net.wanji.web.service.scheme.CrossConfigService; import net.wanji.web.service.scheme.CrossConfigService;
...@@ -26,11 +27,13 @@ public class CrossConfigServiceImpl implements CrossConfigService { ...@@ -26,11 +27,13 @@ public class CrossConfigServiceImpl implements CrossConfigService {
private final CrossDirInfoMapper crossDirInfoMapper; private final CrossDirInfoMapper crossDirInfoMapper;
private final LaneInfoMapper laneInfoMapper; private final LaneInfoMapper laneInfoMapper;
private final CrossLaneLightsMapper crossLaneLightsMapper; private final CrossLaneLightsMapper crossLaneLightsMapper;
private final LaneSegmentMapper laneSegmentMapper;
public CrossConfigServiceImpl(CrossDirInfoMapper crossDirInfoMapper, LaneInfoMapper laneInfoMapper, CrossLaneLightsMapper crossLaneLightsMapper) { public CrossConfigServiceImpl(CrossDirInfoMapper crossDirInfoMapper, LaneInfoMapper laneInfoMapper, CrossLaneLightsMapper crossLaneLightsMapper, LaneSegmentMapper laneSegmentMapper) {
this.crossDirInfoMapper = crossDirInfoMapper; this.crossDirInfoMapper = crossDirInfoMapper;
this.laneInfoMapper = laneInfoMapper; this.laneInfoMapper = laneInfoMapper;
this.crossLaneLightsMapper = crossLaneLightsMapper; this.crossLaneLightsMapper = crossLaneLightsMapper;
this.laneSegmentMapper = laneSegmentMapper;
} }
@Override @Override
...@@ -52,10 +55,12 @@ public class CrossConfigServiceImpl implements CrossConfigService { ...@@ -52,10 +55,12 @@ public class CrossConfigServiceImpl implements CrossConfigService {
laneInfoMapper.deleteByCrossIdAndDir(crossId, dir); laneInfoMapper.deleteByCrossIdAndDir(crossId, dir);
// 删除路口方向表数据 // 删除路口方向表数据
crossDirInfoMapper.deleteInByDirType(crossId, dir); crossDirInfoMapper.deleteInByDirType(crossId, dir);
// 删除灯组-车道关系表数据
List<String> laneIds = getLaneIds(laneInfoPOList); List<String> laneIds = getLaneIds(laneInfoPOList);
if (laneIds.size()!=0){ if (laneIds.size()!=0){
// 删除灯组-车道关系表数据
crossLaneLightsMapper.deleteByLaneIds(laneIds); crossLaneLightsMapper.deleteByLaneIds(laneIds);
// 删除车道状态表数据
laneSegmentMapper.deleteByLaneIds(laneIds);
} }
// 插入进口信息 // 插入进口信息
List<LaneInfoPO> laneInfoPOListForInsert = getLaneInfoPOListForInsert( List<LaneInfoPO> laneInfoPOListForInsert = getLaneInfoPOListForInsert(
......
package net.wanji.web.service.scheme.impl;
import net.wanji.web.dto.CrossIdDTO;
import net.wanji.web.dto.SaveLightsInfoDTO;
import net.wanji.web.service.scheme.LightsConfigService;
import org.springframework.stereotype.Service;
/**
* @author Kent HAN
* @date 2023/1/3 10:00
*/
@Service
public class LightsConfigServiceImpl implements LightsConfigService {
@Override
public void saveLightsInfo(SaveLightsInfoDTO saveLightsInfoDTO) {
}
@Override
public SaveLightsInfoDTO listLightsInfo(CrossIdDTO crossIdDTO) {
return null;
}
}
...@@ -14,7 +14,7 @@ service: ...@@ -14,7 +14,7 @@ service:
mybatis: mybatis:
type-aliases-package: net.wanji.*.model type-aliases-package: net.wanji.*.model
mapper-locations: classpath:mapper/*.xml mapper-locations: classpath:mapper/*.xml,classpath:mapper/*/*.xml
configuration: configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
......
<?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="net.wanji.web.mapper.scheme.CrossLightsMapper">
<!-- 通用查询映射结果 -->
<resultMap type="net.wanji.web.po.scheme.CrossLightsPO" id="BaseResultMap">
<result property="id" column="id"/>
<result property="lightsNo" column="lights_no"/>
<result property="type" column="type"/>
<result property="dir" column="dir"/>
<result property="sort" column="sort"/>
<result property="crossId" column="cross_id"/>
<result property="gmtCreate" column="gmt_create"/>
<result property="gmtModified" column="gmt_modified"/>
</resultMap>
</mapper>
<?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="net.wanji.web.mapper.scheme.LaneSegmentMapper">
<!-- 通用查询映射结果 -->
<resultMap type="net.wanji.web.po.scheme.LaneSegmentPO" id="BaseResultMap">
<result property="id" column="id"/>
<result property="sort" column="sort"/>
<result property="laneId" column="lane_id"/>
<result property="status" column="status"/>
<result property="wkt" column="wkt"/>
<result property="gmtCreate" column="gmt_create"/>
<result property="gmtModified" column="gmt_modified"/>
</resultMap>
<delete id="deleteByLaneIds">
delete from t_base_lane_segment
where lane_id in
<foreach collection="laneIds" item="laneId" separator="," open="(" close=")">
#{laneId}
</foreach>
</delete>
</mapper>
<?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="net.wanji.web.mapper.scheme.PhaseLightsMapper">
<!-- 通用查询映射结果 -->
<resultMap type="net.wanji.web.po.scheme.PhaseLightsPO" id="BaseResultMap">
<result property="id" column="id"/>
<result property="lightsId" column="lights_id"/>
<result property="phaseId" column="phase_id"/>
<result property="crossId" column="cross_id"/>
<result property="gmtCreate" column="gmt_create"/>
<result property="gmtModified" column="gmt_modified"/>
</resultMap>
</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