package com.changhong.autoform.rest.define; import java.util.List; import javax.annotation.Resource; 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.RestController; import com.changhong.autoform.constant.data.DataUrl; import com.changhong.autoform.entity.CodeAndValueBean; import com.changhong.autoform.entity.MasterData; import com.changhong.autoform.entity.MasterDefineEntity; import com.changhong.autoform.entity.MasterElementEntity; import com.changhong.autoform.entity.MasterValue; import com.changhong.autoform.entity.MasterValueEntity; import com.changhong.autoform.entity.system.RestResult; import com.changhong.autoform.entity.system.RestResultGenerator; import com.changhong.autoform.service.define.DefineService; @RestController @RequestMapping(method=RequestMethod.POST) public class DefineRest implements DataUrl{ @Resource private DefineService defineService; //在创建表单数据时查询主数据定义 @RequestMapping(MAINDATA_DEFINE) public RestResult> selectAllMainDefData(@RequestBody MasterData materData){ return RestResultGenerator.ok(defineService.selectAllMainDef(materData)); } //在创建表单数据时搜索框中查询主数据元素 @RequestMapping(SEARCHMAINDATA_DEFINE) public RestResult> searchMainElement(@RequestBody MasterData materData){ return RestResultGenerator.ok(defineService.searchMainElement(materData)); } //在新建数据时查询主数据元素 @RequestMapping(SELECT_MAINELEMENTS) public RestResult> selectCreateMainValue(@RequestBody MasterValue masterValue){ return RestResultGenerator.ok(defineService.selectCreateMainValue(masterValue)); } //根据主数据值的code TO NAME @RequestMapping(MASTER_VALUE_CODE_TO_NAME) public RestResult masterValueCodeToName(@RequestBody MasterValue masterValue){ return RestResultGenerator.ok(defineService.masterValueCodeToName(masterValue)); } }