From 121ea59bd03f7dfc049bf10ac616313930a22ec0 Mon Sep 17 00:00:00 2001 From: Jackwang Date: Fri, 29 Jul 2022 14:10:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=B7=BB=E5=8A=A0=E5=AE=A2?= =?UTF-8?q?=E6=88=B7id=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/PowerAxisStructController.java | 4 ++-- .../controller/PowerAxisTagController.java | 4 ++-- .../modules/axis/dao/PowerAxisStructDao.java | 16 +++++++++++----- .../modules/axis/dao/PowerAxisTagDao.java | 2 +- .../axis/service/PowerAxisStructService.java | 5 +++-- .../axis/service/PowerAxisTagService.java | 5 +++-- .../impl/PowerAxisStructServiceImpl.java | 18 +++++++++++------- .../service/impl/PowerAxisTagServiceImpl.java | 5 +++-- .../mapper/poweraxis/PowerAxisStructDao.xml | 7 +++++++ .../mapper/poweraxis/PowerAxisTagDao.xml | 7 ++++++- 10 files changed, 49 insertions(+), 24 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructController.java index c65f523..4750289 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructController.java @@ -46,8 +46,8 @@ public class PowerAxisStructController { private PowerAxisStructService powerAxisStructService; @RequestMapping("page") - public Result> page(@RequestParam Map params) { - PageData page = powerAxisStructService.page(params); + public Result> page(@LoginUser TokenDto tokenDto,@RequestParam Map params) { + PageData page = powerAxisStructService.page(tokenDto,params); return new Result>().ok(page); } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisTagController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisTagController.java index 38379a3..998bdac 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisTagController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisTagController.java @@ -102,8 +102,8 @@ public class PowerAxisTagController { * @date 2022/4/19/0019 9:24 */ @PostMapping("listSimpleAll") - public Result> listSimpleAll() { - return new Result().ok(powerAxisTagService.listSimpleAll()); + public Result> listSimpleAll(@LoginUser TokenDto tokenDto) { + return new Result().ok(powerAxisTagService.listSimpleAll(tokenDto)); } } 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 d4831d5..ebb2b86 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 @@ -3,8 +3,14 @@ package com.epmet.plugin.power.modules.axis.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.plugin.power.dto.axis.PowerAxisStructDTO; -import com.epmet.plugin.power.dto.axis.form.*; -import com.epmet.plugin.power.dto.axis.result.*; +import com.epmet.plugin.power.dto.axis.form.PowerAxisListPositionFormDTO; +import com.epmet.plugin.power.dto.axis.form.PowerAxisStructFormDTO; +import com.epmet.plugin.power.dto.axis.form.PowerAxisStructLeaderFormDTO; +import com.epmet.plugin.power.dto.axis.form.PowerAxisStructStructTreeFormDTO; +import com.epmet.plugin.power.dto.axis.result.PowerAxisListPositionResultDTO; +import com.epmet.plugin.power.dto.axis.result.PowerAxisStructLeaderResultDTO; +import com.epmet.plugin.power.dto.axis.result.PowerAxisStructResultDTO; +import com.epmet.plugin.power.dto.axis.result.PowerAxisStructTreeResultDTO; import com.epmet.plugin.power.modules.axis.entity.PowerAxisStructEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -12,8 +18,6 @@ import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; -import java.util.List; - /** * 动力主轴结构 * @@ -125,4 +129,6 @@ public interface PowerAxisStructDao extends BaseDao { String getRootAxisStructId(@Param("customerId") String customerId, @Param("agencyId") String agencyId, @Param("structLevel") int structLevel); -} \ No newline at end of file + + List getPageList(Map params); +} diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisTagDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisTagDao.java index babc8bd..b4116c7 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisTagDao.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisTagDao.java @@ -25,7 +25,7 @@ public interface PowerAxisTagDao extends BaseDao { * @author work@yujt.net.cn * @date 2022/4/19/0019 9:14 */ - List listSimpleAll(); + List listSimpleAll(@Param("customerId") String customerId); /** * 根据ID查询节点等级 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 557dd09..d2c71f0 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 @@ -3,6 +3,7 @@ package com.epmet.plugin.power.modules.axis.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.plugin.power.dto.axis.PowerAxisStructDTO; import com.epmet.plugin.power.dto.axis.form.*; import com.epmet.plugin.power.dto.axis.result.*; @@ -27,7 +28,7 @@ public interface PowerAxisStructService extends BaseService page(Map params); + PageData page(TokenDto tokenDto,Map params); /** * 默认查询 @@ -165,4 +166,4 @@ public interface PowerAxisStructService extends BaseService { * @author work@yujt.net.cn * @date 2022/4/19/0019 9:23 */ - List listSimpleAll(); + List listSimpleAll(TokenDto tokenDto); /** * 根据标签编码,查询节点级别 @@ -121,4 +122,4 @@ public interface PowerAxisTagService extends BaseService { * @date 2022/4/23/0023 15:51 */ Integer selectStructLevelById(String customerId, String tagCategory, String axisStructId); -} \ 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 124529c..6ceb724 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 @@ -2,7 +2,6 @@ package com.epmet.plugin.power.modules.axis.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; - import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; @@ -12,6 +11,7 @@ import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.TreeUtils; @@ -53,12 +53,16 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, PowerAxisStructDTO.class); + public PageData page(TokenDto tokenDto,Map params) { +// IPage page = baseDao.selectPage( +// getPage(params, FieldConstant.CREATED_TIME, false), +// getWrapper(params) +// ); +// return getPageData(page, PowerAxisStructDTO.class); + params.put("customerId", tokenDto.getCustomerId()); + IPage page = getPage(params); + List list = baseDao.getPageList(params); + return new PageData<>(list, page.getTotal()); } @Override diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisTagServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisTagServiceImpl.java index a7d0b14..d659a2c 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisTagServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisTagServiceImpl.java @@ -10,6 +10,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.plugin.power.dto.axis.PowerAxisTagDTO; @@ -116,8 +117,8 @@ public class PowerAxisTagServiceImpl extends BaseServiceImpl listSimpleAll() { - return baseDao.listSimpleAll(); + public List listSimpleAll(TokenDto tokenDto) { + return baseDao.listSimpleAll(tokenDto.getCustomerId()); } @Override 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 8be24a9..689ec0f 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 @@ -257,6 +257,13 @@ AND s.DEL_FLAG = '0' AND t.STRUCT_LEVEL = #{structLevel} + diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisTagDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisTagDao.xml index 27034ee..721ab2b 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisTagDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisTagDao.xml @@ -29,7 +29,12 @@