Selaa lähdekoodia

Merge branch 'dev' of huangwenjie/patient-co-management into dev

chenweida 7 vuotta sitten
vanhempi
commit
ce1a971f83

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

@ -591,14 +591,16 @@ public class SFExpressService extends BaseService {
            Document doc = DocumentHelper.parseText(re);
            Document doc = DocumentHelper.parseText(re);
            String headvalue = doc.selectSingleNode("/Response/Head").getText();
            String headvalue = doc.selectSingleNode("/Response/Head").getText();
            if(StringUtils.isNotBlank(headvalue) && "OK".equals(headvalue)) {
            if(StringUtils.isNotBlank(headvalue) && "OK".equals(headvalue)) {
                Element root = doc.getRootElement();
                if (root.element("Body") != null)     //包含OrderResponse节点
                {
                    root = root.element("Body");
                }
                //是否能派送:1:人工确认;2:可收派;3:不可以收派
                //是否能派送:1:人工确认;2:可收派;3:不可以收派
                String filter_result = "";
                String filter_result = "";
                String orderid = "";//业务订单号
                String orderid = "";//业务订单号
                String mailno = "";//顺丰运单号
                String mailno = "";//顺丰运单号
                //错误代对应的文字
                Document redoc = doc.selectSingleNode("/Response/Body/Orderresponse").getDocument();
                Element root = redoc.getRootElement();
                List<?> child = root.elements();
                List<?> child = root.elements();
                for (Object o : child) {
                for (Object o : child) {
                    Element e = (Element) o;
                    Element e = (Element) o;
@ -606,18 +608,15 @@ public class SFExpressService extends BaseService {
                    orderid = e.attributeValue("orderid");
                    orderid = e.attributeValue("orderid");
                    mailno = e.attributeValue("mailno");
                    mailno = e.attributeValue("mailno");
                }
                }
                if(StringUtils.isNotBlank(filter_result) && "3".equals(filter_result)){
                    logger.info("顺丰快递下订单失败:派送地址不可派送,处方编号:"+sfexpress_obj.getPrescriptionCode());
                    throw new Exception("顺丰快递下订单失败:派送地址不可派送");
                }
                if(StringUtils.isBlank(mailno)){
                if(StringUtils.isBlank(mailno)){
                    logger.info("顺丰快递下订单失败:未获取到快递单号!"+sfexpress_obj.getPrescriptionCode());
                    logger.info("顺丰快递下订单失败:未获取到快递单号!"+sfexpress_obj.getPrescriptionCode());
                    throw new Exception("顺丰快递下订单失败:未获取到快递单号!");
                    throw new Exception("顺丰快递下订单失败:未获取到快递单号!");
                }
                }
                if(StringUtils.isNotBlank(filter_result) && "3".equals(filter_result)){
                    logger.info("顺丰快递下订单失败:派送地址不可派送,处方编号:"+sfexpress_obj.getPrescriptionCode());
                    throw new Exception("顺丰快递下订单失败:派送地址不可派送!");
                }
                sfexpress_obj.setMailno(mailno);
            }
            }

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

@ -169,11 +169,10 @@ public class SFExpressController extends BaseController {
    @RequestMapping(value="/sfordersearchservice",method = RequestMethod.GET)
    @RequestMapping(value="/sfordersearchservice",method = RequestMethod.GET)
    @ResponseBody
    @ResponseBody
    @ApiOperation("通过处方编码查询是否下单成功")
    @ApiOperation("通过处方编码查询顺丰快递是否下单成功")
    @ObserverRequired
    @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);
        try {
        try {
            boolean go_on = sfexpressService.sfOrderSearchServiceJustSearch(sfexpress_obj);
            boolean go_on = sfexpressService.sfOrderSearchServiceJustSearch(sfexpress_obj);