|
|
@ -17,6 +17,7 @@ import com.dongjian.dashboard.back.common.Constants; |
|
|
import com.dongjian.dashboard.back.common.response.ResponseCode; |
|
|
import com.dongjian.dashboard.back.common.response.ResponseCode; |
|
|
import com.dongjian.dashboard.back.common.response.SimpleDataResponse; |
|
|
import com.dongjian.dashboard.back.common.response.SimpleDataResponse; |
|
|
import com.dongjian.dashboard.back.dao.ex.BasicUserMapperExt; |
|
|
import com.dongjian.dashboard.back.dao.ex.BasicUserMapperExt; |
|
|
|
|
|
import com.dongjian.dashboard.back.dao.ex.LevelMapperExt; |
|
|
import com.dongjian.dashboard.back.dao.ex.UserBuildingRelationMapperExt; |
|
|
import com.dongjian.dashboard.back.dao.ex.UserBuildingRelationMapperExt; |
|
|
import com.dongjian.dashboard.back.dto.device.LineDataSearchParams; |
|
|
import com.dongjian.dashboard.back.dto.device.LineDataSearchParams; |
|
|
import com.dongjian.dashboard.back.util.DESUtil; |
|
|
import com.dongjian.dashboard.back.util.DESUtil; |
|
|
@ -55,6 +56,8 @@ public class CommonOpt { |
|
|
private BasicUserMapperExt basicUserMapperExt; |
|
|
private BasicUserMapperExt basicUserMapperExt; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private UserBuildingRelationMapperExt userBuildingRelationMapperExt; |
|
|
private UserBuildingRelationMapperExt userBuildingRelationMapperExt; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private LevelMapperExt levelMapperExt; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
@ -172,6 +175,20 @@ public class CommonOpt { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public List<Long> getBindLevelBuildingIdList(Long userId) { |
|
|
|
|
|
Integer levelManager = basicUserMapperExt.checkLevelManager(userId); |
|
|
|
|
|
if (levelManager > 0) { |
|
|
|
|
|
return null;//null表示不限制, sql里面判定bindedBuildingList=null的话,就不限制楼宇
|
|
|
|
|
|
} else { |
|
|
|
|
|
List<Long> bindedBuildingList = levelMapperExt.getBoundBuilding(userId); |
|
|
|
|
|
if (CollectionUtils.isEmpty(bindedBuildingList)) { |
|
|
|
|
|
return Collections.singletonList(-1L);//-1的话,表示没有绑定
|
|
|
|
|
|
} else { |
|
|
|
|
|
return bindedBuildingList; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public List<String> getPreDay(int days) { |
|
|
public List<String> getPreDay(int days) { |
|
|
// 获取当前日期
|
|
|
// 获取当前日期
|
|
|
LocalDate currentDate = LocalDate.now(); |
|
|
LocalDate currentDate = LocalDate.now(); |
|
|
|