|
@@ -47,378 +47,51 @@ import java.util.List;
|
|
|
public class ProjectTaskController {
|
|
|
|
|
|
@Autowired
|
|
|
- private ILargePlatAccessService largePlatAccessService;
|
|
|
+ private ServiceTaskService serviceTaskService;
|
|
|
|
|
|
- @Autowired
|
|
|
- private ILargePlatBasicsService largePlatBasicsService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ILargePlatBasicsCompanyService largePlatBasicsCompanyService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ILargePlatBasicsServerService largePlatBasicsServerService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ILargePlatBasicsSystemService largePlatBasicsSystemService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ILargePlatEmployeeHealthService largePlatEmployeeHealthService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ILargePlatEmployeeHealthIllnessService largePlatEmployeeHealthIllnessService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ILargePlatEmployeeTypeService largePlatEmployeeTypeService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ILargePlatEmployeeTypeFlowService largePlatEmployeeTypeFlowService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ILargePlatGreenFoodsService largePlatGreenFoodsService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ILargePlatGreenSmartService largePlatGreenSmartService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ILargePlatGreenSmartOtherService largePlatGreenSmartOtherService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ILargePlatGreenSmartRankService largePlatGreenSmartRankService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ILargePlatGreenSmartSafetyService largePlatGreenSmartSafetyService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ILargePlatPostStationService largePlatPostStationService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ILargePlatPostStationChartService largePlatPostStationChartService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ILargePlatPropertyService largePlatPropertyService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ILargePlatPropertyListService largePlatPropertyListService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ILargePlatPropertyToolsService largePlatPropertyToolsService;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ILargePlatHousingLandService largePlatHousingLandService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ILargePlatLogisticsService largePlatLogisticsService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ILargePlatLogisticsBuildingAssetService largePlatLogisticsBuildingAssetService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ILargePlatLogisticsOfficeAssetService largePlatLogisticsOfficeAssetService;
|
|
|
|
|
|
@Autowired
|
|
|
- private ILargePlatLogisticsServiceAssetService largePlatLogisticsServiceAssetService;
|
|
|
+ private LogisticsTaskService logisticsTaskService;
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ILargePlatBuildingService largePlatBuildingService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ILargePlatBuildingControlService largePlatBuildingControlService;
|
|
|
-
|
|
|
@Autowired
|
|
|
- private ILargePlatBuildingAmmeterDetailService largePlatBuildingAmmeterDetailService;
|
|
|
-
|
|
|
-
|
|
|
+ private BuildingTaskService buildingTaskService;
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
- private ILargeCameraService largeCameraService;
|
|
|
+ private EngineeringTaskService engineeringTaskService;
|
|
|
|
|
|
- @Autowired
|
|
|
- private ILargePlatIssueService largePlatIssueService;
|
|
|
|
|
|
@Autowired
|
|
|
- private ILargePlatProjectService largePlatProjectService;
|
|
|
+ private CarTaskService carTaskService;
|
|
|
|
|
|
-// @Autowired
|
|
|
-// private GenericService<LargeProject> service28;
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ILargeCarService largeCarService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ILargeCarDetailService largeCarDetailService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ILargeWarnDetailService largeWarnDetailService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ILargeCarRankService largeCarRankService;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private RestTemplate restTemplate;
|
|
|
-
|
|
|
- public String callExternalApi(String url) {
|
|
|
- try {
|
|
|
- System.out.println(url);
|
|
|
- ResponseEntity<String> response = restTemplate.exchange(url, HttpMethod.GET, null, String.class);
|
|
|
- return response.getBody();
|
|
|
- } catch (RestClientException e) {
|
|
|
- throw new RuntimeException(e);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-// @Scheduled(cron = "*/20 * * * * ?")
|
|
|
+ @Scheduled(cron = "0 */2 * * * ?")
|
|
|
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));
|
|
|
- largePlatBasicsServerService.saveOrUpdate(JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getBasicsServerUrl())).getJSONArray("data").toList(PlatBasicsServer.class));
|
|
|
- try {
|
|
|
- List<PlatBasicsSystem> list = JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getBasicsSystemUrl())).getJSONArray("data").toList(PlatBasicsSystem.class);
|
|
|
- if (list.size() < 1){
|
|
|
- return;
|
|
|
- }
|
|
|
- largePlatBasicsSystemService.remove(new LambdaQueryWrapper<>());
|
|
|
- largePlatBasicsSystemService.saveBatch(list);
|
|
|
- } catch (Exception e) {
|
|
|
- throw new RuntimeException(e);
|
|
|
- }
|
|
|
- largePlatEmployeeHealthService.saveOrUpdate(JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getHealthUrl())).getJSONArray("data").toList(PlatEmployeeHealth.class));
|
|
|
- try {
|
|
|
- List<PlatEmployeeHealthIllness> list = JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getHealthIllnessUrl())).getJSONArray("data").toList(PlatEmployeeHealthIllness.class);
|
|
|
- if (list.size() < 1){
|
|
|
- return;
|
|
|
- }
|
|
|
- largePlatEmployeeHealthIllnessService.remove(new LambdaQueryWrapper<>());
|
|
|
- largePlatEmployeeHealthIllnessService.saveBatch(list);
|
|
|
- } catch (Exception e) {
|
|
|
- throw new RuntimeException(e);
|
|
|
- }
|
|
|
- largePlatEmployeeTypeService.saveOrUpdate(JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getEmployeeTypeUrl())).getJSONArray("data").toList(PlatEmployeeType.class));
|
|
|
- try {
|
|
|
- List<PlatEmployeeTypeFlow> list = JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getEmployeeTypeFlowUrl())).getJSONArray("data").toList(PlatEmployeeTypeFlow.class);
|
|
|
- if (list.size() < 1){
|
|
|
- return;
|
|
|
- }
|
|
|
- largePlatEmployeeTypeFlowService.remove(new LambdaQueryWrapper<>());
|
|
|
- largePlatEmployeeTypeFlowService.saveBatch(list);
|
|
|
- } catch (Exception e) {
|
|
|
- throw new RuntimeException(e);
|
|
|
- }
|
|
|
- largePlatGreenFoodsService.saveOrUpdate(JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getGreenFoodsUrl())).getJSONArray("data").toList(PlatGreenFoods.class));
|
|
|
- largePlatGreenSmartService.saveOrUpdate(JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getGreenSmartUrl())).getJSONArray("data").toList(PlatGreenSmart.class));
|
|
|
- largePlatGreenSmartOtherService.saveOrUpdate(JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getGreenSmartOtherUrl())).getJSONArray("data").toList(PlatGreenSmartOther.class));
|
|
|
- try {
|
|
|
- List<PlatGreenSmartRank> list = JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getGreenSmartRankUrl())).getJSONArray("data").toList(PlatGreenSmartRank.class);
|
|
|
- if (list.size() < 1){
|
|
|
- return;
|
|
|
- }
|
|
|
- largePlatGreenSmartRankService.remove(new LambdaQueryWrapper<>());
|
|
|
- largePlatGreenSmartRankService.saveBatch(list);
|
|
|
- } catch (Exception e) {
|
|
|
- throw new RuntimeException(e);
|
|
|
- }
|
|
|
- largePlatGreenSmartSafetyService.saveOrUpdate(JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getGreenSmartSafetyUrl())).getJSONArray("data").toList(PlatGreenSmartSafety.class));
|
|
|
- largePlatPostStationService.saveOrUpdate(JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getPostStationUrl())).getJSONArray("data").toList(PlatPostStation.class));
|
|
|
- try {
|
|
|
- List<PlatPostStationChart> list = JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getPostStationChartUrl())).getJSONArray("data").toList(PlatPostStationChart.class);
|
|
|
- if (list.size() < 1){
|
|
|
- return;
|
|
|
- }
|
|
|
- largePlatPostStationChartService.remove(new LambdaQueryWrapper<>());
|
|
|
- largePlatPostStationChartService.saveBatch(list);
|
|
|
- } catch (Exception e) {
|
|
|
- throw new RuntimeException(e);
|
|
|
- }
|
|
|
- largePlatPropertyService.saveOrUpdate(JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getPropertyUrl())).getJSONArray("data").toList(PlatProperty.class));
|
|
|
- largePlatPropertyListService.saveOrUpdate(JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getPropertyListUrl())).getJSONArray("data").toList(PlatPropertyList.class));
|
|
|
- largePlatPropertyToolsService.saveOrUpdate(JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getPropertyToolsUrl())).getJSONArray("data").toList(PlatPropertyTools.class));
|
|
|
-
|
|
|
- System.out.println("服务保障同步完成");
|
|
|
+ serviceTaskService.myTask();
|
|
|
}
|
|
|
|
|
|
|
|
|
-// @Scheduled(cron = "*/20 * * * * ?")
|
|
|
+ @Scheduled(cron = "0 */2 * * * ?")
|
|
|
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("后勤资源同步完成");
|
|
|
+ logisticsTaskService.myTask();
|
|
|
}
|
|
|
|
|
|
|
|
|
-// @Scheduled(cron = "*/30 * * * * ?")
|
|
|
+ @Scheduled(cron = "0 */2 * * * ?")
|
|
|
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("楼宇运行同步完成");
|
|
|
+ buildingTaskService.myTask();
|
|
|
}
|
|
|
|
|
|
-// @Scheduled(cron = "*/20 * * * * ?")
|
|
|
+ @Scheduled(cron = "0 */2 * * * ?")
|
|
|
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("工程现场同步完成");
|
|
|
+ engineeringTaskService.myTask();
|
|
|
}
|
|
|
|
|
|
-// @Scheduled(cron = "*/25 * * * * ?")
|
|
|
+ @Scheduled(cron = "0 */2 * * * ?")
|
|
|
public void taskCar(){
|
|
|
- largeCarService.saveOrUpdate(JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getCarUrl())).getJSONArray("data").toList(LargeCar.class));
|
|
|
-
|
|
|
- try {
|
|
|
- List<LargeCarDetail> list = JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getCarChangeUrl())).getJSONArray("data").toList(LargeCarDetail.class);
|
|
|
- if (list.size() < 1){
|
|
|
- return;
|
|
|
- }
|
|
|
- largeCarDetailService.remove(new LambdaQueryWrapper<>());
|
|
|
- largeCarDetailService.saveBatch(list);
|
|
|
- } catch (Exception e) {
|
|
|
- throw new RuntimeException(e);
|
|
|
- }
|
|
|
-
|
|
|
- try {
|
|
|
- List<LargeWarnDetail> list = JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getCarWarnUrl())).getJSONArray("data").toList(LargeWarnDetail.class);
|
|
|
- if (list.size() < 1){
|
|
|
- return;
|
|
|
- }
|
|
|
- largeWarnDetailService.remove(new LambdaQueryWrapper<>());
|
|
|
- largeWarnDetailService.saveBatch(list);
|
|
|
- } catch (Exception e) {
|
|
|
- throw new RuntimeException(e);
|
|
|
- }
|
|
|
-
|
|
|
- try {
|
|
|
- List<LargeCarRank> list = JSONUtil.parseObj(callExternalApi(ApiUrlConfig.getCarRankUrl())).getJSONArray("data").toList(LargeCarRank.class);
|
|
|
- if (list.size() < 1){
|
|
|
- return;
|
|
|
- }
|
|
|
- largeCarRankService.remove(new LambdaQueryWrapper<>());
|
|
|
- largeCarRankService.saveBatch(list);
|
|
|
- } catch (Exception e) {
|
|
|
- throw new RuntimeException(e);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- System.out.println("公务用车同步完成");
|
|
|
+ carTaskService.myTask();
|
|
|
}
|
|
|
}
|