|
|
@@ -0,0 +1,72 @@
|
|
|
+package com.usoftchina.saas.purchase.controller;
|
|
|
+
|
|
|
+import com.usoftchina.saas.base.Result;
|
|
|
+import com.usoftchina.saas.common.dto.DocSavedDTO;
|
|
|
+import com.usoftchina.saas.purchase.dto.ProdInOutFormDTO;
|
|
|
+import com.usoftchina.saas.purchase.service.ProdInOutService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+/**
|
|
|
+ * Created by zdw
|
|
|
+ * 2018-10-17 11:41.
|
|
|
+ */
|
|
|
+@CrossOrigin
|
|
|
+@RestController
|
|
|
+@RequestMapping("/prodinout")
|
|
|
+public class ProdInOutController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ ProdInOutService prodInOutService;
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取出入库单表单
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/read/{id}")
|
|
|
+ public Result<ProdInOutFormDTO> getFormData(@PathVariable("id") Long id) {
|
|
|
+ ProdInOutFormDTO data = prodInOutService.getFormData(id);
|
|
|
+ return Result.success(data);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 出入库单表单保存
|
|
|
+ *
|
|
|
+ * @param
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping("/save")
|
|
|
+ public Result<DocSavedDTO> saveFormData(@RequestBody ProdInOutFormDTO data) {
|
|
|
+ DocSavedDTO savedDTO = prodInOutService.saveFormData(data);
|
|
|
+ return Result.success(savedDTO);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 出入库单删除
|
|
|
+ *
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/delete/{id}")
|
|
|
+ public Result delete(@PathVariable("id") Long id) {
|
|
|
+ prodInOutService.delete(id);
|
|
|
+ return Result.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 出入库单审批
|
|
|
+ *
|
|
|
+ * @param formData
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping("/audit")
|
|
|
+ public Result audit(@RequestBody ProdInOutFormDTO formData) {
|
|
|
+ DocSavedDTO audit = prodInOutService.audit(formData);
|
|
|
+ return Result.success(audit);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+}
|