zm
2020-05-18 a18bfacbf56b401f6e0fdae8710fbca4df8cff77
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package com.changhong.epc.form.service.budget.impl;
 
import com.changhong.epc.bean.form.FormType;
import com.changhong.epc.bean.tenant.cost.budgetlog.IBillCostLog;
import com.changhong.epc.bean.tenant.cost.budgetlog.MoneyBudgetLog;
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.SpringUtil;
import com.iemsoft.framework.cloud.ribbon.RestInterface;
 
public class RecordLog implements SystemClients{
    
    public static Object getPostRest(String url,Object parm){
        
        RestInterface restInterface = SpringUtil.getBean(SERVER_TENANT.getBeanName(), RestInterface.class);
        Object data = restInterface.post(url, parm, ResMsg.class, EpcRestInterface.getEpcHeads()).getData();
        return data;
    }
    
    /**
     * 记录扩展日志
     * @param budgetLog
     */
    public static void recordExtendLog(MoneyBudgetLog budgetLog){
        getPostRest(TenantUrlConst.REST_TENANT_COST_RECORDLOG_YS, budgetLog);
    }
    
    public static void recordFormUpdateLog(FormType formType, IBillCostLog billCostLog){
        switch (formType) {
        case YS:
            getPostRest(TenantUrlConst.REST_TENANT_COST_RECORDLOG_YS, billCostLog);
            break;
        case SQ:
            getPostRest(TenantUrlConst.REST_TENANT_COST_RECORDLOG_SQ, billCostLog);
            break;
        case BX:
            getPostRest(TenantUrlConst.REST_TENANT_COST_RECORDLOG_BX, billCostLog);
            break;
        
        default:
            break;
        }
    }
    
}