Commit df393f9a by 陶光胜

Merge branch 'developer' of…

Merge branch 'developer' of http://115.159.76.241/base_platform_enterprise/gic-platform-enterprise into developer
parents 19ee4f70 132182f6
......@@ -213,31 +213,26 @@ public class MarketServiceDTO implements Serializable{
return (String) json.get("200");
}
@SuppressWarnings("unchecked")
public static <K, V> Map<K, List<V>> group(List<V> list, String field) {
Map<K, List<V>> map = new HashMap();
if (list != null && !list.isEmpty()) {
Object v;
Object sublist;
for(Iterator var3 = list.iterator(); var3.hasNext(); ((List)sublist).add(v)) {
v = var3.next();
Object p = null;
try {
p = PropertyUtils.getProperty(v, field);
} catch (Exception var7) {
throw new RuntimeException(var7.getMessage(), var7);
}
sublist = (List)map.get(p);
if (sublist == null) {
sublist = new ArrayList();
map.put(p, sublist);
}
}
return map;
} else {
Map<K, List<V>> map = new HashMap<K, List<V>>();
if (list == null || list.isEmpty()) {
return map;
}
for (V v : list) {
K p = null;
try {
p = (K) PropertyUtils.getProperty(v, field);
} catch (Exception e) {
throw new RuntimeException(e.getMessage(), e);
}
List<V> sublist = map.get(p);
if (sublist == null) {
sublist = new ArrayList<V>();
map.put(p, sublist);
}
sublist.add(v);
}
return map;
}
}
......@@ -10,6 +10,7 @@ import java.util.Map;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import com.gic.enterprise.web.config.Config;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -58,9 +59,11 @@ public class BillingAccountController {
private MarketUserApiService marketUserApiService;
@Autowired
private AppTokenApiService appTokenApiService;
@Autowired
private Config config;
private static final String URL = "https://four.gicdev.com";
//private static final String URL = "https://four.gicdev.com";
/**
* 账户余额相关信息
......@@ -277,7 +280,7 @@ public class BillingAccountController {
ServiceResponse<String> result = marketUserApiService
.BindGicEnterprise(Long.valueOf(enterpriseId), null, null, null);
if (result.isSuccess()) {
return RestResponse.success(URL + "/market/gic" + "?loginKey=" + result.getResult()
return RestResponse.success(config.getHost() + "/market/gic" + "?loginKey=" + result.getResult()
+ "&enterpriseId=" + enterpriseId);
}
return EnterpriseRestResponse.failure(result);
......
......@@ -5,6 +5,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.gic.operation.web.config.Config;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -45,9 +46,11 @@ public class LoginController {
private UserApiService userApiService;
@Autowired
private MarketUserApiService marketUserApiService;
@Autowired
private Config config;
private static final String URL = "https://four.gicdev.com";
// private static final String URL = "https://four.gicdev.com";
/**
* 商户绑定服务市场
......@@ -80,7 +83,7 @@ public class LoginController {
ServiceResponse<String> result = marketUserApiService.BindGicEnterprise(Long.valueOf(enterpriseId), null, null,
null);
if (result.isSuccess()) {
return RestResponse.success(URL + "/market/gic" + "?loginKey=" + result.getResult()
return RestResponse.success(config.getHost() + "/market/gic" + "?loginKey=" + result.getResult()
+ "&enterpriseId=" + enterpriseId);
}
return EnterpriseRestResponse.failure(result);
......@@ -89,7 +92,7 @@ public class LoginController {
@RequestMapping("login-gic")
public RestResponse login(Integer enterpriseId, String redirectUrl) throws IOException {
if (StringUtils.isBlank(redirectUrl)) {
redirectUrl = URL + "/damo-system/overview/index";
redirectUrl = config.getHost() + "/damo-system/overview/index";
// redirectUrl = "https://four.gicdev.com/cost-center/billing-center/overview";
}
String token;
......@@ -165,7 +168,7 @@ public class LoginController {
//塞缓存
token = UserDetailUtils.setUserDetail(userDetail);
String SSO_LOGIN_URL = URL + "/gic-auth-web/login-for-operation";
String SSO_LOGIN_URL = config.getHost() + "/gic-auth-web/login-for-operation";
return RestResponse.success(SSO_LOGIN_URL + "?token=" + token + "&redirectUrl=" + redirectUrl);
}
return RestResponse.success();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment