|  |  |  | @ -6,9 +6,12 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.common.res.BaseResponse; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.common.util.ResultVOUtils; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.dao.auth.AuthCompanyMapper; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.dao.basic.BasicCorpDao; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.alihealth.AliYljgBillDetail; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.alihealth.AliYljgSearchbill; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.auth.AuthCompany; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.auth.CustomerInfoEntity; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.basic.BasicCorpEntity; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.collect.RelCodeBatch; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.req.alihealth.*; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.req.alihealth.local.*; | 
			
		
	
	
		
			
				
					|  |  |  | @ -38,6 +41,8 @@ public class AlihealthYljgUtils { | 
			
		
	
		
			
				
					|  |  |  |  |     private String alihealthUrl; | 
			
		
	
		
			
				
					|  |  |  |  |     @Resource | 
			
		
	
		
			
				
					|  |  |  |  |     private AuthCompanyMapper authCompanyMapper; | 
			
		
	
		
			
				
					|  |  |  |  |     @Resource | 
			
		
	
		
			
				
					|  |  |  |  |     private BasicCorpDao basicCorpDao; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     /** | 
			
		
	
		
			
				
					|  |  |  |  |      * 出入库单据上传 | 
			
		
	
	
		
			
				
					|  |  |  | @ -145,34 +150,41 @@ public class AlihealthYljgUtils { | 
			
		
	
		
			
				
					|  |  |  |  |      * @param reqeust | 
			
		
	
		
			
				
					|  |  |  |  |      * @return | 
			
		
	
		
			
				
					|  |  |  |  |      */ | 
			
		
	
		
			
				
					|  |  |  |  |     public BaseResponse<List<AliYljgSearchbill>> listupout(AlihealthYljgListupoutReqeust reqeust,String erpName) { | 
			
		
	
		
			
				
					|  |  |  |  |     public BaseResponse<List<AliYljgSearchbill>> listupout(AlihealthYljgListupoutReqeust reqeust,String erpId) { | 
			
		
	
		
			
				
					|  |  |  |  |         AuthCompany authCompany = authCompanyMapper.selectOne( | 
			
		
	
		
			
				
					|  |  |  |  |                 new QueryWrapper<AuthCompany>().last("limit 1") | 
			
		
	
		
			
				
					|  |  |  |  |         ); | 
			
		
	
		
			
				
					|  |  |  |  |         if(StringUtils.isNotEmpty(erpName)){ | 
			
		
	
		
			
				
					|  |  |  |  |             AlihealthKytGetentinfoResponse alihealthKytGetentinfoResponse =null; | 
			
		
	
		
			
				
					|  |  |  |  |             try { | 
			
		
	
		
			
				
					|  |  |  |  |                 AlihealthKytGetentinfoReqeust alihealthKytGetentinfoReqeust = new AlihealthKytGetentinfoReqeust(); | 
			
		
	
		
			
				
					|  |  |  |  |                 alihealthKytGetentinfoReqeust.setMethod("alibaba.alihealth.drugtrace.top.yljg.query.getentinfo"); | 
			
		
	
		
			
				
					|  |  |  |  |                 alihealthKytGetentinfoReqeust.setApp_key(authCompany.getAppId()); | 
			
		
	
		
			
				
					|  |  |  |  |                 alihealthKytGetentinfoReqeust.setEnt_name(erpName); | 
			
		
	
		
			
				
					|  |  |  |  |                 Map map  = alihealthUtils.disposeSign(alihealthKytGetentinfoReqeust,authCompany.getAppSecret()); | 
			
		
	
		
			
				
					|  |  |  |  |                 String json = HttpUtil.get(alihealthUrl,map); | 
			
		
	
		
			
				
					|  |  |  |  |                 alihealthKytGetentinfoResponse =new AlihealthKytGetentinfoResponse(json); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |             }catch (Exception e){ | 
			
		
	
		
			
				
					|  |  |  |  |                 return ResultVOUtils.error("阿里健康接口调用失败===往来单位名称请检查"); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         if(StringUtils.isNotEmpty(erpId)){ | 
			
		
	
		
			
				
					|  |  |  |  |             BasicCorpEntity basicCorpEntity = basicCorpDao.selectOne( | 
			
		
	
		
			
				
					|  |  |  |  |                     new QueryWrapper<BasicCorpEntity>().eq("erpId",erpId) | 
			
		
	
		
			
				
					|  |  |  |  |             ); | 
			
		
	
		
			
				
					|  |  |  |  |             if(basicCorpEntity!=null){ | 
			
		
	
		
			
				
					|  |  |  |  |                 AlihealthKytGetentinfoResponse alihealthKytGetentinfoResponse =null; | 
			
		
	
		
			
				
					|  |  |  |  |                 try { | 
			
		
	
		
			
				
					|  |  |  |  |                     AlihealthKytGetentinfoReqeust alihealthKytGetentinfoReqeust = new AlihealthKytGetentinfoReqeust(); | 
			
		
	
		
			
				
					|  |  |  |  |                     alihealthKytGetentinfoReqeust.setMethod("alibaba.alihealth.drugtrace.top.yljg.query.getentinfo"); | 
			
		
	
		
			
				
					|  |  |  |  |                     alihealthKytGetentinfoReqeust.setApp_key(authCompany.getAppId()); | 
			
		
	
		
			
				
					|  |  |  |  |                     alihealthKytGetentinfoReqeust.setEnt_name(basicCorpEntity.getName()); | 
			
		
	
		
			
				
					|  |  |  |  |                     Map map  = alihealthUtils.disposeSign(alihealthKytGetentinfoReqeust,authCompany.getAppSecret()); | 
			
		
	
		
			
				
					|  |  |  |  |                     String json = HttpUtil.get(alihealthUrl,map); | 
			
		
	
		
			
				
					|  |  |  |  |                     alihealthKytGetentinfoResponse =new AlihealthKytGetentinfoResponse(json); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 }catch (Exception e){ | 
			
		
	
		
			
				
					|  |  |  |  |                     return ResultVOUtils.error("阿里健康接口调用失败===往来单位名称请检查"); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 if(StringUtils.isNotEmpty(alihealthKytGetentinfoResponse.getMsg_info()) | 
			
		
	
		
			
				
					|  |  |  |  |                         && alihealthKytGetentinfoResponse.getMsg_info().equals("调用成功") | 
			
		
	
		
			
				
					|  |  |  |  |                 ){ | 
			
		
	
		
			
				
					|  |  |  |  |                     reqeust.setFrom_user_id(alihealthKytGetentinfoResponse.getEnt_id()); | 
			
		
	
		
			
				
					|  |  |  |  |                 }else { | 
			
		
	
		
			
				
					|  |  |  |  |                     return ResultVOUtils.error("阿里健康接口调用失败===往来单位名称请检查==="+alihealthKytGetentinfoResponse.getMsg_info()); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |             if(StringUtils.isNotEmpty(alihealthKytGetentinfoResponse.getMsg_info()) | 
			
		
	
		
			
				
					|  |  |  |  |                     && alihealthKytGetentinfoResponse.getMsg_info().equals("调用成功") | 
			
		
	
		
			
				
					|  |  |  |  |             ){ | 
			
		
	
		
			
				
					|  |  |  |  |                 reqeust.setFrom_user_id(alihealthKytGetentinfoResponse.getEnt_id()); | 
			
		
	
		
			
				
					|  |  |  |  |             }else { | 
			
		
	
		
			
				
					|  |  |  |  |                 return ResultVOUtils.error("阿里健康接口调用失败===往来单位名称请检查==="+alihealthKytGetentinfoResponse.getMsg_info()); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  |  | 
 |