From 8d43111bd0e598bc0b2014cbfa69a32e74959dff Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Wed, 15 Dec 2021 19:24:05 +0800
Subject: [PATCH] ftp sql 同步封装

---
 src/main/java/org/springblade/modules/revoke/controller/RevokeController.java |   38 +++++++++++++++++++++++++++-----------
 1 files changed, 27 insertions(+), 11 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 9597958..a309645 100644
--- a/src/main/java/org/springblade/modules/revoke/controller/RevokeController.java
+++ b/src/main/java/org/springblade/modules/revoke/controller/RevokeController.java
@@ -28,6 +28,8 @@
 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;
@@ -51,7 +53,7 @@
 public class RevokeController extends BladeController {
 
 	private final IRevokeService revokeService;
-
+	private final IInformationService informationService;
 	/**
 	 * 详情
 	 */
@@ -82,7 +84,23 @@
 	@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());
+//		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);
+//		}
+
 		return R.data(pages);
 	}
 
@@ -104,22 +122,20 @@
 		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,establishTime," +
+		//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,permitime,deptid,ptype,representativecell,contacts,contactscell,reason,jurisdiction)" +
+			"address,business,region,registration,industry,type,deptid,ptype,representativecell,contacts,contactscell,reason,jurisdiction,cardid)" +
 			"values(" + "'" + revoke.getId() + "'" + "," + "'" + revoke.getCreditcode() + "'" + "," + "'" + revoke.getEnterprisename() + "'" + "," + "'"
-			+ revoke.getRepresentative() + "'" + "," +
-			"'" + formatStr + "'" + "," + "'" + revoke.getRegisteredcapital() + "'" + "," + "'"
+			+ revoke.getRepresentative() + "'" + "," + "'" + revoke.getRegisteredcapital() + "'" + "," + "'"
 			+ revoke.getOrganizationcode() + "'" + "," + "'" + revoke.getRegistrationnumber() + "'" + "," +
 			"'" + revoke.getIdentificationnumber() + "'" + "," + "'" + revoke.getEnterprises() + "'" + "," + "'" +
 			revoke.getAddress() + "'" + "," + "'" + revoke.getBusiness() + "'" + "," + "'" +
 			revoke.getRegion() + "'" + "," + "'" + revoke.getRegistration() + "'" + "," + "'" + revoke.getIndustry() + "'" + "," + "'"
-			+ revoke.getType() + "'" + "," +
-			"'" + pertime + "'" + "," + "'" + revoke.getDeptid() + "'" + "," + "'" + revoke.getPtype() + "'" + "," +
+			+ revoke.getType() + "'" + "," + "'" + revoke.getDeptid() + "'" + "," + "'" + revoke.getPtype() + "'" + "," +
 			"'" + revoke.getRepresentativecell() + "'" + "," + "'" + revoke.getContacts() + "'" + "," + "'" + revoke.getContactscell() + "'" + "," +
-			"'" + revoke.getReason() + "'" + "," + "'" + revoke.getJurisdiction() + "'" + ")";
+			"'" + revoke.getReason() + "'" + "," + "'" + revoke.getJurisdiction() + "'" +"," + "'" + revoke.getCardid() + "'"+ ")";
 		FtpUtil.sqlFileUpload(s);
 		return R.success("成功");
 	}

--
Gitblit v1.9.3