Commit 9ed13c40 authored by hanbing's avatar hanbing

根据数据库设计统一实体类字段名,包括厂商代码、厂商名称、厂商简称

parent 33f871d4
...@@ -14,6 +14,6 @@ public class BaseCrossInfo { ...@@ -14,6 +14,6 @@ public class BaseCrossInfo {
@ApiModelProperty(value = "信号机ID") @ApiModelProperty(value = "信号机ID")
private String code; private String code;
@ApiModelProperty(value = "厂商缩写") @ApiModelProperty(value = "厂商代码")
private String manufacturerAbbr; private String manufacturerCode;
} }
...@@ -21,9 +21,9 @@ public class HttpRequest { ...@@ -21,9 +21,9 @@ public class HttpRequest {
} }
public HttpRequest(String manufacturerAbbr, String apiCode) { public HttpRequest(String manufacturerCode, String apiCode) {
// 获取请求地址 // 获取请求地址
ManufacturerApiInfoPO manufacturerApiInfoPO = Constants.getManufacturerUrlMap(manufacturerAbbr + ManufacturerApiInfoPO manufacturerApiInfoPO = Constants.getManufacturerUrlMap(manufacturerCode +
Constants.SEPARATOR_UNDER_LINE + apiCode); Constants.SEPARATOR_UNDER_LINE + apiCode);
if (manufacturerApiInfoPO == null) { if (manufacturerApiInfoPO == null) {
throw new NoSuchApiException("没有此接口信息,请在t_manufacturer_api_info表中添加"); throw new NoSuchApiException("没有此接口信息,请在t_manufacturer_api_info表中添加");
......
...@@ -19,9 +19,9 @@ public class OutVO<T> { ...@@ -19,9 +19,9 @@ public class OutVO<T> {
private String systemAbbr; private String systemAbbr;
/** /**
* 厂商缩写 * 厂商代码
*/ */
private String manufacturerAbbr; private String manufacturerCode;
/** /**
* 更新时间 * 更新时间
......
...@@ -9,8 +9,8 @@ public class BasicEnum { ...@@ -9,8 +9,8 @@ public class BasicEnum {
public enum ManufacturerEnum { public enum ManufacturerEnum {
HK(1, "海康", "HK"); HK(1, "海康", "HK");
private Integer code; private Integer id;
private String name; private String nick;
private String abbr; private String code;
} }
} }
...@@ -19,7 +19,6 @@ import org.springframework.web.bind.annotation.*; ...@@ -19,7 +19,6 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Date;
import java.util.List; import java.util.List;
import static net.wanji.utc.common.ResultEnum.BODY_NOT_MATCH; import static net.wanji.utc.common.ResultEnum.BODY_NOT_MATCH;
...@@ -55,7 +54,7 @@ public class ControlCommandController { ...@@ -55,7 +54,7 @@ public class ControlCommandController {
return Result.success(); return Result.success();
} }
Integer manufacturerId = check(signalId); Integer manufacturerId = check(signalId);
if (manufacturerId.equals(BasicEnum.ManufacturerEnum.HK.getCode())) { if (manufacturerId.equals(BasicEnum.ManufacturerEnum.HK.getId())) {
return hkControlCommandService.allRedControl(signalId, null, null, command); return hkControlCommandService.allRedControl(signalId, null, null, command);
} else { } else {
// todo else // todo else
...@@ -86,10 +85,10 @@ public class ControlCommandController { ...@@ -86,10 +85,10 @@ public class ControlCommandController {
//开启适配服务 //开启适配服务
for (TimePlanVO timePlanVo : timePlans) { for (TimePlanVO timePlanVo : timePlans) {
timePlanVo.setCode(crossInfoPo.getCode()); timePlanVo.setCode(crossInfoPo.getCode());
timePlanVo.setManufacturerAbbr(crossInfoPo.getManufacturerId() + ""); timePlanVo.setManufacturerCode(crossInfoPo.getManufacturerId() + "");
} }
Integer manufacturerId = crossInfoPo.getManufacturerId(); Integer manufacturerId = crossInfoPo.getManufacturerId();
if (manufacturerId.equals(BasicEnum.ManufacturerEnum.HK.getCode())) { if (manufacturerId.equals(BasicEnum.ManufacturerEnum.HK.getId())) {
return hkControlCommandService.phaseTimingSend(timePlans); return hkControlCommandService.phaseTimingSend(timePlans);
} else { } else {
// todo else // todo else
...@@ -116,9 +115,9 @@ public class ControlCommandController { ...@@ -116,9 +115,9 @@ public class ControlCommandController {
throw new ControlException(BODY_NOT_MATCH.getResultCode(), "参数错误,信号机ID不正确。"); throw new ControlException(BODY_NOT_MATCH.getResultCode(), "参数错误,信号机ID不正确。");
} }
planSendVO.setCode(crossInfoPo.getCode()); planSendVO.setCode(crossInfoPo.getCode());
planSendVO.setManufacturerAbbr(crossInfoPo.getManufacturerId() + ""); planSendVO.setManufacturerCode(crossInfoPo.getManufacturerId() + "");
Integer manufacturerId = crossInfoPo.getManufacturerId(); Integer manufacturerId = crossInfoPo.getManufacturerId();
if (manufacturerId.equals(BasicEnum.ManufacturerEnum.HK.getCode())) { if (manufacturerId.equals(BasicEnum.ManufacturerEnum.HK.getId())) {
return hkControlCommandService.planSend(planSendVO); return hkControlCommandService.planSend(planSendVO);
} else { } else {
...@@ -145,7 +144,7 @@ public class ControlCommandController { ...@@ -145,7 +144,7 @@ public class ControlCommandController {
return Result.success(); return Result.success();
} }
Integer manufacturerId = check(signalId); Integer manufacturerId = check(signalId);
if (manufacturerId.equals(BasicEnum.ManufacturerEnum.HK.getCode())) { if (manufacturerId.equals(BasicEnum.ManufacturerEnum.HK.getId())) {
return hkControlCommandService.allRedControl(signalId, null, null, command); return hkControlCommandService.allRedControl(signalId, null, null, command);
} else { } else {
// todo else // todo else
...@@ -167,7 +166,7 @@ public class ControlCommandController { ...@@ -167,7 +166,7 @@ public class ControlCommandController {
return Result.success(); return Result.success();
} }
Integer manufacturerId = check(signalId); Integer manufacturerId = check(signalId);
if (manufacturerId.equals(BasicEnum.ManufacturerEnum.HK.getCode())) { if (manufacturerId.equals(BasicEnum.ManufacturerEnum.HK.getId())) {
return hkControlCommandService.yellowLightControl(signalId, null, null, command); return hkControlCommandService.yellowLightControl(signalId, null, null, command);
} else { } else {
// todo else // todo else
...@@ -189,7 +188,7 @@ public class ControlCommandController { ...@@ -189,7 +188,7 @@ public class ControlCommandController {
return Result.success(); return Result.success();
} }
Integer manufacturerId = check(signalId); Integer manufacturerId = check(signalId);
if (manufacturerId.equals(BasicEnum.ManufacturerEnum.HK.getCode())) { if (manufacturerId.equals(BasicEnum.ManufacturerEnum.HK.getId())) {
return hkControlCommandService.closeLightControl(signalId, null, null, command); return hkControlCommandService.closeLightControl(signalId, null, null, command);
} else { } else {
// todo else // todo else
...@@ -214,7 +213,7 @@ public class ControlCommandController { ...@@ -214,7 +213,7 @@ public class ControlCommandController {
return Result.success(); return Result.success();
} }
Integer manufacturerId = check(signalId); Integer manufacturerId = check(signalId);
if (manufacturerId.equals(BasicEnum.ManufacturerEnum.HK.getCode())) { if (manufacturerId.equals(BasicEnum.ManufacturerEnum.HK.getId())) {
return hkControlCommandService.stepControl(signalId, null, null, command, stepNum); return hkControlCommandService.stepControl(signalId, null, null, command, stepNum);
} else { } else {
// todo else // todo else
...@@ -235,7 +234,7 @@ public class ControlCommandController { ...@@ -235,7 +234,7 @@ public class ControlCommandController {
return Result.success(); return Result.success();
} }
Integer manufacturerId = check(signalId); Integer manufacturerId = check(signalId);
if (manufacturerId.equals(BasicEnum.ManufacturerEnum.HK.getCode())) { if (manufacturerId.equals(BasicEnum.ManufacturerEnum.HK.getId())) {
return hkControlCommandService.scheduleSend(signalId, null, null, null); return hkControlCommandService.scheduleSend(signalId, null, null, null);
} else { } else {
// todo else // todo else
...@@ -257,7 +256,7 @@ public class ControlCommandController { ...@@ -257,7 +256,7 @@ public class ControlCommandController {
} }
try { try {
Integer manufacturerId = check(signalId); Integer manufacturerId = check(signalId);
if (manufacturerId.equals(BasicEnum.ManufacturerEnum.HK.getCode())) { if (manufacturerId.equals(BasicEnum.ManufacturerEnum.HK.getId())) {
return hkControlCommandService.lockControl(signalId, phaseLock); return hkControlCommandService.lockControl(signalId, phaseLock);
} else { } else {
// todo else // todo else
......
package net.wanji.utc.controller;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import net.wanji.utc.entity.JsonViewObject;
import net.wanji.utc.po.CrossInfoPO;
import net.wanji.utc.po.ManufacturerApiInfoPO;
import net.wanji.utc.service.systemadmin.CrossInfoService;
import net.wanji.utc.service.systemadmin.ManufacturerApiInfoService;
import net.wanji.utc.vo.systemadmin.CrossInfoListInVO;
import net.wanji.utc.vo.systemadmin.DeleteListInVO;
import net.wanji.utc.vo.systemadmin.ManufacturerApiInfoInsertOrUpdateInVO;
import net.wanji.utc.vo.systemadmin.ManufacturerApiInfoListInVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.ws.rs.core.MediaType;
/**
* 系统管理-信号机管理
*
* @author Kent HAN
* @date 2022/11/24 8:32
*/
@Api(value = "系统管理-信号机管理", description = "系统管理-信号机管理")
@RequestMapping("/crossInfo")
@RestController
public class CrossInfoController {
@Autowired
CrossInfoService crossInfoService;
@ApiOperation(value = "信号机列表", notes = "信号机列表", response = CrossInfoPO.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/list",
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = CrossInfoPO.class),
})
public JsonViewObject list(@RequestBody CrossInfoListInVO crossInfoListInVO) {
PageInfo<CrossInfoPO> crossInfoPOPageInfo = crossInfoService.list(crossInfoListInVO);
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
return jsonViewObject.success(crossInfoPOPageInfo);
}
// @ApiOperation(value = "接口添加或修改", notes = "接口添加或修改", consumes = MediaType.APPLICATION_JSON)
// @PostMapping(value = "/insertOrUpdate", consumes = MediaType.APPLICATION_JSON)
// public JsonViewObject insertOrUpdate(@RequestBody ManufacturerApiInfoInsertOrUpdateInVO inVO) {
// manufacturerApiInfoService.insertOrUpdate(inVO);
// JsonViewObject jsonViewObject = JsonViewObject.newInstance();
//
// return jsonViewObject.success();
// }
//
// @ApiOperation(value = "接口删除", notes = "接口删除", consumes = MediaType.APPLICATION_JSON)
// @PostMapping(value = "/delete", consumes = MediaType.APPLICATION_JSON)
// public JsonViewObject delete(@RequestBody DeleteListInVO inVO) {
// manufacturerApiInfoService.delete(inVO);
// JsonViewObject jsonViewObject = JsonViewObject.newInstance();
//
// return jsonViewObject.success();
// }
}
...@@ -33,8 +33,8 @@ public class StaticInfoController { ...@@ -33,8 +33,8 @@ public class StaticInfoController {
@ApiOperation(value = "信号路口基础信息", notes = "信号路口基础信息") @ApiOperation(value = "信号路口基础信息", notes = "信号路口基础信息")
public ResponseEntity crossInfo(HttpServletRequest request, @RequestBody CrossInfoInVO crossInfoInVO) { public ResponseEntity crossInfo(HttpServletRequest request, @RequestBody CrossInfoInVO crossInfoInVO) {
OutVO<BaseCrossInfo> outVO = new OutVO<>(); OutVO<BaseCrossInfo> outVO = new OutVO<>();
String manufacturerAbbr = crossInfoInVO.getManufacturerAbbr(); String manufacturerCode = crossInfoInVO.getManufacturerCode();
outVO.setManufacturerAbbr(manufacturerAbbr); outVO.setManufacturerCode(manufacturerCode);
outVO.setUpdatetime(new Date()); outVO.setUpdatetime(new Date());
outVO.setSystemAbbr(Constants.SYSTEM_ABBR); outVO.setSystemAbbr(Constants.SYSTEM_ABBR);
......
...@@ -23,4 +23,7 @@ public interface CrossInfoMapper { ...@@ -23,4 +23,7 @@ public interface CrossInfoMapper {
List<CrossInfoPO> selectByManufacturerId(@Param("manufacturerId") Integer manufacturerId); List<CrossInfoPO> selectByManufacturerId(@Param("manufacturerId") Integer manufacturerId);
List<CrossInfoPO> selectAll(); List<CrossInfoPO> selectAll();
List<CrossInfoPO> selectByOptionals(@Param("crossName") String crossName,
@Param("manufacturerId") Integer manufacturerId);
} }
...@@ -17,7 +17,7 @@ public interface ManufacturerInfoMapper { ...@@ -17,7 +17,7 @@ public interface ManufacturerInfoMapper {
List<ManufacturerInfoPO> selectAll(); List<ManufacturerInfoPO> selectAll();
List<ManufacturerInfoPO> selectByOptionalName(@Param("name") String name); List<ManufacturerInfoPO> selectByOptionalPartialName(@Param("name") String name);
void insertOne(ManufacturerInfoPO manufacturerInfoPO); void insertOne(ManufacturerInfoPO manufacturerInfoPO);
...@@ -25,5 +25,5 @@ public interface ManufacturerInfoMapper { ...@@ -25,5 +25,5 @@ public interface ManufacturerInfoMapper {
void deleteBatch(@Param("ids") List<Integer> ids); void deleteBatch(@Param("ids") List<Integer> ids);
Integer selectIdByName(@Param("manufacturerName") String manufacturerName); Integer selectIdByNick(@Param("manufacturerNick") String manufacturerNick);
} }
...@@ -11,39 +11,39 @@ import java.util.Date; ...@@ -11,39 +11,39 @@ import java.util.Date;
*/ */
@Data @Data
public class CrossInfoPO { public class CrossInfoPO {
@ApiModelProperty(name = "路口ID",notes = "") @ApiModelProperty(value = "路口ID",notes = "")
private String id ; private String id ;
/** 路口名称 */ /** 路口名称 */
@ApiModelProperty(name = "路口名称",notes = "") @ApiModelProperty(value = "路口名称",notes = "")
private String name ; private String name ;
/** 信号机编号 */ /** 信号机编号 */
@ApiModelProperty(name = "信号机编号",notes = "") @ApiModelProperty(value = "信号机编号",notes = "")
private String code ; private String code ;
/** 厂商ID */ /** 厂商ID */
@ApiModelProperty(name = "厂商ID",notes = "") @ApiModelProperty(value = "厂商ID",notes = "")
private Integer manufacturerId ; private Integer manufacturerId ;
/** 信号机IP */ /** 信号机IP */
@ApiModelProperty(name = "信号机IP",notes = "") @ApiModelProperty(value = "信号机IP",notes = "")
private String ip ; private String ip ;
/** 信号机端口 */ /** 信号机端口 */
@ApiModelProperty(name = "信号机端口",notes = "") @ApiModelProperty(value = "信号机端口",notes = "")
private Integer port ; private Integer port ;
/** 经纬度 */ /** 经纬度 */
@ApiModelProperty(name = "经纬度",notes = "") @ApiModelProperty(value = "经纬度",notes = "")
private String location ; private String location ;
/** 版本号 */ /** 版本号 */
@ApiModelProperty(name = "版本号",notes = "") @ApiModelProperty(value = "版本号",notes = "")
private String version ; private String version ;
/** 型号 */ /** 型号 */
@ApiModelProperty(name = "型号",notes = "") @ApiModelProperty(value = "型号",notes = "")
private String model ; private String model ;
/** 安装时间 */ /** 安装时间 */
@ApiModelProperty(name = "安装时间",notes = "") @ApiModelProperty(value = "安装时间",notes = "")
private Date installTime ; private Date installTime ;
/** 创建时间 */ /** 创建时间 */
@ApiModelProperty(name = "创建时间",notes = "") @ApiModelProperty(value = "创建时间",notes = "")
private Date gmtCreate ; private Date gmtCreate ;
/** 修改时间 */ /** 修改时间 */
@ApiModelProperty(name = "修改时间",notes = "") @ApiModelProperty(value = "修改时间",notes = "")
private Date gmtModified ; private Date gmtModified ;
} }
...@@ -242,7 +242,7 @@ public class HKControlCommandServiceImpl implements ControlCommandService { ...@@ -242,7 +242,7 @@ public class HKControlCommandServiceImpl implements ControlCommandService {
private Map<String, String> getPathMapByApiCode(String apiCode) { private Map<String, String> getPathMapByApiCode(String apiCode) {
Map<String, String> res = new HashMap<>(); Map<String, String> res = new HashMap<>();
HttpRequest httpRequest = new HttpRequest(BasicEnum.ManufacturerEnum.HK.getAbbr(), apiCode); HttpRequest httpRequest = new HttpRequest(BasicEnum.ManufacturerEnum.HK.getCode(), apiCode);
res.put("http://", artemisPath + httpRequest.getUrl()); res.put("http://", artemisPath + httpRequest.getUrl());
return res; return res;
} }
...@@ -330,7 +330,7 @@ public class HKControlCommandServiceImpl implements ControlCommandService { ...@@ -330,7 +330,7 @@ public class HKControlCommandServiceImpl implements ControlCommandService {
List<BaseCrossInfo> baseSignals = new ArrayList<>(); List<BaseCrossInfo> baseSignals = new ArrayList<>();
BaseCrossInfo baseSignal = new BaseCrossInfo(); BaseCrossInfo baseSignal = new BaseCrossInfo();
baseSignal.setCode(signalId); baseSignal.setCode(signalId);
baseSignal.setManufacturerAbbr(BasicEnum.ManufacturerEnum.HK.getAbbr()); baseSignal.setManufacturerCode(BasicEnum.ManufacturerEnum.HK.getCode());
baseSignals.add(baseSignal); baseSignals.add(baseSignal);
return hkGetSignalMethodService.queryHkSignalInfo(baseSignals); return hkGetSignalMethodService.queryHkSignalInfo(baseSignals);
} }
......
...@@ -79,7 +79,7 @@ public class HkGetSignalMethodServiceImpl implements HkGetSignalMethodService { ...@@ -79,7 +79,7 @@ public class HkGetSignalMethodServiceImpl implements HkGetSignalMethodService {
int curRunTime = jsonObject.getIntValue("curRunTime"); // 当前运行时长 int curRunTime = jsonObject.getIntValue("curRunTime"); // 当前运行时长
int cycleCountDown = cycleLen - curRunTime; // 周期剩余时长 int cycleCountDown = cycleLen - curRunTime; // 周期剩余时长
infoVo.setCode(entity.getCode()); infoVo.setCode(entity.getCode());
infoVo.setManufacturerAbbr(entity.getManufacturerAbbr()); infoVo.setManufacturerCode(entity.getManufacturerCode());
infoVo.setCycleCountDown(cycleCountDown); infoVo.setCycleCountDown(cycleCountDown);
infoVo.setCycleLen(cycleLen); infoVo.setCycleLen(cycleLen);
...@@ -140,7 +140,7 @@ public class HkGetSignalMethodServiceImpl implements HkGetSignalMethodService { ...@@ -140,7 +140,7 @@ public class HkGetSignalMethodServiceImpl implements HkGetSignalMethodService {
private Map<String, String> getPathMapByApiCode(String apiCode) { private Map<String, String> getPathMapByApiCode(String apiCode) {
Map<String, String> res = new HashMap<>(); Map<String, String> res = new HashMap<>();
HttpRequest httpRequest = new HttpRequest(BasicEnum.ManufacturerEnum.HK.getAbbr(), apiCode); HttpRequest httpRequest = new HttpRequest(BasicEnum.ManufacturerEnum.HK.getCode(), apiCode);
res.put("http://", artemisPath + httpRequest.getUrl()); res.put("http://", artemisPath + httpRequest.getUrl());
return res; return res;
} }
......
...@@ -77,7 +77,7 @@ public class HkLightsStatusServiceImpl implements HkLightsStatusService { ...@@ -77,7 +77,7 @@ public class HkLightsStatusServiceImpl implements HkLightsStatusService {
int curRunTime = jsonObject.getIntValue("curRunTime"); // 当前运行时长 int curRunTime = jsonObject.getIntValue("curRunTime"); // 当前运行时长
int cycleCountDown = cycleLen - curRunTime; // 周期剩余时长 int cycleCountDown = cycleLen - curRunTime; // 周期剩余时长
infoVo.setCode(entity.getCode()); infoVo.setCode(entity.getCode());
infoVo.setManufacturerAbbr(entity.getManufacturerAbbr()); infoVo.setManufacturerCode(entity.getManufacturerCode());
infoVo.setCycleCountDown(cycleCountDown); infoVo.setCycleCountDown(cycleCountDown);
infoVo.setCycleLen(cycleLen); infoVo.setCycleLen(cycleLen);
// 循环相位列表 // 循环相位列表
...@@ -159,7 +159,7 @@ public class HkLightsStatusServiceImpl implements HkLightsStatusService { ...@@ -159,7 +159,7 @@ public class HkLightsStatusServiceImpl implements HkLightsStatusService {
private Map<String, String> getPathMapByApiCode(String apiCode) { private Map<String, String> getPathMapByApiCode(String apiCode) {
Map<String, String> res = new HashMap<>(); Map<String, String> res = new HashMap<>();
HttpRequest httpRequest = new HttpRequest(BasicEnum.ManufacturerEnum.HK.getAbbr(), apiCode); HttpRequest httpRequest = new HttpRequest(BasicEnum.ManufacturerEnum.HK.getCode(), apiCode);
res.put("http://", artemisPath + httpRequest.getUrl()); res.put("http://", artemisPath + httpRequest.getUrl());
return res; return res;
} }
......
...@@ -65,7 +65,7 @@ public class HkRunningStatusServiceImpl implements HkRunningStatusService { ...@@ -65,7 +65,7 @@ public class HkRunningStatusServiceImpl implements HkRunningStatusService {
} }
// 从Redis中查询控制类型 // 从Redis中查询控制类型
String lightsStatusVOStr = redisUtil.getHash(RedisKeyConst.KEY_PREFIX + RedisKeyConst.LIGHTS_STATUS, String lightsStatusVOStr = redisUtil.getHash(RedisKeyConst.KEY_PREFIX + RedisKeyConst.LIGHTS_STATUS,
baseCrossInfo.getManufacturerAbbr() + Constants.SEPARATOR_UNDER_LINE + po.getSignalId()); baseCrossInfo.getManufacturerCode() + Constants.SEPARATOR_UNDER_LINE + po.getSignalId());
LightsStatusVO lightsStatusVO = JSON.parseObject(lightsStatusVOStr, LightsStatusVO.class); LightsStatusVO lightsStatusVO = JSON.parseObject(lightsStatusVOStr, LightsStatusVO.class);
String runMode = lightsStatusVO.getRunMode(); String runMode = lightsStatusVO.getRunMode();
int runModeInt = Integer.parseInt(runMode); int runModeInt = Integer.parseInt(runMode);
...@@ -83,7 +83,7 @@ public class HkRunningStatusServiceImpl implements HkRunningStatusService { ...@@ -83,7 +83,7 @@ public class HkRunningStatusServiceImpl implements HkRunningStatusService {
private Map<String, String> getPathMapByApiCode(String apiCode) { private Map<String, String> getPathMapByApiCode(String apiCode) {
Map<String, String> res = new HashMap<>(); Map<String, String> res = new HashMap<>();
HttpRequest httpRequest = new HttpRequest(BasicEnum.ManufacturerEnum.HK.getAbbr(), apiCode); HttpRequest httpRequest = new HttpRequest(BasicEnum.ManufacturerEnum.HK.getCode(), apiCode);
res.put("http://", artemisPath + httpRequest.getUrl()); res.put("http://", artemisPath + httpRequest.getUrl());
return res; return res;
} }
......
...@@ -47,7 +47,7 @@ public class SignalStatusServiceImpl implements SignalStatusService { ...@@ -47,7 +47,7 @@ public class SignalStatusServiceImpl implements SignalStatusService {
List<BaseCrossInfo> baseCrossInfoList = getBaseCrossInfoList(manufacturerEnum); List<BaseCrossInfo> baseCrossInfoList = getBaseCrossInfoList(manufacturerEnum);
if (baseCrossInfoList == null) continue; if (baseCrossInfoList == null) continue;
List<SignalStatusLogPO> signalStatusLogPOList = null; List<SignalStatusLogPO> signalStatusLogPOList = null;
if(manufacturerEnum.getAbbr().equals(BasicEnum.ManufacturerEnum.HK.getAbbr())) { if(manufacturerEnum.getCode().equals(BasicEnum.ManufacturerEnum.HK.getCode())) {
// 海康 // 海康
// 3.2.5信号机运行状态和告警信息 // 3.2.5信号机运行状态和告警信息
signalStatusLogPOList = hkRunningStatusService.getHkRunningStatus(baseCrossInfoList); signalStatusLogPOList = hkRunningStatusService.getHkRunningStatus(baseCrossInfoList);
...@@ -63,7 +63,7 @@ public class SignalStatusServiceImpl implements SignalStatusService { ...@@ -63,7 +63,7 @@ public class SignalStatusServiceImpl implements SignalStatusService {
// 更新Redis // 更新Redis
if (null != signalStatusLogPOList) { if (null != signalStatusLogPOList) {
for (SignalStatusLogPO signalStatusLogPO : signalStatusLogPOList) { for (SignalStatusLogPO signalStatusLogPO : signalStatusLogPOList) {
String field = manufacturerEnum.getAbbr() + Constants.SEPARATOR_UNDER_LINE + String field = manufacturerEnum.getCode() + Constants.SEPARATOR_UNDER_LINE +
signalStatusLogPO.getSignalId(); signalStatusLogPO.getSignalId();
redisUtil.setHash(RedisKeyConst.KEY_PREFIX + RedisKeyConst.TELESEME_STATUS, field, redisUtil.setHash(RedisKeyConst.KEY_PREFIX + RedisKeyConst.TELESEME_STATUS, field,
signalStatusLogPO.getStatus()+""); signalStatusLogPO.getStatus()+"");
...@@ -83,7 +83,7 @@ public class SignalStatusServiceImpl implements SignalStatusService { ...@@ -83,7 +83,7 @@ public class SignalStatusServiceImpl implements SignalStatusService {
List<BaseCrossInfo> baseCrossInfoList = getBaseCrossInfoList(manufacturerEnum); List<BaseCrossInfo> baseCrossInfoList = getBaseCrossInfoList(manufacturerEnum);
if (baseCrossInfoList == null) continue; if (baseCrossInfoList == null) continue;
List<LightsStatusVO> lightsStatusVOList = null; List<LightsStatusVO> lightsStatusVOList = null;
if(manufacturerEnum.getAbbr().equals(BasicEnum.ManufacturerEnum.HK.getAbbr())) { if(manufacturerEnum.getCode().equals(BasicEnum.ManufacturerEnum.HK.getCode())) {
// 海康 // 海康
// 3.2.4灯态 // 3.2.4灯态
lightsStatusVOList = hkLightsStatusService.getHkLightsStatus(baseCrossInfoList); lightsStatusVOList = hkLightsStatusService.getHkLightsStatus(baseCrossInfoList);
...@@ -93,7 +93,7 @@ public class SignalStatusServiceImpl implements SignalStatusService { ...@@ -93,7 +93,7 @@ public class SignalStatusServiceImpl implements SignalStatusService {
// 更新Redis // 更新Redis
if (lightsStatusVOList != null) { if (lightsStatusVOList != null) {
for (LightsStatusVO lightsStatusVO : lightsStatusVOList) { for (LightsStatusVO lightsStatusVO : lightsStatusVOList) {
String field = manufacturerEnum.getAbbr() + Constants.SEPARATOR_UNDER_LINE + String field = manufacturerEnum.getCode() + Constants.SEPARATOR_UNDER_LINE +
lightsStatusVO.getCode(); lightsStatusVO.getCode();
redisUtil.setHash(RedisKeyConst.KEY_PREFIX + RedisKeyConst.LIGHTS_STATUS, field, redisUtil.setHash(RedisKeyConst.KEY_PREFIX + RedisKeyConst.LIGHTS_STATUS, field,
JSON.toJSONString(lightsStatusVO)); JSON.toJSONString(lightsStatusVO));
...@@ -104,7 +104,7 @@ public class SignalStatusServiceImpl implements SignalStatusService { ...@@ -104,7 +104,7 @@ public class SignalStatusServiceImpl implements SignalStatusService {
private List<BaseCrossInfo> getBaseCrossInfoList(BasicEnum.ManufacturerEnum manufacturerEnum) { private List<BaseCrossInfo> getBaseCrossInfoList(BasicEnum.ManufacturerEnum manufacturerEnum) {
// 查询路口信息 // 查询路口信息
ManufacturerInfoPO manufacturerInfoPO = manufacturerInfoMapper.selectByAbbr(manufacturerEnum.getAbbr()); ManufacturerInfoPO manufacturerInfoPO = manufacturerInfoMapper.selectByAbbr(manufacturerEnum.getCode());
Integer manufacturerId = manufacturerInfoPO.getId(); Integer manufacturerId = manufacturerInfoPO.getId();
List<CrossInfoPO> crossInfoPOList = crossInfoMapper.selectByManufacturerId(manufacturerId); List<CrossInfoPO> crossInfoPOList = crossInfoMapper.selectByManufacturerId(manufacturerId);
if (ListUtil.isEmpty(crossInfoPOList)) { if (ListUtil.isEmpty(crossInfoPOList)) {
...@@ -115,7 +115,7 @@ public class SignalStatusServiceImpl implements SignalStatusService { ...@@ -115,7 +115,7 @@ public class SignalStatusServiceImpl implements SignalStatusService {
for (CrossInfoPO infoPO : crossInfoPOList) { for (CrossInfoPO infoPO : crossInfoPOList) {
BaseCrossInfo baseCrossInfo = new BaseCrossInfo(); BaseCrossInfo baseCrossInfo = new BaseCrossInfo();
baseCrossInfo.setCode(infoPO.getCode()); baseCrossInfo.setCode(infoPO.getCode());
baseCrossInfo.setManufacturerAbbr(manufacturerEnum.getAbbr()); baseCrossInfo.setManufacturerCode(manufacturerEnum.getCode());
baseCrossInfoList.add(baseCrossInfo); baseCrossInfoList.add(baseCrossInfo);
} }
return baseCrossInfoList; return baseCrossInfoList;
......
...@@ -8,5 +8,5 @@ import net.wanji.utc.vo.DetailCrossInfoVO; ...@@ -8,5 +8,5 @@ import net.wanji.utc.vo.DetailCrossInfoVO;
* @date 2022/11/16 11:03 * @date 2022/11/16 11:03
*/ */
public interface OthersStaticInfoService { public interface OthersStaticInfoService {
ManufacturerRes<DetailCrossInfoVO> crossBasicInfo(String manufacturerAbbr); ManufacturerRes<DetailCrossInfoVO> crossBasicInfo(String manufacturerCode);
} }
...@@ -110,7 +110,7 @@ public class HkCrossSchedulesServiceImpl implements HkCrossSchedulesService { ...@@ -110,7 +110,7 @@ public class HkCrossSchedulesServiceImpl implements HkCrossSchedulesService {
private Map<String, String> getPathMapByApiCode(String apiCode) { private Map<String, String> getPathMapByApiCode(String apiCode) {
Map<String, String> res = new HashMap<>(); Map<String, String> res = new HashMap<>();
HttpRequest httpRequest = new HttpRequest(BasicEnum.ManufacturerEnum.HK.getAbbr(), apiCode); HttpRequest httpRequest = new HttpRequest(BasicEnum.ManufacturerEnum.HK.getCode(), apiCode);
res.put("http://", artemisPath + httpRequest.getUrl()); res.put("http://", artemisPath + httpRequest.getUrl());
return res; return res;
} }
......
...@@ -111,7 +111,7 @@ public class HkPlanSectionServiceImpl implements HkPlanSectionService { ...@@ -111,7 +111,7 @@ public class HkPlanSectionServiceImpl implements HkPlanSectionService {
private Map<String, String> getPathMapByApiCode(String apiCode) { private Map<String, String> getPathMapByApiCode(String apiCode) {
Map<String, String> res = new HashMap<>(); Map<String, String> res = new HashMap<>();
HttpRequest httpRequest = new HttpRequest(BasicEnum.ManufacturerEnum.HK.getAbbr(), apiCode); HttpRequest httpRequest = new HttpRequest(BasicEnum.ManufacturerEnum.HK.getCode(), apiCode);
res.put("http://", artemisPath + httpRequest.getUrl()); res.put("http://", artemisPath + httpRequest.getUrl());
return res; return res;
} }
......
...@@ -253,7 +253,7 @@ public class HkSchemePhaseLightsServiceImpl implements HkSchemePhaseLightsServic ...@@ -253,7 +253,7 @@ public class HkSchemePhaseLightsServiceImpl implements HkSchemePhaseLightsServic
private Map<String, String> getPathMapByApiCode(String apiCode) { private Map<String, String> getPathMapByApiCode(String apiCode) {
Map<String, String> res = new HashMap<>(); Map<String, String> res = new HashMap<>();
HttpRequest httpRequest = new HttpRequest(BasicEnum.ManufacturerEnum.HK.getAbbr(), apiCode); HttpRequest httpRequest = new HttpRequest(BasicEnum.ManufacturerEnum.HK.getCode(), apiCode);
res.put("http://", artemisPath + httpRequest.getUrl()); res.put("http://", artemisPath + httpRequest.getUrl());
return res; return res;
} }
......
...@@ -75,7 +75,7 @@ public class HkStaticInfoServiceImpl implements HkStaticInfoService { ...@@ -75,7 +75,7 @@ public class HkStaticInfoServiceImpl implements HkStaticInfoService {
crossInfoPO.setName(crossName); crossInfoPO.setName(crossName);
crossInfoPO.setCode(crossCode); crossInfoPO.setCode(crossCode);
ManufacturerInfoPO manufacturerInfoPO = manufacturerInfoMapper.selectByAbbr( ManufacturerInfoPO manufacturerInfoPO = manufacturerInfoMapper.selectByAbbr(
BasicEnum.ManufacturerEnum.HK.getAbbr()); BasicEnum.ManufacturerEnum.HK.getCode());
if (manufacturerInfoPO != null) { if (manufacturerInfoPO != null) {
crossInfoPO.setManufacturerId(manufacturerInfoPO.getId()); crossInfoPO.setManufacturerId(manufacturerInfoPO.getId());
} }
...@@ -99,7 +99,7 @@ public class HkStaticInfoServiceImpl implements HkStaticInfoService { ...@@ -99,7 +99,7 @@ public class HkStaticInfoServiceImpl implements HkStaticInfoService {
private Map<String, String> getPathMapByApiCode(String apiCode) { private Map<String, String> getPathMapByApiCode(String apiCode) {
Map<String, String> res = new HashMap<>(); Map<String, String> res = new HashMap<>();
HttpRequest httpRequest = new HttpRequest(BasicEnum.ManufacturerEnum.HK.getAbbr(), apiCode); HttpRequest httpRequest = new HttpRequest(BasicEnum.ManufacturerEnum.HK.getCode(), apiCode);
res.put("http://", artemisPath + httpRequest.getUrl()); res.put("http://", artemisPath + httpRequest.getUrl());
return res; return res;
} }
......
...@@ -22,8 +22,8 @@ public class OthersStaticInfoServiceImpl implements OthersStaticInfoService { ...@@ -22,8 +22,8 @@ public class OthersStaticInfoServiceImpl implements OthersStaticInfoService {
private HttpRestUtil httpRestUtil; private HttpRestUtil httpRestUtil;
@Override @Override
public ManufacturerRes<DetailCrossInfoVO> crossBasicInfo(String manufacturerAbbr) { public ManufacturerRes<DetailCrossInfoVO> crossBasicInfo(String manufacturerCode) {
HttpRequest httpRequest = new HttpRequest(manufacturerAbbr, "queryCrossing"); HttpRequest httpRequest = new HttpRequest(manufacturerCode, "queryCrossing");
String result = httpRestUtil.doExecute(httpRequest.getUrl(), httpRequest.getHeaders(), HttpMethod.POST, null); String result = httpRestUtil.doExecute(httpRequest.getUrl(), httpRequest.getHeaders(), HttpMethod.POST, null);
if (StringUtils.isEmpty(result)) { if (StringUtils.isEmpty(result)) {
return null; return null;
......
...@@ -46,11 +46,11 @@ public class StaticInfoServiceImpl implements StaticInfoService { ...@@ -46,11 +46,11 @@ public class StaticInfoServiceImpl implements StaticInfoService {
public ManufacturerRes<DetailCrossInfoVO> crossBasicInfo(OutVO<BaseCrossInfo> outVO) { public ManufacturerRes<DetailCrossInfoVO> crossBasicInfo(OutVO<BaseCrossInfo> outVO) {
List<CrossInfoPO> crossInfoPOList = new ArrayList<>(); List<CrossInfoPO> crossInfoPOList = new ArrayList<>();
ManufacturerRes<DetailCrossInfoVO> res = new ManufacturerRes<>(); ManufacturerRes<DetailCrossInfoVO> res = new ManufacturerRes<>();
if (Objects.equals(BasicEnum.ManufacturerEnum.HK.getAbbr(), outVO.getManufacturerAbbr())) { if (Objects.equals(BasicEnum.ManufacturerEnum.HK.getCode(), outVO.getManufacturerCode())) {
crossInfoPOList = hkStaticInfoService.hkCrossBasicInfo(); crossInfoPOList = hkStaticInfoService.hkCrossBasicInfo();
} else { } else {
// todo 其他厂商 // todo 其他厂商
res = othersStaticInfoService.crossBasicInfo(outVO.getManufacturerAbbr()); res = othersStaticInfoService.crossBasicInfo(outVO.getManufacturerCode());
if (null == res) { if (null == res) {
return null; return null;
} }
...@@ -69,7 +69,7 @@ public class StaticInfoServiceImpl implements StaticInfoService { ...@@ -69,7 +69,7 @@ public class StaticInfoServiceImpl implements StaticInfoService {
crossInfoPO.setId(id); crossInfoPO.setId(id);
crossInfoPO.setName(vo.getCrossName()); crossInfoPO.setName(vo.getCrossName());
crossInfoPO.setCode(id); crossInfoPO.setCode(id);
ManufacturerInfoPO manufacturerInfoPO = manufacturerInfoMapper.selectByAbbr(vo.getManufacturerAbbr()); ManufacturerInfoPO manufacturerInfoPO = manufacturerInfoMapper.selectByAbbr(vo.getManufacturerCode());
if (manufacturerInfoPO != null) { if (manufacturerInfoPO != null) {
crossInfoPO.setManufacturerId(manufacturerInfoPO.getId()); crossInfoPO.setManufacturerId(manufacturerInfoPO.getId());
} }
...@@ -103,8 +103,8 @@ public class StaticInfoServiceImpl implements StaticInfoService { ...@@ -103,8 +103,8 @@ public class StaticInfoServiceImpl implements StaticInfoService {
Integer manufacturerId = crossInfoPO.getManufacturerId(); Integer manufacturerId = crossInfoPO.getManufacturerId();
// 获取厂商缩写 // 获取厂商缩写
ManufacturerInfoPO manufacturerInfoPO = manufacturerInfoMapper.selectById(manufacturerId); ManufacturerInfoPO manufacturerInfoPO = manufacturerInfoMapper.selectById(manufacturerId);
String manufacturerAbbr = manufacturerInfoPO.getCode(); String manufacturerCode = manufacturerInfoPO.getCode();
if (Objects.equals(BasicEnum.ManufacturerEnum.HK.getAbbr(), manufacturerAbbr)) { if (Objects.equals(BasicEnum.ManufacturerEnum.HK.getCode(), manufacturerCode)) {
// 海康 // 海康
hkSchemePhaseLightsService.hkSchemePhaseLights(crossId, crossCode); hkSchemePhaseLightsService.hkSchemePhaseLights(crossId, crossCode);
} else { } else {
...@@ -121,9 +121,9 @@ public class StaticInfoServiceImpl implements StaticInfoService { ...@@ -121,9 +121,9 @@ public class StaticInfoServiceImpl implements StaticInfoService {
Integer manufacturerId = crossInfoPO.getManufacturerId(); Integer manufacturerId = crossInfoPO.getManufacturerId();
// 获取厂商缩写 // 获取厂商缩写
ManufacturerInfoPO manufacturerInfoPO = manufacturerInfoMapper.selectById(manufacturerId); ManufacturerInfoPO manufacturerInfoPO = manufacturerInfoMapper.selectById(manufacturerId);
String manufacturerAbbr = manufacturerInfoPO.getCode(); String manufacturerCode = manufacturerInfoPO.getCode();
Integer planNo = planSectionInVO.getPlanNo(); Integer planNo = planSectionInVO.getPlanNo();
if (Objects.equals(BasicEnum.ManufacturerEnum.HK.getAbbr(), manufacturerAbbr)) { if (Objects.equals(BasicEnum.ManufacturerEnum.HK.getCode(), manufacturerCode)) {
// 海康 // 海康
hkPlanSectionService.planSection(crossCode, planNo, crossId); hkPlanSectionService.planSection(crossCode, planNo, crossId);
} else { } else {
...@@ -133,9 +133,9 @@ public class StaticInfoServiceImpl implements StaticInfoService { ...@@ -133,9 +133,9 @@ public class StaticInfoServiceImpl implements StaticInfoService {
@Override @Override
public void crossSchedules(CrossSchedulesInVO crossSchedulesInVO) throws Exception { public void crossSchedules(CrossSchedulesInVO crossSchedulesInVO) throws Exception {
String manufacturerAbbr = crossSchedulesInVO.getManufacturerAbbr(); String manufacturerCode = crossSchedulesInVO.getManufacturerCode();
List<String> crossIdList = crossSchedulesInVO.getCrossIdList(); List<String> crossIdList = crossSchedulesInVO.getCrossIdList();
if (Objects.equals(BasicEnum.ManufacturerEnum.HK.getAbbr(), manufacturerAbbr)) { if (Objects.equals(BasicEnum.ManufacturerEnum.HK.getCode(), manufacturerCode)) {
// 海康 // 海康
hkCrossSchedulesService.crossSchedules(crossIdList); hkCrossSchedulesService.crossSchedules(crossIdList);
} else { } else {
......
package net.wanji.utc.service.systemadmin;
import com.github.pagehelper.PageInfo;
import net.wanji.utc.po.CrossInfoPO;
import net.wanji.utc.vo.systemadmin.CrossInfoListInVO;
/**
* @author Kent HAN
* @date 2022/11/25 8:54
*/
public interface CrossInfoService {
PageInfo<CrossInfoPO> list(CrossInfoListInVO crossInfoListInVO);
}
package net.wanji.utc.service.systemadmin.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import net.wanji.utc.mapper.CrossInfoMapper;
import net.wanji.utc.mapper.ManufacturerInfoMapper;
import net.wanji.utc.po.CrossInfoPO;
import net.wanji.utc.po.ManufacturerApiInfoPO;
import net.wanji.utc.service.systemadmin.CrossInfoService;
import net.wanji.utc.vo.systemadmin.CrossInfoListInVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author Kent HAN
* @date 2022/11/25 8:54
*/
@Service
public class CrossInfoServiceImpl implements CrossInfoService {
@Autowired
ManufacturerInfoMapper manufacturerInfoMapper;
@Autowired
CrossInfoMapper crossInfoMapper;
@Override
public PageInfo<CrossInfoPO> list(CrossInfoListInVO crossInfoListInVO) {
Integer pageNum = crossInfoListInVO.getPageNum();
Integer pageSize = crossInfoListInVO.getPageSize();
String crossName = crossInfoListInVO.getCrossName();
String manufacturerNick = crossInfoListInVO.getManufacturerName();
Integer manufacturerId = null;
if (manufacturerNick != null) {
manufacturerId = manufacturerInfoMapper.selectIdByNick(manufacturerNick);
}
PageHelper.startPage(pageNum, pageSize);
List<CrossInfoPO> crossInfoPOList = crossInfoMapper.selectByOptionals(crossName, manufacturerId);
PageInfo<CrossInfoPO> crossInfoPOPageInfo = new PageInfo<>(crossInfoPOList);
return crossInfoPOPageInfo;
}
}
...@@ -6,7 +6,6 @@ import net.wanji.utc.common.typeenum.ManufacturerApiInfoTypeEnum; ...@@ -6,7 +6,6 @@ import net.wanji.utc.common.typeenum.ManufacturerApiInfoTypeEnum;
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.po.ManufacturerInfoPO;
import net.wanji.utc.service.systemadmin.ManufacturerApiInfoService; import net.wanji.utc.service.systemadmin.ManufacturerApiInfoService;
import net.wanji.utc.vo.systemadmin.DeleteListInVO; import net.wanji.utc.vo.systemadmin.DeleteListInVO;
import net.wanji.utc.vo.systemadmin.ManufacturerApiInfoInsertOrUpdateInVO; import net.wanji.utc.vo.systemadmin.ManufacturerApiInfoInsertOrUpdateInVO;
...@@ -41,10 +40,10 @@ public class ManufacturerApiInfoServiceImpl implements ManufacturerApiInfoServic ...@@ -41,10 +40,10 @@ public class ManufacturerApiInfoServiceImpl implements ManufacturerApiInfoServic
typeCode = ManufacturerApiInfoTypeEnum.getCodeByMsg(typeStr); typeCode = ManufacturerApiInfoTypeEnum.getCodeByMsg(typeStr);
} }
String manufacturerName = manufacturerApiInfoListInVO.getManufacturerName(); String manufacturerNick = manufacturerApiInfoListInVO.getManufacturerNick();
Integer manufacturerId = null; Integer manufacturerId = null;
if (manufacturerName != null) { if (manufacturerNick != null) {
manufacturerId = manufacturerInfoMapper.selectIdByName(manufacturerName); manufacturerId = manufacturerInfoMapper.selectIdByNick(manufacturerNick);
} }
PageHelper.startPage(pageNum, pageSize); PageHelper.startPage(pageNum, pageSize);
...@@ -63,7 +62,7 @@ public class ManufacturerApiInfoServiceImpl implements ManufacturerApiInfoServic ...@@ -63,7 +62,7 @@ public class ManufacturerApiInfoServiceImpl implements ManufacturerApiInfoServic
String typeStr = inVO.getApiType(); String typeStr = inVO.getApiType();
Integer typeCode = ManufacturerApiInfoTypeEnum.getCodeByMsg(typeStr); Integer typeCode = ManufacturerApiInfoTypeEnum.getCodeByMsg(typeStr);
String manufacturerName = inVO.getManufacturerName(); String manufacturerName = inVO.getManufacturerName();
Integer manufacturerId = manufacturerInfoMapper.selectIdByName(manufacturerName); Integer manufacturerId = manufacturerInfoMapper.selectIdByNick(manufacturerName);
manufacturerApiInfoPO.setType(typeCode); manufacturerApiInfoPO.setType(typeCode);
manufacturerApiInfoPO.setManufacturerId(manufacturerId); manufacturerApiInfoPO.setManufacturerId(manufacturerId);
if (id == null || id == 0) { if (id == null || id == 0) {
......
...@@ -30,7 +30,7 @@ public class ManufacturerServiceImpl implements ManufacturerService { ...@@ -30,7 +30,7 @@ public class ManufacturerServiceImpl implements ManufacturerService {
String name = manufacturerListInVO.getName(); String name = manufacturerListInVO.getName();
PageHelper.startPage(pageNum, pageSize); PageHelper.startPage(pageNum, pageSize);
List<ManufacturerInfoPO> manufacturerInfoPOList = manufacturerInfoMapper.selectByOptionalName(name); List<ManufacturerInfoPO> manufacturerInfoPOList = manufacturerInfoMapper.selectByOptionalPartialName(name);
PageInfo<ManufacturerInfoPO> borrowPOPageInfo = new PageInfo<>(manufacturerInfoPOList); PageInfo<ManufacturerInfoPO> borrowPOPageInfo = new PageInfo<>(manufacturerInfoPOList);
return borrowPOPageInfo; return borrowPOPageInfo;
......
...@@ -11,6 +11,6 @@ import lombok.Data; ...@@ -11,6 +11,6 @@ import lombok.Data;
@Data @Data
@ApiModel(value = "CrossInfoInVO", description = "查询信号路口基础信息输入参数") @ApiModel(value = "CrossInfoInVO", description = "查询信号路口基础信息输入参数")
public class CrossInfoInVO { public class CrossInfoInVO {
@ApiModelProperty(value = "厂商缩写 HK-海康") @ApiModelProperty(value = "厂商代码 HK")
String manufacturerAbbr; String manufacturerCode;
} }
...@@ -13,8 +13,8 @@ import java.util.List; ...@@ -13,8 +13,8 @@ import java.util.List;
@Data @Data
@ApiModel(value = "CrossSchedulesInVO", description = "查询时间表数据输入参数") @ApiModel(value = "CrossSchedulesInVO", description = "查询时间表数据输入参数")
public class CrossSchedulesInVO { public class CrossSchedulesInVO {
@ApiModelProperty(value = "厂商缩写 HK-海康") @ApiModelProperty(value = "厂商缩写 HK")
String manufacturerAbbr; String manufacturerCode;
@ApiModelProperty(value = "路口列表") @ApiModelProperty(value = "路口列表")
List<String> crossIdList; List<String> crossIdList;
......
package net.wanji.utc.vo.systemadmin;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author Kent HAN
* @date 2022/11/25 8:55
*/
@Data
public class CrossInfoListInVO {
@ApiModelProperty(required = true, value = "页号")
Integer pageNum;
@ApiModelProperty(required = true, value = "每页记录数")
Integer pageSize;
@ApiModelProperty( value = "路口名称")
String crossName;
@ApiModelProperty( value = "信号机厂商")
String manufacturerName;
}
...@@ -20,5 +20,5 @@ public class ManufacturerApiInfoListInVO { ...@@ -20,5 +20,5 @@ public class ManufacturerApiInfoListInVO {
@ApiModelProperty( value = "接口类型") @ApiModelProperty( value = "接口类型")
String typeStr; String typeStr;
@ApiModelProperty( value = "接口厂商") @ApiModelProperty( value = "接口厂商")
String manufacturerName; String manufacturerNick;
} }
...@@ -64,4 +64,17 @@ ...@@ -64,4 +64,17 @@
select id,name,code,manufacturer_id,ip,port,location,version,model,install_time,gmt_create,gmt_modified select id,name,code,manufacturer_id,ip,port,location,version,model,install_time,gmt_create,gmt_modified
from t_cross_info from t_cross_info
</select> </select>
<select id="selectByOptionals" resultMap="BaseResultMap">
select id,name,code,manufacturer_id,ip,port,location,version,model,install_time,gmt_create,gmt_modified
from t_cross_info
<where>
<if test="crossName != null and name != ''">
AND name LIKE CONCAT('%',#{crossName},'%')
</if>
<if test="manufacturerId != null and manufacturerId != 0">
AND manufacturer_id = #{manufacturerId}
</if>
</where>
</select>
</mapper> </mapper>
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
from t_manufacturer_info from t_manufacturer_info
</select> </select>
<select id="selectByOptionalName" resultMap="BaseResultMap"> <select id="selectByOptionalPartialName" resultMap="BaseResultMap">
select id,code,name,nick_name,address,maintenance_unit,gmt_create,gmt_modified select id,code,name,nick_name,address,maintenance_unit,gmt_create,gmt_modified
from t_manufacturer_info from t_manufacturer_info
<where> <where>
...@@ -77,8 +77,8 @@ ...@@ -77,8 +77,8 @@
order by id order by id
</select> </select>
<select id="selectIdByName" resultType="java.lang.Integer"> <select id="selectIdByNick" resultType="java.lang.Integer">
select id from t_manufacturer_info select id from t_manufacturer_info
where name = #{manufacturerName} where nick_name = #{manufacturerNick}
</select> </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