From 160e150009b51a39fa95d9462c3798ba28d51a09 Mon Sep 17 00:00:00 2001
From: lxw <810412026@qq.com>
Date: 星期二, 15 八月 2023 08:49:47 +0800
Subject: [PATCH] 审批页面修改

---
 src/main/java/com/whyc/controller/BattInfController.java |  137 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 136 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/whyc/controller/BattInfController.java b/src/main/java/com/whyc/controller/BattInfController.java
index 7ac4803..c8dedef 100644
--- a/src/main/java/com/whyc/controller/BattInfController.java
+++ b/src/main/java/com/whyc/controller/BattInfController.java
@@ -1,16 +1,23 @@
 package com.whyc.controller;
 
 import com.whyc.dto.Response;
+import com.whyc.dto.ServiceModel;
+import com.whyc.dto.paramter.DateTimePar;
 import com.whyc.pojo.Battinf;
 import com.whyc.pojo.UserInf;
 import com.whyc.service.BattInfService;
 import com.whyc.util.ActionUtil;
+import com.whyc.util.HttpUtil;
 import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
 import java.util.List;
+import java.util.Map;
 
 @RequestMapping("battInf")
 @RestController
@@ -21,7 +28,7 @@
     private BattInfService service;
 
     @GetMapping("/searchAllStationName1")
-    @ApiOperation("鏌ヨ鐪�")
+    @ApiOperation(tags = "鍦ㄧ嚎鐩戞祴-鍘嗗彶鏁版嵁绠$悊",value="鏌ヨ鐪�",notes = "鍘熸帴鍙�:BattInfAction!serchAllStationName1")
     public Response searchAllStationName1(){
         UserInf userInf = (UserInf) ActionUtil.getUser();
         return service.searchAllStationName1(userInf.getUId().intValue());
@@ -99,6 +106,12 @@
         return service.update(battinf);
     }
 
+    @PutMapping("/updateList")
+    @ApiOperation(value = "鏇存柊鐢垫睜缁凩ist")
+    public Response updateList(@RequestBody List<Battinf> battinfs){
+        return service.updateList(battinfs);
+    }
+
 
     @PutMapping("/updatePubByDevId")
     @ApiOperation(value = "鏍规嵁璁惧id淇敼PublicKeyY鍊�")
@@ -159,4 +172,126 @@
         return service.findBattProducerInfoByYearCode(yearCode,userInf.getUId().intValue());
     }
 
+    @PostMapping("/findBattProducerInfoByTime")
+    @ApiOperation(value = "鏍规嵁鐢垫睜浣跨敤鏃堕棿娈垫煡璇㈢珯鐐瑰強鐢垫睜鍝佺墝鍩虹淇℃伅",notes = "")
+    public Response findBattProducerInfoByTime(@RequestBody DateTimePar dateTimePar){
+        UserInf userInf = ActionUtil.getUser();
+        return service.findBattProducerInfoByTime(dateTimePar.getStartTime(),dateTimePar.getEndTime(),userInf.getUId().intValue());
+    }
+
+    @GetMapping("/findBattInfByStationId")
+    @ApiOperation("鏍规嵁鏈烘埧id鑾峰彇鐢垫睜淇℃伅")
+    public Response findBattInfByStationId(@RequestParam String stationId){
+        return service.findBattInfoByStationId(stationId);
+    }
+
+    @GetMapping("stationList8059")
+    @ApiOperation(tags = "鍦ㄧ嚎鐩戞祴-涓�浣撴満瀵煎叆璁板綍",value = "绔欑偣鍒楄〃")
+    public Response<List<Battinf>> getStationList8059(){
+        Long uId = ActionUtil.getUser().getUId();
+        List<Battinf> stationList = service.getStationList8059(uId);
+        return new Response<List<Battinf>>().set(1,stationList);
+    }
+
+    @GetMapping("battInfByStationId")
+    @ApiOperation(tags = "鍦ㄧ嚎鐩戞祴-涓�浣撴満瀵煎叆璁板綍",value = "绔欑偣涓嬬殑鐢垫睜缁勪俊鎭�")
+    public Response findBattInfByStationId2(@RequestParam String stationId){
+        return service.findBattInfoByStationId(stationId);
+    }
+
+    @GetMapping("/searchByMonNum")
+    @ApiOperation(value = "鏍规嵁鐢垫睜缁刬d鏌ヨ涓嶉噸澶嶇殑鍗曚綋缂栧彿")
+    public Response searchByMonNum(int battGroupId){
+        return service.searchByMonNum(battGroupId);
+    }
+
+
+    @GetMapping("/getVideoAccessToken")
+    @ApiOperation(value = "鑾峰彇鏈烘埧鍐呯數姹犵粍瀵瑰簲瑙嗛鐨則oken浠ょ墝")
+    public Response getVideoAccessToken()  {
+        String resultJson = HttpUtil.doPost(HttpUtil.VIDEO_URL, HttpUtil.VIDEO_REQUEST_BODY);
+        ServiceModel responseNew = ActionUtil.getGson().fromJson(resultJson, ServiceModel.class);
+        //ActionUtil.getApplication().setAttribute("videoToken",responseNew);
+        if(responseNew.getCode()==200){
+            return new Response().set(1,((Map)responseNew.getData()).get("accessToken"));
+        }else{
+            return new Response().setCode(0);
+        }
+    }
+
+    //@GetMapping("/getVideoAccessToken")
+    //@ApiOperation(value = "鑾峰彇鏈烘埧鍐呯數姹犵粍瀵瑰簲瑙嗛鐨則oken浠ょ墝")
+    //public Response getVideoAccessToken1()  {
+    //    Response response = new Response();
+    //    String resultJson = HttpUtil.doPost(HttpUtil.VIDEO_URL, HttpUtil.VIDEO_REQUEST_BODY);
+    //    try {
+    //        Object resp =  ActionUtil.getApplication().getAttribute("videoToken");
+    //        Integer code = ((ServiceModel)resp).getCode();
+    //        Map map = (Map) ((ServiceModel)resp).getData();
+    //        if(code==200){
+    //            String accessToken = (String) map.get("accessToken");
+    //            Double expireTime = (Double) map.get("expireTime");
+    //            long now = System.currentTimeMillis();
+    //            if(now>=(expireTime-1000*10)){
+    //                //閲嶆柊鑾峰彇accessToken骞跺瓨鍏pplication
+    //                //String resultJson = HttpUtil.doPost(HttpUtil.VIDEO_URL, HttpUtil.VIDEO_REQUEST_BODY);
+    //                Response responseNew = ActionUtil.getGson().fromJson(resultJson, Response.class);
+    //                ActionUtil.getApplication().setAttribute("videoToken",responseNew);
+    //                if(responseNew.getCode()==200){
+    //                    response.set(1,((Map)responseNew.getData()).get("accessToken"));
+    //                }else{
+    //                    response.setCode(0);
+    //                }
+    //            }else {
+    //                response.set(1,accessToken);
+    //            }
+    //        }else {
+    //            response.set(0);
+    //        }
+    //    }catch (Exception e){
+    //
+    //        response.set(0);
+    //    }
+    //    return response;
+    //}
+    @PostMapping("/uploadPicOfStation")
+    @ApiOperation("涓婁紶鍥剧墖")
+    @ApiImplicitParam(name = "file", value = "涓婁紶鐨勬枃浠�", dataTypeClass = MultipartFile.class, required = true,paramType = "form")
+    public Response uploadPicOfStation(@RequestPart("file") List<MultipartFile> file, @RequestParam String stationId){
+        return service.uploadPicOfStation(file,stationId);
+    }
+    @PostMapping("/deletePic")
+    @ApiOperation("鍒犻櫎鍥剧墖")
+    public Response deletePic(@RequestParam String stationId,@RequestParam List<String> fileNames){
+        return service.deletePic(stationId,fileNames);
+    }
+    @PostMapping("/getStationPic")
+    @ApiOperation("鑾峰彇绔欑偣鍥剧墖")
+    public Response getStationPic(@RequestParam String stationId){
+        return service.getStationPic(stationId);
+    }
+
+    @GetMapping("getDeviceId")
+    @ApiOperation(value = "鑾峰彇鏈�澶х殑璁惧id", notes = "鏃�:BattInfAction!getDeviceId")
+    public Response getDeviceId(@RequestParam Integer devId) {
+        return new Response().set(1, service.searchMaxDevId(devId));
+    }
+
+    @PutMapping("monCapWH")
+    @ApiModelProperty(value = "鏍囩О瀹归噺KWH淇敼", notes = "浼犲叆battGroupId鍜宯omCapWH")
+    public Response updateMonCapWH(@RequestBody Battinf inf) {
+        return service.updateMonCapWH(inf);
+    }
+
+    @ApiOperation(value = "鏌ヨ鏍囩О鐢靛帇绫诲埆")
+    @GetMapping("searchMonVol")
+    public Response searchMonVol() {
+        return service.searchMonVol();
+    }
+
+    @GetMapping("searchBattGroupIdByDevId")
+    @ApiOperation(value = "鏍规嵁璁惧id鏌ヨ鐢垫睜缁刬d锛堝彇绗竴涓級")
+    public Response searchBattGroupIdByDevId(@RequestParam int devId) {
+        return service.searchBattGroupIdByDevId(devId);
+    }
 }

--
Gitblit v1.9.1