作者 朱兆平

Merge branch 'ver_bh_g2_engin_dev' into ver_bh_g2_engin

... ... @@ -5,7 +5,7 @@
<groupId>com.sy</groupId>
<artifactId>analysis_imf</artifactId>
<version>6.0.0-ENGIN-SNAPSHOT</version>
<version>6.0.3-ENGIN-RELEASE</version>
<packaging>jar</packaging>
<name>analysis_imf</name>
<description>北货集成金二抬杆指令判定</description>
... ...
... ... @@ -113,7 +113,7 @@ class G2X21NoticeWithTrue extends Script implements ChannelCheckScript{
/**
* 写入本地验放通过信息
*/
enginCheckService.commandlog(info,true,"双验放:本地验放通过:等待特殊区域验放指令",executeParams);
enginCheckService.commandlog(info,true,"口岸放行,已转至特殊区域验放",executeParams);
... ...
... ... @@ -130,6 +130,7 @@ class LockNoticeCheck extends Script implements ChannelCheckScript {
return true;
}
//关锁通知验放失败
record(info,false,"业务异常:流转业务-关锁验放失败",null);
return false;
}catch (Exception e){
e.printStackTrace();
... ... @@ -163,7 +164,11 @@ class LockNoticeCheck extends Script implements ChannelCheckScript {
*/
LandBusinessTypeList landBusinessTypeList = (LandBusinessTypeList) executeParams.get("ChanelFormInfo");
if (landBusinessTypeList!=null){
if ("调拨业务".equals(landBusinessTypeList.getBusinesstype()) || "分拨业务".equals(landBusinessTypeList.getBusinesstype())) {
if ("调拨业务".equals(landBusinessTypeList.getBusinesstype())
|| "分拨业务".equals(landBusinessTypeList.getBusinesstype())
|| "区港分拨".equals(landBusinessTypeList.getBusinesstype())
|| "区内分拨".equals(landBusinessTypeList.getBusinesstype())
) {
String sfAreaid = "4600541001";
String zbqAreaid = "4600329012";
... ... @@ -190,7 +195,10 @@ class LockNoticeCheck extends Script implements ChannelCheckScript {
//涉及综保区场站的申请不核验关锁业务.
if (carEndstationList.contains(zbqAreaid)) {
if ("分拨业务".equals(landBusinessTypeList.getBusinesstype())){
if ("分拨业务".equals(landBusinessTypeList.getBusinesstype())
|| "区港分拨".equals(landBusinessTypeList.getBusinesstype())
|| "区内分拨".equals(landBusinessTypeList.getBusinesstype())
){
if (info.getChnlno().equals(bh_3_out)) {
log.info("[LOCK-CHECK-TRUE]-分拨业务-综保区北货流转业务,北货区域关锁通知,当前场站北货站");
return NEED_NOTICE;
... ...
package com.sy.groovy
import com.sy.crossDomain.BuildBarCode
import com.sy.mapper.LandListDao
import com.sy.model.GatherInfo
import com.sy.model.LandBusinessTypeList
import com.sy.service.CommandLogService
import com.sy.service.LandBusListService
import com.sy.service.RedisService
import org.basis.enhance.groovy.entity.ExecuteParams
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import org.springframework.context.ApplicationContext
/**
* 流转申请-核销
* 1. 单进单出即核销判定
* 2. 根据申请单中的通道类型及通道信息判定没有未走完的通道类型,可以核销.比如 申请单证的通道只有进通道,车可以走进一,进二,进二入场,走完进一,即可核销.(一线进)
* 3. 只要有进记录或者出记录 就核销
* 4. 用来布尔类型的核销,一般放在其他布尔验放规则的最后.
*/
class X21FormSingileReleaseCheckWithTrue extends Script implements ChannelCheckScript{
private final Logger log = LoggerFactory.getLogger(getClass());
/**x21指令判定
* 传入gatherInfo
*
* 传入从redis读取的申请表体实体,验证
* 进行通道比对
*/
Boolean check(ExecuteParams executeParams) {
try {
int count = 0;
// 获取product对象
GatherInfo gatherInfo = (GatherInfo) executeParams.get("GatherInfo");
if (gatherInfo!=null){
// 调用方法
ApplicationContext context = getContext();
LandBusListService landBusListService = context.getBean(LandBusListService.class)
count = landBusListService.selectHistoryCount(gatherInfo.getBarcode());
if (count>0){
releaseBarCode(gatherInfo,executeParams);
log.info("[Singile-Release-Success]-{}-{}",gatherInfo.getBarcode(),gatherInfo.getVename())
return true;
}else {
log.error("[Singile-Release-Faild]-{}-{}",gatherInfo.getBarcode(),gatherInfo.getVename())
}
}else {
log.error("[Singile-Release-Faild]-核销失败,缺少关键过卡信息");
}
} catch (Exception e){
e.printStackTrace();
log.error("[Singile-Release-With-True-ERR]:",e);
}
return false;
}
@Override
Object run() {
return false;
}
// 获取spring容器
ApplicationContext getContext() {
// 获取spring IOC容器
ApplicationContext context = applicationContext;
return context;
}
void releaseBarCode(GatherInfo info,ExecuteParams executeParams){
ApplicationContext context = getContext();
// 获取容器中的bean
LandListDao landListDao = context.getBean(LandListDao.class);
Boolean devdebug = (Boolean)context.getBean("devdebug");
if (!devdebug){
BuildBarCode.cancleBarCode(info.getVename());
log.info("[流转申请]-二维码已释放:"+info.getVename());
}
int rc = landListDao.releaseBarcode(info.getBarcode());
if (rc>0) {
log.info("[进出场核销]-{}流转已核销:{}",info.getVename(),info.getBarcode());
}else{
log.error("[进出场核销-ERROR]-{}流转未核销成功:{}",info.getVename(),info.getBarcode());
}
//车辆流转申请缓存删除
releaseCache(info,executeParams);
}
void releaseCache(GatherInfo info,ExecuteParams executeParams){
ApplicationContext context = getContext();
// 获取容器中的bean
RedisService redisService = context.getBean(RedisService.class);
//车辆流转申请缓存删除
redisService.del(info.getVename());
//流转申请时生成的临时核碰场站代码列表
redisService.del(info.getVename()+"_endstationList");
//车辆过卡信息缓存删除-X22金二判定时候生成的这个缓存
redisService.del(info.getSeqno());
log.info("[流转缓存]-{}缓存已核销",info.getVename());
//核销记录
releaseRecord(info,executeParams);
}
/**
* 核销记录
*/
void releaseRecord(GatherInfo info,ExecuteParams executeParams){
LandBusinessTypeList chanelFormInfo = (LandBusinessTypeList) executeParams.get("ChanelFormInfo");
ApplicationContext context = getContext();
CommandLogService commandLogService = context.getBean(CommandLogService.class);
commandLogService.commandlog(info,true,"流转核销",chanelFormInfo,null,0.0,0.0,0.0,0.0);
}
}
... ...