|
@@ -0,0 +1,120 @@
|
|
|
+package com.platform.rest.controller.spareAdd;
|
|
|
+
|
|
|
+import com.platform.common.bean.AbstractPageResultBean;
|
|
|
+import com.platform.common.util.R;
|
|
|
+import com.platform.common.validation.group.AddGroup;
|
|
|
+import com.platform.common.validation.group.UpdateGroup;
|
|
|
+import com.platform.dao.dto.spareAdd.LongYanInventoryCodeDTO;
|
|
|
+import com.platform.dao.entity.spareAdd.LongYanInventoryCode;
|
|
|
+import com.platform.dao.vo.query.spareAdd.LongYanInventoryCodeVO;
|
|
|
+import com.platform.rest.log.annotation.SysLog;
|
|
|
+import com.platform.service.spareAdd.LongYanInventoryCodeService;
|
|
|
+import lombok.AllArgsConstructor;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @Description 图层目录表 控制器
|
|
|
+ * @Author lsq
|
|
|
+ * @Date 2023-07-25 15:59:52
|
|
|
+ * @Version Copyright (c) 2020,北京乾元坤和科技有限公司 All rights reserved.
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@AllArgsConstructor
|
|
|
+@RequestMapping("/inventory/code")
|
|
|
+public class LongYanInventoryCodeController {
|
|
|
+
|
|
|
+ private final LongYanInventoryCodeService longYanInventoryCodeService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过id查询单条记录
|
|
|
+ *
|
|
|
+ * @param id 主键
|
|
|
+ * @return R
|
|
|
+ */
|
|
|
+ @GetMapping("/{id}")
|
|
|
+ public R<LongYanInventoryCode> getById(@PathVariable("id") String id){
|
|
|
+ return new R<>(longYanInventoryCodeService.getModelById(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增记录
|
|
|
+ *
|
|
|
+ * @param longYanInventoryCode 图层目录表DTO
|
|
|
+ * @return R
|
|
|
+ */
|
|
|
+ @SysLog("新增存货分类表")
|
|
|
+ @PostMapping
|
|
|
+ public R save(@Validated({AddGroup.class}) @RequestBody LongYanInventoryCodeDTO longYanInventoryCode) {
|
|
|
+ return new R<>(longYanInventoryCodeService.saveModelByDTO(longYanInventoryCode));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改记录
|
|
|
+ *
|
|
|
+ * @param longYanInventoryCodeDTO 存货分类表DTO
|
|
|
+ * @return R
|
|
|
+ */
|
|
|
+ @SysLog("修改存货分类表")
|
|
|
+ @PutMapping("/{id}")
|
|
|
+ public R update(@PathVariable("id") String id, @Validated({UpdateGroup.class}) @RequestBody LongYanInventoryCodeDTO longYanInventoryCodeDTO) {
|
|
|
+ longYanInventoryCodeDTO.setId(id);
|
|
|
+ longYanInventoryCodeService.modModelByDTO(longYanInventoryCodeDTO);
|
|
|
+ return new R<>();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过id删除一条记录
|
|
|
+ *
|
|
|
+ * @param id 主键
|
|
|
+ * @return R
|
|
|
+ */
|
|
|
+ @SysLog("删除存货分类表")
|
|
|
+ @DeleteMapping("/{id}")
|
|
|
+ public R removeById(@PathVariable String id){
|
|
|
+ longYanInventoryCodeService.deleteByPrimaryKey(id);
|
|
|
+ return new R<>();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 批量记录
|
|
|
+ *
|
|
|
+ * @param ids 主键
|
|
|
+ * @return R
|
|
|
+ */
|
|
|
+ @SysLog("批量删除存货分类表")
|
|
|
+ @DeleteMapping("")
|
|
|
+ public R removeIds(@RequestBody List<String> ids){
|
|
|
+ longYanInventoryCodeService.batchDelete(ids);
|
|
|
+ return new R<>();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取分页
|
|
|
+ *
|
|
|
+ * @param pageNum 当前页码
|
|
|
+ * @param pageSize 每页条数
|
|
|
+ * @param longYanInventoryCodeDTO 存货分类表DTO
|
|
|
+ * @return R
|
|
|
+ */
|
|
|
+ @GetMapping("/page")
|
|
|
+ public R<AbstractPageResultBean<LongYanInventoryCodeVO>> query(LongYanInventoryCodeDTO longYanInventoryCodeDTO, @RequestParam(defaultValue = "1") int pageNum, @RequestParam(defaultValue = "20") int pageSize) {
|
|
|
+ return new R<>(longYanInventoryCodeService.selectPageList(longYanInventoryCodeDTO, pageNum, pageSize));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取列表
|
|
|
+ *
|
|
|
+ * @param longYanInventoryCodeDTO 存货分类表DTO
|
|
|
+ * @return R
|
|
|
+ */
|
|
|
+ @GetMapping("")
|
|
|
+ public R query(LongYanInventoryCodeDTO longYanInventoryCodeDTO) {
|
|
|
+ return new R<>(longYanInventoryCodeService.getModelListByDTO(longYanInventoryCodeDTO));
|
|
|
+ }
|
|
|
+
|
|
|
+}
|