|
@@ -0,0 +1,74 @@
|
|
|
+package org.springblade.factory.controller;
|
|
|
+
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import org.springblade.core.mp.support.Condition;
|
|
|
+import org.springblade.core.mp.support.Query;
|
|
|
+import org.springblade.core.tool.api.R;
|
|
|
+import org.springblade.factory.entity.PcBladeDealerForecast;
|
|
|
+import org.springblade.factory.entity.PcBladeDealerInventory;
|
|
|
+import org.springblade.factory.service.PcBladeDealerForecastService;
|
|
|
+import org.springblade.factory.service.PcBladeDealerInventoryService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+import springfox.documentation.annotations.ApiIgnore;
|
|
|
+
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 经销商库存列表 前端控制器
|
|
|
+ *
|
|
|
+ * @author horizon
|
|
|
+ * @since 2025-08-05
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/api/factory/dealer-inventory")
|
|
|
+public class PcBladeDealerInventoryController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private PcBladeDealerInventoryService inventoryService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 经销商库存列表
|
|
|
+ */
|
|
|
+ @GetMapping
|
|
|
+ @ApiOperation(value = "经销商库存列表", notes = "")
|
|
|
+ public R<IPage<PcBladeDealerInventory>> list(
|
|
|
+ @ApiIgnore @RequestParam Map<String, Object> params,
|
|
|
+ Query query,
|
|
|
+ PcBladeDealerInventory pcBladeDealerInventory) {
|
|
|
+ // 1. 构建基础查询条件
|
|
|
+ QueryWrapper<PcBladeDealerInventory> queryWrapper = Condition.getQueryWrapper(params, PcBladeDealerInventory.class);
|
|
|
+ // 2. 执行分页查询
|
|
|
+ IPage<PcBladeDealerInventory> pages = inventoryService.page(Condition.getPage(query), queryWrapper);
|
|
|
+ // 3. 返回结果
|
|
|
+ return R.data(pages);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 单条查询
|
|
|
+ */
|
|
|
+ @GetMapping("/{id}")
|
|
|
+ public R<PcBladeDealerInventory> get(@PathVariable("id") Long id) {
|
|
|
+ PcBladeDealerInventory inventory = inventoryService.selectPcBladeDealerInventoryById(id);
|
|
|
+ return R.data(inventory);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增
|
|
|
+ */
|
|
|
+ @PostMapping
|
|
|
+ public R<Boolean> save(@RequestBody PcBladeDealerInventory pcBladeDealerInventory) {
|
|
|
+ return R.data(200, inventoryService.insertPcBladeDealerInventory(pcBladeDealerInventory), "添加成功");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改
|
|
|
+ */
|
|
|
+ @PutMapping
|
|
|
+ public R<Boolean> update(@RequestBody PcBladeDealerInventory pcBladeDealerInventory) {
|
|
|
+ return R.data(200, inventoryService.updatePcBladeDealerInventory(pcBladeDealerInventory), "修改成功");
|
|
|
+ }
|
|
|
+}
|