作者 朱兆平

关锁业务生产第一环节完结

... ... @@ -17,6 +17,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
@RestController
@RequestMapping("/lock")
@Slf4j
... ... @@ -37,10 +39,10 @@ public class CustomsLockController {
log.info("收到关锁通知");
StringBuilder sb = new StringBuilder();
sb.append("施解封时间:").append(feedBack.locktime).append("\n")
.append("关锁秘钥:").append(feedBack.secret).append("\n")
.append("施解封内容:").append(feedBack.feedbackconten).append("\n")
.append("施解封状态:").append(feedBack.feedbackcode).append("\n");
// sb.append("施解封时间:").append(feedBack.locktime).append("\n")
// .append("关锁秘钥:").append(feedBack.secret).append("\n")
// .append("施解封内容:").append(feedBack.feedbackconten).append("\n")
// .append("施解封状态:").append(feedBack.feedbackcode).append("\n");
String LOCK_TYPE_UNLOCK = "2";
/**
... ... @@ -77,13 +79,16 @@ public class CustomsLockController {
sb.append("关锁缓存信息读取失败");
gatherInfo = new GatherInfo();
gatherInfo.setBarcode(feedBack.barcode);
gatherInfo.setGrosswt(new BigDecimal(0));
commandLogService.commandlog(gatherInfo,false,sb.toString(),null,null,0.0,0.0,0.0,0.0);
log.info("[LOCK-RSP]-关锁缓存信息读取失败");
}
}else {
sb.append("关锁缓存信息读取失败");
sb.append("关锁施解封失败");
GatherInfo gatherInfo = new GatherInfo();
gatherInfo.setBarcode(feedBack.barcode);
gatherInfo.setGrosswt(new BigDecimal(0));
commandLogService.commandlog(gatherInfo,false,sb.toString(),null,null,0.0,0.0,0.0,0.0);
log.info("[LOCK-RSP]-关锁施解封失败");
}
... ...
... ... @@ -27,4 +27,12 @@ public interface RedisService {
* @return
*/
boolean set(String key,String value,long time);
/**
* 计数
* @param key key
* @param delta 步进值
* @return 返回总数
*/
long incr(String key, long delta);
}
... ...
... ... @@ -634,6 +634,10 @@ public class GatherInfoHandle implements GatherInfoService {
List<LandBusinessTypeList> r = landBusinessTypeListList.stream().filter(item ->{
//判断还有没有没有出区的场站,还有没有出区的场站就不核销
log.debug("[releaseFormCheck-Stream-loop]-缓存与已出核碰,缓存元素场站:[{}],已出记录场站:[{}]",item.getEndstation(),businessTypeList.getEndstation());
//解决缓存那里存储有不一样的把人错的的有问题的点,二维码不一致也把缓存删除
if (!item.getBarcode().equals(businessTypeList.getBarcode())){
return true;
}
if(item.getEndstation().equals(businessTypeList.getEndstation())) {
log.info("[releaseFormCheck-Stream-loop]-缓存元素场站:[{}],已出记录场站:[{}]-核销判定对碰成功",item.getEndstation(),businessTypeList.getEndstation());
return true;
... ... @@ -692,6 +696,9 @@ public class GatherInfoHandle implements GatherInfoService {
log.info("[流转缓存]-{}缓存已核销",vaName);
//核销记录
releaseRecord();
//总业务车次计数
gatherInfoHandle.redisService.incr("kako-barcode-total",1);
}
/**
... ... @@ -712,6 +719,8 @@ public class GatherInfoHandle implements GatherInfoService {
if (gatherInfoHandle.debug){
if (check) {
record();
//总进出车次计数
gatherInfoHandle.redisService.incr("kako-total",1);
}
commandlog(info,check,reason,land,list_infos);
return check;
... ... @@ -724,6 +733,9 @@ public class GatherInfoHandle implements GatherInfoService {
log.info("=============>>>>>>>>放行报文发送成功<<<<<<<<<==============");
flag = true;
record();
//总进出车次计数
gatherInfoHandle.redisService.incr("kako-total",1);
} else {
CommandClient.Client(info, reason);
log.info("=============>>>>>>>>重量异常报文发送成功<<<<<<<<<==============");
... ...
... ... @@ -165,6 +165,7 @@ public class RedisServiceImpl implements RedisService {
* @param delta 要增加几(大于0)
* @return
*/
@Override
public long incr(String key, long delta){
if(delta<0){
throw new RuntimeException("递增因子必须大于0");
... ...
... ... @@ -89,19 +89,33 @@ public class CustomsLockServiceImpl implements CustomsLockService {
LandBusinessTypeList landBusinessTypeList = landBusListService.getLandBusinessTypeListByGather(info);
if (landBusinessTypeList!=null){
if ("调拨业务".equals(landBusinessTypeList.getBusinesstype()) || "分拨业务".equals(landBusinessTypeList.getBusinesstype())) {
//综保区场站及内三不通知,顺丰场站不通知
String sfAreaid = "4600541001";
if ("4600329012".equals(landBusinessTypeList.getEndstation())
|| "4612199001".equals(landBusinessTypeList.getEndstation())
|| sfAreaid.equals(landBusinessTypeList.getEndstation())
) {
log.info("[LOCK-CHECK]-综保区及内三场站,顺丰场站,不处理关锁业务,当前场站:{}",landBusinessTypeList.getEndstation());
return false;
}else {
return true;
/**
* 单证验证-取消
*/
String zbqAreaid = "4600329012";
String zbqN3Areaid = "4612199001";
String carEndstationList = redisService.get(info.getVename() + "_endstationList");
if (StringUtils.isNotEmpty(info.getVename()) && StringUtils.isNotEmpty(carEndstationList)){
//涉及综保区场站的申请不核验关锁业务.
if (carEndstationList.contains(zbqAreaid)) {
log.info("[LOCK-CHECK]-申报场站列表包含综保区,不处理关锁业务,当前场站:{}",landBusinessTypeList.getEndstation());
return false;
}
//综保区场站及内三不通知,顺丰场站不通知
if (zbqAreaid.equals(landBusinessTypeList.getEndstation())
|| zbqN3Areaid.equals(landBusinessTypeList.getEndstation())
|| sfAreaid.equals(landBusinessTypeList.getEndstation())
) {
log.info("[LOCK-CHECK]-综保区及内三场站,顺丰场站,不处理关锁业务,当前场站:{}",landBusinessTypeList.getEndstation());
return false;
}else {
return true;
/**
* 单证验证-取消
*/
// List<LAND_BUSINEESTYPE_LIST_INFO> land_busineestype_list_infos = landBusinessTypeList.getLandBusineestypeListInfoList();
// if (!land_busineestype_list_infos.isEmpty()){
// LAND_BUSINEESTYPE_LIST_INFO list_info = land_busineestype_list_infos.stream().parallel()
... ... @@ -114,6 +128,9 @@ public class CustomsLockServiceImpl implements CustomsLockService {
// return true;
// }
// }
}
}else {
return false;
}
}
}else {
... ...