Commit e31b2a1c authored by hanbing's avatar hanbing

修改厂商简称字段为厂商代码

parent 4dc2e534
......@@ -152,16 +152,6 @@
</dependencies>
<build>
<resources>
<resource>
<directory>lib</directory>
<targetPath>BOOT-INF/lib/</targetPath>
<includes>
<include>**/*.jar</include>
</includes>
</resource>
</resources>
<plugins>
<!-- 编译插件 -->
<plugin>
......@@ -252,58 +242,58 @@
<!-- mvn clean package -Dmaven.test.skip=true jib:build -DsendCredentialsOverHttp=true -->
<!-- 使用jib 无需深入学习docker, 无需编写Dockerfile -->
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>2.5.2</version>
<configuration>
<!--from节点用来设置镜像的基础镜像,相当于Docerkfile中的FROM关键字-->
<from>
<!--使用harbor上的openjdk镜像-->
<image>10.100.1.87:5000/xinkong/openjdk:8-alpine3.9</image>
<!--harbor服务器的登录信息-->
<auth>
<username>admin</username>
<password>Wanji300552</password>
</auth>
</from>
<to>
<image>10.100.1.87:5000/xinkong/${artifactId}:${version}</image>
<auth>
<username>admin</username>
<password>Wanji300552</password>
</auth>
</to>
<container>
<!--配置jvm虚拟机参数-->
<jvmFlags>
<jvmFlag>-Xms512m</jvmFlag>
</jvmFlags>
<!--配置使用的时区-->
<environment>
<TZ>Asia/Shanghai</TZ>
</environment>
<!--要暴露的端口-->
<ports>
<port>32000</port>
</ports>
<!-- <creationTime>2022-10-14T10:08:59.304+08:00</creationTime>-->
<creationTime>${maven.build.timestamp}</creationTime>
<!-- <plugin>-->
<!-- <groupId>com.google.cloud.tools</groupId>-->
<!-- <artifactId>jib-maven-plugin</artifactId>-->
<!-- <version>2.5.2</version>-->
<!-- <configuration>-->
<!-- &lt;!&ndash;from节点用来设置镜像的基础镜像,相当于Docerkfile中的FROM关键字&ndash;&gt;-->
<!-- <from>-->
<!-- &lt;!&ndash;使用harbor上的openjdk镜像&ndash;&gt;-->
<!-- <image>10.100.1.87:5000/xinkong/openjdk:8-alpine3.9</image>-->
<!-- &lt;!&ndash;harbor服务器的登录信息&ndash;&gt;-->
<!-- <auth>-->
<!-- <username>admin</username>-->
<!-- <password>Wanji300552</password>-->
<!-- </auth>-->
<!-- </from>-->
<!-- <to>-->
<!-- <image>10.100.1.87:5000/xinkong/${artifactId}:${version}</image>-->
<!-- <auth>-->
<!-- <username>admin</username>-->
<!-- <password>Wanji300552</password>-->
<!-- </auth>-->
<!-- </to>-->
<!-- <container>-->
<!-- &lt;!&ndash;配置jvm虚拟机参数&ndash;&gt;-->
<!-- <jvmFlags>-->
<!-- <jvmFlag>-Xms512m</jvmFlag>-->
<!-- </jvmFlags>-->
<!-- &lt;!&ndash;配置使用的时区&ndash;&gt;-->
<!-- <environment>-->
<!-- <TZ>Asia/Shanghai</TZ>-->
<!-- </environment>-->
<!-- &lt;!&ndash;要暴露的端口&ndash;&gt;-->
<!-- <ports>-->
<!-- <port>32000</port>-->
<!-- </ports>-->
<!-- &lt;!&ndash; <creationTime>2022-10-14T10:08:59.304+08:00</creationTime>&ndash;&gt;-->
<!-- <creationTime>${maven.build.timestamp}</creationTime>-->
<mainClass>net.wanji.utc.UtcApplication</mainClass>
</container>
<!--可以进行HTTP-->
<allowInsecureRegistries>true</allowInsecureRegistries>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- <mainClass>net.wanji.utc.UtcApplication</mainClass>-->
<!-- </container>-->
<!-- &lt;!&ndash;可以进行HTTP&ndash;&gt;-->
<!-- <allowInsecureRegistries>true</allowInsecureRegistries>-->
<!-- </configuration>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <phase>package</phase>-->
<!-- <goals>-->
<!-- <goal>build</goal>-->
<!-- </goals>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->
</plugins>
</build>
......
......@@ -122,23 +122,6 @@ public class Constants {
Constants.telesemeLaneRealMap = telesemeLaneRealMap;
}
private static String artemisPath;
@Value("${signal.manufacturer.hk.artemisPath}")
public static void setArtemisPath(String artemisPath) {
Constants.artemisPath = artemisPath;
}
/**
* 根据code获取三方 url
*/
public static Map<String, String> getPathMapByApiCode(String apiCode) {
Map<String, String> res = new HashMap<>();
HttpRequest httpRequest = new HttpRequest(BasicEnum.ManufacturerEnum.HK.getAbbr(), apiCode);
res.put("http://", artemisPath + httpRequest.getUrl());
return res;
}
public static ConcurrentHashMap<String, List<CrossLanesVo>> getTelesemeLaneRealMap() {
return telesemeLaneRealMap;
}
......
......@@ -34,7 +34,7 @@ public class ApiInfoTask {
for (ManufacturerApiInfoPO infoPO : manufacturerApiInfoPOList) {
Integer manufacturerId = infoPO.getManufacturerId();
ManufacturerInfoPO manufacturerInfoPO = manufacturerInfoMapper.selectById(manufacturerId);
String abbr = manufacturerInfoPO.getNickName();
String abbr = manufacturerInfoPO.getCode();
String s = abbr + Constants.SEPARATOR_UNDER_LINE + infoPO.getCode();
Constants.putManufacturerUrlMap(s, infoPO);
}
......
......@@ -3,7 +3,6 @@ package net.wanji.utc.mapper;
import net.wanji.utc.po.ManufacturerInfoPO;
import org.apache.ibatis.annotations.Param;
import java.util.Arrays;
import java.util.List;
/**
......
......@@ -8,6 +8,7 @@ import com.hikvision.artemis.sdk.config.ArtemisConfig;
import lombok.extern.slf4j.Slf4j;
import net.wanji.utc.common.Result;
import net.wanji.utc.common.baseentity.BaseCrossInfo;
import net.wanji.utc.common.commonentity.HttpRequest;
import net.wanji.utc.common.exception.ControlException;
import net.wanji.utc.common.typeenum.BasicEnum;
import net.wanji.utc.mapper.CrossPhaseMapper;
......@@ -23,6 +24,7 @@ import net.wanji.utc.vo.signal.SignalRingVo;
import net.wanji.utc.vo.timeplan.Phase;
import net.wanji.utc.vo.timeplan.Ring;
import net.wanji.utc.vo.timeplan.TimePlanVO;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
......@@ -38,6 +40,8 @@ import static net.wanji.utc.common.constant.Constants.*;
@Slf4j
@Service("hkControlCommandService")
public class HKControlCommandServiceImpl implements ControlCommandService {
@Value("${signal.manufacturer.hk.artemisPath}")
private String artemisPath;
@Resource
private HkGetSignalMethodService hkGetSignalMethodService;
......@@ -236,6 +240,13 @@ public class HKControlCommandServiceImpl implements ControlCommandService {
}
}
private Map<String, String> getPathMapByApiCode(String apiCode) {
Map<String, String> res = new HashMap<>();
HttpRequest httpRequest = new HttpRequest(BasicEnum.ManufacturerEnum.HK.getAbbr(), apiCode);
res.put("http://", artemisPath + httpRequest.getUrl());
return res;
}
@Override
public <T> Result<T> phaseDiffSend() {
return null;
......
......@@ -7,10 +7,13 @@ import com.hikvision.artemis.sdk.ArtemisHttpUtil;
import com.hikvision.artemis.sdk.config.ArtemisConfig;
import lombok.extern.slf4j.Slf4j;
import net.wanji.utc.common.baseentity.BaseCrossInfo;
import net.wanji.utc.common.commonentity.HttpRequest;
import net.wanji.utc.common.constant.Constants;
import net.wanji.utc.common.typeenum.BasicEnum;
import net.wanji.utc.service.HkGetSignalMethodService;
import net.wanji.utc.vo.CrossLanesVo;
import net.wanji.utc.vo.signal.SignalLightStateVo;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
......@@ -30,6 +33,8 @@ import static net.wanji.utc.common.constant.Constants.HK_SUCCESS_CODE;
@Slf4j
@Service
public class HkGetSignalMethodServiceImpl implements HkGetSignalMethodService {
@Value("${signal.manufacturer.hk.artemisPath}")
private String artemisPath;
@Resource
private ArtemisConfig artemisConfig;
......@@ -43,7 +48,7 @@ public class HkGetSignalMethodServiceImpl implements HkGetSignalMethodService {
List<SignalLightStateVo> result = new ArrayList<>();
SignalLightStateVo infoVo;
try {
Map<String, String> path = Constants.getPathMapByApiCode("querySignalInfo");
Map<String, String> path = getPathMapByApiCode("querySignalInfo");
for (BaseCrossInfo entity : baseSignals) {
JSONObject jsonBody = new JSONObject();
jsonBody.put("pageNo", 1);
......@@ -133,6 +138,13 @@ public class HkGetSignalMethodServiceImpl implements HkGetSignalMethodService {
return result;
}
private Map<String, String> getPathMapByApiCode(String apiCode) {
Map<String, String> res = new HashMap<>();
HttpRequest httpRequest = new HttpRequest(BasicEnum.ManufacturerEnum.HK.getAbbr(), apiCode);
res.put("http://", artemisPath + httpRequest.getUrl());
return res;
}
/**
* 灯组颜色转换
*/
......
......@@ -103,7 +103,7 @@ public class StaticInfoServiceImpl implements StaticInfoService {
Integer manufacturerId = crossInfoPO.getManufacturerId();
// 获取厂商缩写
ManufacturerInfoPO manufacturerInfoPO = manufacturerInfoMapper.selectById(manufacturerId);
String manufacturerAbbr = manufacturerInfoPO.getNickName();
String manufacturerAbbr = manufacturerInfoPO.getCode();
if (Objects.equals(BasicEnum.ManufacturerEnum.HK.getAbbr(), manufacturerAbbr)) {
// 海康
hkSchemePhaseLightsService.hkSchemePhaseLights(crossId, crossCode);
......@@ -121,7 +121,7 @@ public class StaticInfoServiceImpl implements StaticInfoService {
Integer manufacturerId = crossInfoPO.getManufacturerId();
// 获取厂商缩写
ManufacturerInfoPO manufacturerInfoPO = manufacturerInfoMapper.selectById(manufacturerId);
String manufacturerAbbr = manufacturerInfoPO.getNickName();
String manufacturerAbbr = manufacturerInfoPO.getCode();
Integer planNo = planSectionInVO.getPlanNo();
if (Objects.equals(BasicEnum.ManufacturerEnum.HK.getAbbr(), manufacturerAbbr)) {
// 海康
......
......@@ -4,8 +4,6 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author Kent HAN
* @date 2022/11/24 9:42
......
......@@ -51,7 +51,7 @@
select
id,code,name,nick_name,address,maintenance_unit,gmt_create,gmt_modified
from t_manufacturer_info
where nick_name = #{abbr}
where code = #{abbr}
</select>
<select id="selectById" resultMap="BaseResultMap">
......
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