| | |
| | | @Repository |
| | | public interface ApiLogMapper extends BaseMapper<ApiLog> { |
| | | |
| | | int clearWeekBefore(); |
| | | } |
| | |
| | | |
| | | void save(String namespace, String url, String appkey, String ip, String request, String response, boolean success); |
| | | |
| | | boolean clearWeekBefore(); |
| | | } |
| | |
| | | log.error("接口调用日志保存失败!"); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public boolean clearWeekBefore() { |
| | | return this.baseMapper.clearWeekBefore() > 0; |
| | | } |
| | | } |
| | |
| | | }catch (Exception e){ |
| | | log.error("堆垛机任务完成,请求wms任务完成接口失败"); |
| | | } |
| | | ApiLogService apiLogService = SpringUtils.getBean(ApiLogService.class); |
| | | // ApiLogService apiLogService = SpringUtils.getBean(ApiLogService.class); |
| | | apiLogService.save("Wms任务完成接口" |
| | | ,"10.32.53.195:8080"+"/wcsManager/wcsInterface/taskStatusFeedback" |
| | | ,null |
| | |
| | | } |
| | | } |
| | | |
| | | @Scheduled(cron = "0 0 1 * * ? ") |
| | | public void clearApiLog(){ |
| | | try { |
| | | apiLogService.clearWeekBefore(); |
| | | } catch (Exception e) { |
| | | log.error("第三方接口日志自动清除失败(范围:一周之前", e); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | one.setDestinationPosY(siemensNet.getByteTransform().TransInt16(resultRead.Content, 16)); |
| | | // one.setSourceStaNo(siemensNet.getByteTransform().TransInt16(resultRead.Content, 18)); |
| | | // one.setDestinationStaNo(siemensNet.getByteTransform().TransInt16(resultRead.Content, 20)); |
| | | if (!crnCommand.getTaskNo().equals(one.getTaskNo()) && !crnCommand.getAckFinish().equals(one.getAckFinish()) |
| | | && !crnCommand.getSourcePosZ().equals(one.getSourcePosZ()) && !crnCommand.getSourcePosX().equals(one.getSourcePosX()) && !crnCommand.getSourcePosY().equals(one.getSourcePosY()) |
| | | && !crnCommand.getDestinationPosZ().equals(one.getDestinationPosZ()) && !crnCommand.getDestinationPosX().equals(one.getDestinationPosX()) && !crnCommand.getDestinationPosY().equals(one.getDestinationPosY()) |
| | | if (!command.getTaskNo().equals(one.getTaskNo()) || !command.getTaskMode().equals(one.getTaskMode()) |
| | | || !command.getSourcePosX().equals(one.getSourcePosX()) || !command.getSourcePosY().equals(one.getSourcePosY()) |
| | | || !command.getSourcePosZ().equals(one.getSourcePosZ()) || !command.getDestinationPosX().equals(one.getDestinationPosX()) |
| | | || !command.getDestinationPosY().equals(one.getDestinationPosY()) || !command.getDestinationPosZ().equals(one.getDestinationPosZ()) |
| | | |
| | | ){ |
| | | log.error("堆垛机命令地址写入后回读失败[id:{}] >>>>> 写入[{}],===>>回读[{}]", slave.getId(), JSON.toJSON(command),JSON.toJSON(one)); |
| | | log.error("堆垛机命令回读失败后,重新添加任务到队列 ===>> [id:{}],{}", slave.getId(), JSON.toJSON(crnCommand)); |
| | |
| | | } |
| | | } |
| | | log.error("堆垛机命令回读失败后,重新添加任务到队列 ===>> [id:{}],{}", slave.getId(), JSON.toJSON(command)); |
| | | MessageQueue.offer(SlaveType.Crn, slave.getId(), new Task(2, command)); |
| | | MessageQueue.offer(SlaveType.Crn, slave.getId(), new Task(5, command)); |
| | | Thread.sleep(100); |
| | | readStatus(); |
| | | return false; |
| | |
| | | <result column="memo" property="memo" /> |
| | | |
| | | </resultMap> |
| | | <delete id="clearWeekBefore"> |
| | | delete from man_api_log |
| | | where 1=1 |
| | | and datediff(week,create_time,getdate()) >= 1 |
| | | and result != 1 |
| | | </delete> |
| | | |
| | | </mapper> |