mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-19 18:45:03 +08:00
update统计信息不在测试环境推送
This commit is contained in:
@@ -4,7 +4,9 @@ import com.alibaba.fastjson2.JSON;
|
||||
import com.jsowell.common.annotation.Anonymous;
|
||||
import com.jsowell.common.enums.thirdparty.ThirdPartyReturnCodeEnum;
|
||||
import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum;
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
import com.jsowell.common.response.RestApiResponse;
|
||||
import com.jsowell.pile.dto.QueryOrderDTO;
|
||||
import com.jsowell.pile.dto.QueryStartChargeDTO;
|
||||
import com.jsowell.pile.dto.QueryStationInfoDTO;
|
||||
import com.jsowell.pile.thirdparty.CommonParamsDTO;
|
||||
@@ -199,4 +201,25 @@ public class GuangXiPlatformController extends ThirdPartyBaseController {
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -272,10 +272,9 @@ public class JsowellTask {
|
||||
* 推送统计信息 24小时执行一次
|
||||
*/
|
||||
public void pushStatisticsInfo() {
|
||||
//TODO prd环境不执行
|
||||
String env = SpringUtils.getActiveProfile();
|
||||
if (StringUtils.equalsIgnoreCase(env, "prd")) {
|
||||
log.debug("PRD环境不执行");
|
||||
if (StringUtils.equalsIgnoreCase(env, "pre")) {
|
||||
log.debug("PRE环境不执行");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.pile.domain.AreaCodeInfo;
|
||||
import com.jsowell.pile.domain.OrderBasicInfo;
|
||||
import com.jsowell.pile.domain.OrderDetail;
|
||||
import com.jsowell.pile.dto.QueryOrderDTO;
|
||||
import com.jsowell.pile.dto.QueryStartChargeDTO;
|
||||
import com.jsowell.pile.dto.QueryStationInfoDTO;
|
||||
import com.jsowell.pile.service.*;
|
||||
@@ -49,6 +50,7 @@ import com.jsowell.thirdparty.platform.util.ThirdPartyPlatformUtils;
|
||||
import com.jsowell.thirdparty.service.ThirdpartySecretInfoService;
|
||||
import com.yi.business.geo.GeoCodeInfo;
|
||||
import com.yi.business.geo.TermRelationTreeCoordinate;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -66,6 +68,7 @@ import java.util.stream.Collectors;
|
||||
* @Date 2024/12/23 14:44:32
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class GuangXiPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
// 平台类型
|
||||
private final String thirdPlatformType = ThirdPlatformTypeEnum.GUANG_XI_PLATFORM.getTypeCode();
|
||||
@@ -472,6 +475,30 @@ public class GuangXiPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
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
|
||||
* @param orderCode
|
||||
@@ -692,4 +719,4 @@ public class GuangXiPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
thirdPartySecretInfoVO.setOurOperatorId(Constants.OPERATORID_JIANG_SU);
|
||||
return thirdPartySecretInfoVO;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user