Commit e31b2a1c authored by hanbing's avatar hanbing

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

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