|
@@ -0,0 +1,90 @@
|
|
|
|
+package com.gqy.web.controller.document;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+import com.gqy.common.core.controller.BaseController;
|
|
|
|
+import com.gqy.common.core.domain.AjaxResult;
|
|
|
|
+import com.gqy.common.core.domain.AjaxResultCQY;
|
|
|
|
+import com.gqy.common.utils.bean.BeanUtils;
|
|
|
|
+import com.gqy.document.domain.DcbBlock;
|
|
|
|
+import com.gqy.document.domain.vo.PageResult;
|
|
|
|
+import com.gqy.document.service.IDcbBlockService;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
+import java.util.Map;
|
|
|
|
+
|
|
|
|
+@RestController
|
|
|
|
+@RequestMapping("/document/block")
|
|
|
|
+public class DcbBlockController extends BaseController {
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private IDcbBlockService dcbBlockService;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取数据块列表
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("/list")
|
|
|
|
+ public @ResponseBody AjaxResultCQY list(@RequestBody Map maps) {
|
|
|
|
+
|
|
|
|
+ Integer page = (Integer) maps.get("page");
|
|
|
|
+ Integer pageSize =(Integer) maps.get("pageSize");
|
|
|
|
+ DcbBlock dcbBlock = new DcbBlock();
|
|
|
|
+ BeanUtils.mapToBean(maps, dcbBlock);
|
|
|
|
+ PageResult pageResult = dcbBlockService.searchlistDoc(page,pageSize,dcbBlock);
|
|
|
|
+
|
|
|
|
+ return AjaxResultCQY.success("查询成功", pageResult);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取数据块详细信息
|
|
|
|
+ */
|
|
|
|
+ @GetMapping(value = "/{dcbId}")
|
|
|
|
+ public AjaxResult getInfo(@PathVariable("dcbId") Long dcbId) {
|
|
|
|
+ return success(dcbBlockService.selectDcbBlockById(dcbId));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 新增数据块
|
|
|
|
+ */
|
|
|
|
+ @PostMapping(value="/add")
|
|
|
|
+ public AjaxResult add(@RequestBody DcbBlock dcbBlock) {
|
|
|
|
+ return toAjax(dcbBlockService.insertDcbBlock(dcbBlock));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 修改数据块
|
|
|
|
+ */
|
|
|
|
+ @PostMapping(value="/edit")
|
|
|
|
+ public AjaxResult edit(@RequestBody DcbBlock dcbBlock) {
|
|
|
|
+ return toAjax(dcbBlockService.updateDcbBlock(dcbBlock));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 删除块
|
|
|
|
+ * @param dcbId
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @GetMapping(value = "/dele/{dcbId}")
|
|
|
|
+ public @ResponseBody AjaxResultCQY dele(@PathVariable("dcbId") Long dcbId) {
|
|
|
|
+ // String contentStr = (String) content.get("content");
|
|
|
|
+
|
|
|
|
+ try{
|
|
|
|
+ dcbBlockService.deleteDcbBlockByDocId(dcbId);
|
|
|
|
+ return AjaxResultCQY.success("操作") ;
|
|
|
|
+ }catch(Exception e){
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ return AjaxResultCQY.error("删除块操作失败") ;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 删除数据块
|
|
|
|
+ */
|
|
|
|
+ @DeleteMapping("/{dcbIds}")
|
|
|
|
+ public AjaxResult remove(@PathVariable Long[] dcbIds) {
|
|
|
|
+ return toAjax(dcbBlockService.deleteDcbBlockByIds(dcbIds));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+}
|