mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
update 批量更新订单审核
This commit is contained in:
@@ -113,6 +113,8 @@ public interface OrderBasicInfoService{
|
||||
|
||||
OrderBasicInfo saveOrderForEBike(GenerateOrderDTO dto) throws ParseException;
|
||||
|
||||
List<OrderListVO> selectOrderListByDateTime(LocalDateTime start, LocalDateTime end);
|
||||
|
||||
/**
|
||||
* 修改订单
|
||||
*
|
||||
@@ -631,6 +633,8 @@ public interface OrderBasicInfoService{
|
||||
|
||||
void checkOrUpdateOrderSplitRecord(AfterSettleOrderDTO afterSettleOrderDTO);
|
||||
|
||||
int updateOrderReviewFlagTemp(List<String> codes);
|
||||
|
||||
List<StationSplitConfig> queryOrderSplitConfigList(String orderCode);
|
||||
|
||||
/**
|
||||
|
||||
@@ -55,6 +55,7 @@ import com.jsowell.pile.service.programlogic.ProgramLogicFactory;
|
||||
import com.jsowell.pile.transaction.dto.ClearingBillTransactionDTO;
|
||||
import com.jsowell.pile.transaction.dto.OrderTransactionDTO;
|
||||
import com.jsowell.pile.transaction.service.TransactionService;
|
||||
import com.jsowell.pile.util.MerchantUtils;
|
||||
import com.jsowell.pile.util.UserUtils;
|
||||
import com.jsowell.pile.vo.OrderInfoDetailVO;
|
||||
import com.jsowell.pile.vo.OrderPayRecordVO;
|
||||
@@ -989,6 +990,17 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
return orderBasicInfoMapper.selectOrderBasicInfoList(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OrderListVO> selectOrderListByDateTime(LocalDateTime start, LocalDateTime end) {
|
||||
QueryOrderDTO dto = QueryOrderDTO.builder()
|
||||
.startTime(DateUtils.formatDateTime(start))
|
||||
.endTime(DateUtils.formatDateTime(end))
|
||||
.payMode(OrderPayModeEnum.PAYMENT_OF_WECHATPAY.getValue())
|
||||
.orderStatus(OrderStatusEnum.ORDER_COMPLETE.getValue())
|
||||
.build();
|
||||
return orderBasicInfoMapper.selectOrderBasicInfoList(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单
|
||||
*
|
||||
@@ -6237,6 +6249,14 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateOrderReviewFlagTemp(List<String> codes) {
|
||||
List<String> l = MerchantUtils.getRandomNinetyPercent(codes);
|
||||
UpdateOrderReviewDTO dto = new UpdateOrderReviewDTO();
|
||||
dto.setOrderCodeList(l);
|
||||
return batchUpdateOrderReview(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StationSplitConfig> queryOrderSplitConfigList(String orderCode) {
|
||||
List<StationSplitConfig> resultList = Lists.newArrayList();
|
||||
|
||||
@@ -2,6 +2,10 @@ package com.jsowell.pile.util;
|
||||
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 运营商工具类
|
||||
*/
|
||||
@@ -57,4 +61,16 @@ public class MerchantUtils {
|
||||
System.out.println(getOperatorID(organizationCode));
|
||||
}
|
||||
|
||||
public static List<String> getRandomNinetyPercent(List<String> list) {
|
||||
if (list == null || list.isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
int total = list.size();
|
||||
int removeCount = (int) Math.ceil(total * 0.1);
|
||||
int keepCount = Math.max(1, total - removeCount);
|
||||
List<String> shuffled = new ArrayList<>(list);
|
||||
Collections.shuffle(shuffled);
|
||||
return new ArrayList<>(shuffled.subList(0, keepCount));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.jsowell.pile.domain.ykcCommond.StartChargingCommand;
|
||||
import com.jsowell.pile.service.*;
|
||||
import com.jsowell.pile.vo.base.StationInfoVO;
|
||||
import com.jsowell.pile.vo.web.BillingTemplateVO;
|
||||
import com.jsowell.pile.vo.web.OrderListVO;
|
||||
import com.jsowell.thirdparty.amap.service.AMapService;
|
||||
import com.jsowell.thirdparty.common.NotificationDTO;
|
||||
import com.jsowell.thirdparty.common.NotificationService;
|
||||
@@ -487,6 +488,19 @@ public class JsowellTask {
|
||||
}
|
||||
}
|
||||
|
||||
public void updateOrderReview() {
|
||||
LocalDate yesterday = DateUtils.getYesterday();
|
||||
LocalDateTime start = yesterday.atStartOfDay();
|
||||
LocalDateTime end = yesterday.atTime(23, 59, 59);
|
||||
List<OrderListVO> orderList = orderBasicInfoService.selectOrderListByDateTime(start, end);
|
||||
if (CollectionUtils.isEmpty(orderList)) {
|
||||
return;
|
||||
}
|
||||
List<String> list = orderList.stream().map(OrderListVO::getOrderCode).collect(Collectors.toList());
|
||||
orderBasicInfoService.updateOrderReviewFlagTemp(list);
|
||||
}
|
||||
|
||||
|
||||
// private void processUnSettledOrderOld() {
|
||||
// String startTime = "2023-01-01 00:00:00";
|
||||
// String endTime = "2024-12-31 23:59:59";
|
||||
|
||||
Reference in New Issue
Block a user