Selaa lähdekoodia

修改提供给基卫的接口:1.修改为以挂号码查询,2,增加返回目的地代码

huangwenjie 7 vuotta sitten
vanhempi
commit
5d3c8befd4

+ 4 - 4
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/controller/PrescriptionController.java

@ -176,13 +176,13 @@ public class PrescriptionController extends BaseController{
	/**---------------------顺丰快递相关接口---------------------**/
	@RequestMapping(value = "getSFExpressInfoByJWCode",method = RequestMethod.GET)
	@RequestMapping(value = "getSFExpressInfoByVisitNo",method = RequestMethod.GET)
	@ResponseBody
	@ApiOperation("根据基卫处方编码获取顺丰快递相关信息")
	@ApiOperation("根据基卫挂号单获取顺丰快递相关信息")
	public Result getSFExpressInfo(
			@ApiParam(name="jwCode", value="基卫处方编号") @RequestParam(value = "jwCode",required = true) String jwCode){
			@ApiParam(name="visitNo", value="基卫处方编号") @RequestParam(value = "visitNo",required = true) String visitNo){
		try {
			return prescriptionService.getSFExpressInfoByJWCode(jwCode);
			return prescriptionService.getSFExpressInfoByVisitNo(visitNo);
		}catch (Exception e){
			e.printStackTrace();
			return Result.error(e.getMessage());

+ 2 - 2
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/dao/prescription/PrescriptionDao.java

@ -22,6 +22,6 @@ public interface PrescriptionDao extends PagingAndSortingRepository<Prescription
    @Query("select p from Prescription p where p.jwCode=?1 and p.status=?2 ")
    List<Prescription> fingdByJwCodeAndStatus(String jwcode, Integer status);
    @Query("from Prescription p where p.jwCode=?1")
    Prescription findByJWCode(String jwCode);
    @Query("from Prescription p where p.visitNo=?1")
    Prescription findByVisitNo(String visitNo);
}

+ 16 - 16
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/prescription/VO/PrescriptionExpressageVO.java

@ -10,10 +10,10 @@ public class PrescriptionExpressageVO extends Result {
    //快递编号
    private String mailno;
    //基卫的处方编号
    private String jwCode;
    //i健康处方编码
    private String prescriptionCode;
    //业务类型:如标准快递
    private String mailtype;
    //目的地区域代码
    private String destcode;
    /**----寄方信息----**/
    // 医院名稱
@ -60,14 +60,6 @@ public class PrescriptionExpressageVO extends Result {
        this.mailno = mailno;
    }
    public String getJwCode() {
        return jwCode;
    }
    public void setJwCode(String jwCode) {
        this.jwCode = jwCode;
    }
    public String getJ_name() {
        return j_name;
    }
@ -188,11 +180,19 @@ public class PrescriptionExpressageVO extends Result {
        this.infos = infos;
    }
    public String getPrescriptionCode() {
        return prescriptionCode;
    public String getMailtype() {
        return mailtype;
    }
    public void setMailtype(String mailtype) {
        this.mailtype = mailtype;
    }
    public String getDestcode() {
        return destcode;
    }
    public void setPrescriptionCode(String prescriptionCode) {
        this.prescriptionCode = prescriptionCode;
    public void setDestcode(String destcode) {
        this.destcode = destcode;
    }
}

+ 6 - 6
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/prescription/PrescriptionService.java

@ -464,19 +464,19 @@ public class PrescriptionService extends ZysoftBaseService{
     * @param jwCode
     * @return
     */
    public Result getSFExpressInfoByJWCode(String jwCode) {
    public Result getSFExpressInfoByVisitNo(String visitNo) {
        //根据基卫处方编号获取处方信息
        Prescription prescription = prescriptionDao.findByJWCode(jwCode);
        Prescription prescription = prescriptionDao.findByVisitNo(visitNo);
        if(prescription == null){
            return Result.error(-1,"查询失败,未找到处方,基卫处方码为:"+jwCode);
            return Result.error(-1,"查询失败,未找到处方,挂号单为:"+visitNo);
        }
        //根据处方编码获取处方快递信息
        PrescriptionExpressage prescriptionExpressage = prescriptionExpressageDao.findByPrescriptionPay(prescription.getCode());
        if(prescriptionExpressage == null || StringUtils.isBlank(prescriptionExpressage.getMailno())){
            return Result.error(-2,"查询失败,该处方的快递还未成功下单,基卫处方码为:"+jwCode);
            return Result.error(-2,"查询失败,该处方的快递还未成功下单,挂号单为:"+visitNo);
        }
        //根据医院CODE,获取医院详细
        Hospital hospital = hospitalDao.findByCode(prescription.getHospital());
@ -485,9 +485,9 @@ public class PrescriptionService extends ZysoftBaseService{
        PrescriptionExpressageVO vo = new PrescriptionExpressageVO();
        vo.setJwCode(jwCode);
        vo.setMailno(prescriptionExpressage.getMailno());
        vo.setPrescriptionCode(prescription.getCode());
        vo.setMailtype("标准快递");
        vo.setDestcode(prescriptionExpressage.getCityCode());
        //-----寄方信息----
        vo.setJ_name(hospital.getName());
        vo.setJ_provinceName(hospital.getProvinceName());

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

@ -212,12 +212,14 @@ public class SFExpressService extends BaseService {
            String filter_result = "";
            String orderid = "";//业务订单号
            String mailno = "";//顺丰运单号
            String destCode = "";//目的地区域代码
            List<?> child = root.elements();
            for (Object o : child) {
                Element e = (Element) o;
                filter_result = e.attributeValue("filter_result");
                orderid = e.attributeValue("orderid");
                mailno = e.attributeValue("mailno");
                destCode = e.attributeValue("destCode");
            }
            if(StringUtils.isNotBlank(filter_result) && "3".equals(filter_result)){
                logger.info("顺丰快递下订单失败:派送地址不可派送,处方编号:"+sfexpress_obj.getPrescriptionCode());
@ -229,6 +231,7 @@ public class SFExpressService extends BaseService {
                throw new Exception("顺丰快递下订单失败:未获取到快递单号!");
            }
            sfexpress_obj.setMailno(mailno);
            sfexpress_obj.setCityCode(destCode);
        }
        return sfexpress_obj;
    }
@ -526,6 +529,7 @@ public class SFExpressService extends BaseService {
                String filter_result = "";
                String orderid = "";//业务订单号
                String mailno = "";//顺丰运单号
                String destCode = "";//目的地区域代码
                //错误代对应的文字
                Document redoc = doc.selectSingleNode("/Response/Body/Orderresponse").getDocument();
@ -536,6 +540,7 @@ public class SFExpressService extends BaseService {
                    filter_result = e.attributeValue("filter_result");
                    orderid = e.attributeValue("orderid");
                    mailno = e.attributeValue("mailno");
                    destCode = e.attributeValue("destCode");
                }
                if(StringUtils.isBlank(mailno)){
@ -549,6 +554,7 @@ public class SFExpressService extends BaseService {
                }
                sfexpress_obj.setMailno(mailno);
                sfexpress_obj.setCityCode(destCode);
            }
            //如果成功获取到快递单号,则保存处方物流记录,保存配送日志