1
zhang
4 天以前 e5e76412f1a20e8aed95614cbd7bf2b638cda2cc
zy-acs-cv/src/main/java/com/zy/asrs/service/impl/WmsMainServiceImpl.java
@@ -2,7 +2,7 @@
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.core.exception.CoolException;
import com.zy.acs.framework.exception.CoolException;
import com.zy.asrs.controller.vo.ApplyInDto;
import com.zy.asrs.controller.vo.ApplyInRepsonseDto;
import com.zy.asrs.service.WmsMainService;
@@ -58,9 +58,9 @@
                    .setJson(JSON.toJSONString(applyInDto))
                    .build()
                    .doPost();
            log.info("WMS返回数据:{}", response);
            JSONObject jsonObject = JSON.parseObject(response);
            if (jsonObject.getInteger(code).equals(codeValue)) {
                log.info("WMS返回数据:{}", response);
            if (jsonObject.get(code) != null && jsonObject.getInteger(code).equals(codeValue)) {
                return JSONObject.parseObject(jsonObject.getString(dataCode), ApplyInRepsonseDto.class);
            } else {
                log.error("调用下发任务接口报错,响应码:{},响应内容:{}", jsonObject.getInteger(code), response);
@@ -74,4 +74,11 @@
        }
        return null;
    }
    public static void main(String[] args) {
        String s= "{\"msg\":\"Success\",\"code\":200,\"data\":{\"locNo\":\"A102400201\",\"batchNo\":\"TK2603104428\",\"taskNo\":\"TK2603104428\"}}";
        //System.out.println(JSON.parseObject(s).getString("data"));
        ApplyInRepsonseDto applyInRepsonseDto = JSONObject.parseObject(JSON.parseObject(s).getString("data"), ApplyInRepsonseDto.class);
        System.out.println(applyInRepsonseDto);
    }
}