From 417b1231b1570bdb3711567dedb319314c8f2ea1 Mon Sep 17 00:00:00 2001
From: tangzy <tangzy123456>
Date: Thu, 26 Aug 2021 15:40:55 +0800
Subject: [PATCH] 1.备案

---
 src/main/java/org/springblade/modules/record/controller/RecordController.java |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 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 80ba7a0..45e43c1 100644
--- a/src/main/java/org/springblade/modules/record/controller/RecordController.java
+++ b/src/main/java/org/springblade/modules/record/controller/RecordController.java
@@ -70,6 +70,7 @@
 	@ApiOperationSupport(order = 2)
 	@ApiOperation(value = "分页", notes = "传入record")
 	public R<IPage<Record>> list(Record record, Query query) {
+		record.setStorage("1");
 		IPage<Record> pages = recordService.page(Condition.getPage(query), Condition.getQueryWrapper(record));
 		return R.data(pages);
 	}
@@ -93,7 +94,8 @@
 	@ApiOperation(value = "新增", notes = "传入record")
 	public R save(@Valid @RequestBody Record record) {
 		String cardid = record.getCardid();
-		Map map = recordService.selectIn(cardid);
+		String type = record.getPtype();
+		Map map = recordService.selectIn(cardid,type);
 		if (map != null) {
 			String id = map.get("id").toString();
 			recordService.removeByIds(Func.toLongList(id));
@@ -116,7 +118,7 @@
 			record.getAddress() + "'" + "," + "'" + record.getBusiness() + "'" + "," + "'" +
 			record.getRegion() + "'" + "," + "'" + record.getRegistration() + "'" + "," + "'" + record.getIndustry() + "'" + "," + "'" + record.getType() + "'" + "," + "'" + pertime + "'" + "," + "'" + record.getDeptid() + "'" + "," + "'" + record.getPtype() + "'" + "," +
 			"'" + record.getRepresentativecell() + "'" + "," + "'" + record.getContacts() + "'" + "," + "'" + record.getContactscell() + "'" + "," +
-			"'" + record.getPerid() + "'" + "," + "'" + record.getOffices() + "'" + "," + "'" + offtime + "'" + "'" + "," + "'" + record.getJurisdiction() + "'" + ")";
+			"'" + record.getPerid() + "'" + "," + "'" + record.getOffices() + "'" + "," + "'" + offtime + "'" + "," + "'" + record.getJurisdiction() + "'" + ")";
 		FtpUtil.sqlFileUpload(s);
 		return R.success("成功");
 	}
@@ -129,7 +131,8 @@
 	@ApiOperation(value = "新增", notes = "传入record")
 	public R rocordsave(@Valid @RequestBody Record record) {
 		String cardid = record.getCardid();
-		Map map = recordService.selectIn(cardid);
+		String type = record.getPtype();
+		Map map = recordService.selectIn(cardid,type);
 		if (map != null) {
 			record.setStorage("0");
 			record.setPermitime(new Date());
@@ -137,7 +140,6 @@
 		} else {
 			record.setStorage("0");
 			record.setType("2");
-			record.setPtype("2");
 			record.setPermitime(new Date());
 			recordService.save(record);
 		}
@@ -177,8 +179,8 @@
 
 
 	@PostMapping("/selectIn")
-	public R selectIn(String cardid) {
-		Map map = recordService.selectIn(cardid);
+	public R selectIn(String cardid,String type) {
+		Map map = recordService.selectIn(cardid,type);
 		return R.data(map);
 	}
 }

--
Gitblit v1.9.3