Browse Source

查询添加客户id筛选

dev_zufangUpdate
Jackwang 3 years ago
parent
commit
121ea59bd0
  1. 4
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructController.java
  2. 4
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisTagController.java
  3. 16
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructDao.java
  4. 2
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisTagDao.java
  5. 5
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisStructService.java
  6. 5
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisTagService.java
  7. 18
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java
  8. 5
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisTagServiceImpl.java
  9. 7
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml
  10. 7
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisTagDao.xml

4
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; private PowerAxisStructService powerAxisStructService;
@RequestMapping("page") @RequestMapping("page")
public Result<PageData<PowerAxisStructDTO>> page(@RequestParam Map<String, Object> params) { public Result<PageData<PowerAxisStructDTO>> page(@LoginUser TokenDto tokenDto,@RequestParam Map<String, Object> params) {
PageData<PowerAxisStructDTO> page = powerAxisStructService.page(params); PageData<PowerAxisStructDTO> page = powerAxisStructService.page(tokenDto,params);
return new Result<PageData<PowerAxisStructDTO>>().ok(page); return new Result<PageData<PowerAxisStructDTO>>().ok(page);
} }

4
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 * @date 2022/4/19/0019 9:24
*/ */
@PostMapping("listSimpleAll") @PostMapping("listSimpleAll")
public Result<List<PowerAxisAllTagCategoryResultDTO>> listSimpleAll() { public Result<List<PowerAxisAllTagCategoryResultDTO>> listSimpleAll(@LoginUser TokenDto tokenDto) {
return new Result().ok(powerAxisTagService.listSimpleAll()); return new Result().ok(powerAxisTagService.listSimpleAll(tokenDto));
} }
} }

16
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.commons.mybatis.dao.BaseDao;
import com.epmet.plugin.power.dto.axis.PowerAxisStructDTO; import com.epmet.plugin.power.dto.axis.PowerAxisStructDTO;
import com.epmet.plugin.power.dto.axis.form.*; import com.epmet.plugin.power.dto.axis.form.PowerAxisListPositionFormDTO;
import com.epmet.plugin.power.dto.axis.result.*; 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 com.epmet.plugin.power.modules.axis.entity.PowerAxisStructEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -12,8 +18,6 @@ import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.List;
/** /**
* 动力主轴结构 * 动力主轴结构
* *
@ -125,4 +129,6 @@ public interface PowerAxisStructDao extends BaseDao<PowerAxisStructEntity> {
String getRootAxisStructId(@Param("customerId") String customerId, String getRootAxisStructId(@Param("customerId") String customerId,
@Param("agencyId") String agencyId, @Param("agencyId") String agencyId,
@Param("structLevel") int structLevel); @Param("structLevel") int structLevel);
}
List<PowerAxisStructDTO> getPageList(Map<String, Object> params);
}

2
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<PowerAxisTagEntity> {
* @author work@yujt.net.cn * @author work@yujt.net.cn
* @date 2022/4/19/0019 9:14 * @date 2022/4/19/0019 9:14
*/ */
List<PowerAxisAllTagCategoryResultDTO> listSimpleAll(); List<PowerAxisAllTagCategoryResultDTO> listSimpleAll(@Param("customerId") String customerId);
/** /**
* 根据ID查询节点等级 * 根据ID查询节点等级

5
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.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.PowerAxisStructDTO; import com.epmet.plugin.power.dto.axis.PowerAxisStructDTO;
import com.epmet.plugin.power.dto.axis.form.*; import com.epmet.plugin.power.dto.axis.form.*;
import com.epmet.plugin.power.dto.axis.result.*; import com.epmet.plugin.power.dto.axis.result.*;
@ -27,7 +28,7 @@ public interface PowerAxisStructService extends BaseService<PowerAxisStructEntit
* @author generator * @author generator
* @date 2022-04-18 * @date 2022-04-18
*/ */
PageData<PowerAxisStructDTO> page(Map<String, Object> params); PageData<PowerAxisStructDTO> page(TokenDto tokenDto,Map<String, Object> params);
/** /**
* 默认查询 * 默认查询
@ -165,4 +166,4 @@ public interface PowerAxisStructService extends BaseService<PowerAxisStructEntit
* @date 2022/5/12/0012 10:26 * @date 2022/5/12/0012 10:26
*/ */
String getRootAxisStructId(String rootStructId, String customerId, String agencyId); String getRootAxisStructId(String rootStructId, String customerId, String agencyId);
} }

5
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisTagService.java

@ -3,6 +3,7 @@ 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.PowerAxisTagDTO; import com.epmet.plugin.power.dto.axis.PowerAxisTagDTO;
import com.epmet.plugin.power.dto.axis.result.PowerAxisAllTagCategoryResultDTO; import com.epmet.plugin.power.dto.axis.result.PowerAxisAllTagCategoryResultDTO;
import com.epmet.plugin.power.dto.axis.result.PowerAxisTagCategoryResultDTO; import com.epmet.plugin.power.dto.axis.result.PowerAxisTagCategoryResultDTO;
@ -96,7 +97,7 @@ public interface PowerAxisTagService extends BaseService<PowerAxisTagEntity> {
* @author work@yujt.net.cn * @author work@yujt.net.cn
* @date 2022/4/19/0019 9:23 * @date 2022/4/19/0019 9:23
*/ */
List<PowerAxisAllTagCategoryResultDTO> listSimpleAll(); List<PowerAxisAllTagCategoryResultDTO> listSimpleAll(TokenDto tokenDto);
/** /**
* 根据标签编码查询节点级别 * 根据标签编码查询节点级别
@ -121,4 +122,4 @@ public interface PowerAxisTagService extends BaseService<PowerAxisTagEntity> {
* @date 2022/4/23/0023 15:51 * @date 2022/4/23/0023 15:51
*/ */
Integer selectStructLevelById(String customerId, String tagCategory, String axisStructId); Integer selectStructLevelById(String customerId, String tagCategory, String axisStructId);
} }

18
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.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant; 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.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; 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.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.TreeUtils; import com.epmet.commons.tools.utils.TreeUtils;
@ -53,12 +53,16 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl<PowerAxisStructD
private PowerAxisStructDao powerAxisStructDao; private PowerAxisStructDao powerAxisStructDao;
@Override @Override
public PageData<PowerAxisStructDTO> page(Map<String, Object> params) { public PageData<PowerAxisStructDTO> page(TokenDto tokenDto,Map<String, Object> params) {
IPage<PowerAxisStructEntity> page = baseDao.selectPage( // IPage<PowerAxisStructEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false), // getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params) // getWrapper(params)
); // );
return getPageData(page, PowerAxisStructDTO.class); // return getPageData(page, PowerAxisStructDTO.class);
params.put("customerId", tokenDto.getCustomerId());
IPage<PowerAxisStructDTO> page = getPage(params);
List<PowerAxisStructDTO> list = baseDao.getPageList(params);
return new PageData<>(list, page.getTotal());
} }
@Override @Override

5
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.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException; 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.plugin.power.dto.axis.PowerAxisTagDTO; import com.epmet.plugin.power.dto.axis.PowerAxisTagDTO;
@ -116,8 +117,8 @@ public class PowerAxisTagServiceImpl extends BaseServiceImpl<PowerAxisTagDao, Po
} }
@Override @Override
public List<PowerAxisAllTagCategoryResultDTO> listSimpleAll() { public List<PowerAxisAllTagCategoryResultDTO> listSimpleAll(TokenDto tokenDto) {
return baseDao.listSimpleAll(); return baseDao.listSimpleAll(tokenDto.getCustomerId());
} }
@Override @Override

7
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 s.DEL_FLAG = '0'
AND t.STRUCT_LEVEL = #{structLevel} AND t.STRUCT_LEVEL = #{structLevel}
</select> </select>
<select id="getPageList" resultType="com.epmet.plugin.power.dto.axis.PowerAxisStructDTO">
select *
from pli_power_axis_tag
where DEL_FLAG = '0'
and CUSTOMER_ID = #{customerId}
order by CREATED_TIME desc
</select>
</mapper> </mapper>

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

@ -29,7 +29,12 @@
</resultMap> </resultMap>
<select id="listSimpleAll" resultMap="listSimpleAllResultMap"> <select id="listSimpleAll" resultMap="listSimpleAllResultMap">
select t.TAG_CATEGORY,t.CATEGORY_NAME,t.CATEGORY_CODE,t.STRUCT_LEVEL from pli_power_axis_tag t where t.DEL_FLAG = '0' and t.FORBIDDEN_FLAG = '0' order by t.STRUCT_LEVEL select t.TAG_CATEGORY,t.CATEGORY_NAME,t.CATEGORY_CODE,t.STRUCT_LEVEL
from pli_power_axis_tag t
where t.DEL_FLAG = '0'
and t.FORBIDDEN_FLAG = '0'
and CUSTOMER_ID = #{customerId}
order by t.STRUCT_LEVEL
</select> </select>
<select id="selectStructLevelById" resultType="java.lang.Integer"> <select id="selectStructLevelById" resultType="java.lang.Integer">
SELECT SELECT

Loading…
Cancel
Save