Jelajahi Sumber

新增文件

车车 11 bulan lalu
induk
melakukan
ecfff66fe8

+ 116 - 0
ktg-iscs/src/main/java/com/ktg/iscs/controller/IsLocksetController.java

@@ -0,0 +1,116 @@
+package com.ktg.iscs.controller;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ktg.common.annotation.Log;
+import com.ktg.common.core.controller.BaseController;
+import com.ktg.common.enums.BusinessType;
+import com.ktg.common.pojo.CommonResult;
+import com.ktg.common.utils.poi.ExcelUtil;
+import com.ktg.iscs.domain.IsLockset;
+import com.ktg.iscs.service.IIsLocksetService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Parameters;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * 锁具Controller
+ *
+ * @author cgj
+ * @date 2024-11-19
+ */
+@Api(tags = "锁具")
+@RestController
+@RequestMapping("/iscs/lockset")
+public class IsLocksetController extends BaseController
+{
+    @Autowired
+    private IIsLocksetService isLocksetService;
+
+    /**
+     * 查询锁具分页
+     */
+    @ApiOperation("查询锁具-分页")
+    @Parameters({
+            @Parameter(name = "page", description = "Page"),
+            @Parameter(name = "isLockset", description = "实体参数")
+    })
+    @PreAuthorize("@ss.hasPermi('iscs:lockset:list')")
+    @GetMapping("/getIsLocksetPage")
+    public CommonResult<Page<IsLockset>> getIsLocksetPage(Page<IsLockset> page, IsLockset isLockset)
+    {
+        Page<IsLockset> result = isLocksetService.page(page, Wrappers.<IsLockset>lambdaQuery()
+                .orderByDesc(IsLockset::getLocksetId));
+        return CommonResult.success(result);
+    }
+
+    /**
+     * 导出锁具列表
+     */
+    @ApiOperation("导出锁具列表")
+    @Parameter(name = "isLockset", description = "实体参数")
+    @PreAuthorize("@ss.hasPermi('iscs:lockset:export')")
+    @Log(title = "锁具", businessType = BusinessType.EXPORT)
+    @PostMapping("/exportIsLockset")
+    public void exportIsLockset(HttpServletResponse response, IsLockset isLockset)
+    {
+        List<IsLockset> list = isLocksetService.selectIsLocksetList(isLockset);
+        ExcelUtil<IsLockset> util = new ExcelUtil<IsLockset>(IsLockset.class);
+        util.exportExcel(response, list, "锁具数据");
+    }
+
+    /**
+     * 获取锁具详细信息
+     */
+    @ApiOperation("获取锁具详细信息")
+    @Parameter(name = "locksetId", description = "locksetId")
+    @PreAuthorize("@ss.hasPermi('iscs:lockset:query')")
+    @GetMapping(value = "/selectIsLocksetById")
+    public CommonResult<IsLockset> selectIsLocksetById(Long locksetId)
+    {
+        return CommonResult.success(isLocksetService.selectIsLocksetByLocksetId(locksetId));
+    }
+
+    /**
+     * 新增锁具
+     */
+    @ApiOperation("新增锁具")
+    @PreAuthorize("@ss.hasPermi('iscs:lockset:add')")
+    @Log(title = "锁具", businessType = BusinessType.INSERT)
+    @PostMapping("/insertIsLockset")
+    public CommonResult<Boolean> insertIsLockset(@RequestBody @Parameter(name = "isLockset", description = "新增数据类,放到body") IsLockset isLockset)
+    {
+        return CommonResult.success(isLocksetService.insertIsLockset(isLockset) == 1);
+    }
+
+    /**
+     * 修改锁具
+     */
+    @ApiOperation("修改锁具")
+    @PreAuthorize("@ss.hasPermi('iscs:lockset:edit')")
+    @Log(title = "锁具", businessType = BusinessType.UPDATE)
+    @PostMapping("/updateIsLockset")
+    public CommonResult<Boolean> updateIsLockset(@RequestBody @Parameter(name = "isLockset", description = "修改数据类,放到body") IsLockset isLockset)
+    {
+        return CommonResult.success(isLocksetService.updateIsLockset(isLockset) == 1);
+    }
+
+    /**
+     * 删除锁具
+     */
+    @ApiOperation("删除锁具")
+    @PreAuthorize("@ss.hasPermi('iscs:lockset:remove')")
+    @Log(title = "锁具", businessType = BusinessType.DELETE)
+	@PostMapping("/deleteIsLocksetByLocksetIds")
+    public CommonResult<Boolean> deleteIsLocksetByLocksetIds(String locksetIds)
+    {
+        return CommonResult.success(isLocksetService.deleteIsLocksetByLocksetIds(locksetIds) != 0);
+    }
+}

+ 116 - 0
ktg-iscs/src/main/java/com/ktg/iscs/controller/IsLocksetTypeController.java

@@ -0,0 +1,116 @@
+package com.ktg.iscs.controller;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ktg.common.annotation.Log;
+import com.ktg.common.core.controller.BaseController;
+import com.ktg.common.enums.BusinessType;
+import com.ktg.common.pojo.CommonResult;
+import com.ktg.common.utils.poi.ExcelUtil;
+import com.ktg.iscs.domain.IsLocksetType;
+import com.ktg.iscs.service.IIsLocksetTypeService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Parameters;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * 锁具类型Controller
+ *
+ * @author cgj
+ * @date 2024-11-19
+ */
+@Api(tags = "锁具类型")
+@RestController
+@RequestMapping("/iscs/type")
+public class IsLocksetTypeController extends BaseController
+{
+    @Autowired
+    private IIsLocksetTypeService isLocksetTypeService;
+
+    /**
+     * 查询锁具类型分页
+     */
+    @ApiOperation("查询锁具类型-分页")
+    @Parameters({
+            @Parameter(name = "page", description = "Page"),
+            @Parameter(name = "isLocksetType", description = "实体参数")
+    })
+    @PreAuthorize("@ss.hasPermi('iscs:type:list')")
+    @GetMapping("/getIsLocksetTypePage")
+    public CommonResult<Page<IsLocksetType>> getIsLocksetTypePage(Page<IsLocksetType> page, IsLocksetType isLocksetType)
+    {
+        Page<IsLocksetType> result = isLocksetTypeService.page(page, Wrappers.<IsLocksetType>lambdaQuery()
+                .orderByDesc(IsLocksetType::getLocksetTypeId));
+        return CommonResult.success(result);
+    }
+
+    /**
+     * 导出锁具类型列表
+     */
+    @ApiOperation("导出锁具类型列表")
+    @Parameter(name = "isLocksetType", description = "实体参数")
+    @PreAuthorize("@ss.hasPermi('iscs:type:export')")
+    @Log(title = "锁具类型", businessType = BusinessType.EXPORT)
+    @PostMapping("/exportIsLocksetType")
+    public void exportIsLocksetType(HttpServletResponse response, IsLocksetType isLocksetType)
+    {
+        List<IsLocksetType> list = isLocksetTypeService.selectIsLocksetTypeList(isLocksetType);
+        ExcelUtil<IsLocksetType> util = new ExcelUtil<IsLocksetType>(IsLocksetType.class);
+        util.exportExcel(response, list, "锁具类型数据");
+    }
+
+    /**
+     * 获取锁具类型详细信息
+     */
+    @ApiOperation("获取锁具类型详细信息")
+    @Parameter(name = "locksetTypeId", description = "locksetTypeId")
+    @PreAuthorize("@ss.hasPermi('iscs:type:query')")
+    @GetMapping(value = "/selectIsLocksetTypeById")
+    public CommonResult<IsLocksetType> selectIsLocksetTypeById(Long locksetTypeId)
+    {
+        return CommonResult.success(isLocksetTypeService.selectIsLocksetTypeByLocksetTypeId(locksetTypeId));
+    }
+
+    /**
+     * 新增锁具类型
+     */
+    @ApiOperation("新增锁具类型")
+    @PreAuthorize("@ss.hasPermi('iscs:type:add')")
+    @Log(title = "锁具类型", businessType = BusinessType.INSERT)
+    @PostMapping("/insertIsLocksetType")
+    public CommonResult<Boolean> insertIsLocksetType(@RequestBody @Parameter(name = "isLocksetType", description = "新增数据类,放到body") IsLocksetType isLocksetType)
+    {
+        return CommonResult.success(isLocksetTypeService.insertIsLocksetType(isLocksetType) == 1);
+    }
+
+    /**
+     * 修改锁具类型
+     */
+    @ApiOperation("修改锁具类型")
+    @PreAuthorize("@ss.hasPermi('iscs:type:edit')")
+    @Log(title = "锁具类型", businessType = BusinessType.UPDATE)
+    @PostMapping("/updateIsLocksetType")
+    public CommonResult<Boolean> updateIsLocksetType(@RequestBody @Parameter(name = "isLocksetType", description = "修改数据类,放到body") IsLocksetType isLocksetType)
+    {
+        return CommonResult.success(isLocksetTypeService.updateIsLocksetType(isLocksetType) == 1);
+    }
+
+    /**
+     * 删除锁具类型
+     */
+    @ApiOperation("删除锁具类型")
+    @PreAuthorize("@ss.hasPermi('iscs:type:remove')")
+    @Log(title = "锁具类型", businessType = BusinessType.DELETE)
+	@PostMapping("/deleteIsLocksetTypeByLocksetTypeIds")
+    public CommonResult<Boolean> deleteIsLocksetTypeByLocksetTypeIds(String locksetTypeIds)
+    {
+        return CommonResult.success(isLocksetTypeService.deleteIsLocksetTypeByLocksetTypeIds(locksetTypeIds) != 0);
+    }
+}