Parcourir la source

1:去除String类型的经销商ID
2:客户端经销商信息查询及经销商信息修改申请接口
3:用户信息查询去除多余字段
4:去除账号信息

沈静伟 il y a 4 ans
Parent
commit
ab868e522e

+ 2 - 6
src/dsb/com/cnd3b/common/Controller.java

@@ -39,8 +39,7 @@ public class Controller extends BaseClass {
     public long userid = 0L;
     public String username = "";
     public String siteid = "";
-    public String tagentsid = "";
-    public long tagentsId = 0L;
+    public long tagentsid = 0L;
     public String fusertype = "";
     public String fphonenumber = "";
     public DBConnect dbConnect = null;
@@ -91,7 +90,7 @@ public class Controller extends BaseClass {
         if (parameter.userIdList.containsKey(userid)) {
             Row row = parameter.userIdList.get(userid);
             siteid = row.getString("siteid");
-            tagentsid = row.getString("tagentsid");
+            tagentsid = row.getLong("tagentsid");
             fusertype = row.getString("fusertype");
             username = row.getString("fname");
             fphonenumber = row.getString("fphonenumber");
@@ -99,9 +98,6 @@ public class Controller extends BaseClass {
             fisadministrator = row.getBoolean("fisadministrator");
             createRequestLog();
         }
-        if (!"".equals(tagentsid)) {
-            tagentsId = Long.parseLong(tagentsid);
-        }
     }
 
 

+ 24 - 0
src/dsb/com/cnd3b/restcontroller/customer/tagents/SQL/经销商主界面查询.sql

@@ -0,0 +1,24 @@
+select t1.tagentsid,
+       t1.siteid,
+       t1.createby,
+       t1.createdate,
+       t1.changeby,
+       t1.changedate,
+       t1.fagentnum,
+       t1.fagentname,
+       t1.fagentshortname,
+       t1.fprovince,
+       t1.fcity,
+       t1.fcounty,
+       t1.faddress,
+       t1.fcontact,
+       t1.fphonenumber,
+       t1.fwechatno,
+       t1.femail,
+       t1.fbirthdate,
+       t1.fjoindate,
+       t1.fteamsize,
+       t1.ftype,
+       t1.fbrand
+from tagents t1
+where t1.siteid =$siteid$ and t1.tagentsid=$tagentsid$

+ 72 - 0
src/dsb/com/cnd3b/restcontroller/customer/tagents/tagents.java

@@ -0,0 +1,72 @@
+package com.cnd3b.restcontroller.customer.tagents;
+
+import com.alibaba.fastjson.JSONArray;
+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 com.cnd3b.common.data.db.DataPool;
+import p2.pao.PaoRemote;
+import p2.pao.PaoSetRemote;
+import p2.util.P2Exception;
+
+public class tagents extends Controller {
+    public tagents(JSONObject content) {
+        super(content);
+    }
+
+    /**
+     * 企业档案经销商主界面查询
+     *
+     * @return
+     */
+    public String query_enterpriseAgentsMain() {
+        SQLFactory sql = new SQLFactory(this, "经销商主界面查询");
+        sql.addParameter("siteid", siteid);
+        sql.addParameter("tagentsid", tagentsid);
+        Rows rows = dbConnect.runSqlQuery(sql.getSQL());
+        return getSucReturnObject().setData(rows).toString();
+    }
+
+    /**
+     * 商户信息调整申请
+     *
+     * @return
+     */
+    public String modify_enterpriseAgent() throws D3bException, P2Exception {
+        String ftype = content.getString("ftype");//申请类型
+        /**
+         * 只有个人才可进行商户认证
+         */
+        JSONArray dataArray = content.getJSONArray("data");
+        for (Object o : dataArray) {
+            JSONObject fchangemsgObject = (JSONObject) o;
+            fchangemsgObject.checkStringLength("fagentnum", "tagents.fagentnum", "经销商编号");//经销商编号
+            fchangemsgObject.checkStringLength("fagentname", "tagents.fagentname", "经销商名称");//经销商名称
+            fchangemsgObject.checkStringLength("fagentshortname", "tagents.fagentshortname", "经销商简称");//经销商简称
+            fchangemsgObject.checkStringLength("fcontact", "tagents.fcontact", "联系人");//联系人
+            fchangemsgObject.checkStringLength("faddress", "tagents.faddress", "详细地址");//地址
+            fchangemsgObject.checkStringLength("fphonenumber", "tagents.fphonenumber", "联系方式");//手机号
+            fchangemsgObject.checkStringLength("fwechatno", "tagents.fwechatno", "微信号");//微信号
+            fchangemsgObject.checkStringLength("femail", "tagents.femail", "邮箱");//邮箱
+            fchangemsgObject.checkStringLength("fdutyparagraph", "tagents.fdutyparagraph", "统一社会代码");//统一社会信用代码
+            fchangemsgObject.checkStringLength("fbrand", "tagents.fbrand", "经营品牌");//统一社会信用代码
+
+            dbConnect.runSqlUpdate("update tagents_msgchangeapp set fstatus='作废' where siteid='" + siteid + "' and tagentsid='" + tagentsid + "' and fstatus='申请'");
+
+            PaoSetRemote tagents_msgchangeappSet = getP2ServerSystemPaoSet("tagents_msgchangeapp");
+            PaoRemote tagents_msgchangeapp = tagents_msgchangeappSet.addAtEnd();
+            tagents_msgchangeapp.setValue("fchangemsg", fchangemsgObject.toJSONString(), 11L);
+            tagents_msgchangeapp.setValue("fstatus", "申请", 11L);
+            tagents_msgchangeapp.setValue("ftype", ftype, 11L);
+            tagents_msgchangeapp.setValue("siteid", siteid, 11L);
+            tagents_msgchangeapp.setValue("tagentsid", tagentsid, 11L);
+            tagents_msgchangeapp.setValue("tenterprise_userid", userid, 11L);
+            tagents_msgchangeapp.setValue("changeby", username, 11L);//修改人
+            tagents_msgchangeapp.setValue("changedate", sysdate, 11L);//修改时间
+            tagents_msgchangeappSet.save();
+        }
+        return getSucReturnObject().toString();
+    }
+}

+ 2 - 2
src/dsb/com/cnd3b/restcontroller/customer/usercenter/usermsg/SQL/用户信息查询.sql

@@ -1,3 +1,3 @@
-select t1.fname,t1.frole,t1.fsex,t1.fshortcode,
-t1.fbirthdate,t1.femail,t1.fphonenumber,t1.fwechatno,t1.faccountno from tenterprise_users t1
+select t1.fname,t1.frole,t1.fsex,
+t1.fbirthdate,t1.femail,t1.fphonenumber,t1.fwechatno from tenterprise_users t1
 where t1.siteid=$siteid$ and t1.tagentsid=$tagentsid$ and t1.tenterprise_userid=$userid$

+ 0 - 2
src/dsb/com/cnd3b/restcontroller/enterprise/tagents/SQL/经销商专属业务员选择查询.sql

@@ -1,2 +0,0 @@
-select tenterprise_userid,fname from tenterprise_users
-where fusertype='ÆóÒµ' and siteid=$siteid$ and fphonenumber is not null

+ 2 - 10
src/dsb/com/cnd3b/restcontroller/enterprise/tagents/SQL/经销商主界面查询.sql

@@ -15,18 +15,10 @@ select t1.tagentsid,
        t1.fphonenumber,
        t1.fwechatno,
        t1.femail,
-       t1.fdutyparagraph,
        t1.fbirthdate,
-       t1.fpayment,
        t1.fjoindate,
        t1.fteamsize,
-       t1.fbegdate,
-       t1.fenddate,
-       t1.fcooperationstatus,
-       t1.fsaleruserid,
-       t2.fname as fsaler,
-       t1.fappmodel,
-       t1.ftype
+       t1.ftype,
+       t1.fbrand
 from tagents t1
-         left join tenterprise_users t2 on t1.siteid = t2.siteid and t1.fsaleruserid = t2.tenterprise_userid
 where t1.siteid =$siteid$ and t1.tagentsid=$tagentsid$

+ 0 - 2
src/dsb/com/cnd3b/restcontroller/enterprise/tagents/SQL/经销商列表查询.sql

@@ -24,14 +24,12 @@ select t1.tagentsid,
        t1.fenddate,
        t1.fcooperationstatus,
        t1.fsaleruserid,
-       t2.fname                                                                                         as fsaler,
        t1.fappmodel,
        t1.ftype,
        t4.createdate                                                                                    as factivationtime,
        case when t4.fenddate >= GETDATE() then 'ÓÐЧ' when t4.createdate IS null then '´ý¼¤»î' else 'µ½ÆÚ' end as faccountstatus,
        convert(varchar(10), t6.fdate, 120)                     as ffirstlogintime
 from tagents t1
-         left join tenterprise_users t2 on t1.siteid = t2.siteid and t1.fsaleruserid = t2.tenterprise_userid
          left join (select max(tpayinfoid) tpayinfoid, siteid, tagentsid from tpayinfo group by siteid, tagentsid) t3
                    on t1.siteid = t3.siteid and t1.tagentsid = t3.tagentsid
          left join tpayinfo t4

+ 0 - 4
src/dsb/com/cnd3b/restcontroller/enterprise/tagents/SQL/经销商类型选择.sql

@@ -1,4 +0,0 @@
-select fvalue as ftype
-from ttypedetail
-where ftype = '¾­ÏúÉÌÀàÐÍ'
-  and (siteid is null or (siteid =$siteid$ and fisused=1))

+ 1 - 1
src/dsb/com/cnd3b/restcontroller/enterprise/tagents/SQL/经销商账号列表查询.sql

@@ -1,3 +1,3 @@
 select t1.siteid,t1.tagentsid,t1.tenterprise_userid,t1.fname,
-t1.fphonenumber,t1.fisadministrator,t1.frole,t1.fsex,t1.fbirthdate,t1.femail,t1.fwechatno,t1.faccountno from tenterprise_users t1
+t1.fphonenumber,t1.fisadministrator,t1.frole,t1.fsex,t1.fbirthdate,t1.femail,t1.fwechatno from tenterprise_users t1
 where t1.fusertype='¾­ÏúÉÌ' and t1.siteid=$siteid$ and t1.tagentsid=$tagentsid$

+ 82 - 139
src/dsb/com/cnd3b/restcontroller/enterprise/tagents/tagents.java

@@ -1,15 +1,19 @@
 package com.cnd3b.restcontroller.enterprise.tagents;
 
+import com.alibaba.fastjson.JSONArray;
 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 com.cnd3b.common.data.db.DataPool;
+import org.omg.CORBA.OBJ_ADAPTER;
 import p2.pao.PaoRemote;
 import p2.pao.PaoSetRemote;
 import p2.util.P2Exception;
 
+import java.util.Iterator;
+
 public class tagents extends Controller {
     public tagents(JSONObject content) {
         super(content);
@@ -71,44 +75,6 @@ public class tagents extends Controller {
         return getSucReturnObject().setDataByPaging(rows).setFinalDo(DataPool.defaultdatalife, 1);
     }
 
-    /**
-     * 企业档案经销商选择列表查询
-     *
-     * @return
-     */
-    public String query_AgentsListselect() {
-        /**
-         * 过滤条件设置
-         */
-        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.fagentshortname like'%").append(whereObject.getString("condition")).append("%' ");
-                where.append("or t1.fagentname like'%").append(whereObject.getString("condition")).append("%' ");
-                where.append("or t1.ftype like'%").append(whereObject.getString("condition")).append("%' ");
-                where.append(")");
-            }
-            if (whereObject.containsKey("fsaler") && !"".equals(whereObject.getString("fsaler"))) {
-                where.append(" and(");
-                where.append("t2.fname like'%").append(whereObject.getString("fsaler")).append("%' ");
-                where.append(")");
-            }
-            if (whereObject.containsKey("ftype") && !"".equals(whereObject.getString("ftype"))) {
-                where.append(" and(");
-                where.append("t1.ftype like'%").append(whereObject.getString("ftype")).append("%' ");
-                where.append(")");
-            }
-        }
-        SQLFactory sql = new SQLFactory(this, "经销商选择列表查询", pageSize, pageNumber, "t1.tagentsid");
-        sql.addParameter("siteid", siteid);
-        sql.addParameter_SQL("where", where);
-        Rows rows = dbConnect.runSqlQuery(sql.getSQL());
-        return getSucReturnObject().setDataByPaging(rows).setFinalDo(0, 1);
-    }
-
-
     /**
      * 企业档案经销商主界面查询
      *
@@ -123,88 +89,91 @@ public class tagents extends Controller {
     }
 
     /**
-     * 企业经销商档案新增、修改
+     * 商户信息调整申请
      *
      * @return
      */
-    public String insert_modify_enterpriseAgent() throws D3bException, P2Exception {
-        long tagentsid = content.getLongValue("tagentsid");//经销商ID,新增时默认传0
-        String fagentnum = content.getString("fagentnum", "tagents.fagentnum", "经销商编号");//经销商编号
-        String fagentname = content.getString("fagentname", "tagents.fagentname", "经销商名称");//经销商名称
-        String fagentshortname = content.getString("fagentshortname", "tagents.fagentshortname", "经销商简称");//经销商简称
-        String faddress = content.getString("faddress", "tagents.faddress", "详细地址");//地址
-        String fcontact = content.getString("fcontact", "tagents.fcontact", "联系人");//联系人
-        String fbirthdate = nullToStr(content.getString("fbirthdate"));//生日
-        String fphonenumber = content.getString("fphonenumber", "tagents.fphonenumber", "联系方式");//手机号
-        String fwechatno = content.getString("fwechatno", "tagents.fwechatno", "微信号");//微信号
-        String femail = content.getString("femail", "tagents.femail", "邮箱");//邮箱
-        //String fbegdate = nullToStr(content.getString("fbegdate"));//启用时间
-        String fprovince = content.getString("fprovince");//省
-        String fcity = content.getString("fcity");//市
-        String fcounty = content.getString("fcounty");//县
-        String fdutyparagraph = content.getString("fdutyparagraph", "tagents.fdutyparagraph", "统一社会代码");//统一社会信用代码
-        //String fenddate = nullToStr(content.getString("fenddate"));//到期时间
-        String fjoindate = nullToStr(content.getString("fjoindate"));//加盟日期
-        //String fpayment = content.getString("fpayment");//付费方式
-        long fsaleruserid = content.getLong("fsaleruserid");//专属业务员ID
-        int fteamsize = content.getIntValue("fteamsize");//团队人数
-        String fcooperationstatus = content.getString("fcooperationstatus");//合作状态
-        String ftype = content.getString("ftype");//经销商类型
-
-        PaoSetRemote tagentsSet = getP2ServerSystemPaoSet("tagents", "siteid='" + siteid + "' and tagentsid='" + tagentsid + "'");
-        PaoRemote tagents = null;
-        if (tagentsid <= 0 || tagentsSet.isEmpty()) {
-            tagents = tagentsSet.addAtEnd();
-            tagents.setValue("siteid", siteid, 11L);//企业ID
-            tagents.setValue("createby", username, 11L);//录入人
-            tagents.setValue("createdate", sysdate, 11L);//录入时间
-
-        } else {
-            tagents = tagentsSet.getPao(0);
-        }
-        tagents.setValue("fagentnum", fagentnum, 11L);
-        tagents.setValue("fagentname", fagentname, 11L);
-        tagents.setValue("fagentshortname", fagentshortname, 11L);
-        tagents.setValue("faddress", faddress, 11L);
-        tagents.setValue("fcontact", fcontact, 11L);
-        tagents.setValue("fbirthdate", fbirthdate, 11L);
-        tagents.setValue("fphonenumber", fphonenumber, 11L);
-        tagents.setValue("fwechatno", fwechatno, 11L);
-        tagents.setValue("femail", femail, 11L);
-        //tagents.setValue("fbegdate", fbegdate, 11L);
-        tagents.setValue("fprovince", fprovince, 11L);
-        tagents.setValue("fcity", fcity, 11L);
-        tagents.setValue("fcounty", fcounty, 11L);
-        tagents.setValue("fdutyparagraph", fdutyparagraph, 11L);
-        //tagents.setValue("fenddate", fenddate, 11L);
-        tagents.setValue("fjoindate", fjoindate, 11L);
-        //tagents.setValue("fpayment", fpayment, 11L);
-        tagents.setValue("fsaleruserid", fsaleruserid, 11L);
-        tagents.setValue("fteamsize", fteamsize, 11L);
-        tagents.setValue("fcooperationstatus", fcooperationstatus, 11L);
-        tagents.setValue("ftype", ftype, 11L);
-
-        tagents.setValue("changeby", username, 11L);//修改人
-        tagents.setValue("changedate", sysdate, 11L);//修改时间
-
+    public String modify_enterpriseAgent() throws D3bException, P2Exception {
+        long tagentsid = content.getLong("tagentsid");//经销商id
         /**
-         * 将手机号自动绑定到主账号中
+         * 只有个人才可进行商户认证
          */
-        PaoSetRemote tenterprise_users = tagents.getPaoSet("$tenterprise_users", "tenterprise_users", "siteid='" + siteid + "' and tagentsid=" + tagents.getUniqueIDValue() + " and fisadministrator=1");
-        if (!tenterprise_users.isEmpty()) {
-            PaoRemote tenterprise_user = tenterprise_users.getPao(0);
-            tenterprise_user.setValue("fname", fcontact, 11L);
-            tenterprise_user.setValue("fphonenumber", fphonenumber, 11L);
-            tenterprise_user.setValue("fbirthdate", fbirthdate, 11L);
-            tenterprise_user.setValue("femail", femail, 11L);
-            tenterprise_user.setValue("fwechatno", fwechatno, 11L);
+        JSONArray dataArray = content.getJSONArray("data");
+        for (Object o : dataArray) {
+            JSONObject fchangemsgObject = (JSONObject) o;
+            fchangemsgObject.checkStringLength("fagentnum", "tagents.fagentnum", "经销商编号");//经销商编号
+            fchangemsgObject.checkStringLength("fagentname", "tagents.fagentname", "经销商名称");//经销商名称
+            fchangemsgObject.checkStringLength("fagentshortname", "tagents.fagentshortname", "经销商简称");//经销商简称
+            fchangemsgObject.checkStringLength("fcontact", "tagents.fcontact", "联系人");//联系人
+            fchangemsgObject.checkStringLength("faddress", "tagents.faddress", "详细地址");//地址
+            fchangemsgObject.checkStringLength("fphonenumber", "tagents.fphonenumber", "联系方式");//手机号
+            fchangemsgObject.checkStringLength("fwechatno", "tagents.fwechatno", "微信号");//微信号
+            fchangemsgObject.checkStringLength("femail", "tagents.femail", "邮箱");//邮箱
+            fchangemsgObject.checkStringLength("fdutyparagraph", "tagents.fdutyparagraph", "统一社会代码");//统一社会信用代码
+            fchangemsgObject.checkStringLength("fbrand", "tagents.fbrand", "经营品牌");//统一社会信用代码
+
+            dbConnect.runSqlUpdate("update tagents_msgchangeapp set fstatus='作废' where siteid='" + siteid + "' and tagentsid='" + tagentsid + "' and fstatus='申请'");
+
+            long tagents_msgchangappid = 0;
+            PaoSetRemote tagents_msgchangeappSet = getP2ServerSystemPaoSet("tagents_msgchangeapp");
+            PaoRemote tagents_msgchangeapp = tagents_msgchangeappSet.addAtEnd();
+            tagents_msgchangappid = tagents_msgchangeapp.getUniqueIDValue();
+            tagents_msgchangeapp.setValue("fchangemsg", fchangemsgObject.toJSONString(), 11L);
+            tagents_msgchangeapp.setValue("fstatus", "申请", 11L);
+            tagents_msgchangeapp.setValue("ftype", "普通修改", 11L);
+            tagents_msgchangeapp.setValue("siteid", siteid, 11L);
+            tagents_msgchangeapp.setValue("tagentsid", tagentsid, 11L);
+            tagents_msgchangeapp.setValue("tenterprise_userid", userid, 11L);
+            tagents_msgchangeapp.setValue("changeby", username, 11L);//修改人
+            tagents_msgchangeapp.setValue("changedate", sysdate, 11L);//修改时间
+            tagents_msgchangeappSet.save();
+
+            content.put("tagents_msgchangappid", tagents_msgchangappid);
+            check_enterpriseAgent();
         }
-        /**
-         * 保存修改日志
-         */
-        saveDataLog(tagents);
-        tagentsSet.save();
+        return getSucReturnObject().toString();
+    }
+
+    /**
+     * 经销商信息修改审核
+     *
+     * @return
+     * @throws D3bException
+     * @throws P2Exception
+     */
+    public String check_enterpriseAgent() throws D3bException, P2Exception {
+        long tagents_msgchangappid = content.getLong("tagents_msgchangappid");
+        Rows rows = dbConnect.runSqlQuery("select ftype,fchangemsg,tagentsid from tagents_msgchangeapp where fstatus='申请'and siteid='" + siteid + "' and tagents_msgchangappid='" + tagents_msgchangappid + "'");
+        if (rows.isEmpty()) {
+            return getErrReturnObject().setErrMsg("找不到指定的申请").toString();
+        }
+        String ftype = rows.get(0).getString("ftype");
+        String fchangemsg = rows.get(0).getString("fchangemsg");
+        long tagentsid = rows.get(0).getLong("tagentsid");
 
+        PaoSetRemote tagentsSet = getP2ServerSystemPaoSet("tagents", "siteid='" + siteid + "' and tagentsid='" + tagentsid + "'");
+        if (!tagentsSet.isEmpty()) {
+            PaoRemote tagents = tagentsSet.getPao(0);
+            JSONArray changemsgarray = JSONArray.parseArray(fchangemsg);
+            for (Object o : changemsgarray) {
+                JSONObject changemsgObject = (JSONObject) o;
+                Iterator it = changemsgObject.keySet().iterator();
+                while (it.hasNext()) {
+                    String key = (String) it.next();
+                    String value = changemsgObject.getString(key);
+                    tagents.setValue(key, value, 11L);
+                }
+                if (ftype.equals("商户认证")) {
+                    tagents.setValue("ftype", "普通商户", 11L);
+                }
+            }
+            PaoSetRemote tagents_msgchangeappSet = tagents.getPaoSet("$tagents_msgchangeapp", "tagents_msgchangeapp", "tagents_msgchangappid=" + tagents_msgchangappid);
+            tagents_msgchangeappSet.getPao(0).setValue("fstatus", "审核", 11L);
+            tagents_msgchangeappSet.getPao(0).setValue("checkby", username, 11L);
+            tagents_msgchangeappSet.getPao(0).setValue("checkdate", sysdate, 11L);
+            tagentsSet.save();
+            tagentsSet.close();
+        }
         return getSucReturnObject().toString();
     }
 
@@ -239,31 +208,5 @@ public class tagents extends Controller {
         return getSucReturnObject().setData(rows).saveToDataPool().toString();
     }
 
-    /**
-     * 企业档案经销商专属业务员选择查询
-     *
-     * @return
-     */
-    public String query_saleruserid() {
-        SQLFactory sql = new SQLFactory(this, "经销商专属业务员选择查询");
-        sql.addParameter("siteid", siteid);
-        Rows rows = dbConnect.runSqlQuery(sql.getSQL());
-        return getSucReturnObject().setData(rows).saveToDataPool().toString();
-    }
-
-
 
-    /**
-     * 经销商类型选择
-     *
-     * @return
-     */
-    public String selectAgenttype() {
-        SQLFactory sqlFactory = new SQLFactory(this, "经销商类型选择");
-        sqlFactory.addParameter("siteid", siteid);
-        Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
-        String result = rows.toJsonArray("ftype").toString();
-        DataPool.put(content.toString(), result);
-        return result;
-    }
 }

+ 0 - 1
src/dsb/com/cnd3b/restcontroller/enterprise/tenterprise/SQL/企业账号查询.sql

@@ -16,7 +16,6 @@ select t1.tenterprise_userid,
        t1.fdatamodify,
        t1.tauthgroupid,
        t1.fissysadministrator,
-       t1.faccountno,
        t1.fcanreadagentanalysis,
        t1.faccountbalance,
        convert(varchar(10), t3.fdate, 120)                     as factivationtime,

+ 0 - 1
src/dsb/com/cnd3b/restcontroller/enterprise/tenterprise/SQL/所有账号查询.sql

@@ -12,7 +12,6 @@ select t1.fusertype,
        t1.tenterprise_userid,
        t2.fsaleruserid,
        t3.fname as fsaler,
-       t1.faccountno,
        t1.fcanreadagentanalysis,
        t2.ftype as fagenttype
 from tenterprise_users t1

+ 0 - 1
src/dsb/com/cnd3b/restcontroller/system/users/Users.java

@@ -22,7 +22,6 @@ public class Users extends Controller {
         super(content);
     }
 
-
     public String getChangePhonenumberPassword() {
         String phonenumber = content.getString("newphonenumber");
         String password = createPassWord();

+ 0 - 46
src/p2apps/p2/application/tenterprise_users/tenterprise_users.java

@@ -26,7 +26,6 @@ public class tenterprise_users extends PaoCust {
         } else if (getOwner() instanceof tenterprise) {
             setValue("fusertype", "ÆóÒµ", 11L);
         }
-        setValue("faccountno", createAccount());
     }
 
     @Override
@@ -34,49 +33,4 @@ public class tenterprise_users extends PaoCust {
         super.save();
     }
 
-    public static long maxAccount = 0L;
-    public static ArrayList<Long> accountList = new ArrayList<>();
-
-    private long createAccount() {
-        if (maxAccount == 0) {
-            DBConnect dbConnect = new DBConnect();
-            Row rows = dbConnect.runSqlQuery(0, "select convert(bigint,isnull(max(faccountno),100001)) as faccountno from tenterprise_users");
-
-            maxAccount = rows.getLong("faccountno");
-
-            Rows rows2 = dbConnect.runSqlQuery("select faccountno from tenterprise_users");
-            for (Row row : rows2) {
-                accountList.add(Long.parseLong(row.getString("faccountno")));
-            }
-        }
-        maxAccount = maxAccount + 1;
-        if (accountList.contains(maxAccount)) {
-            return createAccount();
-        } else {
-            accountList.add(maxAccount);
-            return maxAccount;
-        }
-    }
-
-    public static ArrayList<String> ShortCodelist = new ArrayList<>();
-
-    private String createShortCode() {
-        if (ShortCodelist.isEmpty()) {
-            DBConnect dbConnect = new DBConnect();
-            Rows rows = dbConnect.runSqlQuery("select fshortcode from tenterprise_users");
-            ShortCodelist = rows.toArrayList("fshortcode");
-        }
-        String allChar = "1234567890";
-        StringBuffer sb = new StringBuffer();
-        Random random = new Random();
-        for (int i = 0; i < 7; i++) {
-            sb.append(allChar.charAt(random.nextInt(allChar.length())));
-        }
-        if (ShortCodelist.contains(sb.toString())) {
-            return createShortCode();
-        } else {
-            ShortCodelist.add(sb.toString());
-            return sb.toString();
-        }
-    }
 }