From 8853292babb2ad94de4a3207966f1e83b767cd2d Mon Sep 17 00:00:00 2001
From: zhongrj <646384940@qq.com>
Date: Sun, 17 Sep 2023 16:38:34 +0800
Subject: [PATCH] 新增流程节点进程查询接口

---
 src/main/java/org/springblade/modules/revoke/controller/RevokeController.java |   69 ++++++++++++++++++++++++++++++++--
 1 files changed, 65 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/springblade/modules/revoke/controller/RevokeController.java b/src/main/java/org/springblade/modules/revoke/controller/RevokeController.java
index 6867fd4..86a0d1e 100644
--- a/src/main/java/org/springblade/modules/revoke/controller/RevokeController.java
+++ b/src/main/java/org/springblade/modules/revoke/controller/RevokeController.java
@@ -27,16 +27,22 @@
 import org.springblade.core.mp.support.Query;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.FTP.FtpUtil;
+import org.springblade.modules.information.service.IInformationService;
+import org.springblade.modules.permit.vo.PermitVO;
 import org.springblade.modules.revoke.entity.Revoke;
 import org.springblade.modules.revoke.service.IRevokeService;
 import org.springblade.modules.revoke.vo.RevokeVO;
+import org.springblade.modules.system.service.MyAsyncService;
 import org.springframework.web.bind.annotation.*;
 
 import javax.validation.Valid;
+import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.Map;
 
 /**
- *  控制器
+ * 控制器
  *
  * @author BladeX
  * @since 2021-07-12
@@ -48,6 +54,8 @@
 public class RevokeController extends BladeController {
 
 	private final IRevokeService revokeService;
+	private final IInformationService informationService;
+	private final MyAsyncService myAsyncService;
 
 	/**
 	 * 详情
@@ -67,6 +75,7 @@
 	@ApiOperationSupport(order = 2)
 	@ApiOperation(value = "分页", notes = "传入revoke")
 	public R<IPage<Revoke>> list(Revoke revoke, Query query) {
+		revoke.setStorage("1");
 		IPage<Revoke> pages = revokeService.page(Condition.getPage(query), Condition.getQueryWrapper(revoke));
 		return R.data(pages);
 	}
@@ -78,7 +87,8 @@
 	@ApiOperationSupport(order = 3)
 	@ApiOperation(value = "分页", notes = "传入revoke")
 	public R<IPage<RevokeVO>> page(RevokeVO revoke, Query query) {
-		IPage<RevokeVO> pages = revokeService.selectRevokePage(Condition.getPage(query), revoke);
+		IPage<RevokeVO> pages;
+		pages = revokeService.selectRevokePage(Condition.getPage(query), revoke, revoke.getJurisdiction());
 		return R.data(pages);
 	}
 
@@ -89,9 +99,55 @@
 	@ApiOperationSupport(order = 4)
 	@ApiOperation(value = "新增", notes = "传入revoke")
 	public R save(@Valid @RequestBody Revoke revoke) {
+		String cardid = revoke.getCardid();
+		String type = revoke.getPtype();
+		Map map = revokeService.selectIn(cardid, type);
+		if (map != null) {
+			String id = map.get("id").toString();
+			revokeService.removeByIds(Func.toLongList(id));
+		}
+		revoke.setStorage("1");
 		revoke.setType("2");
-		revoke.setCtime(new Date());
-		return R.status(revokeService.save(revoke));
+		revoke.setPermitime(new Date());
+		boolean save = revokeService.save(revoke);
+		if (save) {
+			String s = "insert into sys_revoke(id,creditCode,enterpriseName,representative," +
+				"registeredCapital,organizationCode,registrationNumber,identificationNumber,enterprises," +
+				"address,business,region,registration,industry,type,deptid,ptype,representativecell,contacts,contactscell,reason,jurisdiction,cardid)" +
+				"values(" + "'" + revoke.getId() + "'" + "," + "'" + revoke.getCreditcode() + "'" + "," + "'" + revoke.getEnterprisename() + "'" + "," + "'"
+				+ revoke.getRepresentative() + "'" + "," + "'" + revoke.getRegisteredcapital() + "'" + "," + "'"
+				+ revoke.getOrganizationcode() + "'" + "," + "'" + revoke.getRegistrationnumber() + "'" + "," +
+				"'" + revoke.getIdentificationnumber() + "'" + "," + "'" + revoke.getEnterprises() + "'" + "," + "'" +
+				revoke.getAddress() + "'" + "," + "'" + revoke.getBusiness() + "'" + "," + "'" +
+				revoke.getRegion() + "'" + "," + "'" + revoke.getRegistration() + "'" + "," + "'" + revoke.getIndustry() + "'" + "," + "'"
+				+ revoke.getType() + "'" + "," + "'" + revoke.getDeptid() + "'" + "," + "'" + revoke.getPtype() + "'" + "," +
+				"'" + revoke.getRepresentativecell() + "'" + "," + "'" + revoke.getContacts() + "'" + "," + "'" + revoke.getContactscell() + "'" + "," +
+				"'" + revoke.getReason() + "'" + "," + "'" + revoke.getJurisdiction() + "'" + "," + "'" + revoke.getCardid() + "'" + ")";
+			myAsyncService.dataSync(s);
+		}
+		return R.success("成功");
+	}
+
+	/**
+	 * 暂存
+	 */
+	@PostMapping("/revokesave")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入revoke")
+	public R revokesave(@Valid @RequestBody Revoke revoke) {
+		String cardid = revoke.getCardid();
+		String type = revoke.getPtype();
+		Map map = revokeService.selectIn(cardid, type);
+		if (map != null) {
+			revoke.setStorage("0");
+			revokeService.updateById(revoke);
+		} else {
+			revoke.setStorage("0");
+			revoke.setType("2");
+			revoke.setPermitime(new Date());
+			revokeService.save(revoke);
+		}
+		return R.success("暂存成功");
 	}
 
 	/**
@@ -125,5 +181,10 @@
 		return R.status(revokeService.removeByIds(Func.toLongList(ids)));
 	}
 
+	@PostMapping("/selectIn")
+	public R selectIn(String cardid, String type) {
+		Map map = revokeService.selectIn(cardid, type);
+		return R.data(map);
+	}
 
 }

--
Gitblit v1.9.3