package com.changhong.epc.rely.api.epc.tenant; import com.alibaba.fastjson.TypeReference; import com.changhong.epc.bean.tenant.cost.CostFromMapping; import com.changhong.epc.constter.system.SystemClients; import com.changhong.epc.constter.system.run.EpcRestInterface; import com.changhong.epc.constter.tenant.TenantUrlConst; 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 java.util.Collections; import java.util.List; /** * 费用类型对应表单列表 */ @Service public class CostFromMappingApi implements SystemClients { /** * 获得费用类型对应表单列表 * @param formId * @return */ public List getConstFromMappings(String formId){ CostFromMapping costFromMapping = new CostFromMapping(); costFromMapping.setFId(formId); ResMsg> resMsg = (ResMsg>) SpringUtil.getBean(SERVER_TENANT.getBeanName(), RestInterface.class).post( TenantUrlConst.REST_TENANT_COSTFORM_BY_FORMID , costFromMapping , new TypeReference>>(){}.getType() , EpcRestInterface.getEpcHeads()); List costFromMappingList = JSONTool.toList(JSONTool.toJson(resMsg.getData()), CostFromMapping.class); return costFromMappingList == null ? Collections.emptyList() : costFromMappingList; } }