From f4af3160d181e9e4f9a0d26ecafd8794738b26c8 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期二, 24 九月 2024 09:28:22 +0800
Subject: [PATCH] 代码初始化
---
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/Platform.java | 5 ++
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/PlatformService.java | 3 +
server/visits/dmvisit_service/src/main/java/com/doumee/dao/openapi/response/PlatformStatusListResponse.java | 28 ++++++++++++++
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformServiceImpl.java | 30 +++++++++++++++
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/openapi/HkOpenApiController.java | 8 ++++
5 files changed, 73 insertions(+), 1 deletions(-)
diff --git a/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/openapi/HkOpenApiController.java b/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/openapi/HkOpenApiController.java
index 0170f1c..1643760 100644
--- a/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/openapi/HkOpenApiController.java
+++ b/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/openapi/HkOpenApiController.java
@@ -195,4 +195,12 @@
public ApiResponse<List<PlatformWarnEventListResponse>> warningEventList(@RequestBody PlatformWarnEventListRequest param) {
return ApiResponse.success(new ArrayList<>());
}
+
+ @LoginNoRequired
+ @PreventRepeat
+ @ApiOperation("銆愭湀鍙般�戞湀鍙扮姸鎬�")
+ @PostMapping("/platform/getStatusList")
+ public ApiResponse<List<PlatformStatusListResponse>> getStatusList() {
+ return ApiResponse.success(platformService.getPlatformStatusList());
+ }
}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/Platform.java b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/Platform.java
index 256a013..74e4fe0 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/Platform.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/Platform.java
@@ -46,7 +46,6 @@
@ApiModelProperty(value = "鏇存柊鏃堕棿")
@ExcelColumn(name="鏇存柊鏃堕棿")
-
private Date editDate;
@ApiModelProperty(value = "鏄惁鍒犻櫎0鍚� 1鏄�", example = "1")
@@ -184,6 +183,10 @@
@TableField(exist = false)
private Integer workStatus;
+ @ApiModelProperty(value = "浣滀笟杞﹁締杞︾墝鐓�")
+ @TableField(exist = false)
+ private String workCarCode;
+
@ApiModelProperty(value = "鏈堝彴浣滀笟鏁版嵁")
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/openapi/response/PlatformStatusListResponse.java b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/openapi/response/PlatformStatusListResponse.java
new file mode 100644
index 0000000..720916f
--- /dev/null
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/openapi/response/PlatformStatusListResponse.java
@@ -0,0 +1,28 @@
+package com.doumee.dao.openapi.response;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * Created by IntelliJ IDEA.
+ *
+ * @Author : Rk
+ * @create 2023/12/7 11:19
+ */
+@Data
+@ApiModel("銆愭湀鍙般�戞湀鍙扮姸鎬�")
+public class PlatformStatusListResponse {
+
+ @ApiModelProperty(value = "鏈堝彴ID" )
+ private String platformHkId;
+ @ApiModelProperty(value = "鏈堝彴鍚嶇О" )
+ private String platformName;
+ @ApiModelProperty(value = "杞︾墝鍙�" )
+ private String carCode;
+ @ApiModelProperty(value = "鏈堝彴鐘舵�� 0-鏃犺溅 1-鏈夎溅 2-瓒呮椂鍋滈潬 3-閿欒鍋滈潬" )
+ private Integer status;
+
+}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/PlatformService.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/PlatformService.java
index beaa70c..81fe289 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/PlatformService.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/PlatformService.java
@@ -4,6 +4,7 @@
import com.doumee.core.model.PageWrap;
import com.doumee.dao.business.model.Platform;
import com.doumee.dao.openapi.response.PlatformNumByStatusResponse;
+import com.doumee.dao.openapi.response.PlatformStatusListResponse;
import java.util.List;
@@ -101,4 +102,6 @@
PlatformNumByStatusResponse getPlatformNumByStatusResponse();
+ List<PlatformStatusListResponse> getPlatformStatusList();
+
}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformServiceImpl.java
index 893331c..589330c 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformServiceImpl.java
@@ -14,6 +14,7 @@
import com.doumee.dao.business.join.PlatformJoinMapper;
import com.doumee.dao.business.model.*;
import com.doumee.dao.openapi.response.PlatformNumByStatusResponse;
+import com.doumee.dao.openapi.response.PlatformStatusListResponse;
import com.doumee.service.business.PlatformDeviceService;
import com.doumee.service.business.PlatformService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -333,6 +334,35 @@
+ @Override
+ public List<PlatformStatusListResponse> getPlatformStatusList(){
+ List<Platform> platformList = platformJoinMapper.selectJoinList(Platform.class,new MPJLambdaWrapper<Platform>()
+ .selectAll(Platform.class)
+ .select(" ( select count(1) from platform_job pj where t.id = pj.PLATFORM_ID and pj.STATUS = "+Constants.PlatformJobStatus.WORKING.getKey()+" ) as workStatus ")
+ .select(" ( select pj.CAR_CODE_FRONT from platform_job pj where t.id = pj.PLATFORM_ID and pj.STATUS = "+Constants.PlatformJobStatus.WORKING.getKey()+" limit 1 ) as workCarCode ")
+ .eq(Platform::getIsdeleted,Constants.ZERO)
+ );
+ List<PlatformStatusListResponse> platformStatusListResponses = new ArrayList<>();
+ if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(platformList)){
+ for (Platform platform:platformList) {
+ PlatformStatusListResponse response = new PlatformStatusListResponse();
+ response.setPlatformHkId(platform.getHkId());
+ response.setPlatformName(platform.getName());
+ response.setStatus(platform.getPlatformStatus());
+ if(Constants.equalsInteger(platform.getPlatformStatus(),Constants.ONE)){
+ response.setCarCode(platform.getWorkCarCode());
+ }
+
+
+
+ }
+ }
+
+
+ return platformStatusListResponses;
+
+ }
+
}
--
Gitblit v1.9.3