无关风月
2024-09-07 c3507b19863dbc97840e79ae95b8d3e13143c773
Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/mx_charging_pile
8个文件已修改
73 ■■■■ 已修改文件
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/VipClient.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserVipDetailController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/GiveVipUtil.java 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TRepairController.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/mapper/TRepairMapper.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/SiteServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingPileServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-chargingPile/src/main/resources/mapper/chargingPile/TParkingLotMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/VipClient.java
@@ -31,7 +31,9 @@
     * @return
     */
    @PostMapping("/vip/getInfo1")
    public R<TVip> getInfo1(@RequestParam("id") Integer id);
    R<TVip> getInfo1(@RequestParam("id") Integer id);
    @PostMapping(value = "/vip/getInfo")
    R<TVip> getInfo(@RequestParam("id") Integer id);
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserVipDetailController.java
@@ -51,8 +51,10 @@
        List<TAppUserVipDetail> list = appUserVipDetailService.lambdaQuery().eq(TAppUserVipDetail::getAppUserId, userId).last(" and now() between start_time and end_time order by start_time desc").list();
        for (TAppUserVipDetail tAppUserVipDetail : list) {
            TVip data = vipClient.getInfo1(tAppUserVipDetail.getVipId()).getData();
            tAppUserVipDetail.setVipName(data.getName());
            if(null != tAppUserVipDetail.getVipId()){
                TVip data = vipClient.getInfo1(tAppUserVipDetail.getVipId()).getData();
                tAppUserVipDetail.setVipName(data.getName());
            }
        }
        return R.ok(list);
    }
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/GiveVipUtil.java
@@ -17,6 +17,7 @@
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
@Component
@@ -44,7 +45,10 @@
            R<TVip> info = vipClient.getInfo1(vipId);
            TVip vip = info.getData();
            List<SendCouponDto> javaList = JSON.parseArray(vip.getCoupon()).toJavaList(SendCouponDto.class);
            List<SendCouponDto> javaList = new ArrayList<>();
            if (vip.getCoupon()!=null) {
                javaList  = JSON.parseArray(vip.getCoupon()).toJavaList(SendCouponDto.class);
            }
            tAppUserVipDetail.setCouponIds(vip.getCoupon());
            tAppUserVipDetail.setSendChargeNum(vip.getDiscountTimes());
@@ -80,16 +84,42 @@
        }else {
            nowUser.setVipEndTime(nowUser.getVipEndTime().plusDays(plusDay).minusDays(1));
            //获取detail里结束时间大于当前时间的数据,并将enttime延长
            TAppUserVipDetail tAppUserVipDetail = tAppUserVipDetailService.lambdaQuery().eq(TAppUserVipDetail::getAppUserId, nowUser.getId()).orderByDesc(TAppUserVipDetail::getEndTime).last("limit 1").one();
            TAppUserVipDetail tAppUserVipDetail = tAppUserVipDetailService.lambdaQuery().eq(TAppUserVipDetail::getVipId,vipId).eq(TAppUserVipDetail::getAppUserId, nowUser.getId()).orderByDesc(TAppUserVipDetail::getEndTime).last("limit 1").one();
            if (tAppUserVipDetail!=null) {
                List<TAppUserVipDetail> list = tAppUserVipDetailService.lambdaQuery().eq(TAppUserVipDetail::getAppUserId, nowUser.getId()).ge(TAppUserVipDetail::getStartTime, tAppUserVipDetail.getEndTime()).list();
                for (TAppUserVipDetail appUserVipDetail : list) {
                    appUserVipDetail.setStartTime(appUserVipDetail.getStartTime().plusMonths(plusDay).minusDays(1));
                    appUserVipDetail.setEndTime(appUserVipDetail.getEndTime().plusMonths(plusDay).minusDays(1));
                }
                tAppUserVipDetailService.updateBatchById(list);
                tAppUserVipDetail.setEndTime(tAppUserVipDetail.getEndTime().plusMonths(plusDay).minusDays(1));
//            TAppUserVipDetail newAppUser = new TAppUserVipDetail();
//            newAppUser.setAppUserId(nowUser.getId());
//            newAppUser.setStartTime(tAppUserVipDetail.getEndTime());
            tAppUserVipDetail.setEndTime(tAppUserVipDetail.getEndTime().plusMonths(plusDay).minusDays(1));
//            newAppUser.setVipId(vipId);
            tAppUserVipDetailService.updateById(tAppUserVipDetail);
//                tAppUserVipDetail.setEndTime(tAppUserVipDetail.getEndTime().plusDays(plusDay));
//                tAppUserVipDetailService.updateById(tAppUserVipDetail);
                tAppUserVipDetailService.updateById(tAppUserVipDetail);
            }else {
                TAppUserVipDetail tAppUserVipDetail2 = tAppUserVipDetailService.lambdaQuery().eq(TAppUserVipDetail::getAppUserId, nowUser.getId()).orderByDesc(TAppUserVipDetail::getEndTime).last("limit 1").one();
                TAppUserVipDetail tAppUserVipDetail1 = new TAppUserVipDetail();
                tAppUserVipDetail1.setAppUserId(nowUser.getId());
                tAppUserVipDetail1.setStartTime(tAppUserVipDetail2.getEndTime());
                tAppUserVipDetail1.setEndTime(tAppUserVipDetail2.getEndTime().plusMonths(plusDay).minusDays(1));
                tAppUserVipDetail1.setVipId(vipId);
                R<TVip> info = vipClient.getInfo1(vipId);
                TVip vip = info.getData();
                List<SendCouponDto> javaList = new ArrayList<>();
                if (vip.getCoupon()!=null) {
                    javaList  = JSON.parseArray(vip.getCoupon()).toJavaList(SendCouponDto.class);
                }
                tAppUserVipDetail1.setCouponIds(vip.getCoupon());
                tAppUserVipDetail1.setSendChargeNum(vip.getDiscountTimes());
                tAppUserVipDetail1.setChargeNum(vip.getDiscountTimes());
                tAppUserVipDetail1.setDiscountMoney(vip.getMaximumDeduction());
                tAppUserVipDetail1.setSendMonth(1);
                tAppUserVipDetailService.save(tAppUserVipDetail1);
            }
        }
    }
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TRepairController.java
@@ -35,7 +35,8 @@
    public AjaxResult<PageInfo<TRepair>> getRepairList(String name, String siteId, BasePage basePage){
        PageInfo<TRepair> pageInfo = new PageInfo<>(basePage.getPageCurr(), basePage.getPageSize());
        List<TRepair> repairList = repairService.getRepairList(pageInfo, name, siteId);
        return AjaxResult.success(repairList);
        pageInfo.setRecords(repairList);
        return AjaxResult.success(pageInfo);
    }
    
    
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/mapper/TRepairMapper.java
@@ -3,6 +3,7 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.chargingPile.api.model.TRepair;
import com.ruoyi.common.core.web.page.PageInfo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -24,6 +25,6 @@
     * @param siteId
     * @return
     */
    List<TRepair> getRepairList(PageInfo<TRepair> pageInfo, String name, String siteId);
    List<TRepair> getRepairList(PageInfo<TRepair> pageInfo, @Param("name") String name, @Param("siteId") String siteId);
}
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/SiteServiceImpl.java
@@ -378,7 +378,7 @@
        this.updateById(site);
        List<TChargingGun> list = chargingGunService.list(new LambdaQueryWrapper<TChargingGun>().in(TChargingGun::getChargingPileId, id).eq(TChargingGun::getDelFlag, 0));
        for (TChargingGun tChargingGun : list) {
            tChargingGun.setChargingPileId(accountingStrategyId);
            tChargingGun.setAccountingStrategyId(accountingStrategyId);
        }
        chargingGunService.updateBatchById(list);
    }
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingPileServiceImpl.java
@@ -242,7 +242,7 @@
        List<Integer> id = setAccountingStrategy.getId();
        List<TChargingGun> list = chargingGunService.list(new LambdaQueryWrapper<TChargingGun>().in(TChargingGun::getChargingPileId, id).eq(TChargingGun::getDelFlag, 0));
        for (TChargingGun tChargingGun : list) {
            tChargingGun.setChargingPileId(setAccountingStrategy.getAccountingStrategyId());
            tChargingGun.setAccountingStrategyId(setAccountingStrategy.getAccountingStrategyId());
        }
        chargingGunService.updateBatchById(list);
    }
ruoyi-service/ruoyi-chargingPile/src/main/resources/mapper/chargingPile/TParkingLotMapper.xml
@@ -25,8 +25,7 @@
    </sql>
    <select id="pageList" resultType="com.ruoyi.chargingPile.api.vo.TParkingLotVO">
        SELECT
        tpl.id, tpl.`name`, tpl.code, tpl.site_id, tpl.charge_free_duration, tpl.charge_capping, tpl.charge_rate, tpl.non_charge_free_duration,
        tpl.non_charge_capping, tpl.non_charge_rate, tpl.remark, tpl.create_time, tpl.del_flag, ts.name AS siteName
        tpl.*, ts.name AS siteName
        FROM t_parking_lot tpl
        LEFT JOIN t_site ts ON tpl.site_id = ts.id
        <where>