From fbdcfabd4dd64094f0aa3a3b79833cb363ddb728 Mon Sep 17 00:00:00 2001 From: HAHA Date: Fri, 22 Apr 2022 10:00:53 +0800 Subject: [PATCH] =?UTF-8?q?message:=20=E6=9E=84=E9=80=A0=E6=A0=91=E7=BB=93?= =?UTF-8?q?=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/PowerAxisStructStructTreeFormDTO.java | 8 ++++++++ .../axis/result/PowerAxisStructTreeResultDTO.java | 13 +++++++++++++ .../PowerAxisStructViewController.java | 15 +++++++++++++++ .../modules/axis/dao/PowerAxisStructDao.java | 2 ++ .../axis/service/PowerAxisStructService.java | 5 +++++ .../service/impl/PowerAxisStructServiceImpl.java | 7 +++++++ .../mapper/poweraxis/PowerAxisStructDao.xml | 15 +++++++++++++++ 7 files changed, 65 insertions(+) create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructStructTreeFormDTO.java create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/result/PowerAxisStructTreeResultDTO.java diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructStructTreeFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructStructTreeFormDTO.java new file mode 100644 index 0000000..9915db5 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructStructTreeFormDTO.java @@ -0,0 +1,8 @@ +package com.epmet.plugin.power.dto.axis.form; + +import lombok.Data; + +@Data +public class PowerAxisStructStructTreeFormDTO { + private String agencyId; +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/result/PowerAxisStructTreeResultDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/result/PowerAxisStructTreeResultDTO.java new file mode 100644 index 0000000..5ca4d17 --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/result/PowerAxisStructTreeResultDTO.java @@ -0,0 +1,13 @@ +package com.epmet.plugin.power.dto.axis.result; + +import com.epmet.commons.tools.utils.TreeNode; +import lombok.Data; + +@Data +public class PowerAxisStructTreeResultDTO extends TreeNode { + private Long id; + private Long pid; + private String name; + private String leaderId; + private String leaderName; +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/ViewController/PowerAxisStructViewController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/ViewController/PowerAxisStructViewController.java index 45e2b13..6403727 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/ViewController/PowerAxisStructViewController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/ViewController/PowerAxisStructViewController.java @@ -2,8 +2,12 @@ package com.epmet.plugin.power.modules.axis.ViewController; import com.epmet.commons.tools.utils.Result; import com.epmet.plugin.power.dto.axis.form.PowerAxisLeaderDetailFormDTO; + +import com.epmet.plugin.power.dto.axis.form.PowerAxisStructStructTreeFormDTO; import com.epmet.plugin.power.dto.axis.form.PowerAxisStructViewFormDTO; import com.epmet.plugin.power.dto.axis.result.PowerAxisLeaderDetailResultDTO; +import com.epmet.plugin.power.dto.axis.result.PowerAxisStructResultDTO; +import com.epmet.plugin.power.dto.axis.result.PowerAxisStructTreeResultDTO; import com.epmet.plugin.power.dto.axis.result.PowerAxisStructViewResultDTO; import com.epmet.plugin.power.modules.axis.service.PowerAxisLeaderService; import com.epmet.plugin.power.modules.axis.service.PowerAxisStructService; @@ -13,6 +17,8 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + @RestController @RequestMapping("/data/axis") public class PowerAxisStructViewController { @@ -40,4 +46,13 @@ public class PowerAxisStructViewController { PowerAxisLeaderDetailResultDTO dto = powerAxisLeaderService.getLeaderDetail(form); return new Result().ok(dto); } + + /** + *动力主轴结构树 + */ + @PostMapping("/structTree") + public Result getStructTree(@RequestBody PowerAxisStructStructTreeFormDTO form){ + List dto = powerAxisStructService.getStructTree(form); + return new Result().ok(dto); + } } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructDao.java index 9908bd4..b16b37e 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructDao.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructDao.java @@ -75,4 +75,6 @@ public interface PowerAxisStructDao extends BaseDao { int getKernelHouseHold(); int getServiceStation(); + + List getStructTree(PowerAxisStructStructTreeFormDTO form); } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisStructService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisStructService.java index 18999c4..a348f53 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisStructService.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisStructService.java @@ -151,4 +151,9 @@ public interface PowerAxisStructService extends BaseService getStructTree(PowerAxisStructStructTreeFormDTO form); } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java index 6a9222f..a898ae5 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java @@ -11,6 +11,7 @@ import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.TreeUtils; import com.epmet.plugin.power.dto.axis.PowerAxisStructDTO; import com.epmet.plugin.power.dto.axis.form.*; import com.epmet.plugin.power.dto.axis.result.*; @@ -226,5 +227,11 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl getStructTree(PowerAxisStructStructTreeFormDTO form) { + List dto = baseDao.getStructTree(form); + return TreeUtils.build(dto); + } + } \ No newline at end of file diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml index 82dc6f4..78522f7 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml @@ -188,6 +188,21 @@ + \ No newline at end of file