mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
update 查询未开发票站点列表
This commit is contained in:
@@ -17,6 +17,7 @@ import com.jsowell.pile.dto.QueryOrderDTO;
|
||||
import com.jsowell.pile.dto.SettleOrderDTO;
|
||||
import com.jsowell.pile.dto.StopChargingDTO;
|
||||
import com.jsowell.pile.dto.UniAppQueryOrderDTO;
|
||||
import com.jsowell.pile.vo.base.StationInfoVO;
|
||||
import com.jsowell.pile.vo.uniapp.OrderVO;
|
||||
import com.jsowell.pile.vo.uniapp.UniAppOrderVO;
|
||||
import com.jsowell.service.OrderService;
|
||||
@@ -269,6 +270,35 @@ public class OrderController extends BaseController {
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询未开发票的站点list
|
||||
* http://localhost:8080/uniapp/order/queryUninvoicedStationList
|
||||
* @param request
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/queryUninvoicedStationList")
|
||||
public RestApiResponse<?> queryUninvoicedStationList(HttpServletRequest request, @RequestBody QueryOrderDTO dto) {
|
||||
logger.info("查询未开发票的站点list param:{}", JSONObject.toJSONString(dto));
|
||||
RestApiResponse<?> response;
|
||||
try {
|
||||
String memberId = getMemberIdByAuthorization(request);
|
||||
if (StringUtils.isBlank(memberId)) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
|
||||
}
|
||||
dto.setMemberId(memberId);
|
||||
List<StationInfoVO> list = orderService.queryUninvoicedStationList(dto);
|
||||
response = new RestApiResponse<>(ImmutableMap.of("list", list));
|
||||
} catch (BusinessException e) {
|
||||
logger.error("查询未开发票的站点list warn", e);
|
||||
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||
} catch (Exception e){
|
||||
logger.error("查询未开发票的站点list error", e);
|
||||
response = new RestApiResponse<>("00300004", "查询未开发票的站点list异常");
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请开票接口
|
||||
* http://localhost:8080/uniapp/order/applyOrderInvoice
|
||||
|
||||
@@ -66,6 +66,7 @@ import com.jsowell.pile.transaction.service.TransactionService;
|
||||
import com.jsowell.pile.vo.base.OrderAmountDetailVO;
|
||||
import com.jsowell.pile.vo.base.OrderPeriodAmountVO;
|
||||
import com.jsowell.pile.vo.base.PileInfoVO;
|
||||
import com.jsowell.pile.vo.base.StationInfoVO;
|
||||
import com.jsowell.pile.vo.uniapp.InvoiceRecordVO;
|
||||
import com.jsowell.pile.vo.uniapp.MemberVO;
|
||||
import com.jsowell.pile.vo.uniapp.OrderVO;
|
||||
@@ -205,6 +206,7 @@ public class OrderService {
|
||||
|
||||
/**
|
||||
* 白名单支付订单逻辑
|
||||
*
|
||||
* @param dto
|
||||
*/
|
||||
private void whiteListPayOrder(PayOrderDTO dto) {
|
||||
@@ -221,6 +223,7 @@ public class OrderService {
|
||||
|
||||
/**
|
||||
* 微信支付订单逻辑 获取支付参数
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
* @throws Exception
|
||||
@@ -261,6 +264,7 @@ public class OrderService {
|
||||
|
||||
/**
|
||||
* 余额支付订单逻辑
|
||||
*
|
||||
* @param dto
|
||||
*/
|
||||
private void balancePayOrder(PayOrderDTO dto) {
|
||||
@@ -685,6 +689,7 @@ public class OrderService {
|
||||
|
||||
/**
|
||||
* 查询订单详情信息
|
||||
*
|
||||
* @param orderCode 订单编号
|
||||
* @return
|
||||
*/
|
||||
@@ -773,7 +778,7 @@ public class OrderService {
|
||||
// 使用余额支付
|
||||
payInfo.setPayMode(OrderPayModeEnum.PAYMENT_OF_BALANCE.getValue());
|
||||
payInfo.setPayModeDesc(OrderPayModeEnum.PAYMENT_OF_BALANCE.getLabel());
|
||||
} else if (StringUtils.equals(payMode, OrderPayRecordEnum.WECHATPAY_PAYMENT.getValue())){
|
||||
} else if (StringUtils.equals(payMode, OrderPayRecordEnum.WECHATPAY_PAYMENT.getValue())) {
|
||||
// 使用微信支付
|
||||
payInfo.setPayMode(OrderPayModeEnum.PAYMENT_OF_WECHATPAY.getValue());
|
||||
payInfo.setPayModeDesc(OrderPayModeEnum.PAYMENT_OF_WECHATPAY.getLabel());
|
||||
@@ -783,7 +788,7 @@ public class OrderService {
|
||||
payInfo.setOutTradeNo(wxpayCallbackRecord.getOutTradeNo());
|
||||
payInfo.setTransactionId(wxpayCallbackRecord.getTransactionId());
|
||||
}
|
||||
} else if (StringUtils.equals(payMode, OrderPayRecordEnum.WHITELIST_PAYMENT.getValue())){
|
||||
} else if (StringUtils.equals(payMode, OrderPayRecordEnum.WHITELIST_PAYMENT.getValue())) {
|
||||
// 使用白名单支付
|
||||
payInfo.setPayMode(OrderPayModeEnum.PAYMENT_OF_WHITELIST.getValue());
|
||||
payInfo.setPayModeDesc(OrderPayModeEnum.PAYMENT_OF_WHITELIST.getLabel());
|
||||
@@ -826,6 +831,7 @@ public class OrderService {
|
||||
|
||||
/**
|
||||
* 获取小程序订单详情
|
||||
*
|
||||
* @param orderCode
|
||||
* @return
|
||||
*/
|
||||
@@ -901,7 +907,7 @@ public class OrderService {
|
||||
// monitorDataList是按照时间倒序的,chargingDataList需要按照时间正序
|
||||
Collections.reverse(chargingDataList);
|
||||
vo.setChargingDataList(chargingDataList);
|
||||
}
|
||||
}
|
||||
|
||||
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderCode);
|
||||
if (orderDetail != null) {
|
||||
@@ -924,6 +930,7 @@ public class OrderService {
|
||||
|
||||
/**
|
||||
* 根据订单号查询充电桩启动状态
|
||||
*
|
||||
* @param orderCode
|
||||
* @return
|
||||
*/
|
||||
@@ -943,6 +950,7 @@ public class OrderService {
|
||||
|
||||
/**
|
||||
* 人工结算订单
|
||||
*
|
||||
* @param dto
|
||||
*/
|
||||
public boolean manualSettlementOrder(ManualSettlementDTO dto) {
|
||||
@@ -996,6 +1004,7 @@ public class OrderService {
|
||||
|
||||
/**
|
||||
* 当前登录会员 获取支付方式
|
||||
*
|
||||
* @param dto
|
||||
*/
|
||||
public List<PayModeVO> getPayMode(GetPayModeDTO dto) {
|
||||
@@ -1031,11 +1040,9 @@ public class OrderService {
|
||||
|
||||
public List<OrderVO> queryUninvoicedOrderList(QueryOrderDTO dto) {
|
||||
int i = 15;
|
||||
|
||||
// 查询最近15天完成的订单
|
||||
LocalDateTime dateTime = LocalDateTime.now().plusDays(-i);
|
||||
List<OrderVO> orderList = orderBasicInfoService.getListByMemberIdAndOrderStatus(dto.getMemberId(), Lists.newArrayList("6"), dateTime, dto.getStationId());
|
||||
|
||||
// 过滤掉订单金额为0的
|
||||
orderList = orderList.stream()
|
||||
.filter(x -> x.getOrderAmount().compareTo(BigDecimal.ZERO) > 0)
|
||||
@@ -1043,7 +1050,6 @@ public class OrderService {
|
||||
if (CollectionUtils.isEmpty(orderList)) {
|
||||
return orderList;
|
||||
}
|
||||
|
||||
// 查询最近60天申请开票记录
|
||||
QueryInvoiceRecordDTO build = QueryInvoiceRecordDTO.builder()
|
||||
.memberId(dto.getMemberId())
|
||||
@@ -1053,22 +1059,37 @@ public class OrderService {
|
||||
if (CollectionUtils.isEmpty(orderInvoiceRecords)) {
|
||||
return orderList;
|
||||
}
|
||||
|
||||
// 排除掉已经申请过的订单
|
||||
List<String> orderCodeList = orderInvoiceRecords.stream() // 转化为 Stream
|
||||
.map(OrderInvoiceRecord::getOrderCodes) // 获取 OrderInvoiceRecord 中的 orderCodes 字符串
|
||||
.flatMap(str -> Arrays.stream(str.split(","))) // 分隔逗号并转化为 Stream
|
||||
.collect(Collectors.toList()); // 收集为 List<String>
|
||||
|
||||
orderList = orderList.stream()
|
||||
.filter(x -> !orderCodeList.contains(x.getOrderCode()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
return orderList;
|
||||
}
|
||||
|
||||
public List<StationInfoVO> queryUninvoicedStationList(QueryOrderDTO dto) {
|
||||
dto.setStationId(null);
|
||||
List<OrderVO> orderVOS = queryUninvoicedOrderList(dto);
|
||||
if (CollectionUtils.isEmpty(orderVOS)) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
// 根据站点分组
|
||||
List<StationInfoVO> stationInfoVOS = orderVOS.stream()
|
||||
.map(
|
||||
x -> StationInfoVO.builder()
|
||||
.stationId(x.getStationId())
|
||||
.stationName(x.getStationName())
|
||||
.build()
|
||||
).distinct().collect(Collectors.toList());
|
||||
return stationInfoVOS;
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请开票
|
||||
*
|
||||
* @param dto
|
||||
*/
|
||||
public void applyOrderInvoice(ApplyOrderInvoiceDTO dto) {
|
||||
@@ -1146,4 +1167,5 @@ public class OrderService {
|
||||
.list(volist)
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user