| | |
| | | package com.vci.ubcs.code.controller; |
| | | |
| | | |
| | | import com.vci.ubcs.code.service.CodeResembleRuleServiceI; |
| | | import com.vci.starter.web.pagemodel.BaseQueryObject; |
| | | import com.vci.starter.web.pagemodel.BaseResult; |
| | | import com.vci.starter.web.pagemodel.DataGrid; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.ubcs.code.dto.CodeResembleRuleDTO; |
| | | import com.vci.ubcs.code.service.ICodeResembleRuleService; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeResembleRuleVO; |
| | | import com.vci.ubcs.starter.web.pagemodel.BaseQueryObject; |
| | | import com.vci.ubcs.starter.web.pagemodel.DataGrid; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Collection; |
| | | |
| | | /** |
| | |
| | | @RestController |
| | | @RequestMapping("/resembleRuleController") |
| | | public class CodeResembleRuleController { |
| | | /** |
| | | * 相似查询规则 服务 |
| | | */ |
| | | @Autowired |
| | | private CodeResembleRuleServiceI codeResembleRuleService; |
| | | /** |
| | | * 相似查询规则 服务 |
| | | */ |
| | | @Resource |
| | | private ICodeResembleRuleService codeResembleRuleService; |
| | | |
| | | /** |
| | | * 相似查询规则列表 |
| | | * @param baseQueryObject 基础查询对象,包含查询条件,分页,排序等 |
| | | * @return 相似查询规则显示对象列表 |
| | | */ |
| | | @GetMapping("/gridCodeResembleRule") |
| | | public DataGrid<CodeResembleRuleVO> gridCodeResembleRule(BaseQueryObject baseQueryObject){ |
| | | if(baseQueryObject == null){ |
| | | baseQueryObject = new BaseQueryObject(); |
| | | } |
| | | return codeResembleRuleService.gridCodeResembleRule(baseQueryObject.getConditionMap(),baseQueryObject.getPageHelper()); |
| | | } |
| | | /** |
| | | * 增加 相似查询规则 |
| | | * @param codeResembleRuleDTO 相似查询规则数据传输对象 |
| | | * @return 执行结果,success为true表示成功,msg是失败的提示信息,obj是添加完成后的显示对象 |
| | | */ |
| | | @PostMapping( "/addSave") |
| | | public BaseResult<CodeResembleRuleVO> addSave(@RequestBody CodeResembleRuleDTO codeResembleRuleDTO){ |
| | | CodeResembleRuleVO codeResembleRuleVO = codeResembleRuleService.addSave(codeResembleRuleDTO); |
| | | return BaseResult.success(codeResembleRuleVO); |
| | | } |
| | | /** |
| | | * 相似查询规则列表 |
| | | * @param baseQueryObject 基础查询对象,包含查询条件,分页,排序等 |
| | | * @return 相似查询规则显示对象列表 |
| | | */ |
| | | @GetMapping("/gridCodeResembleRule") |
| | | public DataGrid<CodeResembleRuleVO> gridCodeResembleRule(BaseQueryObject baseQueryObject){ |
| | | if(baseQueryObject == null){ |
| | | baseQueryObject = new BaseQueryObject(); |
| | | } |
| | | return codeResembleRuleService.gridCodeResembleRule(baseQueryObject.getConditionMap(),baseQueryObject.getPageHelper()); |
| | | } |
| | | /** |
| | | * 增加 相似查询规则 |
| | | * @param codeResembleRuleDTO 相似查询规则数据传输对象 |
| | | * @return 执行结果,success为true表示成功,msg是失败的提示信息,obj是添加完成后的显示对象 |
| | | */ |
| | | @PostMapping( "/addSave") |
| | | public R<CodeResembleRuleVO> addSave(@RequestBody CodeResembleRuleDTO codeResembleRuleDTO){ |
| | | CodeResembleRuleVO codeResembleRuleVO = codeResembleRuleService.addSave(codeResembleRuleDTO); |
| | | return R.data(codeResembleRuleVO); |
| | | } |
| | | |
| | | /** |
| | | * 修改 相似查询规则 |
| | | * @param codeResembleRuleDTO 相似查询规则数据传输对象 |
| | | * @return 执行结果,success为true表示成功,msg是失败的提示信息,obj是添加完成后的显示对象 |
| | | */ |
| | | @PutMapping("/editSave") |
| | | public BaseResult<CodeResembleRuleVO> editSave(@RequestBody CodeResembleRuleDTO codeResembleRuleDTO){ |
| | | CodeResembleRuleVO codeResembleRuleVO = codeResembleRuleService.editSave(codeResembleRuleDTO); |
| | | return BaseResult.success(codeResembleRuleVO); |
| | | } |
| | | /** |
| | | * 修改 相似查询规则 |
| | | * @param codeResembleRuleDTO 相似查询规则数据传输对象 |
| | | * @return 执行结果,success为true表示成功,msg是失败的提示信息,obj是添加完成后的显示对象 |
| | | */ |
| | | @PutMapping("/editSave") |
| | | public R<CodeResembleRuleVO> editSave(@RequestBody CodeResembleRuleDTO codeResembleRuleDTO){ |
| | | CodeResembleRuleVO codeResembleRuleVO = codeResembleRuleService.editSave(codeResembleRuleDTO); |
| | | return R.data(codeResembleRuleVO); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除相似查询规则 |
| | | * @param codeResembleRuleDTO 相似查询规则数据传输对象,oid和ts需要传输 |
| | | * @return 删除结果反馈::success:成功,fail:失败 |
| | | */ |
| | | @DeleteMapping( "/deleteData") |
| | | public BaseResult delCodeResembleRule( CodeResembleRuleDTO codeResembleRuleDTO) { |
| | | return codeResembleRuleService.deleteCodeResembleRule(codeResembleRuleDTO); |
| | | } |
| | | /** |
| | | * 删除相似查询规则 |
| | | * @param codeResembleRuleDTO 相似查询规则数据传输对象,oid和ts需要传输 |
| | | * @return 删除结果反馈::success:成功,fail:失败 |
| | | */ |
| | | @DeleteMapping( "/deleteData") |
| | | public R delCodeResembleRule( CodeResembleRuleDTO codeResembleRuleDTO) { |
| | | return codeResembleRuleService.deleteCodeResembleRule(codeResembleRuleDTO); |
| | | } |
| | | |
| | | /** |
| | | * 主键获取相似查询规则 |
| | | * @param oid 主键 |
| | | * @return 相似查询规则显示对象 |
| | | */ |
| | | @GetMapping("/getObjectByOid") |
| | | public BaseResult<CodeResembleRuleVO> getObjectByOid(String oid){ |
| | | CodeResembleRuleVO codeResembleRuleVO = codeResembleRuleService.getObjectByOid(oid); |
| | | return BaseResult.success(codeResembleRuleVO); |
| | | } |
| | | /** |
| | | * 主键获取相似查询规则 |
| | | * @param oid 主键 |
| | | * @return 相似查询规则显示对象 |
| | | */ |
| | | @GetMapping("/getObjectByOid") |
| | | public R<CodeResembleRuleVO> getObjectByOid(String oid){ |
| | | CodeResembleRuleVO codeResembleRuleVO = codeResembleRuleService.getObjectByOid(oid); |
| | | return R.data(codeResembleRuleVO); |
| | | } |
| | | |
| | | /** |
| | | * 主键批量获取相似查询规则 |
| | | * @param oids 主键,多个以逗号分隔,但是受性能影响,建议一次查询不超过10000个 |
| | | * @return 相似查询规则显示对象 |
| | | */ |
| | | @GetMapping("/listDataByOids") |
| | | public BaseResult<CodeResembleRuleVO> listCodeResembleRuleByOids(String oids){ |
| | | Collection<CodeResembleRuleVO> voCollection = codeResembleRuleService.listCodeResembleRuleByOids(VciBaseUtil.str2List(oids)); |
| | | BaseResult baseResult = BaseResult.success(); |
| | | baseResult.setData(voCollection); |
| | | return baseResult; |
| | | } |
| | | /** |
| | | * 主键批量获取相似查询规则 |
| | | * @param oids 主键,多个以逗号分隔,但是受性能影响,建议一次查询不超过10000个 |
| | | * @return 相似查询规则显示对象 |
| | | */ |
| | | @GetMapping("/listDataByOids") |
| | | public R<CodeResembleRuleVO> listCodeResembleRuleByOids(String oids){ |
| | | Collection<CodeResembleRuleVO> voCollection = codeResembleRuleService.listCodeResembleRuleByOids(VciBaseUtil.str2List(oids)); |
| | | R baseResult = R.success("查询成功!"); |
| | | baseResult.setData(voCollection); |
| | | return baseResult; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 参照相似查询规则列表 |
| | | * @param baseQueryObject 基础查询对象,包含查询条件,分页,排序等 |
| | | * @return 相似查询规则显示对象列表,生效的内容 |
| | | */ |
| | | @GetMapping("/refDataGrid") |
| | | public DataGrid<CodeResembleRuleVO> refDataGridCodeResembleRule(BaseQueryObject baseQueryObject){ |
| | | if(baseQueryObject == null){ |
| | | baseQueryObject = new BaseQueryObject(); |
| | | } |
| | | return codeResembleRuleService.refDataGridCodeResembleRule(baseQueryObject.getConditionMap(),baseQueryObject.getPageHelper()); |
| | | } |
| | | |
| | | /** |
| | | * 参照相似查询规则列表 |
| | | * @param baseQueryObject 基础查询对象,包含查询条件,分页,排序等 |
| | | * @return 相似查询规则显示对象列表,生效的内容 |
| | | */ |
| | | @GetMapping("/refDataGrid") |
| | | public DataGrid<CodeResembleRuleVO> refDataGridCodeResembleRule(BaseQueryObject baseQueryObject){ |
| | | if(baseQueryObject == null){ |
| | | baseQueryObject = new BaseQueryObject(); |
| | | } |
| | | return codeResembleRuleService.refDataGridCodeResembleRule(baseQueryObject.getConditionMap(),baseQueryObject.getPageHelper()); |
| | | } |
| | | } |