作者 朱兆平

Merge branch 'ver_bh_g2_engin_dev' into ver_bh_g2_engin

@@ -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>6.0.0-ENGIN-SNAPSHOT</version> 8 + <version>6.0.3-ENGIN-RELEASE</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>
@@ -113,7 +113,7 @@ class G2X21NoticeWithTrue extends Script implements ChannelCheckScript{ @@ -113,7 +113,7 @@ class G2X21NoticeWithTrue extends Script implements ChannelCheckScript{
113 /** 113 /**
114 * 写入本地验放通过信息 114 * 写入本地验放通过信息
115 */ 115 */
116 - enginCheckService.commandlog(info,true,"双验放:本地验放通过:等待特殊区域验放指令",executeParams); 116 + enginCheckService.commandlog(info,true,"口岸放行,已转至特殊区域验放",executeParams);
117 117
118 118
119 119
@@ -130,6 +130,7 @@ class LockNoticeCheck extends Script implements ChannelCheckScript { @@ -130,6 +130,7 @@ class LockNoticeCheck extends Script implements ChannelCheckScript {
130 return true; 130 return true;
131 } 131 }
132 //关锁通知验放失败 132 //关锁通知验放失败
  133 + record(info,false,"业务异常:流转业务-关锁验放失败",null);
133 return false; 134 return false;
134 }catch (Exception e){ 135 }catch (Exception e){
135 e.printStackTrace(); 136 e.printStackTrace();
@@ -163,7 +164,11 @@ class LockNoticeCheck extends Script implements ChannelCheckScript { @@ -163,7 +164,11 @@ class LockNoticeCheck extends Script implements ChannelCheckScript {
163 */ 164 */
164 LandBusinessTypeList landBusinessTypeList = (LandBusinessTypeList) executeParams.get("ChanelFormInfo"); 165 LandBusinessTypeList landBusinessTypeList = (LandBusinessTypeList) executeParams.get("ChanelFormInfo");
165 if (landBusinessTypeList!=null){ 166 if (landBusinessTypeList!=null){
166 - if ("调拨业务".equals(landBusinessTypeList.getBusinesstype()) || "分拨业务".equals(landBusinessTypeList.getBusinesstype())) { 167 + if ("调拨业务".equals(landBusinessTypeList.getBusinesstype())
  168 + || "分拨业务".equals(landBusinessTypeList.getBusinesstype())
  169 + || "区港分拨".equals(landBusinessTypeList.getBusinesstype())
  170 + || "区内分拨".equals(landBusinessTypeList.getBusinesstype())
  171 + ) {
167 172
168 String sfAreaid = "4600541001"; 173 String sfAreaid = "4600541001";
169 String zbqAreaid = "4600329012"; 174 String zbqAreaid = "4600329012";
@@ -190,7 +195,10 @@ class LockNoticeCheck extends Script implements ChannelCheckScript { @@ -190,7 +195,10 @@ class LockNoticeCheck extends Script implements ChannelCheckScript {
190 195
191 //涉及综保区场站的申请不核验关锁业务. 196 //涉及综保区场站的申请不核验关锁业务.
192 if (carEndstationList.contains(zbqAreaid)) { 197 if (carEndstationList.contains(zbqAreaid)) {
193 - if ("分拨业务".equals(landBusinessTypeList.getBusinesstype())){ 198 + if ("分拨业务".equals(landBusinessTypeList.getBusinesstype())
  199 + || "区港分拨".equals(landBusinessTypeList.getBusinesstype())
  200 + || "区内分拨".equals(landBusinessTypeList.getBusinesstype())
  201 + ){
194 if (info.getChnlno().equals(bh_3_out)) { 202 if (info.getChnlno().equals(bh_3_out)) {
195 log.info("[LOCK-CHECK-TRUE]-分拨业务-综保区北货流转业务,北货区域关锁通知,当前场站北货站"); 203 log.info("[LOCK-CHECK-TRUE]-分拨业务-综保区北货流转业务,北货区域关锁通知,当前场站北货站");
196 return NEED_NOTICE; 204 return NEED_NOTICE;
  1 +package com.sy.groovy
  2 +
  3 +import com.sy.crossDomain.BuildBarCode
  4 +import com.sy.mapper.LandListDao
  5 +import com.sy.model.GatherInfo
  6 +import com.sy.model.LandBusinessTypeList
  7 +import com.sy.service.CommandLogService
  8 +import com.sy.service.LandBusListService
  9 +import com.sy.service.RedisService
  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 + * 1. 单进单出即核销判定
  18 + * 2. 根据申请单中的通道类型及通道信息判定没有未走完的通道类型,可以核销.比如 申请单证的通道只有进通道,车可以走进一,进二,进二入场,走完进一,即可核销.(一线进)
  19 + * 3. 只要有进记录或者出记录 就核销
  20 + * 4. 用来布尔类型的核销,一般放在其他布尔验放规则的最后.
  21 + */
  22 +class X21FormSingileReleaseCheckWithTrue extends Script implements ChannelCheckScript{
  23 +
  24 + private final Logger log = LoggerFactory.getLogger(getClass());
  25 +
  26 +
  27 + /**x21指令判定
  28 + * 传入gatherInfo
  29 + *
  30 + * 传入从redis读取的申请表体实体,验证
  31 + * 进行通道比对
  32 + */
  33 + Boolean check(ExecuteParams executeParams) {
  34 + try {
  35 + int count = 0;
  36 + // 获取product对象
  37 + GatherInfo gatherInfo = (GatherInfo) executeParams.get("GatherInfo");
  38 + if (gatherInfo!=null){
  39 + // 调用方法
  40 + ApplicationContext context = getContext();
  41 + LandBusListService landBusListService = context.getBean(LandBusListService.class)
  42 + count = landBusListService.selectHistoryCount(gatherInfo.getBarcode());
  43 + if (count>0){
  44 + releaseBarCode(gatherInfo,executeParams);
  45 + log.info("[Singile-Release-Success]-{}-{}",gatherInfo.getBarcode(),gatherInfo.getVename())
  46 + return true;
  47 + }else {
  48 + log.error("[Singile-Release-Faild]-{}-{}",gatherInfo.getBarcode(),gatherInfo.getVename())
  49 + }
  50 + }else {
  51 + log.error("[Singile-Release-Faild]-核销失败,缺少关键过卡信息");
  52 + }
  53 +
  54 + } catch (Exception e){
  55 + e.printStackTrace();
  56 + log.error("[Singile-Release-With-True-ERR]:",e);
  57 + }
  58 + return false;
  59 + }
  60 +
  61 + @Override
  62 + Object run() {
  63 + return false;
  64 + }
  65 +
  66 + // 获取spring容器
  67 + ApplicationContext getContext() {
  68 + // 获取spring IOC容器
  69 + ApplicationContext context = applicationContext;
  70 + return context;
  71 + }
  72 +
  73 + void releaseBarCode(GatherInfo info,ExecuteParams executeParams){
  74 + ApplicationContext context = getContext();
  75 + // 获取容器中的bean
  76 + LandListDao landListDao = context.getBean(LandListDao.class);
  77 + Boolean devdebug = (Boolean)context.getBean("devdebug");
  78 +
  79 + if (!devdebug){
  80 + BuildBarCode.cancleBarCode(info.getVename());
  81 + log.info("[流转申请]-二维码已释放:"+info.getVename());
  82 + }
  83 +
  84 + int rc = landListDao.releaseBarcode(info.getBarcode());
  85 + if (rc>0) {
  86 + log.info("[进出场核销]-{}流转已核销:{}",info.getVename(),info.getBarcode());
  87 + }else{
  88 + log.error("[进出场核销-ERROR]-{}流转未核销成功:{}",info.getVename(),info.getBarcode());
  89 + }
  90 + //车辆流转申请缓存删除
  91 + releaseCache(info,executeParams);
  92 +
  93 + }
  94 +
  95 + void releaseCache(GatherInfo info,ExecuteParams executeParams){
  96 +
  97 + ApplicationContext context = getContext();
  98 + // 获取容器中的bean
  99 + RedisService redisService = context.getBean(RedisService.class);
  100 +
  101 + //车辆流转申请缓存删除
  102 + redisService.del(info.getVename());
  103 + //流转申请时生成的临时核碰场站代码列表
  104 + redisService.del(info.getVename()+"_endstationList");
  105 + //车辆过卡信息缓存删除-X22金二判定时候生成的这个缓存
  106 + redisService.del(info.getSeqno());
  107 + log.info("[流转缓存]-{}缓存已核销",info.getVename());
  108 + //核销记录
  109 + releaseRecord(info,executeParams);
  110 + }
  111 +
  112 + /**
  113 + * 核销记录
  114 + */
  115 + void releaseRecord(GatherInfo info,ExecuteParams executeParams){
  116 + LandBusinessTypeList chanelFormInfo = (LandBusinessTypeList) executeParams.get("ChanelFormInfo");
  117 + ApplicationContext context = getContext();
  118 + CommandLogService commandLogService = context.getBean(CommandLogService.class);
  119 + commandLogService.commandlog(info,true,"流转核销",chanelFormInfo,null,0.0,0.0,0.0,0.0);
  120 + }
  121 +
  122 +}