Commit fdb24121 authored by hanbing's avatar hanbing

静态信息接口添加返回值

parent 41b3fa91
...@@ -5,6 +5,9 @@ import io.swagger.annotations.Api; ...@@ -5,6 +5,9 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponses;
import net.wanji.utc.dto.systemadmin.CrossInfoInsertOrUpdateDTO;
import net.wanji.utc.dto.systemadmin.CrossInfoListDTO;
import net.wanji.utc.dto.systemadmin.DeleteByStringIdListDTO;
import net.wanji.utc.entity.JsonViewObject; import net.wanji.utc.entity.JsonViewObject;
import net.wanji.utc.service.systemadmin.CrossInfoService; import net.wanji.utc.service.systemadmin.CrossInfoService;
import net.wanji.utc.vo.systemadmin.*; import net.wanji.utc.vo.systemadmin.*;
...@@ -30,15 +33,15 @@ public class CrossInfoController { ...@@ -30,15 +33,15 @@ public class CrossInfoController {
@Autowired @Autowired
CrossInfoService crossInfoService; CrossInfoService crossInfoService;
@ApiOperation(value = "信号机列表", notes = "信号机列表", response = CrossInfoListOutVO.class, @ApiOperation(value = "信号机列表", notes = "信号机列表", response = CrossInfoListVO.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON) produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/list", @PostMapping(value = "/list",
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON) produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@ApiResponses({ @ApiResponses({
@ApiResponse(code = 200, message = "OK", response = CrossInfoListOutVO.class), @ApiResponse(code = 200, message = "OK", response = CrossInfoListVO.class),
}) })
public JsonViewObject list(@RequestBody CrossInfoListInVO crossInfoListInVO) { public JsonViewObject list(@RequestBody CrossInfoListDTO crossInfoListDTO) {
PageInfo<CrossInfoListOutVO> crossInfoListOutVOPageInfo = crossInfoService.list(crossInfoListInVO); PageInfo<CrossInfoListVO> crossInfoListOutVOPageInfo = crossInfoService.list(crossInfoListDTO);
JsonViewObject jsonViewObject = JsonViewObject.newInstance(); JsonViewObject jsonViewObject = JsonViewObject.newInstance();
return jsonViewObject.success(crossInfoListOutVOPageInfo); return jsonViewObject.success(crossInfoListOutVOPageInfo);
...@@ -46,7 +49,7 @@ public class CrossInfoController { ...@@ -46,7 +49,7 @@ public class CrossInfoController {
@ApiOperation(value = "信号机添加或修改", notes = "信号机添加或修改", consumes = MediaType.APPLICATION_JSON) @ApiOperation(value = "信号机添加或修改", notes = "信号机添加或修改", consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/insertOrUpdate", consumes = MediaType.APPLICATION_JSON) @PostMapping(value = "/insertOrUpdate", consumes = MediaType.APPLICATION_JSON)
public JsonViewObject insertOrUpdate(@RequestBody CrossInfoInsertOrUpdateInVO inVO) { public JsonViewObject insertOrUpdate(@RequestBody CrossInfoInsertOrUpdateDTO inVO) {
crossInfoService.insertOrUpdate(inVO); crossInfoService.insertOrUpdate(inVO);
JsonViewObject jsonViewObject = JsonViewObject.newInstance(); JsonViewObject jsonViewObject = JsonViewObject.newInstance();
...@@ -55,7 +58,7 @@ public class CrossInfoController { ...@@ -55,7 +58,7 @@ public class CrossInfoController {
@ApiOperation(value = "信号机删除", notes = "信号机删除", consumes = MediaType.APPLICATION_JSON) @ApiOperation(value = "信号机删除", notes = "信号机删除", consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/delete", consumes = MediaType.APPLICATION_JSON) @PostMapping(value = "/delete", consumes = MediaType.APPLICATION_JSON)
public JsonViewObject delete(@RequestBody DeleteByStringIdListInVO inVO) { public JsonViewObject delete(@RequestBody DeleteByStringIdListDTO inVO) {
crossInfoService.delete(inVO); crossInfoService.delete(inVO);
JsonViewObject jsonViewObject = JsonViewObject.newInstance(); JsonViewObject jsonViewObject = JsonViewObject.newInstance();
......
...@@ -5,13 +5,13 @@ import io.swagger.annotations.Api; ...@@ -5,13 +5,13 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponses;
import net.wanji.utc.dto.systemadmin.DeleteByIntegerIdListDTO;
import net.wanji.utc.dto.systemadmin.ManufacturerApiInfoInsertOrUpdateDTO;
import net.wanji.utc.dto.systemadmin.ManufacturerApiInfoListDTO;
import net.wanji.utc.entity.JsonViewObject; import net.wanji.utc.entity.JsonViewObject;
import net.wanji.utc.po.ManufacturerApiInfoPO; import net.wanji.utc.po.ManufacturerApiInfoPO;
import net.wanji.utc.service.systemadmin.ManufacturerApiInfoService; import net.wanji.utc.service.systemadmin.ManufacturerApiInfoService;
import net.wanji.utc.vo.systemadmin.DeleteByIntegerIdListInVO; import net.wanji.utc.vo.systemadmin.ManufacturerApiInfoVO;
import net.wanji.utc.vo.systemadmin.ManufacturerApiInfoInsertOrUpdateInVO;
import net.wanji.utc.vo.systemadmin.ManufacturerApiInfoListInVO;
import net.wanji.utc.vo.systemadmin.ManufacturerApiInfoOutVO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
...@@ -41,9 +41,9 @@ public class ManufacturerApiController { ...@@ -41,9 +41,9 @@ public class ManufacturerApiController {
@ApiResponses({ @ApiResponses({
@ApiResponse(code = 200, message = "OK", response = ManufacturerApiInfoPO.class), @ApiResponse(code = 200, message = "OK", response = ManufacturerApiInfoPO.class),
}) })
public JsonViewObject list(@RequestBody ManufacturerApiInfoListInVO manufacturerApiInfoListInVO) { public JsonViewObject list(@RequestBody ManufacturerApiInfoListDTO manufacturerApiInfoListDTO) {
PageInfo<ManufacturerApiInfoOutVO> manufacturerApiInfoOutVOPageInfo = PageInfo<ManufacturerApiInfoVO> manufacturerApiInfoOutVOPageInfo =
manufacturerApiInfoService.list(manufacturerApiInfoListInVO); manufacturerApiInfoService.list(manufacturerApiInfoListDTO);
JsonViewObject jsonViewObject = JsonViewObject.newInstance(); JsonViewObject jsonViewObject = JsonViewObject.newInstance();
return jsonViewObject.success(manufacturerApiInfoOutVOPageInfo); return jsonViewObject.success(manufacturerApiInfoOutVOPageInfo);
...@@ -51,7 +51,7 @@ public class ManufacturerApiController { ...@@ -51,7 +51,7 @@ public class ManufacturerApiController {
@ApiOperation(value = "接口添加或修改", notes = "接口添加或修改", consumes = MediaType.APPLICATION_JSON) @ApiOperation(value = "接口添加或修改", notes = "接口添加或修改", consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/insertOrUpdate", consumes = MediaType.APPLICATION_JSON) @PostMapping(value = "/insertOrUpdate", consumes = MediaType.APPLICATION_JSON)
public JsonViewObject insertOrUpdate(@RequestBody ManufacturerApiInfoInsertOrUpdateInVO inVO) { public JsonViewObject insertOrUpdate(@RequestBody ManufacturerApiInfoInsertOrUpdateDTO inVO) {
manufacturerApiInfoService.insertOrUpdate(inVO); manufacturerApiInfoService.insertOrUpdate(inVO);
JsonViewObject jsonViewObject = JsonViewObject.newInstance(); JsonViewObject jsonViewObject = JsonViewObject.newInstance();
...@@ -60,7 +60,7 @@ public class ManufacturerApiController { ...@@ -60,7 +60,7 @@ public class ManufacturerApiController {
@ApiOperation(value = "接口删除", notes = "接口删除", consumes = MediaType.APPLICATION_JSON) @ApiOperation(value = "接口删除", notes = "接口删除", consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/delete", consumes = MediaType.APPLICATION_JSON) @PostMapping(value = "/delete", consumes = MediaType.APPLICATION_JSON)
public JsonViewObject delete(@RequestBody DeleteByIntegerIdListInVO inVO) { public JsonViewObject delete(@RequestBody DeleteByIntegerIdListDTO inVO) {
manufacturerApiInfoService.delete(inVO); manufacturerApiInfoService.delete(inVO);
JsonViewObject jsonViewObject = JsonViewObject.newInstance(); JsonViewObject jsonViewObject = JsonViewObject.newInstance();
......
...@@ -5,12 +5,12 @@ import io.swagger.annotations.Api; ...@@ -5,12 +5,12 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponses;
import net.wanji.utc.dto.systemadmin.ManufacturerInsertOrUpdateDTO;
import net.wanji.utc.entity.JsonViewObject; import net.wanji.utc.entity.JsonViewObject;
import net.wanji.utc.po.ManufacturerInfoPO; import net.wanji.utc.po.ManufacturerInfoPO;
import net.wanji.utc.service.systemadmin.ManufacturerService; import net.wanji.utc.service.systemadmin.ManufacturerService;
import net.wanji.utc.vo.systemadmin.DeleteByIntegerIdListInVO; import net.wanji.utc.dto.systemadmin.DeleteByIntegerIdListDTO;
import net.wanji.utc.vo.systemadmin.ManufacturerInsertOrUpdateInVO; import net.wanji.utc.dto.systemadmin.ManufacturerListDTO;
import net.wanji.utc.vo.systemadmin.ManufacturerListInVO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MediaType;
...@@ -40,8 +40,8 @@ public class ManufacturerController { ...@@ -40,8 +40,8 @@ public class ManufacturerController {
@ApiResponses({ @ApiResponses({
@ApiResponse(code = 200, message = "OK", response = ManufacturerInfoPO.class), @ApiResponse(code = 200, message = "OK", response = ManufacturerInfoPO.class),
}) })
public JsonViewObject list(@RequestBody ManufacturerListInVO manufacturerListInVO) { public JsonViewObject list(@RequestBody ManufacturerListDTO manufacturerListDTO) {
PageInfo<ManufacturerInfoPO> manufacturerInfoPOPageInfo = manufacturerService.list(manufacturerListInVO); PageInfo<ManufacturerInfoPO> manufacturerInfoPOPageInfo = manufacturerService.list(manufacturerListDTO);
JsonViewObject jsonViewObject = JsonViewObject.newInstance(); JsonViewObject jsonViewObject = JsonViewObject.newInstance();
return jsonViewObject.success(manufacturerInfoPOPageInfo); return jsonViewObject.success(manufacturerInfoPOPageInfo);
...@@ -49,7 +49,7 @@ public class ManufacturerController { ...@@ -49,7 +49,7 @@ public class ManufacturerController {
@ApiOperation(value = "厂商添加或修改", notes = "厂商添加或修改", consumes = MediaType.APPLICATION_JSON) @ApiOperation(value = "厂商添加或修改", notes = "厂商添加或修改", consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/insertOrUpdate", consumes = MediaType.APPLICATION_JSON) @PostMapping(value = "/insertOrUpdate", consumes = MediaType.APPLICATION_JSON)
public JsonViewObject insertOrUpdate(@RequestBody ManufacturerInsertOrUpdateInVO inVO) { public JsonViewObject insertOrUpdate(@RequestBody ManufacturerInsertOrUpdateDTO inVO) {
manufacturerService.insertOrUpdate(inVO); manufacturerService.insertOrUpdate(inVO);
JsonViewObject jsonViewObject = JsonViewObject.newInstance(); JsonViewObject jsonViewObject = JsonViewObject.newInstance();
...@@ -58,7 +58,7 @@ public class ManufacturerController { ...@@ -58,7 +58,7 @@ public class ManufacturerController {
@ApiOperation(value = "厂商删除", notes = "厂商删除", consumes = MediaType.APPLICATION_JSON) @ApiOperation(value = "厂商删除", notes = "厂商删除", consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/delete", consumes = MediaType.APPLICATION_JSON) @PostMapping(value = "/delete", consumes = MediaType.APPLICATION_JSON)
public JsonViewObject delete(@RequestBody DeleteByIntegerIdListInVO inVO) { public JsonViewObject delete(@RequestBody DeleteByIntegerIdListDTO inVO) {
manufacturerService.delete(inVO); manufacturerService.delete(inVO);
JsonViewObject jsonViewObject = JsonViewObject.newInstance(); JsonViewObject jsonViewObject = JsonViewObject.newInstance();
......
package net.wanji.utc.controller; package net.wanji.utc.controller;
import net.wanji.utc.common.constant.Constants; import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import net.wanji.utc.entity.JsonViewObject;
import net.wanji.utc.po.*;
import net.wanji.utc.service.staticinfo.StaticInfoService; import net.wanji.utc.service.staticinfo.StaticInfoService;
import net.wanji.utc.common.baseentity.BaseCrossInfo; import net.wanji.utc.dto.CrossInfoDTO;
import net.wanji.utc.vo.CrossInfoInVO;
import net.wanji.utc.common.genericentity.OutVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import net.wanji.utc.vo.CrossSchedulesInVO; import net.wanji.utc.dto.CrossSchedulesDTO;
import net.wanji.utc.vo.PlanSectionInVO; import net.wanji.utc.dto.PlanSectionDTO;
import net.wanji.utc.vo.SchemePhaseLightsInVO; import net.wanji.utc.dto.SchemePhaseLightsDTO;
import net.wanji.utc.vo.PlanSectionVO;
import net.wanji.utc.vo.SchemePhaseLightsVO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.Date; import javax.ws.rs.core.MediaType;
import java.util.List;
/** /**
* 静态信息接口 * 静态信息接口
...@@ -29,41 +33,80 @@ public class StaticInfoController { ...@@ -29,41 +33,80 @@ public class StaticInfoController {
@Autowired @Autowired
StaticInfoService staticInfoService; StaticInfoService staticInfoService;
@PostMapping("/crossInfo") @PostMapping(value = "/crossInfo",
@ApiOperation(value = "信号路口基础信息", notes = "信号路口基础信息") produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
public ResponseEntity crossInfo(HttpServletRequest request, @RequestBody CrossInfoInVO crossInfoInVO) { @ApiOperation(value = "信号路口基础信息", notes = "信号路口基础信息", response = CrossInfoPO.class,
OutVO<BaseCrossInfo> outVO = new OutVO<>(); produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
String manufacturerCode = crossInfoInVO.getManufacturerCode(); @ApiResponses({
outVO.setManufacturerCode(manufacturerCode); @ApiResponse(code = 200, message = "OK", response = CrossInfoPO.class)
outVO.setUpdatetime(new Date()); })
outVO.setSystemAbbr(Constants.SYSTEM_ABBR); public JsonViewObject crossInfo(@RequestBody CrossInfoDTO crossInfoDTO) {
List<CrossInfoPO> crossInfoPOList = staticInfoService.crossBasicInfo(crossInfoDTO);
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
staticInfoService.crossBasicInfo(outVO); return jsonViewObject.success(crossInfoPOList);
return ResponseEntity.ok("success");
} }
@PostMapping("/schemePhaseLights") @PostMapping(value = "/schemePhaseLights",
@ApiOperation(value = "方案数据-方案信息、相位信息、灯组信息", notes = "方案数据-方案信息、相位信息、灯组信息") produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
public ResponseEntity schemePhaseLights(HttpServletRequest request, @ApiOperation(value = "方案数据-方案信息、相位信息、灯组信息", notes = "方案数据-方案信息、相位信息、灯组信息",
@RequestBody SchemePhaseLightsInVO schemePhaseLightsInVO) throws Exception { response = SchemePhaseLightsVO.class,
staticInfoService.schemePhaseLights(schemePhaseLightsInVO); produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
return ResponseEntity.ok("success"); @ApiResponses({
@ApiResponse(code = 200, message = "OK", response = SchemePhaseLightsVO.class)
})
public JsonViewObject schemePhaseLights(@RequestBody SchemePhaseLightsDTO schemePhaseLightsDTO) throws Exception {
// 更新数据库
staticInfoService.schemePhaseLights(schemePhaseLightsDTO);
// 构造返回值
SchemePhaseLightsVO schemePhaseLightsVO = staticInfoService.buildSchemePhaseLightsResponse(schemePhaseLightsDTO);
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
return jsonViewObject.success(schemePhaseLightsVO);
}
@PostMapping(value = "/planSection",
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@ApiOperation(value = "计划数据-计划信息、时段信息", notes = "计划数据-计划信息、时段信息", response = PlanSectionVO.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = PlanSectionVO.class)
})
public JsonViewObject planSection(@RequestBody PlanSectionDTO planSectionDTO) throws Exception {
// 更新数据库
staticInfoService.planSection(planSectionDTO);
// 构造返回值
String crossId = planSectionDTO.getCrossId();
Integer planNo = planSectionDTO.getPlanNo();
PlanSectionVO planSectionVO = new PlanSectionVO();
if (planNo == -1) {
// 返回所有
planSectionVO = staticInfoService.buildPlanSectionResponse(crossId);
} else {
// 按计划号返回
planSectionVO = staticInfoService.buildPlanSectionResponse(crossId, planNo);
} }
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
@PostMapping("/planSection") return jsonViewObject.success(planSectionVO);
@ApiOperation(value = "计划数据-计划信息、时段信息", notes = "计划数据-计划信息、时段信息")
public ResponseEntity planSection(HttpServletRequest request,
@RequestBody PlanSectionInVO planSectionInVO) throws Exception {
staticInfoService.planSection(planSectionInVO);
return ResponseEntity.ok("success");
} }
@PostMapping("/crossSchedules") @PostMapping(value = "/crossSchedules",
@ApiOperation(value = "时间表数据", notes = "时间表数据") produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
public ResponseEntity crossSchedules(HttpServletRequest request, @ApiOperation(value = "时间表数据", notes = "时间表数据", response = CrossSchedulesPO.class,
@RequestBody CrossSchedulesInVO crossSchedulesInVO) throws Exception { produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
staticInfoService.crossSchedules(crossSchedulesInVO); @ApiResponses({
return ResponseEntity.ok("success"); @ApiResponse(code = 200, message = "OK", response = CrossSchedulesPO.class)
})
public JsonViewObject crossSchedules(@RequestBody CrossSchedulesDTO crossSchedulesDTO) throws Exception {
// 更新数据库
staticInfoService.crossSchedules(crossSchedulesDTO);
// 构造返回值
List<String> crossIdList = crossSchedulesDTO.getCrossIdList();
List<CrossSchedulesPO> crossSchedulesPOList = staticInfoService.buildCrossSchedulesResponse(crossIdList);
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
return jsonViewObject.success(crossSchedulesPOList);
} }
} }
package net.wanji.utc.vo; package net.wanji.utc.dto;
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/15 9:57 * @date 2022/11/15 9:57
*/ */
@Data @Data
@ApiModel(value = "CrossInfoInVO", description = "查询信号路口基础信息输入参数") @ApiModel(value = "CrossInfoDTO", description = "查询信号路口基础信息输入参数")
public class CrossInfoInVO { public class CrossInfoDTO {
@ApiModelProperty(value = "厂商代码 HK") @ApiModelProperty(value = "厂商代码 HK")
String manufacturerCode; String manufacturerCode;
} }
package net.wanji.utc.vo; package net.wanji.utc.dto;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -11,9 +11,9 @@ import java.util.List; ...@@ -11,9 +11,9 @@ import java.util.List;
* @date 2022/11/18 17:15 * @date 2022/11/18 17:15
*/ */
@Data @Data
@ApiModel(value = "CrossSchedulesInVO", description = "查询时间表数据输入参数") @ApiModel(value = "CrossSchedulesDTO", description = "查询时间表数据输入参数")
public class CrossSchedulesInVO { public class CrossSchedulesDTO {
@ApiModelProperty(value = "厂商缩写 HK") @ApiModelProperty(value = "厂商代码 HK")
String manufacturerCode; String manufacturerCode;
@ApiModelProperty(value = "路口列表") @ApiModelProperty(value = "路口列表")
......
package net.wanji.utc.vo; package net.wanji.utc.dto;
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/15 9:57 * @date 2022/11/15 9:57
*/ */
@Data @Data
@ApiModel(value = "PlanSectionInVO", description = "查询计划数据-计划信息、时段信息输入参数") @ApiModel(value = "PlanSectionDTO", description = "查询计划数据-计划信息、时段信息输入参数")
public class PlanSectionInVO { public class PlanSectionDTO {
@ApiModelProperty(value = "路口ID") @ApiModelProperty(value = "路口ID")
private String crossId; private String crossId;
......
package net.wanji.utc.vo; package net.wanji.utc.dto;
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/16 13:23 * @date 2022/11/16 13:23
*/ */
@Data @Data
@ApiModel(value = "SchemePhaseLightsInVO", description = "查询方案数据-方案信息、相位信息、灯组信息输入参数") @ApiModel(value = "SchemePhaseLightsDTO", description = "查询方案数据-方案信息、相位信息、灯组信息输入参数")
public class SchemePhaseLightsInVO { public class SchemePhaseLightsDTO {
@ApiModelProperty(value = "路口ID") @ApiModelProperty(value = "路口ID")
private String crossId; private String crossId;
} }
package net.wanji.utc.vo.systemadmin; package net.wanji.utc.dto.systemadmin;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -11,8 +11,8 @@ import java.util.Date; ...@@ -11,8 +11,8 @@ import java.util.Date;
* @date 2022/11/25 10:21 * @date 2022/11/25 10:21
*/ */
@Data @Data
@ApiModel(value = "CrossInfoInsertOrUpdateInVO", description = "信号机新增或修改输入参数") @ApiModel(value = "CrossInfoInsertOrUpdateDTO", description = "信号机新增或修改输入参数")
public class CrossInfoInsertOrUpdateInVO { public class CrossInfoInsertOrUpdateDTO {
@ApiModelProperty(value = "路口ID。不传ID为新增,传ID为修改",notes = "") @ApiModelProperty(value = "路口ID。不传ID为新增,传ID为修改",notes = "")
private String id ; private String id ;
/** 信号机编号 */ /** 信号机编号 */
......
package net.wanji.utc.vo.systemadmin; package net.wanji.utc.dto.systemadmin;
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/25 8:55 * @date 2022/11/25 8:55
*/ */
@Data @Data
@ApiModel(value = "CrossInfoListInVO", description = "信号机列表输入参数") @ApiModel(value = "CrossInfoListDTO", description = "信号机列表输入参数")
public class CrossInfoListInVO { public class CrossInfoListDTO {
@ApiModelProperty(required = true, value = "页号") @ApiModelProperty(required = true, value = "页号")
Integer pageNum; Integer pageNum;
@ApiModelProperty(required = true, value = "每页记录数") @ApiModelProperty(required = true, value = "每页记录数")
......
package net.wanji.utc.vo.systemadmin; package net.wanji.utc.dto.systemadmin;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -11,8 +11,8 @@ import java.util.List; ...@@ -11,8 +11,8 @@ import java.util.List;
* @date 2022/11/24 10:10 * @date 2022/11/24 10:10
*/ */
@Data @Data
@ApiModel(value = "DeleteByIntegerIdListInVO", description = "厂商或接口删除输入参数") @ApiModel(value = "DeleteByIntegerIdListDTO", description = "厂商或接口删除输入参数")
public class DeleteByIntegerIdListInVO { public class DeleteByIntegerIdListDTO {
/** 厂商或接口ID列表 */ /** 厂商或接口ID列表 */
@ApiModelProperty(value = "厂商或接口ID列表",notes = "") @ApiModelProperty(value = "厂商或接口ID列表",notes = "")
private List<Integer> ids ; private List<Integer> ids ;
......
package net.wanji.utc.vo.systemadmin; package net.wanji.utc.dto.systemadmin;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -11,8 +11,8 @@ import java.util.List; ...@@ -11,8 +11,8 @@ import java.util.List;
* @date 2022/11/24 10:10 * @date 2022/11/24 10:10
*/ */
@Data @Data
@ApiModel(value = "DeleteByStringIdListInVO", description = "信号机删除输入参数") @ApiModel(value = "DeleteByStringIdListDTO", description = "信号机删除输入参数")
public class DeleteByStringIdListInVO { public class DeleteByStringIdListDTO {
/** 信号机ID列表 */ /** 信号机ID列表 */
@ApiModelProperty(value = "信号机ID列表",notes = "") @ApiModelProperty(value = "信号机ID列表",notes = "")
private List<String> ids ; private List<String> ids ;
......
package net.wanji.utc.vo.systemadmin; package net.wanji.utc.dto.systemadmin;
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/24 15:20 * @date 2022/11/24 15:20
*/ */
@Data @Data
@ApiModel(value = "ManufacturerApiInfoInsertOrUpdateInVO", description = "接口新增或修改输入参数") @ApiModel(value = "ManufacturerApiInfoInsertOrUpdateDTO", description = "接口新增或修改输入参数")
public class ManufacturerApiInfoInsertOrUpdateInVO { public class ManufacturerApiInfoInsertOrUpdateDTO {
/** 接口ID */ /** 接口ID */
@ApiModelProperty(value = "接口ID。不传ID为新增,传ID为修改",notes = "") @ApiModelProperty(value = "接口ID。不传ID为新增,传ID为修改",notes = "")
private Integer id ; private Integer id ;
......
package net.wanji.utc.vo.systemadmin; package net.wanji.utc.dto.systemadmin;
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/24 14:05 * @date 2022/11/24 14:05
*/ */
@Data @Data
@ApiModel(value = "ManufacturerApiInfoListInVO", description = "查询接口列表输入参数") @ApiModel(value = "ManufacturerApiInfoListDTO", description = "查询接口列表输入参数")
public class ManufacturerApiInfoListInVO { public class ManufacturerApiInfoListDTO {
@ApiModelProperty(required = true, value = "页号") @ApiModelProperty(required = true, value = "页号")
Integer pageNum; Integer pageNum;
@ApiModelProperty(required = true, value = "每页记录数") @ApiModelProperty(required = true, value = "每页记录数")
......
package net.wanji.utc.vo.systemadmin; package net.wanji.utc.dto.systemadmin;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -9,9 +9,9 @@ import lombok.Data; ...@@ -9,9 +9,9 @@ import lombok.Data;
* @date 2022/11/24 9:42 * @date 2022/11/24 9:42
*/ */
@Data @Data
@ApiModel(value = "ManufacturerInsertOrUpdateInVO", @ApiModel(value = "ManufacturerInsertOrUpdateDTO",
description = "厂商添加或修改输入参数。如果携带ID,即为修改;如果不携带ID,即为新增") description = "厂商添加或修改输入参数。如果携带ID,即为修改;如果不携带ID,即为新增")
public class ManufacturerInsertOrUpdateInVO { public class ManufacturerInsertOrUpdateDTO {
/** 厂商ID */ /** 厂商ID */
@ApiModelProperty(value = "厂商ID。如果携带ID,即为修改;如果不携带ID,即为新增",notes = "") @ApiModelProperty(value = "厂商ID。如果携带ID,即为修改;如果不携带ID,即为新增",notes = "")
private Integer id ; private Integer id ;
......
package net.wanji.utc.vo.systemadmin; package net.wanji.utc.dto.systemadmin;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -10,8 +10,8 @@ import lombok.Data; ...@@ -10,8 +10,8 @@ import lombok.Data;
*/ */
@Data @Data
@ApiModel(value = "ManufacturerListInVO", description = "查询厂商列表输入参数") @ApiModel(value = "ManufacturerListDTO", description = "查询厂商列表输入参数")
public class ManufacturerListInVO { public class ManufacturerListDTO {
@ApiModelProperty(required = true, value = "页号") @ApiModelProperty(required = true, value = "页号")
Integer pageNum; Integer pageNum;
@ApiModelProperty(required = true, value = "每页记录数") @ApiModelProperty(required = true, value = "每页记录数")
......
...@@ -16,7 +16,8 @@ public interface CrossInfoMapper { ...@@ -16,7 +16,8 @@ public interface CrossInfoMapper {
List<String> selectCrossCodesByIds(@Param("entities") List<String> crossIdList); List<String> selectCrossCodesByIds(@Param("entities") List<String> crossIdList);
String selectIdByCode(@Param("crossCode")String crossCode); String selectIdByCodeAndManufacturerId(@Param("crossCode") String crossCode,
@Param("manufacturerId")Integer manufacturerId);
CrossInfoPO selectByCode(@Param("code") String code); CrossInfoPO selectByCode(@Param("code") String code);
...@@ -32,4 +33,6 @@ public interface CrossInfoMapper { ...@@ -32,4 +33,6 @@ public interface CrossInfoMapper {
void updateOne(CrossInfoPO crossInfoPO); void updateOne(CrossInfoPO crossInfoPO);
void deleteBatch(@Param("ids") List<String> ids); void deleteBatch(@Param("ids") List<String> ids);
void updateOneByCodeAndManufacturerId(CrossInfoPO crossInfoPO);
} }
...@@ -17,4 +17,6 @@ public interface CrossPhaseMapper { ...@@ -17,4 +17,6 @@ public interface CrossPhaseMapper {
List<CrossPhasePO> selectByCrossIdAndPlanId(@Param("crossId") String crossId, @Param("planId") String planId); List<CrossPhasePO> selectByCrossIdAndPlanId(@Param("crossId") String crossId, @Param("planId") String planId);
List<Integer> selectIdsByPhaseNo(@Param("phaseNo") Integer phaseNo); List<Integer> selectIdsByPhaseNo(@Param("phaseNo") Integer phaseNo);
List<CrossPhasePO> selectByCrossId(@Param("crossId") String crossId);
} }
...@@ -3,6 +3,8 @@ package net.wanji.utc.mapper; ...@@ -3,6 +3,8 @@ package net.wanji.utc.mapper;
import net.wanji.utc.po.CrossPlanPO; import net.wanji.utc.po.CrossPlanPO;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* @author Kent HAN * @author Kent HAN
* @date 2022/11/18 15:57 * @date 2022/11/18 15:57
...@@ -12,5 +14,9 @@ public interface CrossPlanMapper { ...@@ -12,5 +14,9 @@ public interface CrossPlanMapper {
void insertOne(CrossPlanPO crossPlanPO); void insertOne(CrossPlanPO crossPlanPO);
Integer selectIdByNo(@Param("crossId")String crossId, @Param("planNo")Integer planNo); Integer selectIdByNo(@Param("crossId") String crossId, @Param("planNo")Integer planNo);
List<CrossPlanPO> selectByCrossId(@Param("crossId") String crossId);
List<CrossPlanPO> selectByCrossIdAndPlanNo(@Param("crossId") String crossId, @Param("planNo")Integer planNo);
} }
...@@ -4,6 +4,7 @@ import net.wanji.utc.po.CrossSchedulesPO; ...@@ -4,6 +4,7 @@ import net.wanji.utc.po.CrossSchedulesPO;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List;
/** /**
* @author Kent HAN * @author Kent HAN
...@@ -13,4 +14,6 @@ public interface CrossSchedulesMapper { ...@@ -13,4 +14,6 @@ public interface CrossSchedulesMapper {
void deleteByCrossId(@Param("crossId") String crossId); void deleteByCrossId(@Param("crossId") String crossId);
void insertBatch(@Param("entities") ArrayList<CrossSchedulesPO> crossSchedulesPOList); void insertBatch(@Param("entities") ArrayList<CrossSchedulesPO> crossSchedulesPOList);
List<CrossSchedulesPO> selectByCrossIds(@Param("crossIds") List<String> crossIdList);
} }
...@@ -18,4 +18,6 @@ public interface CrossSchemeMapper { ...@@ -18,4 +18,6 @@ public interface CrossSchemeMapper {
CrossSchemePO selectByCrossIdAndSchemeNo(@Param("crossId") String crossId, CrossSchemePO selectByCrossIdAndSchemeNo(@Param("crossId") String crossId,
@Param("schemeNo") Integer schemeNo); @Param("schemeNo") Integer schemeNo);
List<CrossSchemePO> selectByCrossId(@Param("crossId") String crossId);
} }
...@@ -3,6 +3,8 @@ package net.wanji.utc.mapper; ...@@ -3,6 +3,8 @@ package net.wanji.utc.mapper;
import net.wanji.utc.po.CrossSectionPO; import net.wanji.utc.po.CrossSectionPO;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* @author Kent HAN * @author Kent HAN
* @date 2022/11/18 16:46 * @date 2022/11/18 16:46
...@@ -12,4 +14,9 @@ public interface CrossSectionMapper { ...@@ -12,4 +14,9 @@ public interface CrossSectionMapper {
@Param("timeSecNo") Integer timeSecNo); @Param("timeSecNo") Integer timeSecNo);
void insertOne(CrossSectionPO crossSectionPO); void insertOne(CrossSectionPO crossSectionPO);
List<CrossSectionPO> selectByCrossId(@Param("crossId") String crossId);
List<CrossSectionPO> selectByCrossIdAndPlanId(@Param("crossId") String crossId,
@Param("planId") Integer planId);
} }
...@@ -12,33 +12,33 @@ import java.util.Date; ...@@ -12,33 +12,33 @@ import java.util.Date;
@Data @Data
public class CrossLightsPO { public class CrossLightsPO {
/** 灯组ID */ /** 灯组ID */
@ApiModelProperty(name = "灯组ID",notes = "") @ApiModelProperty(value = "灯组ID",notes = "")
private Integer id ; private Integer id ;
/** 灯组号 */ /** 灯组号 */
@ApiModelProperty(name = "灯组号",notes = "") @ApiModelProperty(value = "灯组号",notes = "")
private String lightsNo ; private String lightsNo ;
/** 灯组名称 */ /** 灯组名称 */
@ApiModelProperty(name = "灯组名称",notes = "") @ApiModelProperty(value = "灯组名称",notes = "")
private String name ; private String name ;
/** 灯组类型:1箭头;2圆饼,3行人 */ /** 灯组类型:1箭头;2圆饼,3行人 */
@ApiModelProperty(name = "灯组类型:1箭头2圆饼3行人",notes = "") @ApiModelProperty(value = "灯组类型:1箭头2圆饼3行人",notes = "")
private Integer type ; private Integer type ;
/** 灯组方向:1北;2东北;3东;4东南;5南;6西南;7西;8西北 */ /** 灯组方向:1北;2东北;3东;4东南;5南;6西南;7西;8西北 */
@ApiModelProperty(name = "灯组方向:1北;2东北;3东;4东南;5南;6西南;7西;8西北",notes = "") @ApiModelProperty(value = "灯组方向:1北;2东北;3东;4东南;5南;6西南;7西;8西北",notes = "")
private Integer dir ; private Integer dir ;
/** 灯组转向:1左转;2右转;3直行;4左掉头;5直左;6直右;7右掉头;8向左合流;9向右合流;10左转加掉头;11右转加掉头;12直行加左掉头;13直行加右掉头;14左转右转;15左直右;16左转右转加掉头;17左直掉头;18左直右掉头;20行人 */ /** 灯组转向:1左转;2右转;3直行;4左掉头;5直左;6直右;7右掉头;8向左合流;9向右合流;10左转加掉头;11右转加掉头;12直行加左掉头;13直行加右掉头;14左转右转;15左直右;16左转右转加掉头;17左直掉头;18左直右掉头;20行人 */
@ApiModelProperty(name = "灯组转向:1左转;2右转;3直行;4左掉头;5直左;6直右;7右掉头;8向左合流;9向右合流;10左转加掉头;11右转加掉头;12直行加左掉头;13直行加右掉头;14左转右转;15左直右;16左转右转加掉头;17左直掉头;18左直右掉头;20行人",notes = "") @ApiModelProperty(value = "灯组转向:1左转;2右转;3直行;4左掉头;5直左;6直右;7右掉头;8向左合流;9向右合流;10左转加掉头;11右转加掉头;12直行加左掉头;13直行加右掉头;14左转右转;15左直右;16左转右转加掉头;17左直掉头;18左直右掉头;20行人",notes = "")
private Integer turn ; private Integer turn ;
/** 路口ID */ /** 路口ID */
@ApiModelProperty(name = "路口ID",notes = "") @ApiModelProperty(value = "路口ID",notes = "")
private String crossId ; private String crossId ;
/** 行人进出口:1进口;2出口,3进出口 */ /** 行人进出口:1进口;2出口,3进出口 */
@ApiModelProperty(name = "行人进出口:1进口2出口,3进出口",notes = "") @ApiModelProperty(value = "行人进出口:1进口2出口,3进出口",notes = "")
private Integer inOutType ; private Integer inOutType ;
/** 创建时间 */ /** 创建时间 */
@ApiModelProperty(name = "创建时间",notes = "") @ApiModelProperty(value = "创建时间",notes = "")
private Date gmtCreate ; private Date gmtCreate ;
/** 修改时间 */ /** 修改时间 */
@ApiModelProperty(name = "修改时间",notes = "") @ApiModelProperty(value = "修改时间",notes = "")
private Date gmtModified ; private Date gmtModified ;
} }
...@@ -12,57 +12,57 @@ import java.util.Date; ...@@ -12,57 +12,57 @@ import java.util.Date;
@Data @Data
public class CrossPhasePO { public class CrossPhasePO {
/** 相位ID */ /** 相位ID */
@ApiModelProperty(name = "相位ID",notes = "") @ApiModelProperty(value = "相位ID",notes = "")
private Integer id ; private Integer id ;
/** 相位号 */ /** 相位号 */
@ApiModelProperty(name = "相位号",notes = "") @ApiModelProperty(value = "相位号",notes = "")
private String phaseNo; private String phaseNo;
/** 相位名称 */ /** 相位名称 */
@ApiModelProperty(name = "相位名称",notes = "") @ApiModelProperty(value = "相位名称",notes = "")
private String name ; private String name ;
/** 相位序号 */ /** 相位序号 */
@ApiModelProperty(name = "相位序号",notes = "") @ApiModelProperty(value = "相位序号",notes = "")
private Integer sort ; private Integer sort ;
/** 路口ID */ /** 路口ID */
@ApiModelProperty(name = "路口ID",notes = "") @ApiModelProperty(value = "路口ID",notes = "")
private String crossId ; private String crossId ;
/** 方案ID */ /** 方案ID */
@ApiModelProperty(name = "方案ID",notes = "") @ApiModelProperty(value = "方案ID",notes = "")
private Integer planId ; private Integer planId ;
/** 环号 */ /** 环号 */
@ApiModelProperty(name = "环号",notes = "") @ApiModelProperty(value = "环号",notes = "")
private Integer ringNo ; private Integer ringNo ;
/** 控制模式:1定周期;2绿灯;3黄灯;4红灯;5关灯;6绿闪;7黄闪;8红闪 */ /** 控制模式:1定周期;2绿灯;3黄灯;4红灯;5关灯;6绿闪;7黄闪;8红闪 */
@ApiModelProperty(name = "控制模式:1定周期;2绿灯;3黄灯;4红灯;5关灯;6绿闪;7黄闪;8红闪",notes = "") @ApiModelProperty(value = "控制模式:1定周期;2绿灯;3黄灯;4红灯;5关灯;6绿闪;7黄闪;8红闪",notes = "")
private Integer controlMode ; private Integer controlMode ;
/** 相位时间 */ /** 相位时间 */
@ApiModelProperty(name = "相位时间",notes = "") @ApiModelProperty(value = "相位时间",notes = "")
private Integer phaseTime ; private Integer phaseTime ;
/** 绿灯时间 */ /** 绿灯时间 */
@ApiModelProperty(name = "绿灯时间",notes = "") @ApiModelProperty(value = "绿灯时间",notes = "")
private Integer greenTime ; private Integer greenTime ;
/** 绿闪时间 */ /** 绿闪时间 */
@ApiModelProperty(name = "绿闪时间",notes = "") @ApiModelProperty(value = "绿闪时间",notes = "")
private Integer greenFlashTime ; private Integer greenFlashTime ;
/** 行闪时间 */ /** 行闪时间 */
@ApiModelProperty(name = "行闪时间",notes = "") @ApiModelProperty(value = "行闪时间",notes = "")
private Integer pedFlashTime ; private Integer pedFlashTime ;
/** 黄灯时间 */ /** 黄灯时间 */
@ApiModelProperty(name = "黄灯时间",notes = "") @ApiModelProperty(value = "黄灯时间",notes = "")
private Integer yellowTime ; private Integer yellowTime ;
/** 红灯时间 */ /** 红灯时间 */
@ApiModelProperty(name = "红灯时间",notes = "") @ApiModelProperty(value = "红灯时间",notes = "")
private Integer redTime ; private Integer redTime ;
/** 最小绿灯时间 */ /** 最小绿灯时间 */
@ApiModelProperty(name = "最小绿灯时间",notes = "") @ApiModelProperty(value = "最小绿灯时间",notes = "")
private Integer minGreenTime ; private Integer minGreenTime ;
/** 最大绿灯时间 */ /** 最大绿灯时间 */
@ApiModelProperty(name = "最大绿灯时间",notes = "") @ApiModelProperty(value = "最大绿灯时间",notes = "")
private Integer maxGreenTime ; private Integer maxGreenTime ;
/** 创建时间 */ /** 创建时间 */
@ApiModelProperty(name = "创建时间",notes = "") @ApiModelProperty(value = "创建时间",notes = "")
private Date gmtCreate ; private Date gmtCreate ;
/** 修改时间 */ /** 修改时间 */
@ApiModelProperty(name = "修改时间",notes = "") @ApiModelProperty(value = "修改时间",notes = "")
private Date gmtModified ; private Date gmtModified ;
} }
...@@ -12,21 +12,21 @@ import java.util.Date; ...@@ -12,21 +12,21 @@ import java.util.Date;
@Data @Data
public class CrossPlanPO { public class CrossPlanPO {
/** 计划ID */ /** 计划ID */
@ApiModelProperty(name = "计划ID",notes = "") @ApiModelProperty(value = "计划ID",notes = "")
private Integer id ; private Integer id ;
/** 计划号 */ /** 计划号 */
@ApiModelProperty(name = "计划号",notes = "") @ApiModelProperty(value = "计划号",notes = "")
private String planNo ; private String planNo ;
/** 计划名称 */ /** 计划名称 */
@ApiModelProperty(name = "计划名称",notes = "") @ApiModelProperty(value = "计划名称",notes = "")
private String name ; private String name ;
/** 路口ID */ /** 路口ID */
@ApiModelProperty(name = "路口ID",notes = "") @ApiModelProperty(value = "路口ID",notes = "")
private String crossId ; private String crossId ;
/** 创建时间 */ /** 创建时间 */
@ApiModelProperty(name = "创建时间",notes = "") @ApiModelProperty(value = "创建时间",notes = "")
private Date gmtCreate ; private Date gmtCreate ;
/** 修改时间 */ /** 修改时间 */
@ApiModelProperty(name = "修改时间",notes = "") @ApiModelProperty(value = "修改时间",notes = "")
private Date gmtModified ; private Date gmtModified ;
} }
...@@ -12,27 +12,27 @@ import java.util.Date; ...@@ -12,27 +12,27 @@ import java.util.Date;
@Data @Data
public class CrossSchedulesPO { public class CrossSchedulesPO {
/** 日期ID */ /** 日期ID */
@ApiModelProperty(name = "日期ID",notes = "") @ApiModelProperty(value = "日期ID",notes = "")
private Integer id ; private Integer id ;
/** 日期名称 */ /** 日期名称 */
@ApiModelProperty(name = "日期名称",notes = "") @ApiModelProperty(value = "日期名称",notes = "")
private String name ; private String name ;
/** 路口ID */ /** 路口ID */
@ApiModelProperty(name = "路口ID",notes = "") @ApiModelProperty(value = "路口ID",notes = "")
private String crossId ; private String crossId ;
/** 计划ID */ /** 计划ID */
@ApiModelProperty(name = "计划ID",notes = "") @ApiModelProperty(value = "计划ID",notes = "")
private Integer planId ; private Integer planId ;
/** 星期:1周一;2周二,3周三,4周四,5周五,6周六,7周日,0特殊日期 */ /** 星期:1周一;2周二,3周三,4周四,5周五,6周六,7周日,0特殊日期 */
@ApiModelProperty(name = "星期:1周一",notes = "2周二,3周三,4周四,5周五,6周六,7周日,0特殊日期") @ApiModelProperty(value = "星期:1周一",notes = "2周二,3周三,4周四,5周五,6周六,7周日,0特殊日期")
private Integer week ; private Integer week ;
/** 特殊日期 */ /** 特殊日期 */
@ApiModelProperty(name = "特殊日期",notes = "") @ApiModelProperty(value = "特殊日期",notes = "")
private Date specialDate ; private Date specialDate ;
/** 创建时间 */ /** 创建时间 */
@ApiModelProperty(name = "创建时间",notes = "") @ApiModelProperty(value = "创建时间",notes = "")
private Date gmtCreate ; private Date gmtCreate ;
/** 修改时间 */ /** 修改时间 */
@ApiModelProperty(name = "修改时间",notes = "") @ApiModelProperty(value = "修改时间",notes = "")
private Date gmtModified ; private Date gmtModified ;
} }
...@@ -12,36 +12,36 @@ import java.util.Date; ...@@ -12,36 +12,36 @@ import java.util.Date;
@Data @Data
public class CrossSchemePO { public class CrossSchemePO {
/** 方案ID */ /** 方案ID */
@ApiModelProperty(name = "方案ID",notes = "") @ApiModelProperty(value = "方案ID",notes = "")
private Integer id ; private Integer id ;
/** 方案号 */ /** 方案号 */
@ApiModelProperty(name = "方案号",notes = "") @ApiModelProperty(value = "方案号",notes = "")
private String schemeNo; private String schemeNo;
/** 方案名称 */ /** 方案名称 */
@ApiModelProperty(name = "方案名称",notes = "") @ApiModelProperty(value = "方案名称",notes = "")
private String name ; private String name ;
/** 路口ID */ /** 路口ID */
@ApiModelProperty(name = "路口ID",notes = "") @ApiModelProperty(value = "路口ID",notes = "")
private String crossId ; private String crossId ;
/** 周期 */ /** 周期 */
@ApiModelProperty(name = "周期",notes = "") @ApiModelProperty(value = "周期",notes = "")
private Integer cycle ; private Integer cycle ;
/** 协调相位ID */ /** 协调相位ID */
@ApiModelProperty(name = "协调相位ID",notes = "") @ApiModelProperty(value = "协调相位ID",notes = "")
private Integer coordPhase ; private Integer coordPhase ;
/** 相位差 */ /** 相位差 */
@ApiModelProperty(name = "相位差",notes = "") @ApiModelProperty(value = "相位差",notes = "")
private Integer offset ; private Integer offset ;
/** 数据来源:1信号机;2平台 */ /** 数据来源:1信号机;2平台 */
@ApiModelProperty(name = "数据来源:1信号机;2平台",notes = "") @ApiModelProperty(value = "数据来源:1信号机;2平台",notes = "")
private Integer source ; private Integer source ;
/** 删除标识:1删除;0未删除 */ /** 删除标识:1删除;0未删除 */
@ApiModelProperty(name = "删除标识:1删除;0未删除",notes = "") @ApiModelProperty(value = "删除标识:1删除;0未删除",notes = "")
private Integer isDeleted ; private Integer isDeleted ;
/** 创建时间 */ /** 创建时间 */
@ApiModelProperty(name = "创建时间",notes = "") @ApiModelProperty(value = "创建时间",notes = "")
private Date gmtCreate ; private Date gmtCreate ;
/** 修改时间 */ /** 修改时间 */
@ApiModelProperty(name = "修改时间",notes = "") @ApiModelProperty(value = "修改时间",notes = "")
private Date gmtModified ; private Date gmtModified ;
} }
...@@ -12,33 +12,33 @@ import java.util.Date; ...@@ -12,33 +12,33 @@ import java.util.Date;
@Data @Data
public class CrossSectionPO { public class CrossSectionPO {
/** 时段ID */ /** 时段ID */
@ApiModelProperty(name = "时段ID",notes = "") @ApiModelProperty(value = "时段ID",notes = "")
private Integer id ; private Integer id ;
/** 时段号 */ /** 时段号 */
@ApiModelProperty(name = "时段号",notes = "") @ApiModelProperty(value = "时段号",notes = "")
private String sectionNo ; private String sectionNo ;
/** 开始时间 */ /** 开始时间 */
@ApiModelProperty(name = "开始时间",notes = "") @ApiModelProperty(value = "开始时间",notes = "")
private String startTime ; private String startTime ;
/** 结束时间 */ /** 结束时间 */
@ApiModelProperty(name = "结束时间",notes = "") @ApiModelProperty(value = "结束时间",notes = "")
private String endTime ; private String endTime ;
/** 路口ID */ /** 路口ID */
@ApiModelProperty(name = "路口ID",notes = "") @ApiModelProperty(value = "路口ID",notes = "")
private String crossId ; private String crossId ;
/** 计划ID */ /** 计划ID */
@ApiModelProperty(name = "计划ID",notes = "") @ApiModelProperty(value = "计划ID",notes = "")
private Integer planId ; private Integer planId ;
/** 控制模式:1定周期;2绿波协调;3黄闪;4全红;5关灯;6单点自适应;7全感应;8半感应;9 */ /** 控制模式:1定周期;2绿波协调;3黄闪;4全红;5关灯;6单点自适应;7全感应;8半感应;9 */
@ApiModelProperty(name = "控制模式:1定周期;2绿波协调;3黄闪;4全红;5关灯;6单点自适应;7全感应;8半感应;9",notes = "") @ApiModelProperty(value = "控制模式:1定周期;2绿波协调;3黄闪;4全红;5关灯;6单点自适应;7全感应;8半感应;9",notes = "")
private Integer controlMode ; private Integer controlMode ;
/** 方案ID */ /** 方案ID */
@ApiModelProperty(name = "方案ID",notes = "") @ApiModelProperty(value = "方案ID",notes = "")
private Integer scemeId ; private Integer scemeId ;
/** 创建时间 */ /** 创建时间 */
@ApiModelProperty(name = "创建时间",notes = "") @ApiModelProperty(value = "创建时间",notes = "")
private Date gmtCreate ; private Date gmtCreate ;
/** 修改时间 */ /** 修改时间 */
@ApiModelProperty(name = "修改时间",notes = "") @ApiModelProperty(value = "修改时间",notes = "")
private Date gmtModified ; private Date gmtModified ;
} }
...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray; ...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.hikvision.artemis.sdk.ArtemisHttpUtil; import com.hikvision.artemis.sdk.ArtemisHttpUtil;
import com.hikvision.artemis.sdk.config.ArtemisConfig; import com.hikvision.artemis.sdk.config.ArtemisConfig;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.wanji.utc.common.baseentity.BaseCrossInfo; import net.wanji.utc.common.baseentity.BaseCrossInfo;
import net.wanji.utc.common.commonentity.HttpRequest; import net.wanji.utc.common.commonentity.HttpRequest;
...@@ -12,8 +13,11 @@ import net.wanji.utc.common.constant.Constants; ...@@ -12,8 +13,11 @@ import net.wanji.utc.common.constant.Constants;
import net.wanji.utc.common.typeenum.BasicEnum; import net.wanji.utc.common.typeenum.BasicEnum;
import net.wanji.utc.mapper.CrossInfoMapper; import net.wanji.utc.mapper.CrossInfoMapper;
import net.wanji.utc.mapper.CrossLightsMapper; import net.wanji.utc.mapper.CrossLightsMapper;
import net.wanji.utc.mapper.ManufacturerInfoMapper;
import net.wanji.utc.po.CrossLightsPO; import net.wanji.utc.po.CrossLightsPO;
import net.wanji.utc.po.ManufacturerInfoPO;
import net.wanji.utc.service.runninginfo.HkLightsStatusService; import net.wanji.utc.service.runninginfo.HkLightsStatusService;
import net.wanji.utc.util.PathUtil;
import net.wanji.utc.vo.LightsStatusVO; import net.wanji.utc.vo.LightsStatusVO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -30,22 +34,19 @@ import java.util.Map; ...@@ -30,22 +34,19 @@ import java.util.Map;
*/ */
@Service @Service
@Slf4j @Slf4j
@RequiredArgsConstructor
public class HkLightsStatusServiceImpl implements HkLightsStatusService { public class HkLightsStatusServiceImpl implements HkLightsStatusService {
@Value("${signal.manufacturer.hk.artemisPath}") private final ArtemisConfig artemisConfig;
private String artemisPath; private final CrossLightsMapper crossLightsMapper;
@Autowired private final CrossInfoMapper crossInfoMapper;
private ArtemisConfig artemisConfig; private final ManufacturerInfoMapper manufacturerInfoMapper;
@Autowired
private CrossLightsMapper crossLightsMapper;
@Autowired
CrossInfoMapper crossInfoMapper;
@Override @Override
public List<LightsStatusVO> getHkLightsStatus(List<BaseCrossInfo> baseCrossInfoList) { public List<LightsStatusVO> getHkLightsStatus(List<BaseCrossInfo> baseCrossInfoList) {
List<LightsStatusVO> result = new ArrayList<>(); List<LightsStatusVO> result = new ArrayList<>();
LightsStatusVO infoVo; LightsStatusVO infoVo;
try { try {
Map<String, String> path = getPathMapByApiCode("getRealtimeSchemeStateInfo"); Map<String, String> path = PathUtil.getPathMapByApiCode("getRealtimeSchemeStateInfo");
for (BaseCrossInfo entity : baseCrossInfoList) { for (BaseCrossInfo entity : baseCrossInfoList) {
JSONObject jsonBody = new JSONObject(); JSONObject jsonBody = new JSONObject();
jsonBody.put("pageNo", 1); jsonBody.put("pageNo", 1);
...@@ -58,8 +59,11 @@ public class HkLightsStatusServiceImpl implements HkLightsStatusService { ...@@ -58,8 +59,11 @@ public class HkLightsStatusServiceImpl implements HkLightsStatusService {
String strResult = ArtemisHttpUtil.doPostStringArtemis(artemisConfig, path, jsonBody.toJSONString(), String strResult = ArtemisHttpUtil.doPostStringArtemis(artemisConfig, path, jsonBody.toJSONString(),
null, null, "application/json", null); null, null, "application/json", null);
JSONObject object = JSON.parseObject(strResult); JSONObject object = JSON.parseObject(strResult);
ManufacturerInfoPO manufacturerInfoPO =
manufacturerInfoMapper.selectByCode(entity.getManufacturerCode());
String crossId = crossInfoMapper.selectIdByCode(entity.getCode()); String crossId = crossInfoMapper.selectIdByCodeAndManufacturerId(entity.getCode(),
manufacturerInfoPO.getId());
List<CrossLightsPO> crossLightsPOList = crossLightsMapper.selectByCrossId(crossId); List<CrossLightsPO> crossLightsPOList = crossLightsMapper.selectByCrossId(crossId);
if(Constants.HK_SUCCESS_CODE.equals(object.getInteger(Constants.HK_CODE_KEY))) { if(Constants.HK_SUCCESS_CODE.equals(object.getInteger(Constants.HK_CODE_KEY))) {
...@@ -156,11 +160,4 @@ public class HkLightsStatusServiceImpl implements HkLightsStatusService { ...@@ -156,11 +160,4 @@ public class HkLightsStatusServiceImpl implements HkLightsStatusService {
} }
return color; return color;
} }
private Map<String, String> getPathMapByApiCode(String apiCode) {
Map<String, String> res = new HashMap<>();
HttpRequest httpRequest = new HttpRequest(BasicEnum.ManufacturerEnum.HK.getCode(), apiCode);
res.put("http://", artemisPath + httpRequest.getUrl());
return res;
}
} }
package net.wanji.utc.service.staticinfo; package net.wanji.utc.service.staticinfo;
import net.wanji.utc.common.baseentity.BaseCrossInfo; import net.wanji.utc.dto.CrossInfoDTO;
import net.wanji.utc.common.genericentity.ManufacturerRes; import net.wanji.utc.dto.CrossSchedulesDTO;
import net.wanji.utc.common.genericentity.OutVO; import net.wanji.utc.po.CrossInfoPO;
import net.wanji.utc.vo.CrossSchedulesInVO; import net.wanji.utc.dto.PlanSectionDTO;
import net.wanji.utc.vo.DetailCrossInfoVO; import net.wanji.utc.dto.SchemePhaseLightsDTO;
import net.wanji.utc.vo.PlanSectionInVO; import net.wanji.utc.po.CrossSchedulesPO;
import net.wanji.utc.vo.SchemePhaseLightsInVO; import net.wanji.utc.vo.PlanSectionVO;
import net.wanji.utc.vo.SchemePhaseLightsVO;
import java.util.List;
public interface StaticInfoService { public interface StaticInfoService {
ManufacturerRes<DetailCrossInfoVO> crossBasicInfo(OutVO<BaseCrossInfo> outVO); List<CrossInfoPO> crossBasicInfo(CrossInfoDTO crossInfoDTO);
void schemePhaseLights(SchemePhaseLightsDTO schemePhaseLightsDTO) throws Exception;
void planSection(PlanSectionDTO planSectionDTO) throws Exception;
void crossSchedules(CrossSchedulesDTO crossSchedulesDTO) throws Exception;
SchemePhaseLightsVO buildSchemePhaseLightsResponse(SchemePhaseLightsDTO schemePhaseLightsDTO);
void schemePhaseLights(SchemePhaseLightsInVO schemePhaseLightsInVO) throws Exception; PlanSectionVO buildPlanSectionResponse(String crossId);
void planSection(PlanSectionInVO planSectionInVO) throws Exception; PlanSectionVO buildPlanSectionResponse(String crossId, Integer planNo);
void crossSchedules(CrossSchedulesInVO crossSchedulesInVO) throws Exception; List<CrossSchedulesPO> buildCrossSchedulesResponse(List<String> crossIdList);
} }
...@@ -6,15 +6,17 @@ import com.alibaba.fastjson.JSONArray; ...@@ -6,15 +6,17 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.hikvision.artemis.sdk.ArtemisHttpUtil; import com.hikvision.artemis.sdk.ArtemisHttpUtil;
import com.hikvision.artemis.sdk.config.ArtemisConfig; import com.hikvision.artemis.sdk.config.ArtemisConfig;
import lombok.RequiredArgsConstructor;
import net.wanji.utc.common.commonentity.HttpRequest; import net.wanji.utc.common.commonentity.HttpRequest;
import net.wanji.utc.common.constant.Constants; import net.wanji.utc.common.constant.Constants;
import net.wanji.utc.common.typeenum.BasicEnum; import net.wanji.utc.common.typeenum.BasicEnum;
import net.wanji.utc.mapper.CrossInfoMapper; import net.wanji.utc.mapper.CrossInfoMapper;
import net.wanji.utc.mapper.CrossPlanMapper; import net.wanji.utc.mapper.CrossPlanMapper;
import net.wanji.utc.mapper.CrossSchedulesMapper; import net.wanji.utc.mapper.CrossSchedulesMapper;
import net.wanji.utc.mapper.ManufacturerInfoMapper;
import net.wanji.utc.po.CrossSchedulesPO; import net.wanji.utc.po.CrossSchedulesPO;
import net.wanji.utc.po.ManufacturerInfoPO;
import net.wanji.utc.service.staticinfo.HkCrossSchedulesService; import net.wanji.utc.service.staticinfo.HkCrossSchedulesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -25,17 +27,15 @@ import java.util.*; ...@@ -25,17 +27,15 @@ import java.util.*;
* @date 2022/11/18 17:20 * @date 2022/11/18 17:20
*/ */
@Service @Service
@RequiredArgsConstructor
public class HkCrossSchedulesServiceImpl implements HkCrossSchedulesService { public class HkCrossSchedulesServiceImpl implements HkCrossSchedulesService {
@Value("${signal.manufacturer.hk.artemisPath}") @Value("${signal.manufacturer.hk.artemisPath}")
private String artemisPath; private String artemisPath;
@Autowired private final ArtemisConfig artemisConfig;
private ArtemisConfig artemisConfig; private final CrossInfoMapper crossInfoMapper;
@Autowired private final CrossPlanMapper crossPlanMapper;
CrossInfoMapper crossInfoMapper; private final CrossSchedulesMapper crossSchedulesMapper;
@Autowired private final ManufacturerInfoMapper manufacturerInfoMapper;
CrossPlanMapper crossPlanMapper;
@Autowired
CrossSchedulesMapper crossSchedulesMapper;
@Override @Override
public void crossSchedules(List<String> crossIdList) throws Exception { public void crossSchedules(List<String> crossIdList) throws Exception {
...@@ -53,7 +53,10 @@ public class HkCrossSchedulesServiceImpl implements HkCrossSchedulesService { ...@@ -53,7 +53,10 @@ public class HkCrossSchedulesServiceImpl implements HkCrossSchedulesService {
JSONObject dataEle = data.getJSONObject(i); JSONObject dataEle = data.getJSONObject(i);
JSONArray schedules = dataEle.getJSONArray("schedules"); JSONArray schedules = dataEle.getJSONArray("schedules");
String crossCode = dataEle.getString("crossCode"); String crossCode = dataEle.getString("crossCode");
String crossId = crossInfoMapper.selectIdByCode(crossCode); String code = BasicEnum.ManufacturerEnum.HK.getCode();
ManufacturerInfoPO manufacturerInfoPO = manufacturerInfoMapper.selectByCode(code);
Integer manufacturerId = manufacturerInfoPO.getId();
String crossId = crossInfoMapper.selectIdByCodeAndManufacturerId(crossCode, manufacturerId);
for (int j = 0; j < schedules.size(); j++) { for (int j = 0; j < schedules.size(); j++) {
JSONObject schedule = schedules.getJSONObject(j); JSONObject schedule = schedules.getJSONObject(j);
JSONArray weeks = schedule.getJSONArray("weeks"); JSONArray weeks = schedule.getJSONArray("weeks");
......
package net.wanji.utc.service.staticinfo.impl; package net.wanji.utc.service.staticinfo.impl;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import net.wanji.utc.common.genericentity.ManufacturerRes;
import net.wanji.utc.common.typeenum.BasicEnum; import net.wanji.utc.common.typeenum.BasicEnum;
import net.wanji.utc.mapper.CrossInfoMapper; import net.wanji.utc.dto.CrossInfoDTO;
import net.wanji.utc.mapper.ManufacturerInfoMapper; import net.wanji.utc.mapper.*;
import net.wanji.utc.po.CrossInfoPO; import net.wanji.utc.po.*;
import net.wanji.utc.po.ManufacturerInfoPO;
import net.wanji.utc.common.baseentity.BaseCrossInfo;
import net.wanji.utc.common.genericentity.OutVO;
import net.wanji.utc.service.staticinfo.*; import net.wanji.utc.service.staticinfo.*;
import net.wanji.utc.util.ListUtil; import net.wanji.utc.dto.CrossSchedulesDTO;
import net.wanji.utc.vo.CrossSchedulesInVO; import net.wanji.utc.dto.PlanSectionDTO;
import net.wanji.utc.vo.DetailCrossInfoVO; import net.wanji.utc.dto.SchemePhaseLightsDTO;
import net.wanji.utc.vo.PlanSectionInVO; import net.wanji.utc.vo.PlanSectionVO;
import net.wanji.utc.vo.SchemePhaseLightsInVO; import net.wanji.utc.vo.SchemePhaseLightsVO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -30,79 +26,59 @@ import java.util.Objects; ...@@ -30,79 +26,59 @@ import java.util.Objects;
@RequiredArgsConstructor @RequiredArgsConstructor
public class StaticInfoServiceImpl implements StaticInfoService { public class StaticInfoServiceImpl implements StaticInfoService {
private final HkCrossInfoService hkCrossInfoService; private final HkCrossInfoService hkCrossInfoService;
@Autowired private final CrossInfoMapper crossInfoMapper;
CrossInfoMapper crossInfoMapper; private final OthersStaticInfoService othersStaticInfoService;
@Autowired private final ManufacturerInfoMapper manufacturerInfoMapper;
OthersStaticInfoService othersStaticInfoService; private final HkSchemePhaseLightsService hkSchemePhaseLightsService;
@Autowired private final HkPlanSectionService hkPlanSectionService;
ManufacturerInfoMapper manufacturerInfoMapper; private final HkCrossSchedulesService hkCrossSchedulesService;
@Autowired private final CrossSchemeMapper crossSchemeMapper;
HkSchemePhaseLightsService hkSchemePhaseLightsService; private final CrossPhaseMapper crossPhaseMapper;
@Autowired private final CrossLightsMapper crossLightsMapper;
HkPlanSectionService hkPlanSectionService; private final CrossPlanMapper crossPlanMapper;
@Autowired private final CrossSectionMapper crossSectionMapper;
HkCrossSchedulesService hkCrossSchedulesService; private final CrossSchedulesMapper crossSchedulesMapper;
@Override @Override
public ManufacturerRes<DetailCrossInfoVO> crossBasicInfo(OutVO<BaseCrossInfo> outVO) { public List<CrossInfoPO> crossBasicInfo(CrossInfoDTO crossInfoDTO) {
List<CrossInfoPO> crossInfoPOList = new ArrayList<>(); List<CrossInfoPO> crossInfoPOList = new ArrayList<>();
ManufacturerRes<DetailCrossInfoVO> res = new ManufacturerRes<>(); if (Objects.equals(BasicEnum.ManufacturerEnum.HK.getCode(), crossInfoDTO.getManufacturerCode())) {
if (Objects.equals(BasicEnum.ManufacturerEnum.HK.getCode(), outVO.getManufacturerCode())) {
crossInfoPOList = hkCrossInfoService.hkCrossBasicInfo(); crossInfoPOList = hkCrossInfoService.hkCrossBasicInfo();
} else { } else {
// todo 其他厂商 // todo 其他厂商
res = othersStaticInfoService.crossBasicInfo(outVO.getManufacturerCode());
if (null == res) {
return null;
}
List<DetailCrossInfoVO> dataContent = res.getDatalist();
if (ListUtil.isEmpty(dataContent)) {
return null;
}
for (DetailCrossInfoVO vo : dataContent) {
String id = vo.getCode();
CrossInfoPO crossInfoPO = crossInfoMapper.selectByPrimaryKey(id);
if (null != crossInfoPO) {
continue;
}
crossInfoPO = new CrossInfoPO();
// 用信号机ID作为路口ID
crossInfoPO.setId(id);
crossInfoPO.setName(vo.getCrossName());
crossInfoPO.setCode(id);
ManufacturerInfoPO manufacturerInfoPO = manufacturerInfoMapper.selectByCode(vo.getManufacturerCode());
if (manufacturerInfoPO != null) {
crossInfoPO.setManufacturerId(manufacturerInfoPO.getId());
}
crossInfoPO.setIp(vo.getIp());
crossInfoPO.setPort(vo.getPort());
// 经纬度
Double longitude = vo.getLon();
Double latitude = vo.getLat();
crossInfoPO.setLocation(longitude + "," + latitude);
crossInfoPO.setVersion(vo.getVersion());
crossInfoPO.setModel(vo.getModel());
crossInfoPO.setInstallTime(vo.getInstallTime());
crossInfoPOList.add(crossInfoPO);
}
} }
//存储信号机信息 //存储信号机信息
if (crossInfoPOList.size() == 0) { if (crossInfoPOList.size() == 0) {
return null; return null;
} }
crossInfoMapper.insertBatch(crossInfoPOList); for (CrossInfoPO crossInfoPO : crossInfoPOList) {
return res; String code = crossInfoPO.getCode();
Integer manufacturerId = crossInfoPO.getManufacturerId();
String id = crossInfoMapper.selectIdByCodeAndManufacturerId(code, manufacturerId);
if (id != null) {
// 如果有记录,则更新
crossInfoMapper.updateOneByCodeAndManufacturerId(crossInfoPO);
} else {
// 如果无记录,则新增
crossInfoMapper.insertOne(crossInfoPO);
}
}
String manufacturerCode = crossInfoDTO.getManufacturerCode();
ManufacturerInfoPO manufacturerInfoPO = manufacturerInfoMapper.selectByCode(manufacturerCode);
Integer manufacturerId = manufacturerInfoPO.getId();
crossInfoPOList = crossInfoMapper.selectByManufacturerId(manufacturerId);
return crossInfoPOList;
} }
@Override @Override
public void schemePhaseLights(SchemePhaseLightsInVO schemePhaseLightsInVO) throws Exception { public void schemePhaseLights(SchemePhaseLightsDTO schemePhaseLightsDTO) throws Exception {
String crossId = schemePhaseLightsInVO.getCrossId(); String crossId = schemePhaseLightsDTO.getCrossId();
// 获取厂商ID和信号机ID // 获取厂商ID和信号机ID
CrossInfoPO crossInfoPO = crossInfoMapper.selectByPrimaryKey(crossId); CrossInfoPO crossInfoPO = crossInfoMapper.selectByPrimaryKey(crossId);
String crossCode = crossInfoPO.getCode(); String crossCode = crossInfoPO.getCode();
Integer manufacturerId = crossInfoPO.getManufacturerId(); Integer manufacturerId = crossInfoPO.getManufacturerId();
// 获取厂商缩写 // 获取厂商代码
ManufacturerInfoPO manufacturerInfoPO = manufacturerInfoMapper.selectById(manufacturerId); ManufacturerInfoPO manufacturerInfoPO = manufacturerInfoMapper.selectById(manufacturerId);
String manufacturerCode = manufacturerInfoPO.getCode(); String manufacturerCode = manufacturerInfoPO.getCode();
if (Objects.equals(BasicEnum.ManufacturerEnum.HK.getCode(), manufacturerCode)) { if (Objects.equals(BasicEnum.ManufacturerEnum.HK.getCode(), manufacturerCode)) {
...@@ -114,16 +90,16 @@ public class StaticInfoServiceImpl implements StaticInfoService { ...@@ -114,16 +90,16 @@ public class StaticInfoServiceImpl implements StaticInfoService {
} }
@Override @Override
public void planSection(PlanSectionInVO planSectionInVO) throws Exception { public void planSection(PlanSectionDTO planSectionDTO) throws Exception {
String crossId = planSectionInVO.getCrossId(); String crossId = planSectionDTO.getCrossId();
// 获取厂商ID和信号机ID // 获取厂商ID和信号机ID
CrossInfoPO crossInfoPO = crossInfoMapper.selectByPrimaryKey(crossId); CrossInfoPO crossInfoPO = crossInfoMapper.selectByPrimaryKey(crossId);
String crossCode = crossInfoPO.getCode(); String crossCode = crossInfoPO.getCode();
Integer manufacturerId = crossInfoPO.getManufacturerId(); Integer manufacturerId = crossInfoPO.getManufacturerId();
// 获取厂商缩写 // 获取厂商代码
ManufacturerInfoPO manufacturerInfoPO = manufacturerInfoMapper.selectById(manufacturerId); ManufacturerInfoPO manufacturerInfoPO = manufacturerInfoMapper.selectById(manufacturerId);
String manufacturerCode = manufacturerInfoPO.getCode(); String manufacturerCode = manufacturerInfoPO.getCode();
Integer planNo = planSectionInVO.getPlanNo(); Integer planNo = planSectionDTO.getPlanNo();
if (Objects.equals(BasicEnum.ManufacturerEnum.HK.getCode(), manufacturerCode)) { if (Objects.equals(BasicEnum.ManufacturerEnum.HK.getCode(), manufacturerCode)) {
// 海康 // 海康
hkPlanSectionService.planSection(crossCode, planNo, crossId); hkPlanSectionService.planSection(crossCode, planNo, crossId);
...@@ -133,9 +109,9 @@ public class StaticInfoServiceImpl implements StaticInfoService { ...@@ -133,9 +109,9 @@ public class StaticInfoServiceImpl implements StaticInfoService {
} }
@Override @Override
public void crossSchedules(CrossSchedulesInVO crossSchedulesInVO) throws Exception { public void crossSchedules(CrossSchedulesDTO crossSchedulesDTO) throws Exception {
String manufacturerCode = crossSchedulesInVO.getManufacturerCode(); String manufacturerCode = crossSchedulesDTO.getManufacturerCode();
List<String> crossIdList = crossSchedulesInVO.getCrossIdList(); List<String> crossIdList = crossSchedulesDTO.getCrossIdList();
if (Objects.equals(BasicEnum.ManufacturerEnum.HK.getCode(), manufacturerCode)) { if (Objects.equals(BasicEnum.ManufacturerEnum.HK.getCode(), manufacturerCode)) {
// 海康 // 海康
hkCrossSchedulesService.crossSchedules(crossIdList); hkCrossSchedulesService.crossSchedules(crossIdList);
...@@ -144,4 +120,50 @@ public class StaticInfoServiceImpl implements StaticInfoService { ...@@ -144,4 +120,50 @@ public class StaticInfoServiceImpl implements StaticInfoService {
} }
} }
@Override
public SchemePhaseLightsVO buildSchemePhaseLightsResponse(SchemePhaseLightsDTO schemePhaseLightsDTO) {
String crossId = schemePhaseLightsDTO.getCrossId();
List<CrossSchemePO> crossSchemePOList = crossSchemeMapper.selectByCrossId(crossId);
List<CrossPhasePO> crossPhasePOList = crossPhaseMapper.selectByCrossId(crossId);
List<CrossLightsPO> crossLightsPOList = crossLightsMapper.selectByCrossId(crossId);
SchemePhaseLightsVO schemePhaseLightsVO = new SchemePhaseLightsVO();
schemePhaseLightsVO.setCrossSchemeList(crossSchemePOList);
schemePhaseLightsVO.setCrossPhaseList(crossPhasePOList);
schemePhaseLightsVO.setCrossLightsList(crossLightsPOList);
return schemePhaseLightsVO;
}
@Override
public PlanSectionVO buildPlanSectionResponse(String crossId) {
List<CrossPlanPO> crossPlanPOList = crossPlanMapper.selectByCrossId(crossId);
List<CrossSectionPO> crossSectionPOList = crossSectionMapper.selectByCrossId(crossId);
PlanSectionVO planSectionVO = new PlanSectionVO();
planSectionVO.setCrossPlanPOList(crossPlanPOList);
planSectionVO.setCrossSectionPOList(crossSectionPOList);
return planSectionVO;
}
@Override
public PlanSectionVO buildPlanSectionResponse(String crossId, Integer planNo) {
List<CrossPlanPO> crossPlanPOList = crossPlanMapper.selectByCrossIdAndPlanNo(crossId, planNo);
Integer planId = crossPlanMapper.selectIdByNo(crossId, planNo);
List<CrossSectionPO> crossSectionPOList = crossSectionMapper.selectByCrossIdAndPlanId(crossId, planId);
PlanSectionVO planSectionVO = new PlanSectionVO();
planSectionVO.setCrossPlanPOList(crossPlanPOList);
planSectionVO.setCrossSectionPOList(crossSectionPOList);
return planSectionVO;
}
@Override
public List<CrossSchedulesPO> buildCrossSchedulesResponse(List<String> crossIdList) {
List<CrossSchedulesPO> crossSchedulesPOList = crossSchedulesMapper.selectByCrossIds(crossIdList);
return crossSchedulesPOList;
}
} }
package net.wanji.utc.service.systemadmin; package net.wanji.utc.service.systemadmin;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import net.wanji.utc.vo.systemadmin.CrossInfoInsertOrUpdateInVO; import net.wanji.utc.dto.systemadmin.CrossInfoInsertOrUpdateDTO;
import net.wanji.utc.vo.systemadmin.CrossInfoListInVO; import net.wanji.utc.dto.systemadmin.CrossInfoListDTO;
import net.wanji.utc.vo.systemadmin.CrossInfoListOutVO; import net.wanji.utc.vo.systemadmin.CrossInfoListVO;
import net.wanji.utc.vo.systemadmin.DeleteByStringIdListInVO; import net.wanji.utc.dto.systemadmin.DeleteByStringIdListDTO;
/** /**
* @author Kent HAN * @author Kent HAN
* @date 2022/11/25 8:54 * @date 2022/11/25 8:54
*/ */
public interface CrossInfoService { public interface CrossInfoService {
PageInfo<CrossInfoListOutVO> list(CrossInfoListInVO crossInfoListInVO); PageInfo<CrossInfoListVO> list(CrossInfoListDTO crossInfoListDTO);
void insertOrUpdate(CrossInfoInsertOrUpdateInVO inVO); void insertOrUpdate(CrossInfoInsertOrUpdateDTO inVO);
void delete(DeleteByStringIdListInVO inVO); void delete(DeleteByStringIdListDTO inVO);
} }
package net.wanji.utc.service.systemadmin; package net.wanji.utc.service.systemadmin;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import net.wanji.utc.vo.systemadmin.DeleteByIntegerIdListInVO; import net.wanji.utc.dto.systemadmin.DeleteByIntegerIdListDTO;
import net.wanji.utc.vo.systemadmin.ManufacturerApiInfoInsertOrUpdateInVO; import net.wanji.utc.dto.systemadmin.ManufacturerApiInfoInsertOrUpdateDTO;
import net.wanji.utc.vo.systemadmin.ManufacturerApiInfoListInVO; import net.wanji.utc.dto.systemadmin.ManufacturerApiInfoListDTO;
import net.wanji.utc.vo.systemadmin.ManufacturerApiInfoOutVO; import net.wanji.utc.vo.systemadmin.ManufacturerApiInfoVO;
/** /**
* @author Kent HAN * @author Kent HAN
* @date 2022/11/24 13:59 * @date 2022/11/24 13:59
*/ */
public interface ManufacturerApiInfoService { public interface ManufacturerApiInfoService {
PageInfo<ManufacturerApiInfoOutVO> list(ManufacturerApiInfoListInVO manufacturerApiInfoListInVO); PageInfo<ManufacturerApiInfoVO> list(ManufacturerApiInfoListDTO manufacturerApiInfoListDTO);
void insertOrUpdate(ManufacturerApiInfoInsertOrUpdateInVO inVO); void insertOrUpdate(ManufacturerApiInfoInsertOrUpdateDTO inVO);
void delete(DeleteByIntegerIdListInVO inVO); void delete(DeleteByIntegerIdListDTO inVO);
} }
package net.wanji.utc.service.systemadmin; package net.wanji.utc.service.systemadmin;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import net.wanji.utc.dto.systemadmin.DeleteByIntegerIdListDTO;
import net.wanji.utc.po.ManufacturerInfoPO; import net.wanji.utc.po.ManufacturerInfoPO;
import net.wanji.utc.vo.systemadmin.DeleteByIntegerIdListInVO; import net.wanji.utc.dto.systemadmin.ManufacturerInsertOrUpdateDTO;
import net.wanji.utc.vo.systemadmin.ManufacturerInsertOrUpdateInVO; import net.wanji.utc.dto.systemadmin.ManufacturerListDTO;
import net.wanji.utc.vo.systemadmin.ManufacturerListInVO;
/** /**
* @author Kent HAN * @author Kent HAN
* @date 2022/11/24 8:49 * @date 2022/11/24 8:49
*/ */
public interface ManufacturerService { public interface ManufacturerService {
PageInfo<ManufacturerInfoPO> list(ManufacturerListInVO manufacturerListInVO); PageInfo<ManufacturerInfoPO> list(ManufacturerListDTO manufacturerListDTO);
void insertOrUpdate(ManufacturerInsertOrUpdateInVO inVO); void insertOrUpdate(ManufacturerInsertOrUpdateDTO inVO);
void delete(DeleteByIntegerIdListInVO inVO); void delete(DeleteByIntegerIdListDTO inVO);
} }
...@@ -6,16 +6,16 @@ import com.github.pagehelper.PageHelper; ...@@ -6,16 +6,16 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import net.wanji.utc.common.exception.IpPortException; import net.wanji.utc.common.exception.IpPortException;
import net.wanji.utc.common.exception.PortFormatException; import net.wanji.utc.common.exception.PortFormatException;
import net.wanji.utc.dto.systemadmin.CrossInfoInsertOrUpdateDTO;
import net.wanji.utc.dto.systemadmin.CrossInfoListDTO;
import net.wanji.utc.mapper.CrossInfoMapper; import net.wanji.utc.mapper.CrossInfoMapper;
import net.wanji.utc.mapper.ManufacturerInfoMapper; import net.wanji.utc.mapper.ManufacturerInfoMapper;
import net.wanji.utc.po.CrossInfoPO; import net.wanji.utc.po.CrossInfoPO;
import net.wanji.utc.po.ManufacturerInfoPO; import net.wanji.utc.po.ManufacturerInfoPO;
import net.wanji.utc.service.systemadmin.CrossInfoService; import net.wanji.utc.service.systemadmin.CrossInfoService;
import net.wanji.utc.util.PageUtils; import net.wanji.utc.util.PageUtils;
import net.wanji.utc.vo.systemadmin.CrossInfoInsertOrUpdateInVO; import net.wanji.utc.vo.systemadmin.CrossInfoListVO;
import net.wanji.utc.vo.systemadmin.CrossInfoListInVO; import net.wanji.utc.dto.systemadmin.DeleteByStringIdListDTO;
import net.wanji.utc.vo.systemadmin.CrossInfoListOutVO;
import net.wanji.utc.vo.systemadmin.DeleteByStringIdListInVO;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -35,13 +35,13 @@ public class CrossInfoServiceImpl implements CrossInfoService { ...@@ -35,13 +35,13 @@ public class CrossInfoServiceImpl implements CrossInfoService {
CrossInfoMapper crossInfoMapper; CrossInfoMapper crossInfoMapper;
@Override @Override
public PageInfo<CrossInfoListOutVO> list(CrossInfoListInVO crossInfoListInVO) { public PageInfo<CrossInfoListVO> list(CrossInfoListDTO crossInfoListDTO) {
Integer pageNum = crossInfoListInVO.getPageNum(); Integer pageNum = crossInfoListDTO.getPageNum();
Integer pageSize = crossInfoListInVO.getPageSize(); Integer pageSize = crossInfoListDTO.getPageSize();
String crossName = crossInfoListInVO.getCrossName(); String crossName = crossInfoListDTO.getCrossName();
String manufacturerNick = crossInfoListInVO.getManufacturerNick(); String manufacturerNick = crossInfoListDTO.getManufacturerNick();
Integer manufacturerId = null; Integer manufacturerId = null;
if (manufacturerNick != null) { if (manufacturerNick != null) {
manufacturerId = manufacturerInfoMapper.selectIdByNick(manufacturerNick); manufacturerId = manufacturerInfoMapper.selectIdByNick(manufacturerNick);
...@@ -51,22 +51,22 @@ public class CrossInfoServiceImpl implements CrossInfoService { ...@@ -51,22 +51,22 @@ public class CrossInfoServiceImpl implements CrossInfoService {
List<CrossInfoPO> crossInfoPOList = crossInfoMapper.selectByOptionals(crossName, manufacturerId); List<CrossInfoPO> crossInfoPOList = crossInfoMapper.selectByOptionals(crossName, manufacturerId);
PageInfo<CrossInfoPO> crossInfoPOPageInfo = new PageInfo<>(crossInfoPOList); PageInfo<CrossInfoPO> crossInfoPOPageInfo = new PageInfo<>(crossInfoPOList);
// 转换为VO类型的PageInfo对象 // 转换为VO类型的PageInfo对象
PageInfo<CrossInfoListOutVO> crossInfoListOutVOPageInfo = PageUtils.PageInfo2PageInfoVo(crossInfoPOPageInfo); PageInfo<CrossInfoListVO> crossInfoListOutVOPageInfo = PageUtils.PageInfo2PageInfoVo(crossInfoPOPageInfo);
for (CrossInfoPO crossInfoPO : crossInfoPOList) { for (CrossInfoPO crossInfoPO : crossInfoPOList) {
CrossInfoListOutVO crossInfoListOutVO = new CrossInfoListOutVO(); CrossInfoListVO crossInfoListVO = new CrossInfoListVO();
BeanUtils.copyProperties(crossInfoPO, crossInfoListOutVO); BeanUtils.copyProperties(crossInfoPO, crossInfoListVO);
Integer manufacturerIdInPage = crossInfoPO.getManufacturerId(); Integer manufacturerIdInPage = crossInfoPO.getManufacturerId();
ManufacturerInfoPO manufacturerInfoPO = manufacturerInfoMapper.selectById(manufacturerIdInPage); ManufacturerInfoPO manufacturerInfoPO = manufacturerInfoMapper.selectById(manufacturerIdInPage);
String nickName = manufacturerInfoPO.getNickName(); String nickName = manufacturerInfoPO.getNickName();
crossInfoListOutVO.setManufacturerNick(nickName); crossInfoListVO.setManufacturerNick(nickName);
crossInfoListOutVOPageInfo.getList().add(crossInfoListOutVO); crossInfoListOutVOPageInfo.getList().add(crossInfoListVO);
} }
return crossInfoListOutVOPageInfo; return crossInfoListOutVOPageInfo;
} }
@Override @Override
public void insertOrUpdate(CrossInfoInsertOrUpdateInVO inVO) { public void insertOrUpdate(CrossInfoInsertOrUpdateDTO inVO) {
CrossInfoPO crossInfoPO = new CrossInfoPO(); CrossInfoPO crossInfoPO = new CrossInfoPO();
BeanUtils.copyProperties(inVO, crossInfoPO); BeanUtils.copyProperties(inVO, crossInfoPO);
...@@ -108,7 +108,7 @@ public class CrossInfoServiceImpl implements CrossInfoService { ...@@ -108,7 +108,7 @@ public class CrossInfoServiceImpl implements CrossInfoService {
} }
@Override @Override
public void delete(DeleteByStringIdListInVO inVO) { public void delete(DeleteByStringIdListDTO inVO) {
List<String> ids = inVO.getIds(); List<String> ids = inVO.getIds();
crossInfoMapper.deleteBatch(ids); crossInfoMapper.deleteBatch(ids);
} }
......
...@@ -2,17 +2,16 @@ package net.wanji.utc.service.systemadmin.impl; ...@@ -2,17 +2,16 @@ package net.wanji.utc.service.systemadmin.impl;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import net.wanji.utc.common.typeenum.BasicEnum;
import net.wanji.utc.common.typeenum.ManufacturerApiInfoTypeEnum; import net.wanji.utc.common.typeenum.ManufacturerApiInfoTypeEnum;
import net.wanji.utc.dto.systemadmin.ManufacturerApiInfoInsertOrUpdateDTO;
import net.wanji.utc.mapper.ManufacturerApiInfoMapper; import net.wanji.utc.mapper.ManufacturerApiInfoMapper;
import net.wanji.utc.mapper.ManufacturerInfoMapper; import net.wanji.utc.mapper.ManufacturerInfoMapper;
import net.wanji.utc.po.ManufacturerApiInfoPO; import net.wanji.utc.po.ManufacturerApiInfoPO;
import net.wanji.utc.service.systemadmin.ManufacturerApiInfoService; import net.wanji.utc.service.systemadmin.ManufacturerApiInfoService;
import net.wanji.utc.util.PageUtils; import net.wanji.utc.util.PageUtils;
import net.wanji.utc.vo.systemadmin.DeleteByIntegerIdListInVO; import net.wanji.utc.dto.systemadmin.DeleteByIntegerIdListDTO;
import net.wanji.utc.vo.systemadmin.ManufacturerApiInfoInsertOrUpdateInVO; import net.wanji.utc.dto.systemadmin.ManufacturerApiInfoListDTO;
import net.wanji.utc.vo.systemadmin.ManufacturerApiInfoListInVO; import net.wanji.utc.vo.systemadmin.ManufacturerApiInfoVO;
import net.wanji.utc.vo.systemadmin.ManufacturerApiInfoOutVO;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -31,19 +30,19 @@ public class ManufacturerApiInfoServiceImpl implements ManufacturerApiInfoServic ...@@ -31,19 +30,19 @@ public class ManufacturerApiInfoServiceImpl implements ManufacturerApiInfoServic
ManufacturerInfoMapper manufacturerInfoMapper; ManufacturerInfoMapper manufacturerInfoMapper;
@Override @Override
public PageInfo<ManufacturerApiInfoOutVO> list(ManufacturerApiInfoListInVO manufacturerApiInfoListInVO) { public PageInfo<ManufacturerApiInfoVO> list(ManufacturerApiInfoListDTO manufacturerApiInfoListDTO) {
Integer pageNum = manufacturerApiInfoListInVO.getPageNum(); Integer pageNum = manufacturerApiInfoListDTO.getPageNum();
Integer pageSize = manufacturerApiInfoListInVO.getPageSize(); Integer pageSize = manufacturerApiInfoListDTO.getPageSize();
String name = manufacturerApiInfoListInVO.getName(); String name = manufacturerApiInfoListDTO.getName();
String typeStr = manufacturerApiInfoListInVO.getTypeStr(); String typeStr = manufacturerApiInfoListDTO.getTypeStr();
Integer typeCode = null; Integer typeCode = null;
if (typeStr != null) { if (typeStr != null) {
typeCode = ManufacturerApiInfoTypeEnum.getCodeByMsg(typeStr); typeCode = ManufacturerApiInfoTypeEnum.getCodeByMsg(typeStr);
} }
String manufacturerNick = manufacturerApiInfoListInVO.getManufacturerNick(); String manufacturerNick = manufacturerApiInfoListDTO.getManufacturerNick();
Integer manufacturerId = null; Integer manufacturerId = null;
if (manufacturerNick != null) { if (manufacturerNick != null) {
manufacturerId = manufacturerInfoMapper.selectIdByNick(manufacturerNick); manufacturerId = manufacturerInfoMapper.selectIdByNick(manufacturerNick);
...@@ -54,26 +53,26 @@ public class ManufacturerApiInfoServiceImpl implements ManufacturerApiInfoServic ...@@ -54,26 +53,26 @@ public class ManufacturerApiInfoServiceImpl implements ManufacturerApiInfoServic
name, typeCode, manufacturerId); name, typeCode, manufacturerId);
PageInfo<ManufacturerApiInfoPO> manufacturerApiInfoPOPageInfo = new PageInfo<>(manufacturerApiInfoPOList); PageInfo<ManufacturerApiInfoPO> manufacturerApiInfoPOPageInfo = new PageInfo<>(manufacturerApiInfoPOList);
// 转换为VO类型的PageInfo对象 // 转换为VO类型的PageInfo对象
PageInfo<ManufacturerApiInfoOutVO> manufacturerApiInfoOutVOPageInfo = PageInfo<ManufacturerApiInfoVO> manufacturerApiInfoOutVOPageInfo =
PageUtils.PageInfo2PageInfoVo(manufacturerApiInfoPOPageInfo); PageUtils.PageInfo2PageInfoVo(manufacturerApiInfoPOPageInfo);
for (ManufacturerApiInfoPO manufacturerApiInfoPO : manufacturerApiInfoPOList) { for (ManufacturerApiInfoPO manufacturerApiInfoPO : manufacturerApiInfoPOList) {
ManufacturerApiInfoOutVO manufacturerApiInfoOutVO = new ManufacturerApiInfoOutVO(); ManufacturerApiInfoVO manufacturerApiInfoVO = new ManufacturerApiInfoVO();
BeanUtils.copyProperties(manufacturerApiInfoPO, manufacturerApiInfoOutVO); BeanUtils.copyProperties(manufacturerApiInfoPO, manufacturerApiInfoVO);
Integer type = manufacturerApiInfoPO.getType(); Integer type = manufacturerApiInfoPO.getType();
String apiType = ManufacturerApiInfoTypeEnum.getMsgByCode(type); String apiType = ManufacturerApiInfoTypeEnum.getMsgByCode(type);
manufacturerApiInfoOutVO.setApiType(apiType); manufacturerApiInfoVO.setApiType(apiType);
// 转换厂商简称 // 转换厂商简称
Integer manufacturerId1 = manufacturerApiInfoPO.getManufacturerId(); Integer manufacturerId1 = manufacturerApiInfoPO.getManufacturerId();
String manufacturerNick1 = manufacturerInfoMapper.selectNickById(manufacturerId1); String manufacturerNick1 = manufacturerInfoMapper.selectNickById(manufacturerId1);
manufacturerApiInfoOutVO.setManufacturerNick(manufacturerNick1); manufacturerApiInfoVO.setManufacturerNick(manufacturerNick1);
manufacturerApiInfoOutVOPageInfo.getList().add(manufacturerApiInfoOutVO); manufacturerApiInfoOutVOPageInfo.getList().add(manufacturerApiInfoVO);
} }
return manufacturerApiInfoOutVOPageInfo; return manufacturerApiInfoOutVOPageInfo;
} }
@Override @Override
public void insertOrUpdate(ManufacturerApiInfoInsertOrUpdateInVO inVO) { public void insertOrUpdate(ManufacturerApiInfoInsertOrUpdateDTO inVO) {
ManufacturerApiInfoPO manufacturerApiInfoPO = new ManufacturerApiInfoPO(); ManufacturerApiInfoPO manufacturerApiInfoPO = new ManufacturerApiInfoPO();
BeanUtils.copyProperties(inVO, manufacturerApiInfoPO); BeanUtils.copyProperties(inVO, manufacturerApiInfoPO);
String typeStr = inVO.getApiType(); String typeStr = inVO.getApiType();
...@@ -94,7 +93,7 @@ public class ManufacturerApiInfoServiceImpl implements ManufacturerApiInfoServic ...@@ -94,7 +93,7 @@ public class ManufacturerApiInfoServiceImpl implements ManufacturerApiInfoServic
} }
@Override @Override
public void delete(DeleteByIntegerIdListInVO inVO) { public void delete(DeleteByIntegerIdListDTO inVO) {
List<Integer> ids = inVO.getIds(); List<Integer> ids = inVO.getIds();
manufacturerApiInfoMapper.deleteBatch(ids); manufacturerApiInfoMapper.deleteBatch(ids);
} }
......
...@@ -2,12 +2,12 @@ package net.wanji.utc.service.systemadmin.impl; ...@@ -2,12 +2,12 @@ package net.wanji.utc.service.systemadmin.impl;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import net.wanji.utc.dto.systemadmin.DeleteByIntegerIdListDTO;
import net.wanji.utc.dto.systemadmin.ManufacturerInsertOrUpdateDTO;
import net.wanji.utc.mapper.ManufacturerInfoMapper; import net.wanji.utc.mapper.ManufacturerInfoMapper;
import net.wanji.utc.po.ManufacturerInfoPO; import net.wanji.utc.po.ManufacturerInfoPO;
import net.wanji.utc.service.systemadmin.ManufacturerService; import net.wanji.utc.service.systemadmin.ManufacturerService;
import net.wanji.utc.vo.systemadmin.DeleteByIntegerIdListInVO; import net.wanji.utc.dto.systemadmin.ManufacturerListDTO;
import net.wanji.utc.vo.systemadmin.ManufacturerInsertOrUpdateInVO;
import net.wanji.utc.vo.systemadmin.ManufacturerListInVO;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -24,10 +24,10 @@ public class ManufacturerServiceImpl implements ManufacturerService { ...@@ -24,10 +24,10 @@ public class ManufacturerServiceImpl implements ManufacturerService {
ManufacturerInfoMapper manufacturerInfoMapper; ManufacturerInfoMapper manufacturerInfoMapper;
@Override @Override
public PageInfo<ManufacturerInfoPO> list(ManufacturerListInVO manufacturerListInVO) { public PageInfo<ManufacturerInfoPO> list(ManufacturerListDTO manufacturerListDTO) {
Integer pageNum = manufacturerListInVO.getPageNum(); Integer pageNum = manufacturerListDTO.getPageNum();
Integer pageSize = manufacturerListInVO.getPageSize(); Integer pageSize = manufacturerListDTO.getPageSize();
String name = manufacturerListInVO.getName(); String name = manufacturerListDTO.getName();
PageHelper.startPage(pageNum, pageSize); PageHelper.startPage(pageNum, pageSize);
List<ManufacturerInfoPO> manufacturerInfoPOList = manufacturerInfoMapper.selectByOptionalPartialName(name); List<ManufacturerInfoPO> manufacturerInfoPOList = manufacturerInfoMapper.selectByOptionalPartialName(name);
...@@ -37,7 +37,7 @@ public class ManufacturerServiceImpl implements ManufacturerService { ...@@ -37,7 +37,7 @@ public class ManufacturerServiceImpl implements ManufacturerService {
} }
@Override @Override
public void insertOrUpdate(ManufacturerInsertOrUpdateInVO inVO) { public void insertOrUpdate(ManufacturerInsertOrUpdateDTO inVO) {
Integer id = inVO.getId(); Integer id = inVO.getId();
ManufacturerInfoPO manufacturerInfoPO = new ManufacturerInfoPO(); ManufacturerInfoPO manufacturerInfoPO = new ManufacturerInfoPO();
BeanUtils.copyProperties(inVO, manufacturerInfoPO); BeanUtils.copyProperties(inVO, manufacturerInfoPO);
...@@ -51,7 +51,7 @@ public class ManufacturerServiceImpl implements ManufacturerService { ...@@ -51,7 +51,7 @@ public class ManufacturerServiceImpl implements ManufacturerService {
} }
@Override @Override
public void delete(DeleteByIntegerIdListInVO inVO) { public void delete(DeleteByIntegerIdListDTO inVO) {
List<Integer> ids = inVO.getIds(); List<Integer> ids = inVO.getIds();
manufacturerInfoMapper.deleteBatch(ids); manufacturerInfoMapper.deleteBatch(ids);
} }
......
package net.wanji.utc.vo;
import lombok.Data;
import net.wanji.utc.po.CrossPlanPO;
import net.wanji.utc.po.CrossSectionPO;
import java.util.List;
/**
* @author Kent HAN
* @date 2022/12/1 14:07
*/
@Data
public class PlanSectionVO {
private List<CrossPlanPO> crossPlanPOList;
private List<CrossSectionPO> crossSectionPOList;
}
package net.wanji.utc.vo;
import lombok.Data;
import net.wanji.utc.po.CrossLightsPO;
import net.wanji.utc.po.CrossPhasePO;
import net.wanji.utc.po.CrossSchemePO;
import java.util.List;
/**
* @author Kent HAN
* @date 2022/12/1 11:23
*/
@Data
public class SchemePhaseLightsVO {
private List<CrossSchemePO> crossSchemeList;
private List<CrossPhasePO> crossPhaseList;
private List<CrossLightsPO> crossLightsList;
}
...@@ -11,8 +11,8 @@ import java.util.Date; ...@@ -11,8 +11,8 @@ import java.util.Date;
* @date 2022/11/25 10:03 * @date 2022/11/25 10:03
*/ */
@Data @Data
@ApiModel(value = "CrossInfoListOutVO", description = "信号机列表返回参数") @ApiModel(value = "CrossInfoListVO", description = "信号机列表返回参数")
public class CrossInfoListOutVO { public class CrossInfoListVO {
@ApiModelProperty(value = "路口ID",notes = "") @ApiModelProperty(value = "路口ID",notes = "")
private String id ; private String id ;
/** 路口名称 */ /** 路口名称 */
......
...@@ -10,7 +10,7 @@ import java.util.Date; ...@@ -10,7 +10,7 @@ import java.util.Date;
* @date 2022/11/28 17:56 * @date 2022/11/28 17:56
*/ */
@Data @Data
public class ManufacturerApiInfoOutVO { public class ManufacturerApiInfoVO {
/** 接口ID */ /** 接口ID */
@ApiModelProperty(value = "接口ID",notes = "") @ApiModelProperty(value = "接口ID",notes = "")
private Integer id ; private Integer id ;
......
...@@ -64,6 +64,40 @@ ...@@ -64,6 +64,40 @@
where id = #{id} where id = #{id}
</update> </update>
<update id="updateOneByCodeAndManufacturerId">
update t_cross_info
<set>
<if test="name != null and name != ''">
name = #{name},
</if>
<if test="code != null and code != ''">
code = #{code},
</if>
<if test="manufacturerId != null and manufacturerId != ''">
manufacturer_id = #{manufacturerId},
</if>
<if test="ip != null and ip != ''">
ip = #{ip},
</if>
<if test="port != null and port != ''">
port = #{port},
</if>
<if test="location != null and location != ''">
location = #{location},
</if>
<if test="version != null and version != ''">
version = #{version},
</if>
<if test="model != null and model != ''">
model = #{model},
</if>
<if test="installTime != null">
install_time = #{installTime},
</if>
</set>
where code = #{code} and manufacturer_id = #{manufacturerId}
</update>
<delete id="deleteBatch"> <delete id="deleteBatch">
delete from t_cross_info delete from t_cross_info
where id in where id in
...@@ -88,10 +122,10 @@ ...@@ -88,10 +122,10 @@
</foreach> </foreach>
</select> </select>
<select id="selectIdByCode" resultType="java.lang.String"> <select id="selectIdByCodeAndManufacturerId" resultType="java.lang.String">
select id select id
from t_cross_info from t_cross_info
where code = #{crossCode} where code = #{crossCode} and manufacturer_id = #{manufacturerId}
</select> </select>
<select id="selectByCode" resultMap="BaseResultMap"> <select id="selectByCode" resultMap="BaseResultMap">
......
...@@ -48,4 +48,11 @@ ...@@ -48,4 +48,11 @@
where phase_no = #{phaseNo} where phase_no = #{phaseNo}
</select> </select>
<select id="selectByCrossId" resultMap="BaseResultMap">
select
id,phase_no,name,sort,cross_id,plan_id,ring_no,control_mode,phase_time,green_time,green_flash_time,ped_flash_time,yellow_time,red_time,min_green_time,max_green_time,gmt_create,gmt_modified
from t_cross_phase
where cross_id = #{crossId}
</select>
</mapper> </mapper>
...@@ -27,5 +27,19 @@ ...@@ -27,5 +27,19 @@
where cross_id = #{crossId} and plan_no = #{planNo} where cross_id = #{crossId} and plan_no = #{planNo}
</select> </select>
<select id="selectByCrossId" resultMap="BaseResultMap">
select
id,plan_no,name,cross_id,gmt_create,gmt_modified
from t_cross_plan
where cross_id = #{crossId}
</select>
<select id="selectByCrossIdAndPlanNo" resultMap="BaseResultMap">
select
id,plan_no,name,cross_id,gmt_create,gmt_modified
from t_cross_plan
where cross_id = #{crossId} and plan_no = #{planNo}
</select>
</mapper> </mapper>
...@@ -26,5 +26,15 @@ ...@@ -26,5 +26,15 @@
where cross_id = #{crossId} where cross_id = #{crossId}
</delete> </delete>
<select id="selectByCrossIds" resultMap="BaseResultMap">
select
id,name,cross_id,plan_id,week,special_date,gmt_create,gmt_modified
from t_cross_schedules
where cross_id in
<foreach collection="crossIds" item="crossId" separator="," open="(" close=")">
#{crossId}
</foreach>
</select>
</mapper> </mapper>
...@@ -41,4 +41,11 @@ ...@@ -41,4 +41,11 @@
where cross_id = #{crossId} and scheme_no = #{schemeNo} where cross_id = #{crossId} and scheme_no = #{schemeNo}
</select> </select>
<select id="selectByCrossId" resultMap="BaseResultMap">
select
id,scheme_no,name,cross_id,cycle,coord_phase,offset,source,is_deleted,gmt_create,gmt_modified
from t_cross_scheme
where cross_id = #{crossId}
</select>
</mapper> </mapper>
...@@ -24,5 +24,19 @@ ...@@ -24,5 +24,19 @@
where cross_id = #{crossId} and section_no = #{timeSecNo} where cross_id = #{crossId} and section_no = #{timeSecNo}
</delete> </delete>
<select id="selectByCrossId" resultMap="BaseResultMap">
select
id,section_no,start_time,end_time,cross_id,plan_id,control_mode,sceme_id,gmt_create,gmt_modified
from t_cross_section
where cross_id = #{crossId}
</select>
<select id="selectByCrossIdAndPlanId" resultMap="BaseResultMap">
select
id,section_no,start_time,end_time,cross_id,plan_id,control_mode,sceme_id,gmt_create,gmt_modified
from t_cross_section
where cross_id = #{crossId} and plan_id = #{planId}
</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