|
@@ -13,9 +13,7 @@ import com.sckj.project.domain.car.LargeWarnDetail;
|
|
|
import com.sckj.project.domain.engineering.LargeCamera;
|
|
|
import com.sckj.project.domain.engineering.LargeIssue;
|
|
|
import com.sckj.project.domain.engineering.LargeProject;
|
|
|
-import com.sckj.project.domain.logistics.LargeAssetDirs;
|
|
|
-import com.sckj.project.domain.logistics.LargeHousingLand;
|
|
|
-import com.sckj.project.domain.logistics.LargeLogistics;
|
|
|
+import com.sckj.project.domain.logistics.*;
|
|
|
import com.sckj.project.domain.service.*;
|
|
|
import com.sckj.project.service.building.ILargePlatBuildingAmmeterDetailService;
|
|
|
import com.sckj.project.service.building.ILargePlatBuildingControlService;
|
|
@@ -27,9 +25,7 @@ import com.sckj.project.service.car.ILargeWarnDetailService;
|
|
|
import com.sckj.project.service.engineering.ILargeCameraService;
|
|
|
import com.sckj.project.service.engineering.ILargePlatIssueService;
|
|
|
import com.sckj.project.service.engineering.ILargePlatProjectService;
|
|
|
-import com.sckj.project.service.logistics.ILargePlatHousingLandService;
|
|
|
-import com.sckj.project.service.logistics.ILargePlatLogisticsBuildingAssetService;
|
|
|
-import com.sckj.project.service.logistics.ILargePlatLogisticsService;
|
|
|
+import com.sckj.project.service.logistics.*;
|
|
|
import com.sckj.project.service.service.*;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.HttpMethod;
|
|
@@ -118,6 +114,12 @@ public class ProjectTaskController {
|
|
|
@Autowired
|
|
|
private ILargePlatLogisticsBuildingAssetService largePlatLogisticsBuildingAssetService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ILargePlatLogisticsOfficeAssetService largePlatLogisticsOfficeAssetService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ILargePlatLogisticsServiceAssetService largePlatLogisticsServiceAssetService;
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -175,9 +177,8 @@ public class ProjectTaskController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @Scheduled(cron = "*/20 * * * * ?")
|
|
|
- public void taskService()
|
|
|
- {
|
|
|
+// @Scheduled(cron = "*/20 * * * * ?")
|
|
|
+ public void taskService() {
|
|
|
largePlatAccessService.saveOrUpdate(JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getAccessUrl())).getJSONArray("data").toList(PlatAccess.class));
|
|
|
largePlatBasicsService.saveOrUpdate(JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getBasicsApiUrl())).getJSONArray("data").toList(PlatBasics.class));
|
|
|
largePlatBasicsCompanyService.saveOrUpdate(JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getBasicsCompanyUrl())).getJSONArray("data").toList(PlatBasicsCompany.class));
|
|
@@ -247,109 +248,140 @@ public class ProjectTaskController {
|
|
|
}
|
|
|
|
|
|
|
|
|
-// @Scheduled(cron = "*/5 * * * * ?")
|
|
|
-// public void taskLogistics(){
|
|
|
-// try {
|
|
|
-// List<LargeHousingLand> list = JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getLogisticsHousingUrl())).getJSONArray("data").toList(LargeHousingLand.class);
|
|
|
-// if (list.size() < 1){
|
|
|
-// return;
|
|
|
-// }
|
|
|
-// largePlatHousingLandService.remove(new LambdaQueryWrapper<>());
|
|
|
-// largePlatHousingLandService.saveBatch(list);
|
|
|
-// } catch (Exception e) {
|
|
|
-// throw new RuntimeException(e);
|
|
|
-// }
|
|
|
-//
|
|
|
-// largePlatLogisticsService.saveOrUpdate(JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getLogisticsUrl())).getJSONArray("data").toList(LargeLogistics.class));
|
|
|
-// largePlatLogisticsBuildingAssetService.saveOrUpdate(JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getLogisticsBuildingAssetUrl())).getJSONArray("data").toList(LargeAssetDirs.class));
|
|
|
-// largePlatLogisticsBuildingAssetService.saveOrUpdate(JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getLogisticsOfficeAssetUrl())).getJSONArray("data").toList(LargeAssetDirs.class));
|
|
|
-// largePlatLogisticsBuildingAssetService.saveOrUpdate(JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getLogisticsServiceAssetUrl())).getJSONArray("data").toList(LargeAssetDirs.class));
|
|
|
-//
|
|
|
-// System.out.println("后勤资源同步完成");
|
|
|
-// }
|
|
|
-
|
|
|
-
|
|
|
-// @Scheduled(cron = "*/5 * * * * ?")
|
|
|
-// public void taskBuilding(){
|
|
|
-// try {
|
|
|
-// List<LargeBuilding> list = JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getBuildingUrl())).getJSONArray("data").toList(LargeBuilding.class);
|
|
|
-// if (list.size() < 1){
|
|
|
-// return;
|
|
|
-// }
|
|
|
-// largePlatBuildingService.remove(new LambdaQueryWrapper<>());
|
|
|
-// largePlatBuildingService.saveBatch(list);
|
|
|
-// } catch (Exception e) {
|
|
|
-// throw new RuntimeException(e);
|
|
|
-// }
|
|
|
-//
|
|
|
-// try {
|
|
|
-// List<LargeBuildingControl> list = JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getBuildingControlUrl())).getJSONArray("data").toList(LargeBuildingControl.class);
|
|
|
-// if (list.size() < 1){
|
|
|
-// return;
|
|
|
-// }
|
|
|
-// largePlatBuildingControlService.remove(new LambdaQueryWrapper<>());
|
|
|
-// largePlatBuildingControlService.saveBatch(list);
|
|
|
-// } catch (Exception e) {
|
|
|
-// throw new RuntimeException(e);
|
|
|
-// }
|
|
|
-//
|
|
|
-// try {
|
|
|
-// List<LargeBuildingControlAmmeterDetail> list = JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getBuildingAmmeterDetailUrl())).getJSONArray("data").toList(LargeBuildingControlAmmeterDetail.class);
|
|
|
-// if (list.size() < 1){
|
|
|
-// return;
|
|
|
-// }
|
|
|
-// largePlatBuildingAmmeterDetailService.remove(new LambdaQueryWrapper<>());
|
|
|
-// largePlatBuildingAmmeterDetailService.saveBatch(list);
|
|
|
-// } catch (Exception e) {
|
|
|
-// throw new RuntimeException(e);
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-// System.out.println("楼宇运行同步完成");
|
|
|
-// }
|
|
|
-
|
|
|
-// @Scheduled(cron = "*/5 * * * * ?")
|
|
|
-// public void taskEngineering(){
|
|
|
-//
|
|
|
-// try {
|
|
|
-// List<LargeCamera> list = JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getEngineerCameraUrl())).getJSONArray("data").toList(LargeCamera.class);
|
|
|
-// if (list.size() < 1){
|
|
|
-// return;
|
|
|
-// }
|
|
|
-// largeCameraService.remove(new LambdaQueryWrapper<>());
|
|
|
-// largeCameraService.saveBatch(list);
|
|
|
-// } catch (Exception e) {
|
|
|
-// throw new RuntimeException(e);
|
|
|
-// }
|
|
|
-//
|
|
|
-// try {
|
|
|
-// List<LargeIssue> list = JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getEngineerIssueUrl())).getJSONArray("data").toList(LargeIssue.class);
|
|
|
-// if (list.size() < 1){
|
|
|
-// return;
|
|
|
-// }
|
|
|
-// largePlatIssueService.remove(new LambdaQueryWrapper<>());
|
|
|
-// largePlatIssueService.saveBatch(list);
|
|
|
-// } catch (Exception e) {
|
|
|
-// throw new RuntimeException(e);
|
|
|
-// }
|
|
|
-//
|
|
|
-//// JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getEngineerPlanUrl())).getJSONArray("data").toList(LargePlan.class);
|
|
|
-//
|
|
|
-// try {
|
|
|
-// List<LargeProject> list = JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getEngineerProjectUrl())).getJSONArray("data").toList(LargeProject.class);
|
|
|
-// if (list.size() < 1){
|
|
|
-// return;
|
|
|
-// }
|
|
|
-// largePlatProjectService.remove(new LambdaQueryWrapper<>());
|
|
|
-// largePlatProjectService.saveBatch(list);
|
|
|
-// } catch (Exception e) {
|
|
|
-// throw new RuntimeException(e);
|
|
|
-// }
|
|
|
-//
|
|
|
-// System.out.println("工程现场同步完成");
|
|
|
-// }
|
|
|
-
|
|
|
- @Scheduled(cron = "0 */5 * * * ?")
|
|
|
+// @Scheduled(cron = "*/20 * * * * ?")
|
|
|
+ public void taskLogistics(){
|
|
|
+ try {
|
|
|
+ List<LargeHousingLand> list = JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getLogisticsHousingUrl())).getJSONArray("data").toList(LargeHousingLand.class);
|
|
|
+ if (list.size() < 1){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ largePlatHousingLandService.remove(new LambdaQueryWrapper<>());
|
|
|
+ largePlatHousingLandService.saveBatch(list);
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+
|
|
|
+ largePlatLogisticsService.saveOrUpdate(JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getLogisticsUrl())).getJSONArray("data").toList(LargeLogistics.class));
|
|
|
+
|
|
|
+ try {
|
|
|
+ List<LargeBuildingAssetDirs> list = JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getLogisticsBuildingAssetUrl())).getJSONArray("data").toList(LargeBuildingAssetDirs.class);
|
|
|
+ if (list.size() < 1){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ largePlatLogisticsBuildingAssetService.remove(new LambdaQueryWrapper<>());
|
|
|
+ largePlatLogisticsBuildingAssetService.saveBatch(list);
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+
|
|
|
+ try {
|
|
|
+ List<LargeOfficeAssetDirs> list = JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getLogisticsOfficeAssetUrl())).getJSONArray("data").toList(LargeOfficeAssetDirs.class);
|
|
|
+ if (list.size() < 1){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ largePlatLogisticsOfficeAssetService.remove(new LambdaQueryWrapper<>());
|
|
|
+ largePlatLogisticsOfficeAssetService.saveBatch(list);
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+
|
|
|
+ try {
|
|
|
+ List<LargeServiceAssetDirs> list = JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getLogisticsServiceAssetUrl())).getJSONArray("data").toList(LargeServiceAssetDirs.class);
|
|
|
+ if (list.size() < 1){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ largePlatLogisticsServiceAssetService.remove(new LambdaQueryWrapper<>());
|
|
|
+ largePlatLogisticsServiceAssetService.saveBatch(list);
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ System.out.println("后勤资源同步完成");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+// @Scheduled(cron = "*/30 * * * * ?")
|
|
|
+ public void taskBuilding(){
|
|
|
+ try {
|
|
|
+ List<LargeBuilding> list = JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getBuildingUrl())).getJSONArray("data").toList(LargeBuilding.class);
|
|
|
+ if (list.size() < 1){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ largePlatBuildingService.remove(new LambdaQueryWrapper<>());
|
|
|
+ largePlatBuildingService.saveBatch(list);
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+
|
|
|
+ try {
|
|
|
+ List<LargeBuildingControl> list = JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getBuildingControlUrl())).getJSONArray("data").toList(LargeBuildingControl.class);
|
|
|
+ if (list.size() < 1){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ largePlatBuildingControlService.remove(new LambdaQueryWrapper<>());
|
|
|
+ largePlatBuildingControlService.saveBatch(list);
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+
|
|
|
+ try {
|
|
|
+ List<LargeBuildingControlAmmeterDetail> list = JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getBuildingAmmeterDetailUrl())).getJSONArray("data").toList(LargeBuildingControlAmmeterDetail.class);
|
|
|
+ if (list.size() < 1){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ largePlatBuildingAmmeterDetailService.remove(new LambdaQueryWrapper<>());
|
|
|
+ largePlatBuildingAmmeterDetailService.saveBatch(list);
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ System.out.println("楼宇运行同步完成");
|
|
|
+ }
|
|
|
+
|
|
|
+// @Scheduled(cron = "*/20 * * * * ?")
|
|
|
+ public void taskEngineering(){
|
|
|
+
|
|
|
+ try {
|
|
|
+ List<LargeCamera> list = JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getEngineerCameraUrl())).getJSONArray("data").toList(LargeCamera.class);
|
|
|
+ if (list.size() < 1){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ largeCameraService.remove(new LambdaQueryWrapper<>());
|
|
|
+ largeCameraService.saveBatch(list);
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+
|
|
|
+ try {
|
|
|
+ List<LargeIssue> list = JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getEngineerIssueUrl())).getJSONArray("data").toList(LargeIssue.class);
|
|
|
+ if (list.size() < 1){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ largePlatIssueService.remove(new LambdaQueryWrapper<>());
|
|
|
+ largePlatIssueService.saveBatch(list);
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+
|
|
|
+// JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getEngineerPlanUrl())).getJSONArray("data").toList(LargePlan.class);
|
|
|
+
|
|
|
+ try {
|
|
|
+ List<LargeProject> list = JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getEngineerProjectUrl())).getJSONArray("data").toList(LargeProject.class);
|
|
|
+ if (list.size() < 1){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ largePlatProjectService.remove(new LambdaQueryWrapper<>());
|
|
|
+ largePlatProjectService.saveBatch(list);
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+
|
|
|
+ System.out.println("工程现场同步完成");
|
|
|
+ }
|
|
|
+
|
|
|
+// @Scheduled(cron = "*/25 * * * * ?")
|
|
|
public void taskCar(){
|
|
|
largeCarService.saveOrUpdate(JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getCarUrl())).getJSONArray("data").toList(LargeCar.class));
|
|
|
|