|
@@ -0,0 +1,504 @@
|
|
|
+package com.bosshand.virgo.api.test.controller;
|
|
|
+
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.bosshand.virgo.api.test.controller.dto.*;
|
|
|
+import com.bosshand.virgo.api.test.controller.view.*;
|
|
|
+import com.bosshand.virgo.api.test.model.*;
|
|
|
+import com.bosshand.virgo.api.test.service.SetService;
|
|
|
+import com.bosshand.virgo.core.response.Response;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+@RestController
|
|
|
+@RequestMapping("set")
|
|
|
+@Api(tags = {"物联网配置"})
|
|
|
+public class SetCont {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ SetService setService;
|
|
|
+
|
|
|
+ @ApiOperation("协议保存")
|
|
|
+ @RequestMapping(value = "/protocol/save", method = RequestMethod.POST)
|
|
|
+ public Response save(@RequestBody Protocol data) {
|
|
|
+ return Response.ok(setService.save(data));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("协议修改")
|
|
|
+ @RequestMapping(value = "/protocol/update", method = RequestMethod.PUT)
|
|
|
+ public Response update(@RequestBody Protocol data) {
|
|
|
+ return Response.ok(setService.update(data));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("协议列表")
|
|
|
+ @RequestMapping(value = "/protocol/get", method = RequestMethod.POST)
|
|
|
+ public Response get(@RequestBody ProtocolDto data) {
|
|
|
+ Protocol protocol = new Protocol();
|
|
|
+ BeanUtils.copyProperties(data, protocol);
|
|
|
+ List<Protocol> list = setService.get(protocol, data.getCurrPage(), data.getPageSize());
|
|
|
+ int totalCount = setService.count(protocol);
|
|
|
+ List<ProtocolView> viewList = new ArrayList<>();
|
|
|
+ for (Protocol p : list) {
|
|
|
+ ProtocolView view = new ProtocolView();
|
|
|
+ BeanUtils.copyProperties(p, view);
|
|
|
+ viewList.add(view);
|
|
|
+ }
|
|
|
+ Map<String, Object> result = new HashMap<String, Object>();
|
|
|
+ result.put("dataList", viewList);
|
|
|
+ result.put("totalCount", totalCount);
|
|
|
+ return Response.ok(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("设备参数保存")
|
|
|
+ @RequestMapping(value = "/deviceParameter/save", method = RequestMethod.POST)
|
|
|
+ public Response save(@RequestBody DeviceParameter data) {
|
|
|
+ return Response.ok(setService.save(data));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("设备参数修改")
|
|
|
+ @RequestMapping(value = "/deviceParameter/update", method = RequestMethod.PUT)
|
|
|
+ public Response update(@RequestBody DeviceParameter data) {
|
|
|
+ return Response.ok(setService.update(data));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("设备参数列表")
|
|
|
+ @RequestMapping(value = "/deviceParameter/get", method = RequestMethod.POST)
|
|
|
+ public Response get(@RequestBody DeviceParameterDto data) {
|
|
|
+ DeviceParameter deviceParameter = new DeviceParameter();
|
|
|
+ BeanUtils.copyProperties(data, deviceParameter);
|
|
|
+ List<DeviceParameter> list = setService.get(deviceParameter, data.getCurrPage(), data.getPageSize());
|
|
|
+ int totalCount = setService.count(deviceParameter);
|
|
|
+ List<DeviceParameterView> viewList = new ArrayList<>();
|
|
|
+ for (DeviceParameter p : list) {
|
|
|
+ DeviceParameterView view = new DeviceParameterView();
|
|
|
+ BeanUtils.copyProperties(p, view);
|
|
|
+ viewList.add(view);
|
|
|
+ }
|
|
|
+ Map<String, Object> result = new HashMap<String, Object>();
|
|
|
+ result.put("dataList", viewList);
|
|
|
+ result.put("totalCount", totalCount);
|
|
|
+ return Response.ok(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("系统类型保存")
|
|
|
+ @RequestMapping(value = "/systemType/save", method = RequestMethod.POST)
|
|
|
+ public Response save(@RequestBody SystemType data) {
|
|
|
+ return Response.ok(setService.save(data));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("系统类型修改")
|
|
|
+ @RequestMapping(value = "/systemType/update", method = RequestMethod.PUT)
|
|
|
+ public Response update(@RequestBody SystemType data) {
|
|
|
+ return Response.ok(setService.update(data));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("系统类型列表")
|
|
|
+ @RequestMapping(value = "/systemType/get", method = RequestMethod.POST)
|
|
|
+ public Response get(@RequestBody SystemTypeDto data) {
|
|
|
+ SystemType systemType = new SystemType();
|
|
|
+ BeanUtils.copyProperties(data, systemType);
|
|
|
+ List<SystemType> list = setService.get(systemType, data.getCurrPage(), data.getPageSize());
|
|
|
+ int totalCount = setService.count(systemType);
|
|
|
+ List<SystemTypeView> viewList = new ArrayList<>();
|
|
|
+ for (SystemType p : list) {
|
|
|
+ SystemTypeView view = new SystemTypeView();
|
|
|
+ BeanUtils.copyProperties(p, view);
|
|
|
+ viewList.add(view);
|
|
|
+ }
|
|
|
+ Map<String, Object> result = new HashMap<String, Object>();
|
|
|
+ result.put("dataList", viewList);
|
|
|
+ result.put("totalCount", totalCount);
|
|
|
+ return Response.ok(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("末端组合式空调机组控制策略 type1 末端吊顶式空调机组控制策略 type2 保存")
|
|
|
+ @RequestMapping(value = "/AirConditioningUnitsStrategy/save", method = RequestMethod.POST)
|
|
|
+ public Response save(@RequestBody AirConditioningUnitsStrategy data){
|
|
|
+ setService.save(data);
|
|
|
+ return Response.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("末端组合式空调机组控制策略 type1 末端吊顶式空调机组控制策略 type2 修改")
|
|
|
+ @RequestMapping(value = "/AirConditioningUnitsStrategy/update", method = RequestMethod.PUT)
|
|
|
+ public Response update(@RequestBody AirConditioningUnitsStrategy data){
|
|
|
+ setService.update(data);
|
|
|
+ return Response.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("末端组合式空调机组控制策略 type1 末端吊顶式空调机组控制策略 type2 列表")
|
|
|
+ @RequestMapping(value = "/AirConditioningUnitsStrategy/get", method = RequestMethod.POST)
|
|
|
+ public Response get(@RequestBody AirConditioningUnitsStrategyDto data) {
|
|
|
+ AirConditioningUnitsStrategy airConditioningUnitsStrategy = new AirConditioningUnitsStrategy();
|
|
|
+ BeanUtils.copyProperties(data, airConditioningUnitsStrategy);
|
|
|
+ List<AirConditioningUnitsStrategy> list = setService.get(airConditioningUnitsStrategy, data.getCurrPage(), data.getPageSize());
|
|
|
+ int totalCount = setService.count(airConditioningUnitsStrategy);
|
|
|
+ List<AirConditioningUnitsStrategyView> viewList = new ArrayList<>();
|
|
|
+ for (AirConditioningUnitsStrategy p : list) {
|
|
|
+ AirConditioningUnitsStrategyView view = new AirConditioningUnitsStrategyView();
|
|
|
+ BeanUtils.copyProperties(p, view);
|
|
|
+ viewList.add(view);
|
|
|
+ }
|
|
|
+ Map<String, Object> result = new HashMap<String, Object>();
|
|
|
+ result.put("dataList", viewList);
|
|
|
+ result.put("totalCount", totalCount);
|
|
|
+ return Response.ok(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("冷水机房优化控制策略保存")
|
|
|
+ @RequestMapping(value = "/ChillerRoomStrategy/save", method = RequestMethod.POST)
|
|
|
+ public Response save(@RequestBody ChillerRoomStrategy data){
|
|
|
+ setService.save(data);
|
|
|
+ return Response.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("冷水机房优化控制策略修改")
|
|
|
+ @RequestMapping(value = "/ChillerRoomStrategy/update", method = RequestMethod.PUT)
|
|
|
+ public Response update(@RequestBody ChillerRoomStrategy data){
|
|
|
+ setService.update(data);
|
|
|
+ return Response.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("冷水机房优化控制策略列表")
|
|
|
+ @RequestMapping(value = "/ChillerRoomStrategy/get", method = RequestMethod.POST)
|
|
|
+ public Response get(@RequestBody ChillerRoomStrategyDto data) {
|
|
|
+ ChillerRoomStrategy chillerRoomStrategy = new ChillerRoomStrategy();
|
|
|
+ BeanUtils.copyProperties(data, chillerRoomStrategy);
|
|
|
+ List<ChillerRoomStrategy> list = setService.get(chillerRoomStrategy, data.getCurrPage(), data.getPageSize());
|
|
|
+ int totalCount = setService.count(chillerRoomStrategy);
|
|
|
+ List<ChillerRoomStrategyView> viewList = new ArrayList<>();
|
|
|
+ for (ChillerRoomStrategy p : list) {
|
|
|
+ ChillerRoomStrategyView view = new ChillerRoomStrategyView();
|
|
|
+ BeanUtils.copyProperties(p, view);
|
|
|
+ viewList.add(view);
|
|
|
+ }
|
|
|
+ Map<String, Object> result = new HashMap<String, Object>();
|
|
|
+ result.put("dataList", viewList);
|
|
|
+ result.put("totalCount", totalCount);
|
|
|
+ return Response.ok(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("冷站总启停策略保存")
|
|
|
+ @RequestMapping(value = "/ColdStartStopStrategy/save", method = RequestMethod.POST)
|
|
|
+ public Response save(@RequestBody ColdStartStopStrategy data){
|
|
|
+ setService.save(data);
|
|
|
+ return Response.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("冷站总启停策略修改")
|
|
|
+ @RequestMapping(value = "/ColdStartStopStrategy/update", method = RequestMethod.PUT)
|
|
|
+ public Response update(@RequestBody ColdStartStopStrategy data){
|
|
|
+ setService.update(data);
|
|
|
+ return Response.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("冷站总启停策略列表")
|
|
|
+ @RequestMapping(value = "/ColdStartStopStrategy/get", method = RequestMethod.POST)
|
|
|
+ public Response get(@RequestBody ColdStartStopStrategyDto data) {
|
|
|
+ ColdStartStopStrategy coldStartStopStrategy = new ColdStartStopStrategy();
|
|
|
+ BeanUtils.copyProperties(data, coldStartStopStrategy);
|
|
|
+ List<ColdStartStopStrategy> list = setService.get(coldStartStopStrategy, data.getCurrPage(), data.getPageSize());
|
|
|
+ int totalCount = setService.count(coldStartStopStrategy);
|
|
|
+ List<ColdStartStopStrategyView> viewList = new ArrayList<>();
|
|
|
+ for (ColdStartStopStrategy p : list) {
|
|
|
+ ColdStartStopStrategyView view = new ColdStartStopStrategyView();
|
|
|
+ BeanUtils.copyProperties(p, view);
|
|
|
+ viewList.add(view);
|
|
|
+ }
|
|
|
+ Map<String, Object> result = new HashMap<String, Object>();
|
|
|
+ result.put("dataList", viewList);
|
|
|
+ result.put("totalCount", totalCount);
|
|
|
+ return Response.ok(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("硬件参数设置保存")
|
|
|
+ @RequestMapping(value = "/HardwareParameter/save", method = RequestMethod.POST)
|
|
|
+ public Response save(@RequestBody HardwareParameter data){
|
|
|
+ setService.save(data);
|
|
|
+ return Response.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("硬件参数设置修改")
|
|
|
+ @RequestMapping(value = "/HardwareParameter/update", method = RequestMethod.PUT)
|
|
|
+ public Response update(@RequestBody HardwareParameter data){
|
|
|
+ setService.update(data);
|
|
|
+ return Response.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("硬件参数设置列表")
|
|
|
+ @RequestMapping(value = "/HardwareParameter/get", method = RequestMethod.POST)
|
|
|
+ public Response get(@RequestBody HardwareParameterDto data) {
|
|
|
+ HardwareParameter hardwareParameter = new HardwareParameter();
|
|
|
+ BeanUtils.copyProperties(data, hardwareParameter);
|
|
|
+ List<HardwareParameter> list = setService.get(hardwareParameter, data.getCurrPage(), data.getPageSize());
|
|
|
+ int totalCount = setService.count(hardwareParameter);
|
|
|
+ List<HardwareParameterView> viewList = new ArrayList<>();
|
|
|
+ for (HardwareParameter p : list) {
|
|
|
+ HardwareParameterView view = new HardwareParameterView();
|
|
|
+ BeanUtils.copyProperties(p, view);
|
|
|
+ viewList.add(view);
|
|
|
+ }
|
|
|
+ Map<String, Object> result = new HashMap<String, Object>();
|
|
|
+ result.put("dataList", viewList);
|
|
|
+ result.put("totalCount", totalCount);
|
|
|
+ return Response.ok(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("总启停设置保存")
|
|
|
+ @RequestMapping(value = "/TotalStartStop/save", method = RequestMethod.POST)
|
|
|
+ public Response save(@RequestBody TotalStartStop data){
|
|
|
+ setService.save(data);
|
|
|
+ return Response.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("总启停设置修改")
|
|
|
+ @RequestMapping(value = "/TotalStartStop/update", method = RequestMethod.PUT)
|
|
|
+ public Response update(@RequestBody TotalStartStop data){
|
|
|
+ setService.update(data);
|
|
|
+ return Response.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("总启停设置列表")
|
|
|
+ @RequestMapping(value = "/TotalStartStop/get", method = RequestMethod.POST)
|
|
|
+ public Response get(@RequestBody TotalStartStopDto data) {
|
|
|
+ TotalStartStop totalStartStop = new TotalStartStop();
|
|
|
+ BeanUtils.copyProperties(data, totalStartStop);
|
|
|
+ List<TotalStartStop> list = setService.get(totalStartStop, data.getCurrPage(), data.getPageSize());
|
|
|
+ int totalCount = setService.count(totalStartStop);
|
|
|
+ List<TotalStartStopView> viewList = new ArrayList<>();
|
|
|
+ for (TotalStartStop p : list) {
|
|
|
+ TotalStartStopView view = new TotalStartStopView();
|
|
|
+ BeanUtils.copyProperties(p, view);
|
|
|
+ viewList.add(view);
|
|
|
+ }
|
|
|
+ Map<String, Object> result = new HashMap<String, Object>();
|
|
|
+ result.put("dataList", viewList);
|
|
|
+ result.put("totalCount", totalCount);
|
|
|
+ return Response.ok(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("定时任务保存")
|
|
|
+ @RequestMapping(value = "/TimedTasks/save", method = RequestMethod.POST)
|
|
|
+ public Response save(@RequestBody TimedTasks data){
|
|
|
+ setService.save(data);
|
|
|
+ return Response.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("定时任务修改")
|
|
|
+ @RequestMapping(value = "/TimedTasks/update", method = RequestMethod.PUT)
|
|
|
+ public Response update(@RequestBody TimedTasks data){
|
|
|
+ setService.update(data);
|
|
|
+ return Response.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("定时任务列表")
|
|
|
+ @RequestMapping(value = "/TimedTasks/get", method = RequestMethod.POST)
|
|
|
+ public Response get(@RequestBody TimedTasksDto data) {
|
|
|
+ TimedTasks timedTasks = new TimedTasks();
|
|
|
+ BeanUtils.copyProperties(data, timedTasks);
|
|
|
+ List<TimedTasks> list = setService.get(timedTasks, data.getCurrPage(), data.getPageSize());
|
|
|
+ int totalCount = setService.count(timedTasks);
|
|
|
+ List<TimedTasksView> viewList = new ArrayList<>();
|
|
|
+ for (TimedTasks p : list) {
|
|
|
+ TimedTasksView view = new TimedTasksView();
|
|
|
+ BeanUtils.copyProperties(p, view);
|
|
|
+ viewList.add(view);
|
|
|
+ }
|
|
|
+ Map<String, Object> result = new HashMap<String, Object>();
|
|
|
+ result.put("dataList", viewList);
|
|
|
+ result.put("totalCount", totalCount);
|
|
|
+ return Response.ok(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("采集分析保存")
|
|
|
+ @RequestMapping(value = "/CollectionAnalysis/save", method = RequestMethod.POST)
|
|
|
+ public Response save(@RequestBody CollectionAnalysis data){
|
|
|
+ setService.save(data);
|
|
|
+ return Response.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("采集分析修改")
|
|
|
+ @RequestMapping(value = "/CollectionAnalysis/update", method = RequestMethod.PUT)
|
|
|
+ public Response update(@RequestBody CollectionAnalysis data){
|
|
|
+ setService.update(data);
|
|
|
+ return Response.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("采集分析列表")
|
|
|
+ @RequestMapping(value = "/CollectionAnalysis/get", method = RequestMethod.POST)
|
|
|
+ public Response get(@RequestBody CollectionAnalysisDto data) {
|
|
|
+ CollectionAnalysis collectionAnalysis = new CollectionAnalysis();
|
|
|
+ BeanUtils.copyProperties(data, collectionAnalysis);
|
|
|
+ List<CollectionAnalysis> list = setService.get(collectionAnalysis, data.getCurrPage(), data.getPageSize());
|
|
|
+ int totalCount = setService.count(collectionAnalysis);
|
|
|
+ List<CollectionAnalysisView> viewList = new ArrayList<>();
|
|
|
+ for (CollectionAnalysis p : list) {
|
|
|
+ CollectionAnalysisView view = new CollectionAnalysisView();
|
|
|
+ BeanUtils.copyProperties(p, view);
|
|
|
+ viewList.add(view);
|
|
|
+ }
|
|
|
+ Map<String, Object> result = new HashMap<String, Object>();
|
|
|
+ result.put("dataList", viewList);
|
|
|
+ result.put("totalCount", totalCount);
|
|
|
+ return Response.ok(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("命令管理保存")
|
|
|
+ @RequestMapping(value = "/CommandManagement/save", method = RequestMethod.POST)
|
|
|
+ public Response save(@RequestBody CommandManagement data){
|
|
|
+ setService.save(data);
|
|
|
+ return Response.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("命令管理修改")
|
|
|
+ @RequestMapping(value = "/CommandManagement/update", method = RequestMethod.PUT)
|
|
|
+ public Response update(@RequestBody CommandManagement data){
|
|
|
+ setService.update(data);
|
|
|
+ return Response.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("命令管理列表")
|
|
|
+ @RequestMapping(value = "/CommandManagement/get", method = RequestMethod.POST)
|
|
|
+ public Response get(@RequestBody CommandManagementDto data) {
|
|
|
+ CommandManagement commandManagement = new CommandManagement();
|
|
|
+ BeanUtils.copyProperties(data, commandManagement);
|
|
|
+ List<CommandManagement> list = setService.get(commandManagement, data.getCurrPage(), data.getPageSize());
|
|
|
+ int totalCount = setService.count(commandManagement);
|
|
|
+ List<CommandManagementView> viewList = new ArrayList<>();
|
|
|
+ for (CommandManagement p : list) {
|
|
|
+ CommandManagementView view = new CommandManagementView();
|
|
|
+ BeanUtils.copyProperties(p, view);
|
|
|
+ viewList.add(view);
|
|
|
+ }
|
|
|
+ Map<String, Object> result = new HashMap<String, Object>();
|
|
|
+ result.put("dataList", viewList);
|
|
|
+ result.put("totalCount", totalCount);
|
|
|
+ return Response.ok(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("告警设置保存")
|
|
|
+ @RequestMapping(value = "/AlarmSettings/save", method = RequestMethod.POST)
|
|
|
+ public Response save(@RequestBody AlarmSettingsDto data){
|
|
|
+ AlarmSettings alarmSettings = new AlarmSettings();
|
|
|
+ BeanUtils.copyProperties(data, alarmSettings);
|
|
|
+ alarmSettings.setParameter(JSONObject.toJSONString(data.getParameters()));
|
|
|
+ alarmSettings.setSmsRecipient(JSONObject.toJSONString(data.getSmsRecipient()));
|
|
|
+ setService.save(alarmSettings);
|
|
|
+ return Response.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("告警设置修改")
|
|
|
+ @RequestMapping(value = "/AlarmSettings/update", method = RequestMethod.PUT)
|
|
|
+ public Response update(@RequestBody AlarmSettingsDto data){
|
|
|
+ AlarmSettings alarmSettings = new AlarmSettings();
|
|
|
+ BeanUtils.copyProperties(data, alarmSettings);
|
|
|
+ if (data.getParameters() != null) {
|
|
|
+ alarmSettings.setParameter(JSONObject.toJSONString(data.getParameters()));
|
|
|
+ }
|
|
|
+ if (data.getSmsRecipient() != null) {
|
|
|
+ alarmSettings.setSmsRecipient(JSONObject.toJSONString(data.getSmsRecipient()));
|
|
|
+ }
|
|
|
+ setService.update(alarmSettings);
|
|
|
+ return Response.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("告警设置获取")
|
|
|
+ @RequestMapping(value = "/AlarmSettings/get", method = RequestMethod.POST)
|
|
|
+ public Response get(@RequestBody AlarmSettingsDto data) {
|
|
|
+ AlarmSettings alarmSettings = new AlarmSettings();
|
|
|
+ BeanUtils.copyProperties(data, alarmSettings);
|
|
|
+ List<AlarmSettings> list = setService.get(alarmSettings, data.getCurrPage(), data.getPageSize());
|
|
|
+ int totalCount = setService.count(alarmSettings);
|
|
|
+ List<AlarmSettingsView> viewList = new ArrayList<>();
|
|
|
+ for (AlarmSettings p : list) {
|
|
|
+ AlarmSettingsView view = new AlarmSettingsView();
|
|
|
+ BeanUtils.copyProperties(p, view);
|
|
|
+ List<AlarmParameterDto> parameters = JSONObject.parseArray(p.getParameter(), AlarmParameterDto.class);
|
|
|
+ List<SmsRecipientDto> smsRecipients = JSONObject.parseArray(p.getSmsRecipient(), SmsRecipientDto.class);
|
|
|
+ view.setParameters(parameters);
|
|
|
+ view.setSmsRecipient(smsRecipients);
|
|
|
+ viewList.add(view);
|
|
|
+ }
|
|
|
+ Map<String, Object> result = new HashMap<String, Object>();
|
|
|
+ result.put("dataList", viewList);
|
|
|
+ result.put("totalCount", totalCount);
|
|
|
+ return Response.ok(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("抄表设置保存")
|
|
|
+ @RequestMapping(value = "/MeterReadingSettings/save", method = RequestMethod.POST)
|
|
|
+ public Response save(@RequestBody MeterReadingSettings data){
|
|
|
+ setService.save(data);
|
|
|
+ return Response.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("抄表设置修改")
|
|
|
+ @RequestMapping(value = "/MeterReadingSettings/update", method = RequestMethod.PUT)
|
|
|
+ public Response update(@RequestBody MeterReadingSettings data){
|
|
|
+ setService.update(data);
|
|
|
+ return Response.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("抄表设置列表")
|
|
|
+ @RequestMapping(value = "/MeterReadingSettings/get", method = RequestMethod.POST)
|
|
|
+ public Response get(@RequestBody MeterReadingSettingsDto data) {
|
|
|
+ MeterReadingSettings meterReadingSettings = new MeterReadingSettings();
|
|
|
+ BeanUtils.copyProperties(data, meterReadingSettings);
|
|
|
+ List<MeterReadingSettings> list = setService.get(meterReadingSettings, data.getCurrPage(), data.getPageSize());
|
|
|
+ int totalCount = setService.count(meterReadingSettings);
|
|
|
+ List<MeterReadingSettingsView> viewList = new ArrayList<>();
|
|
|
+ for (MeterReadingSettings p : list) {
|
|
|
+ MeterReadingSettingsView view = new MeterReadingSettingsView();
|
|
|
+ BeanUtils.copyProperties(p, view);
|
|
|
+ viewList.add(view);
|
|
|
+ }
|
|
|
+ Map<String, Object> result = new HashMap<String, Object>();
|
|
|
+ result.put("dataList", viewList);
|
|
|
+ result.put("totalCount", totalCount);
|
|
|
+ return Response.ok(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("定额设置保存")
|
|
|
+ @RequestMapping(value = "/QuotaSettings/save", method = RequestMethod.POST)
|
|
|
+ public Response save(@RequestBody QuotaSettings data){
|
|
|
+ setService.save(data);
|
|
|
+ return Response.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("定额设置修改")
|
|
|
+ @RequestMapping(value = "/QuotaSettings/update", method = RequestMethod.PUT)
|
|
|
+ public Response update(@RequestBody QuotaSettings data){
|
|
|
+ setService.update(data);
|
|
|
+ return Response.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("定额设置列表")
|
|
|
+ @RequestMapping(value = "/QuotaSettings/get", method = RequestMethod.POST)
|
|
|
+ public Response get(@RequestBody QuotaSettingsDto data) {
|
|
|
+ QuotaSettings quotaSettings = new QuotaSettings();
|
|
|
+ BeanUtils.copyProperties(data, quotaSettings);
|
|
|
+ List<QuotaSettings> list = setService.get(quotaSettings, data.getCurrPage(), data.getPageSize());
|
|
|
+ int totalCount = setService.count(quotaSettings);
|
|
|
+ List<QuotaSettingsView> viewList = new ArrayList<>();
|
|
|
+ for (QuotaSettings p : list) {
|
|
|
+ QuotaSettingsView view = new QuotaSettingsView();
|
|
|
+ BeanUtils.copyProperties(p, view);
|
|
|
+ viewList.add(view);
|
|
|
+ }
|
|
|
+ Map<String, Object> result = new HashMap<String, Object>();
|
|
|
+ result.put("dataList", viewList);
|
|
|
+ result.put("totalCount", totalCount);
|
|
|
+ return Response.ok(result);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|