package com.changhong.autoform.rest.associateDataSourse;
|
|
import java.util.List;
|
import java.util.Map;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RestController;
|
|
import com.changhong.autoform.entity.BudgetData;
|
import com.changhong.autoform.entity.BudgetTitle;
|
import com.changhong.autoform.entity.ProcessBudget;
|
import com.changhong.autoform.entity.system.RestResult;
|
import com.changhong.autoform.entity.system.RestResultGenerator;
|
import com.changhong.autoform.mapper.associate.Associate;
|
import com.changhong.autoform.rest.excute.Execute;
|
import com.iemsoft.framework.cloud.core.tools.SpringUtil;
|
import com.changhong.autoform.constant.data.DataUrl;
|
import com.changhong.autoform.core.msg.StateMsg;
|
|
@RestController
|
@RequestMapping(method=RequestMethod.POST)
|
public class AssociateDataSourseRest implements DataUrl{
|
|
|
@RequestMapping(SELECT_ASSOCIATEDATASOURSE)
|
public RestResult<List<Map<String, Object>>> getAssociateDataSourse(){
|
List<Map<String, Object>> result = null ;
|
List<Associate> associate = SpringUtil.getBeans(Associate.class);
|
try {
|
result = (associate.get(0) != null ? associate.get(0).getAssociateDataSourse() : null);
|
} catch (Exception e1) {
|
e1.printStackTrace();
|
}
|
return RestResultGenerator.ok(result);
|
}
|
|
@RequestMapping(SELECT_ASSOCIATEDATA)
|
public RestResult<Map<String, Object>> getAssociateData(@RequestBody BudgetData budgetData){
|
Map<String, Object> result = null;
|
List<Associate> associate = SpringUtil.getBeans(Associate.class);
|
try {
|
result = (associate.get(0) != null ? associate.get(0).getAssociateData(budgetData) : null);
|
} catch (Exception e1) {
|
e1.printStackTrace();
|
}
|
return RestResultGenerator.ok(result);
|
}
|
|
@RequestMapping(SELECT_ASSOCIATETITLE)
|
public RestResult<List<BudgetTitle>> getAssociateTitle(@RequestBody Map<String, Object> key){
|
List<BudgetTitle> result = null;
|
List<Associate> associate = SpringUtil.getBeans(Associate.class);
|
try {
|
result = (associate.get(0) != null ? associate.get(0).getAssociateTitle(key.get("key").toString()) : null);
|
} catch (Exception e1) {
|
e1.printStackTrace();
|
}
|
return RestResultGenerator.ok(result);
|
}
|
|
|
@RequestMapping(FORM_DATA_BUDGET)
|
public RestResult<Boolean> processBudget(@RequestBody ProcessBudget processBudget){
|
List<Execute> executes = SpringUtil.getBeans(Execute.class);
|
Boolean result = false;
|
result = executes.get(0).executeProcessBudget(processBudget);
|
return RestResultGenerator.ok(result);
|
}
|
|
@RequestMapping(FORM_DATA_REFUNDS)
|
public RestResult<Boolean> processRefunds(@RequestBody ProcessBudget processBudget){
|
List<Execute> executes = SpringUtil.getBeans(Execute.class);
|
Boolean result = false;
|
result = executes.get(0).processRefunds(processBudget);
|
return RestResultGenerator.ok(result);
|
}
|
}
|