You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
98 lines
3.8 KiB
Java
98 lines
3.8 KiB
Java
1 year ago
|
package com.chenxuan.controller;
|
||
|
|
||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||
|
import com.chenxuan.base.controller.BaseController;
|
||
|
import com.chenxuan.base.entity.AjaxResult;
|
||
|
import com.chenxuan.base.entity.Query;
|
||
|
import com.chenxuan.bean.annotation.LogAnnotation;
|
||
|
import com.chenxuan.constants.BusiUrlConstants;
|
||
|
import com.chenxuan.entity.model.BusiTransformerConf;
|
||
|
import com.chenxuan.enums.OperateType;
|
||
|
import com.chenxuan.service.BusiTransformerConfService;
|
||
|
import io.swagger.annotations.Api;
|
||
|
import io.swagger.annotations.ApiOperation;
|
||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||
|
import org.springframework.web.bind.annotation.RestController;
|
||
|
|
||
|
import java.util.List;
|
||
|
|
||
|
@Api(tags = "原副边电流电压配置")
|
||
|
@RestController
|
||
|
@RequestMapping(value = BusiUrlConstants.BUSI_TRANSFORMER_CONF)
|
||
|
public class BusiTransformerConfController extends BaseController {
|
||
|
|
||
|
@Autowired
|
||
|
private BusiTransformerConfService busiTransformerConfService;
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @Description: 获取原副边电流电压配置列表
|
||
|
* @Param:
|
||
|
* @Return: TableDataInfo
|
||
|
**/
|
||
|
@ApiOperation(value = "获取原副边电流电压配置列表")
|
||
|
@GetMapping(value = "/page")
|
||
|
public AjaxResult page(Query queryParam) {
|
||
|
Page<BusiTransformerConf> page = busiTransformerConfService.page(queryParam);
|
||
|
return AjaxResult.success(page);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 新增电流电压配置
|
||
|
*/
|
||
|
@ApiOperation(value = "新增电流电压配置")
|
||
|
@LogAnnotation(module = "电流电压设置", operateType = OperateType.INSERT)
|
||
|
@PostMapping(value = "/add")
|
||
|
public AjaxResult add(@RequestBody List<BusiTransformerConf> busiTransformerConfList) {
|
||
|
return returnAjax(busiTransformerConfService.insertConfigs(busiTransformerConfList));
|
||
|
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 修改电流电压配置
|
||
|
*/
|
||
|
@ApiOperation(value = "修改电流电压配置")
|
||
|
// @LogAnnotation(module = "电流电压设置", operateType = OperateType.UPDATE)
|
||
|
@PostMapping(value = "/update")
|
||
|
public AjaxResult update(@RequestBody List<BusiTransformerConf> busiTransformerConfList) {
|
||
|
return returnAjax(busiTransformerConfService.updateConfigs(busiTransformerConfList));
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 加载对应主变的原边副边电流电压信息
|
||
|
*/
|
||
|
@ApiOperation(value = "加载对应主变的原边副边电流电压信息")
|
||
|
@GetMapping(value = "/getTransformerConfigByMainId/{mainId}")
|
||
|
public AjaxResult getTransformerConfigByMainId(@PathVariable("mainId") String mainId) {
|
||
|
return AjaxResult.success(busiTransformerConfService.selectConfigsByMainId(mainId));
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 删除配置
|
||
|
*/
|
||
|
@ApiOperation(value = "根据配置id删除电流电压配置")
|
||
|
@LogAnnotation(module = "电流电压设置", operateType = OperateType.DELETE)
|
||
|
@DeleteMapping(value = "/delete")
|
||
|
public AjaxResult remove(@RequestParam("id") String id) {
|
||
|
return returnAjax(busiTransformerConfService.deleteConfById(id));
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 根据主变id删除该主变下对应的电流电压配置信息
|
||
|
*/
|
||
|
@ApiOperation(value = "根据主变id删除该主变下对应的电流电压配置信息")
|
||
|
@LogAnnotation(module = "电流电压设置", operateType = OperateType.DELETE)
|
||
|
@DeleteMapping(value = "/deleteByMainId")
|
||
|
public AjaxResult deleteByMainId(@RequestParam("mainId") String mainId) {
|
||
|
return returnAjax(busiTransformerConfService.deleteConfsByMainId(mainId));
|
||
|
}
|
||
|
|
||
|
}
|