diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/android/controller/DeviceController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/android/controller/DeviceController.java index 3d5d389..41956a8 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/android/controller/DeviceController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/android/controller/DeviceController.java @@ -5,6 +5,8 @@ import com.bonus.canteen.core.android.dto.AppDTO; import com.bonus.canteen.core.android.service.DeviceService; import com.bonus.canteen.core.android.vo.CookRecipeCompressVO; import com.bonus.canteen.core.android.vo.DeviceTimeIntervalVO; +import com.bonus.canteen.core.device.domain.DeviceSearchDTO; +import com.bonus.canteen.core.device.service.IDeviceInfoService; import com.bonus.common.core.exception.ServiceException; import com.bonus.common.core.web.controller.BaseController; import com.bonus.common.core.web.domain.AjaxResult; @@ -26,7 +28,8 @@ import java.util.Map; public class DeviceController extends BaseController { @Resource private DeviceService deviceService; - + @Resource + private IDeviceInfoService deviceInfoService; @ApiOperation("获取设备信息") @@ -69,4 +72,14 @@ public class DeviceController extends BaseController { return this.deviceService.intervalConfig(HeaderFetchUtil.getMachineSn(headers)); } + @ApiOperation(value = "更新设备在线状态") + @PostMapping({"/updateTimeBySn"}) + public AjaxResult updateTimeBySn(@RequestBody DeviceSearchDTO dto) { + if (ObjectUtil.isEmpty(dto.getDeviceSn())) { + throw new ServiceException("设备sn不能为空"); + } + this.deviceInfoService.updateTimeBySn(dto.getDeviceSn()); + return AjaxResult.success(); + } + } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/device/controller/DeviceInfoController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/device/controller/DeviceInfoController.java index 5b9366d..fd0f762 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/device/controller/DeviceInfoController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/device/controller/DeviceInfoController.java @@ -1,6 +1,7 @@ package com.bonus.canteen.core.device.controller; import java.util.List; +import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import cn.hutool.core.util.ObjectUtil; @@ -34,7 +35,7 @@ import com.bonus.common.core.web.page.TableDataInfo; @RestController @RequestMapping("/device_info") public class DeviceInfoController extends BaseController { - @Autowired + @Resource private IDeviceInfoService deviceInfoService; /** @@ -107,14 +108,5 @@ public class DeviceInfoController extends BaseController { return toAjax(deviceInfoService.deleteDeviceInfoByDeviceIds(deviceIds)); } - @ApiOperation(value = "更新设备在线状态") - @PostMapping({"/updateTimeBySn"}) - public AjaxResult updateTimeBySn(@RequestBody DeviceSearchDTO dto) { - if (ObjectUtil.isEmpty(dto.getDeviceSn())) { - throw new ServiceException("设备sn不能为空"); - } - this.deviceInfoService.updateTimeBySn(dto.getDeviceSn()); - return AjaxResult.success(); - } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/android/UserMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/android/UserMapper.xml index 7c24576..611efc3 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/android/UserMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/android/UserMapper.xml @@ -39,8 +39,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" r.user_id as userId from( select user_id, - IF(wallet_id = 1,wallet_bal,0) as personalWalletBalance, - IF(wallet_id = 2,wallet_bal,0) as subsidiesBalance, + IF(wallet_type = 1,wallet_bal,0) as personalWalletBalance, + IF(wallet_type = 2,wallet_bal,0) as subsidiesBalance, wallet_bal from account_wallet_info)r GROUP BY r.user_id