|
@@ -0,0 +1,90 @@
|
|
|
+ package com.huimv.manager.controller;
|
|
|
+
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+import com.huimv.manager.entity.StockOutEntity;
|
|
|
+import com.huimv.manager.result.R;
|
|
|
+import com.huimv.manager.service.StockOutService;
|
|
|
+import com.huimv.manager.utils.PageUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ *
|
|
|
+ * @author yinhao
|
|
|
+ * @version ${version}
|
|
|
+ * @date 2021-08-06 15:40:07
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("management/stockout")
|
|
|
+@CrossOrigin
|
|
|
+public class StockOutController {
|
|
|
+ @Autowired
|
|
|
+ private StockOutService stockOutService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 列表
|
|
|
+ */
|
|
|
+ @RequestMapping("/list")
|
|
|
+ public R list(@RequestParam Map<String, Object> params){
|
|
|
+ PageUtils page = stockOutService.queryPage(params);
|
|
|
+
|
|
|
+ return R.ok().put("page", page);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 信息
|
|
|
+ */
|
|
|
+ @RequestMapping("/info/{id}")
|
|
|
+ public R info(@PathVariable("id") Integer id){
|
|
|
+ StockOutEntity stockOut = stockOutService.getById(id);
|
|
|
+
|
|
|
+ return R.ok().put("stockOut", stockOut);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 保存
|
|
|
+ */
|
|
|
+ @RequestMapping("/save")
|
|
|
+ public R save(@RequestBody StockOutEntity stockOut){
|
|
|
+ stockOutService.save(stockOut);
|
|
|
+
|
|
|
+ return R.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改
|
|
|
+ */
|
|
|
+ @RequestMapping("/update")
|
|
|
+ public R update(@RequestBody StockOutEntity stockOut){
|
|
|
+ stockOutService.updateById(stockOut);
|
|
|
+
|
|
|
+ return R.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除
|
|
|
+ */
|
|
|
+ @RequestMapping("/delete")
|
|
|
+ public R delete(@RequestBody Integer[] ids){
|
|
|
+ stockOutService.removeByIds(Arrays.asList(ids));
|
|
|
+
|
|
|
+ return R.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除
|
|
|
+ */
|
|
|
+ @RequestMapping("/findByCode")
|
|
|
+ public R findByCode(@RequestParam Map<String, Object> params){
|
|
|
+ List list = stockOutService.findByCode(params);
|
|
|
+
|
|
|
+ return R.ok().put("data",list);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|