Pu Zhibing
2025-01-20 a0333e5234fae97ce785858e2152e390d85ca270
修改bug
1个文件已添加
2个文件已修改
37 ■■■■ 已修改文件
nacos_config_export_20250110114500.zip 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingPileServiceImpl.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
nacos_config_export_20250110114500.zip
Binary files differ
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java
@@ -84,9 +84,8 @@
    private TAppUserService appUserService;
    @Resource
    private TAppUserTagService appUserTagService;
    @Autowired
    @Resource
    private OrderClient orderClient;
    @Resource
    private TAppUserVipDetailService tAppUserVipDetailService;
    @Resource
@@ -1012,14 +1011,10 @@
    public R sign() {
        LoginUserApplet loginUserApplet = tokenService.getLoginUserApplet();
        Long userId = loginUserApplet.getUserId();
        TAppUser byId = appUserService.getById(userId);
        if (signService.lambdaQuery().eq(TAppUserSign::getSignDay, LocalDate.now()).eq(TAppUserSign::getAppUserId, userId).count()>0){
            return R.fail("今日已签到");
        }
        //判断当前生效的vipDetail
        TAppUserVipDetail one = tAppUserVipDetailService.lambdaQuery().le(TAppUserVipDetail::getStartTime, LocalDateTime.now()).ge(TAppUserVipDetail::getEndTime, LocalDateTime.now()).eq(TAppUserVipDetail::getAppUserId, userId).last("limit 1").one();
        boolean doubleVip = false;
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingPileServiceImpl.java
@@ -182,22 +182,28 @@
            return AjaxResult.error("设备编号已存在");
        }
        //调用华为Iot创建设备
        AddDevice addDevice = new AddDevice();
        addDevice.setProductId("66da68d21837002b28b34ec0");
        addDevice.setNodeId(chargingPile.getCode());
        addDevice.setDeviceName(chargingPile.getName());
        addDevice.setDescription(chargingPile.getNumber().toString());
        AddDeviceResp deviceResp = iotInterfaceClient.addDevice(addDevice).getData();
        if(null != deviceResp){
            int httpStatusCode = deviceResp.getHttpStatusCode();
            if(httpStatusCode == 201){
                chargingPile.setIotdDeviceId(deviceResp.getDeviceId());
        ShowDeviceResp showDeviceResp = iotInterfaceClient.showDeviceRequest(chargingPile.getCode()).getData();
        if(null == showDeviceResp){
            //调用华为Iot创建设备
            AddDevice addDevice = new AddDevice();
            addDevice.setProductId("66da68d21837002b28b34ec0");
            addDevice.setNodeId(chargingPile.getCode());
            addDevice.setDeviceName(chargingPile.getName());
            addDevice.setDescription(chargingPile.getNumber().toString());
            AddDeviceResp deviceResp = iotInterfaceClient.addDevice(addDevice).getData();
            if(null != deviceResp){
                int httpStatusCode = deviceResp.getHttpStatusCode();
                if(httpStatusCode == 201){
                    chargingPile.setIotdDeviceId(deviceResp.getDeviceId());
                }else{
                    log.error("华为创建设备失败" + JSON.toJSONString(deviceResp));
                    return AjaxResult.error("华为创建设备失败");
                }
            }else{
                log.error("华为创建设备失败" + JSON.toJSONString(deviceResp));
                return AjaxResult.error("华为创建设备失败");
            }
        }else{
            return AjaxResult.error("华为创建设备失败");
            chargingPile.setIotdDeviceId(showDeviceResp.getDeviceId());
        }
        this.save(chargingPile);
        return AjaxResult.success();