增加根据名称获取供应商或者客户信息的接口
This commit is contained in:
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
@@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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>
|
||||||
Reference in New Issue
Block a user