| | |
| | | AI_CHAT_META("ai_chat_meta_"), |
| | | MAIN_PROCESS_PSEUDOCODE("main_process_pseudocode"), |
| | | PLANNER_SCHEDULE("planner_schedule_"), |
| | | REPORT_CRN_DB110_STATUS_LIMIT("report_crn_db110_status_limit_"), |
| | | |
| | | RECEIVE_IN_TASK_CHANGE_STATION_TASK("receive_in_task_change_station_task_"), |
| | | SEND_LIMIT_RECEIVE_IN_TASK_CHANGE_STATION_TASK("send_limit_receive_in_task_change_station_task_"), |
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.domain.param.CreateInTaskParam; |
| | | import com.zy.asrs.entity.BasCrnp; |
| | | import com.zy.asrs.entity.BasDevp; |
| | |
| | | } |
| | | } |
| | | |
| | | try { |
| | | WmsOperateUtils wmsOperateUtils = SpringUtils.getBean(WmsOperateUtils.class); |
| | | if (wmsOperateUtils != null) { |
| | | wmsOperateUtils.reportCrnDb110Status(crnProtocol.getCrnNo(), currentIndices); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("Report Crn Db110 Status Fail", e); |
| | | if (currentIndices.isEmpty()) { |
| | | continue; |
| | | } |
| | | |
| | | String reportLockKey = RedisKeyType.REPORT_CRN_DB110_STATUS_LIMIT.key + crnProtocol.getCrnNo(); |
| | | if (redisUtil.get(reportLockKey) != null) { |
| | | continue; |
| | | } |
| | | |
| | | long reportLockSeconds = Math.max(60L, currentIndices.size() * 35L); |
| | | redisUtil.set(reportLockKey, "lock", reportLockSeconds); |
| | | wmsOperateUtils.reportCrnDb110StatusAsync(crnProtocol.getCrnNo(), new ArrayList<>(currentIndices)); |
| | | } |
| | | } |
| | | |
| | |
| | | import com.zy.system.entity.Config; |
| | | import com.zy.system.service.ConfigService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | return response; |
| | | } |
| | | |
| | | @Async |
| | | public void reportCrnDb110StatusAsync(Integer crnNo, List<Integer> indices) { |
| | | try { |
| | | if (crnNo == null || indices == null || indices.isEmpty()) { |
| | | return; |
| | | } |
| | | reportCrnDb110Status(crnNo, indices); |
| | | } catch (Exception e) { |
| | | News.error("异步上报堆垛机DB110状态异常,crnNo={},indices={}", crnNo, JSON.toJSONString(indices), e); |
| | | } finally { |
| | | if (crnNo != null) { |
| | | redisUtil.del(RedisKeyType.REPORT_CRN_DB110_STATUS_LIMIT.key + crnNo); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 上报堆垛机DB110状态数据 |
| | | public void reportCrnDb110Status(Integer crnNo, List<Integer> indices) { |
| | | Object systemConfigMapObj = redisUtil.get(RedisKeyType.SYSTEM_CONFIG_MAP.key); |