ZY
2025-04-24 4e0da368106385d208157b9d565374733b7c4a87
src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
@@ -24,26 +24,20 @@
    @Autowired
    private WrkMastService wrkMastService;
    @Autowired
    private LocMastService locMastService;
    @Autowired
    private WaitPakinService waitPakinService;
    @Autowired
    private WrkMastLogService wrkMastLogService;
    @Autowired
    private WrkDetlLogService wrkDetlLogService;
    @Autowired
    private WrkDetlService wrkDetlService;
    @Autowired
    private ApiLogService apiLogService;
    @Value("${wms.url}")
    private String wmsUrl;
    @Value("${wms.inboundTaskApplyPath}")
    private String inboundTaskApplyPath;
    @Value("${wms.movePath}")
    private String movePath;
    @Value("${wms.taskStatusFeedbackPath}")
    private String taskStatusFeedbackPath;
    private ToWmsService    toWmsService;
    @Override
    @Transactional
@@ -76,31 +70,8 @@
        HashMap<String, Object> headParam = new HashMap<>();
        headParam.put("TaskNo", wrkMast.getTaskNo());
        headParam.put("Result", 0);//完成
        toWmsService.addReportLog(wrkMast);
        try {
            String response;
            log.error("wcs手动完结任务上报wms={}", wrkMast);
            response = new HttpHandler.Builder()
                    // .setHeaders(headParam)
                    .setUri(wmsUrl)
                    .setPath(taskStatusFeedbackPath)
                    .setJson(JSON.toJSONString(headParam))
                    .build()
                    .doPost();
            apiLogService.save("wcs手动完成任务上报wms"
                    , wmsUrl + taskStatusFeedbackPath
                    , null
                    , "127.0.0.1"
                    , JSON.toJSONString(headParam)
                    , response
                    , true
            );
        } catch (Exception e) {
            log.error("wcs手动完结任务上报wms失败={}", wrkMast);
            log.error("wcs手动完结任务上报wms失败,报错信息:", e);
//                        throw new CoolException("wcs派发入库任务上报wms失败");
        }
    }
    @Override
@@ -183,30 +154,7 @@
        HashMap<String, Object> headParam = new HashMap<>();
        headParam.put("TaskNo", wrkMast.getTaskNo());
        headParam.put("Result", 1);//取消
        toWmsService.addReportLog(wrkMast);
        try {
            String response;
            log.error("wcs手动取消任务上报wms={}", wrkMast);
            response = new HttpHandler.Builder()
                    // .setHeaders(headParam)
                    .setUri(wmsUrl)
                    .setPath(taskStatusFeedbackPath)
                    .setJson(JSON.toJSONString(headParam))
                    .build()
                    .doPost();
            apiLogService.save("wcs手动取消任务上报wms"
                    , wmsUrl + taskStatusFeedbackPath
                    , null
                    , "127.0.0.1"
                    , JSON.toJSONString(headParam)
                    , response
                    , true
            );
        } catch (Exception e) {
            log.error("wcs手动取消任务上报wms失败={}", wrkMast);
            log.error("wcs手动取消任务上报wms失败,报错信息:", e);
//                        throw new CoolException("wcs派发入库任务上报wms失败");
        }
    }
}