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>> getAssociateDataSourse(){ List> result = null ; List 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> getAssociateData(@RequestBody BudgetData budgetData){ Map result = null; List 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> getAssociateTitle(@RequestBody Map key){ List result = null; List 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 processBudget(@RequestBody ProcessBudget processBudget){ List executes = SpringUtil.getBeans(Execute.class); Boolean result = false; result = executes.get(0).executeProcessBudget(processBudget); return RestResultGenerator.ok(result); } @RequestMapping(FORM_DATA_REFUNDS) public RestResult processRefunds(@RequestBody ProcessBudget processBudget){ List executes = SpringUtil.getBeans(Execute.class); Boolean result = false; result = executes.get(0).processRefunds(processBudget); return RestResultGenerator.ok(result); } }