This commit is contained in:
2024-02-28 17:00:40 +08:00
6 changed files with 84 additions and 19 deletions

View File

@@ -73,16 +73,16 @@ public class CameraService {
public void receiveIdentifyResults(JSONObject jsonObject) throws InterruptedException {
// 区分入场和出场
Integer parking_state = jsonObject.getJSONObject("parking").getInteger("parking_state");
if (parking_state == 1) {
if (parking_state == Constants.one) {
// 入场
String parkingState = "ENTRY";
String result = vehicleEntry(jsonObject, parkingState);
logger.info("车辆入场处理 result:{}", result);
}
if (parking_state == 2) {
if (parking_state == Constants.two) {
// 在场
}
if (parking_state == 4) {
if (parking_state == Constants.four) {
// 出场
vehicleLeave(jsonObject);
}
@@ -346,13 +346,13 @@ public class CameraService {
// 判断降锁是否成功
// 将此降锁指令存入缓存, 在 nettyServer 收到新消息时判断是否是此消息的回复
String redisKey = "plate_number_occupy_order:" + msgId;
String redisKey = CacheConstants.SEND_DROP_LOCK_COMMOND + msgId;
redisCache.setCacheObject(redisKey, command, 5, TimeUnit.MINUTES);
// 延时 3 秒钟, 再查询缓存中是否有此降锁信息的回复
Thread.sleep(3);
String responseRedisKey = "plate_number_occupy_order_response:" + msgId;
String responseRedisKey = CacheConstants.GROUND_LOCK_DEVICE_REPORT + msgId;
Object cacheObject = redisCache.getCacheObject(responseRedisKey);
return cacheObject;
}

View File

@@ -47,6 +47,7 @@ import com.jsowell.pile.vo.base.StationInfoVO;
import com.jsowell.pile.vo.uniapp.InvoiceRecordVO;
import com.jsowell.pile.vo.uniapp.*;
import com.jsowell.pile.vo.web.*;
import com.jsowell.thirdparty.common.CommonService;
import com.jsowell.wxpay.response.WechatPayNotifyParameter;
import org.apache.commons.collections4.CollectionUtils;
import org.slf4j.Logger;
@@ -60,6 +61,7 @@ import java.math.BigDecimal;
import java.text.ParseException;
import java.time.LocalDateTime;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
@Service
@@ -129,6 +131,9 @@ public class OrderService {
@Resource
private ClearingBillInfoService clearingBillInfoService;
@Autowired
private CommonService commonService;
@Resource
private RedisCache redisCache;
@@ -722,6 +727,16 @@ public class OrderService {
pileRemoteService.remoteStopCharging(orderBasicInfo.getPileSn(), orderBasicInfo.getConnectorCode(), orderBasicInfo.getTransactionCode());
log.info("人工结算订单-end orderCode:{}", dto.getOrderCode());
// 异步推送第三方平台订单信息
CompletableFuture.runAsync(() -> {
try {
commonService.commonPushOrderInfo(orderBasicInfo);
} catch (Exception e) {
log.error("人工结算订单 推送第三方平台订单信息error, ", e);
e.printStackTrace();
}
});
return true;
}