|
@@ -1,17 +1,18 @@
|
|
|
package com.gyee.backconfig.controller;
|
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.gyee.backconfig.config.R;
|
|
|
+import com.gyee.backconfig.model.auto.ProEconTestingPoint;
|
|
|
import com.gyee.backconfig.service.auto.IProEconTestingPointService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.Arrays;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -26,9 +27,78 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
@RequestMapping("//pro-econ-testing-point")
|
|
|
public class ProEconTestingPointController {
|
|
|
|
|
|
+
|
|
|
+
|
|
|
@Autowired
|
|
|
private IProEconTestingPointService proEconTestingPointService;
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 逻辑测点list
|
|
|
+ * @param id
|
|
|
+ * @param nemCode
|
|
|
+ * @param name
|
|
|
+ * @param model
|
|
|
+ * @param uniformCode
|
|
|
+ * @param isDisplay
|
|
|
+ * @param pageNum
|
|
|
+ * @param pageSize
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping(value = "/list")
|
|
|
+ @ApiOperation(value = "逻辑测点配置-列表", notes = "逻辑测点配置-列表")
|
|
|
+ public R findList(@RequestParam(value = "id", required = false) String id,
|
|
|
+ @RequestParam(value = "nemCode", required = false) String nemCode,
|
|
|
+ @RequestParam(value = "name", required = false) String name,
|
|
|
+ @RequestParam(value = "model", required = false) String model,
|
|
|
+ @RequestParam(value = "uniformCode", required = false) String uniformCode,
|
|
|
+ @RequestParam(value = "isDisplay", required = false) String isDisplay,
|
|
|
+ @RequestParam(value = "pageNum", required = true) String pageNum,
|
|
|
+ @RequestParam(value = "pageSize", required = true) String pageSize) {
|
|
|
+ IPage<ProEconTestingPoint> list = proEconTestingPointService.list( id, nemCode, name, model, uniformCode, isDisplay, pageNum, pageSize);
|
|
|
+ if (null != list) {
|
|
|
+ return R.ok().data(list);
|
|
|
+ } else {
|
|
|
+ return R.error().data("查询失败!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 添加
|
|
|
+ * @param proEconTestingPoint
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping(value = "/add")
|
|
|
+ @ApiOperation(value = "逻辑测点配置-新增or修改", notes = "逻辑测点配置-新增or修改")
|
|
|
+ public R addAll(@RequestBody ProEconTestingPoint proEconTestingPoint) {
|
|
|
+
|
|
|
+ boolean b = proEconTestingPointService.saveOrUpdate(proEconTestingPoint);
|
|
|
+ if (b) {
|
|
|
+ return R.ok().data(b);
|
|
|
+ } else {
|
|
|
+ return R.error().data("保存失败!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除
|
|
|
+ * @param ids
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @DeleteMapping(value = "/{ids}")
|
|
|
+ @ApiOperation(value = "逻辑测点配置-删除", notes = "逻辑测点配置-删除")
|
|
|
+ public R deleteAll(@PathVariable("ids") String ids) {
|
|
|
+ String[] strings = ids.split(",");
|
|
|
+ boolean b = proEconTestingPointService.removeByIds(Arrays.asList(strings));
|
|
|
+ if (b) {
|
|
|
+ return R.ok().data(b);
|
|
|
+ } else {
|
|
|
+ return R.error().data("删除失败!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@PostMapping(value = "/generatePoint")
|
|
|
@ApiOperation(value = "设备or场站测点生成", notes = "设备or场站测点生成")
|
|
|
@ApiImplicitParams({ @ApiImplicitParam(name = "points", value = "统一编码", required = true, dataType = "string[]", paramType = "query"),
|