|
@@ -9,11 +9,15 @@ import com.persagy.adm.server.custom.entity.DownLoadData;
|
|
|
import com.persagy.adm.server.custom.entity.UploadRtn;
|
|
|
import com.persagy.adm.server.custom.service.ISyncApp;
|
|
|
import com.persagy.adm.server.custom.service.ServiceUtil;
|
|
|
+import com.persagy.dmp.common.constant.ResponseCode;
|
|
|
+import com.persagy.dmp.common.exception.BusinessException;
|
|
|
import com.persagy.dmp.common.model.response.CommonResult;
|
|
|
import com.persagy.dmp.common.utils.ResultHelper;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.util.HashMap;
|
|
@@ -60,11 +64,19 @@ public class AppController {
|
|
|
DownLoadData data;
|
|
|
if(StrUtil.isNotBlank(req.getBuildingId())) {
|
|
|
data = syncApp.downloadBuildingData(req.getGroupCode(), req.getProjectId(), req.getUserId(), req.getClientId(), req.getBuildingId(), req.getBdtpDownloadTs(), req.getAdmDownloadTs());
|
|
|
- } else
|
|
|
- data = syncApp.downloadProjectData(req.getGroupCode(), req.getProjectId(), req.getUserId(), req.getClientId(), req.getBdtpDownloadTs(), req.getAdmDownloadTs());
|
|
|
+ }else {
|
|
|
+ throw new BusinessException(ResponseCode.A0400.getCode(),"建筑ID不能为空");
|
|
|
+ }
|
|
|
return ResultHelper.single(data);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 下载对象关系数据
|
|
|
+ */
|
|
|
+ @RequestMapping("/downloadObjRel")
|
|
|
+ public CommonResult<DownLoadData> downloadObjRel(@RequestBody AdmRequest req){
|
|
|
+ return ResultHelper.single(syncApp.downloadProjectData(req.getGroupCode(), req.getProjectId(), req.getUserId(), req.getClientId(), req.getBdtpDownloadTs(), req.getAdmDownloadTs()));
|
|
|
+ }
|
|
|
|
|
|
@RequestMapping("/upload")
|
|
|
public CommonResult<UploadRtn> upload(HttpServletRequest request){
|