mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
Merge branch 'dev' into dev-g
This commit is contained in:
@@ -22,6 +22,7 @@ import com.jsowell.common.core.domain.ykc.TransactionRecordsData;
|
||||
import com.jsowell.common.core.redis.RedisCache;
|
||||
import com.jsowell.common.enums.adapay.AdapayStatusEnum;
|
||||
import com.jsowell.common.enums.adapay.MerchantDelayModeEnum;
|
||||
import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum;
|
||||
import com.jsowell.common.enums.ykc.*;
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
@@ -34,7 +35,13 @@ import com.jsowell.pile.service.programlogic.AbstractProgramLogic;
|
||||
import com.jsowell.pile.service.programlogic.ProgramLogicFactory;
|
||||
import com.jsowell.pile.transaction.dto.OrderTransactionDTO;
|
||||
import com.jsowell.pile.transaction.service.TransactionService;
|
||||
import com.jsowell.pile.vo.ThirdPartySecretInfoVO;
|
||||
import com.jsowell.pile.vo.base.StationInfoVO;
|
||||
import com.jsowell.pile.vo.uniapp.business.BusinessOrderDetailInfoVO;
|
||||
import com.jsowell.pile.vo.web.*;
|
||||
import com.jsowell.thirdparty.common.CommonService;
|
||||
import com.jsowell.thirdparty.platform.dto.PushOrderDTO;
|
||||
import com.jsowell.thirdparty.service.ThirdpartySecretInfoService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -117,6 +124,15 @@ public class TempService {
|
||||
@Autowired
|
||||
private OrderUnsplitRecordService orderUnsplitRecordService;
|
||||
|
||||
@Autowired
|
||||
private ThirdpartySecretInfoService thirdpartySecretInfoService;
|
||||
|
||||
@Autowired
|
||||
private ThirdPartyStationRelationService thirdPartyStationRelationService;
|
||||
|
||||
@Autowired
|
||||
private CommonService commonService;
|
||||
|
||||
/**
|
||||
* 计算订单耗电量
|
||||
* 内蒙古站点
|
||||
@@ -1187,5 +1203,55 @@ public class TempService {
|
||||
logger.info("debugOrder结束, resultMap:{}", JSONObject.toJSONString(resultMap));
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
public void sendOrderData2Mq(String orderCode) {
|
||||
// 通过订单编号查询订单信息
|
||||
OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
||||
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderCode);
|
||||
if (orderBasicInfo == null || orderDetail == null) {
|
||||
return;
|
||||
}
|
||||
// 发送消息
|
||||
AfterSettleOrderDTO afterSettleOrderDTO = AfterSettleOrderDTO.builder()
|
||||
.orderCode(orderBasicInfo.getOrderCode())
|
||||
.merchantId(orderBasicInfo.getMerchantId())
|
||||
.stationId(orderBasicInfo.getStationId())
|
||||
.orderPayAmount(orderBasicInfo.getPayAmount()) // 支付金额
|
||||
.orderConsumeAmount(orderBasicInfo.getOrderAmount()) // 消费金额
|
||||
.orderSettleAmount(orderBasicInfo.getSettleAmount()) // 结算金额
|
||||
.orderElectricityAmount(orderDetail.getTotalElectricityAmount()) // 电费金额
|
||||
.orderElectricityDiscountAmount(orderDetail.getDiscountElectricityAmount()) // 电费折扣金额
|
||||
.orderServiceAmount(orderDetail.getTotalServiceAmount()) // 服务费金额
|
||||
.orderServiceDiscountAmount(orderDetail.getDiscountServiceAmount()) // 服务费折扣金额
|
||||
.orderRefundAmount(orderBasicInfo.getRefundAmount()) // 退款金额
|
||||
.build();
|
||||
|
||||
rabbitTemplate.convertAndSend(RabbitConstants.YKC_EXCHANGE_NAME, RabbitConstants.QUEUE_CHARGE_ORDER_DATA, afterSettleOrderDTO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据时间区间批量推送订单
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
public void pushOrderInfoBatch(PushOrderDTO dto) {
|
||||
// 根据type查出对接的stationIds
|
||||
List<StationInfoVO> stationInfoVOS = thirdPartyStationRelationService.selectStationList(dto.getThirdPartyType());
|
||||
|
||||
List<String> stationIds = stationInfoVOS.stream()
|
||||
.map(StationInfoVO::getStationId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 批量查询需要推送的订单
|
||||
List<OrderBasicInfo> orderInfos = orderBasicInfoService.getOrderBasicInfoByTimeInterval(stationIds, dto.getStartTime(), dto.getEndTime());
|
||||
|
||||
if (CollectionUtils.isEmpty(orderInfos)) {
|
||||
return;
|
||||
}
|
||||
orderInfos.forEach(orderBasicInfo -> {
|
||||
// 推送第三方平台
|
||||
commonService.commonPushOrderInfoV2(orderBasicInfo);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user