puzhibing
2026-08-14 74bce573f6eb00f9f4942afd903cfad53addc9cf
ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/drainage/TCECController.java
@@ -92,6 +92,9 @@
   private SystemConfigurationClient systemConfigurationClient;
   @Autowired
   private TCECSuperviseUtil tcecSuperviseUtil;
    ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(10, 50, 1L, TimeUnit.MINUTES, new LinkedBlockingQueue<Runnable>());
   private final static String operatorId = "906171535";
   
   /**
@@ -931,7 +934,7 @@
      NotificationStationChangeResult notificationStationChange = TCECKDUtil.notificationStationChange(operator, 3, siteIds);
      //启动重试推送机制
      if(null == notificationStationChange || 1 == notificationStationChange.getSuccStat()){
         ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>());
         threadPoolExecutor.execute(new Runnable() {
            //计数器
            Integer size = 0;
@@ -1093,7 +1096,6 @@
      //启动重试推送机制
      if(null == notificationStartChargeResult || 1 == notificationStartChargeResult.getSuccStat()){
         
         ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>());
         threadPoolExecutor.execute(new Runnable() {
            //计数器
            Integer size = 0;
@@ -1291,7 +1293,6 @@
      NotificationEquipChargeStatusResult notificationEquipChargeStatusResult = TCECUtil.notificationEquipChargeStatus(operator, queryEquipChargeStatusResult);
      //启动重试推送机制
      if(null == notificationEquipChargeStatusResult || 1 == notificationEquipChargeStatusResult.getSuccStat()){
         ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>());
         threadPoolExecutor.execute(new Runnable() {
            //计数器
            Integer size = 0;
@@ -1384,17 +1385,26 @@
   @PostMapping("/notificationStopChargeResult")
   public R notificationStopChargeResult(@RequestParam("startChargeSeq") String startChargeSeq, @RequestParam("connectorID") String connectorID,
                                         @RequestParam("operatorId") Integer operatorId){
        TChargingOrder chargingOrder = chargingOrderClient.getChargingOrderByStartChargeSeq(startChargeSeq).getData();
        if(null == chargingOrder){
            return null;
        }
        List<TChargingOrderAccountingStrategy> data = chargingOrderAccountingStrategyClient.getChargingOrderAccountingStrategyByOrderId(chargingOrder.getId()).getData();
      Operator operator = operatorClient.getOperatorById(operatorId).getData();
      NotificationStopChargeResult info = new NotificationStopChargeResult();
      info.setStartChargeSeq(startChargeSeq);
      info.setStartChargeSeqStat(4);
      info.setConnectorID(connectorID);
      info.setSuccStat(0);
      info.setFailReason(0);
        info.setStartChargeSeqStat(4);
        if(data.isEmpty()){
            info.setSuccStat(1);
            info.setFailReason(3);
        }else{
            info.setSuccStat(0);
            info.setFailReason(0);
        }
      NotificationStopCharge notificationStopCharge = TCECUtil.notificationStopChargeResult(operator, info);
      //启动重试推送机制
      if(null == notificationStopCharge || 1 == notificationStopCharge.getSuccStat()){
         ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>());
         threadPoolExecutor.execute(new Runnable() {
            //计数器
            Integer size = 0;
@@ -1432,11 +1442,13 @@
   @PostMapping("/notificationChargeOrderInfo")
   public R notificationChargeOrderInfo(@RequestParam("startChargeSeq") String startChargeSeq, @RequestParam("operatorId") Integer operatorId){
      NotificationChargeOrderInfo info = buildNotificationChargeOrderInfo(startChargeSeq);
      if(null == info){
         return R.fail("引流平台同步数据失败");
      }
      Operator operator = operatorClient.getOperatorById(operatorId).getData();
      NotificationChargeOrderInfoResult notificationChargeOrderInfoResult = TCECUtil.notificationChargeOrderInfo(operator, info);
      //启动重试推送机制
      if(null == notificationChargeOrderInfoResult || 1 == notificationChargeOrderInfoResult.getConfirmResult()){
         ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>());
         threadPoolExecutor.execute(new Runnable() {
            //计数器
            Integer size = 0;
@@ -1487,6 +1499,9 @@
      notificationChargeOrderInfo.setTotalPower(chargingOrder.getElectricity());
      
      List<TChargingOrderAccountingStrategy> data = chargingOrderAccountingStrategyClient.getChargingOrderAccountingStrategyByOrderId(chargingOrder.getId()).getData();
      if(data.isEmpty()){
         return null;
      }
      if(data.size() > 0){
         BigDecimal totalElectricity = data.stream().map(TChargingOrderAccountingStrategy::getPeriodElectricPrice).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(4, RoundingMode.HALF_EVEN);
         BigDecimal serviceCharge = data.stream().map(TChargingOrderAccountingStrategy::getPeriodServicePrice).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(4, RoundingMode.HALF_EVEN);