金属元素外部接口
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package com.zt.plat.module.api;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.module.api.dto.AccountDTO;
|
||||
import com.zt.plat.module.api.dto.ElementDTO;
|
||||
import com.zt.plat.module.api.dto.MaterialOtherDTO;
|
||||
import com.zt.plat.module.base.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
@@ -23,4 +25,8 @@ public interface BaseApi {
|
||||
@GetMapping(PREFIX + "/getMaterialOtherNoPage")
|
||||
@Operation(summary = "物料拓展关系数据不分页查询")
|
||||
List<MaterialOtherDTO> getMaterialOtherNoPage(MaterialOtherDTO respVO);
|
||||
|
||||
@GetMapping(PREFIX + "/getElementNoPage")
|
||||
@Operation(summary = "金属元素数据不分页查询")
|
||||
CommonResult<List<ElementDTO>> getElementNoPage(ElementDTO respVO);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.zt.plat.module.api.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 金属元素 Response VO")
|
||||
@Data
|
||||
public class ElementDTO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "21884")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "金属元素缩写", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String abbreviation;
|
||||
|
||||
@Schema(description = "金属元素名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "金属元素编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String coding;
|
||||
|
||||
@Schema(description = "小数位数", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long decimalValue;
|
||||
|
||||
@Schema(description = "品位单位", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String gradeUnit;
|
||||
|
||||
}
|
||||
@@ -1,16 +1,30 @@
|
||||
package com.zt.plat.module.base.api;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.module.api.BaseApi;
|
||||
import com.zt.plat.module.api.dto.AccountDTO;
|
||||
import com.zt.plat.module.api.dto.ElementDTO;
|
||||
import com.zt.plat.module.api.dto.MaterialOtherDTO;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.ElementPageReqVO;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.ElementRespVO;
|
||||
import com.zt.plat.module.base.dal.dataobject.base.ElementDO;
|
||||
import com.zt.plat.module.base.service.base.AccountService;
|
||||
import com.zt.plat.module.base.service.base.ElementService;
|
||||
import com.zt.plat.module.base.service.base.MaterialOtherService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* ERP Api 实现类
|
||||
*
|
||||
@@ -27,6 +41,9 @@ public class BaseApiImpl implements BaseApi {
|
||||
@Resource
|
||||
private MaterialOtherService materialOtherService;
|
||||
|
||||
@Resource
|
||||
private ElementService elementService;
|
||||
|
||||
@Override
|
||||
public List<AccountDTO> getAccountNoPage(AccountDTO respVO) {
|
||||
return accountService.getAccountNoPage(respVO);
|
||||
@@ -36,4 +53,9 @@ public class BaseApiImpl implements BaseApi {
|
||||
public List<MaterialOtherDTO> getMaterialOtherNoPage(MaterialOtherDTO respVO) {
|
||||
return materialOtherService.getMaterialOtherNoPage(respVO);
|
||||
}
|
||||
|
||||
public CommonResult<List<ElementDTO>> getElementNoPage(ElementDTO respVO) {
|
||||
List<ElementDO> list = elementService.getElementNoPage(respVO);
|
||||
return success(BeanUtils.toBean(list, ElementDTO.class));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,10 +3,13 @@ package com.zt.plat.module.base.dal.mysql.base;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.module.api.dto.ElementDTO;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.ElementPageReqVO;
|
||||
import com.zt.plat.module.base.dal.dataobject.base.ElementDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 金属元素 Mapper
|
||||
*
|
||||
@@ -27,4 +30,14 @@ public interface ElementMapper extends BaseMapperX<ElementDO> {
|
||||
}
|
||||
|
||||
String selectMaxCode();
|
||||
|
||||
default List<ElementDO> getElementNoPage(ElementDTO dto) {
|
||||
return selectList(new LambdaQueryWrapperX<ElementDO>()
|
||||
.eqIfPresent(ElementDO::getAbbreviation, dto.getAbbreviation())
|
||||
.likeIfPresent(ElementDO::getName, dto.getName())
|
||||
.eqIfPresent(ElementDO::getDecimalValue, dto.getDecimalValue())
|
||||
.eqIfPresent(ElementDO::getCoding, dto.getCoding())
|
||||
.eqIfPresent(ElementDO::getGradeUnit, dto.getGradeUnit())
|
||||
.orderByDesc(ElementDO::getId));
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.zt.plat.module.base.service.base;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.module.api.dto.ElementDTO;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.ElementPageReqVO;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.ElementRespVO;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.ElementSaveReqVO;
|
||||
@@ -62,4 +63,6 @@ public interface ElementService {
|
||||
PageResult<ElementDO> getElementPage(ElementPageReqVO pageReqVO);
|
||||
|
||||
void enableElementList(List<ElementRespVO> saveReqVOS);
|
||||
|
||||
List<ElementDO> getElementNoPage(ElementDTO respVO);
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.zt.plat.module.base.service.base;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.module.api.dto.ElementDTO;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.ElementPageReqVO;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.ElementRespVO;
|
||||
import com.zt.plat.module.base.controller.admin.base.vo.ElementSaveReqVO;
|
||||
@@ -107,4 +108,9 @@ public class ElementServiceImpl implements ElementService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ElementDO> getElementNoPage(ElementDTO respVO) {
|
||||
return elementMapper.getElementNoPage(respVO);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user