新增-erp物料查询接口api,post改get
This commit is contained in:
@@ -13,6 +13,7 @@ import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -35,7 +36,7 @@ public interface ErpExternalApi {
|
||||
@Operation(summary = "生产版本数据查询")
|
||||
CommonResult<String> getErpProductiveVersionByFM(@Valid @RequestBody ErpProductiveVersionReqDTO reqDTO);
|
||||
|
||||
@PostMapping(PREFIX + "/queryMaterial")
|
||||
@Operation(summary = "物料数据查询")
|
||||
CommonResult<ErpMaterialDTO> getErpMaterial(@Valid @RequestBody ErpMaterialDTO reqDTO);
|
||||
@GetMapping(PREFIX + "/getMaterialUnit")
|
||||
@Operation(summary = "根据物料编码查询对应计量单位")
|
||||
CommonResult<String> getMaterialUnit(@RequestParam("downCenterNumber") String downCenterNumber);
|
||||
}
|
||||
|
||||
@@ -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