自动化立体仓库 - WMS系统
#
LSH
2023-02-13 6ee5f8a9a8cbec6bfe559debfc08ad4b8035add5
src/main/java/com/zy/asrs/task/handler/WorkLogHandler.java
@@ -11,6 +11,7 @@
import com.zy.asrs.service.impl.MobileServiceImpl;
import com.zy.asrs.task.AbstractHandler;
import com.zy.asrs.task.core.ReturnT;
import com.zy.asrs.utils.PostMesDataUtils;
import com.zy.common.constant.MesConstant;
import com.zy.common.utils.HttpHandler;
import lombok.extern.slf4j.Slf4j;
@@ -69,7 +70,7 @@
                    combParam.setLocNo(wrkMast.getLocNo());
                    combParam.setPackSts(1);
                    combParam.setRequestTime(DateUtils.convert(new Date()));
                    result = postMesData(inpath,combParam);
//                    result = new PostMesDataUtils().postMesData(inpath,combParam);
                    // 保存入库通知档历史档
                    WaitPakin pakin = waitPakinService.selectOne(new EntityWrapper<WaitPakin>().eq("zpallet", wrkMast.getBarcode()));
                    if (pakin!=null){
@@ -90,7 +91,7 @@
                    combParam.setLocNo(wrkMast.getSourceLocNo());
//                    combParam.setPackSts(0);
                    combParam.setRequestTime(DateUtils.convert(new Date()));
                    result = postMesData(outPath,combParam);
//                    result = new PostMesDataUtils().postMesData(outPath,combParam);
                }
            }
            if(null != result && !result.isSuccess()){
@@ -125,47 +126,4 @@
        }
        return SUCCESS;
    }
    /*...........................赣州新增..............以下.............赣州新增...........................*/
    private ReturnT<String> postMesData(String mesPath,Object combParam){
        if(combParam != null){
            String response = "";
            boolean success = false;
            try {
                response = new HttpHandler.Builder()
                        .setUri(mesUrl)
                        .setPath(mesPath)
                        .setJson(JSON.toJSONString(combParam))
                        .build()
                        .doPost();
                JSONObject jsonObject = JSON.parseObject(response);
                if (jsonObject.getInteger("code").equals(200)) {
                    success = true;
                } else {
                    log.error("请求接口失败!!!url:{};request:{};response:{}", mesUrl+mesPath, JSON.toJSONString(combParam), response);
                    throw new CoolException("上报mes系统失败");
                }
            } catch (Exception e) {
                log.error("fail", e);
//                      TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                return FAIL.setMsg(e.getMessage());
            } finally {
                try {
                    // 保存接口日志
                    apiLogService.save(
                            "上报mes系统",
                            mesUrl + mesPath,
                            null,
                            "127.0.0.1",
                            JSON.toJSONString(combParam),
                            response,
                            success
                    );
                } catch (Exception e) { log.error("", e); }
            }
        }
        return SUCCESS;
    }
    /*...........................赣州新增..............以上.............赣州新增...........................*/
}