自动化立体仓库 - WMS系统
18516761980
2022-10-15 8eb1495d8551cd267e9ccae0508113bc969574be
src/main/java/com/zy/asrs/task/handler/WorkLogHandler.java
@@ -65,29 +65,41 @@
                if(wrkDetl != null){
                    CombParam combParam = new CombParam();
                    combParam.setPackNo(wrkDetl.getZpallet());
                    combParam.setPackName(wrkDetl.getMatnr());
                    combParam.setLocno(wrkMast.getLocNo());
//                    combParam.setPackName(wrkDetl.getMatnr());
                    combParam.setLocNo(wrkMast.getLocNo());
                    combParam.setPackSts(1);
                    combParam.setRequestTime(DateUtils.convert(new Date()));
//                    result = postMesData(inpath,combParam);
                    result = postMesData(inpath,combParam);
                    // 保存入库通知档历史档
                    if (!waitPakinLogService.save(wrkMast.getBarcode())) {
                        exceptionHandle("保存入库通知档历史档[workNo={0}]失败", wrkMast.getWrkNo());
                    }
                    // 删除入库通知档
                    if (!waitPakinService.delete(new EntityWrapper<WaitPakin>().eq("zpallet", wrkMast.getBarcode()))) {
                        exceptionHandle("删除入库通知档[workNo={0}]失败", wrkMast.getWrkNo());
                    WaitPakin pakin = waitPakinService.selectOne(new EntityWrapper<WaitPakin>().eq("zpallet", wrkMast.getBarcode()));
                    if (pakin!=null){
                        if (!waitPakinLogService.save(wrkMast.getBarcode())) {
                            exceptionHandle("保存入库通知档历史档[workNo={0}]失败", wrkMast.getWrkNo());
                        }
                        // 删除入库通知档
                        if (!waitPakinService.delete(new EntityWrapper<WaitPakin>().eq("zpallet", wrkMast.getBarcode()))) {
                            exceptionHandle("删除入库通知档[workNo={0}]失败", wrkMast.getWrkNo());
                        }
                    }
                }
            } else if (wrkMast.getWrkSts() == 15 && wrkMast.getIoType() == 101){
                if(wrkDetl != null){
                    CombParam combParam = new CombParam();
                    combParam.setPackNo(wrkDetl.getZpallet());
                    combParam.setPackName(wrkDetl.getMatnr());
                    combParam.setLocno(wrkMast.getLocNo());
                    combParam.setPackSts(0);
//                    combParam.setPackName(wrkDetl.getMatnr());
                    combParam.setLocNo(wrkMast.getSourceLocNo());
//                    combParam.setPackSts(0);
                    combParam.setRequestTime(DateUtils.convert(new Date()));
//                    result = postMesData(outPath,combParam);
                    result = postMesData(outPath,combParam);
                }
            }else if(wrkMast.getWrkSts() == 4 && wrkMast.getIoType() == 11){
                if(wrkDetl != null){
                    CombParam combParam = new CombParam();
                    combParam.setPackNo(wrkDetl.getZpallet());
                    combParam.setLocNo(wrkMast.getLocNo());
                    combParam.setPackSts(5);
                    combParam.setRequestTime(DateUtils.convert(new Date()));
                    result = postMesData(inpath,combParam);
                }
            }
            if(null != result && !result.isSuccess()){
@@ -140,7 +152,7 @@
                if (jsonObject.getInteger("code").equals(200)) {
                    success = true;
                } else {
                    log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL+MesConstant.PAKIN_URL, JSON.toJSONString(combParam), response);
                    log.error("请求接口失败!!!url:{};request:{};response:{}", mesUrl+mesPath, JSON.toJSONString(combParam), response);
                    throw new CoolException("上报mes系统失败");
                }
            } catch (Exception e) {
@@ -151,8 +163,8 @@
                try {
                    // 保存接口日志
                    apiLogService.save(
                            "成品库入库上报",
                            MesConstant.URL + MesConstant.PAKIN_URL,
                            "上报mes系统",
                            mesUrl + mesPath,
                            null,
                            "127.0.0.1",
                            JSON.toJSONString(combParam),