增加根据名称获取供应商或者客户信息的接口

This commit is contained in:
jishenghua
2025-10-10 22:03:53 +08:00
parent b513d57283
commit 69d351e119
4 changed files with 30 additions and 0 deletions

View File

@@ -508,4 +508,19 @@ public class SupplierController extends BaseController {
} }
} }
@GetMapping(value = "/getInfoByName")
@ApiOperation(value = "根据名称获取信息")
public String getInfoByName(@RequestParam("name") String name,
@RequestParam("type") String type,
HttpServletRequest request) throws Exception {
Supplier supplier = supplierService.getInfoByName(name, type);
Map<String, Object> objectMap = new HashMap<>();
if(supplier != null) {
objectMap.put("info", supplier);
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
} else {
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
}
}
} }

View File

@@ -39,4 +39,8 @@ public interface SupplierMapperEx {
Supplier getInfoById( Supplier getInfoById(
@Param("id") Long id); @Param("id") Long id);
Supplier getInfoByName(
@Param("name") String name,
@Param("type") String type);
} }

View File

@@ -700,4 +700,8 @@ public class SupplierService {
public List<SupplierSimple> getAllCustomer() { public List<SupplierSimple> getAllCustomer() {
return supplierMapperEx.getAllCustomer(); return supplierMapperEx.getAllCustomer();
} }
public Supplier getInfoByName(String name, String type) {
return supplierMapperEx.getInfoByName(name, type);
}
} }

View File

@@ -102,4 +102,11 @@
where id = #{id} where id = #{id}
and ifnull(delete_flag,'0') !='1' and ifnull(delete_flag,'0') !='1'
</select> </select>
<select id="getInfoByName" resultType="com.jsh.erp.datasource.entities.Supplier">
select id, supplier from jsh_supplier
where supplier = #{name} and type = #{type}
and ifnull(delete_flag,'0') !='1'
limit 1
</select>
</mapper> </mapper>