package com.changhong.epc.rely.api.epc.admin;
|
|
import com.alibaba.fastjson.TypeReference;
|
import com.changhong.epc.bean.admin.BatchInitCompany;
|
import com.changhong.epc.bean.admin.CostTypeTemplate;
|
import com.changhong.epc.bean.admin.extend.CostTypeTemplateExtend;
|
import com.changhong.epc.bean.tenant.cost.CostFromMapping;
|
import com.changhong.epc.constter.admin.AdminUrlConst;
|
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.SpringUtil;
|
import com.iemsoft.framework.cloud.ribbon.RestInterface;
|
import org.springframework.stereotype.Service;
|
import org.springframework.ui.ModelMap;
|
|
import java.util.Collections;
|
import java.util.HashMap;
|
import java.util.List;
|
import java.util.Map;
|
|
import static com.changhong.epc.constter.admin.AdminUrlConst.REST_ADMIN_GET_COSTTYPE_TEMPLATE;
|
|
@Service
|
public class CostFromTemplateApi extends BaseApi implements SystemClients {
|
|
public CostTypeTemplateExtend getCostTypeTemplate(Integer ctId){
|
ResMsg<CostTypeTemplateExtend> resMsg =
|
(ResMsg<CostTypeTemplateExtend>)
|
SpringUtil.getBean(SERVER_ADMIN.getBeanName(), RestInterface.class)
|
.post(AdminUrlConst.REST_ADMIN_GET_COSTTYPE_TEMPLATE
|
, new CostTypeTemplate(ctId)
|
, new TypeReference<ResMsg<CostTypeTemplateExtend>>(){}.getType()
|
, EpcRestInterface.getEpcHeads()
|
);
|
assertSuccess(resMsg);
|
return resMsg.getData() == null ? new CostTypeTemplateExtend() : resMsg.getData();
|
}
|
|
/**
|
* 通过表单id查询费用类型
|
* @param formId
|
* @return
|
*/
|
public Map<String,String> getCostType(String formId,String dataRowNum){
|
ResMsg<Map<String,String>> resMsg =
|
(ResMsg<Map<String,String>>)
|
SpringUtil.getBean(SERVER_TENANT.getBeanName(), RestInterface.class)
|
.post(TenantUrlConst.REST_TENANT_COST_TYPE_BY_FORMID
|
, new ModelMap("fId",formId)
|
.addAttribute("dataRowNum",dataRowNum)
|
, new TypeReference<ResMsg<Map<String,String>>>() {
|
}.getType()
|
, EpcRestInterface.getEpcHeads()
|
);
|
assertSuccess(resMsg);
|
return resMsg.getData() == null ? new HashMap<>() : resMsg.getData();
|
}
|
|
}
|