update统计信息不在测试环境推送

This commit is contained in:
YAS\29473
2025-11-10 17:07:29 +08:00
parent 8e5c193e77
commit 76fcad70fc
3 changed files with 53 additions and 4 deletions

View File

@@ -4,7 +4,9 @@ import com.alibaba.fastjson2.JSON;
import com.jsowell.common.annotation.Anonymous; import com.jsowell.common.annotation.Anonymous;
import com.jsowell.common.enums.thirdparty.ThirdPartyReturnCodeEnum; import com.jsowell.common.enums.thirdparty.ThirdPartyReturnCodeEnum;
import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum; import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum;
import com.jsowell.common.exception.BusinessException;
import com.jsowell.common.response.RestApiResponse; import com.jsowell.common.response.RestApiResponse;
import com.jsowell.pile.dto.QueryOrderDTO;
import com.jsowell.pile.dto.QueryStartChargeDTO; import com.jsowell.pile.dto.QueryStartChargeDTO;
import com.jsowell.pile.dto.QueryStationInfoDTO; import com.jsowell.pile.dto.QueryStationInfoDTO;
import com.jsowell.pile.thirdparty.CommonParamsDTO; import com.jsowell.pile.thirdparty.CommonParamsDTO;
@@ -199,4 +201,25 @@ public class GuangXiPlatformController extends ThirdPartyBaseController {
return CommonResult.failed("查询已完成订单列表信息接口 error"); return CommonResult.failed("查询已完成订单列表信息接口 error");
} }
/**
* 充电订单信息推送
*/
@PostMapping("/v1/notification_charge_order_info")
public RestApiResponse<?> notification_charge_order_info(@RequestBody QueryOrderDTO dto) {
RestApiResponse<?> response = null;
try {
String result = platformLogic.pushOrderInfo(dto);
response = new RestApiResponse<>(result);
} catch (BusinessException e) {
logger.error("推送充电订单信息 error" , e);
response = new RestApiResponse<>(e.getCode() , e.getMessage());
} catch (Exception e) {
logger.error("推送充电订单信息 error" , e);
response = new RestApiResponse<>(e);
}
logger.info("推送充电订单信息 result:{}" , response);
return response;
}
} }

View File

@@ -272,10 +272,9 @@ public class JsowellTask {
* 推送统计信息 24小时执行一次 * 推送统计信息 24小时执行一次
*/ */
public void pushStatisticsInfo() { public void pushStatisticsInfo() {
//TODO prd环境不执行
String env = SpringUtils.getActiveProfile(); String env = SpringUtils.getActiveProfile();
if (StringUtils.equalsIgnoreCase(env, "prd")) { if (StringUtils.equalsIgnoreCase(env, "pre")) {
log.debug("PRD环境不执行"); log.debug("PRE环境不执行");
return; return;
} }

View File

@@ -21,6 +21,7 @@ import com.jsowell.common.util.StringUtils;
import com.jsowell.pile.domain.AreaCodeInfo; import com.jsowell.pile.domain.AreaCodeInfo;
import com.jsowell.pile.domain.OrderBasicInfo; import com.jsowell.pile.domain.OrderBasicInfo;
import com.jsowell.pile.domain.OrderDetail; import com.jsowell.pile.domain.OrderDetail;
import com.jsowell.pile.dto.QueryOrderDTO;
import com.jsowell.pile.dto.QueryStartChargeDTO; import com.jsowell.pile.dto.QueryStartChargeDTO;
import com.jsowell.pile.dto.QueryStationInfoDTO; import com.jsowell.pile.dto.QueryStationInfoDTO;
import com.jsowell.pile.service.*; import com.jsowell.pile.service.*;
@@ -49,6 +50,7 @@ import com.jsowell.thirdparty.platform.util.ThirdPartyPlatformUtils;
import com.jsowell.thirdparty.service.ThirdpartySecretInfoService; import com.jsowell.thirdparty.service.ThirdpartySecretInfoService;
import com.yi.business.geo.GeoCodeInfo; import com.yi.business.geo.GeoCodeInfo;
import com.yi.business.geo.TermRelationTreeCoordinate; import com.yi.business.geo.TermRelationTreeCoordinate;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -66,6 +68,7 @@ import java.util.stream.Collectors;
* @Date 2024/12/23 14:44:32 * @Date 2024/12/23 14:44:32
*/ */
@Service @Service
@Slf4j
public class GuangXiPlatformServiceImpl implements ThirdPartyPlatformService { public class GuangXiPlatformServiceImpl implements ThirdPartyPlatformService {
// 平台类型 // 平台类型
private final String thirdPlatformType = ThirdPlatformTypeEnum.GUANG_XI_PLATFORM.getTypeCode(); private final String thirdPlatformType = ThirdPlatformTypeEnum.GUANG_XI_PLATFORM.getTypeCode();
@@ -472,6 +475,30 @@ public class GuangXiPlatformServiceImpl implements ThirdPartyPlatformService {
return resultMap; return resultMap;
} }
@Override
public String pushOrderInfo(QueryOrderDTO dto) {
ThirdPartySecretInfoVO wangKuaiDianPlatformSecretInfo = getGuangXiSecretInfo();
// 根据站点id 开始时间,结束时间查询出所有的订单信息
// List<OrderListVO> orderListVOS = orderBasicInfoService.selectOrderBasicInfoList(dto);
List<String> orderCodes = orderBasicInfoService.tempGetOrderCodes(dto);
if (CollectionUtils.isEmpty(orderCodes)) {
return "订单信息为空";
}
// List<String> orderCodeList = orderListVOS.stream().map(OrderListVO::getOrderCode).collect(Collectors.toList());
for (String orderCode : orderCodes) {
try {
String result = notificationChargeOrderInfo(orderCode, wangKuaiDianPlatformSecretInfo);
log.info("订单:{} 推送结果:{}", orderCode, result);
}catch (Exception e) {
log.error("订单:{} 推送error, ", orderCode, e);
}
}
return "Success";
}
/** /**
* 推送已完成订单信息接口 notification_charge_order_info * 推送已完成订单信息接口 notification_charge_order_info
* @param orderCode * @param orderCode
@@ -692,4 +719,4 @@ public class GuangXiPlatformServiceImpl implements ThirdPartyPlatformService {
thirdPartySecretInfoVO.setOurOperatorId(Constants.OPERATORID_JIANG_SU); thirdPartySecretInfoVO.setOurOperatorId(Constants.OPERATORID_JIANG_SU);
return thirdPartySecretInfoVO; return thirdPartySecretInfoVO;
} }
} }