package com.changhong.epc.tenant.controller.accounting;
|
|
import com.changhong.epc.bean.form.ProcessBudget;
|
import com.changhong.epc.constter.base.BaseConst;
|
import com.changhong.epc.constter.tenant.TenantUrlConst;
|
import com.changhong.epc.tenant.service.accounting.AccountingService;
|
import com.changhong.epc.tenant.service.org.impl.OrgFormatServiceImpl;
|
import com.iemsoft.framework.cloud.core.thread.ThreadData;
|
import org.springframework.web.bind.annotation.*;
|
|
import javax.annotation.Resource;
|
import java.util.ArrayList;
|
import java.util.HashMap;
|
import java.util.List;
|
import java.util.Map;
|
|
@RestController
|
public class AccountingController implements TenantUrlConst,BaseConst {
|
|
@Resource(name="accountingServiceImpl")
|
private AccountingService accountingService;
|
|
|
/**
|
* api数据源(临时数据)
|
*/
|
@RequestMapping(value="postapi" ,method = RequestMethod.POST)
|
public List<Map<String,String>> postapi(){
|
List<Map<String,String>> list = new ArrayList<Map<String,String>>();
|
for(int i=1; i<=3;i++){
|
Map<String,String> map = new HashMap<>();
|
map.put("tenantID", "00"+i);
|
map.put("openId", "10000"+i);
|
map.put("userName", "00"+i);
|
map.put("value", "Y-m-d");
|
list.add(map);
|
}
|
return list;
|
|
}
|
/**
|
* 暂时保留
|
* @return
|
*/
|
@RequestMapping(value="postapi" ,method = RequestMethod.GET)
|
public List<Map<String,String>> getapi(){
|
List<Map<String,String>> list = new ArrayList<Map<String,String>>();
|
for(int i=1; i<=3;i++){
|
Map<String,String> map = new HashMap<>();
|
map.put("tenantID", "00"+i);
|
map.put("openId", "10000"+i);
|
map.put("userName", "00"+i);
|
map.put("value", "Y-m-d");
|
list.add(map);
|
}
|
return list;
|
|
}
|
|
|
|
/**
|
* 记账接口
|
* @param str
|
* @return
|
*/
|
@PostMapping(ACCOUNTING_RECORD)
|
public int record(@RequestBody ProcessBudget processBudget){
|
return accountingService.record(processBudget);
|
}
|
|
@Resource(name = "orgFormatServiceImpl")
|
OrgFormatServiceImpl org;
|
/**
|
* 测试树结构api
|
*/
|
@GetMapping("gettree")
|
public Object getre(){
|
ThreadData.set(COMPANY_ID, 17);
|
return org.getFormatOrg();
|
}
|
|
|
}
|