| | |
| | | return str; |
| | | } |
| | | |
| | | @Override |
| | | public String receiveCurrWeight(HttpServletRequest r, String jsonParam) { // 获取业务单号 一次称重 二次称重 |
| | | JsonParser jp=new JsonParser(); |
| | | JsonObject jo=jp.parse(jsonParam).getAsJsonObject(); |
| | | String businessNo = JSONobj.getstring(jo, "businessNo"); |
| | | boolean firstWeighing = JSONobj.getbool(jo, "firstWeighing"); |
| | | boolean secondWeighing = JSONobj.getbool(jo, "secondWeighing"); |
| | | String sdepartNo = JSONobj.getstring(jo, "sdepartNo"); |
| | | if(StringUtils.isBlank(businessNo) || businessNo.indexOf("XS")!=0 || StringUtils.isBlank(sdepartNo) |
| | | ) { |
| | | return null; |
| | | } |
| | | // 刷新 |
| | | if(firstWeighing || secondWeighing) { // 称重需要刷新一下 |
| | | if ("06".equals(sdepartNo)) { // 明晟 |
| | | synchronized (FdXSTDService.refreshMsLedLock) { |
| | | if (FdXSTDService.refreshMsLedLock) { // 系统繁忙 |
| | | return null; |
| | | } |
| | | } |
| | | try { |
| | | synchronized (FdXSTDService.refreshMsLedLock) { |
| | | FdXSTDService.refreshMsLedLock = true; |
| | | } |
| | | fdser.sendToMsLed(null); |
| | | } finally { |
| | | synchronized (FdXSTDService.refreshMsLedLock) { |
| | | FdXSTDService.refreshMsLedLock = false; |
| | | } |
| | | } |
| | | }else if ("08".equals(sdepartNo)) { // 义瑞 |
| | | synchronized (FdXSTDService.refreshYrLedLock) { |
| | | if (FdXSTDService.refreshYrLedLock) { // 系统繁忙 |
| | | return null; |
| | | } |
| | | } |
| | | try { |
| | | synchronized (FdXSTDService.refreshYrLedLock) { |
| | | FdXSTDService.refreshYrLedLock = true; |
| | | } |
| | | fdser.sendToYrLed(null); |
| | | }finally { |
| | | synchronized (FdXSTDService.refreshYrLedLock) { |
| | | FdXSTDService.refreshYrLedLock = false; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | } |