From bc2d4d4f3ceee6e51b15723c5e3f2c981bd72ba0 Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期五, 29 十二月 2023 10:10:55 +0800
Subject: [PATCH] 车牌
---
ard-work/src/main/java/com/ruoyi/sy/domain/ArdSyCarVo.java | 15 +++++++++++++++
ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarController.java | 45 +++++++++++++++++++++++++++++++++++++++++----
2 files changed, 56 insertions(+), 4 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarController.java b/ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarController.java
index 9d0d430..334603a 100644
--- a/ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarController.java
+++ b/ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarController.java
@@ -9,9 +9,12 @@
import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson2.JSON;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
+import com.ruoyi.sy.domain.ArdSyCarVo;
import com.ruoyi.sy.domain.ArdSyUser;
import com.ruoyi.sy.gps31.PositionContainer;
import com.ruoyi.sy.gps31.PushClientImplAlarm;
@@ -78,7 +81,6 @@
ardSyCarController = this;
ardSyCarController.sysConfigService = this.sysConfigService;
ardSyCarController.iArdSyUserService = this.iArdSyUserService;
-
SysConfig config = new SysConfig();
config.setConfigKey("syCarPT");
List<SysConfig> sysConfigResult = sysConfigService.selectConfigList(config);
@@ -119,11 +121,46 @@
*/
@PreAuthorize("@ss.hasPermi('sy:syCar:list')")
@GetMapping("/list")
- public TableDataInfo list(ArdSyCar ardSyCar)
+ @ApiOperation("鏌ヨ涓変竴杞﹁締鍒楄〃")
+ public AjaxResult list(ArdSyCar ardSyCar)
{
- startPage();
+ if(ardSyCar.getPageNum()==null || ardSyCar.getPageNum() == 0){
+ ardSyCar.setPageNum(1);
+ }
+ if(ardSyCar.getPageSize()==null || ardSyCar.getPageSize() == 0){
+ ardSyCar.setPageSize(10);
+ }
+ PageHelper.startPage(ardSyCar.getPageNum(),ardSyCar.getPageSize());
List<ArdSyCar> list = ardSyCarService.selectArdSyCarList(ardSyCar);
- return getDataTable(list);
+ String userId = SecurityUtils.getUserId();
+ Map<String,Object> result = ardSyCarService.getArdSyCarAll(userId);
+ List<ArdSyCarVo> ardSyCarVoList = new ArrayList<>();
+ if(((String)result.get("code")).equals("200")){
+ List<Map<String,Object>> list1 = (List<Map<String, Object>>) result.get("data");
+ for (int i = 0; i < list.size(); i++) {
+ ArdSyCar ardSyCar1 = list.get(i);
+ String carId = ardSyCar1.getCarId();
+ for (int j = 0; j < list1.size(); j++) {
+ String carId31 = (String) list1.get(j).get("carId");
+ if(carId.equals(carId31)){
+ ArdSyCarVo ardSyCarVo = new ArdSyCarVo();
+ ardSyCarVo.setCarId(carId);
+ ardSyCarVo.setCarBrand(ardSyCar1.getCarBrand());
+ ardSyCarVo.setCarModel(ardSyCar1.getCarModel());
+ ardSyCarVo.setCarPicture(ardSyCar1.getCarPicture());
+ ardSyCarVo.setCarType(ardSyCar1.getCarType());
+ ardSyCarVo.setDeptId(ardSyCar1.getDeptId());
+ ardSyCarVo.setRemark(ardSyCar1.getRemark());
+ ardSyCarVo.setCarPlate((String) list1.get(j).get("carPlate"));
+ ardSyCarVoList.add(ardSyCarVo);
+ break;
+ }
+ }
+ }
+ return AjaxResult.success(new PageInfo<>(ardSyCarVoList));
+ }else {
+ return AjaxResult.success(new PageInfo<>(list));
+ }
}
/**
diff --git a/ard-work/src/main/java/com/ruoyi/sy/domain/ArdSyCarVo.java b/ard-work/src/main/java/com/ruoyi/sy/domain/ArdSyCarVo.java
new file mode 100644
index 0000000..bd82416
--- /dev/null
+++ b/ard-work/src/main/java/com/ruoyi/sy/domain/ArdSyCarVo.java
@@ -0,0 +1,15 @@
+package com.ruoyi.sy.domain;
+
+import lombok.Data;
+
+@Data
+public class ArdSyCarVo {
+ private String carId;
+ private String carBrand;
+ private String carModel;
+ private String carPicture;
+ private String carType;
+ private String deptId;
+ private String remark;
+ private String carPlate;
+}
--
Gitblit v1.9.3