| | |
| | | import com.ld.igds.camera.data.ApiCameraResp; |
| | | import com.ld.igds.camera.data.ApiSnapReq; |
| | | import com.ld.igds.constant.BizType; |
| | | import com.ld.igds.constant.DeviceType; |
| | | import com.ld.igds.data.SnapImgDto; |
| | | import com.ld.igds.file.CoreFileService; |
| | | import com.ld.igds.inout.ApiInoutManager; |
| | |
| | | public void onReceivePlateNum(ApiInoutData data) { |
| | | |
| | | InoutConf conf = this.getInoutConfBySn(data.getCompanyId(), data.getDeptId(), data.getSn()); |
| | | |
| | | if (null == conf) return; |
| | | |
| | | if (null == conf) { |
| | | log.error("没有获取到出入库配置CONF:"+data.toString()); |
| | | return; |
| | | } |
| | | log.info(conf.toString()); |
| | | if (0 == conf.getInOrder()) return; |
| | | |
| | | data = new ApiInoutData(conf); |
| | | |
| | | ApiInoutService inoutApiService = apiInoutManager.getApiService(conf.getProtocol()); |
| | | |
| | | log.info(data.toString()); |
| | | ApiInoutService inoutApiService = null; |
| | | InoutConf gateconf = null; |
| | | //获取车牌信息,开闸机 |
| | | if (InoutApiConstant.DEVICE_CODE_1002 == data.getDeviceCode()) { |
| | | gateconf = this.getWeightGateway(data.getCompanyId(), data.getDeptId(), null); |
| | | if (null == gateconf) { |
| | | log.info("----------没有获取到称重控制器--------------"); |
| | | } |
| | | data = new ApiInoutData(gateconf); |
| | | //开入口处道闸 |
| | | inoutApiService = apiInoutManager.getApiService(gateconf.getProtocol()); |
| | | data.setDeviceCode(InoutApiConstant.DEVICE_CODE_2002); |
| | | data.setActionCode(InoutApiConstant.ACTION_CODE_1); |
| | | |
| | | inoutApiService.gateControl(data); |
| | | } |
| | | |
| | | |
| | | if (InoutApiConstant.DEVICE_CODE_1003 == data.getDeviceCode()) { |
| | | gateconf = this.getWeightGateway(data.getCompanyId(), data.getDeptId(), null); |
| | | if (null == gateconf) { |
| | | log.info("----------没有获取到称重控制器--------------"); |
| | | } |
| | | //开入口处道闸 |
| | | data = new ApiInoutData(gateconf); |
| | | inoutApiService = apiInoutManager.getApiService(gateconf.getProtocol()); |
| | | data.setDeviceCode(InoutApiConstant.DEVICE_CODE_2003); |
| | | data.setActionCode(InoutApiConstant.ACTION_CODE_1); |
| | | |
| | | inoutApiService.gateControl(data); |
| | | } |
| | | |
| | |
| | | ApiInoutData apiInoutData; |
| | | ApiInoutService inoutApiService; |
| | | for (InoutConf conf : listInoutConf) { |
| | | if (InoutConstant.CONF_TYPE_10.equals(conf.getType()) && sort.equals(conf.getSort())) { |
| | | if (InoutConstant.PROGRESS_WEIGHT_TAG.equals(conf.getInoutProgress())&&InoutConstant.CONF_TYPE_10.equals(conf.getType()) && sort.equals(conf.getSort())) { |
| | | apiInoutData = new ApiInoutData(conf); |
| | | inoutApiService = apiInoutManager.getApiService(conf.getProtocol()); |
| | | inoutApiService.initLpr(apiInoutData); |
| | |
| | | if (InoutConstant.TYPE_IN.equals(data.getType())) { |
| | | //结算重量大于0表示二次称重 |
| | | if (data.getNetWeight() > 0) { |
| | | apiData.setDeviceCode(InoutApiConstant.DEVICE_CODE_1002); |
| | | apiData.setDeviceCode(InoutApiConstant.DEVICE_CODE_2002); |
| | | } else { |
| | | apiData.setDeviceCode(InoutApiConstant.DEVICE_CODE_1003); |
| | | apiData.setDeviceCode(InoutApiConstant.DEVICE_CODE_2003); |
| | | } |
| | | apiData.setActionCode(InoutApiConstant.ACTION_CODE_1); |
| | | |
| | |
| | | } else { |
| | | //结算重量大于0表示二次称重 |
| | | if (data.getNetWeight() > 0) { |
| | | apiData.setDeviceCode(InoutApiConstant.DEVICE_CODE_1003); |
| | | apiData.setDeviceCode(InoutApiConstant.DEVICE_CODE_2002); |
| | | } else { |
| | | apiData.setDeviceCode(InoutApiConstant.DEVICE_CODE_1002); |
| | | apiData.setDeviceCode(InoutApiConstant.DEVICE_CODE_2003); |
| | | } |
| | | apiData.setActionCode(InoutApiConstant.ACTION_CODE_1); |
| | | inoutApiService.gateControl(apiData); |