自动化立体仓库 - WMS系统
13
zhang
昨天 82de5a307466894bbb0258f8a63a26a7bb96d80d
src/main/java/com/zy/erp/kingdee/utils/PostMesDataUtils.java
@@ -15,12 +15,12 @@
@Slf4j
public class PostMesDataUtils extends AbstractHandler<String> {
    public ReturnT<String> postMesData(String name, String URL, String mesPath, Object combParam){
    public ReturnT<String> postMesData(String name, String URL, String mesPath, Object combParam) {
//        if (true){
//            System.out.println("name:"+name+",URL:"+URL+",mesPath:"+mesPath+",combParam:"+combParam);
//            return SUCCESS;
//        }
        if(combParam != null){
        if (combParam != null) {
            String response = "";
            boolean success = false;
            try {
@@ -33,17 +33,17 @@
                        .setJson(JSON.toJSONString(combParam))
                        .build()
                        .doPost();
                System.out.println("response:"+response);
                System.out.println("response:" + response);
                JSONObject jsonObject = JSON.parseObject(response);
                if (jsonObject.getInteger("code").equals(200)) {
                    success = true;
                } else {
                    log.error("请求接口失败!!!url:{};request:{};response:{}", URL+"/"+mesPath, JSON.toJSONString(combParam), response);
                    throw new CoolException("上报"+name);
                    log.error("请求接口失败!!!url:{};request:{};response:{}", URL + "/" + mesPath, JSON.toJSONString(combParam), response);
                    throw new CoolException("上报" + name);
                }
            } catch (Exception e) {
                log.error("请求接口失败!!!url:{};request:{};response:{}", URL+"/"+mesPath, JSON.toJSONString(combParam), response);
                log.error("请求接口失败!!!url:{};request:{};response:{}", URL + "/" + mesPath, JSON.toJSONString(combParam), response);
//                      TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                return FAIL.setMsg(e.getMessage());
            } finally {
@@ -51,8 +51,8 @@
                    // 保存接口日志
                    ApiLogService apiLogService = SpringUtils.getBean(ApiLogService.class);
                    apiLogService.save(
                            "上报"+name,
                            URL +"/"+ mesPath,
                            "上报" + name,
                            URL + "/" + mesPath,
                            null,
                            "127.0.0.1",
                            JSON.toJSONString(combParam),
@@ -60,18 +60,19 @@
                            success
                    );
                } catch (Exception e) {
                    log.error("", e); }
                    log.error("", e);
                }
            }
        }
        return SUCCESS;
    }
    public ReturnT<String> postMesData(String name, String URL, String mesPath, Object combParam,Map<String, Object> map){
    public ReturnT<String> postMesData(String name, String URL, String mesPath, Object combParam, Map<String, Object> map) {
//        if (true){
//            System.out.println("name:"+name+",URL:"+URL+",mesPath:"+mesPath+",combParam:"+combParam);
//            return SUCCESS;
//        }
        if(combParam != null){
        if (combParam != null) {
            String response = "";
            boolean success = false;
            try {
@@ -84,17 +85,17 @@
                        .setJson(JSON.toJSONString(combParam))
                        .build()
                        .doPost();
                System.out.println("response:"+response);
                System.out.println("response:" + response);
                JSONObject jsonObject = JSON.parseObject(response);
                if (jsonObject.getInteger("code").equals(200)) {
                    success = true;
                } else {
                    log.error("请求接口失败!!!url:{};request:{};response:{}", URL+"/"+mesPath, JSON.toJSONString(combParam), response);
                    throw new CoolException("上报"+name);
                    log.error("请求接口失败!!!url:{};request:{};response:{}", URL + "/" + mesPath, JSON.toJSONString(combParam), response);
                    throw new CoolException("上报" + name);
                }
            } catch (Exception e) {
                log.error("请求接口失败!!!url:{};request:{};response:{}", URL+"/"+mesPath, JSON.toJSONString(combParam), response);
                log.error("请求接口失败!!!url:{};request:{};response:{}", URL + "/" + mesPath, JSON.toJSONString(combParam), response);
//                      TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                return FAIL.setMsg(e.getMessage());
            } finally {
@@ -102,8 +103,8 @@
                    // 保存接口日志
                    ApiLogService apiLogService = SpringUtils.getBean(ApiLogService.class);
                    apiLogService.save(
                            "上报"+name,
                            URL +"/"+ mesPath,
                            "上报" + name,
                            URL + "/" + mesPath,
                            null,
                            "127.0.0.1",
                            JSON.toJSONString(combParam),
@@ -111,7 +112,8 @@
                            success
                    );
                } catch (Exception e) {
                    log.error("", e); }
                    log.error("", e);
                }
            }
        }
        return SUCCESS;