webServices 执行流程,(我是菜鸟,我怕谁,仅代表个人理解,欢迎各位大神们指导,不和您的胃口,请默默离开!!)
二、上图仅仅代表个人理解,下面以代码方式解释一下。
(1) strtus.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN"
"http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
<!-- 功能:维护工具 lotus 开发者:wg 15-09 -->
<package name="/msp/invQryOrg" extends="default" namespace="/msp/invQryOrg">
<action name="init" class="lotusOrgAction" method="init">
<result name="init">/msp/pages/org/msLotusQryList.jsp</result>
</action>
<action name="query" class="lotusOrgAction" method="query">
<result name="list">/msp/pages/org/msLotusQryList.jsp</result>
</action>
<action name="detail" class="lotusOrgAction" method="detail">
<result name="success">/msp/pages/org/slLotusOrgDetail.jsp</result>
</action>
<action name="edit" class="lotusOrgAction" method="edit">
<result name="success">/msp/pages/org/slLotusOrgEditList.jsp</result>
</action>
<action name="update" class="lotusOrgAction" method="update">
<result name="success">/msp/pages/org/slLotusOrgEditList.jsp</result>
</action>
<action name="delete" class="lotusOrgAction" method="delete">
<result name="success">query.hlt</result>
</action>
<action name="qryhistory" class="lotusOrgAction" method="qryhistory">
<result name="list">/msp/pages/org/lotusOrgHistoryDetail.jsp</result>
</action>
<action name="initsave" class="lotusOrgAction" method="initsave">
<result name="init">/msp/pages/org/slLotusInputList.jsp</result>
</action>
<action name="save" class="lotusOrgAction" method="save">
<result name="success">/msp/pages/org/slLotusInputList.jsp</result>
</action>
</package>
</struts>
(2)spring.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"
default-lazy-init="true">
<description>运维工具配置</description>
<!-- 功能 LotusManager 开发者:wg 时间:2015-8-26 -->
<bean id="lotusOrgManager" class="com.holytax.eipp.msp.qorg.service.LotusOrgManager" parent="manager">
</bean>
<!-- 功能 报表Manager 开发者:wg 时间:2015-8-26 -->
<bean id="lotusOrgManagerImpl" class="com.holytax.eipp.msp.qorg.service.LotusOrgManagerImpl" parent="manager">
</bean>
<!-- 功能:LotusAction 开发者:wg 时间:2015-8-26-->
<bean id="lotusOrgAction" class="com.holytax.eipp.msp.qorg.action.LotusOrgAction" scope="prototype">
<!-- <property name="invoiceForManager" ref="invoiceForManager"/> -->
<property name="wsCfg" ref="propWsCfg"/>
</bean>
</beans>
(3)springServer.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"> <import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<bean id="aegisBean" class="org.apache.cxf.aegis.databinding.AegisDatabinding" /> <bean id="jaxws-and-aegis-service-factory" class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean">
<property name="dataBinding" ref="aegisBean" />
</bean>
<!--目的:对于lotus的webservice服务器端配置 wg 时间:2012-09-11 -->
<jaxws:server id="lotusOrgManager" serviceClass="com.holytax.eipp.msp.qorg.service.LotusOrgManager" address="/LotusOrgManager"><!--接口地址-->
<jaxws:serviceBean>
<ref bean="lotusOrgManagerImpl"/><!--接口方法的实现-->
</jaxws:serviceBean>
<jaxws:inInterceptors>
<bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
<bean class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor" /> <bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
<constructor-arg>
<map>
<entry key="action" value="UsernameToken" />
<entry key="passwordType" value="PasswordText" />
<entry key="user" value="cxfServer" />
<entry key="passwordCallbackRef">
<ref bean="serverPasswordCallback" />
</entry>
</map>
</constructor-arg>
</bean> </jaxws:inInterceptors>
<jaxws:outInterceptors>
<bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
</jaxws:outInterceptors>
<jaxws:inFaultInterceptors>
<bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
</jaxws:inFaultInterceptors>
<jaxws:outFaultInterceptors>
<bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
</jaxws:outFaultInterceptors>
</jaxws:server>
</beans>
(4)Action.java
package com.holytax.eipp.msp.qorg.action; import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map; import org.apache.commons.lang.StringUtils;
import org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor;
import org.apache.ws.security.WSConstants;
import org.apache.ws.security.handler.WSHandlerConstants; import com.holytax.base.action.BaseAction;
import com.holytax.base.service.Page;
import com.holytax.base.util.Constants;
import com.holytax.base.util.StringUtil;
import com.holytax.eipp.msp.qorg.entity.TAcOrgdataBackup;
import com.holytax.eipp.msp.qorg.entity.TLotusAcOrg;
import com.holytax.eipp.msp.qorg.model.LotusOrgModel;
import com.holytax.eipp.msp.qorg.service.LotusOrgManager;
import com.holytax.eipp.webservice.cfg.IWsCfg;
import com.holytax.eipp.webservice.model.WsModel;
import com.holytax.eipp.webservice.security.ClientPasswordCallback; public class LotusOrgAction extends BaseAction<TLotusAcOrg>{ /**
*
*/
private static final long serialVersionUID = -3501266082603574394L;
private LotusOrgModel orgModel = new LotusOrgModel();
private TLotusAcOrg entity=new TLotusAcOrg();
private LotusOrgManager lotusOrgManager;
//private Page<InvcoiceInforModel> page = new Page<InvcoiceInforModel>(Constants.PAGESIZE);
private IWsCfg wsCfg;
private Page<Map<String, Object>> page = new Page<Map<String, Object>>(
Constants.PAGESIZE);
private String[] _chk;//记录选中数组
private TAcOrgdataBackup lotusentity =new TAcOrgdataBackup();//莲花备份实体
private String loginUser;private Long parentid;
private Long orgid;
@Override
protected void prepareModel() throws Exception {
WsModel wsModel = wsCfg.getWsModel("holylotus");
LotusOrgManager lotusOrgManager = getholyVatManager(wsModel.getUrl());
if(entity.getOrgid()!=null){
entity=lotusOrgManager.findInvById(entity.getOrgid());
} }
/**
* 初始化方法
* @return
*/
public String init(){
return INIT;
}
/**
* 初始化方法
* @return
*/
public String initsave(){
orgModel.setCode("holylotus");
//String company = invModel.getCompany();
String code = orgModel.getCode();
if (StringUtil.isEmpty(code)) {
addActionMessage("请选择公司");
}
if (wsCfg == null) {
addActionMessage("未加载配置");
}
logger.info("使用ws配置:" + wsCfg.getClass().getName());
WsModel model = wsCfg.getWsModel(code);
if (model == null) {
addActionMessage("未找到" + code + "对应的配置信息");
}
LotusOrgManager lotusOrgManager = getholyVatManager(model.getUrl());
entity.setParentid(entity.getParentid());
return INIT;
}
/**
* 新增机构
* @return
*/
public String save(){
orgModel.setCode("holylotus");
//String company = invModel.getCompany();
String code = orgModel.getCode();
if (StringUtil.isEmpty(code)) {
addActionMessage("请选择公司");
}
if (wsCfg == null) {
addActionMessage("未加载配置");
}
logger.info("使用ws配置:" + wsCfg.getClass().getName());
WsModel model = wsCfg.getWsModel(code);
if (model == null) {
addActionMessage("未找到" + code + "对应的配置信息");
}
LotusOrgManager lotusOrgManager = getholyVatManager(model.getUrl());
try {
loginUser=(String) getSession().getAttribute(Constants.LOGIN_NAME);
entity.setCreateBy(loginUser);
entity.setCreateTime(new Date());
lotusOrgManager.save(entity);
addActionMessage("机构信息保存成功!!");
entity.setOrgname(null);
entity.setOrgcode(null);
entity.setTaxname(null);
entity.setTaxno(null);
entity.setLinkman(null);
entity.setPhone(null);
entity.setAddress(null);
entity.setEmail(null);
entity.setPostcode(null);
entity.setBank(null);
entity.setAccount(null);
entity.setTreelevel(null);
entity.setTreelayer(null);
entity.setRemark(null);
} catch (Exception e) {
addActionMessage("机构信息保存失败!!");
entity.setOrgname(null);
entity.setOrgcode(null);
entity.setTaxname(null);
entity.setTaxno(null);
entity.setLinkman(null);
entity.setPhone(null);
entity.setAddress(null);
entity.setEmail(null);
entity.setPostcode(null);
entity.setBank(null);
entity.setAccount(null);
entity.setTreelevel(null);
entity.setTreelayer(null);
entity.setRemark(null);
e.printStackTrace();
}
return SUCCESS;
}
/**
*lotus org数据查询
* @return
* @throws Exception
*/
@SuppressWarnings("rawtypes")
public String query ()throws Exception{
orgModel.setCode("holylotus");
String code = orgModel.getCode();
if (StringUtil.isEmpty(code)) {
addActionMessage("请选择公司");
}
if (wsCfg == null) {
addActionMessage("未加载配置");
}
logger.info("使用ws配置:" + wsCfg.getClass().getName());
WsModel model = wsCfg.getWsModel(code);
if (model == null) {
addActionMessage("未找到" + code + "对应的配置信息");
}
LotusOrgManager lotusOrgManager = getholyVatManager(model.getUrl());
page = (Page<Map<String, Object>>) lotusOrgManager.findVatPageList(page,
"REPORTSQL.findOrgMessage", entity,orgModel, null);
return LIST;
}
/**
*lotus org数据查询
* @return
* @throws Exception
*/
@SuppressWarnings("rawtypes")
public String qryhistory ()throws Exception{
orgModel.setCode("holylotus");
String code = orgModel.getCode();
if (StringUtil.isEmpty(code)) {
addActionMessage("请选择公司");
}
if (wsCfg == null) {
addActionMessage("未加载配置");
}
logger.info("使用ws配置:" + wsCfg.getClass().getName());
WsModel model = wsCfg.getWsModel(code);
if (model == null) {
addActionMessage("未找到" + code + "对应的配置信息");
}
LotusOrgManager lotusOrgManager = getholyVatManager(model.getUrl());
page = (Page<Map<String, Object>>) lotusOrgManager.findVatPageList(page,
"REPORTSQL.findOldOrgMessage", entity,null, null);
return LIST;
}
/**
* 机构明细方法
* @return
* @throws Exception
*/
public String detail ()throws Exception{
orgModel.setCode("holylotus");
String code = orgModel.getCode();
if (StringUtil.isEmpty(code)) {
addActionMessage("请选择公司");
}
if (wsCfg == null) {
addActionMessage("未加载配置");
}
logger.info("使用ws配置:" + wsCfg.getClass().getName());
WsModel model = wsCfg.getWsModel(code);
if (model == null) {
addActionMessage("未找到" + code + "对应的配置信息");
}
LotusOrgManager lotusOrgManager = getholyVatManager(model.getUrl());
page = (Page<Map<String, Object>>) lotusOrgManager.findVatPageList(page,
"REPORTSQL.findOneOrgMessage", entity,null, null);
return SUCCESS; }
/**
* 机构信息修改
* @return
* @throws Exception
*/
public String edit ()throws Exception{
orgModel.setCode("holylotus");
//String company = invModel.getCompany();
String code = orgModel.getCode();
if (StringUtil.isEmpty(code)) {
addActionMessage("请选择公司");
}
if (wsCfg == null) {
addActionMessage("未加载配置");
}
logger.info("使用ws配置:" + wsCfg.getClass().getName());
WsModel model = wsCfg.getWsModel(code);
if (model == null) {
addActionMessage("未找到" + code + "对应的配置信息");
}
LotusOrgManager lotusOrgManager = getholyVatManager(model.getUrl());
try {
entity=lotusOrgManager.findInvById(entity.getOrgid());
lotusentity.setOrgid(entity.getOrgid());
lotusentity.setOrgcode(entity.getOrgcode());
lotusentity.setOrgname(entity.getOrgname());
lotusentity.setTaxno(entity.getTaxno());
lotusentity.setTaxname(entity.getTaxname());
lotusentity.setParentid(entity.getParentid());
lotusentity.setOrgtype(entity.getOrgtype());
lotusentity.setLinkman(entity.getLinkman());
lotusentity.setPhone(entity.getPhone());
lotusentity.setAddress(entity.getAddress());
lotusentity.setEmail(entity.getEmail());
lotusentity.setPostcode(entity.getPostcode());
lotusentity.setBank(entity.getBank());
lotusentity.setAccount(entity.getAccount());
lotusentity.setExtracttype(entity.getExtracttype());
lotusentity.setExtractsoftzone(entity.getExtractsoftzone());
lotusentity.setScansoftzone(entity.getScansoftzone());
lotusentity.setIsbottom(entity.getIsbottom());
lotusentity.setOrglevel(entity.getTreelevel());
lotusentity.setOrglayer(entity.getTreelayer());
lotusentity.setCompany(entity.getCompany());
lotusentity.setRemark(entity.getRemark());
//lotusentity.setAutocommit(entity.GET);
lotusentity.setCreateTime(entity.getCreateTime());
lotusentity.setCreateBy(entity.getCreateBy());
lotusentity.setLastModifyTime(entity.getLastModifyTime());
lotusentity.setLastModifyBy(entity.getLastModifyBy());
lotusentity.setExtf4(entity.getExtf4());
lotusentity.setExtf5(entity.getExtf5());
lotusentity.setOperationtype("0");
lotusOrgManager.savelotus(lotusentity);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return SUCCESS;
}
public String update ()throws Exception{
orgModel.setCode("holylotus");
//String company = invModel.getCompany();
String code = orgModel.getCode();
if (StringUtil.isEmpty(code)) {
addActionMessage("请选择公司");
}
if (wsCfg == null) {
addActionMessage("未加载配置");
}
logger.info("使用ws配置:" + wsCfg.getClass().getName());
WsModel model = wsCfg.getWsModel(code);
if (model == null) {
addActionMessage("未找到" + code + "对应的配置信息");
}
LotusOrgManager lotusOrgManager = getholyVatManager(model.getUrl());
try {
//entity=lotusOrgManager.findInvById(entity.getOrgid());//通过主键找到
entity.setLastModifyTime(new Date());//更改修改人,为当前登录用户,修改时间当前系统时间
loginUser=(String) getSession().getAttribute(Constants.LOGIN_NAME);
entity.setLastModifyBy(loginUser);
lotusOrgManager.updateGds(entity);
TLotusAcOrg entity=null;
setIsSuc("true");
} catch (Exception e) {
setIsSuc("false");
e.printStackTrace();
}
return SUCCESS; }
/**
* @描述:删除勾选的机构
* @作者:wg
* @日期:2013-06-30
* @return
* @throws Exception
*/
public String delete() throws Exception{
orgModel.setCode("holylotus");
//String company = invModel.getCompany();
String code = orgModel.getCode();
if (StringUtil.isEmpty(code)) {
addActionMessage("请选择公司");
}
if (wsCfg == null) {
addActionMessage("未加载配置");
}
logger.info("使用ws配置:" + wsCfg.getClass().getName());
WsModel model = wsCfg.getWsModel(code);
if (model == null) {
addActionMessage("未找到" + code + "对应的配置信息");
}
LotusOrgManager lotusOrgManager = getholyVatManager(model.getUrl());
try {
//entity=lotusOrgManager.findInvById(entity.getOrgid());//通过主键找到
//loginUser=(String) getSession().getAttribute(Constants.LOGIN_NAME);
for(int i = 0;i< _chk.length;i++){
if(StringUtils.isNotBlank(_chk[i])){
entity = lotusOrgManager.findInvById(Long.parseLong(_chk[i]));
lotusentity.setOrgid(entity.getOrgid());
lotusentity.setOrgcode(entity.getOrgcode());
lotusentity.setOrgname(entity.getOrgname());
lotusentity.setTaxno(entity.getTaxno());
lotusentity.setTaxname(entity.getTaxname());
lotusentity.setParentid(entity.getParentid());
lotusentity.setOrgtype(entity.getOrgtype());
lotusentity.setLinkman(entity.getLinkman());
lotusentity.setPhone(entity.getPhone());
lotusentity.setAddress(entity.getAddress());
lotusentity.setEmail(entity.getEmail());
lotusentity.setPostcode(entity.getPostcode());
lotusentity.setBank(entity.getBank());
lotusentity.setAccount(entity.getAccount());
lotusentity.setExtracttype(entity.getExtracttype());
lotusentity.setExtractsoftzone(entity.getExtractsoftzone());
lotusentity.setScansoftzone(entity.getScansoftzone());
lotusentity.setIsbottom(entity.getIsbottom());
lotusentity.setOrglevel(entity.getTreelevel());
lotusentity.setOrglayer(entity.getTreelayer());
lotusentity.setCompany(entity.getCompany());
lotusentity.setRemark(entity.getRemark());
//lotusentity.setAutocommit(entity.GET);
lotusentity.setCreateTime(entity.getCreateTime());
lotusentity.setCreateBy(entity.getCreateBy());
lotusentity.setLastModifyTime(entity.getLastModifyTime());
lotusentity.setLastModifyBy(entity.getLastModifyBy());
lotusentity.setExtf4(entity.getExtf4());
lotusentity.setExtf5(entity.getExtf5());
lotusentity.setOperationtype("1");
lotusOrgManager.savelotus(lotusentity); }
}
List<TLotusAcOrg> agreelist =lotusOrgManager.delete(_chk, (String)getSession().getAttribute(Constants.LOGIN_NAME));
if(agreelist.size()>0){
StringBuilder sb = new StringBuilder();
addActionMessage(sb.toString());
}else{
addActionMessage("成功删除!");
}
} catch (Exception e) {
addActionMessage("删除失败!");
e.printStackTrace();
} return SUCCESS;
}
/**
* @描述: 动态的生成一期库的管理类
* @作者:byq
* @日期:2012-9-14
* @return:ILotusVatManager
*/
private LotusOrgManager getholyVatManager(String address) {
if (logger.isDebugEnabled()) {
logger.debug("create LotusOrgManager client webservice...");
}
JaxWsProxyFactoryBean bean = new JaxWsProxyFactoryBean();
Map<String, Object> outProps = new HashMap<String, Object>();
outProps.put(WSHandlerConstants.ACTION,
WSHandlerConstants.USERNAME_TOKEN);
outProps.put(WSHandlerConstants.USER, "cxfClient");
outProps.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_TEXT);
outProps.put(WSHandlerConstants.PW_CALLBACK_CLASS,
ClientPasswordCallback.class.getName());
WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps);
bean.getOutInterceptors().add(wssOut);
bean.getOutInterceptors().add(new SAAJOutInterceptor()); bean.setServiceClass(LotusOrgManager.class);
bean.setAddress(address + "/services/LotusOrgManager");
LotusOrgManager service = (LotusOrgManager) bean.create();
return service;
}
public IWsCfg getWsCfg() {
return wsCfg;
}
public LotusOrgModel getOrgModel() {
return orgModel;
}
public void setOrgModel(LotusOrgModel orgModel) {
this.orgModel = orgModel;
}
public LotusOrgManager getLotusOrgManager() {
return lotusOrgManager;
}
public void setLotusOrgManager(LotusOrgManager lotusOrgManager) {
this.lotusOrgManager = lotusOrgManager;
}
public void setWsCfg(IWsCfg wsCfg) {
this.wsCfg = wsCfg;
}
public Page<Map<String, Object>> getPage() {
return page;
}
public void setPage(Page<Map<String, Object>> page) {
this.page = page;
}
public TLotusAcOrg getEntity() {
return entity;
}
public void setEntity(TLotusAcOrg entity) {
this.entity = entity;
}
@Override
public TLotusAcOrg getModel() {
// TODO Auto-generated method stub
return entity;
}
public String[] get_chk() {
return _chk;
}
public void set_chk(String[] _chk) {
this._chk = _chk;
}
public TAcOrgdataBackup getLotusentity() {
return lotusentity;
}
public void setLotusentity(TAcOrgdataBackup lotusentity) {
this.lotusentity = lotusentity;
}
public String getLoginUser() {
return loginUser;
}
public void setLoginUser(String loginUser) {
this.loginUser = loginUser;
}
public Long getParentid() {
return parentid;
}
public void setParentid(Long parentid) {
this.parentid = parentid;
}
public Long getOrgid() {
return orgid;
}
public void setOrgid(Long orgid) {
this.orgid = orgid;
}
}
(5)WsModel.jsva
package com.holytax.eipp.webservice.model; public class WsModel { private String code;
private String desc;
private String url;
private String tableName; public WsModel(){ } public WsModel(String code, String desc,
String url){
this.code = code;
this.desc = desc;
this.url = url;
} public WsModel(String code, String desc,
String url, String tableName){
this.code = code;
this.desc = desc;
this.url = url;
this.tableName = tableName;
} public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getTableName() {
return tableName;
}
public void setTableName(String tableName) {
this.tableName = tableName;
} @Override
public String toString() {
return "SystemModel [code=" + code + ", desc=" + desc + ", url=" + url
+ ", tableName=" + tableName + "]";
} }
(6)service-->manager.java
package com.holytax.eipp.msp.qorg.service; import java.util.List;
import java.util.Map; import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import com.holytax.base.service.IPage;
import com.holytax.eipp.msp.qorg.entity.TAcOrgdataBackup;
import com.holytax.eipp.msp.qorg.entity.TAcVangorgBackup;
import com.holytax.eipp.msp.qorg.entity.TLotusAcOrg;
import com.holytax.eipp.msp.qorg.entity.TVanguanOrg;
import com.holytax.eipp.msp.qorg.model.LotusOrgModel;
import com.holytax.eipp.webservice.adapter.MapAdapter;
import com.holytax.eipp.webservice.adapter.PageMapAdapter;
@WebService
public interface LotusOrgManager{
/**
*莲花部分,分页查询
* @param mapPage
* @param sql
* @param entity
* @param orgModel
* @param mapParam
* @return
*/
@SuppressWarnings("unchecked")
@WebMethod
@XmlJavaTypeAdapter(PageMapAdapter.class)
public IPage<Map<String, Object>> findVatPageList(
@WebParam(name = "mapPage")
@XmlJavaTypeAdapter(PageMapAdapter.class)
final IPage<Map<String, Object>> mapPage,
@WebParam
final String sql,
@WebParam(name = "entity")
final TLotusAcOrg entity,
@WebParam(name = "invModel")
final LotusOrgModel orgModel,
@WebParam(name = "mapParam")
@XmlJavaTypeAdapter(MapAdapter.class) final Map mapParam); @WebMethod
public TLotusAcOrg findInvById(@WebParam(name = "id")final Long id); @WebMethod
public TAcOrgdataBackup findOrgById(@WebParam(name = "id")final Long id); /**
* 修改对象
* @param entity
* add by ZM 2010-11-23
* @return
*/
@WebMethod
public void updateGds(TLotusAcOrg entity);
/**
* 新增或是更新保存对象
* @param entity
* add by sjy 2010-11-15
*/
@WebMethod
public void save(TLotusAcOrg entity); @WebMethod
public void savelotus(TAcOrgdataBackup lotusentity); /**
* @描述: 删除选中商品
* @作者: wg
* @日期:2015-5-19
* @param ids 选中的id数组
*/
@WebMethod
public List<TLotusAcOrg> delete(String[] ids, String attribute);
}
(6)service-->managerImpl.java
public class LotusOrgManagerImpl extends BaseManager implements LotusOrgManager{
/**
* @描述: 一期库发票修改查询
* @作者:wg
* @日期:2012-9-11
* @return:void
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
public IPage<Map<String, Object>> findVatPageList(
final IPage<Map<String, Object>> mapPage,
final String sql,
final TLotusAcOrg entity,
final LotusOrgModel orgModel,
final Map mapParam){
Map<String, Object> map = new HashMap<String, Object>();
if(orgModel != null){
map.putAll(ConvertUtils.pojoToMap(orgModel));
}
if(mapParam != null){
map.putAll(mapParam);
}
if(entity != null){
map.putAll(ConvertUtils.pojoToMap(entity));
}
Page<Map<String, Object>> queryResult = sqlDao.findPage((Page)mapPage, sql, map);
return queryResult;
} /**
* 根据id查询对象
*
*/
public TLotusAcOrg findInvById(Long id) {
return (TLotusAcOrg) dao.findById(TLotusAcOrg.class, id);
}
/**
* 根据id查询对象
*
*/
public TAcOrgdataBackup findOrgById(Long id) {
return (TAcOrgdataBackup) dao.findById(TAcOrgdataBackup.class, id);
}
/**
* 修改对象
* @param entity
* add by wg 2010-11-23
* @return
*/
public void updateGds(TLotusAcOrg entity){
dao.saveOrUpdate(entity);
}
/**
* 新增或是更新保存对象
* @param entity
* add by wg 2010-11-15
*/
public void save(TLotusAcOrg entity){
dao.save(entity);
} public void savelotus(TAcOrgdataBackup lotusentity){
dao.save(lotusentity);
}
/**
* 删除选中数据
*/
@Override
public List<TLotusAcOrg> delete(String[] ids, String attribute) {
List list = new ArrayList();
TLotusAcOrg ent = null;
for(int i = 0;i< ids.length;i++){
if(StringUtils.isNotBlank(ids[i])){
ent = this.findInvById(Long.parseLong(ids[i]));
}
//删除主表
dao.delete(ent);
}
return list;
}
}
(7)最后在总的配置文件配置sql.xml,spring.xml,strtus即可。。。。
(8)所谓的服务端,就是把客户端复制一份,,修改项目名。。。更改数据连接地址即可。。。还有一种情况,就是客户端,即是服务端,又是客户端,,但是流程是一样的。。。
webServices 执行流程,(我是菜鸟,我怕谁,仅代表个人理解,欢迎各位大神们指导,不和您的胃口,请默默离开!!)的更多相关文章
- HDU 2520 我是菜鸟我怕谁
2019-05-27 17:52:01 加油!!! 看题时候就要仔细,最后容易忘记%10000 #include <bits/stdc++.h> using namespace std; ...
- 深入浅出Mybatis系列(十)---SQL执行流程分析(源码篇)
最近太忙了,一直没时间继续更新博客,今天忙里偷闲继续我的Mybatis学习之旅.在前九篇中,介绍了mybatis的配置以及使用, 那么本篇将走进mybatis的源码,分析mybatis 的执行流程, ...
- JavaScript 引擎 V8 执行流程概述
本文首发于 vivo互联网技术 微信公众号 链接:https://mp.weixin.qq.com/s/t__Jqzg1rbTlsCHXKMwh6A作者:赖勇高 本文主要讲解的是V8的技术,是V8的入 ...
- 深入浅出Mybatis系列十-SQL执行流程分析(源码篇)
注:本文转载自南轲梦 注:博主 Chloneda:个人博客 | 博客园 | Github | Gitee | 知乎 最近太忙了,一直没时间继续更新博客,今天忙里偷闲继续我的Mybatis学习之旅.在前 ...
- 【推理引擎】从源码看ONNXRuntime的执行流程
目录 前言 准备工作 构造 InferenceSession 对象 & 初始化 让模型 Run 总结 前言 在上一篇博客中:[推理引擎]ONNXRuntime 的架构设计,主要从文档上对ONN ...
- HDU2520 我是菜鸟,我怕谁
http://acm.hdu.edu.cn/showproblem.php?pid=2520 我是菜鸟,我怕谁 Time Limit: 2000/1000 MS (Java/Others) Memor ...
- 我是菜鸟,我怕谁--hdu2520
我是菜鸟,我怕谁 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Su ...
- HDU 2520 我是菜鸟,我怕谁
我是菜鸟,我怕谁 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Su ...
- 我是菜鸟,我怕谁(hdu2520)
我是菜鸟,我怕谁 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total S ...
随机推荐
- C语言结构体的对齐原则
Q:关于结构体的对齐,到底遵循什么原则?A:首先先不讨论结构体按多少字节对齐,先看看只以1字节对齐的情况: #include <stdio.h> #include <string.h ...
- SQL Server 2008 数据库误删除数据的恢复
原文:SQL Server 2008 数据库误删除数据的恢复 原文:http://www.cnblogs.com/dudu/archive/2011/10/15/sql_server_recover_ ...
- 创办支持多种屏幕尺寸的Android应用
创建支持多种屏幕尺寸的Android应用 Android涉及各种各样的支持不同屏幕尺寸和密度的设备.对于应用程序,Android系统通过设备和句柄提供了统一的开发环境,大部分工作是校正每一个应用程序的 ...
- HTML,CSS编码规范
不管有多少人共同参与同一项目,一定要确保每一行代码都像是同一个人编写的. HTML 语法 对于属性的定义,确保全部使用双引号,绝不要使用单引号. 为每个 HTML 页面的第一行添加标准模式(stand ...
- poj1637
混合图欧拉回路首先先明确基本概念连通的无向图存在欧拉回路当且仅当不存在奇点连通的有向图当且仅当每个点入度=出度这道题我们显然应该当作连通的有向图来做这个问题的困难之处在于我不知道应该从无向边的什么方向 ...
- Delhi 安装ocx的方法
Delhi 安装ocx的方法 1.通过cmd注册 2.通过delphi 注册 然后 可以修改 classnames 改成__tlb.pas单元中的控件的名称,就可以了 例如下图:
- iOS开发tips总结
tip 1 : 给UIImage添加毛玻璃效果 func blurImage(value:NSNumber) -> UIImage { let context = CIContext(opti ...
- 容斥原理应用(求1~r中有多少个数与n互素)
问题:求1~r中有多少个数与n互素. 对于这个问题由容斥原理,我们有3种写法,其实效率差不多.分别是:dfs,队列数组,位运算. 先说说位运算吧: 用二进制1,0来表示第几个素因子是否被用到,如m=3 ...
- 找不到这个cache.properties缓存文件
Android Studio在导入第三库同步时报错: C:\Users\Administrator\.gradle\caches\2.4\scripts\asLocalRepo88_4u65z0u2 ...
- Centos6.5 nginx+nginx-rtmp配置流媒体服务器
之前使用命令方式安装nginx并配置了反向代理,由于想做一个视频直播的小项目,查了流媒体服务器的方案,发现nginx有相关模块,于是开始搞起. nginx-rtmp模块需要在nginx编译时,以模块方 ...