正在显示
16 个修改的文件
包含
452 行增加
和
36 行删除
@@ -10,6 +10,7 @@ spring.cloud.discovery.client.health-indicator.enabled=false | @@ -10,6 +10,7 @@ spring.cloud.discovery.client.health-indicator.enabled=false | ||
10 | spring.cloud.service-registry.auto-registration.register-management=false | 10 | spring.cloud.service-registry.auto-registration.register-management=false |
11 | spring.cloud.features.enabled=false | 11 | spring.cloud.features.enabled=false |
12 | spring.cloud.discovery.enabled=false | 12 | spring.cloud.discovery.enabled=false |
13 | +spring.cloud.config.enabled=false | ||
13 | 14 | ||
14 | spring.devtools.restart.enabled=true | 15 | spring.devtools.restart.enabled=true |
15 | 16 |
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | 5 | ||
6 | <groupId>com.sy</groupId> | 6 | <groupId>com.sy</groupId> |
7 | <artifactId>analysis_imf</artifactId> | 7 | <artifactId>analysis_imf</artifactId> |
8 | - <version>4.5-ENGINE-SNAPSHOT</version> | 8 | + <version>5.0.0-ENGIN-SNAPSHOT</version> |
9 | <packaging>jar</packaging> | 9 | <packaging>jar</packaging> |
10 | <name>analysis_imf</name> | 10 | <name>analysis_imf</name> |
11 | <description>北货集成金二抬杆指令判定</description> | 11 | <description>北货集成金二抬杆指令判定</description> |
@@ -8,8 +8,11 @@ import org.slf4j.Logger | @@ -8,8 +8,11 @@ import org.slf4j.Logger | ||
8 | import org.slf4j.LoggerFactory | 8 | import org.slf4j.LoggerFactory |
9 | import org.springframework.context.ApplicationContext | 9 | import org.springframework.context.ApplicationContext |
10 | 10 | ||
11 | -//通道申请信息验放 | ||
12 | -class BaseFormCacheCheck extends Script { | 11 | +/** |
12 | + * 基本验放 | ||
13 | + * 流转申请信息验放 | ||
14 | + */ | ||
15 | +class BaseFormCacheCheck extends Script implements ChannelCheckScript { | ||
13 | 16 | ||
14 | private final Logger logger = LoggerFactory.getLogger(getClass()); | 17 | private final Logger logger = LoggerFactory.getLogger(getClass()); |
15 | private final String CHANEL_ERR= "无对应通道流转申请,走错通道"; | 18 | private final String CHANEL_ERR= "无对应通道流转申请,走错通道"; |
@@ -10,8 +10,11 @@ import org.slf4j.Logger | @@ -10,8 +10,11 @@ import org.slf4j.Logger | ||
10 | import org.slf4j.LoggerFactory | 10 | import org.slf4j.LoggerFactory |
11 | import org.springframework.context.ApplicationContext | 11 | import org.springframework.context.ApplicationContext |
12 | 12 | ||
13 | -//基本信息验放 | ||
14 | -class BaseVeCheck extends Script { | 13 | +/** |
14 | + * 基本验放 | ||
15 | + * 车辆备案验放 | ||
16 | + */ | ||
17 | +class BaseVeCheck extends Script implements ChannelCheckScript { | ||
15 | 18 | ||
16 | private final Logger logger = LoggerFactory.getLogger(getClass()); | 19 | private final Logger logger = LoggerFactory.getLogger(getClass()); |
17 | private final String NORECORD = "车辆未备案或者识别错误,车牌号:"; | 20 | private final String NORECORD = "车辆未备案或者识别错误,车牌号:"; |
@@ -8,8 +8,11 @@ import org.slf4j.Logger | @@ -8,8 +8,11 @@ import org.slf4j.Logger | ||
8 | import org.slf4j.LoggerFactory | 8 | import org.slf4j.LoggerFactory |
9 | import org.springframework.context.ApplicationContext | 9 | import org.springframework.context.ApplicationContext |
10 | 10 | ||
11 | -//基本信息验放 | ||
12 | -class BaseX21GatherInfoCheck extends Script { | 11 | +/** |
12 | + * 基本验放 | ||
13 | + * 过卡信息验放 | ||
14 | + */ | ||
15 | +class BaseX21GatherInfoCheck extends Script implements ChannelCheckScript { | ||
13 | 16 | ||
14 | private final Logger logger = LoggerFactory.getLogger(getClass()); | 17 | private final Logger logger = LoggerFactory.getLogger(getClass()); |
15 | private final String X21_WEIGHT_ERR = "车辆过卡重量异常"; | 18 | private final String X21_WEIGHT_ERR = "车辆过卡重量异常"; |
1 | +package com.sy.groovy | ||
2 | + | ||
3 | +import com.alibaba.fastjson.JSON | ||
4 | +import com.alibaba.fastjson.JSONArray | ||
5 | +import com.alibaba.fastjson.JSONObject | ||
6 | +import com.sy.model.Feign_Allocate_Search | ||
7 | +import com.sy.model.GatherInfo | ||
8 | +import com.sy.model.LAND_BUSINEESTYPE_LIST_INFO | ||
9 | +import com.sy.model.LandBusinessTypeList | ||
10 | +import com.sy.service.NmmsService | ||
11 | +import com.sy.service.impl.GatherInfoHandle | ||
12 | +import org.basis.enhance.groovy.entity.ExecuteParams | ||
13 | +import org.slf4j.Logger | ||
14 | +import org.slf4j.LoggerFactory | ||
15 | +import org.springframework.context.ApplicationContext | ||
16 | + | ||
17 | +import javax.validation.constraints.NotNull | ||
18 | + | ||
19 | +/** | ||
20 | + * 单证验放 | ||
21 | + * 舱单分拨申请验放 | ||
22 | + */ | ||
23 | +class BillAllocateCheck extends Script implements ChannelCheckScript { | ||
24 | + | ||
25 | + private final Logger logger = LoggerFactory.getLogger(getClass()); | ||
26 | + private final String FENBO = "装载运单的分拨申请舱单未通过校验"; | ||
27 | + | ||
28 | + /**过磅重量判定 | ||
29 | + * 传入gatherInfo,三大属性验证,二维码/车牌/过卡重量 | ||
30 | + * 适用于分拨业务或者调拨业务 | ||
31 | + */ | ||
32 | + Boolean check(ExecuteParams executeParams) { | ||
33 | + try{ | ||
34 | + GatherInfo gatherInfo = (GatherInfo) executeParams.get("gatherInfo"); | ||
35 | + LandBusinessTypeList landBusinessTypeList = (LandBusinessTypeList) executeParams.get("ChanelFormInfo"); | ||
36 | + List<LAND_BUSINEESTYPE_LIST_INFO> listinfos = (List<LAND_BUSINEESTYPE_LIST_INFO>) executeParams.get("ChanelFormBillLists"); | ||
37 | + | ||
38 | + // 调用方法 | ||
39 | + ApplicationContext context = getContext(); | ||
40 | + // 获取容器中的bean | ||
41 | + GatherInfoHandle gatherInfoHandle = context.getBean(GatherInfoHandle.class); | ||
42 | + | ||
43 | + boolean allocatCheck = checkNmmsAllocate(landBusinessTypeList.getMasterList()); | ||
44 | + | ||
45 | + if(!allocatCheck){ | ||
46 | + logger.error("[分拨业务]-分拨申请舱单未通过校验:"+FENBO); | ||
47 | + gatherInfoHandle.sendBw(gatherInfo,false,FENBO,landBusinessTypeList,listinfos); | ||
48 | + return false; | ||
49 | + } | ||
50 | + return true; | ||
51 | + | ||
52 | + }catch (Exception e){ | ||
53 | + e.printStackTrace(); | ||
54 | + logger.error("[BillAllocateCheck-ERROR]:",e); | ||
55 | + return false; | ||
56 | + } | ||
57 | + } | ||
58 | + | ||
59 | + @Override | ||
60 | + Object run() { | ||
61 | + return null | ||
62 | + } | ||
63 | + | ||
64 | + // 获取spring容器 | ||
65 | + ApplicationContext getContext() { | ||
66 | + // 获取spring IOC容器 | ||
67 | + ApplicationContext context = applicationContext; | ||
68 | + return context; | ||
69 | + } | ||
70 | + | ||
71 | + /** | ||
72 | + * 新舱单分拨申请数据查询 | ||
73 | + * @param waybill 查询的运单号 | ||
74 | + * @return | ||
75 | + */ | ||
76 | + private Map nmmsAllocate(@NotNull String waybill){ | ||
77 | + logger.info("新舱单查询分拨申请数据开始"); | ||
78 | + Feign_Allocate_Search feignAllocateSearch = new Feign_Allocate_Search(waybill,0,10); | ||
79 | + ApplicationContext context = getContext(); | ||
80 | + NmmsService nmmsService = context.getBean(NmmsService.class) | ||
81 | + Map map = nmmsService.getAllocate(feignAllocateSearch); | ||
82 | + logger.info(""+map); | ||
83 | + return map; | ||
84 | + } | ||
85 | + | ||
86 | + | ||
87 | + /** | ||
88 | + * 分拨申请查询 | ||
89 | + * @param waybill | ||
90 | + * @return | ||
91 | + */ | ||
92 | + private boolean checkNmmsAllocate(String waybill){ | ||
93 | + if (waybill.length() < 1) { | ||
94 | + return false; | ||
95 | + } | ||
96 | + waybill = waybill.replace("-", ""); | ||
97 | + //中文逗号替换 | ||
98 | + waybill = waybill.replace(",", ","); | ||
99 | + String[] maifest = waybill.split(","); | ||
100 | + logger.info("运单列表:" + waybill); | ||
101 | + boolean flag = false; | ||
102 | + | ||
103 | + for (String awb : maifest) { | ||
104 | + Map map= nmmsAllocate(awb); | ||
105 | + if (map.containsKey("reslut")){ | ||
106 | + String result = map.get("reslut").toString(); | ||
107 | + JSONObject jsonObject = JSON.parseObject(result); | ||
108 | + if (jsonObject.containsKey("ds")) { | ||
109 | + JSONArray ds = jsonObject.getJSONArray("ds"); | ||
110 | + JSONObject awbinfo = ds.getJSONObject(0); | ||
111 | + if (awbinfo.containsKey("RECEIPTINFORMATION")){ | ||
112 | + if (awbinfo.getString("RECEIPTINFORMATION").contains("39301") || awbinfo.getString("RECEIPTINFORMATION").contains("39103")){ | ||
113 | + log.info("运单:{},分拨回执查询结果:{}",awb,awbinfo.getString("RECEIPTINFORMATION")); | ||
114 | + }else { | ||
115 | + log.info("运单{}分拨申请回执不正常:{}",awb,awbinfo.getString("RECEIPTINFORMATION")); | ||
116 | + return false; | ||
117 | + } | ||
118 | + } | ||
119 | + }else { | ||
120 | + logger.info("运单:{}分拨申请回执未查询到,或未进行分拨申请",awb); | ||
121 | + return false; | ||
122 | + } | ||
123 | + }else{ | ||
124 | + logger.info("运单:{}分拨申请回执未查询到,或未进行分拨申请",awb); | ||
125 | + return false; | ||
126 | + } | ||
127 | + | ||
128 | + } | ||
129 | + return true; | ||
130 | + } | ||
131 | +} |
@@ -11,8 +11,11 @@ import org.slf4j.Logger | @@ -11,8 +11,11 @@ import org.slf4j.Logger | ||
11 | import org.slf4j.LoggerFactory | 11 | import org.slf4j.LoggerFactory |
12 | import org.springframework.context.ApplicationContext | 12 | import org.springframework.context.ApplicationContext |
13 | 13 | ||
14 | -//过卡单证验放-放行验放 | ||
15 | -class ReleaseCheck extends Script { | 14 | +/** |
15 | + * 单证验放 | ||
16 | + * 放行验放 | ||
17 | + */ | ||
18 | +class BillReleaseCheck extends Script implements ChannelCheckScript { | ||
16 | 19 | ||
17 | private final Logger logger = LoggerFactory.getLogger(getClass()); | 20 | private final Logger logger = LoggerFactory.getLogger(getClass()); |
18 | private final String FANGXING= "有运单未放行"; | 21 | private final String FANGXING= "有运单未放行"; |
@@ -3,11 +3,14 @@ package com.sy.groovy; | @@ -3,11 +3,14 @@ package com.sy.groovy; | ||
3 | import org.basis.enhance.groovy.entity.ExecuteParams; | 3 | import org.basis.enhance.groovy.entity.ExecuteParams; |
4 | 4 | ||
5 | /** | 5 | /** |
6 | - * @author mrz | ||
7 | - * @date 2023-05-01 | ||
8 | - * 规则脚本对应通道验放规则接口类声明 | ||
9 | - * 通道规则验放必须包含check方法,且方法结果为布尔类型,验放通过为true.否则为false | 6 | + * 验放接口 |
10 | */ | 7 | */ |
11 | -public abstract class ChannelCheckScript { | ||
12 | - public abstract Boolean check(ExecuteParams executeParams); | 8 | +public interface ChannelCheckScript { |
9 | + | ||
10 | + /** | ||
11 | + * 验放接口方法 | ||
12 | + * @param executeParams 过卡信息+申报信息+车辆备案+入卡信息 | ||
13 | + * @return true 通过,false 禁行 | ||
14 | + */ | ||
15 | + Boolean check(ExecuteParams executeParams); | ||
13 | } | 16 | } |
src/main/java/com/sy/groovy/G2Notice.groovy
0 → 100644
1 | +package com.sy.groovy | ||
2 | + | ||
3 | +import com.alibaba.fastjson.JSON | ||
4 | +import com.sy.mapper.LandRouterConfigDao | ||
5 | +import com.sy.model.* | ||
6 | +import com.sy.service.CommandLogService | ||
7 | +import com.sy.service.RedisService | ||
8 | +import com.sy.socket.CommandClient | ||
9 | +import org.apache.commons.lang.StringUtils | ||
10 | +import org.basis.enhance.groovy.entity.ExecuteParams | ||
11 | +import org.slf4j.Logger | ||
12 | +import org.slf4j.LoggerFactory | ||
13 | +import org.springframework.context.ApplicationContext | ||
14 | + | ||
15 | +/** | ||
16 | + * 金二验放 | ||
17 | + * 金二通知验放规则 | ||
18 | + * todo:需要改造成验放型.返回true false,某些业务类型需要强制走金二验放,海关智能卡口配置端也是根据通道进行配置的 | ||
19 | + */ | ||
20 | +class G2Notice extends Script implements ChannelCheckScript { | ||
21 | + private final Logger log = LoggerFactory.getLogger(getClass()); | ||
22 | + @Override | ||
23 | + Object run() { | ||
24 | + return null | ||
25 | + } | ||
26 | + | ||
27 | + | ||
28 | + Boolean check(ExecuteParams executeParams) { | ||
29 | + try{ | ||
30 | + /** | ||
31 | + * X21通道信息与流转信息比对 | ||
32 | + * 1. 从缓存获取车辆进出场申请信息,有流转信息再进行通道对碰. | ||
33 | + * 无流转信息则说明缓存失效或者二维码不对. | ||
34 | + */ | ||
35 | + GatherInfo info = (GatherInfo) executeParams.get("gatherInfo"); | ||
36 | + LandBusinessTypeList landBusinessTypeList = (LandBusinessTypeList) executeParams.get("chanelFormInfo"); | ||
37 | + if (landBusinessTypeList!=null){ | ||
38 | + rightChnelCheck(landBusinessTypeList.getBusinesstype(),info); | ||
39 | + }else { | ||
40 | + /** | ||
41 | + * 对应进出场申请数据 | ||
42 | + */ | ||
43 | + log.error("[G2]-X21与流转信息核碰失败,未有流转缓存或者二维码对碰不成功"); | ||
44 | + CommandClient.Client(info,"未找到通道对应申报信息,或二维码信息不一致"); | ||
45 | + record(info,false,"[FormCheck]-未找到通道对应申报信息",null); | ||
46 | + } | ||
47 | + }catch (Exception e){ | ||
48 | + e.printStackTrace(); | ||
49 | + log.error("[LockNoticeCheck-ERR]:",e); | ||
50 | + return false; | ||
51 | + } | ||
52 | + } | ||
53 | + | ||
54 | + // 获取spring容器 | ||
55 | + ApplicationContext getContext() { | ||
56 | + // 获取spring IOC容器 | ||
57 | + ApplicationContext context = applicationContext; | ||
58 | + return context; | ||
59 | + } | ||
60 | + | ||
61 | + void rightChnelCheck(String businessType,GatherInfo info){ | ||
62 | + LandRouterConfig landRouterConfig = new LandRouterConfig(); | ||
63 | + landRouterConfig.setBusinessType(businessType); | ||
64 | + landRouterConfig.setAreaId(info.getAreaid()); | ||
65 | + | ||
66 | + ApplicationContext context = getContext(); | ||
67 | + LandRouterConfigDao landRouterConfigDao = context.getBean(LandRouterConfigDao.class); | ||
68 | + //查询此场站此业务类型有无金二业务配置 | ||
69 | + List<LandRouterConfig> routerConfigs = landRouterConfigDao.selectByBussType(landRouterConfig); | ||
70 | + //有金二与业务类型绑定 | ||
71 | + if (!routerConfigs.isEmpty()){ | ||
72 | + /** | ||
73 | + * 路由配置的卡口 是进出卡口都有 还是只有进或者出 | ||
74 | + * 根据X21过的通道类型(进卡口/出卡口)来判定,对应流转申报业务类型 的 进出卡口业务是否有金二通道配置 | ||
75 | + */ | ||
76 | + boolean anyMatch = routerConfigs.stream().anyMatch({router-> router.getChanelType().equals(info.getIetype())}); | ||
77 | + | ||
78 | + /** | ||
79 | + * 有对应卡口进出类型的配置 | ||
80 | + * 继续判定 | ||
81 | + * 1 通道是否走对. 走对 将X21报文给金二,由三宝转成X81 | ||
82 | + * 2 没走对 返回 走错通道.业务结束. | ||
83 | + */ | ||
84 | + if (anyMatch){ | ||
85 | + //是否走对通道的判定 | ||
86 | + for (LandRouterConfig routerConfig : routerConfigs) { | ||
87 | + | ||
88 | + if (routerConfig.getChanelId().equals(info.getChnlno())){ | ||
89 | + /** | ||
90 | + * 查找到金二与通道的验放配置 | ||
91 | + */ | ||
92 | + log.info("[G2-ROUTER]-车辆[{}]流转为金二业务,转金二处理",info.getVename()); | ||
93 | + //缓存X21,用来接收海关的x82指令核对.收到X22指令后进行核销此缓存.走金二验放的才缓存 | ||
94 | + cacheWithSeqno(info); | ||
95 | + log.debug("[G2-ROUTER-CACHE]-车辆[{}]流转已缓存[SEQNO]:{}",info.getVename(),info.getSeqno()); | ||
96 | + //将X21报文发给三宝,让三宝发给金二 | ||
97 | + sendToSample(info); | ||
98 | + record(info,true,"已转金二验放-[SEQN]:"+info.getSeqno(),null); | ||
99 | + log.info("[G2]>>为[金二业务],已将[{}]过卡信息发送与金二",info.getVename()); | ||
100 | + return; | ||
101 | + } | ||
102 | + } | ||
103 | + | ||
104 | + /** | ||
105 | + * 没适配上 为走错通道,走错通道直接给指令,不走本地验放. | ||
106 | + * 为提高抬杆效率 | ||
107 | + */ | ||
108 | + //todo:走错通道的回执指令处理 | ||
109 | + log.info("[rightChnelCheck]-走错通道"); | ||
110 | + CommandClient.Client(info,"G2-走错通道,未找到通道对应申报信息,或二维码信息不一致"); | ||
111 | + record(info,false,"走错通道-[SEQN]:"+info.getSeqno(),null); | ||
112 | + } | ||
113 | + /** | ||
114 | + * 有对应卡口进出类型的配置. | ||
115 | + * 说明没有金二配置 | ||
116 | + * 走本地 | ||
117 | + */ | ||
118 | + else{ | ||
119 | + //没有金二配置,走本地 | ||
120 | +// X21Local(info); | ||
121 | + log.info("[G2Notice-CHECK]-通道[{}]没有G2配置",info.getChnlno()) | ||
122 | + } | ||
123 | + }else { | ||
124 | + | ||
125 | + //没有金二配置,走本地 | ||
126 | +// X21Local(info); | ||
127 | + log.info("[G2Notice-CHECK]-通道[{}]没有G2配置",info.getChnlno()) | ||
128 | + } | ||
129 | + | ||
130 | + } | ||
131 | + | ||
132 | + void record(GatherInfo info, boolean result, String reason, LandBusinessTypeList landBusinessTypeList){ | ||
133 | + ApplicationContext context = getContext(); | ||
134 | + CommandLogService commandLogService = context.getBean(CommandLogService.class); | ||
135 | + commandLogService.commandlog(info,result,reason,landBusinessTypeList,null,0.0,0.0,0.0,0.0); | ||
136 | + } | ||
137 | + | ||
138 | + void sendToSample(GatherInfo info){ | ||
139 | + CommandClient.gatherInfoBuildAndSend(info); | ||
140 | + } | ||
141 | + | ||
142 | + void cacheWithSeqno(GatherInfo info){ | ||
143 | + ApplicationContext context = getContext(); | ||
144 | + RedisService redisService = context.getBean(RedisService.class); | ||
145 | + if (info!=null && StringUtils.isNotEmpty(info.getSeqno())) { | ||
146 | + redisService.set(info.getSeqno(), JSON.toJSONString(info),60*60*24*3); | ||
147 | + } | ||
148 | + } | ||
149 | +} |
1 | +package com.sy.groovy | ||
2 | + | ||
3 | +import com.sy.mapper.LandListDao | ||
4 | +import com.sy.model.GatherInfo | ||
5 | +import com.sy.model.LandBusinessTypeList | ||
6 | +import com.sy.model.LandList | ||
7 | +import com.sy.model.LockFeignResponse | ||
8 | +import com.sy.model.NoticeLock | ||
9 | +import com.sy.service.CommandLogService | ||
10 | +import com.sy.service.CustomsLockService | ||
11 | +import com.sy.service.feigin.LockFeignService | ||
12 | +import com.sy.socket.CommandClient | ||
13 | +import org.apache.commons.lang.StringUtils | ||
14 | +import org.basis.enhance.groovy.entity.ExecuteParams | ||
15 | +import org.slf4j.Logger | ||
16 | +import org.slf4j.LoggerFactory | ||
17 | +import org.springframework.context.ApplicationContext | ||
18 | + | ||
19 | +/** | ||
20 | + * 关锁验放 | ||
21 | + * 关锁通知验放规则 | ||
22 | + */ | ||
23 | +class LockNoticeCheck extends Script implements ChannelCheckScript { | ||
24 | + private final Logger log = LoggerFactory.getLogger(getClass()); | ||
25 | + @Override | ||
26 | + Object run() { | ||
27 | + return null | ||
28 | + } | ||
29 | + | ||
30 | + @Override | ||
31 | + Boolean check(ExecuteParams executeParams) { | ||
32 | + try{ | ||
33 | + /** | ||
34 | + * 入场标识 | ||
35 | + */ | ||
36 | + String IN_TYPE="I"; | ||
37 | + /** | ||
38 | + * 离场标识 | ||
39 | + */ | ||
40 | + String OUT_TYPE="E"; | ||
41 | + GatherInfo info = (GatherInfo) executeParams.get("gatherInfo"); | ||
42 | + // 获取容器中的bean | ||
43 | + // 调用方法 | ||
44 | + ApplicationContext context = getContext(); | ||
45 | + CustomsLockService customsLockService = context.getBean(CustomsLockService.class); | ||
46 | + LandListDao landListDao = context.getBean(LandListDao.class); | ||
47 | + LockFeignService lockFeignService = context.getBean(LockFeignService.class); | ||
48 | + | ||
49 | + //需要关锁业务通知 | ||
50 | + if (customsLockService.lockNoticeCheck(info)){ | ||
51 | + /** | ||
52 | + * 关锁号申请检查 | ||
53 | + * 根据二维码查申请是否有关锁信息,没有查到实体返回null | ||
54 | + */ | ||
55 | + LandList landList = landListDao.selectLockInfoByBarcode(info.getBarcode()); | ||
56 | + if (landList!=null && StringUtils.isNotEmpty(landList.getLockNum())) { | ||
57 | + log.info("[LOCK-CHECK]-流转申请携带关锁,二维码:{}",info.getBarcode()); | ||
58 | + | ||
59 | + NoticeLock noticeLock = new NoticeLock(); | ||
60 | + noticeLock.barcode = info.getBarcode(); | ||
61 | + noticeLock.areaId = info.getAreaid(); | ||
62 | + noticeLock.chnlNo = info.getChnlno(); | ||
63 | + noticeLock.vehicleNo = info.getVename(); | ||
64 | + | ||
65 | + //1. 判定是上锁通知还是解锁通知 | ||
66 | + if (OUT_TYPE.equals(info.getIetype()) && customsLockService.lockCheck(info)) { | ||
67 | + //写入缓存 | ||
68 | + customsLockService.cacheWrite(info); | ||
69 | + //接口通知 | ||
70 | + noticeLock.lockNo =landList.getLockNum(); | ||
71 | + noticeLock.type = "1"; | ||
72 | + LockFeignResponse lockFeignResponse = lockFeignService.noticeLock(noticeLock); | ||
73 | + log.info("[LOCK-API-RSP]-关锁通知接口返回,code:{},message:{},success:{}",lockFeignResponse.code,lockFeignResponse.message,lockFeignResponse.success); | ||
74 | + record(info,false,"关锁施封通知中,等待下一步指令",null); | ||
75 | + return true; | ||
76 | + }else { | ||
77 | + if (IN_TYPE.equals(info.getIetype()) && customsLockService.unLockCheck(info)) { | ||
78 | + customsLockService.cacheWrite(info); | ||
79 | + | ||
80 | + //接口通知 | ||
81 | + noticeLock.lockNo =landList.getLockNum(); | ||
82 | + noticeLock.type = "2"; | ||
83 | + LockFeignResponse lockFeignResponse = lockFeignService.noticeLock(noticeLock); | ||
84 | + log.info("[LOCK-API-RSP]-关锁通知接口返回,code:{},message:{},success:{}",lockFeignResponse.code,lockFeignResponse.message,lockFeignResponse.success); | ||
85 | + record(info,false,"关锁解封通知中,等待下一步指令",null); | ||
86 | + return true; | ||
87 | + } | ||
88 | + } | ||
89 | + }else { | ||
90 | + CommandClient.Client(info,"流转业务-未申请关锁号"); | ||
91 | + record(info,false,"业务异常:流转业务-未申请关锁号",null); | ||
92 | + //这里需要返回true,是关锁业务,但是中断,不抬杆不放行,给予关锁业务异常通知 | ||
93 | + return true; | ||
94 | + } | ||
95 | + } | ||
96 | + return false; | ||
97 | + }catch (Exception e){ | ||
98 | + e.printStackTrace(); | ||
99 | + log.error("[LockNoticeCheck-ERR]:",e); | ||
100 | + return false; | ||
101 | + } | ||
102 | + } | ||
103 | + | ||
104 | + // 获取spring容器 | ||
105 | + ApplicationContext getContext() { | ||
106 | + // 获取spring IOC容器 | ||
107 | + ApplicationContext context = applicationContext; | ||
108 | + return context; | ||
109 | + } | ||
110 | + | ||
111 | + void record(GatherInfo info, boolean result, String reason, LandBusinessTypeList landBusinessTypeList){ | ||
112 | + ApplicationContext context = getContext(); | ||
113 | + CommandLogService commandLogService = context.getBean(CommandLogService.class); | ||
114 | + commandLogService.commandlog(info,result,reason,landBusinessTypeList,null,0.0,0.0,0.0,0.0); | ||
115 | + } | ||
116 | +} |
@@ -10,8 +10,11 @@ import org.slf4j.Logger | @@ -10,8 +10,11 @@ import org.slf4j.Logger | ||
10 | import org.slf4j.LoggerFactory | 10 | import org.slf4j.LoggerFactory |
11 | import org.springframework.context.ApplicationContext | 11 | import org.springframework.context.ApplicationContext |
12 | 12 | ||
13 | -//过卡重量验放-分拨调拨验放 | ||
14 | -class WeightCheckAllocateOrDispatch extends Script { | 13 | +/** |
14 | + * 重量验放 | ||
15 | + * 分拨调拨流转验放 | ||
16 | + */ | ||
17 | +class WeightCheckAllocateOrDispatch extends Script implements ChannelCheckScript { | ||
15 | 18 | ||
16 | private final Logger logger = LoggerFactory.getLogger(getClass()); | 19 | private final Logger logger = LoggerFactory.getLogger(getClass()); |
17 | private final String GROWSSEXCETION = "禁止通行,重量不在可控范围"; | 20 | private final String GROWSSEXCETION = "禁止通行,重量不在可控范围"; |
@@ -10,8 +10,11 @@ import org.slf4j.Logger | @@ -10,8 +10,11 @@ import org.slf4j.Logger | ||
10 | import org.slf4j.LoggerFactory | 10 | import org.slf4j.LoggerFactory |
11 | import org.springframework.context.ApplicationContext | 11 | import org.springframework.context.ApplicationContext |
12 | 12 | ||
13 | -//过卡重量验放-提货验放 | ||
14 | -class WeightCheckEmpty extends Script { | 13 | +/** |
14 | + * 重量验放 | ||
15 | + * 空车验放 | ||
16 | + */ | ||
17 | +class WeightCheckEmpty extends Script implements ChannelCheckScript { | ||
15 | 18 | ||
16 | private final Logger logger = LoggerFactory.getLogger(getClass()); | 19 | private final Logger logger = LoggerFactory.getLogger(getClass()); |
17 | private final String GROWSSEXCETION = "禁止通行,重量不在可控范围"; | 20 | private final String GROWSSEXCETION = "禁止通行,重量不在可控范围"; |
@@ -10,8 +10,11 @@ import org.slf4j.Logger | @@ -10,8 +10,11 @@ import org.slf4j.Logger | ||
10 | import org.slf4j.LoggerFactory | 10 | import org.slf4j.LoggerFactory |
11 | import org.springframework.context.ApplicationContext | 11 | import org.springframework.context.ApplicationContext |
12 | 12 | ||
13 | -//过卡重量验放-送货验放 | ||
14 | -class WeightCheckExportUnload extends Script { | 13 | +/** |
14 | + * 重量验放 | ||
15 | + * 卸货验放 | ||
16 | + */ | ||
17 | +class WeightCheckExportUnload extends Script implements ChannelCheckScript { | ||
15 | 18 | ||
16 | private final Logger logger = LoggerFactory.getLogger(getClass()); | 19 | private final Logger logger = LoggerFactory.getLogger(getClass()); |
17 | private final String GROWSSEXCETION = "禁止通行,重量不在可控范围"; | 20 | private final String GROWSSEXCETION = "禁止通行,重量不在可控范围"; |
@@ -10,8 +10,11 @@ import org.slf4j.Logger | @@ -10,8 +10,11 @@ import org.slf4j.Logger | ||
10 | import org.slf4j.LoggerFactory | 10 | import org.slf4j.LoggerFactory |
11 | import org.springframework.context.ApplicationContext | 11 | import org.springframework.context.ApplicationContext |
12 | 12 | ||
13 | -//过卡重量验放-提货验放 | ||
14 | -class WeightCheckImportDlv extends Script { | 13 | +/** |
14 | + * 重量验放 | ||
15 | + * 提货验放 | ||
16 | + */ | ||
17 | +class WeightCheckImportDlv extends Script implements ChannelCheckScript { | ||
15 | 18 | ||
16 | private final Logger logger = LoggerFactory.getLogger(getClass()); | 19 | private final Logger logger = LoggerFactory.getLogger(getClass()); |
17 | private final String GROWSSEXCETION = "禁止通行,重量不在可控范围"; | 20 | private final String GROWSSEXCETION = "禁止通行,重量不在可控范围"; |
@@ -9,7 +9,11 @@ import org.slf4j.LoggerFactory | @@ -9,7 +9,11 @@ import org.slf4j.LoggerFactory | ||
9 | import org.springframework.context.ApplicationContext | 9 | import org.springframework.context.ApplicationContext |
10 | import java.util.stream.Collectors | 10 | import java.util.stream.Collectors |
11 | 11 | ||
12 | -//申请单核销判定 | 12 | +/** |
13 | + * 流转申请-核销 | ||
14 | + * 1. 所有申请单中的场站出通道出了,可以核销 | ||
15 | + * 2. 根据申请单中的通道类型及通道信息判定没有未走完的通道类型,可以核销.比如 申请单证的通道只有进通道,车可以走进一,进二,进二入场,走完进一,即可核销.(一线进) | ||
16 | + */ | ||
13 | class X21FormReleaseCheck extends Script { | 17 | class X21FormReleaseCheck extends Script { |
14 | 18 | ||
15 | private final Logger logger = LoggerFactory.getLogger(getClass()); | 19 | private final Logger logger = LoggerFactory.getLogger(getClass()); |
-
请 注册 或 登录 后发表评论