无关风月
2024-08-31 7495652b4380078ad16576f992ddfced8b3ca818
代码提交
2个文件已修改
2个文件已添加
191 ■■■■■ 已修改文件
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/TExchangeOrder.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/vo/ChargingOrderListVO.java 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/FinancialSettlementController.java 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TExchangeOrderServiceImpl.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/model/TExchangeOrder.java
@@ -113,6 +113,15 @@
    @ApiModelProperty(value = "取消人")
    @TableField(exist = false)
    private String cancellationName;
    @ApiModelProperty(value = "商品名称")
    @TableField(exist = false)
    private String name;
    @ApiModelProperty(value = "下单手机号")
    @TableField(exist = false)
    private String phone;
    @ApiModelProperty(value = "订单id")
    @TableField(exist = false)
    private String uid;
}
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/vo/ChargingOrderListVO.java
New file
@@ -0,0 +1,57 @@
package com.ruoyi.order.api.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.order.api.model.TChargingOrder;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Data
@ApiModel(value = "ChargingOrderListVO对象",description = "充电时段统计列表VO")
public class ChargingOrderListVO  {
    @ApiModelProperty(value = "电站名称")
    private String siteName;
    @ApiModelProperty(value = "订单编号")
    private String code;
    @ApiModelProperty(value = "订单类型(1=充电订单(小程序),2=充电订单(刷卡))")
    private String orderType;
    @ApiModelProperty(value = "充电终端名称 桩+枪")
    private String terminalName;
    @ApiModelProperty(value = "充电时间 秒")
    private Long chargingSecond;
    @ApiModelProperty(value = "充电电流 度")
    private String chargingCapacity;
    @ApiModelProperty(value = "车牌号")
    private String licensePlate;
    @ApiModelProperty(value = "客户手机号")
    private String phone;
    @ApiModelProperty(value = "充电到账金额")
    private BigDecimal paymentAmount;
    @ApiModelProperty(value = "累计电费")
    private BigDecimal electrovalence;
    @ApiModelProperty(value = "累计服务费")
    private BigDecimal serviceCharge;
    @ApiModelProperty(value = "平台手续费")
    private BigDecimal platFormMoney;
    @ApiModelProperty(value = "引流平台")
    private String platform;
    @ApiModelProperty(value = "平台分佣")
    private BigDecimal platformCommission;
    @ApiModelProperty(value = "开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime startTime;
    @ApiModelProperty(value = "结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime endTime;
    @ApiModelProperty(value = "开始soc")
    private String startSoc;
    @ApiModelProperty(value = "结束soc")
    private String endSoc;
    @ApiModelProperty(value = "结束原因 (0=异常终止,1=主动终止,2=满电终止,3=费用不足终止)")
    private Integer endMode;
    @ApiModelProperty(value = "电流占比")
    private String electronicProportion;
}
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/FinancialSettlementController.java
New file
@@ -0,0 +1,94 @@
package com.ruoyi.order.controller;
import com.ruoyi.account.api.feignClient.AppUserCarClient;
import com.ruoyi.account.api.feignClient.AppUserClient;
import com.ruoyi.chargingPile.api.feignClient.ChargingGunClient;
import com.ruoyi.chargingPile.api.feignClient.ChargingPileClient;
import com.ruoyi.chargingPile.api.feignClient.ParkingLotClient;
import com.ruoyi.chargingPile.api.feignClient.SiteClient;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.PageInfo;
import com.ruoyi.common.redis.service.RedisService;
import com.ruoyi.common.security.service.TokenService;
import com.ruoyi.order.api.model.TVipOrder;
import com.ruoyi.order.api.query.VipShoppingOrderQuery;
import com.ruoyi.order.dto.PayOrderDto;
import com.ruoyi.order.dto.PayOrderQueryDto;
import com.ruoyi.order.service.*;
import com.ruoyi.payment.api.feignClient.AliPaymentClient;
import com.ruoyi.payment.api.feignClient.WxPaymentClient;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;
/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author xiaochen
 * @since 2024-08-07
 */
@Api(tags = "财务结算")
@RestController
@RequestMapping("/financial/settlement")
public class FinancialSettlementController {
    @Resource
    private TChargingOrderService chargingOrderService;
    @Autowired
    private TokenService tokenService;
    @Autowired
    private TOrderEvaluateService orderEvaluateService;
    @Resource
    private WxPaymentClient wxPaymentClient;
    @Resource
    private RedisService redisService;
    @Resource
    private AliPaymentClient aliPaymentClient;
    @Resource
    private TShoppingOrderService shoppingOrderService;
    @Resource
    private AppUserClient appUserClient;
    @Resource
    private TVipOrderService vipOrderService;
    @Resource
    private ParkingLotClient parkingLotClient;
    @Resource
    private TChargingOrderRefundService chargingOrderRefundService;
    @Resource
    private TShoppingOrderRefundService shoppingOrderRefundService;
    @Resource
    private TVipOrderRefundService vipOrderRefundService;
    @Resource
    private SiteClient siteClient;
    @Resource
    private ChargingPileClient chargingPileClient;
    @Resource
    private ChargingGunClient chargingGunClient;
    @Resource
    private AppUserCarClient appUserCarClient;
    @Resource
    private TChargingOrderAccountingStrategyService chargingOrderAccountingStrategyService;
    @ResponseBody
    @PostMapping(value = "/chargingList")
    @ApiOperation(value = "充电时段统计列表", tags = {"管理后台-财务结算"})
    public R<PageInfo<PayOrderDto>> payOrderList(@RequestBody PayOrderQueryDto payOrderQueryDto) {
        return chargingOrderService.payOrderQuery(payOrderQueryDto);
    }
}
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TExchangeOrderServiceImpl.java
@@ -3,6 +3,8 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.account.api.feignClient.AppUserAddressClient;
import com.ruoyi.account.api.feignClient.AppUserClient;
import com.ruoyi.account.api.model.TAppUser;
import com.ruoyi.account.api.model.TAppUserAddress;
import com.ruoyi.common.core.web.page.PageInfo;
import com.ruoyi.common.security.service.TokenService;
@@ -51,8 +53,9 @@
    
    @Resource
    private AppUserAddressClient appUserAddressClient;
    @Resource
    private AppUserClient appUserClient;
    
    
    
@@ -168,7 +171,29 @@
        }
        PageInfo<TExchangeOrder> pageInfo = new PageInfo<>(query.getPageCurr(),query.getPageSize());
        List<TExchangeOrder> list = this.baseMapper.pageList(pageInfo,query,startTime1,startTime2);
        for (TExchangeOrder tShoppingOrder : list) {
            tShoppingOrder.setUid(tShoppingOrder.getId().toString());
            switch (tShoppingOrder.getOrderType()){
                case 1:
                    TGoods data = goodsClient.getGoodsById(tShoppingOrder.getGoodsId()).getData();
                    if (data!=null){
                        tShoppingOrder.setName(data.getName());
                    }
                    break;
                case 2:
                    TCoupon data1 = couponClient.getCouponById1(tShoppingOrder.getCouponId()).getData();
                    if (data1!=null){
                        tShoppingOrder.setName(data1.getName());
                    }
                    break;
            }
            if (tShoppingOrder.getAppUserId() != null){
                TAppUser data = appUserClient.getUserById(tShoppingOrder.getAppUserId()).getData();
                if (data!=null){
                    tShoppingOrder.setPhone(data.getPhone());
                }
            }
        }
        pageInfo.setRecords(list);
        return pageInfo;
    }