From 8b375fe00a241b3a769b82fe3dac8d1c9dce8a02 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Thu, 16 Jun 2022 14:36:07 +0800
Subject: [PATCH] 模拟考试修改

---
 src/main/java/org/springblade/modules/revoke/controller/RevokeController.java |   60 ++++++++++++++++++++++++------------------------------------
 1 files changed, 24 insertions(+), 36 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 a309645..2876212 100644
--- a/src/main/java/org/springblade/modules/revoke/controller/RevokeController.java
+++ b/src/main/java/org/springblade/modules/revoke/controller/RevokeController.java
@@ -33,6 +33,7 @@
 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;
@@ -54,6 +55,8 @@
 
 	private final IRevokeService revokeService;
 	private final IInformationService informationService;
+	private final MyAsyncService myAsyncService;
+
 	/**
 	 * 详情
 	 */
@@ -85,22 +88,7 @@
 	@ApiOperation(value = "分页", notes = "传入revoke")
 	public R<IPage<RevokeVO>> page(RevokeVO revoke, Query query) {
 		IPage<RevokeVO> pages;
-		pages =revokeService.selectRevokePage(Condition.getPage(query), revoke,revoke.getJurisdiction());
-//		if (revoke.getUsetype().equals("0")) {
-//			pages = revokeService.selectRevokePage(Condition.getPage(query), revoke,null);
-//		} else if (revoke.getUsetype().equals("1")) {
-//			String childer = informationService.selJurchilder(revoke.getJurisdiction());
-//			String[] split = childer.split(",");
-//			String strArrays = "";
-//			for (int j = 0; j < split.length; j++) {
-//				strArrays += "'" + split[j] + "',";
-//			}
-//			String jurisdiction = strArrays.substring(0, strArrays.length() - 1);
-//			pages =revokeService.selectRevokePage(Condition.getPage(query), revoke,jurisdiction);
-//		} else {
-//			pages =revokeService.selectRevokePage(Condition.getPage(query), revoke,null);
-//		}
-
+		pages = revokeService.selectRevokePage(Condition.getPage(query), revoke, revoke.getJurisdiction());
 		return R.data(pages);
 	}
 
@@ -113,7 +101,7 @@
 	public R save(@Valid @RequestBody Revoke revoke) {
 		String cardid = revoke.getCardid();
 		String type = revoke.getPtype();
-		Map map = revokeService.selectIn(cardid,type);
+		Map map = revokeService.selectIn(cardid, type);
 		if (map != null) {
 			String id = map.get("id").toString();
 			revokeService.removeByIds(Func.toLongList(id));
@@ -121,22 +109,22 @@
 		revoke.setStorage("1");
 		revoke.setType("2");
 		revoke.setPermitime(new Date());
-		revokeService.save(revoke);
-		//String formatStr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(revoke.getEstablishtime());
-		//String pertime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(revoke.getPermitime());
-		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() + "'"+ ")";
-		FtpUtil.sqlFileUpload(s);
+		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.FTP(s);
+		}
 		return R.success("成功");
 	}
 
@@ -149,7 +137,7 @@
 	public R revokesave(@Valid @RequestBody Revoke revoke) {
 		String cardid = revoke.getCardid();
 		String type = revoke.getPtype();
-		Map map = revokeService.selectIn(cardid,type);
+		Map map = revokeService.selectIn(cardid, type);
 		if (map != null) {
 			revoke.setStorage("0");
 			revokeService.updateById(revoke);
@@ -194,8 +182,8 @@
 	}
 
 	@PostMapping("/selectIn")
-	public R selectIn(String cardid,String type) {
-		Map map = revokeService.selectIn(cardid,type);
+	public R selectIn(String cardid, String type) {
+		Map map = revokeService.selectIn(cardid, type);
 		return R.data(map);
 	}
 

--
Gitblit v1.9.3