|
@@ -1,14 +1,15 @@
|
|
package com.gyee.backconfig.controller;
|
|
package com.gyee.backconfig.controller;
|
|
|
|
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.gyee.backconfig.config.R;
|
|
import com.gyee.backconfig.config.R;
|
|
-import com.gyee.backconfig.model.auto.ProBasicLogicalUnit;
|
|
|
|
-import com.gyee.backconfig.model.auto.ProEconEquipmentmodel;
|
|
|
|
import com.gyee.backconfig.model.auto.ProEconLogicalUnit;
|
|
import com.gyee.backconfig.model.auto.ProEconLogicalUnit;
|
|
import com.gyee.backconfig.service.auto.IProEconLogicalUnitService;
|
|
import com.gyee.backconfig.service.auto.IProEconLogicalUnitService;
|
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
+import java.util.Arrays;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -32,11 +33,17 @@ public class ProEconLogicalUnitController {
|
|
* @param
|
|
* @param
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- @GetMapping(value = "/typeid")
|
|
|
|
|
|
+ @GetMapping(value = "/list")
|
|
|
|
+ @ApiOperation(value = "逻辑部件-列表", notes = "逻辑部件-列表")
|
|
public R findList(
|
|
public R findList(
|
|
@RequestParam(value = "id", required = false) String id,
|
|
@RequestParam(value = "id", required = false) String id,
|
|
- @RequestParam(value = "equipmentId", required = false) String equipmentId) {
|
|
|
|
- List<ProEconLogicalUnit> code = proEconLogicalUnitService.list(id,equipmentId);
|
|
|
|
|
|
+ @RequestParam(value = "name", required = false) String name,
|
|
|
|
+ @RequestParam(value = "nemCode", required = false) String nemCode,
|
|
|
|
+ @RequestParam(value = "aname", required = false) String aname,
|
|
|
|
+ @RequestParam(value = "equipmentId", required = false) String equipmentId,
|
|
|
|
+ @RequestParam(value = "pageNum", required = true) String pageNum,
|
|
|
|
+ @RequestParam(value = "pageSize", required = true) String pageSize){
|
|
|
|
+ IPage<ProEconLogicalUnit> code = proEconLogicalUnitService.list(id,name,aname,nemCode,equipmentId,pageNum,pageSize);
|
|
if (null != code) {
|
|
if (null != code) {
|
|
return R.ok().data(code);
|
|
return R.ok().data(code);
|
|
} else {
|
|
} else {
|
|
@@ -44,4 +51,37 @@ public class ProEconLogicalUnitController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ *
|
|
|
|
+ * @param proEconLogicalUnit
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @PostMapping(value = "/add")
|
|
|
|
+ @ApiOperation(value = "逻辑部件-新增or修改", notes = "逻辑部件-新增or修改")
|
|
|
|
+ public R addAll(@RequestBody ProEconLogicalUnit proEconLogicalUnit) {
|
|
|
|
+
|
|
|
|
+ boolean b = proEconLogicalUnitService.saveOrUpdate(proEconLogicalUnit);
|
|
|
|
+ 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 = proEconLogicalUnitService.removeByIds(Arrays.asList(strings));
|
|
|
|
+ if (b) {
|
|
|
|
+ return R.ok().data(b);
|
|
|
|
+ } else {
|
|
|
|
+ return R.error().data("删除失败!");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|