|  | @ -0,0 +1,53 @@
 | 
	
		
			
				|  |  | package com.yihu.jw.entrance.controller.third;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import com.yihu.jw.hospital.prescription.service.PrescriptionExpressageService;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.web.Envelop;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
 | 
	
		
			
				|  |  | 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.web.bind.annotation.RequestMapping;
 | 
	
		
			
				|  |  | import org.springframework.web.bind.annotation.RequestMethod;
 | 
	
		
			
				|  |  | import org.springframework.web.bind.annotation.RequestParam;
 | 
	
		
			
				|  |  | import org.springframework.web.bind.annotation.RestController;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import java.net.URLDecoder;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | /**
 | 
	
		
			
				|  |  |  * @author zmk
 | 
	
		
			
				|  |  |  * @vsrsion 1.0
 | 
	
		
			
				|  |  |  * Created at 2019/11/7
 | 
	
		
			
				|  |  |  */
 | 
	
		
			
				|  |  | @RestController
 | 
	
		
			
				|  |  | @RequestMapping(value ="/openRoutePush")
 | 
	
		
			
				|  |  | @Api(value = "顺丰路由推送", description = "顺丰路由推送", tags = {"hospital-entrance顺丰路由推送"})
 | 
	
		
			
				|  |  | public class SfRoutePushController extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     private static Logger logger = LoggerFactory.getLogger(SfRoutePushController.class);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private PrescriptionExpressageService sfexpressService;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     private String successxml = "<Response service='RoutePushService'><Head>OK</Head></Response>";
 | 
	
		
			
				|  |  |     private String failedxml = "<Response service='RoutePushService'><Head>ERR</Head><ERROR code='-1'>系统发生数据错误或运行时异常</ERROR></Response>";
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @RequestMapping(value="/routepushservice",method = RequestMethod.POST)
 | 
	
		
			
				|  |  |     @ApiOperation("顺丰路由信息推送")
 | 
	
		
			
				|  |  |     public Envelop SFRoutePushService (
 | 
	
		
			
				|  |  |             @ApiParam(name="content", value="入参报文") @RequestParam(value = "content",required = true) String content){
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             content = URLDecoder.decode(content,"utf-8");
 | 
	
		
			
				|  |  |             logger.info("顺丰路由信息推送,xml="+content);
 | 
	
		
			
				|  |  |             sfexpressService.SFRoutePushService(content);
 | 
	
		
			
				|  |  |             return success(successxml);
 | 
	
		
			
				|  |  |         }catch (Exception e){
 | 
	
		
			
				|  |  |             logger.error("接收顺丰路由信息推送失败,入参xml:"+content);
 | 
	
		
			
				|  |  |             //日志文件中记录异常信息
 | 
	
		
			
				|  |  |             //返回接口异常信息处理结果
 | 
	
		
			
				|  |  |             return failed(failedxml);
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | }
 |