记一次联调测试的锅, 从此再也不敢乱粘代码了...
private Map<String, String> generateParams(HandlingFeeReq reqData) { Map<String, String> params = new HashMap(); Field[] fieldArr = reqData.getClass().getDeclaredFields(); try { for (Field field : fieldArr) { field.setAccessible(true); if (field.get(reqData) != null && !"".equals(field.get(reqData).toString())) { params.put(field.getName(), field.get(reqData).toString()); } } } catch (IllegalAccessException e) { logger.error("参数转化异常, 参数:{}", JSON.toJSONString(params)); e.printStackTrace(); } return params; }