|
@@ -1,7 +1,6 @@
|
|
|
package com.persagy.adm.server.custom.controller;
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
-import com.persagy.adm.server.auth.service.AdmAuthService;
|
|
|
import com.persagy.adm.server.custom.common.AdmRequest;
|
|
|
import com.persagy.adm.server.custom.datatx.DataTxHandler;
|
|
|
import com.persagy.adm.server.custom.dto.HasUpdateReq;
|
|
@@ -9,6 +8,7 @@ import com.persagy.adm.server.custom.entity.ConfigData;
|
|
|
import com.persagy.adm.server.custom.entity.Dict;
|
|
|
import com.persagy.adm.server.custom.entity.DownLoadData;
|
|
|
import com.persagy.adm.server.custom.entity.UploadRtn;
|
|
|
+import com.persagy.adm.server.custom.interceptor.TokenInterceptor;
|
|
|
import com.persagy.adm.server.custom.service.ISyncApp;
|
|
|
import com.persagy.adm.server.custom.service.ServiceUtil;
|
|
|
import com.persagy.dmp.auth.domain.BossAuthUser;
|
|
@@ -43,9 +43,6 @@ public class AppController {
|
|
|
@Autowired
|
|
|
private DataTxHandler dataTxHandler;
|
|
|
|
|
|
- @Autowired
|
|
|
- private AdmAuthService admAuthService;
|
|
|
-
|
|
|
@RequestMapping("/clientId")
|
|
|
public CommonResult<Map<String, Object>> clientId(@RequestBody AdmRequest req){
|
|
|
HashMap<String, Object> rtn = new HashMap<>();
|
|
@@ -55,25 +52,25 @@ public class AppController {
|
|
|
|
|
|
@RequestMapping("/dict")
|
|
|
public CommonResult<Dict> dict(@RequestBody AdmRequest req){
|
|
|
- req.setUserId(admAuthService.loginInfo().getId());
|
|
|
+ req.setUserId(TokenInterceptor.bossAuthUserThreadLocal.get().getId());
|
|
|
return ResultHelper.single(syncApp.downloadDict(req.getGroupCode(), req.getProjectId(), req.getUserId()));
|
|
|
}
|
|
|
|
|
|
@RequestMapping("/config")
|
|
|
public CommonResult<ConfigData> config(@RequestBody AdmRequest req){
|
|
|
- req.setUserId(admAuthService.loginInfo().getId());
|
|
|
+ req.setUserId(TokenInterceptor.bossAuthUserThreadLocal.get().getId());
|
|
|
return ResultHelper.single(syncApp.downloadConfig(req.getGroupCode(), req.getProjectId(), req.getUserId()));
|
|
|
}
|
|
|
|
|
|
@RequestMapping("/frame")
|
|
|
public CommonResult<Map<String, Object>> frame(@RequestBody AdmRequest req){
|
|
|
- req.setUserId(admAuthService.loginInfo().getId());
|
|
|
+ req.setUserId(TokenInterceptor.bossAuthUserThreadLocal.get().getId());
|
|
|
return ResultHelper.single(syncApp.downloadFrameData(req.getGroupCode(), req.getProjectId(), req.getUserId()));
|
|
|
}
|
|
|
|
|
|
@RequestMapping("/download")
|
|
|
public CommonResult<DownLoadData> download(@RequestBody AdmRequest req){
|
|
|
- req.setUserId(admAuthService.loginInfo().getId());
|
|
|
+ req.setUserId(TokenInterceptor.bossAuthUserThreadLocal.get().getId());
|
|
|
DownLoadData data;
|
|
|
if(StrUtil.isNotBlank(req.getBuildingId())) {
|
|
|
data = syncApp.downloadBuildingData(req.getGroupCode(), req.getProjectId(), req.getUserId(), req.getClientId(), req.getBuildingId(), req.getBdtpDownloadTs(), req.getAdmDownloadTs());
|
|
@@ -88,7 +85,7 @@ public class AppController {
|
|
|
*/
|
|
|
@RequestMapping("/downloadObjRel")
|
|
|
public CommonResult<DownLoadData> downloadObjRel(@RequestBody AdmRequest req){
|
|
|
- req.setUserId(admAuthService.loginInfo().getId());
|
|
|
+ req.setUserId(TokenInterceptor.bossAuthUserThreadLocal.get().getId());
|
|
|
return ResultHelper.single(syncApp.downloadProjectData(req.getGroupCode(), req.getProjectId(), req.getUserId(), req.getClientId(), req.getBdtpDownloadTs(), req.getAdmDownloadTs()));
|
|
|
}
|
|
|
|
|
@@ -100,7 +97,7 @@ public class AppController {
|
|
|
@RequestMapping("/upload")
|
|
|
public CommonResult<UploadRtn> upload(HttpServletRequest request){
|
|
|
AdmRequest admRequest = dataTxHandler.handleRequest(request);
|
|
|
- BossAuthUser bossAuthUser = admAuthService.loginInfo();
|
|
|
+ BossAuthUser bossAuthUser = TokenInterceptor.bossAuthUserThreadLocal.get();
|
|
|
log.info("用户:{},上传数据:{}",bossAuthUser,admRequest);
|
|
|
return ResultHelper.single(syncApp.uploadData(admRequest.getUploadData(), admRequest.getGroupCode(), admRequest.getProjectId(), admRequest.getUserId(), admRequest.getClientId()));
|
|
|
}
|