| | |
| | | |
| | | 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 { |
| | |
| | | String tdmx_pch = jo.get("tdmx_pch").getAsString(); |
| | | tdmxPchList.add(tdmx_pch); |
| | | } |
| | | // 检查是否当前区域已经排队 |
| | | 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) { |
| | | 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(); |
| | |
| | | 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) { // 系统繁忙 |
| | |
| | | } 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; |
| | | } |
| | | } |
| | | }); |
| | |
| | | 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; |