| | |
| | | import com.ruoyi.sy.domain.ArdSyUser; |
| | | import com.ruoyi.sy.domain.ArdTankLock; |
| | | import com.ruoyi.sy.domain.ArdTankWall; |
| | | import com.ruoyi.sy.gps31.PositionContainer; |
| | | import com.ruoyi.sy.mapper.ArdSyUserMapper; |
| | | import com.ruoyi.sy.mapper.ArdTankLockMapper; |
| | | import com.ruoyi.sy.mapper.ArdTankWallMapper; |
| | |
| | | private SYClient sYClient; |
| | | |
| | | private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | |
| | | private Map<String,Timer> timerMap = new HashMap(); |
| | | |
| | | /** |
| | | * 查询罐车锁操控日志 |
| | |
| | | |
| | | String paramsStr = lockNum + "02" + process + checkNum; |
| | | paramsStr = "%7B%22type%22%3A%22ff%22%2C%22dataCnt%22%3A%22" + paramsStr + "%22%7D"; |
| | | PositionContainer.getCarLockProcessThreadMap().get(carId).get(lockNum).put("lockProcess",new Thread());//加入容器 |
| | | Map<String,Object> result = sendCmd(syURL, ardSyUser.getUserId(), carId, 199, "DataDownTransfer", paramsStr, sessionId); |
| | | PositionContainer.getCarLockProcessThreadMap().get(carId).get(lockNum).remove("lockProcess");//移除容器 |
| | | if(((String)result.get("rspCode")).equals("0")){ |
| | | ArdTankLockProcessLog ardTankLockProcessLog = new ArdTankLockProcessLog(); |
| | | ardTankLockProcessLog.setId(IdUtils.simpleUUID()); |
| | |
| | | ardTankLockProcessLog.setProcessTime(this.sdf.format(new Date())); |
| | | ardTankLockProcessLogMapper.insertArdTankLockProcessLog(ardTankLockProcessLog); |
| | | return AjaxResult.success("发送成功"); |
| | | }else{ |
| | | }else if(((String)result.get("rspCode")).equals("-6")){ |
| | | return AjaxResult.error("找不到车辆"); |
| | | }else if(((String)result.get("rspCode")).equals("-5")){ |
| | | return AjaxResult.error("找不到用户"); |
| | | }else if(((String)result.get("rspCode")).equals("-4")){ |
| | | return AjaxResult.error("找不到指令"); |
| | | }else if(((String)result.get("rspCode")).equals("-3")){ |
| | | return AjaxResult.error("指令发送超时"); |
| | | }else if(((String)result.get("rspCode")).equals("-2")){ |
| | | return AjaxResult.error("离线待发"); |
| | | }else if(((String)result.get("rspCode")).equals("-1")){ |
| | | return AjaxResult.error("车辆离线"); |
| | | }else if(((String)result.get("rspCode")).equals("1")){ |
| | | return AjaxResult.error("发送失败"); |
| | | }else if(((String)result.get("rspCode")).equals("2")){ |
| | | return AjaxResult.error("消息有误"); |
| | | }else if(((String)result.get("rspCode")).equals("3")){ |
| | | return AjaxResult.error("不支持"); |
| | | }else{ |
| | | return AjaxResult.error("其他原因发送失败"); |
| | | } |
| | | }catch(Exception e){ |
| | | e.printStackTrace(); |
| | | return AjaxResult.error("发送失败"); |
| | | PositionContainer.getCarLockProcessThreadMap().get(carId).get(lockNum).remove("lockProcess");//移除容器 |
| | | return AjaxResult.error("发送失败" + e.toString()); |
| | | } |
| | | } |
| | | } |