|
@@ -0,0 +1,114 @@
|
|
|
+package com.ruoyi.web.controller.mobile;
|
|
|
+
|
|
|
+import com.ruoyi.common.annotation.Log;
|
|
|
+import com.ruoyi.common.annotation.RepeatSubmit;
|
|
|
+import com.ruoyi.common.core.controller.BaseController;
|
|
|
+import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
+import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
+import com.ruoyi.common.core.validate.AddGroup;
|
|
|
+import com.ruoyi.common.core.validate.EditGroup;
|
|
|
+import com.ruoyi.common.core.validate.QueryGroup;
|
|
|
+import com.ruoyi.common.enums.BusinessType;
|
|
|
+import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
+import com.ruoyi.gas.domain.bo.GCadBo;
|
|
|
+import com.ruoyi.gas.domain.vo.GCadVo;
|
|
|
+import com.ruoyi.gas.service.IGCadService;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import javax.validation.constraints.NotEmpty;
|
|
|
+import javax.validation.constraints.NotNull;
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * cad图纸Controller
|
|
|
+ *
|
|
|
+ * @author ruoyi
|
|
|
+ * @date 2024-03-22
|
|
|
+ */
|
|
|
+@Validated
|
|
|
+@Api(value = "cad图纸控制器", tags = {"cad图纸管理"})
|
|
|
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
|
|
+@RestController
|
|
|
+@RequestMapping("/mobile/cad")
|
|
|
+public class MCadController extends BaseController {
|
|
|
+
|
|
|
+ private final IGCadService iGCadService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询cad图纸列表
|
|
|
+ */
|
|
|
+ @ApiOperation("查询cad图纸列表")
|
|
|
+ @GetMapping("/list")
|
|
|
+ public TableDataInfo<GCadVo> list(@Validated(QueryGroup.class) GCadBo bo) {
|
|
|
+ return iGCadService.queryPageList(bo);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出cad图纸列表
|
|
|
+ */
|
|
|
+ @ApiOperation("导出cad图纸列表")
|
|
|
+ @Log(title = "cad图纸", businessType = BusinessType.EXPORT)
|
|
|
+ @GetMapping("/export")
|
|
|
+ public void export(@Validated GCadBo bo, HttpServletResponse response) {
|
|
|
+ List<GCadVo> list = iGCadService.queryList(bo);
|
|
|
+ ExcelUtil.exportExcel(list, "cad图纸", GCadVo.class, response);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取cad图纸详细信息
|
|
|
+ */
|
|
|
+ @ApiOperation("获取cad图纸详细信息")
|
|
|
+ @GetMapping("/{id}")
|
|
|
+ public AjaxResult<GCadVo> getInfo(@NotNull(message = "主键不能为空") @PathVariable("id") Long id) {
|
|
|
+ return AjaxResult.success(iGCadService.queryById(id));//需要改自定义sql
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增cad图纸
|
|
|
+ */
|
|
|
+ @ApiOperation("新增cad图纸")
|
|
|
+ @Log(title = "cad图纸", businessType = BusinessType.INSERT)
|
|
|
+ @RepeatSubmit()
|
|
|
+ @PostMapping()
|
|
|
+ public AjaxResult<Void> add(@Validated(AddGroup.class) @RequestBody GCadBo bo) {
|
|
|
+ return toAjax(iGCadService.insertByBo(bo) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改cad图纸
|
|
|
+ */
|
|
|
+ @ApiOperation("修改cad图纸")
|
|
|
+ @Log(title = "cad图纸", businessType = BusinessType.UPDATE)
|
|
|
+ @RepeatSubmit()
|
|
|
+ @PutMapping()
|
|
|
+ public AjaxResult<Void> edit(@Validated(EditGroup.class) @RequestBody GCadBo bo) {
|
|
|
+ return toAjax(iGCadService.updateByBo(bo) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除cad图纸
|
|
|
+ */
|
|
|
+ @ApiOperation("删除cad图纸")
|
|
|
+ @Log(title = "cad图纸" , businessType = BusinessType.DELETE)
|
|
|
+ @DeleteMapping("/{ids}")
|
|
|
+ public AjaxResult<Void> remove(@NotEmpty(message = "主键不能为空")
|
|
|
+ @PathVariable Long[] ids) {
|
|
|
+ return toAjax(iGCadService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 手机端查询队伍下所有文件
|
|
|
+ */
|
|
|
+ @ApiOperation("手机端查询队伍下所有文件")
|
|
|
+ @GetMapping("getAllFileByPostId/{postId}")
|
|
|
+ public AjaxResult getAllFileByPostId(@PathVariable Long postId) {
|
|
|
+ return AjaxResult.success(iGCadService.getAllFileByPostId(postId));
|
|
|
+ }
|
|
|
+}
|