xuhy
2024-10-26 006388b29f309e1072e1e686a9cb3661debe6b7d
Merge remote-tracking branch 'origin/master'
9个文件已修改
56 ■■■■■ 已修改文件
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TInviteUser.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TAccountingStrategyDetailController.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/SiteServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-chargingPile/src/main/resources/mapper/chargingPile/TParkingRecordMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/ChargingBillController.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/export/ChargingBillExport.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/util/task/TaskUtil.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TChargingOrderMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TInviteUser.java
@@ -50,6 +50,8 @@
    @TableField("create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;
    @TableField(exist = false)
    private String avatar;
}
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java
@@ -765,8 +765,11 @@
    @PostMapping(value = "/user/invite/page")
    public R<Page<TInviteUser>> invitePage(@RequestBody BasePage basePage) {
        Long userId = tokenService.getLoginUserApplet().getUserId();
        Page<TInviteUser> page = inviteUserService.lambdaQuery().eq(TInviteUser::getAppUserId, userId).isNotNull(TInviteUser::getAward).orderByDesc(TInviteUser::getCreateTime).page(Page.of(basePage.getPageCurr(), basePage.getPageSize()));
        for (TInviteUser record : page.getRecords()) {
            TAppUser byId = appUserService.getById(record.getBeInvitedAppUserId());
            record.setAvatar(byId.getAvatar());
        }
        return R.ok(page);
    }
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TAccountingStrategyDetailController.java
@@ -114,13 +114,13 @@
    public R<TAccountingStrategyDetail> getDetailByCode(@RequestParam("code") String code){
        // 查询桩
        TChargingPile chargingPile = chargingPileService.getOne(Wrappers.lambdaQuery(TChargingPile.class)
                .eq(TChargingPile::getCode,code)
                .eq(TChargingPile::getCode,code).eq(TChargingPile::getDelFlag, 0)
                .last("LIMIT 1"));
        if(Objects.isNull(chargingPile)){
            return R.fail("未查询到该桩设备");
        }
        TChargingGun chargingGun = chargingGunService.getOne(Wrappers.lambdaQuery(TChargingGun.class)
                .eq(TChargingGun::getChargingPileId, chargingPile.getId())
                .eq(TChargingGun::getChargingPileId, chargingPile.getId()).eq(TChargingGun::getDelFlag, 0)
                .last("LIMIT 1"));
        TAccountingStrategy accountingStrategy = accountingStrategyService.getById(chargingGun.getAccountingStrategyId());
        TAccountingStrategyDetail one;
@@ -146,7 +146,7 @@
    public R<Boolean> checkChargingStrategy(@RequestBody CheckChargingStrategyDTO dto){
        // 查询桩
        TChargingPile chargingPile = chargingPileService.getOne(Wrappers.lambdaQuery(TChargingPile.class)
                .eq(TChargingPile::getCode,dto.getCode())
                .eq(TChargingPile::getCode,dto.getCode()).eq(TChargingPile::getDelFlag, 0)
                .last("LIMIT 1"));
        if(Objects.isNull(chargingPile)){
            return R.ok(false);
@@ -180,16 +180,26 @@
    public R<List<TAccountingStrategyDetail>> getDetailListByCode(@RequestParam("code") String code){
        // 查询桩
        TChargingPile chargingPile = chargingPileService.getOne(Wrappers.lambdaQuery(TChargingPile.class)
                .eq(TChargingPile::getCode,code)
                .eq(TChargingPile::getCode,code).eq(TChargingPile::getDelFlag, 0)
                .last("LIMIT 1"));
        if(Objects.isNull(chargingPile)){
            return R.fail("未查询到该桩设备");
        }
        Site site = siteService.getById(chargingPile.getSiteId());
        TAccountingStrategy accountingStrategy = accountingStrategyService.getById(site.getAccountingStrategyId());
        List<TAccountingStrategyDetail> accountingStrategyDetails = accountingStrategyDetailService.list(Wrappers.<TAccountingStrategyDetail>lambdaQuery()
                .eq(TAccountingStrategyDetail::getAccountingStrategyId, accountingStrategy.getId()));
        return R.ok(accountingStrategyDetails);
        TChargingGun chargingGun = chargingGunService.getOne(Wrappers.lambdaQuery(TChargingGun.class)
                .eq(TChargingGun::getChargingPileId, chargingPile.getId()).eq(TChargingGun::getDelFlag, 0)
                .last("LIMIT 1"));
        TAccountingStrategy accountingStrategy = accountingStrategyService.getById(chargingGun.getAccountingStrategyId());
        if(Objects.nonNull(accountingStrategy)){
            List<TAccountingStrategyDetail> accountingStrategyDetails = accountingStrategyDetailService.list(Wrappers.<TAccountingStrategyDetail>lambdaQuery()
                    .eq(TAccountingStrategyDetail::getAccountingStrategyId, accountingStrategy.getId()));
            return R.ok(accountingStrategyDetails);
        }else {
            Site site = siteService.getById(chargingPile.getSiteId());
            accountingStrategy = accountingStrategyService.getById(site.getAccountingStrategyId());
            List<TAccountingStrategyDetail> accountingStrategyDetails = accountingStrategyDetailService.list(Wrappers.<TAccountingStrategyDetail>lambdaQuery()
                    .eq(TAccountingStrategyDetail::getAccountingStrategyId, accountingStrategy.getId()));
            return R.ok(accountingStrategyDetails);
        }
    }
}
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/SiteServiceImpl.java
@@ -394,7 +394,7 @@
        Site site = this.getById(id);
        site.setAccountingStrategyId(accountingStrategyId);
        this.updateById(site);
        List<TChargingGun> list = chargingGunService.list(new LambdaQueryWrapper<TChargingGun>().in(TChargingGun::getChargingPileId, id).eq(TChargingGun::getDelFlag, 0));
        List<TChargingGun> list = chargingGunService.list(new LambdaQueryWrapper<TChargingGun>().in(TChargingGun::getSiteId, id).eq(TChargingGun::getDelFlag, 0));
        for (TChargingGun tChargingGun : list) {
            tChargingGun.setAccountingStrategyId(accountingStrategyId);
        }
ruoyi-service/ruoyi-chargingPile/src/main/resources/mapper/chargingPile/TParkingRecordMapper.xml
@@ -69,7 +69,7 @@
                AND code LIKE concat('%',#{query.code},'%')
            </if>
            <if test="query.licensePlate != null and query.licensePlate != ''">
                AND licensePlate LIKE concat('%',#{query.licensePlate},'%')
                AND license_plate LIKE concat('%',#{query.licensePlate},'%')
            </if>
            <if test="query.lotIds != null and query.lotIds.size()>0">
                AND parking_lot_id IN
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/ChargingBillController.java
@@ -245,14 +245,12 @@
        chargingBillExport.setCode(byId.getCode());
        chargingBillExport.setAccountType("微信商户");
        chargingBillExport.setType(byId.getType().toString());
        chargingBillExport.setBillType("月账单");
        LocalDateTime billTime = byId.getBillTime();
        // 将billTime 减去一个月 转化为yyyy-MM格式字符串
        billTime = billTime.minusMonths(1);
        chargingBillExport.setBillWeek(DateUtils.parseDateToStr("yyyy-MM",DateUtils.toDate(billTime)));
        chargingBillExport.setBillTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",DateUtils.toDate(billTime)));
        chargingBillExport.setState("未出账");
        List<Site> data = siteClient.getSiteByIds(Arrays.asList(byId.getSiteId())).getData();
        if (!data.isEmpty()){
            chargingBillExport.setSiteName(data.get(0).getName());
@@ -322,7 +320,7 @@
                chargingBillRefundExport.setCode(tChargingOrder.getCode());
                chargingBillRefundExport.setPayTime(tChargingOrder.getCreateTime()!=null?DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",DateUtils.toDate(tChargingOrder.getCreateTime())):"");
                if (tChargingOrder.getRefundTime()!=null){
                    chargingBillRefundExport.setRefundTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",DateUtils.toDate(tChargingOrder.getRefundTime())));
                    chargingBillRefundExport.setRefundTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",DateUtils.toDate(one.getRefundTime())));
                }
                chargingBillRefundExport.setRefundMoney(one.getRefundAmount().toString());
                chargingBillRefundExport.setRefundRemark(one.getRefundReason());
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/export/ChargingBillExport.java
@@ -17,14 +17,12 @@
    private String accountType;
    @Excel(name = "账单分类",width = 30,replace = {"全站账单_1","各个站点账单_2"})
    private String type;
    @Excel(name = "账单类型",width = 30)
    private String billType;
    @Excel(name  = "账单周期",width = 30 )
    private String billWeek;
    @Excel(name  = "账单生成日期",width = 30)
    private String billTime;
    @Excel(name  = "状态",width = 30)
    private String state;
    @Excel(name  = "站点名称",width = 30)
    private String siteName;
    @Excel(name  = "支付金额",width = 30)
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/util/task/TaskUtil.java
@@ -128,7 +128,7 @@
                tChargingBill3.setType(2);
                tChargingBill3.setSiteId(collect.get(i));
                tChargingBill3.setBillTime(LocalDateTime.now());
                tChargingBill3.setBillType(1);
                tChargingBill3.setBillType(2);
                tChargingBill3.setStatus(1);
                tChargingBill3.setOrderState(2);
                tChargingBills1.add(tChargingBill3);
ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TChargingOrderMapper.xml
@@ -401,6 +401,7 @@
        CAST(SUM(service_charge-coupon_discount_amount) AS DECIMAL(20, 6)) as  servicecharge,
        CAST(SUM(charging_capacity) AS DECIMAL(20, 6)) as electrovalence,
        CAST(SUM(electrovalence) AS DECIMAL(20, 4)) AS paymentAmount,
        SUM(payment_amount) AS paymoney,
    count(1) as orderCount
        FROM
            t_charging_order
@@ -972,7 +973,7 @@
                LEFT JOIN  `charging_pile_service`.`t_charging_gun` tc on co.charging_gun_id = tc.id
                LEFT JOIN  `charging_pile_service`.`t_charging_pile` cp on tc.charging_pile_id = cp.id
        WHERE
            co.start_time IS NOT NULL AND co.end_time IS NOT NULL and cp.type = 1
            co.start_time IS NOT NULL AND co.end_time IS NOT NULL and tc.type = 4
        <if test="siteIds != null and siteIds.size() > 0">
            and co.site_id IN
            <foreach collection="siteIds" item="siteId" open="(" separator="," close=")">
@@ -1032,7 +1033,7 @@
        LEFT JOIN  `charging_pile_service`.`t_charging_gun` tc on co.charging_gun_id = tc.id
        LEFT JOIN  `charging_pile_service`.`t_charging_pile` cp on tc.charging_pile_id = cp.id
        WHERE
        co.start_time IS NOT NULL AND co.end_time IS NOT NULL and cp.type = 2
        co.start_time IS NOT NULL AND co.end_time IS NOT NULL and tc.type in (2,3)
        <if test="siteIds != null and siteIds.size() > 0">
            and co.site_id IN
            <foreach collection="siteIds" item="siteId" open="(" separator="," close=")">