|
@@ -1,13 +1,9 @@
|
|
|
package com.fdkankan.indoor.core.service.impl;
|
|
|
|
|
|
-import cn.hutool.core.date.DateUtil;
|
|
|
-import cn.hutool.core.util.PageUtil;
|
|
|
import com.fdkankan.indoor.base.constant.MsgCode;
|
|
|
import com.fdkankan.indoor.base.util.Result;
|
|
|
import com.fdkankan.indoor.core.entity.InitEntity;
|
|
|
import com.fdkankan.indoor.core.entity.dto.PageDto;
|
|
|
-import com.fdkankan.indoor.core.entity.dto.SceneAgePageDto;
|
|
|
-import com.fdkankan.indoor.core.entity.vo.ResponseScene;
|
|
|
import com.fdkankan.indoor.core.mapper.InitMapper;
|
|
|
import com.fdkankan.indoor.core.service.InitService;
|
|
|
import com.fdkankan.indoor.core.service.SceneService;
|
|
@@ -17,10 +13,7 @@ import org.springframework.data.domain.*;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.List;
|
|
|
-import java.util.function.Function;
|
|
|
-import java.util.stream.Collectors;
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* Created by owen on 2021/7/26 0026 9:05
|
|
@@ -50,7 +43,8 @@ public class SceneServiceImpl extends IBaseServiceImpl implements SceneService {
|
|
|
// 重token中获取用户名
|
|
|
String tokenByUserName = getTokenByUserName();
|
|
|
if (tokenByUserName == null) {
|
|
|
- return Result.failure(MsgCode.e3001, "请检查token是否正确");
|
|
|
+ log.error("token为空");
|
|
|
+ return Result.failure(MsgCode.e3001, "请检查token是否正确或者token为空");
|
|
|
}
|
|
|
|
|
|
// 这里的"recordNo"是实体类的主键,记住一定要是实体类的属性,而不能是数据库的字段
|
|
@@ -64,7 +58,9 @@ public class SceneServiceImpl extends IBaseServiceImpl implements SceneService {
|
|
|
// 必要的查询条件
|
|
|
// search.setUserId(param.getUserId());
|
|
|
// search.setSnCode(param.getSnCode());
|
|
|
+ log.info("tokenByUserName: {}", tokenByUserName);
|
|
|
search.setUserName(tokenByUserName);
|
|
|
+ search.setUseStatus(1);
|
|
|
|
|
|
// 模糊查询条件
|
|
|
// 参考:https://blog.csdn.net/wonder_dog/article/details/82319216
|
|
@@ -104,6 +100,14 @@ public class SceneServiceImpl extends IBaseServiceImpl implements SceneService {
|
|
|
return Result.success(all);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Result updateByUseStatus(String sceneCode, Integer useStatus) {
|
|
|
+ InitEntity entity = initService.findById(sceneCode);
|
|
|
+ entity.setUseStatus(useStatus);
|
|
|
+ entity.setUpdateTime(LocalDateTime.now());
|
|
|
+ initMapper.save(entity);
|
|
|
+ return Result.success();
|
|
|
+ }
|
|
|
|
|
|
|
|
|
}
|