Browse Source

新增接口;其他

dev_power_axis
YUJT 4 years ago
parent
commit
5904152ea9
  1. 23
      epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/StructLeaderBriefFormDTO.java
  2. 4
      epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml
  3. 10
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructLeaderController.java
  4. 7
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructLeaderDao.java
  5. 5
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisStructLeaderService.java
  6. 49
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructLeaderServiceImpl.java
  7. 3
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerKernelHouseholdServiceImpl.java
  8. 22
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructLeaderDao.xml

23
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;
}

4
epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml

@ -223,8 +223,8 @@
<spring.datasource.druid.url> <spring.datasource.druid.url>
<![CDATA[jdbc:mysql://rm-m5ef9t617j6o5eup7.mysql.rds.aliyuncs.com:3306/epmet_pli_power?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]> <![CDATA[jdbc:mysql://rm-m5ef9t617j6o5eup7.mysql.rds.aliyuncs.com:3306/epmet_pli_power?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</spring.datasource.druid.url> </spring.datasource.druid.url>
<spring.datasource.druid.username>epmet</spring.datasource.druid.username> <spring.datasource.druid.username>epmet_pli_power_user</spring.datasource.druid.username>
<spring.datasource.druid.password>elink@833066</spring.datasource.druid.password> <spring.datasource.druid.password>EpmEt-db-UsEr</spring.datasource.druid.password>
<!-- redis配置 --> <!-- redis配置 -->
<spring.redis.index>0</spring.redis.index> <spring.redis.index>0</spring.redis.index>
<spring.redis.host>r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com</spring.redis.host> <spring.redis.host>r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com</spring.redis.host>

10
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; 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.aop.NoRepeatSubmit;
import com.epmet.commons.tools.page.PageData; 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.ExcelUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils; 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.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.plugin.power.dto.axis.PowerAxisStructLeaderDTO; 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.excel.PowerAxisStructLeaderExcel;
import com.epmet.plugin.power.modules.axis.service.PowerAxisStructLeaderService; import com.epmet.plugin.power.modules.axis.service.PowerAxisStructLeaderService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -27,7 +31,7 @@ import java.util.Map;
* @since v1.0.0 2022-04-19 * @since v1.0.0 2022-04-19
*/ */
@RestController @RestController
@RequestMapping("powerAxisStructLeader") @RequestMapping("axisstructleader")
public class PowerAxisStructLeaderController { public class PowerAxisStructLeaderController {
@Autowired @Autowired
@ -77,6 +81,10 @@ public class PowerAxisStructLeaderController {
ExcelUtils.exportExcelToTarget(response, null, list, PowerAxisStructLeaderExcel.class); ExcelUtils.exportExcelToTarget(response, null, list, PowerAxisStructLeaderExcel.class);
} }
@PostMapping("listbrief")
public Result<List<PowerAxisSimpleListDTO>> listLeaderByStructId(@LoginUser TokenDto tokenDto, @RequestBody StructLeaderBriefFormDTO formDto) {
return new Result().ok(powerAxisStructLeaderService.listLeaderByStructId(tokenDto, formDto));
}
} }

7
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; package com.epmet.plugin.power.modules.axis.dao;
import com.epmet.commons.mybatis.dao.BaseDao; 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.PowerAxisSLeaderResultDTO;
import com.epmet.plugin.power.dto.axis.result.PowerAxisSimpleListDTO;
import com.epmet.plugin.power.modules.axis.entity.PowerAxisStructLeaderEntity; import com.epmet.plugin.power.modules.axis.entity.PowerAxisStructLeaderEntity;
import org.apache.ibatis.annotations.Mapper; 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<PowerAxisStructLeaderEntity> { public interface PowerAxisStructLeaderDao extends BaseDao<PowerAxisStructLeaderEntity> {
PowerAxisSLeaderResultDTO queryLeaderDetailById(String axisStructId,String customerId); PowerAxisSLeaderResultDTO queryLeaderDetailById(String axisStructId,String customerId);
List<PowerAxisSimpleListDTO> listLeaderBriefByRootStructId(StructLeaderBriefFormDTO formDto);
} }

5
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.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData; 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.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.PowerAxisSLeaderResultDTO;
import com.epmet.plugin.power.dto.axis.result.PowerAxisSimpleListDTO;
import com.epmet.plugin.power.modules.axis.entity.PowerAxisStructLeaderEntity; import com.epmet.plugin.power.modules.axis.entity.PowerAxisStructLeaderEntity;
import java.util.List; import java.util.List;
@ -81,4 +84,6 @@ public interface PowerAxisStructLeaderService extends BaseService<PowerAxisStruc
* 查询节点负责人信息 * 查询节点负责人信息
*/ */
PowerAxisSLeaderResultDTO queryLeaderDetailById(String axisStructId); PowerAxisSLeaderResultDTO queryLeaderDetailById(String axisStructId);
List<PowerAxisSimpleListDTO> listLeaderByStructId(TokenDto tokenDto, StructLeaderBriefFormDTO formDto);
} }

49
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; 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.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; 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.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.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant; 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.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.modules.axis.dao.PowerAxisStructLeaderDao;
import com.epmet.plugin.power.dto.axis.PowerAxisStructLeaderDTO; 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.entity.PowerAxisStructLeaderEntity;
import com.epmet.plugin.power.modules.axis.service.PowerAxisStructLeaderService; import com.epmet.plugin.power.modules.axis.service.PowerAxisStructLeaderService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -34,7 +47,13 @@ public class PowerAxisStructLeaderServiceImpl extends BaseServiceImpl<PowerAxisS
// private PowerAxisStructLeaderRedis powerAxisStructLeaderRedis; // private PowerAxisStructLeaderRedis powerAxisStructLeaderRedis;
@Autowired @Autowired
LoginUserUtil loginUserUtil; private LoginUserUtil loginUserUtil;
@Autowired
private PowerAxisLeaderDao powerAxisLeaderDao;
@Autowired
private PowerAxisStructDao powerAxisStructDao;
@Override @Override
public PageData<PowerAxisStructLeaderDTO> page(Map<String, Object> params) { public PageData<PowerAxisStructLeaderDTO> page(Map<String, Object> params) {
@ -94,4 +113,32 @@ public class PowerAxisStructLeaderServiceImpl extends BaseServiceImpl<PowerAxisS
return baseDao.queryLeaderDetailById(axisStructId, customerId); return baseDao.queryLeaderDetailById(axisStructId, customerId);
} }
@Override
public List<PowerAxisSimpleListDTO> 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<PowerAxisStructEntity> 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);
}
} }

3
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<PowerKernel
return; return;
} }
List<HouseInfoDTO> houseList = listResult.getData(); List<HouseInfoDTO> houseList = listResult.getData();
List<PowerKernelHouseholdEntity> list = Lists.newArrayList();
PowerKernelHouseholdEntity entity; PowerKernelHouseholdEntity entity;
for (HouseInfoDTO houseInfo : houseList) { for (HouseInfoDTO houseInfo : houseList) {
@ -175,7 +174,7 @@ public class PowerKernelHouseholdServiceImpl extends BaseServiceImpl<PowerKernel
entity = new PowerKernelHouseholdEntity(); entity = new PowerKernelHouseholdEntity();
entity.setHouseId(houseInfo.getHomeId()); entity.setHouseId(houseInfo.getHomeId());
if (!org.springframework.util.StringUtils.isEmpty(houseInfo.getBuildingLatitude()) && !org.springframework.util.StringUtils.isEmpty(houseInfo.getBuildingLongitude())) { if (StringUtils.isNotBlank(houseInfo.getBuildingLatitude()) && StringUtils.isNotBlank(houseInfo.getBuildingLongitude())) {
entity.setLatitude(new BigDecimal(houseInfo.getBuildingLatitude())); entity.setLatitude(new BigDecimal(houseInfo.getBuildingLatitude()));
entity.setLongitude(new BigDecimal(houseInfo.getBuildingLongitude())); entity.setLongitude(new BigDecimal(houseInfo.getBuildingLongitude()));
} else { } else {

22
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructLeaderDao.xml

@ -33,6 +33,28 @@
AND sl.DEL_FLAG = '0' AND l.DEL_FLAG = '0' AND sl.DEL_FLAG = '0' AND l.DEL_FLAG = '0'
and l.customer_id = #{customerId} and l.customer_id = #{customerId}
</select> </select>
<select id="listLeaderBriefByRootStructId"
resultType="com.epmet.plugin.power.dto.axis.result.PowerAxisSimpleListDTO">
SELECT
l.ID,
l.`NAME` ,
l.MOBILE
FROM
pli_power_axis_struct s
LEFT JOIN pli_power_axis_struct_leader sl ON s.ID = sl.STRUCT_REFERENCE_ID
LEFT JOIN pli_power_axis_leader l ON sl.LEADER_ID = l.ID
WHERE
s.DEL_FLAG = '0'
AND sl.DEL_FLAG = '0'
AND s.CUSTOMER_ID = #{customerId}
AND ( s.ID = #{axisStructId} OR PIDS LIKE '%${axisStructId}%' )
AND (l.`NAME` LIKE '%${keyWord}%' OR l.MOBILE LIKE '%${keyWord}%')
GROUP BY
l.ID
ORDER BY
s.CREATED_TIME,
s.SORT
</select>
</mapper> </mapper>
Loading…
Cancel
Save