|
@@ -5,6 +5,7 @@ import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.util.BooleanUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
+import cn.hutool.json.JSONUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.xy.annotate.RestMappingController;
|
|
@@ -34,6 +35,8 @@ import com.xy.vo.DeviceDetailVO;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
@@ -63,6 +66,7 @@ public class MercMiniDeviceController {
|
|
|
* auth-code有效期30分钟,单位:s ,
|
|
|
*/
|
|
|
public static final Integer AUTH_CODE_TIMEOUT = 1800;
|
|
|
+ private static final Logger log = LoggerFactory.getLogger(MercMiniDeviceController.class);
|
|
|
private final MercFeignService mercFeignService;
|
|
|
private final DeviceInfoServiceImpl deviceInfoService;
|
|
|
private final DeviceSysinfoServiceImpl deviceSysinfoService;
|
|
@@ -164,7 +168,12 @@ public class MercMiniDeviceController {
|
|
|
@PostMapping("mercHomeStatistical")
|
|
|
public R<DeviceInfoDto.MercHomeStatisticalVO> mercHomeStatistical(@RequestBody @Valid DeviceInfoDto.MercHomeQueryDTO dto) {
|
|
|
dto.setMercId(MercAuthUtils.getMercId());
|
|
|
- dto.setMyDeviceIds(getMyDevices());
|
|
|
+
|
|
|
+ List<Long> myDevices = getMyDevices();
|
|
|
+ dto.setMyDeviceIds(myDevices);
|
|
|
+ if ("393010594508869".equals(String.valueOf(dto.getMercId())) || "498503052238597".equals(String.valueOf(dto.getMercId()))) {
|
|
|
+ log.info("[商户设备首页统计]#myDevices {}", JSONUtil.toJsonPrettyStr(myDevices));
|
|
|
+ }
|
|
|
return deviceInfoService.mercHomeStatistical(dto);
|
|
|
}
|
|
|
|
|
@@ -397,7 +406,11 @@ public class MercMiniDeviceController {
|
|
|
boolean mercAdmin = MercAuthUtils.isMercAdmin();
|
|
|
Long mercId = MercAuthUtils.getMercId();
|
|
|
if (mercAdmin) {
|
|
|
- List<DeviceInfo> deviceInfos = deviceInfoService.list(Wrappers.<DeviceInfo>lambdaQuery().eq(DeviceInfo::getMercId, mercId).eq(DeviceInfo::getActiveState, DeviceActiveStateEnum.TRUE.getCode()));
|
|
|
+ boolean isQa = false;
|
|
|
+ if ("393010594508869".equals(String.valueOf(mercId)) || "498503052238597".equals(String.valueOf(mercId))) {
|
|
|
+ isQa = true;
|
|
|
+ }
|
|
|
+ List<DeviceInfo> deviceInfos = deviceInfoService.list(Wrappers.<DeviceInfo>lambdaQuery().eq(DeviceInfo::getMercId, mercId).eq(!isQa, DeviceInfo::getActiveState, DeviceActiveStateEnum.TRUE.getCode()));
|
|
|
if (CollUtil.isEmpty(deviceInfos)) {
|
|
|
return CollUtil.newArrayList();
|
|
|
}
|