Browse Source

新增查询标签编码接口

dev_power_axis
YUJT 3 years ago
parent
commit
58b60bc14c
  1. 2
      README.md
  2. 28
      epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/result/PowerAxisTagCategoryResultDTO.java
  3. 6
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisTagController.java
  4. 11
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisTagService.java
  5. 27
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisTagServiceImpl.java

2
README.md

@ -9,7 +9,7 @@
>>> 建议新模块的context-path以'/pli/'为前缀 >>> 建议新模块的context-path以'/pli/'为前缀
### 私服依赖下载 ### 私服依赖下载
> 本地maven的settings.xml文件,在<servers>标签下新建子元素 > 本地maven的settings.xml文件,在<servers>标签下新建子元素,在account与password处,填入私服的账号密码
```xml ```xml
<server> <server>
<id>epmet</id> <id>epmet</id>

28
epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/result/PowerAxisTagCategoryResultDTO.java

@ -0,0 +1,28 @@
package com.epmet.plugin.power.dto.axis.result;
import lombok.Data;
import java.io.Serializable;
/**
* 动力主轴相关标签信息
*
* @author work@yujt.net.cn
* @date 2022/4/18/0018 17:14
*/
@Data
public class PowerAxisTagCategoryResultDTO implements Serializable {
private static final long serialVersionUID = -2228160345628508079L;
/**
* 标签类别 动力主轴结构STRUCT动力主轴领导人 LEADER
*/
private String tagCategory;
/**
* 标签类别编码
*/
private String categoryCode;
}

6
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisTagController.java

@ -10,6 +10,7 @@ import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.plugin.power.dto.axis.PowerAxisTagDTO; import com.epmet.plugin.power.dto.axis.PowerAxisTagDTO;
import com.epmet.plugin.power.dto.axis.result.PowerAxisTagCategoryResultDTO;
import com.epmet.plugin.power.modules.axis.excel.PowerAxisTagExcel; import com.epmet.plugin.power.modules.axis.excel.PowerAxisTagExcel;
import com.epmet.plugin.power.modules.axis.service.PowerAxisTagService; import com.epmet.plugin.power.modules.axis.service.PowerAxisTagService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -77,6 +78,9 @@ public class PowerAxisTagController {
ExcelUtils.exportExcelToTarget(response, null, list, PowerAxisTagExcel.class); ExcelUtils.exportExcelToTarget(response, null, list, PowerAxisTagExcel.class);
} }
@PostMapping("listSimple/{tagCategory}")
public Result<List<PowerAxisTagCategoryResultDTO>> listSimple(@PathVariable("tagCategory") String tagCategory) {
return new Result().ok(powerAxisTagService.listSimple(tagCategory));
}
} }

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

@ -4,6 +4,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.plugin.power.dto.axis.PowerAxisTagDTO; import com.epmet.plugin.power.dto.axis.PowerAxisTagDTO;
import com.epmet.plugin.power.dto.axis.result.PowerAxisTagCategoryResultDTO;
import com.epmet.plugin.power.modules.axis.entity.PowerAxisTagEntity; import com.epmet.plugin.power.modules.axis.entity.PowerAxisTagEntity;
import java.util.List; import java.util.List;
@ -76,4 +77,14 @@ public interface PowerAxisTagService extends BaseService<PowerAxisTagEntity> {
* @date 2022-04-18 * @date 2022-04-18
*/ */
void delete(String[] ids); void delete(String[] ids);
/**
* 按标签类别查询标签列表
*
* @param tagCategory
* @return java.util.List<com.epmet.plugin.power.dto.axis.result.PowerAxisTagCategoryResultDTO>
* @author work@yujt.net.cn
* @date 2022/4/18/0018 17:24
*/
List<PowerAxisTagCategoryResultDTO> listSimple(String tagCategory);
} }

27
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisTagServiceImpl.java

@ -2,11 +2,17 @@ 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.enums.EpmetDelFlagEnum;
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.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData; 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.ConvertUtils;
import com.epmet.plugin.power.dto.axis.PowerAxisTagDTO; import com.epmet.plugin.power.dto.axis.PowerAxisTagDTO;
import com.epmet.plugin.power.dto.axis.result.PowerAxisTagCategoryResultDTO;
import com.epmet.plugin.power.modules.axis.dao.PowerAxisTagDao; import com.epmet.plugin.power.modules.axis.dao.PowerAxisTagDao;
import com.epmet.plugin.power.modules.axis.entity.PowerAxisTagEntity; import com.epmet.plugin.power.modules.axis.entity.PowerAxisTagEntity;
import com.epmet.plugin.power.modules.axis.redis.PowerAxisTagRedis; import com.epmet.plugin.power.modules.axis.redis.PowerAxisTagRedis;
@ -29,8 +35,12 @@ import java.util.Map;
@Service @Service
public class PowerAxisTagServiceImpl extends BaseServiceImpl<PowerAxisTagDao, PowerAxisTagEntity> implements PowerAxisTagService { public class PowerAxisTagServiceImpl extends BaseServiceImpl<PowerAxisTagDao, PowerAxisTagEntity> implements PowerAxisTagService {
// @Autowired
// private PowerAxisTagRedis powerAxisTagRedis;
@Autowired @Autowired
private PowerAxisTagRedis powerAxisTagRedis; private LoginUserUtil loginUserUtil;
@Override @Override
public PageData<PowerAxisTagDTO> page(Map<String, Object> params) { public PageData<PowerAxisTagDTO> page(Map<String, Object> params) {
@ -84,4 +94,19 @@ public class PowerAxisTagServiceImpl extends BaseServiceImpl<PowerAxisTagDao, Po
baseDao.deleteBatchIds(Arrays.asList(ids)); baseDao.deleteBatchIds(Arrays.asList(ids));
} }
@Override
public List<PowerAxisTagCategoryResultDTO> listSimple(String tagCategory) {
if (StringUtils.isBlank(tagCategory)) {
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "缺少参数", EpmetErrorCode.SERVER_ERROR.getMsg());
}
QueryWrapper<PowerAxisTagEntity> wrapper = new QueryWrapper<>();
wrapper.eq("TAG_CATEGORY", tagCategory)
.eq("FORBIDDEN_FLAG", EpmetDelFlagEnum.NORMAL.value())
.eq(FieldConstant.CUSTOMER_ID, loginUserUtil.getLoginUserCustomerId())
.orderByAsc("SORT", FieldConstant.CREATED_TIME);
return ConvertUtils.sourceToTarget(baseDao.selectList(wrapper), PowerAxisTagCategoryResultDTO.class);
}
} }
Loading…
Cancel
Save