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.ac.D_AC00009; import com.miniframe.generate.comm.ac.D_ACHEAD; import com.miniframe.generate.business.ac.model.AC00009BaseModel; public class AC00009Client { private static final Logger logger = LoggerFactory.getLogger(AC00009Client.class); private MFHttpRespInfo respInfo; public MFHttpRespInfo getRespInfo(){ return respInfo; } /** * 调用 [气动设计->项目属性大对象查询((AC00009)]的通讯接口 * @param model 接口模型 * @param extMap 扩展输入 * @param url 请求地址 * @return model 接口模型 * @throws Exception */ @SuppressWarnings({ "rawtypes", "unchecked" }) public AC00009BaseModel execute(AC00009BaseModel model,final Map extMap,final String url) throws Exception { this.executeToRespInfo(model,extMap,url); return model; } @SuppressWarnings({ "rawtypes", "unchecked" }) public AC00009BaseModel execute(AC00009BaseModel model,final Map extMap) throws Exception { this.executeToRespInfo(model,extMap,null); return model; } @SuppressWarnings({ "rawtypes", "unchecked" }) public MFHttpRespInfo executeToRespInfo(AC00009BaseModel model,final Map extMap,final String url) throws Exception { if (logger.isDebugEnabled()) { logger.debug("execute(AC00009BaseModel) - start"); } if(UtilTools.isNullOrBlank(model.getA_achead().getTransCode())){ model.getA_achead().setTransCode("AC00009"); } Map inMap = new LinkedHashMap(); inMap.putAll(UtilTools.obj2Map(model.getA_achead())); inMap.putAll(UtilTools.obj2Map(model.getA_ac00009())); 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_ACHEAD d_achead = UtilTools.map2Obj(outMap, D_ACHEAD.class); D_AC00009 d_ac00009 = UtilTools.map2Obj(outMap, D_AC00009.class); model.setD_achead(d_achead); model.setD_ac00009(d_ac00009); } if (logger.isDebugEnabled()) { logger.debug("execute(AC00009BaseModel) - end"); } this.respInfo=respInfo; return respInfo; } @SuppressWarnings({ "rawtypes", "unchecked" }) public AC00009BaseModel execute(AC00009BaseModel model) throws Exception { return this.execute(model,null,null); } }