From 975c04c0181b3da82a79cb04abe6a2f1799eb363 Mon Sep 17 00:00:00 2001
From: hjg <hjg@123.com>
Date: 星期三, 22 十一月 2023 17:33:04 +0800
Subject: [PATCH] 科技LED、公司简称

---
 JavaSource/com/mandi/webservice/service/impl/FdXSTDService.java |   58 +++++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 51 insertions(+), 7 deletions(-)

diff --git a/JavaSource/com/mandi/webservice/service/impl/FdXSTDService.java b/JavaSource/com/mandi/webservice/service/impl/FdXSTDService.java
index ab42c4e..ee76ae9 100644
--- a/JavaSource/com/mandi/webservice/service/impl/FdXSTDService.java
+++ b/JavaSource/com/mandi/webservice/service/impl/FdXSTDService.java
@@ -67,7 +67,7 @@
 
 	public static Boolean refreshMsLedLock = false;
 	public static Boolean refreshYrLedLock = false;
-
+	public static Boolean refreshKjLedLock = false;
 	@Override
 	@Transactional(rollbackFor=Exception.class)
 	public ObjectResult<Boolean> saveFd_xstd(String dataArr) throws Exception {
@@ -460,7 +460,7 @@
 			String tdmx_pch = jo.get("tdmx_pch").getAsString();
 			tdmxPchList.add(tdmx_pch);
 		}
-		/*if("08".equals(fdb.getSdepartNo())) { // 鍙槸涔夌憺鍘傚尯鏈夋晥
+		if("08".equals(fdb.getSdepartNo())) { // 鍙槸涔夌憺鍘傚尯鏈夋晥
 			// 妫�鏌ユ槸鍚﹀綋鍓嶅尯鍩熷凡缁忔帓闃�
 			Map paramMap = new HashMap();
 			paramMap.put("vehicleId", vehicleId);
@@ -472,7 +472,7 @@
 				prr.setErrmsg(jsonObject.get("errmsg").getAsString());
 				return prr;
 			}
-		}*/
+		}
 		for (JsonElement je : dataArr) {
 			JsonObject jo=je.getAsJsonObject();
 			String tdmx_pch = jo.get("tdmx_pch").getAsString();
@@ -633,11 +633,10 @@
 		if("08".equals(fdb.getSdepartNo())) {
 			final String cph = currPch;
 			ThreadPoolUtil.getInstance().execute(()->{
-
-				Map scanCodeParamMap = new HashMap();
+				// 杩欎釜鍦版柟涓嶅啀璇锋眰
+				/*Map scanCodeParamMap = new HashMap();
 				scanCodeParamMap.put("pch",cph);
-				Wxhtmethod.post(Contants.yr_scanCodeNoticeUrl, scanCodeParamMap);
-
+				Wxhtmethod.post(Contants.yr_scanCodeNoticeUrl, scanCodeParamMap);*/
 				try {
 					synchronized (FdXSTDService.refreshYrLedLock) {
 						if (FdXSTDService.refreshYrLedLock) { // 绯荤粺绻佸繖
@@ -651,6 +650,25 @@
 				} finally {
 					synchronized (FdXSTDService.refreshYrLedLock) {
 						FdXSTDService.refreshYrLedLock = false;
+					}
+				}
+			});
+		} else if("04".equals(fdb.getSdepartNo())) { // 绉戞妧
+			final String cph = currPch;
+			ThreadPoolUtil.getInstance().execute(()->{
+				try {
+					synchronized (FdXSTDService.refreshKjLedLock) {
+						if (FdXSTDService.refreshKjLedLock) { // 绯荤粺绻佸繖
+							return  ;
+						}
+						FdXSTDService.refreshKjLedLock = true;
+					}
+					sendToKjLed(cph);
+				} catch (Exception e) {
+					log.error(e);
+				} finally {
+					synchronized (FdXSTDService.refreshKjLedLock) {
+						FdXSTDService.refreshKjLedLock = false;
 					}
 				}
 			});
@@ -894,6 +912,32 @@
 			Wxhtmethod.post(Contants.yr_zcLedUrl + "/SendLED",paramMap);
 			log.info("yr_zcLedUrl: " + Contants.yr_zcLedUrl + ";title:" + strTitle + ",content:" + strContent);
 	}
+	@Override
+	public void sendToKjLed(String currPch) {
+		// 鐘舵�� 涓�纾呭悗锛屽緟瑁咃紱PDA鎵爜 鍦ㄨ锛� 浜屾杩囩鍚庢秷澶�
+		// 瑁呰溅鍖� 涓や釜姹夊瓧鍔犱袱涓嫳鏂囨垨鏁板瓧
+		String strTitle="搴忓彿  杞﹀彿   瑁呰溅鍖�  鐘舵�乗r\n";
+		String strContent = "";
+		String contentFormatStr = "%s   %s  %s   %s\r\n";
+		List<Map> list = tdmxper.yRZcList("04");
+		int index = 1;
+		for (Map map : list) {
+			String numberplates = (String) map.get("numberplates"); // 杞︾墝鍙�
+			String zcWz = (String) map.get("zcWz"); // 瑁呰溅浣嶇疆
+			if(StringUtils.isNotBlank(zcWz)) {
+				zcWz = zcWz.substring(0,4);
+			} else { // 绌烘槸6涓綅缃�
+				zcWz = "      ";
+			}
+			String zcStatus = (String) map.get("zcStatus"); // 瑁呰溅浣嶇疆 鍦ㄥ姙/寰呭姙
+			strContent += String.format(contentFormatStr, fillWithZero(index++), numberplates, zcWz, zcStatus);
+		}
+		Map paramMap = new HashMap();
+		paramMap.put("strTitle",strTitle);
+		paramMap.put("strContent",strContent);
+		String re = Wxhtmethod.post(Contants.kj_zcLedUrl + "/SendLED",paramMap);
+		log.info("鍥炲锛�" + re +";kj_zcLedUrl: " + Contants.kj_zcLedUrl + ";title:" + strTitle + ",content:" + strContent);
+	}
 
 	String fillWithZero(int str){
 		String s;

--
Gitblit v1.9.3