新增-erp物料查询接口api,post改get
This commit is contained in:
@@ -60,8 +60,8 @@ public class ErpExternalApiImpl implements ErpExternalApi {
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<ErpMaterialDTO> getErpMaterial(ErpMaterialDTO reqDTO) {
|
||||
ErpMaterialDTO dto = erpMaterialService.getErpMaterial(reqDTO);
|
||||
return success(dto);
|
||||
public CommonResult<String> getMaterialUnit(String materialNumber) {
|
||||
String materialUnit = erpMaterialService.getMaterialUnit(materialNumber);
|
||||
return success(materialUnit);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.zt.plat.module.erp.dal.mysql.erp;
|
||||
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.erp.api.dto.ErpMaterialDTO;
|
||||
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpMaterialPageReqVO;
|
||||
import com.zt.plat.module.erp.dal.dataobject.erp.ErpMaterialDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
@@ -43,9 +42,9 @@ public interface ErpMaterialMapper extends BaseMapperX<ErpMaterialDO> {
|
||||
|
||||
Integer countByErpMNumbers(List<String> erpMNumber);
|
||||
|
||||
default ErpMaterialDO selectOne(ErpMaterialDTO dto) {
|
||||
default String getMaterialUnit(String downCenterNumber) {
|
||||
return selectOne(new LambdaQueryWrapperX<ErpMaterialDO>()
|
||||
.eq(ErpMaterialDO::getDownCenterNumber, dto.getDownCenterNumber())
|
||||
.last("limit 1"));
|
||||
.eq(ErpMaterialDO::getDownCenterNumber, downCenterNumber)
|
||||
.last("limit 1")).getUnit();
|
||||
}
|
||||
}
|
||||
@@ -66,11 +66,5 @@ public interface ErpMaterialService {
|
||||
|
||||
PageResult<ErpMaterialRespVO> getErpMaterialPageAndOther(ErpMaterialPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得ERP物料数据
|
||||
*
|
||||
* @param DTO
|
||||
* @return ERP物料数据
|
||||
*/
|
||||
ErpMaterialDTO getErpMaterial(ErpMaterialDTO DTO);
|
||||
String getMaterialUnit(String materialNumber);
|
||||
}
|
||||
@@ -177,9 +177,8 @@ public class ErpMaterialServiceImpl implements ErpMaterialService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ErpMaterialDTO getErpMaterial(ErpMaterialDTO DTO) {
|
||||
ErpMaterialDO erpMaterialDO = erpMaterialMapper.selectOne(DTO);
|
||||
return BeanUtils.toBean(erpMaterialDO, ErpMaterialDTO.class);
|
||||
public String getMaterialUnit(String materialNumber) {
|
||||
return erpMaterialMapper.getMaterialUnit(materialNumber);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user