Explorar o código

展会扫码进场代码更新

沈静伟 %!s(int64=3) %!d(string=hai) anos
pai
achega
902dd06ba9

+ 71 - 0
src/dsb/com/cnd3b/restcontroller/customer/activity/activitysignup.java

@@ -0,0 +1,71 @@
+package com.cnd3b.restcontroller.customer.activity;
+
+import com.alibaba.fastjson.JSONObject;
+import com.cnd3b.common.Controller;
+import com.cnd3b.common.D3bException;
+import com.cnd3b.common.data.Rows;
+import com.cnd3b.common.data.SQLFactory;
+import p2.pao.PaoRemote;
+import p2.pao.PaoSetRemote;
+import p2.util.P2Exception;
+
+/**
+ * 展会活动访客注册表
+ */
+public class activitysignup extends Controller {
+    public activitysignup(JSONObject content) {
+        super(content);
+    }
+
+    /**
+     * 访客登记注册
+     *
+     * @return
+     * @throws D3bException
+     * @throws P2Exception
+     */
+    public String signup() throws D3bException, P2Exception {
+        long tactivityid = content.getLong("tactivityid");
+        String fname = content.getString("fname", "tactivitysignup.fname", "姓名");
+        String fidcard = content.getString("fidcard", "tactivitysignup.fidcard", "身份证号");
+        String fphonenumber = content.getString("fphonenumber", "tactivitysignup.fphonenumber", "手机号");
+        String findustry = content.getString("findustry", "tactivitysignup.findustry", "行业");
+        String fcompname = content.getString("fcompname", "tactivitysignup.fcompname", "公司");
+        String frole = content.getString("frole", "tactivitysignup.frole", "职位");
+        String faddress = content.getString("faddress", "tactivitysignup.faddress", "住址");
+        String fchannel = content.getString("fchannel", "tactivitysignup.fchannel", "入会渠道");
+
+        PaoSetRemote tscanningSet = getP2ServerSystemPaoSet("tactivitysignup", "siteid='" + siteid + "' and tactivityid ='" + tactivityid + "' and tenterprise_userid='" + userid + "'");
+        PaoRemote tscanning = null;
+        if (tscanningSet.isEmpty()) {
+            tscanning = tscanningSet.addAtEnd();
+            tscanning.setValue("tenterprise_userid", userid, 11L);
+            tscanning.setValue("siteid", siteid, 11L);
+            tscanning.setValue("createdate", sysdate, 11L);
+            tscanning.setValue("tactivityid", tactivityid, 11L);
+        } else {
+            tscanning = tscanningSet.getPao(0);
+        }
+        tscanning.setValue("fname", fname, 11L);
+        tscanning.setValue("fidcard", fidcard, 11L);
+        tscanning.setValue("fphonenumber", fphonenumber, 11L);
+        tscanning.setValue("findustry", findustry, 11L);
+        tscanning.setValue("fcompname", fcompname, 11L);
+        tscanning.setValue("frole", frole, 11L);
+        tscanning.setValue("faddress", faddress, 11L);
+        tscanning.setValue("fchannel", fchannel, 11L);
+        tscanningSet.save();
+        return getSucReturnObject().toString();
+    }
+
+    /**
+     * 查询注册信息,前端根据此信息生成身份码
+     *
+     * @return
+     */
+    public String getsignupmsg() {
+        long tactivityid = content.getLong("tactivityid");
+        Rows rows = dbConnect.runSqlQuery("select * from tactivitysignup where siteid='" + siteid + "' and tactivityid='" + tactivityid + "' and tenterprise_userid='" + userid + "'");
+        return getSucReturnObject().setDataByPaging(rows).toString();
+    }
+}

+ 3 - 0
src/dsb/com/cnd3b/restcontroller/enterprise/activity/SQL/入场信息列表查询.sql

@@ -0,0 +1,3 @@
+select t1.createdate,t1.flocation,t1.fecid,t2.frole,t2.fphonenumber,t2.fname,t2.findustry,t2.fidcard,t2.fcompname,t2.fchannel,t2.faddress from tactivityvisitmsg t1
+inner join tactivitysignup t2 on t1.siteid=t2.siteid and t1.tactivitysignupid=t2.tactivitysignupid
+where t1.siteid=$siteid$ and t2.tactivityid=$tactivityid$

+ 3 - 0
src/dsb/com/cnd3b/restcontroller/enterprise/activity/SQL/扫码枪列表查询.sql

@@ -0,0 +1,3 @@
+select t1.fecid,t1.flocation,t1.fnotes,t1.createdate,t2.ftitle from tscanning t1
+inner join tactivity t2 on t1.siteid=t2.siteid and t1.tactivityid=t2.tactivityid
+where $where$ and t1.siteid=$siteid$

+ 2 - 0
src/dsb/com/cnd3b/restcontroller/enterprise/activity/SQL/访客入场信息查询.sql

@@ -0,0 +1,2 @@
+select t1.tactivitysignupid,t1.createdate,t1.flocation,t1.fecid from tactivityvisitmsg t1
+where t1.siteid=$siteid$ and t1.tactivitysignupid in $t1.tactivitysignupid$

+ 2 - 0
src/dsb/com/cnd3b/restcontroller/enterprise/activity/SQL/访客登记信息查询.sql

@@ -0,0 +1,2 @@
+select t1.createdate,t1.faddress,t1.fchannel,t1.fcompname,t1.fidcard,t1.findustry,t1.fname,t1.fphonenumber,t1.frole,t1.tactivitysignupid from tactivitysignup t1
+where $where$ and t1.siteid=$siteid$ and t1.tactivityid=$tactivityid$

+ 76 - 0
src/dsb/com/cnd3b/restcontroller/enterprise/activity/activitysignup.java

@@ -0,0 +1,76 @@
+package com.cnd3b.restcontroller.enterprise.activity;
+
+import com.alibaba.fastjson.JSONObject;
+import com.cnd3b.common.Controller;
+import com.cnd3b.common.D3bException;
+import com.cnd3b.common.data.Row;
+import com.cnd3b.common.data.Rows;
+import com.cnd3b.common.data.RowsMap;
+import com.cnd3b.common.data.SQLFactory;
+import p2.pao.PaoRemote;
+import p2.pao.PaoSetRemote;
+import p2.util.P2Exception;
+
+/**
+ * 展会活动访客注册表
+ */
+public class activitysignup extends Controller {
+    public activitysignup(JSONObject content) {
+        super(content);
+    }
+
+    /**
+     * 查询注册信息
+     *
+     * @return
+     */
+    public String getsignupmsglist() {
+        /**
+         * 过滤条件设置
+         */
+        StringBuffer where = new StringBuffer(" 1=1 ");
+        if (content.containsKey("where")) {
+            JSONObject whereObject = content.getJSONObject("where");
+            if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
+                where.append(" and(");
+                where.append("t1.fcompname like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append("or t1.fname like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append("or t1.fphonenumber like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append(")");
+            }
+        }
+        long tactivityid = content.getLong("tactivityid");
+        SQLFactory signuplistsql = new SQLFactory(this, "访客登记信息查询", pageSize, pageNumber, "t1.createdate desc");
+        signuplistsql.addParameter("siteid", siteid);
+        signuplistsql.addParameter("tactivityid", tactivityid);
+        signuplistsql.addParameter_SQL("where", where);
+        Rows signuprows = dbConnect.runSqlQuery(signuplistsql);
+
+        SQLFactory visitlistsql = new SQLFactory(this, "访客入场信息查询");
+        visitlistsql.addParameter("siteid", siteid);
+        visitlistsql.addParameter_in("tactivitysignupid", signuprows.toArrayList("tactivitysignupid"));
+        RowsMap visitlistrows = dbConnect.runSqlQuery(visitlistsql).toRowsMap("tactivitysignupid");
+
+        for (Row signuprow : signuprows) {
+            Rows visitrows = visitlistrows.get(signuprow.getString("tactivitysignupid"));
+            signuprow.put("visittimes", visitrows.size());
+            signuprow.put("visitmsg", visitrows);
+        }
+        return getSucReturnObject().setDataByPaging(signuprows).toString();
+    }
+
+
+    /**
+     * 访客查询入场信息
+     *
+     * @return
+     */
+    public String getvisitmsglist() {
+        long tactivityid = content.getLong("tactivityid");
+        SQLFactory signuplistsql = new SQLFactory(this, "入场信息列表查询", pageSize, pageNumber, "t1.createdate desc");
+        signuplistsql.addParameter("siteid", siteid);
+        signuplistsql.addParameter("tactivityid", tactivityid);
+        Rows signuprows = dbConnect.runSqlQuery(signuplistsql);
+        return getSucReturnObject().setDataByPaging(signuprows).toString();
+    }
+}

+ 87 - 0
src/dsb/com/cnd3b/restcontroller/enterprise/activity/scanning.java

@@ -0,0 +1,87 @@
+package com.cnd3b.restcontroller.enterprise.activity;
+
+import com.alibaba.fastjson.JSONObject;
+import com.cnd3b.common.Controller;
+import com.cnd3b.common.D3bException;
+import com.cnd3b.common.data.Rows;
+import com.cnd3b.common.data.SQLFactory;
+import p2.pao.PaoRemote;
+import p2.pao.PaoSetRemote;
+import p2.util.P2Exception;
+
+/**
+ * 扫码枪管理
+ */
+public class scanning extends Controller {
+    public scanning(JSONObject content) {
+        super(content);
+    }
+
+    /**
+     * 扫码枪列表查询
+     *
+     * @return
+     */
+    public String query_scanninglist() {
+        /**
+         * 过滤条件设置
+         */
+        StringBuffer where = new StringBuffer(" 1=1 ");
+        if (content.containsKey("where")) {
+            JSONObject whereObject = content.getJSONObject("where");
+            if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
+                where.append(" and(");
+                where.append("t1.fecid like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append("or t1.flocation like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append("or t1.fnotes like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append("or t2.ftitle like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append(")");
+            }
+        }
+        SQLFactory sqlFactory = new SQLFactory(this, "扫码枪列表查询", pageSize, pageNumber, "t1.flocation");
+        sqlFactory.addParameter_SQL("where", where);
+        sqlFactory.addParameter("siteid", siteid);
+
+        Rows rows = dbConnect.runSqlQuery(sqlFactory);
+        return getSucReturnObject().setDataByPaging(rows).toString();
+    }
+
+    /**
+     * 扫码枪新增修改
+     *
+     * @return
+     * @throws D3bException
+     * @throws P2Exception
+     */
+    public String insertormodify_scanning() throws D3bException, P2Exception {
+        String fecid = content.getString("fecid", "tscanning.fecid", "设备码");
+        String flocation = content.getString("flocation", "tscanning.flocation", "位置");
+        String fnotes = content.getString("fnotes", "tscanning.fnotes", "设备描述");
+        long tactivityid = content.getLong("tactivityid");
+
+        PaoSetRemote tscanningSet = getP2ServerSystemPaoSet("tscanning", "fecid='" + fecid + "'");
+        PaoRemote tscanning = null;
+        if (tscanningSet.isEmpty()) {
+            tscanning = tscanningSet.addAtEnd();
+            tscanning.setValue("tactivityid", tactivityid, 11L);
+            tscanning.setValue("fecid", fecid, 11L);
+            tscanning.setValue("flocation", flocation, 11L);
+            tscanning.setValue("fnotes", fnotes, 11L);
+            tscanning.setValue("siteid", siteid, 11L);
+            tscanning.setValue("createdate", sysdate, 11L);
+        } else {
+            tscanning = tscanningSet.getPao(0);
+        }
+        tscanning.setValue("flocation", flocation, 11L);
+        tscanning.setValue("fnotes", fnotes, 11L);
+        tscanningSet.save();
+
+        return getSucReturnObject().toString();
+    }
+
+    public String delete_scanning() throws D3bException, P2Exception {
+        String fecid = content.getString("fecid");
+        dbConnect.runSqlUpdate("delete from tscanning where fecid='" + fecid + "' and siteid='" + siteid + "'");
+        return getSucReturnObject().toString();
+    }
+}

+ 5 - 0
src/dsb/com/cnd3b/restcontroller/publicmethod/activity/SQL/插入扫码入场信息.sql

@@ -0,0 +1,5 @@
+insert into tactivityvisitmsg(tactivityvisitmsid, rmkenable, siteid, tactivitysignupid, createdate, flocation, fecid)
+select $tactivityvisitmsid$, 0, t1.siteid, t1.tactivitysignupid, getDate(), t2.flocation, t2.fecid
+from tactivitysignup t1
+inner join tscanning t2 on t1.siteid=t2.siteid and t1.tactivityid=t2.tactivityid and t2.fecid=$fecid$
+where t1.tactivitysignupid=$tactivitysignupid$

+ 58 - 0
src/dsb/com/cnd3b/restcontroller/publicmethod/activity/scanning.java

@@ -0,0 +1,58 @@
+package com.cnd3b.restcontroller.publicmethod.activity;
+
+import com.alibaba.fastjson.JSONObject;
+import com.cnd3b.common.Controller;
+import com.cnd3b.common.D3bException;
+import com.cnd3b.common.data.Row;
+import com.cnd3b.common.data.Rows;
+import com.cnd3b.common.data.SQLFactory;
+import p2.pao.PaoRemote;
+import p2.pao.PaoSetRemote;
+import p2.util.P2Exception;
+
+/**
+ * �쯤퓜
+ */
+public class scanning extends Controller {
+    public scanning(JSONObject content) {
+        super(content);
+    }
+
+    /**
+     * �쯤흙끝
+     *
+     * @return
+     */
+    public String entering() {
+        String fecid = content.getString("fecid");
+        long tactivitysignupid = content.getLong("tactivitysignupid");
+
+        Rows signupRows = dbConnect.runSqlQuery("select fname,fphonenumber,siteid from tactivitysignup where tactivitysignupid=" + tactivitysignupid);
+        if (signupRows.isEmpty()) {
+            return getErrReturnObject().setErrMsg("轟늪련와되션斤口").toString();
+        }
+        String fname = signupRows.get(0).getString("fname");
+        String fphonenumber = signupRows.get(0).getString("fphonenumber");
+        String siteid = signupRows.get(0).getString("siteid");
+
+        Rows scanningRows = dbConnect.runSqlQuery("select flocation from tscanning where fecid='" + fecid + "' and siteid='" + siteid + "'");
+        if (scanningRows.isEmpty()) {
+            return getErrReturnObject().setErrMsg("뎠품�쯤�구灌鬧꿍").toString();
+        }
+        String flocation = scanningRows.get(0).getString("flocation");
+
+        SQLFactory sqlFactory = new SQLFactory(this, "�쯤퓜죗깊꿴璂", pageSize, pageNumber, "t1.flocation");
+        sqlFactory.addParameter("tactivityvisitmsid", createTableID("tactivityvisitmsg", "tactivityvisitmsid"));
+        sqlFactory.addParameter("fecid", fecid);
+        sqlFactory.addParameter("tactivitysignupid", tactivitysignupid);
+        dbConnect.runSqlUpdate(sqlFactory);
+        JSONObject object = new JSONObject();
+
+        object.put("fname", fname);
+        object.put("fphonenumber", fphonenumber);
+        object.put("ftime", sysdate);
+        object.put("flocation", flocation);
+
+        return getSucReturnObject().setData(object).toString();
+    }
+}