| | |
| | | |
| | | 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 { |
| | |
| | | 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) { // 系统繁忙 |
| | |
| | | } 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); |
| | | Wxhtmethod.post(Contants.kj_zcLedUrl + "/SendLED",paramMap); |
| | | log.info("kj_zcLedUrl: " + Contants.kj_zcLedUrl + ";title:" + strTitle + ",content:" + strContent); |
| | | } |
| | | |
| | | String fillWithZero(int str){ |
| | | String s; |