| | |
| | | |
| | | 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 { |
| | |
| | | return prr; |
| | | } |
| | | } catch (Exception e) { |
| | | // TODO: handle exception |
| | | } |
| | | |
| | | String currPch="";// 当前批次号 |
| | | List<String> pchList = new ArrayList<>(); |
| | | //第一次添加装卸记录发送装车信息 |
| | | int sfzc=this.fbper.getbsitembyNo(fdb.getBsNo()); |
| | | if(sfzc<=0) { |
| | |
| | | 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); |
| | |
| | | prr.setErrmsg(jsonObject.get("errmsg").getAsString()); |
| | | return prr; |
| | | } |
| | | }*/ |
| | | } |
| | | for (JsonElement je : dataArr) { |
| | | JsonObject jo=je.getAsJsonObject(); |
| | | String tdmx_pch = jo.get("tdmx_pch").getAsString(); |
| | |
| | | remp.put("tdmx_tdfl",tdmx.getTdmx_tdfl()); |
| | | relist.add(remp); |
| | | currPch = tdmx.getTdmx_pch(); |
| | | pchList.add(tdmx.getTdmx_pch()); |
| | | } |
| | | |
| | | if(grossNum>0) { |
| | |
| | | |
| | | // 此处异步触发一下明晟发车 |
| | | if("06".equals(fdb.getSdepartNo())) { |
| | | final String cph = currPch; |
| | | final String pch = currPch; |
| | | final String finalVehicleId = vehicleId; |
| | | ThreadPoolUtil.getInstance().execute(()->{ |
| | | Map paramMap = new HashMap(); |
| | | paramMap.put("vehicleId", finalVehicleId); |
| | | paramMap.put("tdmxPchList", tdmxPchList); |
| | | String jsonStr = Jacksonmethod.tojson(paramMap, false); |
| | | JsonObject jsonObject = Wxhtmethod.postJsonStr(Contants.ms_DoScanUrl, jsonStr); |
| | | if (jsonObject.get("code").getAsInt() != 0) { |
| | | prr.setCode(1); |
| | | prr.setErrmsg(jsonObject.get("errmsg").getAsString()); |
| | | // return prr; |
| | | } |
| | | }); |
| | | // 延迟1.5秒执行,保证数据执行完了 |
| | | ThreadPoolUtil.getInstance().execute(()->{ |
| | | synchronized (FdXSTDService.refreshMsLedLock) { |
| | | if (FdXSTDService.refreshMsLedLock) { // 系统繁忙 |
| | | log.info(finalVehicleId + "" + cph + "系统繁忙!"); |
| | | log.info(finalVehicleId + "" + pch + "系统繁忙!"); |
| | | return; |
| | | } |
| | | } |
| | |
| | | synchronized (FdXSTDService.refreshMsLedLock) { |
| | | FdXSTDService.refreshMsLedLock = true; |
| | | } |
| | | sendToMsLed(cph); |
| | | sendToMsLed(pch); |
| | | } catch (Exception e) { |
| | | log.error("出现异常:"+ e.getMessage(),e); |
| | | } finally { |
| | |
| | | FdXSTDService.refreshMsLedLock = false; |
| | | } |
| | | } |
| | | }); |
| | | },1500); |
| | | } |
| | | 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) { // 系统繁忙 |
| | |
| | | } |
| | | } |
| | | }); |
| | | } 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; |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | prr.setCode(0); |
| | | prr.setErrmsg("装车操作成功!"); |
| | |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * 挪到一卡通 |
| | | * @param currPch 当前批次号 |
| | | */ |
| | | public void sendToMsLed(String currPch){ |
| | | //A区 76-86 + 99-1 |
| | | //B区 14-33 + 99-2 |
| | | //C区 53-67 + 99-3 |
| | | // 2024年改 |
| | | //A区 73-88 + 99-1 + 40-45 |
| | | //B区 14-27 + 99-2 + 46-49 |
| | | //C区 50-65 + 99-3 |
| | | //D区 28-39 + 69-72 + 89-98 |
| | | log.info("LED-ABC当前扫码批次号:" + currPch); |
| | | List<Map> totalList = tdmxper.getHwList("06"); // 获取明晟所有在办业务单的信息 |
| | | log.info("LED-ABC获取信息条数:" + totalList.size()); |
| | |
| | | Map speakParam = new HashMap(1); |
| | | for (Map.Entry<String, List<Map>> entry : ywbhListMap.entrySet()) { |
| | | // 遍历每个业务单的 |
| | | // 当前装车A、B、C区 |
| | | boolean currA = false,currB = false, currC = false; |
| | | // 当前装车A、B、C区; D区只参与记录,不参与LED显示和语言播报 |
| | | boolean currA = false,currB = false, currC = false, currD = false; |
| | | boolean hasZcwc = false; // 保证已经完成了 |
| | | String ywhb = entry.getKey(); |
| | | List<Map> vehicleIdTotalList = entry.getValue(); |
| | | Map<String, Integer> totalAbcMap = new HashMap(3); // 总计信息 |
| | | // 总计信息 |
| | | Map<String, Integer> totalAbcMap = new HashMap(3); |
| | | totalAbcMap.put("A", 0); |
| | | totalAbcMap.put("B", 0); |
| | | totalAbcMap.put("C", 0); |
| | | Map<String, Integer> abcMap = new HashMap(3); // 已装信息 |
| | | /* 已装信息 */ |
| | | Map<String, Integer> abcMap = new HashMap(3); |
| | | abcMap.put("A", 0); |
| | | abcMap.put("B", 0); |
| | | abcMap.put("C", 0); |
| | |
| | | String hh = hw.replaceAll("\\-.*",""); |
| | | hh = hh.substring(hh.length()-2); // 取最后两位 |
| | | int num = Integer.parseInt(hh); |
| | | if (num >= 76 && num <= 86 || hw.lastIndexOf("99-1") >= 0) { // A区 |
| | | if (num >= 73 && num <= 88 || hw.lastIndexOf("99-1") >= 0) { // A区 |
| | | totalAbcMap.put("A",totalAbcMap.get("A") + 1); |
| | | if (zcbz != null && zcbz == 1) { // 装车完成 |
| | | abcMap.put("A", abcMap.get("A") + 1); |
| | | hasZcwc = true; |
| | | } |
| | | if(pch.equals(currPch)) { |
| | | currA = true; currB = false;currC =false; |
| | | currA = true; currB = false;currC =false;currD=false; |
| | | } |
| | | } else if (num >= 14 && num <= 33 || hw.lastIndexOf("99-2") >= 0) { // B区 |
| | | } else if (num >= 14 && num <= 27 || hw.lastIndexOf("99-2") >= 0) { // B区 |
| | | totalAbcMap.put("B", totalAbcMap.get("B") + 1); |
| | | if (zcbz != null && zcbz == 1) { |
| | | abcMap.put("B", abcMap.get("B") + 1); |
| | | hasZcwc = true; |
| | | } |
| | | if(pch.equals(currPch)) { |
| | | currA = false; currB = true;currC =false; |
| | | currA = false; currB = true;currC =false;currD=false; |
| | | } |
| | | } else if (num >= 53 && num <= 67 || hw.lastIndexOf("99-3") >= 0) { // C区 |
| | | } else if (num >= 50 && num <= 65 || hw.lastIndexOf("99-3") >= 0) { // C区 |
| | | totalAbcMap.put("C", totalAbcMap.get("C") + 1); |
| | | if (zcbz != null && zcbz == 1) { |
| | | abcMap.put("C", abcMap.get("C") + 1); |
| | | hasZcwc = true; |
| | | } |
| | | if(pch.equals(currPch)) { |
| | | currA = false; currB = false; currC =true; |
| | | currA = false; currB = false; currC =true; currD=false; |
| | | } |
| | | } else if(num>=28 && num<=39 || (num>=69 && num<=72) || (num>=89 && num<=98)) { |
| | | if(pch.equals(currPch)) { |
| | | currA = false; currB = false;currC =false;currD=true; |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 准备语音 |
| | | * 准备语音 ,挪到一卡通 |
| | | * @param cph 车牌号 |
| | | * @param total 当前区总数 |
| | | * @param abcMap A、B、C为key的区已装数目 |
| | |
| | | String strTitle="序号 车号 装车区 状态\r\n"; |
| | | String strContent = ""; |
| | | String contentFormatStr = "%s %s %s %s\r\n"; |
| | | List<Map> list = tdmxper.yRZcList("08"); |
| | | List<Map> list = tdmxper.kjZcList("08"); |
| | | int index = 1; |
| | | for (Map map : list) { |
| | | String numberplates = (String) map.get("numberplates"); // 车牌号 |
| | |
| | | paramMap.put("strContent",strContent); |
| | | 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.kjZcList("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){ |
| | |
| | | return orr; |
| | | } |
| | | } catch (Exception e) { |
| | | // TODO: handle exception |
| | | } |
| | | // Fd_Bsheet nr=this.fbper.getbyVehicleId(vehicleId, Serviceenum.在办); |
| | | // if(nr==null){ |
| | |
| | | } |
| | | |
| | | @Override |
| | | public ObjectResult<Map<String, Object>> getcInfo(String cardID) { |
| | | public ObjectResult<Map<String, Object>> getcInfo(String cardID,boolean needRecord) { |
| | | ObjectResult<Map<String, Object>> orr=new ObjectResult<Map<String,Object>>(); |
| | | Map<String, Object> rem=new HashMap<String, Object>(); |
| | | Map<String, Object> mp=this.yktper.getcardinuse(cardID); |
| | |
| | | }else { |
| | | mr.put("firstzxhtime", new Date()); |
| | | } |
| | | this.bsper.updateTaskTime(mr); |
| | | if(needRecord) { // 为true 则更新第一次扫卡时间,否则不记录 |
| | | this.bsper.updateTaskTime(mr); |
| | | } |
| | | }else { |
| | | orr.setCode(1); |
| | | orr.setErrmsg("未找到装车记录"); |