package com.vci.web.controller; import java.util.Collection; import java.util.List; import com.vci.pagemodel.KeyValue; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import com.vci.starter.web.pagemodel.*; import com.vci.pagemodel.BdSelectInputCharVO; import com.vci.dto.BdSelectInputCharDTO; import com.vci.web.service.BdSelectInputCharServiceI; import com.vci.starter.web.util.*; /** * 可输可选内容控制器 * * @author weidy * @date 2022-03-09 */ @RestController @RequestMapping("/bdSelectInputController") public class BdSelectInputCharController { /** * 可输可选内容 服务 */ @Autowired private BdSelectInputCharServiceI bdSelectInputCharService; /** * 可输可选内容列表 * @param baseQueryObject 基础查询对象,包含查询条件,分页,排序等 * @return 可输可选内容显示对象列表 */ @GetMapping("/gridBdSelectInputChar") public DataGrid gridBdSelectInputChar(BaseQueryObject baseQueryObject){ if(baseQueryObject == null){ baseQueryObject = new BaseQueryObject(); } return bdSelectInputCharService.gridBdSelectInputChar(baseQueryObject.getConditionMap(),baseQueryObject.getPageHelper()); } /** * 增加 可输可选内容 * @param bdSelectInputCharDTO 可输可选内容数据传输对象 * @return 执行结果,success为true表示成功,msg是失败的提示信息,obj是添加完成后的显示对象 */ @PostMapping( "/addSave") public BaseResult addSave(@RequestBody BdSelectInputCharDTO bdSelectInputCharDTO){ BdSelectInputCharVO bdSelectInputCharVO = bdSelectInputCharService.addSave(bdSelectInputCharDTO); return BaseResult.success(bdSelectInputCharVO); } /** * 修改 可输可选内容 * @param bdSelectInputCharDTO 可输可选内容数据传输对象 * @return 执行结果,success为true表示成功,msg是失败的提示信息,obj是添加完成后的显示对象 */ @PutMapping("/editSave") public BaseResult editSave(@RequestBody BdSelectInputCharDTO bdSelectInputCharDTO){ BdSelectInputCharVO bdSelectInputCharVO = bdSelectInputCharService.editSave(bdSelectInputCharDTO); return BaseResult.success(bdSelectInputCharVO); } /** * 删除可输可选内容 * @param bdSelectInputCharDTO 可输可选内容数据传输对象,oid和ts需要传输 * @return 删除结果反馈::success:成功,fail:失败 */ @DeleteMapping( "/deleteData") public BaseResult delBdSelectInputChar( BdSelectInputCharDTO bdSelectInputCharDTO) { return bdSelectInputCharService.deleteBdSelectInputChar(bdSelectInputCharDTO); } /** * 主键获取可输可选内容 * @param oid 主键 * @return 可输可选内容显示对象 */ @GetMapping("/getObjectByOid") public BaseResult getObjectByOid(String oid){ BdSelectInputCharVO bdSelectInputCharVO = bdSelectInputCharService.getObjectByOid(oid); return BaseResult.success(bdSelectInputCharVO); } /** * 主键批量获取可输可选内容 * @param oids 主键,多个以逗号分隔,但是受性能影响,建议一次查询不超过10000个 * @return 可输可选内容显示对象 */ @GetMapping("/listDataByOids") public BaseResult listBdSelectInputCharByOids(String oids){ Collection voCollection = bdSelectInputCharService.listBdSelectInputCharByOids(VciBaseUtil.str2List(oids)); BaseResult baseResult = BaseResult.success(); baseResult.setData(voCollection); return baseResult; } /** * 参照可输可选内容列表 * @param baseQueryObject 基础查询对象,包含查询条件,分页,排序等 * @return 可输可选内容显示对象列表,生效的内容 */ @GetMapping("/refDataGrid") public DataGrid refDataGridBdSelectInputChar(BaseQueryObject baseQueryObject){ if(baseQueryObject == null){ baseQueryObject = new BaseQueryObject(); } return bdSelectInputCharService.refDataGridBdSelectInputChar(baseQueryObject.getConditionMap(),baseQueryObject.getPageHelper()); } /** * 获取可选择的列表 * @param flag 标记 * @param namespace 命名空间 * @return 包含的内容 */ @GetMapping("/listByFlag") public BaseResult> listByFlag(String namespace,String flag){ return BaseResult.success(bdSelectInputCharService.listByFlag(namespace,flag)); } }