Commit b576e301 by zhangxk

修改对接车辆类型

1 parent ab87334c
...@@ -86,4 +86,21 @@ public class PropertiesConfiguration { ...@@ -86,4 +86,21 @@ public class PropertiesConfiguration {
return properties; return properties;
} }
/**
* 车牌类型
* 博康的车牌类型指文安的号牌颜色
* @return
*/
@Bean(name = "plateTypeProp")
public Properties plateTypeProp() {
Properties properties = new Properties();
try (InputStream inputStream = PropertiesConfiguration.class.getResourceAsStream("/hpys.properties")) {
properties.load(inputStream);
} catch (Exception e) {
log.error("读取 hpys.properties 失败", e);
}
return properties;
}
} }
...@@ -33,6 +33,8 @@ public class TrafficProcess implements Process { ...@@ -33,6 +33,8 @@ public class TrafficProcess implements Process {
@Resource @Resource
private Properties eventProp; private Properties eventProp;
@Resource @Resource
private Properties plateTypeProp;
@Resource
private FTPClientHelper ftpClientHelper; private FTPClientHelper ftpClientHelper;
...@@ -156,8 +158,9 @@ public class TrafficProcess implements Process { ...@@ -156,8 +158,9 @@ public class TrafficProcess implements Process {
} }
byte[] text = palteNum.getBytes(Charset.forName("GBK")); byte[] text = palteNum.getBytes(Charset.forName("GBK"));
System.arraycopy(text, 0, model.getPlateText(), 0, Math.min(text.length, 16)); System.arraycopy(text, 0, model.getPlateText(), 0, Math.min(text.length, 16));
// todo 车牌类型待实现 //车牌类型
model.setPlateType(1); String colorCode = plateTypeProp.getProperty(plate.getString("color_code"), "5");
model.setPlateType(Integer.valueOf(colorCode));
JSONObject rect = plate.getJSONObject("rect"); JSONObject rect = plate.getJSONObject("rect");
if (rect != null) { if (rect != null) {
Float top = rect.getFloat("top"); Float top = rect.getFloat("top");
......
0=5
3=2
5=4
2=1
9=5
1=3
6=5
7=3
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!