commit | author | age
|
a18bfa
|
1 |
package com.changhong.epc.rely.api.epc.admin; |
Z |
2 |
|
|
3 |
import com.alibaba.fastjson.TypeReference; |
|
4 |
import com.changhong.epc.bean.admin.BatchInitCompany; |
|
5 |
import com.changhong.epc.bean.admin.CostTypeTemplate; |
|
6 |
import com.changhong.epc.bean.admin.extend.CostTypeTemplateExtend; |
|
7 |
import com.changhong.epc.bean.tenant.cost.CostFromMapping; |
|
8 |
import com.changhong.epc.constter.admin.AdminUrlConst; |
|
9 |
import com.changhong.epc.constter.system.SystemClients; |
|
10 |
import com.changhong.epc.constter.system.run.EpcRestInterface; |
|
11 |
import com.changhong.epc.constter.tenant.TenantUrlConst; |
|
12 |
import com.changhong.epc.rely.api.epc.BaseApi; |
|
13 |
import com.iemsoft.framework.cloud.core.base.ResMsg; |
|
14 |
import com.iemsoft.framework.cloud.core.tools.SpringUtil; |
|
15 |
import com.iemsoft.framework.cloud.ribbon.RestInterface; |
|
16 |
import org.springframework.stereotype.Service; |
|
17 |
import org.springframework.ui.ModelMap; |
|
18 |
|
|
19 |
import java.util.Collections; |
|
20 |
import java.util.HashMap; |
|
21 |
import java.util.List; |
|
22 |
import java.util.Map; |
|
23 |
|
|
24 |
import static com.changhong.epc.constter.admin.AdminUrlConst.REST_ADMIN_GET_COSTTYPE_TEMPLATE; |
|
25 |
|
|
26 |
@Service |
|
27 |
public class CostFromTemplateApi extends BaseApi implements SystemClients { |
|
28 |
|
|
29 |
public CostTypeTemplateExtend getCostTypeTemplate(Integer ctId){ |
|
30 |
ResMsg<CostTypeTemplateExtend> resMsg = |
|
31 |
(ResMsg<CostTypeTemplateExtend>) |
|
32 |
SpringUtil.getBean(SERVER_ADMIN.getBeanName(), RestInterface.class) |
|
33 |
.post(AdminUrlConst.REST_ADMIN_GET_COSTTYPE_TEMPLATE |
|
34 |
, new CostTypeTemplate(ctId) |
|
35 |
, new TypeReference<ResMsg<CostTypeTemplateExtend>>(){}.getType() |
|
36 |
, EpcRestInterface.getEpcHeads() |
|
37 |
); |
|
38 |
assertSuccess(resMsg); |
|
39 |
return resMsg.getData() == null ? new CostTypeTemplateExtend() : resMsg.getData(); |
|
40 |
} |
|
41 |
|
|
42 |
/** |
|
43 |
* 通过表单id查询费用类型 |
|
44 |
* @param formId |
|
45 |
* @return |
|
46 |
*/ |
|
47 |
public Map<String,String> getCostType(String formId,String dataRowNum){ |
|
48 |
ResMsg<Map<String,String>> resMsg = |
|
49 |
(ResMsg<Map<String,String>>) |
|
50 |
SpringUtil.getBean(SERVER_TENANT.getBeanName(), RestInterface.class) |
|
51 |
.post(TenantUrlConst.REST_TENANT_COST_TYPE_BY_FORMID |
|
52 |
, new ModelMap("fId",formId) |
|
53 |
.addAttribute("dataRowNum",dataRowNum) |
|
54 |
, new TypeReference<ResMsg<Map<String,String>>>() { |
|
55 |
}.getType() |
|
56 |
, EpcRestInterface.getEpcHeads() |
|
57 |
); |
|
58 |
assertSuccess(resMsg); |
|
59 |
return resMsg.getData() == null ? new HashMap<>() : resMsg.getData(); |
|
60 |
} |
|
61 |
|
|
62 |
} |