Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

liuwenbin 7 years ago
parent
commit
983c72ffe8

+ 1 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionExpressageLog.java

@ -79,6 +79,7 @@ public class PrescriptionExpressageLog extends IdEntity{
        this.acceptAddress = acceptAddress;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getAcceptTime() {
        return acceptTime;
    }

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

@ -354,8 +354,7 @@ public class SFExpressService extends BaseService {
     */
    public void SFRoutePushService(String xml) throws Exception{
        Document doc = DocumentHelper.parseText(xml);
        Document bodydoc = doc.selectSingleNode("/Request/Body").getDocument();
        Element root = bodydoc.getRootElement();
        Element root = doc.getRootElement();
        if (root.element("WaybillRoute") != null)     //包含WaybillRoute节点
        {
            root = root.element("WaybillRoute");
@ -366,10 +365,10 @@ public class SFExpressService extends BaseService {
        for (Object o : child) {
            Element routinfoe = (Element) o;
            PrescriptionExpressageLog sflog = new PrescriptionExpressageLog();
            String accept_time = routinfoe.attributeValue("acceptTime");
            String accept_address = routinfoe.attributeValue("acceptAddress");
            String accept_time = routinfoe.attributeValue("accepttime");
            String accept_address = routinfoe.attributeValue("acceptaddress");
            String accept_remark = routinfoe.attributeValue("remark");
            String opcode = routinfoe.attributeValue("opCode");
            String opcode = routinfoe.attributeValue("opcode");
            String mailno = routinfoe.attributeValue("mailno");
            String orderid = routinfoe.attributeValue("orderid");
@ -379,6 +378,7 @@ public class SFExpressService extends BaseService {
            sflog.setOpCode(opcode);
            sflog.setExpressageCode(orderid);
            sflog.setCode(UUID.randomUUID().toString());
            sflog.setCreateTime(new Date());
            if(wayroutlsit.keySet().contains(mailno)){
                wayroutlsit.get(mailno).add(sflog);
            }else{

+ 4 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/express/SFExpressApiController.java

@ -6,6 +6,8 @@ import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@ -23,6 +25,7 @@ import java.net.URLDecoder;
@RequestMapping(value = "/express/sf")
@Api(description = "顺丰速运相关接口")
public class SFExpressApiController extends BaseController {
    private static Logger logger = LoggerFactory.getLogger(SFExpressService.class);
    @Autowired
    private SFExpressService sfexpressService;
@ -40,6 +43,7 @@ public class SFExpressApiController extends BaseController {
            sfexpressService.SFRoutePushService(xml);
            return successxml;
        }catch (Exception e){
            logger.error("接收顺丰路由信息推送失败,入参xml:"+xml);
            //日志文件中记录异常信息
            error(e);
            //返回接口异常信息处理结果

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

@ -128,13 +128,12 @@ public class SFExpressController extends BaseController {
            PrescriptionExpressage sfexpress_obj = prescriptionExpressageService.findByPrescriptionCode(prescriptionCode);
            //先判断该处方是否已完成配送,如果配送完成,则直接取本地的物流记录
            if(100 == prescription.getStatus()){
                return write(200, "查询成功","data",sfexpresslogList);
            }else{
            if(100 != prescription.getStatus()){
                //如果配送未完成,则调用顺丰接口获取物流路由日志,与本地匹配,进行增量修改
                sfexpresslogList = sfexpressService.getRoutInfos(prescription,sfexpress_obj,sfexpresslogList);
                return write(200, "查询成功","data",sfexpresslogList);
            }
            return write(200, "查询成功","data",sfexpresslogList);
        }catch (Exception e){
            //日志文件中记录异常信息
            error(e);