Prechádzať zdrojové kódy

顺丰快递面单问题

huangwenjie 4 rokov pred
rodič
commit
230586cb62

+ 2 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionDao.java

@ -34,6 +34,8 @@ public interface PrescriptionDao extends PagingAndSortingRepository<WlyyPrescrip
    List<WlyyPrescriptionDO> findById(String id);
    List<WlyyPrescriptionDO> findById(String id);
    WlyyPrescriptionDO findByRealOrder(String realOrder);
    WlyyPrescriptionDO findByRealOrder(String realOrder);
    
    WlyyPrescriptionDO findByAdmNoAndRealOrder(String admno,String realOrder);
    List<WlyyPrescriptionDO> findByDoctorAndCreateTimeAndRemark(String doctor,Date createTime,String remark);
    List<WlyyPrescriptionDO> findByDoctorAndCreateTimeAndRemark(String doctor,Date createTime,String remark);

+ 16 - 2
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionExpressageService.java

@ -1,5 +1,6 @@
package com.yihu.jw.hospital.prescription.service;
package com.yihu.jw.hospital.prescription.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
@ -206,7 +207,7 @@ public class PrescriptionExpressageService extends BaseJpaService<WlyyPrescripti
        WlyyOutpatientDO outpatientDO = outpatientDao.findOne(sfexpress_obj.getOutpatientId());
        WlyyOutpatientDO outpatientDO = outpatientDao.findOne(sfexpress_obj.getOutpatientId());
        BaseOrgDO hospital = baseOrgDao.findByCode(outpatientDO.getHospital());
        BaseOrgDO hospital = baseOrgDao.findByCode(outpatientDO.getHospital());
        BasePatientDO basePatientDO = basePatientDao.findById(outpatientDO.getPatient());
        BasePatientDO basePatientDO = basePatientDao.findById(outpatientDO.getPatient());
    
        JSONObject params = SFUtils.postSFOrderServiceV2(sfexpress_obj,hospital,basePatientDO);
        JSONObject params = SFUtils.postSFOrderServiceV2(sfexpress_obj,hospital,basePatientDO);
        String re = this.SFExpressPostV2(params);
        String re = this.SFExpressPostV2(params);
        //xml验证
        //xml验证
@ -214,10 +215,23 @@ public class PrescriptionExpressageService extends BaseJpaService<WlyyPrescripti
        verificationResponV2(re);
        verificationResponV2(re);
        JSONObject respone = JSONObject.parseObject(re);
        JSONObject respone = JSONObject.parseObject(re);
//        String re = "{\"success\":true,\"message\":null,\"code\":\"SUCCESS\",\"result\":{\"successResult\":[{\"mailNo\":\"SF1023527844982\",\"bspOrderNo\":\"2c9081aa724b941501724eb3d0e40036\"}]}}";
//        JSONObject respone = JSONObject.parseObject(re);
        String mailno = "";//顺丰运单号
        String mailno = "";//顺丰运单号
        
        JSONArray successResult =  respone.getJSONObject("result").getJSONArray("successResult");
        
        if(!successResult.isEmpty()){
            JSONObject object = successResult.getJSONObject(0);
            mailno = object.getString("mailNo");
        }
    
        logger.info("顺丰快递下订单:mailno"+mailno);
    
    
        mailno = respone.getJSONObject("result").getJSONArray("successResult").getJSONObject(0).getString("mailNo");
        
//        mailno = respone.getJSONObject("result").getJSONArray("successResult").getJSONObject(0).getString("mailNo");
        
        sfexpress_obj.setMailno(mailno);
        sfexpress_obj.setMailno(mailno);
        return sfexpress_obj;
        return sfexpress_obj;
    }
    }

+ 7 - 5
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -4233,13 +4233,15 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    public Object getSFExpressInfo(String admNo,String realOrder,String wxId)throws Exception {
    public Object getSFExpressInfo(String admNo,String realOrder,String wxId)throws Exception {
    
    
        //根据门诊唯一号取就诊记录
        //根据门诊唯一号取就诊记录
        List<WlyyOutpatientDO> wlyyOutpatientDOs = outpatientDao.findByAdmNo(admNo);
//        List<WlyyOutpatientDO> wlyyOutpatientDOs = outpatientDao.findByAdmNo(admNo);
        
        WlyyPrescriptionDO wlyyPrescriptionDOS = prescriptionDao.findByAdmNoAndRealOrder(admNo,realOrder);
        
        
        Object result = "";
        Object result = "";
    
    
        System.out.println("获取顺丰物流面单信息:wlyyOutpatientDOs.isEmpty()="+wlyyOutpatientDOs.isEmpty());
        if(!wlyyOutpatientDOs.isEmpty() && wlyyOutpatientDOs.size()>0){
            List<WlyyPrescriptionExpressageDO> expressageDOList = sfexpressService.findByField("outpatientId",wlyyOutpatientDOs.get(0).getId());
        System.out.println("获取顺丰物流面单信息:wlyyPrescriptionDOS != null="+wlyyPrescriptionDOS != null);
        if(wlyyPrescriptionDOS != null){
            List<WlyyPrescriptionExpressageDO> expressageDOList = sfexpressService.findByField("outpatientId",wlyyPrescriptionDOS.getOutpatientId());
            WlyyPrescriptionExpressageDO sfexpress_obj = null;
            WlyyPrescriptionExpressageDO sfexpress_obj = null;
            System.out.println("获取顺丰物流面单信息:CollectionUtils.isEmpty(expressageDOList)="+CollectionUtils.isEmpty(expressageDOList));
            System.out.println("获取顺丰物流面单信息:CollectionUtils.isEmpty(expressageDOList)="+CollectionUtils.isEmpty(expressageDOList));
            if(CollectionUtils.isEmpty(expressageDOList)){
            if(CollectionUtils.isEmpty(expressageDOList)){
@ -4248,7 +4250,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                System.out.println("获取顺丰物流面单信息:1");
                System.out.println("获取顺丰物流面单信息:1");
                sfexpress_obj = expressageDOList.get(0);
                sfexpress_obj = expressageDOList.get(0);
                System.out.println("获取顺丰物流面单信息:2");
                System.out.println("获取顺丰物流面单信息:2");
                BasePatientDO basePatientDO = basePatientDao.findById(wlyyOutpatientDOs.get(0).getPatient());
                BasePatientDO basePatientDO = basePatientDao.findById(wlyyPrescriptionDOS.getPatientCode());
                //如果该处方的快递单号已生成,则说明已经下单成功,不需要重复下单,直接返回面单信息
                //如果该处方的快递单号已生成,则说明已经下单成功,不需要重复下单,直接返回面单信息
                System.out.println("获取顺丰物流面单信息:3");
                System.out.println("获取顺丰物流面单信息:3");
                if(org.apache.commons.lang.StringUtils.isNotBlank(sfexpress_obj.getMailno())){
                if(org.apache.commons.lang.StringUtils.isNotBlank(sfexpress_obj.getMailno())){