11,修改
This commit is contained in:
@ -65,11 +65,11 @@ public class BillingSaveReqVO {
|
||||
private String billingName;
|
||||
@Schema(description = "订单选择时间段-开始时间")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date startTime;
|
||||
@Schema(description = "订单选择时间段-结束时间")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date endTime;
|
||||
@Schema(description = "单位所有开票的userid")
|
||||
private Set<Long> orderId;
|
||||
|
@ -94,8 +94,8 @@ public class AppBillingController {
|
||||
Object data = billingService.getData(time, billingType, carteenId,userId);
|
||||
return success(data);
|
||||
}
|
||||
@GetMapping("/data")
|
||||
@Operation(summary = "获取月时间段的订单详情")
|
||||
@GetMapping("/TypeTotal")
|
||||
@Operation(summary = "获取开票订单数量")
|
||||
public CommonResult<Map<Integer, Integer>> getBillingTypeTotal(@RequestParam("carteenId") Long carteenId,@RequestParam("userId") Long userId) {
|
||||
Map<Integer, Integer> billingTypeTotal = billingService.getBillingTypeTotal(carteenId, userId);
|
||||
return success(billingTypeTotal);
|
||||
|
@ -62,6 +62,7 @@ public interface BillingService {
|
||||
*/
|
||||
PageResult<BillingDO> getBillingPage(BillingPageReqVO pageReqVO);
|
||||
BillingRespMoneyVO getHaveWithoutMoney(Long userId,Long carteenId);
|
||||
BillingRespMoneyVO getHaveWithoutMoney(Long userId);
|
||||
|
||||
/**
|
||||
* 获取指定时间段的所有金额
|
||||
|
@ -335,6 +335,20 @@ public class BillingServiceImpl implements BillingService {
|
||||
return response;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BillingRespMoneyVO getHaveWithoutMoney(Long userId) {
|
||||
List<Long> memberList = getMemberListByUserId(userId);
|
||||
// 创建 BillingRespMoneyVO 对象
|
||||
BillingRespMoneyVO response = new BillingRespMoneyVO();
|
||||
// 查询已开票的金额
|
||||
BigDecimal haveMoney = getTotalMoneyForBilling(userId, BillingStatusEnum.BILLING_INVOICING_IS_COMPLETE.getCode());
|
||||
response.setHaveMoney(haveMoney);
|
||||
// 查询未开票的金额
|
||||
BigDecimal withoutMoney = getTotalMoneyForOrders(memberList,null);
|
||||
response.setWithoutMoney(withoutMoney);
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询已开票的金额
|
||||
* @param userId 用户 ID
|
||||
@ -372,8 +386,8 @@ public class BillingServiceImpl implements BillingService {
|
||||
private BigDecimal getTotalMoneyForOrderSpaceCapsules(List<Long> memberList,Long carteenId) {
|
||||
return orderSpaceCapsuleMapper.selectList(new LambdaQueryWrapperX<OrderSpaceCapsuleDO>()
|
||||
.eq(OrderSpaceCapsuleDO::getStatus, SpaceCapsuleOrderEnum.SPACE_CAPSULE_ORDER_ENUM_DONE.getCode())
|
||||
.eqIfPresent(OrderSpaceCapsuleDO::getCarteenId,carteenId)
|
||||
.isNull(OrderSpaceCapsuleDO::getBillingNum)
|
||||
.eq(OrderSpaceCapsuleDO::getCarteenId,carteenId)
|
||||
.in(OrderSpaceCapsuleDO::getUserId, memberList))
|
||||
.stream()
|
||||
.map(OrderSpaceCapsuleDO::getMoney)
|
||||
@ -388,8 +402,8 @@ public class BillingServiceImpl implements BillingService {
|
||||
private BigDecimal getTotalMoneyForDishOrders(List<Long> memberList,Long carteenId) {
|
||||
return dishOrderMapper.selectList(new LambdaQueryWrapperX<DishOrderDO>()
|
||||
.eq(DishOrderDO::getOrderStatus, DishOrderDO.COMPLETE)
|
||||
.eqIfPresent(DishOrderDO::getStoreId,carteenId)
|
||||
.isNull(DishOrderDO::getBillingNum)
|
||||
.eq(DishOrderDO::getStoreId,carteenId)
|
||||
.in(DishOrderDO::getUserId, memberList))
|
||||
.stream()
|
||||
.map(DishOrderDO::getTotalMoney)
|
||||
@ -404,9 +418,9 @@ public class BillingServiceImpl implements BillingService {
|
||||
private BigDecimal getTotalMoneyForStoreOrders(List<Long> memberList,Long carteenId) {
|
||||
return storeOrderMapper.selectList(new LambdaQueryWrapperX<StoreOrderDO>()
|
||||
.eq(StoreOrderDO::getStatus, StoreOrderStatusEnum.COMPLETE.getCode())
|
||||
.eqIfPresent(StoreOrderDO::getCarteenId,carteenId)
|
||||
.eq(StoreOrderDO::getBillingExist, Boolean.FALSE)
|
||||
.isNull(StoreOrderDO::getBillingNum)
|
||||
.eq(StoreOrderDO::getCarteenId,carteenId)
|
||||
.in(StoreOrderDO::getUserId, memberList))
|
||||
.stream()
|
||||
.map(f -> BigDecimal.valueOf(f.getTotalPrice()))
|
||||
|
Reference in New Issue
Block a user