|
|
@@ -0,0 +1,123 @@
|
|
|
+package org.springblade.client.port.controller;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import io.undertow.attribute.SubstituteEmptyWrapper;
|
|
|
+import lombok.AllArgsConstructor;
|
|
|
+import oracle.jdbc.proxy.annotation.Post;
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
|
+import org.springblade.client.container.service.BasicContainerDescService;
|
|
|
+import org.springblade.client.container.service.BasicContainerTypeService;
|
|
|
+import org.springblade.client.dto.BasicPortDescDTO;
|
|
|
+import org.springblade.client.entity.BasicPortDesc;
|
|
|
+import org.springblade.client.entity.BasicPortType;
|
|
|
+import org.springblade.client.port.service.BasicPortDescService;
|
|
|
+import org.springblade.client.port.service.BasicPortTypeDescService;
|
|
|
+import org.springblade.client.port.service.BasicPortTypeService;
|
|
|
+import org.springblade.core.tenant.annotation.NonDS;
|
|
|
+import org.springblade.core.tool.api.R;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+import springfox.documentation.annotations.ApiIgnore;
|
|
|
+
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+@NonDS
|
|
|
+@ApiIgnore
|
|
|
+@RestController
|
|
|
+@RequestMapping("/port")
|
|
|
+@AllArgsConstructor
|
|
|
+public class PortController
|
|
|
+{
|
|
|
+ @Autowired
|
|
|
+ private BasicPortDescService basicPortDescService;
|
|
|
+ @Autowired
|
|
|
+ private BasicPortTypeService basicPortTypeService;
|
|
|
+ @Autowired
|
|
|
+ private BasicPortTypeDescService midBasicPortTypeDescService;
|
|
|
+ @Autowired
|
|
|
+ private BasicContainerDescService basicContainerDescService;
|
|
|
+ @Autowired
|
|
|
+ private BasicContainerTypeService basicContainerTypeService;
|
|
|
+
|
|
|
+ @GetMapping("list")
|
|
|
+ public R list(@RequestParam(name = "current", defaultValue = "1") Integer current,
|
|
|
+ @RequestParam(name = "size", defaultValue = "10") Integer size,
|
|
|
+ @RequestParam(name = "name", required = false) String name,
|
|
|
+ @RequestParam(name = "lines", required = false) String lines,
|
|
|
+ @RequestParam(name = "unCode", required = false) String unCode,
|
|
|
+ @RequestParam(name = "status", required = false) String status)
|
|
|
+ {
|
|
|
+ Page<BasicPortDescDTO> page=new Page<>(current,size);
|
|
|
+ IPage<BasicPortDescDTO> iPage = basicPortDescService.listBasicPortDesc(page, name, lines, unCode, status);
|
|
|
+ return R.data(iPage);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("add")
|
|
|
+ public R add (@RequestBody BasicPortDescDTO dto)
|
|
|
+ {
|
|
|
+ basicPortDescService.addBasicPortDesc(dto);
|
|
|
+ return R.success("操作成功");
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("edit")
|
|
|
+ public R edit( @RequestBody BasicPortDesc body )
|
|
|
+ {
|
|
|
+ basicPortDescService.updateById(body);
|
|
|
+ return R.success("操作成功");
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping("delete")
|
|
|
+ public R delete(@RequestParam(name = "id", required = true) Long id)
|
|
|
+ {
|
|
|
+ List<Long> ids= Arrays.asList(id);
|
|
|
+ basicPortDescService.deleteLogic(ids);
|
|
|
+ return R.success("操作成功");
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("type/list")
|
|
|
+ public R typeList(@RequestParam(name = "current", defaultValue = "1") Integer current,
|
|
|
+ @RequestParam(name = "size", defaultValue = "10") Integer size,
|
|
|
+ @RequestParam(name = "parentId", required = false) Long parentId)
|
|
|
+
|
|
|
+ {
|
|
|
+ LambdaQueryWrapper<BasicPortType> typeLambdaQueryWrapper=new LambdaQueryWrapper<>();
|
|
|
+ typeLambdaQueryWrapper
|
|
|
+ .eq(parentId!=null,BasicPortType::getParentId,parentId)
|
|
|
+ .orderByDesc(BasicPortType::getCreateTime);
|
|
|
+ Page<BasicPortType> page=new Page<>(current,size);
|
|
|
+ IPage<BasicPortType> iPage=basicPortTypeService.page(page,typeLambdaQueryWrapper);
|
|
|
+ return R.data(iPage);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @PostMapping("type/add")
|
|
|
+ public R typeList(@RequestBody BasicPortType portType )
|
|
|
+ {
|
|
|
+ basicPortTypeService.save(portType);
|
|
|
+ return R.success("操作成功");
|
|
|
+ }
|
|
|
+
|
|
|
+ @PutMapping("type/edit")
|
|
|
+ public R typeEdit(@RequestBody BasicPortType portType)
|
|
|
+ {
|
|
|
+ basicPortTypeService.updateById(portType);
|
|
|
+ return R.success("操作成功");
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping("type/delet")
|
|
|
+ public R typeDelet(@RequestParam(name = "id", required = true) Long id)
|
|
|
+ {
|
|
|
+ List<Long> ids= Arrays.asList(id);
|
|
|
+ basicPortTypeService.deleteLogic(ids);
|
|
|
+ return R.success("操作成功");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+}
|