Browse Source

增加顺丰快递接口:增加通过处方编码查询顺丰快递单信息(不包含物流记录)

huangwenjie 7 years ago
parent
commit
4c11e93517

BIN
patient-co/patient-co-wlyy/doc/部署文档/正式库/后台/tomcat部署.docx


+ 46 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prescription/VO/PrescriptionExpressLogVO.java

@ -0,0 +1,46 @@
package com.yihu.wlyy.entity.patient.prescription.VO;
/**
 * 快递记录VO类,给快递记录界面用
 * @author  huangwenjie --2017.08.08
 */
public class PrescriptionExpressLogVO {
    private String expressName = "";//快递名称
    private String expressPhone = "";//快递官方电话
    private String expressStatus = "";//物流状态
    private String expressMailNo = "";//快递单号
    public String getExpressName() {
        return expressName;
    }
    public void setExpressName(String expressName) {
        this.expressName = expressName;
    }
    public String getExpressPhone() {
        return expressPhone;
    }
    public void setExpressPhone(String expressPhone) {
        this.expressPhone = expressPhone;
    }
    public String getExpressStatus() {
        return expressStatus;
    }
    public void setExpressStatus(String expressStatus) {
        this.expressStatus = expressStatus;
    }
    public String getExpressMailNo() {
        return expressMailNo;
    }
    public void setExpressMailNo(String expressMailNo) {
        this.expressMailNo = expressMailNo;
    }
}

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

@ -25,7 +25,7 @@ import java.net.URLDecoder;
@RequestMapping(value = "/express/sf")
@RequestMapping(value = "/express/sf")
@Api(description = "顺丰速运相关接口")
@Api(description = "顺丰速运相关接口")
public class SFExpressApiController extends BaseController {
public class SFExpressApiController extends BaseController {
    private static Logger logger = LoggerFactory.getLogger(SFExpressService.class);
    private static Logger logger = LoggerFactory.getLogger(SFExpressApiController.class);
    @Autowired
    @Autowired
    private SFExpressService sfexpressService;
    private SFExpressService sfexpressService;
@ -39,6 +39,8 @@ public class SFExpressApiController extends BaseController {
    public String SFRoutePushService (
    public String SFRoutePushService (
            @ApiParam(name="xml", value="入参报文") @RequestParam(value = "xml",required = true) String xml){
            @ApiParam(name="xml", value="入参报文") @RequestParam(value = "xml",required = true) String xml){
        try {
        try {
            logger.info("顺丰路由信息推送,xml="+xml);
            xml = URLDecoder.decode(xml,"utf-8");
            xml = URLDecoder.decode(xml,"utf-8");
            sfexpressService.SFRoutePushService(xml);
            sfexpressService.SFRoutePushService(xml);
            return successxml;
            return successxml;

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

@ -6,6 +6,7 @@ import com.yihu.wlyy.entity.dict.DmExpressagePriceEntity;
import com.yihu.wlyy.entity.patient.prescription.Prescription;
import com.yihu.wlyy.entity.patient.prescription.Prescription;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionExpressage;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionExpressage;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionExpressageLog;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionExpressageLog;
import com.yihu.wlyy.entity.patient.prescription.VO.PrescriptionExpressLogVO;
import com.yihu.wlyy.service.app.express.SFExpressService;
import com.yihu.wlyy.service.app.express.SFExpressService;
import com.yihu.wlyy.service.app.prescription.PrescriptionExpressageLogService;
import com.yihu.wlyy.service.app.prescription.PrescriptionExpressageLogService;
import com.yihu.wlyy.service.app.prescription.PrescriptionExpressageService;
import com.yihu.wlyy.service.app.prescription.PrescriptionExpressageService;
@ -138,7 +139,7 @@ public class SFExpressController extends BaseController {
            //日志文件中记录异常信息
            //日志文件中记录异常信息
            error(e);
            error(e);
            //返回接口异常信息处理结果
            //返回接口异常信息处理结果
            return error(-1, "查询失败!");
            return error(-1, "查询失败,"+e.getMessage());
        }
        }
    }
    }
@ -170,7 +171,6 @@ public class SFExpressController extends BaseController {
    @RequestMapping(value="/sfordersearchservice",method = RequestMethod.GET)
    @RequestMapping(value="/sfordersearchservice",method = RequestMethod.GET)
    @ResponseBody
    @ResponseBody
    @ApiOperation("通过处方编码查询顺丰快递是否下单成功")
    @ApiOperation("通过处方编码查询顺丰快递是否下单成功")
    @ObserverRequired
    public String SFOrderSearchService(
    public String SFOrderSearchService(
            @ApiParam(name="prescriptionCode", value="处方编号") @RequestParam(value = "prescriptionCode",required = true) String prescriptionCode){
            @ApiParam(name="prescriptionCode", value="处方编号") @RequestParam(value = "prescriptionCode",required = true) String prescriptionCode){
        PrescriptionExpressage sfexpress_obj = prescriptionExpressageService.findByPrescriptionCode(prescriptionCode);
        PrescriptionExpressage sfexpress_obj = prescriptionExpressageService.findByPrescriptionCode(prescriptionCode);
@ -184,4 +184,37 @@ public class SFExpressController extends BaseController {
            return error(-1, "查询失败," + e.getMessage());
            return error(-1, "查询失败," + e.getMessage());
        }
        }
    }
    }
    @RequestMapping(value="/sfgetorderinfoservice",method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("通过处方编码查询顺丰快递单信息(不包含物流记录)")
    public String SFGetOrderInfo(
            @ApiParam(name="prescriptionCode", value="处方编号") @RequestParam(value = "prescriptionCode",required = true) String prescriptionCode){
        try {
            PrescriptionExpressage sfexpress_obj = prescriptionExpressageService.findByPrescriptionCode(prescriptionCode);
            Prescription prescription = prescriptionService.findByCode(prescriptionCode);
            PrescriptionExpressLogVO vo = new PrescriptionExpressLogVO();
            vo.setExpressMailNo(sfexpress_obj.getMailno());
            vo.setExpressName("顺丰速递");
            if(100 == prescription.getStatus()){
                vo.setExpressStatus("已收件");
            }else{
                if(StringUtils.isBlank(sfexpress_obj.getMailno())){
                    vo.setExpressStatus("待发货");
                }else{
                    vo.setExpressStatus("运输中");
                }
            }
            vo.setExpressPhone("95338");
            return write(200, "查询成功","data",vo);
        }catch (Exception e) {
            //日志文件中记录异常信息
            error(e);
            //返回接口异常信息处理结果
            return error(-1, "查询失败," + e.getMessage());
        }
    }
}
}