ソースを参照

顺丰快递下单接口问题修改

huangwenjie 8 年 前
コミット
386c0acb5f

+ 18 - 17
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/express/SFExpressService.java

@ -251,24 +251,25 @@ public class SFExpressService extends BaseService {
        if(StringUtils.isNotBlank(headvalue) && "OK".equals(headvalue)) {
        }
        List<Document> redocs = doc.selectNodes("/Response/Body/RouteResponse");
        Element root = doc.getRootElement();
        if (root.element("Body") != null)     //取报文根节点
        {
            root = root.element("Body");
        }
        List<?> child = root.elements();
        String mailno = "";
        for (Document routdoc : redocs) {
            Element root = routdoc.getRootElement();
            List<?> child = root.elements();
            for (Object o : child) {
                Element e = (Element) o;
                mailno = e.attributeValue("mailno");
                //判断快递单号不为空,且和我们本地的一致
                if(StringUtils.isNotBlank(mailno) &&
                        sfexpress_obj.getMailno().equals(mailno)){
                    //解析报文,结合本地数据返回最终的日志结果
                    return this.xmltologlist(e,sfexpresslogList,sfexpress_obj);
                }else{
                    continue;
                }
        Map<String,List<PrescriptionExpressageLog>> wayroutlsit = new HashMap<>();
        for (Object o : child) {
            Element e = (Element) o;
            mailno = e.attributeValue("mailno");
            //判断快递单号不为空,且和我们本地的一致
            if(StringUtils.isNotBlank(mailno) &&
                    sfexpress_obj.getMailno().equals(mailno)){
                //解析报文,结合本地数据返回最终的日志结果
                return this.xmltologlist(e,sfexpresslogList,sfexpress_obj);
            }else{
                continue;
            }
        }
        return null;

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/express/SFExpressController.java

@ -138,7 +138,7 @@ public class SFExpressController extends BaseController {
            //日志文件中记录异常信息
            error(e);
            //返回接口异常信息处理结果
            return error(-1, e.getMessage());
            return error(-1, "查询失败!");
        }
    }