liujie
2026-06-05 5b8dc7912678e63a255d771157033c3ed6c5c047
Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/mx_charging_pile
5个文件已修改
58 ■■■■■ 已修改文件
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppCouponController.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/dto/PreChargeCheck.java 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppCouponController.java
@@ -116,7 +116,7 @@
        Long userId = tokenService.getLoginUserApplet().getUserId();
        RLock lock = redissonClient.getLock("CREATE_CAR:" + userId);
        try {
            boolean tryLock = lock.tryLock(10, 10, TimeUnit.SECONDS);
            boolean tryLock = lock.tryLock(2, 10, TimeUnit.SECONDS);
            if(tryLock){
                dto.setAppUserId(userId);
                TAppUserCar one = appUserCarService.getOne(new LambdaQueryWrapper<TAppUserCar>()
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java
@@ -57,6 +57,8 @@
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.compress.utils.IOUtils;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.validation.annotation.Validated;
@@ -148,6 +150,9 @@
    private TInviteUserService inviteUserService;
    @Resource
    private GiveVipUtil giveVipUtil;
    @Autowired
    private RedissonClient redissonClient;
    /**
     * 远程调用 发送邮件
@@ -1270,15 +1275,7 @@
    //积分变化记录用
//    @PostMapping(value = "/user/points/change")
//    public R change(@RequestBody PointChangeDto points) {
//        TAppUser byId = appUserService.getById(points.getUserId());
//        pointDetailUtil.addDetail(byId.getPoints(),byId.getPoints()+points.getPoints(),points.getType(),points.getUserId(),points.getRemark(),"JF");
//        byId.setPoints(byId.getPoints()+points.getPoints());
//        appUserService.updateById(byId);
//        return R.ok();
//    }
    @PostMapping(value = "/user/points/change/down")
    public R changeDown(@RequestBody PointChangeDto points) {
@@ -1294,20 +1291,26 @@
    @ApiOperation(value = "添加编辑车辆", tags = {"小程序-个人中心-车辆"})
    @PostMapping(value = "/user/car/addOrUpdate")
    public R carAdd(@RequestBody TAppUserCar appUserCar) {
        Long userId = tokenService.getLoginUserApplet().getUserId();
        if(null != appUserCar.getId()){
            TAppUserCar userCar = appUserCarService.getById(appUserCar.getId());
            Long userId = tokenService.getLoginUserApplet().getUserId();
            if(!userCar.getAppUserId().equals(userId)){
                return R.fail("权限不足");
            }
        }
        TAppUserCar one1 = appUserCarService.getOne(new LambdaQueryWrapper<TAppUserCar>().eq(TAppUserCar::getLicensePlate, appUserCar.getLicensePlate())
        RLock lock = redissonClient.getLock("CREATE_CAR:" + userId);
        try {
            boolean tryLock = lock.tryLock(5, 10, TimeUnit.SECONDS);
            if(tryLock){
                TAppUserCar one1 = appUserCarService.getOne(new LambdaQueryWrapper<TAppUserCar>()
                        .eq(TAppUserCar::getLicensePlate, appUserCar.getLicensePlate())
                        .eq(TAppUserCar::getAppUserId, userId)
                .eq(TAppUserCar::getDelFlag, 0));
        if(null != one1){
                if(null != one1 && null == appUserCar.getId()){
            return R.fail("车辆已存在");
        }
        LoginUserApplet loginUserApplet = tokenService.getLoginUserApplet();
        Long userId = loginUserApplet.getUserId();
        TAppUser byId = appUserService.getById(userId);
        appUserCar.setAppUserId(userId);
@@ -1375,12 +1378,17 @@
        //
        appUserCarService.saveOrUpdate(appUserCar);
            }
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }finally {
            lock.unlock();
        }
        return R.ok();
    }
    
    @Log(title = "【我的】添加编辑车辆", businessType = BusinessType.INSERT,operatorType = OperatorType.MOBILE)
    @ApiOperation(value = "添加编辑车辆", tags = {"小程序-个人中心-车辆"})
    @Log(title = "【我的】删除车辆", businessType = BusinessType.INSERT,operatorType = OperatorType.MOBILE)
    @ApiOperation(value = "删除车辆", tags = {"小程序-个人中心-车辆"})
    @GetMapping(value = "/user/car/delete")
    public R carDelete(String id) {
        TAppUserCar appUserCar = appUserCarService.getById(id);
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java
@@ -868,7 +868,13 @@
    })
    public AjaxResult<PreChargeCheck> preChargeCheck(@PathVariable Integer id) {
        String key = "AQJC_" + id;
        Object cacheObject = redisService.getCacheObject(key);
        PreChargeCheck cacheObject = redisService.getCacheObject(key);
        if(null != cacheObject){
            if(LocalDateTime.now().minusMinutes(1).isAfter(cacheObject.getAddTime())){
                redisService.deleteObject(key);
                cacheObject = null;
            }
        }
        return AjaxResult.success(cacheObject);
    }
    
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/dto/PreChargeCheck.java
@@ -4,6 +4,8 @@
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;
/**
 * @author zhibing.pu
 * @Date 2024/8/21 13:47
@@ -21,4 +23,6 @@
    private Integer startupSuccess;
    @ApiModelProperty("失败原因(0:无,1:设备编号不匹配,2:枪已在充电,3:设备故障,4:设备离线,5:未插枪桩在收到启充命令后,检测到未插枪则发送 0x33 报文回复充电失败。若在 60 秒(以收到 0x34 时间开始计算)内检测到枪重新连接,则补送 0x33 成功报文;超时或者离线等其他异常,桩不启充、不补发 0x33 报文)")
    private Integer failureCause;
    @ApiModelProperty("添加时间")
    private LocalDateTime addTime;
}
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java
@@ -904,6 +904,7 @@
        preChargeCheck.setInsulationTesting(false);
        preChargeCheck.setSecureConnectionDetection(false);
        preChargeCheck.setStartupSuccess(1);
        preChargeCheck.setAddTime(LocalDateTime.now());
        String key = "AQJC_" + chargingOrder.getChargingGunId();
        redisService.setCacheObject(key, preChargeCheck, 24L, TimeUnit.HOURS);
        
@@ -4963,6 +4964,7 @@
        preChargeCheck.setInsulationTesting(false);
        preChargeCheck.setSecureConnectionDetection(false);
        preChargeCheck.setStartupSuccess(1);
        preChargeCheck.setAddTime(LocalDateTime.now());
        String key = "AQJC_" + chargingOrder.getChargingGunId();
        redisService.setCacheObject(key, preChargeCheck, 24L, TimeUnit.HOURS);