From 976c901225ab892868cd6c6c041c73420628ce57 Mon Sep 17 00:00:00 2001
From: zhangnaisong <2434969829@qq.com>
Date: 星期五, 21 七月 2023 13:40:39 +0800
Subject: [PATCH] 查询全部三一车辆提交
---
ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarController.java | 18 +++++++++
ard-work/src/main/java/com/ruoyi/sy/service/IArdSyCarService.java | 5 ++
ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarServiceImpl.java | 53 ++++++++++++++++++++++++++
3 files changed, 76 insertions(+), 0 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 340f154..fe33285 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
@@ -161,6 +161,24 @@
}
/**
+ * 鑾峰彇鍏ㄩ儴鐨勪笁涓�杞﹁締
+ */
+ @PreAuthorize("@ss.hasPermi('sy:syCar:getArdSyCarAll')")
+ @PostMapping("/getArdSyCarAll")
+ @ApiOperation("鑾峰彇鍏ㄩ儴鐨勪笁涓�杞﹁締")
+ public Map<String,Object> getArdSyCarAll(){
+ String userId = SecurityUtils.getUserId();
+ Map<String,Object> result = ardSyCarService.getArdSyCarAll(userId);
+ if(((String)result.get("code")).equals("500")){
+ return error((String) result.get("data"));
+ }else if(((String)result.get("code")).equals("200")){
+ return success(result.get("data"));
+ }else{
+ return error("");
+ }
+ }
+
+ /**
* 鑾峰彇鍏ㄩ儴杞﹁締妯″瀷
*/
@PreAuthorize("@ss.hasPermi('sy:syCar:getAllCarModel')")
diff --git a/ard-work/src/main/java/com/ruoyi/sy/service/IArdSyCarService.java b/ard-work/src/main/java/com/ruoyi/sy/service/IArdSyCarService.java
index 195443f..4aa0e34 100644
--- a/ard-work/src/main/java/com/ruoyi/sy/service/IArdSyCarService.java
+++ b/ard-work/src/main/java/com/ruoyi/sy/service/IArdSyCarService.java
@@ -68,6 +68,11 @@
public Map<String,Object> getArdSyCarNoRight(String userId);
/**
+ * 鑾峰彇鏈寕鎺ユ潈闄愮殑涓変竴杞﹁締
+ */
+ public Map<String,Object> getArdSyCarAll(String userId);
+
+ /**
* 鑾峰彇鍏ㄩ儴杞﹁締妯″瀷
*/
public List<Map<String,String>> getAllCarModel();
diff --git a/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarServiceImpl.java b/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarServiceImpl.java
index 5e4a70f..ed8f4dc 100644
--- a/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarServiceImpl.java
@@ -180,6 +180,59 @@
}
@Override
+ public Map<String, Object> getArdSyCarAll(String userId) {
+ SysConfig config = new SysConfig();
+ config.setConfigKey("syCarPT");
+ List<SysConfig> sysConfigResult = sysConfigMapper.selectConfigList(config);
+ String syURL = "";
+ Map<String,Object> result = new HashMap();
+ if(sysConfigResult.size() == 0){
+ result.put("data","涓変竴杞﹁締url娌℃湁褰曞叆");
+ result.put("code","500");
+ return result;
+ }else{
+ syURL = sysConfigResult.get(0).getConfigValue();
+ ArdSyUser ardSyUserPara = new ArdSyUser();
+ ardSyUserPara.setSysUserId(userId);
+ List<ArdSyUser> ardSyUserList = ardSyUserMapper.selectArdSyUserList(ardSyUserPara);
+ if(ardSyUserList.size() == 0){
+ result.put("data","鐢ㄦ埛鏈寕鎺ヤ笁涓�杞﹁締");
+ result.put("code","500");
+ return result;
+ }else{
+ ArdSyUser ardSyUser = ardSyUserList.get(0);
+ Map<String,Object> LogInResult = SYCarClient.logIn(syURL,ardSyUser.getUserId(), ardSyUser.getPassword());
+ String sessionId = (String) LogInResult.get("sessionId");
+ Map<String,Object> carListMap = SYCarClient.getCarList(syURL,sessionId);
+ if(((String)carListMap.get("rspCode")).equals("1")){
+ List<Map<String,Object>> list = (List<Map<String,Object>>) carListMap.get("list");
+ /*ArdSyCar ardSyCar = new ArdSyCar();
+ List<ArdSyCar> ardSyCarList = ardSyCarMapper.selectArdSyCarList(ardSyCar);
+ List<String> carIdList = new ArrayList();
+ for(ArdSyCar innerArdSyCar : ardSyCarList){
+ carIdList.add(innerArdSyCar.getCarId());
+ }
+
+ List<Map<String,Object>> carList = list.stream().filter(new Predicate<Map<String,Object>>(){
+ @Override
+ public boolean test(Map<String,Object> map) {
+ return !carIdList.contains((String)map.get("carId"));
+ }
+ }).collect(Collectors.toList());
+ result.put("data",carList);*/
+ result.put("data",list);
+ result.put("code","200");
+ return result;
+ }else{
+ result.put("data","涓変竴杞﹁締骞冲彴鍑洪敊");
+ result.put("code","500");
+ return result;
+ }
+ }
+ }
+ }
+
+ @Override
public List<Map<String,String>> getAllCarModel() {
boolean exsit = MinioUtils.exitsBucket("sycar");
if (exsit) {
--
Gitblit v1.9.3