新增-erp物料查询接口api,post改get

This commit is contained in:
liss
2025-11-03 16:30:49 +08:00
parent 189d2d6fb6
commit 79fa52f39c
5 changed files with 13 additions and 20 deletions

View File

@@ -13,6 +13,7 @@ import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@@ -35,7 +36,7 @@ public interface ErpExternalApi {
@Operation(summary = "生产版本数据查询") @Operation(summary = "生产版本数据查询")
CommonResult<String> getErpProductiveVersionByFM(@Valid @RequestBody ErpProductiveVersionReqDTO reqDTO); CommonResult<String> getErpProductiveVersionByFM(@Valid @RequestBody ErpProductiveVersionReqDTO reqDTO);
@PostMapping(PREFIX + "/queryMaterial") @GetMapping(PREFIX + "/getMaterialUnit")
@Operation(summary = "物料数据查询") @Operation(summary = "根据物料编码查询对应计量单位")
CommonResult<ErpMaterialDTO> getErpMaterial(@Valid @RequestBody ErpMaterialDTO reqDTO); CommonResult<String> getMaterialUnit(@RequestParam("downCenterNumber") String downCenterNumber);
} }

View File

@@ -60,8 +60,8 @@ public class ErpExternalApiImpl implements ErpExternalApi {
} }
@Override @Override
public CommonResult<ErpMaterialDTO> getErpMaterial(ErpMaterialDTO reqDTO) { public CommonResult<String> getMaterialUnit(String materialNumber) {
ErpMaterialDTO dto = erpMaterialService.getErpMaterial(reqDTO); String materialUnit = erpMaterialService.getMaterialUnit(materialNumber);
return success(dto); return success(materialUnit);
} }
} }

View File

@@ -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.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; 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.controller.admin.erp.vo.ErpMaterialPageReqVO;
import com.zt.plat.module.erp.dal.dataobject.erp.ErpMaterialDO; import com.zt.plat.module.erp.dal.dataobject.erp.ErpMaterialDO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@@ -43,9 +42,9 @@ public interface ErpMaterialMapper extends BaseMapperX<ErpMaterialDO> {
Integer countByErpMNumbers(List<String> erpMNumber); Integer countByErpMNumbers(List<String> erpMNumber);
default ErpMaterialDO selectOne(ErpMaterialDTO dto) { default String getMaterialUnit(String downCenterNumber) {
return selectOne(new LambdaQueryWrapperX<ErpMaterialDO>() return selectOne(new LambdaQueryWrapperX<ErpMaterialDO>()
.eq(ErpMaterialDO::getDownCenterNumber, dto.getDownCenterNumber()) .eq(ErpMaterialDO::getDownCenterNumber, downCenterNumber)
.last("limit 1")); .last("limit 1")).getUnit();
} }
} }

View File

@@ -66,11 +66,5 @@ public interface ErpMaterialService {
PageResult<ErpMaterialRespVO> getErpMaterialPageAndOther(ErpMaterialPageReqVO pageReqVO); PageResult<ErpMaterialRespVO> getErpMaterialPageAndOther(ErpMaterialPageReqVO pageReqVO);
/** String getMaterialUnit(String materialNumber);
* 获得ERP物料数据
*
* @param DTO
* @return ERP物料数据
*/
ErpMaterialDTO getErpMaterial(ErpMaterialDTO DTO);
} }

View File

@@ -177,9 +177,8 @@ public class ErpMaterialServiceImpl implements ErpMaterialService {
} }
@Override @Override
public ErpMaterialDTO getErpMaterial(ErpMaterialDTO DTO) { public String getMaterialUnit(String materialNumber) {
ErpMaterialDO erpMaterialDO = erpMaterialMapper.selectOne(DTO); return erpMaterialMapper.getMaterialUnit(materialNumber);
return BeanUtils.toBean(erpMaterialDO, ErpMaterialDTO.class);
} }
@Override @Override