diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructFormDTO.java
index de4662c..94965aa 100644
--- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructFormDTO.java
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructFormDTO.java
@@ -7,7 +7,7 @@ import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
-public class PowerAxisStructFormDTO{
+public class PowerAxisStructFormDTO {
private String agencyId;
private String name;
private String customerId;
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/StructLeaderBriefFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/StructLeaderBriefFormDTO.java
new file mode 100644
index 0000000..fded377
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/StructLeaderBriefFormDTO.java
@@ -0,0 +1,23 @@
+package com.epmet.plugin.power.dto.axis.form;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class StructLeaderBriefFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 523592353978009455L;
+
+ private int structLevel;
+
+ private String axisStructId;
+
+ private String keyWord;
+
+ private String customerId;
+}
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml
index 46166db..770b347 100644
--- a/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml
@@ -223,8 +223,8 @@
- epmet
- elink@833066
+ epmet_pli_power_user
+ EpmEt-db-UsEr
0
r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructLeaderController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructLeaderController.java
index 9f3e7f8..418af81 100644
--- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructLeaderController.java
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructLeaderController.java
@@ -1,7 +1,9 @@
package com.epmet.plugin.power.modules.axis.controller;
+import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
@@ -10,6 +12,8 @@ import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.plugin.power.dto.axis.PowerAxisStructLeaderDTO;
+import com.epmet.plugin.power.dto.axis.form.StructLeaderBriefFormDTO;
+import com.epmet.plugin.power.dto.axis.result.PowerAxisSimpleListDTO;
import com.epmet.plugin.power.modules.axis.excel.PowerAxisStructLeaderExcel;
import com.epmet.plugin.power.modules.axis.service.PowerAxisStructLeaderService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -21,33 +25,33 @@ import java.util.Map;
/**
- * 动力主轴负责人关系
+ * 动力主轴负责人关系
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-04-19
*/
@RestController
-@RequestMapping("powerAxisStructLeader")
+@RequestMapping("axisstructleader")
public class PowerAxisStructLeaderController {
@Autowired
private PowerAxisStructLeaderService powerAxisStructLeaderService;
@RequestMapping("page")
- public Result> page(@RequestParam Map params){
+ public Result> page(@RequestParam Map params) {
PageData page = powerAxisStructLeaderService.page(params);
return new Result>().ok(page);
}
- @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET})
- public Result get(@PathVariable("id") String id){
+ @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET})
+ public Result get(@PathVariable("id") String id) {
PowerAxisStructLeaderDTO data = powerAxisStructLeaderService.get(id);
return new Result().ok(data);
}
@NoRepeatSubmit
@PostMapping("save")
- public Result save(@RequestBody PowerAxisStructLeaderDTO dto){
+ public Result save(@RequestBody PowerAxisStructLeaderDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
powerAxisStructLeaderService.save(dto);
@@ -56,7 +60,7 @@ public class PowerAxisStructLeaderController {
@NoRepeatSubmit
@PostMapping("update")
- public Result update(@RequestBody PowerAxisStructLeaderDTO dto){
+ public Result update(@RequestBody PowerAxisStructLeaderDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
powerAxisStructLeaderService.update(dto);
@@ -64,7 +68,7 @@ public class PowerAxisStructLeaderController {
}
@PostMapping("delete")
- public Result delete(@RequestBody String[] ids){
+ public Result delete(@RequestBody String[] ids) {
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
powerAxisStructLeaderService.delete(ids);
@@ -77,6 +81,10 @@ public class PowerAxisStructLeaderController {
ExcelUtils.exportExcelToTarget(response, null, list, PowerAxisStructLeaderExcel.class);
}
+ @PostMapping("listbrief")
+ public Result> listLeaderByStructId(@LoginUser TokenDto tokenDto, @RequestBody StructLeaderBriefFormDTO formDto) {
+ return new Result().ok(powerAxisStructLeaderService.listLeaderByStructId(tokenDto, formDto));
+ }
}
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructLeaderDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructLeaderDao.java
index 2780461..2412501 100644
--- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructLeaderDao.java
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructLeaderDao.java
@@ -1,10 +1,14 @@
package com.epmet.plugin.power.modules.axis.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.plugin.power.dto.axis.form.StructLeaderBriefFormDTO;
import com.epmet.plugin.power.dto.axis.result.PowerAxisSLeaderResultDTO;
+import com.epmet.plugin.power.dto.axis.result.PowerAxisSimpleListDTO;
import com.epmet.plugin.power.modules.axis.entity.PowerAxisStructLeaderEntity;
import org.apache.ibatis.annotations.Mapper;
+import java.util.List;
+
/**
* 动力主轴负责人关系
*
@@ -15,4 +19,7 @@ import org.apache.ibatis.annotations.Mapper;
public interface PowerAxisStructLeaderDao extends BaseDao {
PowerAxisSLeaderResultDTO queryLeaderDetailById(String axisStructId,String customerId);
+
+
+ List listLeaderBriefByRootStructId(StructLeaderBriefFormDTO formDto);
}
\ 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/PowerAxisStructLeaderService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisStructLeaderService.java
index 46e3f1b..0da7c77 100644
--- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisStructLeaderService.java
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisStructLeaderService.java
@@ -2,8 +2,11 @@ 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.PowerAxisStructLeaderDTO;
+import com.epmet.plugin.power.dto.axis.form.StructLeaderBriefFormDTO;
import com.epmet.plugin.power.dto.axis.result.PowerAxisSLeaderResultDTO;
+import com.epmet.plugin.power.dto.axis.result.PowerAxisSimpleListDTO;
import com.epmet.plugin.power.modules.axis.entity.PowerAxisStructLeaderEntity;
import java.util.List;
@@ -81,4 +84,6 @@ public interface PowerAxisStructLeaderService extends BaseService listLeaderByStructId(TokenDto tokenDto, StructLeaderBriefFormDTO formDto);
}
\ 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/PowerAxisStructLeaderServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructLeaderServiceImpl.java
index b7242ce..5d67ea5 100644
--- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructLeaderServiceImpl.java
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructLeaderServiceImpl.java
@@ -1,15 +1,28 @@
package com.epmet.plugin.power.modules.axis.service.impl;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.epmet.commons.mybatis.enums.EpmetDelFlagEnum;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
+import com.epmet.commons.tools.constant.NumConstant;
+import com.epmet.commons.tools.constant.StrConstant;
+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.commons.tools.constant.FieldConstant;
+import com.epmet.plugin.power.dto.axis.form.StructLeaderBriefFormDTO;
import com.epmet.plugin.power.dto.axis.result.PowerAxisSLeaderResultDTO;
+import com.epmet.plugin.power.dto.axis.result.PowerAxisSimpleListDTO;
+import com.epmet.plugin.power.enums.PowerTagLevelEnum;
+import com.epmet.plugin.power.modules.axis.dao.PowerAxisLeaderDao;
+import com.epmet.plugin.power.modules.axis.dao.PowerAxisStructDao;
import com.epmet.plugin.power.modules.axis.dao.PowerAxisStructLeaderDao;
import com.epmet.plugin.power.dto.axis.PowerAxisStructLeaderDTO;
+import com.epmet.plugin.power.modules.axis.entity.PowerAxisStructEntity;
import com.epmet.plugin.power.modules.axis.entity.PowerAxisStructLeaderEntity;
import com.epmet.plugin.power.modules.axis.service.PowerAxisStructLeaderService;
import org.apache.commons.lang3.StringUtils;
@@ -22,7 +35,7 @@ import java.util.List;
import java.util.Map;
/**
- * 动力主轴负责人关系
+ * 动力主轴负责人关系
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-04-19
@@ -34,7 +47,13 @@ public class PowerAxisStructLeaderServiceImpl extends BaseServiceImpl page(Map params) {
@@ -52,8 +71,8 @@ public class PowerAxisStructLeaderServiceImpl extends BaseServiceImpl getWrapper(Map params){
- String id = (String)params.get(FieldConstant.ID_HUMP);
+ private QueryWrapper getWrapper(Map params) {
+ String id = (String) params.get(FieldConstant.ID_HUMP);
QueryWrapper wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
@@ -91,7 +110,35 @@ public class PowerAxisStructLeaderServiceImpl extends BaseServiceImpl listLeaderByStructId(TokenDto tokenDto, StructLeaderBriefFormDTO formDto) {
+
+ int structLevel = formDto.getStructLevel();
+ String axisStructId = formDto.getAxisStructId();
+ String customerId = tokenDto.getCustomerId();
+ String rootId;
+ if (PowerTagLevelEnum.ROOT.level() == structLevel) {
+ rootId = axisStructId;
+ } else {
+
+ LambdaQueryWrapper lqw = new LambdaQueryWrapper<>();
+ lqw.eq(PowerAxisStructEntity::getCustomerId, customerId)
+ .eq(PowerAxisStructEntity::getPid, axisStructId)
+ .eq(PowerAxisStructEntity::getDelFlag, EpmetDelFlagEnum.NORMAL.value());
+
+ PowerAxisStructEntity axisStructEntity = powerAxisStructDao.selectOne(lqw);
+ if (null == axisStructEntity) {
+ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "节点匹配错误");
+ }
+
+ rootId = StringUtils.split(axisStructEntity.getPids(), StrConstant.COLON)[NumConstant.ZERO];
+ }
+
+ formDto.setCustomerId(customerId);
+ formDto.setAxisStructId(rootId);
+ return baseDao.listLeaderBriefByRootStructId(formDto);
+ }
}
\ 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/PowerKernelHouseholdServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerKernelHouseholdServiceImpl.java
index b48f4bf..bc337c6 100644
--- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerKernelHouseholdServiceImpl.java
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerKernelHouseholdServiceImpl.java
@@ -163,7 +163,6 @@ public class PowerKernelHouseholdServiceImpl extends BaseServiceImpl houseList = listResult.getData();
- List list = Lists.newArrayList();
PowerKernelHouseholdEntity entity;
for (HouseInfoDTO houseInfo : houseList) {
@@ -175,7 +174,7 @@ public class PowerKernelHouseholdServiceImpl extends BaseServiceImpl
+
\ No newline at end of file