#
ynhfasrs
2025-06-27 fbd802755cc359394935f65f63d3cb8975e51986
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -150,9 +150,9 @@
                    if (staProtocol.isAutoing()
                            && staProtocol.isLoading()
                            && staProtocol.isInEnable()
                            && !staProtocol.isEmptyMk()
//                            && !staProtocol.isEmptyMk()
                            && staProtocol.isPakMk()
                            && staProtocol.getWorkNo() == 9999
                            && (staProtocol.getWorkNo() == 9999 || staProtocol.getWorkNo() == 9998)
                    ) {
                        // 获取条码扫描仪信息
                        BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcode());
@@ -183,10 +183,10 @@
                            requestParam.put("wcsStatus", 0);//成功
                        }
                        String response = "";
                        String response = "None";
                        Boolean success = false;
                        try {
                            Object object = redisUtil.get(RedisKeyType.IN_TASK_LOCK.key);
                            Object object = redisUtil.get(RedisKeyType.IN_TASK_LOCK.key + inSta.getStaNo());
                            if(object != null) {
                                continue;
                            }
@@ -198,7 +198,7 @@
                                    .build()
                                    .doPost();
                            JSONObject jsonObject = JSON.parseObject(response);
                            redisUtil.set(RedisKeyType.IN_TASK_LOCK.key, "lock", 5);
                            redisUtil.set(RedisKeyType.IN_TASK_LOCK.key + inSta.getStaNo(), "lock", 5);
                            if (jsonObject.getInteger("code") == 200) {
                            } else if (jsonObject.getInteger("code") == 500) {
@@ -695,37 +695,24 @@
                    if (taskWrkMapper.updateById(taskWrk) == 0) {
                        log.error("修改工作档状态 11.生成出库ID => 12.吊车出库中 失败!!,工作号={}", taskWrk.getWrkNo());
                    }
                    String response = "";
                    Boolean bool=false;
                    HashMap<String, Object> headParam = new HashMap<>();
                    headParam.put("TaskNo", taskWrk.getTaskNo());
                    try {
                        response = new HttpHandler.Builder()
                                // .setHeaders(headParam)
                                .setUri(wmsUrl)
                                .setPath(taskExecCallback)
                                .setJson(JSON.toJSONString(headParam))
                                .build()
                                .doPost();
                        JSONObject jsonObject = JSON.parseObject(response);
                        if(jsonObject.get("ReturnStatus").equals(0)){
                            bool = true;
                            taskWrk.setStatus(2);
                            taskWrkMapper.updateById(taskWrk);
                        }
                    } catch (Exception e) {
                        log.error("wcs派发移库库任务上报wms失败", taskWrk);
//                        throw new CoolException("wcs派发移库库任务上报wms失败");
                    }finally {
                        apiLogService.save("wcs派发移库任务上报wms"
                                , wmsUrl + taskExecCallback
                                , null
                                , "127.0.0.1"
                                , JSON.toJSONString(headParam)
                                , response
                                , bool
                        );
                    //上报-移库任务开始时,WCS回调WMS
                    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:ss:mm");
                    HashMap<String, Object> hashMap = new HashMap<>();
                    hashMap.put("taskNo", taskWrk.getTaskNo());
                    hashMap.put("status", TaskStatusType.DISTRIBUTE.id);
                    hashMap.put("ioType", 3);
                    hashMap.put("barcode", taskWrk.getBarcode());
                    hashMap.put("reportTime", format.format(new Date()));
                    NotifyCustomDataDto customDataDto = new NotifyCustomDataDto();
                    customDataDto.setUri(wmsUrl);
                    customDataDto.setPath(taskExecCallback);
                    customDataDto.setData(JSON.toJSONString(hashMap));
                    boolean notifyResult = notifyUtils.notify("task", 1, String.valueOf(taskWrk.getWrkNo()), taskWrk.getTaskNo(), NotifyMsgType.TASK_START, JSON.toJSONString(taskWrk), true, customDataDto);
                    if(notifyResult) {
                        taskWrk.setStatus(2);
                        taskWrkService.updateById(taskWrk);
                    }
                }