| | |
| | | * @throws Exception |
| | | */ |
| | | @PostMapping("/push-grain") |
| | | public @ResponseBody BaseResp pushGrain(@RequestBody Fz40Grain grainData) throws Exception { |
| | | public @ResponseBody |
| | | BaseResp pushGrain(@RequestBody Fz40Grain grainData) { |
| | | |
| | | BaseResp resp = new BaseResp(); |
| | | try { |
| | | |
| | | log.info("----------主动推送粮情接口执行----{}",grainData); |
| | | |
| | | //根据系统仓库编码获取配置设备信息 |
| | | GatewayDevice device = GatewayUtils.getCacheByDepotSysId(grainData.getDepotId()); |
| | |
| | | reqData.setDeviceId(device.getDeviceId()); |
| | | |
| | | reqData.setDevice(device); |
| | | reqData.setData(resp.getData()); |
| | | |
| | | //手动推送到平台 |
| | | resp = reportService.reportGrainDataByHand(reqData); |
| | | |
| | | |
| | | } catch (Exception e) { |
| | | log.error("-----------手动推送粮情数据执行异常---{}", e); |
| | | resp.setCode(BaseResp.CODE_500); |
| | | resp.setMsg("执行异常:" + e.getMessage()); |
| | | } |
| | | return resp; |
| | | } |
| | | |
| | | } |