野心家
2025-05-23 d75bdc98e2bc456eecfa4003bf700cb701d52a9b
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -172,8 +172,9 @@
                        if (!staProtocol.isPakMk()) {
                            continue;
                        }
                        System.out.println("扫码入库失败,{"+inSta.getStaNo()+"}入库站因{"+errMsg+"}异常,托盘已被退回");
//                        News.warn("扫码入库失败,{}入库站因{}异常,托盘已被退回", inSta.getStaNo(), errMsg);
                        staProtocol.setWorkNo(workNo);
                        staProtocol.setWorkNo(9999);
                        staProtocol.setStaNo(inSta.getBackSta());
                        devpThread.setPakMk(staProtocol.getSiteId(), false);
                        MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
@@ -362,8 +363,9 @@
                        if (!staProtocol.isPakMk()) {
                            continue;
                        }
                        System.out.println("扫码入库失败,{"+inSta.getStaNo()+"}入库站因{"+errMsg+"}异常,托盘已被退回");
//                        News.warn("扫码入库失败,{}入库站因{}异常,托盘已被退回", inSta.getStaNo(), errMsg);
                        staProtocol.setWorkNo(workNo);
                        staProtocol.setWorkNo(9999);
                        staProtocol.setStaNo(inSta.getStaNo());
                        devpThread.setPakMk(staProtocol.getSiteId(), false);
                        MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
@@ -1171,43 +1173,43 @@
                    taskWrkService.updateById(taskWrk);
                    try {
                        HashMap<String, Object> headParam = new HashMap<>();
                        headParam.put("taskNo",taskWrk.getTaskNo());
                        headParam.put("taskStatus",taskWrk.getStatusWms());
                        headParam.put("ioType",taskWrk.getIoTypeWms());
                        headParam.put("barCode",taskWrk.getBarcode());
                        headParam.put("reportTime", LocalDateTime.now());
                        headParam.put("weight",taskWrk.getScWeight().doubleValue());
                        String response;
                        log.error("wcs完结任务上报wms==》", headParam);
                        response = new HttpHandler.Builder()
                                // .setHeaders(headParam)
                                .setUri(wmsUrl)
                                .setPath(taskStatusFeedbackPath)
                                .setJson(JSON.toJSONString(headParam))
                                .build()
                                .doPost();
                        log.error("wcs完结任务上报wms==》", response);
//                        JSONObject jsonObject = JSON.parseObject(response);
//                        log.error("wcs完结任务上报wms==》", jsonObject);
                        apiLogService.save("wcs派发入库任务上报wms"
                                , wmsUrl + taskStatusFeedbackPath
                                , null
                                , "127.0.0.1"
                                , JSON.toJSONString(headParam)
                                , response
                                , true
                        );
                    } catch (Exception e) {
                        log.error("wcs完结任务上报wms失败", taskWrk);
                        log.error("wcs完结任务上报wms失败,报错信息:", e);
//                        throw new CoolException("wcs派发入库任务上报wms失败");
                    }
//                    try {
//                        HashMap<String, Object> headParam = new HashMap<>();
//                        headParam.put("taskNo",taskWrk.getTaskNo());
//                        headParam.put("taskStatus",taskWrk.getStatusWms());
//                        headParam.put("ioType",taskWrk.getIoTypeWms());
//                        headParam.put("barCode",taskWrk.getBarcode());
//                        headParam.put("reportTime", LocalDateTime.now());
//                        headParam.put("weight",taskWrk.getScWeight().doubleValue());
//
//                        String response;
//                        log.error("wcs完结任务上报wms==》", headParam);
//
//                        response = new HttpHandler.Builder()
//                                // .setHeaders(headParam)
//                                .setUri(wmsUrl)
//                                .setPath(taskStatusFeedbackPath)
//                                .setJson(JSON.toJSONString(headParam))
//                                .build()
//                                .doPost();
//                        log.error("wcs完结任务上报wms==》", response);
//
////                        JSONObject jsonObject = JSON.parseObject(response);
////                        log.error("wcs完结任务上报wms==》", jsonObject);
//
//                        apiLogService.save("wcs派发入库任务上报wms"
//                                , wmsUrl + taskStatusFeedbackPath
//                                , null
//                                , "127.0.0.1"
//                                , JSON.toJSONString(headParam)
//                                , response
//                                , true
//                        );
//                    } catch (Exception e) {
//                        log.error("wcs完结任务上报wms失败", taskWrk);
//                        log.error("wcs完结任务上报wms失败,报错信息:", e);
////                        throw new CoolException("wcs派发入库任务上报wms失败");
//                    }
                }
            }