|
@@ -10,11 +10,10 @@ import com.fdkankan.manage.common.PageInfo;
|
|
|
import com.fdkankan.manage.common.ResultCode;
|
|
|
import com.fdkankan.manage.entity.*;
|
|
|
import com.fdkankan.manage.exception.BusinessException;
|
|
|
+import com.fdkankan.manage.mapper.ICameraDetailMapper;
|
|
|
import com.fdkankan.manage.mapper.IRtkAccountMapper;
|
|
|
-import com.fdkankan.manage.service.IRtkAccountService;
|
|
|
+import com.fdkankan.manage.service.*;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
-import com.fdkankan.manage.service.IRtkUseLogService;
|
|
|
-import com.fdkankan.manage.service.ISysUserService;
|
|
|
import com.fdkankan.manage.task.DingdingService;
|
|
|
import com.fdkankan.manage.task.TaskService;
|
|
|
import com.fdkankan.manage.util.SendMailUtils;
|
|
@@ -58,17 +57,30 @@ public class RtkAccountServiceImpl extends ServiceImpl<IRtkAccountMapper, RtkAcc
|
|
|
DingdingService dingdingService;
|
|
|
@Autowired
|
|
|
TaskService taskService;
|
|
|
+ @Autowired
|
|
|
+ ICameraService cameraService;
|
|
|
+ @Autowired
|
|
|
+ ICameraDetailService cameraDetailService;
|
|
|
|
|
|
@Override
|
|
|
- public RtkAccount getOneNotUseAccount(String rtkSnCode) {
|
|
|
+ public RtkAccount getOneNotUseAccount(String rtkSnCode,String cameraSn) {
|
|
|
String redisKey = "4dkankan:rtk:snCode:"+rtkSnCode;
|
|
|
+ Long time = 8 * 60 * 60L;
|
|
|
+ if(StringUtils.isNotBlank(cameraSn)){
|
|
|
+ Camera camera = cameraService.getBySnCode(cameraSn);
|
|
|
+ if(camera != null){
|
|
|
+ CameraDetail cameraDetail = cameraDetailService.getByCameraId(camera.getId());
|
|
|
+ if(cameraDetail != null && ( cameraDetail.getType() == 10 || cameraDetail.getType() == 11)){
|
|
|
+ time = 4 * 60 * 60L;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
if(redisUtil.hasKey(redisKey)){
|
|
|
String jsonStr = redisUtil.get(redisKey);
|
|
|
- redisUtil.expire(redisKey,8 * 60 * 60);
|
|
|
+ redisUtil.expire(redisKey,time);
|
|
|
return JSONObject.parseObject(jsonStr, RtkAccount.class);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
LambdaQueryWrapper<RtkAccount> wrapper = new LambdaQueryWrapper<>();
|
|
|
wrapper.in(RtkAccount::getStatus,0,1);
|
|
|
wrapper.orderByAsc(RtkAccount::getUpdateTime);
|