| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 | 
							- package com.miniframe.generate.comm.httpesapater;
 
- import com.miniframe.spring.httpclient.MFHttpRespInfo;
 
- import org.slf4j.Logger;
 
- import org.slf4j.LoggerFactory;
 
- import java.util.LinkedHashMap;
 
- import java.util.Map;
 
- import com.miniframe.core.Transmitter;
 
- import com.miniframe.core.ext.UtilTools;
 
- import com.miniframe.generate.comm.es.D_ES0026;
 
- import com.miniframe.generate.comm.es.D_ESHEAD;
 
- import com.miniframe.generate.business.es.model.ES0026BaseModel;
 
- public class ES0026Client {
 
- 	private static final Logger logger = LoggerFactory.getLogger(ES0026Client.class);
 
- 	private MFHttpRespInfo respInfo;
 
- 	public MFHttpRespInfo getRespInfo(){
 
- 		return respInfo;
 
- 	}
 
- 	/**
 
- 	 * 调用 [无锡发动机->单位系统删除((ES0026)]的通讯接口
 
- 	 * @param model 接口模型
 
- 	 * @param extMap 扩展输入
 
- 	 * @param url 请求地址
 
- 	 * @return model 接口模型
 
- 	 * @throws Exception
 
- 	 */
 
- 	@SuppressWarnings({ "rawtypes", "unchecked" })
 
- 	public ES0026BaseModel execute(ES0026BaseModel model,final Map extMap,final String url) throws Exception {
 
- 		this.executeToRespInfo(model,extMap,url);
 
- 		return model;
 
- 	}
 
- 	@SuppressWarnings({ "rawtypes", "unchecked" })
 
- 	public ES0026BaseModel execute(ES0026BaseModel model,final Map extMap) throws Exception {
 
- 		this.executeToRespInfo(model,extMap,null);
 
- 		return model;
 
- 	}
 
- 	@SuppressWarnings({ "rawtypes", "unchecked" })
 
- 	public MFHttpRespInfo executeToRespInfo(ES0026BaseModel model,final Map extMap,final String url) throws Exception {
 
- 		if (logger.isDebugEnabled()) {
 
- 			logger.debug("execute(ES0026BaseModel) - start");
 
- 		}
 
- 		if(UtilTools.isNullOrBlank(model.getA_eshead().getTransCode())){
 
- 			model.getA_eshead().setTransCode("ES0026");
 
- 		}
 
- 		Map inMap = new LinkedHashMap();
 
- 		inMap.putAll(UtilTools.obj2Map(model.getA_eshead()));
 
- 		inMap.putAll(UtilTools.obj2Map(model.getA_es0026()));
 
- 		if(extMap!=null && extMap.size()>0){
 
- 			inMap.putAll(extMap);
 
- 		}
 
- 		Transmitter httpesApater = (Transmitter) UtilTools.getBean("httpesApater");
 
- 		MFHttpRespInfo respInfo;
 
- 		if(UtilTools.isNotNullAndBlank(url)){
 
- 			respInfo = httpesApater.doPostDataToRespInfo(inMap,url);
 
- 		}else{
 
- 			respInfo = httpesApater.doPostDataToRespInfo(inMap);
 
- 		}
 
- 		if(respInfo!=null) {
 
- 			Map outMap=respInfo.getParamMap();
 
- 			D_ESHEAD d_eshead =  UtilTools.map2Obj(outMap, D_ESHEAD.class);
 
- 			D_ES0026 d_es0026 =  UtilTools.map2Obj(outMap, D_ES0026.class);
 
- 			model.setD_eshead(d_eshead);
 
- 			model.setD_es0026(d_es0026);
 
- 		}
 
- 		if (logger.isDebugEnabled()) {
 
- 			logger.debug("execute(ES0026BaseModel) - end");
 
- 		}
 
-         this.respInfo=respInfo;
 
- 		return respInfo;
 
- 	}
 
- 	@SuppressWarnings({ "rawtypes", "unchecked" })
 
- 	public ES0026BaseModel execute(ES0026BaseModel model) throws Exception {
 
- 		return this.execute(model,null,null);
 
- 	}
 
- }
 
 
  |