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 | 72 +++++++++++++++++++++++++++++++++++- 1 files changed, 70 insertions(+), 2 deletions(-) diff --git a/JavaSource/com/mandi/webservice/service/impl/FdXSTDService.java b/JavaSource/com/mandi/webservice/service/impl/FdXSTDService.java index 3698132..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 { @@ -415,6 +415,7 @@ prr.setErrmsg("鍙傛暟锛氬崱鍙峰叧鑱旂殑杞︾墝鍙峰拰涓氬姟鍗曞叧鑱旂殑杞︾墝鍙蜂笉涓�鑷�"); return prr; } + // yktywdh = fdb.getBsNo(); int wcnum=this.bsper.getweightDoc(vehicleId, fdb.getBsNo()); @@ -453,7 +454,25 @@ } // 鐜板満杩囧畬姣涢噸鍚庡嚭鐜版壂鐮佽杞︾殑锛屽繀椤婚噸鏂拌繃纾� int grossNum=this.bsper.getgrosstDoc(vehicleId, fdb.getBsNo()); - + List tdmxPchList = new ArrayList(); + for (JsonElement je : dataArr) { + JsonObject jo=je.getAsJsonObject(); + String tdmx_pch = jo.get("tdmx_pch").getAsString(); + tdmxPchList.add(tdmx_pch); + } + if("08".equals(fdb.getSdepartNo())) { // 鍙槸涔夌憺鍘傚尯鏈夋晥 + // 妫�鏌ユ槸鍚﹀綋鍓嶅尯鍩熷凡缁忔帓闃� + Map paramMap = new HashMap(); + paramMap.put("vehicleId", vehicleId); + paramMap.put("tdmxPchList", tdmxPchList); + String jsonStr = Jacksonmethod.tojson(paramMap, false); + JsonObject jsonObject = Wxhtmethod.postJsonStr(Contants.yr_canDoScanUrl, jsonStr); + if (jsonObject.get("code").getAsInt() != 0) { + prr.setCode(1); + prr.setErrmsg(jsonObject.get("errmsg").getAsString()); + return prr; + } + } for (JsonElement je : dataArr) { JsonObject jo=je.getAsJsonObject(); String tdmx_pch = jo.get("tdmx_pch").getAsString(); @@ -614,6 +633,10 @@ if("08".equals(fdb.getSdepartNo())) { final String cph = currPch; ThreadPoolUtil.getInstance().execute(()->{ + // 杩欎釜鍦版柟涓嶅啀璇锋眰 + /*Map scanCodeParamMap = new HashMap(); + scanCodeParamMap.put("pch",cph); + Wxhtmethod.post(Contants.yr_scanCodeNoticeUrl, scanCodeParamMap);*/ try { synchronized (FdXSTDService.refreshYrLedLock) { if (FdXSTDService.refreshYrLedLock) { // 绯荤粺绻佸繖 @@ -627,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; } } }); @@ -870,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