From 1686e242b0c63d64db8551fe9d08cd57bd77fb8b Mon Sep 17 00:00:00 2001
From: tangzy <tangzy123456>
Date: Mon, 16 Aug 2021 19:21:22 +0800
Subject: [PATCH] 1.许可审批

---
 src/main/java/org/springblade/modules/record/controller/RecordController.java |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/src/main/java/org/springblade/modules/record/controller/RecordController.java b/src/main/java/org/springblade/modules/record/controller/RecordController.java
index 6d8f717..afa795b 100644
--- a/src/main/java/org/springblade/modules/record/controller/RecordController.java
+++ b/src/main/java/org/springblade/modules/record/controller/RecordController.java
@@ -33,6 +33,7 @@
 import org.springframework.web.bind.annotation.*;
 
 import javax.validation.Valid;
+import java.util.Map;
 
 /**
  *  控制器
@@ -88,10 +89,39 @@
 	@ApiOperationSupport(order = 4)
 	@ApiOperation(value = "新增", notes = "传入record")
 	public R save(@Valid @RequestBody Record record) {
+		String cardid = record.getCardid();
+		Map map = recordService.selectIn(cardid);
+		if (map!=null){
+			String id = map.get("id").toString();
+			recordService.removeByIds(Func.toLongList(id));
+		}
+		record.setStorage("0");
 		return R.status(recordService.save(record));
 	}
 
 	/**
+	 * 暂存
+	 */
+	@PostMapping("/rocordsave")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入record")
+	public R rocordsave(@Valid @RequestBody Record record) {
+		String cardid = record.getCardid();
+		Map map = recordService.selectIn(cardid);
+		if (map!=null){
+			record.setStorage("0");
+			recordService.updateById(record);
+		}
+		else {
+			record.setStorage("0");
+			record.setType("2");
+			record.setPtype("2");
+			recordService.save(record);
+		}
+		return R.success("暂存成功");
+	}
+
+	/**
 	 * 修改
 	 */
 	@PostMapping("/update")

--
Gitblit v1.9.3