mirror of
https://gitee.com/egzosn/pay-java-parent.git
synced 2026-05-07 19:46:15 +08:00
代码优化
This commit is contained in:
@@ -277,7 +277,7 @@ public class AliPayService extends BasePayService<AliPayConfigStorage> {
|
||||
|
||||
for (Map.Entry<String, Object> entry : orderInfo.entrySet()) {
|
||||
Object o = entry.getValue();
|
||||
if (null == o || "null".equals(o) || "".equals(o)) {
|
||||
if (StringUtils.isEmpty((String)o) || "null".equals(o) ) {
|
||||
continue;
|
||||
}
|
||||
formHtml.append("<input type=\"hidden\" name=\"" + entry.getKey() + "\" value=\"" + o + "\"/>");
|
||||
|
||||
@@ -133,7 +133,7 @@ public abstract class BasePayService<PC extends PayConfigStorage> implements Pay
|
||||
|
||||
Map<String, Object> params = new TreeMap<String,Object>();
|
||||
for (Map.Entry<String, String[]> entry : parameterMap.entrySet()) {
|
||||
String name = (String) entry.getKey();
|
||||
String name = entry.getKey();
|
||||
String[] values = entry.getValue();
|
||||
String valueStr = "";
|
||||
for (int i = 0,len = values.length; i < len; i++) {
|
||||
|
||||
@@ -88,7 +88,7 @@ public class UriVariables {
|
||||
public static String getMapToParameters(Map pe){
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (Map.Entry entry : (Set<Map.Entry>)pe.entrySet()) {
|
||||
Object o = entry.getKey();
|
||||
Object o = entry.getValue();
|
||||
|
||||
if (null == o) {
|
||||
continue;
|
||||
|
||||
@@ -433,12 +433,9 @@ public class UnionPayService extends BasePayService<UnionPayConfigStorage> {
|
||||
sf.append("<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=" + payConfigStorage.getInputCharset() + "\"/></head><body>");
|
||||
sf.append("<form id = \"pay_form\" action=\"" + getFrontTransUrl() + "\" method=\"post\">");
|
||||
if (null != orderInfo && 0 != orderInfo.size()) {
|
||||
Set<Map.Entry<String, Object>> set = orderInfo.entrySet();
|
||||
Iterator<Map.Entry<String, Object>> it = set.iterator();
|
||||
while (it.hasNext()) {
|
||||
Map.Entry<String, Object> ey = it.next();
|
||||
String key = ey.getKey();
|
||||
Object value = ey.getValue();
|
||||
for ( Map.Entry<String, Object> entry: orderInfo.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
Object value = entry.getValue();
|
||||
sf.append("<input type=\"hidden\" name=\"" + key + "\" id=\"" + key + "\" value=\"" + value + "\"/>");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user