package com.changhong.epc.rely.api.service.impl;
|
|
import com.alibaba.fastjson.TypeReference;
|
import com.changhong.epc.bean.PageResult;
|
import com.changhong.epc.bean.tenant.system.permission.PowerKey;
|
import com.changhong.epc.constter.base.BaseConst;
|
import com.changhong.epc.constter.exception.EPCServiceException;
|
import com.changhong.epc.constter.system.prop.ChangHongProperties;
|
import com.changhong.epc.constter.system.prop.ChangHongProperties.PassPortName;
|
import com.changhong.epc.rely.api.bean.*;
|
import com.changhong.epc.rely.api.service.CscApiService;
|
import com.changhong.epc.rely.api.tool.CscUtils;
|
import com.changhong.epc.rely.api.tool.EpcApiHttp;
|
import com.changhong.epc.rely.api.tool.HttpUtil;
|
import com.iemsoft.framework.cloud.core.exception.IEMRuntimeException;
|
import com.iemsoft.framework.cloud.core.thread.ThreadData;
|
import com.iemsoft.framework.cloud.core.tools.JSONTool;
|
import com.iemsoft.framework.cloud.core.tools.ObjectUtil;
|
import com.iemsoft.framework.cloud.core.tools.SpringUtil;
|
import com.iemsoft.framework.cloud.core.tools.http.Http;
|
import com.iemsoft.framework.cloud.core.tools.http.IEMHttpException;
|
import com.iemsoft.framework.cloud.redis.annotation.CacheSave;
|
import com.netflix.hystrix.contrib.javanica.cache.annotation.CacheResult;
|
import lombok.Data;
|
import lombok.Setter;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.cache.annotation.Cacheable;
|
import org.springframework.stereotype.Service;
|
import org.springframework.ui.ModelMap;
|
|
import java.util.*;
|
import java.util.function.Predicate;
|
|
|
/**
|
* 云尚行api接口实现
|
* @author liush
|
*
|
*/
|
@Service
|
@Slf4j
|
public class CscApiServiceImpl implements CscApiService, BaseConst {
|
|
@Autowired
|
@Setter
|
private ChangHongProperties changHongProperties;
|
|
@Override
|
@CacheSave(time = 60 * 60 * 24)
|
public List<User> getUsers() {
|
return EpcApiHttp.post(this, PassPortName.FIND_USERS)
|
// return EpcApiHttp.post(this, "http://csza.chfcloud.com/csc-ie-user/rest/json/api/organization/findUserList")
|
.addUrlParam(CscUtils.getParam(
|
new ModelMap("flag", 2)
|
.addAttribute("orgCodes", getCompany().getOrgCode())
|
)
|
)
|
.execute(new TypeReference<Organizations>(){}.getType())
|
.map(Organizations::getUsers).orElse(Collections.emptyList());
|
}
|
|
@Override
|
public Optional<User> getUser(Predicate<User> filter) {
|
return SpringUtil.getBean(CscApiServiceImpl.class).getUsers()
|
// return getUsers()
|
.stream().filter(filter).findFirst();
|
}
|
|
//1.1
|
@Override
|
public Tenant findTenantCompanys(Integer tenantId) {
|
Tenant tenantCompanys;
|
try {
|
tenantCompanys = HttpUtil.post(changHongProperties.getPassUrl(PassPortName.FIND_TENANT_TENANTCOMPANYS, null)
|
, null
|
, CscUtils.getParam(new ModelMap("tenantId", tenantId))
|
, null, new TypeReference<Tenant>(){}.getType());
|
return tenantCompanys;
|
} catch (Exception e) {
|
log.error(e.getMessage(), e);
|
throw new IEMRuntimeException(C0002).setchildIEMExc(changHongProperties.getPassUrl(PassPortName.FIND_TENANT_TENANTCOMPANYS, null));
|
}
|
}
|
|
@Override
|
public Organization findOneOrgByOrgCode(String orgCode) {
|
List<Organization> organizations = findRelationDetail().getOrgs();
|
if(ObjectUtil.empty(organizations)){
|
return null;
|
}
|
Organization company = organizations.stream().findFirst().get();
|
if(ObjectUtil.empty(company) || ObjectUtil.empty(company.getChildren())){
|
return null;
|
}
|
for(Organization organization : company.getChildren()){
|
if(Objects.equals(organization.getCode(), orgCode)){
|
return organization;
|
}
|
}
|
return null;
|
}
|
|
//6.1
|
// @CacheSave(time = 60 * 60 * 24, tenant = false, company = false)
|
public TenantsAndCompanys findTenantsAndCompanys() {
|
TenantsAndCompanys tenantsAndCompanys;
|
try {
|
tenantsAndCompanys = HttpUtil.post(
|
// "http://csza.chfcloud.com/csc-ie-user/rest/json/api/user/findTenantsAndCompanys"
|
changHongProperties.getPassUrl(PassPortName.FIND_USER_TENANTSANDCOMPANYS, null)
|
, null, CscUtils.getParam(new ModelMap("openId",ThreadData.get(OPEN_ID)))
|
, null, new TypeReference<TenantsAndCompanys>(){}.getType());
|
if(tenantsAndCompanys==null){
|
return null;
|
}
|
return tenantsAndCompanys;
|
} catch (Exception e) {
|
log.error(e.getMessage(), e);
|
throw new EPCServiceException(N0002).setchildIEMExc(changHongProperties.getPassUrl(PassPortName.FIND_USER_TENANTSANDCOMPANYS, null));
|
}
|
}
|
|
//9.0
|
@Override
|
public Organizations getOrgsOfTree(String code) {
|
Organizations organizations = null;
|
try {
|
organizations = HttpUtil.post(changHongProperties.getPassUrl(PassPortName.GET_USER_ORGSOFTREE, null)
|
, null, CscUtils.getParam(new ModelMap("code", code)) //ThreadData.get(TENANT_ID) 应该传入的参数
|
, null, new TypeReference<Organizations>(){}.getType());
|
return organizations;
|
} catch (Exception e) {
|
log.error(e.getMessage(), e);
|
throw new IEMRuntimeException(C0002).setchildIEMExc(changHongProperties.getPassUrl(PassPortName.FIND_TENANT_ORGANIZATION, null));
|
}
|
|
}
|
|
//13.1
|
@CacheResult
|
@Override
|
public Organizations findRelationDetail() {
|
// System.out.println("公司Id:是"+ThreadData.get(COMPANY_ID));
|
|
Organizations orgs;
|
try {
|
orgs = HttpUtil.post(changHongProperties.getPassUrl(PassPortName.FIND_ORGANIZATION_RELATIONDETAIL, null)
|
, null, CscUtils.getParam(new ModelMap("companyId", ThreadData.get(COMPANY_ID)))
|
, null, new TypeReference<Organizations>(){}.getType());
|
return orgs;
|
} catch (Exception e) {
|
log.error(e.getMessage(), e);
|
throw new IEMRuntimeException(C0002).setchildIEMExc(changHongProperties.getPassUrl(PassPortName.FIND_ORGANIZATION_RELATIONDETAIL, null));
|
}
|
}
|
|
@Override
|
public Map<String, Object> orderAccount(Map<String, Object> map) {
|
Map<String, Object> orgs = new HashMap<String,Object>();
|
try {
|
orgs = HttpUtil.post(changHongProperties.getPassUrl(PassPortName.ORDER_ORDERACCOUNT, null)
|
, null, CscUtils.getParam(map)
|
, null, new TypeReference<Map<String,Object>>(){}.getType());
|
//findSystemList();
|
// System.err.println(orgs);
|
return orgs;
|
} catch (Exception e) {
|
log.error(e.getMessage(), e);
|
throw new IEMRuntimeException(C0002).setchildIEMExc(changHongProperties.getPassUrl(PassPortName.ORDER_ORDERACCOUNT, null));
|
// e.printStackTrace();
|
}
|
}
|
|
@Override
|
public Object orderRuleCheck(String orderCode) {
|
try {
|
Object asd = HttpUtil.post(changHongProperties.getPassUrl(PassPortName.ORDER_RULE_CHECK, null)
|
,null, CscUtils.getCloudParam(new ModelMap("orderCode", orderCode))
|
, null, new TypeReference<String>(){}.getType());
|
// System.out.println(JSONTool.toJson(asd));
|
return asd;
|
} catch (Exception e) {
|
log.error(e.getMessage(), e);
|
throw new IEMRuntimeException(C0002).setchildIEMExc(changHongProperties.getPassUrl(PassPortName.REST_TENANT_BILLDATA_BILLCORRECT, null));
|
}
|
}
|
|
//16.0
|
@Override
|
public Object getOrderPic(String orderCode) {
|
try {
|
Object pic = HttpUtil.post(changHongProperties.getPassUrl(PassPortName.GET_ORDERPIC, null)
|
,null, CscUtils.getCloudParam(new ModelMap("orderCode",orderCode))
|
, null, new TypeReference<Object>(){}.getType());
|
// System.err.println(JSONTool.toJson(pic));
|
return pic;
|
} catch (Exception e) {
|
log.error(e.getMessage(), e);
|
throw new IEMRuntimeException(C0002).setchildIEMExc(changHongProperties.getPassUrl(PassPortName.GET_ORDERPIC, null));
|
}
|
}
|
|
@Override
|
public Map<String, Object> orderTypeDefineList(Map<String, Object> reqData) {
|
Map<String, Object> managementData = null;
|
try {
|
managementData = HttpUtil.post(changHongProperties.getPassUrl(PassPortName.GET_ORDER_TYPEDEFINELIST, null)
|
, null, CscUtils.getCloudParam(reqData)
|
, null, new TypeReference<Map<String,Object>>(){}.getType());
|
// System.err.println(managementData);
|
return managementData;
|
} catch (Exception e) {
|
log.error(e.getMessage(), e);
|
throw new IEMRuntimeException(C0002).setchildIEMExc(changHongProperties.getPassUrl(PassPortName.GET_ORDER_TYPEDEFINELIST, null));
|
}
|
}
|
|
@Override
|
public Map<String, Object> busTypeByComp(Map<String, Object> reqData) {
|
Map<String,Object> appointData = null;
|
try {
|
appointData = HttpUtil.post(changHongProperties.getPassUrl(PassPortName.GET_BUS_TYPEBYCOMP, null)
|
, null, CscUtils.getCloudParam(reqData)
|
, null, new TypeReference<Map<String,Object>>(){}.getType());
|
// System.err.println(appointData);
|
if(!Objects.equals(appointData.get("rspCode"), "000000")){
|
throw new IEMRuntimeException(Objects.toString(appointData.get("rspDesc")));
|
}
|
return appointData;
|
} catch (Exception e) {
|
log.error(e.getMessage(), e);
|
throw new IEMRuntimeException(C0002).setchildIEMExc(changHongProperties.getPassUrl(PassPortName.GET_BUS_TYPEBYCOMP, null));
|
}
|
}
|
|
@Override
|
public Tenant getTenantAndCompany(Integer tenantId) {
|
return findTenantCompanys(tenantId);
|
|
}
|
|
@Override
|
public Tenant getTenantAndCompany(Integer tenantId,Integer companyId) {
|
return getTenantAndCompany(tenantId, company ->Objects.equals(company.getId(), companyId));
|
}
|
|
public Tenant getTenantAndCompany(Integer tenantId, CompareCompany compareCompany){
|
Tenant tenant = getTenantAndCompany(tenantId);
|
if(ObjectUtil.empty(tenant) || ObjectUtil.empty(tenant.getCompanys())){
|
return tenant;
|
}
|
for(Company comp : tenant.getCompanys()){
|
if(compareCompany.equ(comp)){
|
return new Tenant(tenant, comp);
|
}
|
}
|
return new Tenant(tenant, null);
|
}
|
|
/**
|
* 获取主数据定义
|
*/
|
@Override
|
public List<Map> getTenantDefine(Map<String, Object> map) {
|
Map<String,Object> appointData = null;
|
try {
|
appointData = HttpUtil.post(changHongProperties.getPassUrl(PassPortName.GET_TENANT_DEFINEMASTER, null)
|
, null, CscUtils.getCloudParam(map)
|
, null, new TypeReference<Map<String,Object>>(){}.getType());
|
// System.err.println("获取主数据定义:"+appointData);
|
Map<String,Object> define = JSONTool.toObj(JSONTool.toJson(appointData.get("data")),Map.class);
|
return JSONTool.toList(JSONTool.toJson(define.get("rows")),Map.class);
|
|
} catch (Exception e) {
|
log.error(e.getMessage(), e);
|
throw new IEMRuntimeException(C0002).setchildIEMExc(changHongProperties.getPassUrl(PassPortName.GET_TENANT_DEFINEMASTER, null));
|
}
|
}
|
|
/**
|
* 获取主数据元素
|
*/
|
@Override
|
public List<Map> getTenantEle(Map<String, Object> map) {
|
Map<String,Object> appointData = null;
|
try {
|
appointData = HttpUtil.post(changHongProperties.getPassUrl(PassPortName.GET_TENANT_ELEMASTER, null)
|
, null, CscUtils.getCloudParam(map)
|
, null, new TypeReference<Map<String,Object>>(){}.getType());
|
// System.err.println("获取主数据元素:"+JSONTool.toJson(appointData));
|
return JSONTool.toList(JSONTool.toJson(appointData.get("data")),Map.class);
|
} catch (Exception e) {
|
log.error(e.getMessage(), e);
|
throw new IEMRuntimeException(C0002).setchildIEMExc(changHongProperties.getPassUrl(PassPortName.GET_TENANT_ELEMASTER, null));
|
}
|
}
|
|
/**
|
* 获取主数据value
|
*/
|
@Override
|
public List<Map> getTenantValue(Map<String, Object> map) {
|
Map<String,Object> appointData = null;
|
try {
|
appointData = HttpUtil.post(changHongProperties.getPassUrl(PassPortName.GET_TENANT_VALUEMASTER, null)
|
, null, CscUtils.getCloudParam(map)
|
, null, new TypeReference<Map<String,Object>>(){}.getType());
|
// System.err.println("获取主数据值:"+JSONTool.toJson(appointData));
|
return JSONTool.toList(JSONTool.toJson(appointData.get("data")),Map.class);
|
} catch (Exception e) {
|
log.error(e.getMessage(), e);
|
throw new IEMRuntimeException(C0002).setchildIEMExc(changHongProperties.getPassUrl(PassPortName.GET_TENANT_VALUEMASTER, null));
|
}
|
}
|
|
/**
|
* 向租户云单添加人员
|
*/
|
@Override
|
public int addUserInfo(Map<String,Object> map) {
|
// System.out.println("入参:"+JSONTool.toJson(map));
|
//默认参数
|
map.put("platFrom","费用云系统");
|
Map<String,Object> res = null;
|
try {
|
res = HttpUtil.post(changHongProperties.getPassUrl(PassPortName.ADD_USER_USERTOCSC, null)
|
, null, CscUtils.getCloudParam(map)
|
, null, new TypeReference<Map<String,Object>>(){}.getType());
|
// System.out.println("返回结果:"+JSONTool.toJson(res));
|
return 1;
|
} catch (Exception e) {
|
log.error(e.getMessage(), e);
|
throw new IEMRuntimeException(C0002).setchildIEMExc(changHongProperties.getPassUrl(PassPortName.GET_TENANT_VALUEMASTER, null));
|
}
|
}
|
|
@Override
|
public Company getCompany() {
|
return findTenantsAndCompanys().getCompany();
|
}
|
|
@Override
|
public PowerKey getSubCompanySystem(Integer companyId) {
|
return Http.post(changHongProperties.getYsx()+"/csc-ie-user/rest/json/api/tenant/findSubCompanySystem", SubCompanyResult.class)
|
.addUrlParam(
|
CscUtils.getParam(
|
new ModelMap("companyId", companyId)
|
.addAttribute("appKey", changHongProperties.getPermissionAppKey())
|
)
|
)
|
.execute(SubCompanyResult.class)
|
.map(SubCompanyResult::getPremission)
|
.orElse(null);
|
}
|
|
public static void main(String... args){
|
CscApiService a = new CscApiServiceImpl(){
|
{
|
setChangHongProperties(new ChangHongProperties(){
|
{
|
setYsx("http://csza.chfcloud.com");
|
// setPermissionAppKey("951176a2b1fc4862ae997a5e80fc71ed");
|
setCscPrivateKey("fa5e4cca8dc79ad8aa333e867b2ecb10");
|
setCscId("1000000");
|
}
|
});
|
}
|
};
|
// System.out.println(JSONTool.toJson(a.getSubCompanySystem(439)));
|
a.initTenant(100000001);
|
}
|
|
@Data
|
public static class SubCompanyResult{
|
private PowerKey premission;
|
}
|
|
@Override
|
public PageResult<Tenant> getTenants(Tenant tenant) {
|
|
// return new PageResult<>(
|
// Arrays.asList(
|
// new Tenant(){
|
// {
|
// setId(1);
|
// setCode("1001");
|
// setName("租户1");
|
// }
|
// },
|
// new Tenant(){
|
// {
|
// setId(2);
|
// setCode("1002");
|
// setName("租户2");
|
// }
|
// },
|
// new Tenant(){
|
// {
|
// setId(3);
|
// setCode("1003");
|
// setName("租户3");
|
// }
|
// },
|
// new Tenant(){
|
// {
|
// setId(4);
|
// setCode("1004");
|
// setName("租户4");
|
// }
|
// },
|
// new Tenant(){
|
// {
|
// setId(5);
|
// setCode("1005");
|
// setName("租户5");
|
// }
|
// }
|
// )
|
// );
|
|
return (PageResult<Tenant>)Http.post(changHongProperties.getYsx()+"/csc-ie-user/rest/json/api/tenant/findTenantsPage", CscResult.class)
|
.addUrlParam(CscUtils.getParam(
|
new ModelMap("name", tenant.getName())
|
.addAttribute("pageNum", tenant.getPageNum())
|
.addAttribute("pageSize", tenant.getPageSize())
|
))
|
.execute(new TypeReference<CscResult<PageResult<Tenant>>>(){}.getType())
|
.map(CscResult::getData)
|
.orElse(new PageResult<>());
|
// return (PageResult<Tenant>)Http.post(changHongProperties.getYsx()+"/csc-ie-user/rest/json/api/tenant/findTenants", CscResult.class)
|
// .addUrlParam(CscUtils.getParam(new ModelMap()))
|
// .execute(new TypeReference<CscResult<PageResult<Tenant>>>(){}.getType())
|
// .map(CscResult::getData)
|
// .orElse(null);
|
}
|
|
@Override
|
public PageResult<Company> getCompanys(Company company){
|
// return new PageResult<>(
|
// Arrays.asList(
|
// new Company(){
|
// {
|
// setId(new Random().nextInt(1000));
|
// setCode(company.getTenantId()+"1001");
|
// setName("公司"+getCode());
|
// }
|
// },
|
// new Company(){
|
// {
|
// setId(new Random().nextInt(1000));
|
// setCode(company.getTenantId()+"1002");
|
// setName("公司"+getCode());
|
// }
|
// },
|
// new Company(){
|
// {
|
// setId(new Random().nextInt(1000));
|
// setCode(company.getTenantId()+"1003");
|
// setName("公司"+getCode());
|
// }
|
// },
|
// new Company(){
|
// {
|
// setId(new Random().nextInt(1000));
|
// setCode(company.getTenantId()+"1004");
|
// setName("公司"+getCode());
|
// }
|
// },
|
// new Company(){
|
// {
|
// setId(new Random().nextInt(1000));
|
// setCode(company.getTenantId()+"1005");
|
// setName("公司"+getCode());
|
// }
|
// }
|
// )
|
// );
|
|
return (PageResult<Company>)Http.post(changHongProperties.getYsx()+"/csc-ie-user/rest/json/api/tenant/findCompanysPage", CscResult.class)
|
.addUrlParam(CscUtils.getParam(
|
new ModelMap("tenantId", company.getTenantId())
|
.addAttribute("name", company.getName())
|
.addAttribute("pageNum", company.getPageNum())
|
.addAttribute("pageSize", company.getPageSize())
|
))
|
.execute(new TypeReference<CscResult<PageResult<Company>>>(){}.getType())
|
.map(CscResult::getData)
|
.orElse(new PageResult<>());
|
}
|
|
@Override
|
public void initTenant(Integer tenantId) {
|
Map<String, Object> res =
|
Http.post(changHongProperties.getYsx()+"/csc-ie-api/rest/json/fyyTenantInit", Map.class)
|
.addUrlParam(CscUtils.getParam(
|
new ModelMap("tenantId", tenantId)
|
// new ModelMap("tenantCode", "R00002")
|
, changHongProperties.getCscId()
|
, changHongProperties.getCscPrivateKey()
|
))
|
.execute(Map.class)
|
.orElse(new ModelMap());
|
if("000000".equals(res.get("rspCode"))){
|
throw new IEMHttpException(Objects.toString(res.get("rspDesc")));
|
}
|
}
|
|
@Override
|
public int updateUserName(Map<String,Object> userInfo) {
|
userInfo.put("openId",ThreadData.get(OPEN_ID));
|
int i = -1;
|
Map<String,Object> res = null;
|
try {
|
res = HttpUtil.post(changHongProperties.getPassUrl(PassPortName.UPDATE_USERINFO,
|
new ModelMap("token", ThreadData.get(TOKEN))
|
.addAttribute("livemode", changHongProperties.getSsoLivemode()))
|
, null, null
|
, userInfo, new TypeReference<Map<String,Object>>(){}.getType());
|
// System.out.println("返回结果:"+JSONTool.toJson(res));
|
if(res != null && res.get("result")!=null){
|
i = "200".equals(JSONTool.toObj(JSONTool.toJson(res.get("result")),Map.class).get("code"))?1:-1;
|
}
|
return i;
|
} catch (Exception e) {
|
log.error(e.getMessage(), e);
|
throw new IEMRuntimeException(C0002).setchildIEMExc(changHongProperties.getPassUrl(PassPortName.UPDATE_USERINFO, null));
|
}
|
}
|
|
@Override
|
@Cacheable
|
public TenantsAndCompanys findTenantAndOrg() {
|
return Http.post(changHongProperties.getPassUrl(PassPortName.FIND_TENANT_TENANTANDORG, null), TenantsAndCompanys.class)
|
.addUrlParam(CscUtils.getParam(new ModelMap()))
|
.execute(new TypeReference<TenantsAndCompanys>(){}.getType())
|
.orElse(new TenantsAndCompanys());
|
}
|
|
/**
|
* 自动创单
|
*/
|
@Override
|
public Map<String, Object> orderAccountFyy(Map<String, Object> map) {
|
try {
|
return HttpUtil.post(changHongProperties.getPassUrl(PassPortName.JSON_ORDER_ORDERACCOUNTFYY, null)
|
,null, CscUtils.getParam(map)
|
, null, new TypeReference<Map<String,Object>>(){}.getType());
|
} catch (Exception e) {
|
log.error(e.getMessage(), e);
|
throw new IEMRuntimeException(C0002)
|
.setchildIEMExc(changHongProperties.getPassUrl(PassPortName.JSON_ORDER_ORDERACCOUNTFYY, null))
|
.addSuper(e);
|
}
|
}
|
|
/**
|
* 创建订单
|
*/
|
@Override
|
public String addOrder(Map<String, Object> map) {
|
Map<String,Object> maps = null;
|
try {
|
maps = HttpUtil.post(changHongProperties.getPassUrl(PassPortName.JSON_ORDER_ADDORDER, null)
|
,null, CscUtils.getParam(map)
|
, null, new TypeReference<Map<String,Object>>(){}.getType());
|
log.debug("云上行返回数据:"+ JSONTool.toJson(maps));
|
} catch (Exception e) {
|
log.error(e.getMessage(), e);
|
throw new IEMRuntimeException(C0002).setchildIEMExc(changHongProperties.getPassUrl(PassPortName.FIND_TENANT_TENANTANDORG, null));
|
}
|
String res = Objects.toString(maps.get("orderCode"),null);
|
return res!=null?res:null;
|
}
|
|
@Override
|
public String getOrgVersion() {
|
Map<String,Object> maps;
|
try {
|
maps = HttpUtil.post(changHongProperties.getPassUrl(PassPortName.FIND_ORGANIZATION_VERSION, null)
|
,null, CscUtils.getParam(new ModelMap("companyId",ThreadData.get(COMPANY_ID)))
|
, null, new TypeReference<Map<String,Object>>(){}.getType());
|
log.debug("云上行返回数据:"+ JSONTool.toJson(maps));
|
if(maps == null){
|
return "";
|
}
|
} catch (Exception e) {
|
log.error(e.getMessage(), e);
|
throw new IEMRuntimeException(C0002).setchildIEMExc(changHongProperties.getPassUrl(PassPortName.FIND_TENANT_TENANTANDORG, null));
|
}
|
return Objects.toString(maps.get("version"),"");
|
}
|
|
@Override
|
public Map<String, Object> backRule(Map<String, Object> billInfo) {
|
Map<String,Object> maps;
|
try {
|
maps = HttpUtil.post(changHongProperties.getPassUrl(PassPortName.ORDER_BACKRULE, null)
|
,null, CscUtils.getParam(billInfo)
|
, null, new TypeReference<Map<String,Object>>(){}.getType());
|
log.debug("云上行返回数据:"+ JSONTool.toJson(maps));
|
} catch (Exception e) {
|
log.error(e.getMessage(), e);
|
throw new IEMRuntimeException(C0002).setchildIEMExc(changHongProperties.getPassUrl(PassPortName.ORDER_BACKRULE, null));
|
}
|
return maps;
|
}
|
|
@Override
|
public List<Company> getCompanyOrgs(Integer tenantId) {
|
return Http.post(changHongProperties.getYsx() + "/csc-ie-user/rest/json/api/tenant/findCompanysAndOrg", CscResult.class)
|
.addUrlParam(CscUtils.getParam(new ModelMap("tenantId", tenantId)))
|
.execute(new TypeReference<CscResult>(){}.getType())
|
.map(CscResult::getCompanys)
|
.orElse(Collections.EMPTY_LIST);
|
}
|
|
}
|
|