| | |
| | | import com.ld.igds.file.CoreFileService; |
| | | import com.ld.igds.inout.ApiInoutManager; |
| | | import com.ld.igds.inout.ApiInoutService; |
| | | import com.ld.igds.inout.InoutApiConstant; |
| | | import com.ld.igds.inout.InoutConstant; |
| | | import com.ld.igds.inout.dto.*; |
| | | import com.ld.igds.inout.service.InoutService; |
| | |
| | | apiData.setMsg("称重已完成"); |
| | | |
| | | // apiInoutManager.getApiService(apiData.getProtocol()).noticeWeightDone(apiData); |
| | | // apiInoutManager.getApiService(apiData.getProtocol()).noticeRadio(apiData); |
| | | // apiInoutManager.getApiService(apiData.getProtocol()).noticeRadio(apiData); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Async |
| | | public void onInoutWeight(InoutData data, String curProgress, String nextProgress) { |
| | | //获取地磅控制器 |
| | | InoutConf conf = this.getWeightGateway(data.getCompanyId(), data.getDeptId(), null); |
| | | if (null == conf) { |
| | | log.info("----------称重完成事件,没有获取到称重控制器--------------"); |
| | | } |
| | | |
| | | //1、通知称重显示屏 |
| | | //1、通知称重显示屏,设备编号6001 |
| | | ApiInoutData apiData = new ApiInoutData(conf); |
| | | apiData.setTime(new Date()); |
| | | apiData.setDeviceId(InoutApiConstant.DEVICE_CODE_6001); |
| | | ApiInoutService inoutApiService = apiInoutManager.getApiService(conf.getProtocol()); |
| | | inoutApiService.noticeLed(apiData, data); |
| | | |
| | | //2、语音通知 |
| | | apiData.setDeviceId(InoutApiConstant.DEVICE_CODE_8001); |
| | | inoutApiService.noticeRadio(apiData, data); |
| | | |
| | | //3、开闸机 |
| | | if (InoutConstant.TYPE_IN.equals(data.getType())) { |
| | | //结算重量大于0表示二次称重 |
| | | if (data.getNetWeight() > 0) { |
| | | apiData.setDeviceId(InoutApiConstant.DEVICE_CODE_1002); |
| | | } else { |
| | | apiData.setDeviceId(InoutApiConstant.DEVICE_CODE_1003); |
| | | } |
| | | apiData.setActionCode(InoutApiConstant.ACTION_CODE_1); |
| | | |
| | | inoutApiService.gateControl(apiData); |
| | | } else { |
| | | //结算重量大于0表示二次称重 |
| | | if (data.getNetWeight() > 0) { |
| | | apiData.setDeviceId(InoutApiConstant.DEVICE_CODE_1003); |
| | | } else { |
| | | apiData.setDeviceId(InoutApiConstant.DEVICE_CODE_1002); |
| | | } |
| | | apiData.setActionCode(InoutApiConstant.ACTION_CODE_1); |
| | | inoutApiService.gateControl(apiData); |
| | | } |
| | | |
| | | //4、开红绿灯 |
| | | if (InoutConstant.TYPE_IN.equals(data.getType())) { |
| | | //结算重量大于0表示二次称重 |
| | | if (data.getNetWeight() > 0) { |
| | | apiData.setDeviceId(InoutApiConstant.DEVICE_CODE_7001); |
| | | } else { |
| | | apiData.setDeviceId(InoutApiConstant.DEVICE_CODE_7002); |
| | | } |
| | | apiData.setActionCode(InoutApiConstant.ACTION_CODE_1); |
| | | |
| | | inoutApiService.lightControl(apiData); |
| | | } else { |
| | | //结算重量大于0表示二次称重 |
| | | if (data.getNetWeight() > 0) { |
| | | apiData.setDeviceId(InoutApiConstant.DEVICE_CODE_7002); |
| | | } else { |
| | | apiData.setDeviceId(InoutApiConstant.DEVICE_CODE_7001); |
| | | } |
| | | apiData.setActionCode(InoutApiConstant.ACTION_CODE_1); |
| | | inoutApiService.lightControl(apiData); |
| | | } |
| | | |
| | | } |
| | | |
| | | |