From 351b9a53cb9ecebdf8f79db0117f540d9c42c2a4 Mon Sep 17 00:00:00 2001 From: whycrzg <ruanzhigang@whycst.com> Date: 星期二, 23 二月 2021 17:19:23 +0800 Subject: [PATCH] update --- src/main/java/com/fgkj/controller/ram/Fbs9600_stateController.java | 76 ++++++++++++++++++++++++-------------- 1 files changed, 48 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/fgkj/controller/ram/Fbs9600_stateController.java b/src/main/java/com/fgkj/controller/ram/Fbs9600_stateController.java index 84b9b40..18f2cfa 100644 --- a/src/main/java/com/fgkj/controller/ram/Fbs9600_stateController.java +++ b/src/main/java/com/fgkj/controller/ram/Fbs9600_stateController.java @@ -1,35 +1,41 @@ package com.fgkj.controller.ram; -import com.fgkj.util.*; -import com.fgkj.dto.BattInf; -import com.fgkj.dto.ServiceModel; -import com.fgkj.dto.User_inf; -import com.fgkj.dto.User_log; +import com.fgkj.dto.*; import com.fgkj.dto.ram.Fbs9600_state; import com.fgkj.mapper.FBS9100_ComBase; import com.fgkj.mapper.UinfDaoFactory; import com.fgkj.services.User_logService; import com.fgkj.services.ram.Fbs9600_stateService; +import com.fgkj.util.ActionUtil; import io.swagger.annotations.Api; -import org.springframework.beans.factory.annotation.Autowired; +import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; import java.util.List; @RequestMapping("fbs9600State") @RestController -@Api +@Api(tags = "fbs9600State鎺ュ彛") public class Fbs9600_stateController{ - @Autowired + @Resource private Fbs9600_stateService service; - @Autowired + @Resource private User_logService uservice; @PostMapping("/") + @ApiOperation(notes = "{\n" + + " \"op_cmd\": 0,\n" + + " \"dev_alarmstate\": 0,\n" + + " \"dev_commcount\": 0,\n" + + " \"dev_errcommcount\": 0,\n" + + " \"dev_id\": 0,\n" + + " \"dev_ip\": \"\",\n" + + " \"dev_workstate\": 0\n" + + "}",value="娣诲姞") public ServiceModel add(@RequestBody Fbs9600_state state) { - // Fbs9600_state state = getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, Fbs9600_state.class); ServiceModel model = service.add(state); return model; @@ -37,16 +43,18 @@ } //bts鏄剧ず灞忓惎鍔ㄦ斁鐢� - @PutMapping("update") - public ServiceModel update(@RequestBody Fbs9600_state state) { - // Fbs9600_state state = getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, Fbs9600_state.class); - //System.out.println(state); + @PutMapping("/") + @ApiOperation(notes = "",value="bts鏄剧ず灞忓惎鍔ㄦ斁鐢�") + public ServiceModel update(@RequestParam Integer num,@RequestParam Integer dev_id) { + Fbs9600_state state = new Fbs9600_state(); + state.setNum(num); + state.setDev_id(dev_id); ServiceModel model = service.update(state); { String msg=""; - if(state.getNum()==FBS9100_ComBase.CMD_Start){ - msg="鍚姩"+state.getDev_id()+"鐨勮澶囨斁鐢�"; + if(num==FBS9100_ComBase.CMD_Start){ + msg="鍚姩"+dev_id+"鐨勮澶囨斁鐢�"; }else if(state.getNum()==FBS9100_ComBase.CMD_Stop){ - msg="鍋滄"+state.getDev_id()+"鐨勮澶囨斁鐢�"; + msg="鍋滄"+dev_id+"鐨勮澶囨斁鐢�"; } User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Alter, msg); uservice.add(ulog);//灏嗙敤鎴风殑鎿嶄綔璁板綍涓嬫潵 @@ -57,37 +65,48 @@ //fbs9600璁惧鍐呴樆娴嬭瘯 @PutMapping("updatePro") + @ApiOperation(notes = "[{ \"dev_id\": \"-\", \"op_cmd\": \"-\" }]",value="fbs9600璁惧鍐呴樆娴嬭瘯") public ServiceModel updatePro(@RequestBody List<Fbs9600_state> list) { - // List<Fbs9600_state> list =getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, new TypeToken<List<Fbs9600_state>>(){}.getType()); ServiceModel model = service.updatePro(list); return model; } @DeleteMapping("/") - public ServiceModel delete(@RequestBody Fbs9600_state state) { - // Fbs9600_state state = getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, Fbs9600_state.class); + @ApiOperation(notes = "",value="鍒犻櫎") + public ServiceModel delete(@RequestParam Integer num) { + Fbs9600_state state = new Fbs9600_state(); + state.setNum(num); ServiceModel model = service.delete(state); return model; } //11.1FBS9600璁惧閫氫俊鐘舵�佹煡璇� - @GetMapping("byCondition") - public ServiceModel serchByCondition(@RequestBody Fbs9600_state state){ - //System.out.println(json); - // Fbs9600_state state = getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, Fbs9600_state.class); + @PostMapping("byCondition") + @ApiOperation(notes = "",value="FBS9600璁惧閫氫俊鐘舵�佹煡璇�") + public ServiceModel serchByCondition(@RequestParam Integer dev_errcommcount,@RequestParam Integer pageNum,@RequestParam Integer pageSize){ + Fbs9600_state state = new Fbs9600_state(); + state.setDev_errcommcount(dev_errcommcount); + PageBean pageBean = new PageBean(); + pageBean.setPageNum(pageNum); + pageBean.setPageSize(pageSize); + state.setPageBean(pageBean); User_inf uinf=(User_inf) ActionUtil.getUser(); - state.setNum(uinf.getUId());//灏嗙敤鎴穒d瀛樻斁鍦‵bs9100_state鐨刵um涓敤浜庡鐞嗙敤鎴风鐞嗙殑鏈烘埧闂 + state.setNum(uinf.getuId());//灏嗙敤鎴穒d瀛樻斁鍦‵bs9100_state鐨刵um涓敤浜庡鐞嗙敤鎴风鐞嗙殑鏈烘埧闂 ServiceModel model = service.serchByCondition(state); return model; } //鏀剧數娴嬭瘯娣诲姞fbs9600璁惧鐨勬坊鍔犵數姹犵粍鐨勬搷浣� - @GetMapping("byInfo") - public ServiceModel serchByInfo(@RequestBody BattInf binf){ - // BattInf binf = getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattInf.class); + @PostMapping("byInfo") + @ApiOperation(notes = "",value="鏀剧數娴嬭瘯娣诲姞fbs9600璁惧鐨勬坊鍔犵數姹犵粍鐨勬搷浣�") + public ServiceModel serchByInfo(@RequestParam String stationName,@RequestParam String stationName1,@RequestParam Integer battGroupId){ + BattInf binf = new BattInf(); + binf.setStationName(stationName); + binf.setStationName1(stationName1); + binf.setBattGroupId(battGroupId); ServiceModel model= service.serchByInfo(binf); return model; @@ -95,6 +114,7 @@ //FBS9600璁惧鍐呴樆娴嬭瘯鏄剧ず鍏ㄩ儴9600璁惧鐨勪俊鎭�(鏀逛负灏�9600鍐呴樆鏁版嵁鏀惧湪9100state琛ㄤ腑) @GetMapping("byUid") + @ApiOperation(notes = "",value="FBS9600璁惧鍐呴樆娴嬭瘯鏄剧ず鍏ㄩ儴9600璁惧鐨勪俊鎭�(鏀逛负灏�9600鍐呴樆鏁版嵁鏀惧湪9100state琛ㄤ腑)") public ServiceModel searchByUid(){ User_inf uinf=(User_inf) ActionUtil.getUser(); ServiceModel model = service.searchByUid(uinf); -- Gitblit v1.9.1