作者 朱兆平

金二路由验证优化,根据场站编号确定此场站是否有申报业务的金二业务配置,再进行判定

@@ -15,7 +15,7 @@ public interface LandRouterConfigDao { @@ -15,7 +15,7 @@ public interface LandRouterConfigDao {
15 15
16 List<LandRouterConfig> selectByGatherInfo(LandRouterConfig record); 16 List<LandRouterConfig> selectByGatherInfo(LandRouterConfig record);
17 17
18 - List<LandRouterConfig> selectByBussType(String businessType); 18 + List<LandRouterConfig> selectByBussType(LandRouterConfig record);
19 19
20 int updateByPrimaryKeySelective(LandRouterConfig record); 20 int updateByPrimaryKeySelective(LandRouterConfig record);
21 21
  1 +package com.sy.model;
  2 +
  3 +import lombok.Data;
  4 +
  5 +
  6 +public enum ChannelEnum {
  7 + WEST_IN_1 ("4604000000","4604333311"),
  8 + WEST_EX_1 ("4604000000","4604333322"),
  9 + NORTH_K1_IN_1 ("4604600000","4604601010"),
  10 + NORTH_K1_EX_1 ("4604600000","4604600010"),
  11 + NORTH_K1_EX_2 ("4604600000","4604600011"),
  12 + NORTH_K3_IN_1 ("4604600000","4604601030"),
  13 + NORTH_K3_EX_1 ("4604600000","4604600030"),
  14 + ZBQ_IN_6 ("4600329012","4600011006"),
  15 + ZBQ_EX_5 ("4600329012","4600010005"),
  16 + ZBQ_NEI_IN_1 ("4612199001","4612031001"),
  17 + ZBQ_NEI_EX_1 ("4612199001","4612030001"),
  18 + ;
  19 +
  20 + private String area;
  21 + private String channel;
  22 +
  23 + ChannelEnum(String area, String channel) {
  24 + this.area = area;
  25 + this.channel = channel;
  26 + }
  27 +
  28 + public String getArea() {
  29 + return area;
  30 + }
  31 +
  32 + public void setArea(String area) {
  33 + this.area = area;
  34 + }
  35 +
  36 + public String getChannel() {
  37 + return channel;
  38 + }
  39 +
  40 + public void setChannel(String channel) {
  41 + this.channel = channel;
  42 + }
  43 +}
@@ -195,7 +195,7 @@ public class MessageRouterX21 implements MessageRouter { @@ -195,7 +195,7 @@ public class MessageRouterX21 implements MessageRouter {
195 */ 195 */
196 private void cacheWithSeqno(GatherInfo info){ 196 private void cacheWithSeqno(GatherInfo info){
197 if (info!=null && StringUtils.isNotEmpty(info.getSeqno())) { 197 if (info!=null && StringUtils.isNotEmpty(info.getSeqno())) {
198 - redisService.set(info.getSeqno(), JSON.toJSONString(info),60*60*24); 198 + redisService.set(info.getSeqno(), JSON.toJSONString(info),60*60*24*3);
199 } 199 }
200 } 200 }
201 201
@@ -82,7 +82,7 @@ public class MessageRouterX22 implements MessageRouter { @@ -82,7 +82,7 @@ public class MessageRouterX22 implements MessageRouter {
82 * 通知卡口 82 * 通知卡口
83 */ 83 */
84 CommandClient.Client(gatherInfo,commandInfoX22.getOpHint()); 84 CommandClient.Client(gatherInfo,commandInfoX22.getOpHint());
85 - record(gatherInfo,false,gatherInfo.getSeqno()+"金二验放失败:"+commandInfoX22.getOpHint(),null); 85 + record(gatherInfo,false,gatherInfo.getSeqno()+"-金二验放失败:"+commandInfoX22.getOpHint(),null);
86 } 86 }
87 } 87 }
88 else{ 88 else{
@@ -37,12 +37,13 @@ @@ -37,12 +37,13 @@
37 and business_type = #{businessType,jdbcType=VARCHAR} 37 and business_type = #{businessType,jdbcType=VARCHAR}
38 </select> 38 </select>
39 39
40 - <select id="selectByBussType" parameterType="java.lang.String" resultMap="BaseResultMap"> 40 + <select id="selectByBussType" parameterType="com.sy.model.LandRouterConfig" resultMap="BaseResultMap">
41 select 41 select
42 <include refid="Base_Column_List" /> 42 <include refid="Base_Column_List" />
43 from land_router_config 43 from land_router_config
44 where 44 where
45 business_type = #{businessType,jdbcType=VARCHAR} 45 business_type = #{businessType,jdbcType=VARCHAR}
  46 + and area_id = #{areaId,jdbcType=VARCHAR}
46 and gather_receiver = 'G2' 47 and gather_receiver = 'G2'
47 and `status` = 'Y' 48 and `status` = 'Y'
48 </select> 49 </select>
@@ -5,6 +5,7 @@ import com.sy.bwAnalysis.GatherInfoAnalysis; @@ -5,6 +5,7 @@ import com.sy.bwAnalysis.GatherInfoAnalysis;
5 import com.sy.bwAnalysis.MessageAnalysis; 5 import com.sy.bwAnalysis.MessageAnalysis;
6 import com.sy.bwAssist.Message; 6 import com.sy.bwAssist.Message;
7 import com.sy.mapper.LandListDao; 7 import com.sy.mapper.LandListDao;
  8 +import com.sy.model.ChannelEnum;
8 import com.sy.model.GatherInfo; 9 import com.sy.model.GatherInfo;
9 import com.sy.service.RedisService; 10 import com.sy.service.RedisService;
10 import com.sy.service.router.MessageRouter; 11 import com.sy.service.router.MessageRouter;
@@ -27,20 +28,6 @@ import javax.annotation.Resource; @@ -27,20 +28,6 @@ import javax.annotation.Resource;
27 public class GatherInfoHandleImplTest { 28 public class GatherInfoHandleImplTest {
28 29
29 30
30 -  
31 - private AnalysisRoute analysisRoute=new AnalysisRoute();  
32 -  
33 - private static String AREA_BEIHUO= "4604600000";  
34 - //一号卡口  
35 - private static String CHANEL_BEIHUO_C1_I1 = "4604601010";  
36 - private static String CHANEL_BEIHUO_C1_E1 = "4604600010";  
37 - private static String CHANEL_BEIHUO_C1_E2 = "4604600011";  
38 - //三号卡卡口一  
39 - private static String CHANEL_BEIHUO_I3 = "4604601030";  
40 - private static String CHANEL_BEIHUO_E3_3= "4604600030";  
41 - //二维码  
42 - private static String BARCODE = "9fc-4149-b8e2-28bfc18cd22b";  
43 -  
44 @Autowired 31 @Autowired
45 RedisService redisService; 32 RedisService redisService;
46 33
@@ -56,15 +43,12 @@ public class GatherInfoHandleImplTest { @@ -56,15 +43,12 @@ public class GatherInfoHandleImplTest {
56 private LandListDao landListDao; 43 private LandListDao landListDao;
57 44
58 //车牌号 45 //车牌号
59 - private String voNo = "豫A61CR7";  
60 - //备案重量  
61 - private String vo_weight = "2000";  
62 - //过卡重量  
63 - private String cross_weight= "2324"; 46 + private String voNo = "豫K823A9";
  47 + //二维码
  48 + private static String BARCODE = "932-4b18-8931-bd28b4e9abc7";
64 //场站编号 49 //场站编号
65 private String areaID = "4604600000"; 50 private String areaID = "4604600000";
66 - //通道编号  
67 - private String chnlNo = "4604601010"; 51 +
68 //进出场类型I/E 52 //进出场类型I/E
69 private String ie = "I"; 53 private String ie = "I";
70 54
@@ -143,7 +127,7 @@ public class GatherInfoHandleImplTest { @@ -143,7 +127,7 @@ public class GatherInfoHandleImplTest {
143 127
144 private static String RESULT_CODE_DES_SUC = "海关放行"; 128 private static String RESULT_CODE_DES_SUC = "海关放行";
145 129
146 - private static String RESULT_CODE_DES_ERR = "不放行"; 130 + private static String RESULT_CODE_DES_ERR = "海关不放行";
147 131
148 //X22指令报文 132 //X22指令报文
149 private static String X22_COMMANDINFO_XML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + 133 private static String X22_COMMANDINFO_XML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
@@ -177,13 +161,12 @@ public class GatherInfoHandleImplTest { @@ -177,13 +161,12 @@ public class GatherInfoHandleImplTest {
177 @Test 161 @Test
178 public void exportDownload_I() { 162 public void exportDownload_I() {
179 //车牌号 163 //车牌号
180 - String voNo = "豫A61CR7";  
181 //过卡重量 164 //过卡重量
182 - String cross_weight= "1660"; 165 + String cross_weight= String.valueOf(5724);
183 //场站编号 166 //场站编号
184 - String areaID = AREA_BEIHUO; 167 + String areaID = ChannelEnum.NORTH_K1_IN_1.getArea();
185 //通道编号 168 //通道编号
186 - String chnlNo = CHANEL_BEIHUO_C1_I1; 169 + String chnlNo = ChannelEnum.NORTH_K1_IN_1.getChannel();
187 //进出场类型I/E 170 //进出场类型I/E
188 String ie = "I"; 171 String ie = "I";
189 //二维码 172 //二维码
@@ -213,14 +196,12 @@ public class GatherInfoHandleImplTest { @@ -213,14 +196,12 @@ public class GatherInfoHandleImplTest {
213 public void exportDownload_E(){ 196 public void exportDownload_E(){
214 PropertyConfigurator.configure("config/log4j.properties"); 197 PropertyConfigurator.configure("config/log4j.properties");
215 198
216 - //车牌号  
217 - String voNo = "豫A61CR7";  
218 //过卡重量 199 //过卡重量
219 - String cross_weight= String.valueOf(1660+24255); 200 + String cross_weight= String.valueOf(4622);
220 //场站编号 201 //场站编号
221 - String areaID = AREA_BEIHUO; 202 + String areaID = ChannelEnum.NORTH_K1_EX_2.getArea();
222 //通道编号 203 //通道编号
223 - String chnlNo = CHANEL_BEIHUO_C1_E1; 204 + String chnlNo = ChannelEnum.NORTH_K1_EX_2.getChannel();
224 //进出场类型I/E 205 //进出场类型I/E
225 String ie = "E"; 206 String ie = "E";
226 //二维码 207 //二维码
@@ -248,10 +229,8 @@ public class GatherInfoHandleImplTest { @@ -248,10 +229,8 @@ public class GatherInfoHandleImplTest {
248 */ 229 */
249 @Test 230 @Test
250 public void X22Test(){ 231 public void X22Test(){
251 -  
252 - landListDao.releaseBarcode("20220624063118000004");  
253 - X22_COMMANDINFO_XML= X22_COMMANDINFO_XML.replace("${AREA_ID}",AREA_BEIHUO)  
254 - .replace("${CHNL_NO}",CHANEL_BEIHUO_C1_E1) 232 + X22_COMMANDINFO_XML= X22_COMMANDINFO_XML.replace("${AREA_ID}",ChannelEnum.NORTH_K1_IN_1.getArea())
  233 + .replace("${CHNL_NO}",ChannelEnum.NORTH_K1_IN_1.getChannel())
255 .replace("${I_E_TYPE}","E") 234 .replace("${I_E_TYPE}","E")
256 .replace("${SEQ_NO}","20220624063118000004") 235 .replace("${SEQ_NO}","20220624063118000004")
257 .replace("${CHECK_RESULT}",CHCEK_RESULT_CODE_E_SUC) 236 .replace("${CHECK_RESULT}",CHCEK_RESULT_CODE_E_SUC)