package com.changhong.epc.rely.api.epc.tenant;
|
|
import com.alibaba.fastjson.TypeReference;
|
import com.changhong.epc.bean.tenant.cost.CostType;
|
import com.changhong.epc.constter.system.SystemClients;
|
import com.changhong.epc.constter.system.run.EpcRestInterface;
|
import com.changhong.epc.constter.tenant.TenantUrlConst;
|
import com.changhong.epc.rely.api.epc.BaseApi;
|
import com.iemsoft.framework.cloud.core.base.ResMsg;
|
import com.iemsoft.framework.cloud.core.tools.JSONTool;
|
import com.iemsoft.framework.cloud.core.tools.SpringUtil;
|
import com.iemsoft.framework.cloud.ribbon.RestInterface;
|
import org.springframework.stereotype.Service;
|
import org.springframework.ui.ModelMap;
|
|
import java.util.ArrayList;
|
import java.util.List;
|
|
/**
|
* 补助标准查询api
|
*/
|
@Service
|
public class NormApi extends BaseApi implements SystemClients {
|
|
public List<CostType> getAllNormCostType(){
|
ResMsg<List<CostType>> resMsg =
|
(ResMsg<List<CostType>>)
|
SpringUtil.getBean(SERVER_TENANT.getBeanName(), RestInterface.class)
|
.post(TenantUrlConst.REST_TENANT_NORM_COSTTYPE_IDS
|
, new ModelMap()
|
, new TypeReference<ResMsg<List<CostType>>>(){}.getType()
|
, EpcRestInterface.getEpcHeads()
|
);
|
assertSuccess(resMsg);
|
List<CostType> data = JSONTool.toList(JSONTool.toJson(resMsg.getData()), CostType.class);
|
return data == null ? new ArrayList<>() : data;
|
}
|
|
}
|