⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 alipaymsgaction.java

📁 cwbbs 云网论坛源码
💻 JAVA
字号:
package com.redmoon.forum.plugin2.alipay;import javax.servlet.http.HttpServletRequest;import cn.js.fan.util.ErrMsgException;import javax.servlet.ServletContext;import com.redmoon.forum.plugin.base.IPluginMsgAction;import org.apache.log4j.Logger;import com.redmoon.forum.MsgDb;import cn.js.fan.util.StrUtil;import cn.js.fan.util.ResKeyException;import com.redmoon.kit.util.FileUpload;import cn.js.fan.web.SkinUtil;public class AlipayMsgAction implements IPluginMsgAction {    Logger logger = Logger.getLogger(this.getClass().getName());    public AlipayMsgAction() {    }    public boolean AddNew(ServletContext application,                          HttpServletRequest request, MsgDb md, FileUpload fu) throws            ErrMsgException {        String plugin2Code = "alipay";        String seller = StrUtil.getNullStr(fu.getFieldValue("alipay_seller")).trim();        logger.info("AddNew: seller=" + seller);        if (seller.equals(""))            throw new ErrMsgException(SkinUtil.LoadString(request, "res.forum.plugin2.alipay", "err_want_seller"));        String subject = StrUtil.getNullStr(fu.getFieldValue("alipay_subject")).trim();        if (subject.equals(""))            throw new ErrMsgException(SkinUtil.LoadString(request, "res.forum.plugin2.alipay", "err_want_subject"));        String price = StrUtil.getNullStr(fu.getFieldValue("alipay_price"));        if (price.equals(""))            throw new ErrMsgException(SkinUtil.LoadString(request, "res.forum.plugin2.alipay", "err_want_price"));        String transport = StrUtil.getNullStr(fu.getFieldValue("alipay_transport"));        String demo = StrUtil.getNullStr(fu.getFieldValue("alipay_demo"));        String ordinary = StrUtil.getNullStr(fu.getFieldValue("alipay_ordinary"));        String express = StrUtil.getNullStr(fu.getFieldValue("alipay_express"));        String ww = StrUtil.getNullStr(fu.getFieldValue("alipay_ww"));        String qq = StrUtil.getNullStr(fu.getFieldValue("alipay_qq"));        if (!StrUtil.isNumeric(qq)) {            throw new ErrMsgException(SkinUtil.LoadString(request, "res.forum.plugin2.alipay", "err_QQ"));        }        AlipayDb ad = new AlipayDb();        ad.setMsgRootId(md.getId());        ad.setSeller(seller);        ad.setSubject(subject);        ad.setPrice(price);        ad.setTransport(Integer.parseInt(transport));        ad.setDemo(demo);        ad.setOrdinary(ordinary);        ad.setExpress(express);        ad.setWw(ww);        ad.setQq(qq);        return ad.create();    }        public synchronized boolean editTopic(ServletContext application,                                          HttpServletRequest request,                                          MsgDb md, FileUpload fu) throws            ErrMsgException {        boolean re = true;        logger.info("editTopic:replyId=" + md.getReplyid() + " id=" + md.getId());        if (md.getReplyid() == -1) {            String seller = StrUtil.getNullStr(fu.getFieldValue("alipay_seller")).trim();            if (seller.equals(""))                throw new ErrMsgException(SkinUtil.LoadString(request, "res.forum.plugin2.alipay", "err_want_seller"));            String subject = StrUtil.getNullStr(fu.getFieldValue("alipay_subject")).trim();            if (subject.equals(""))                throw new ErrMsgException(SkinUtil.LoadString(request, "res.forum.plugin2.alipay", "err_want_subject"));            String price = StrUtil.getNullStr(fu.getFieldValue("alipay_price"));            if (price.equals(""))                throw new ErrMsgException(SkinUtil.LoadString(request, "res.forum.plugin2.alipay", "err_want_price"));            String transport = StrUtil.getNullStr(fu.getFieldValue("alipay_transport"));            String demo = StrUtil.getNullStr(fu.getFieldValue("alipay_demo"));            String ordinary = StrUtil.getNullStr(fu.getFieldValue("alipay_ordinary"));            String express = StrUtil.getNullStr(fu.getFieldValue("alipay_express"));            String ww = StrUtil.getNullStr(fu.getFieldValue("alipay_ww"));            String qq = StrUtil.getNullStr(fu.getFieldValue("alipay_qq"));            if (!StrUtil.isNumeric(qq)) {                throw new ErrMsgException(SkinUtil.LoadString(request, "res.forum.plugin2.alipay", "err_QQ"));            }            AlipayDb ad = new AlipayDb();            ad = ad.getAlipaydDb(md.getId());            ad.setSeller(seller);            ad.setSubject(subject);            ad.setPrice(price);            ad.setTransport(Integer.parseInt(transport));            ad.setDemo(demo);            ad.setOrdinary(ordinary);            ad.setExpress(express);            ad.setWw(ww);            ad.setQq(qq);            re = ad.save();        }        return re;    }    public boolean AddQuickReply(ServletContext application,                                 HttpServletRequest request, long replyMsgId) throws            ErrMsgException {        return true;    }        public boolean delTopic(ServletContext application,                            HttpServletRequest request, MsgDb md) throws            ErrMsgException {                if (md.getReplyid() == -1) {            AlipayDb ad = new AlipayDb();            ad = ad.getAlipaydDb(md.getId());            if (ad.isLoaded()) {                return ad.del();            }        }        return true;    }        public boolean delSingleMsg(long delId) throws            ResKeyException {        return true;    }    public boolean AddReply(ServletContext application,                            HttpServletRequest request, MsgDb md, FileUpload fu) throws            ErrMsgException {        return true;    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -