| | |
| | | //将称重重量写入设备基础数据中的gross_wt字段 |
| | | if(scale > 20) { |
| | | BasDevpService basDevpService = SpringUtils.getBean(BasDevpService.class); |
| | | Integer staNo = slave.getId() == 1 ? 101 : 201; |
| | | BasDevp basDevp = basDevpService.selectById(staNo); |
| | | BasDevp basDevp = basDevpService.selectById(slave.getStaNo()); |
| | | if(!Cools.isEmpty(basDevp)) { |
| | | basDevp.setGrossWt(scale); |
| | | if (null != basDevpService && !basDevpService.updateById(basDevp)) { |
| | |
| | | } |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("time", DateUtils.convert(new Date(), DateUtils.yyyyMMddHHmmss_F)); |
| | | jsonObject.put("id", staNo); |
| | | jsonObject.put("id", slave.getStaNo()); |
| | | jsonObject.put("scale", scale); |
| | | if (OutputQueue.SCALE.size() >= 32) { |
| | | OutputQueue.SCALE.poll(); |