瀏覽代碼

完善游客个人信息数据

eganwu 1 年之前
父節點
當前提交
4e28b10104

+ 5 - 0
src/custom/restcontroller/R.java

@@ -6399,6 +6399,11 @@ public class R {
         }
     }
 
+    public static class ID20240514161502 {
+        public static class v1 {
+        }
+    }
+
 }
 
 

+ 1 - 1
src/custom/restcontroller/webmanage/saletool/store/StoreTeam.java

@@ -314,7 +314,7 @@ public class StoreTeam extends Controller {
             updateSQL.setValue("usertype", usertype);
             updateSQL.update();
 
-            ArrayList<Long> deleteroles = dbConnect.runSqlQuery("SELECT visitor_roleid from sys_wechatapp WHERE (systemclient='" + systemclient + "' or systemclient_auth='" + systemclient + "' ) and  siteid='" + siteid + "'  and isvisitor=1").toArrayList("roleid", new ArrayList<>());
+            ArrayList<Long> deleteroles = dbConnect.runSqlQuery("SELECT visitor_roleid from sys_wechatapp WHERE (systemclient='" + systemclient + "' or systemclient_auth='" + systemclient + "' ) and  siteid='" + siteid + "'  and isvisitor=1").toArrayList("visitor_roleid", new ArrayList<>());
 
             if (deleteroles.size() > 0) {
                 DeleteSQL deleteSQL = SQLFactory.createDeleteSQL(this, "sys_userrole");

+ 39 - 0
src/custom/restcontroller/webmanage/users/visitors.java

@@ -1,5 +1,7 @@
 package restcontroller.webmanage.users;
 
+import beans.attachment.Attachment;
+import beans.datatag.DataTag;
 import com.alibaba.fastjson.JSONObject;
 import com.mysql.cj.x.protobuf.MysqlxCrud;
 import common.Controller;
@@ -12,6 +14,7 @@ import restcontroller.R;
 import java.time.LocalDate;
 import java.time.temporal.ChronoUnit;
 import java.util.ArrayList;
+import java.util.HashMap;
 
 import static restcontroller.webmanage.sale.enterprise.enterprise.validatePhoneNumber;
 
@@ -88,6 +91,41 @@ public class visitors extends Controller {
         return getSucReturnObject().setData(row).toString();
     }
 
+    @API(title = "名片信息", apiversion = R.ID20240514161502.v1.class)
+    public String cardInfo() throws YosException {
+        Long userid = content.getLongValue("userid");
+        Row row = getUser(userid);
+        Row enterpriseRow = getEnterpriseHr(userid);
+        Long sys_enterpriseid = 0L;
+        String enterprisename = "";
+        if (!enterpriseRow.isEmpty()) {
+            sys_enterpriseid = enterpriseRow.getLong("sys_enterpriseid");
+            enterprisename = enterpriseRow.getString("enterprisename");
+        }
+        row.put("enterprisename", enterprisename);
+        row.put("headpic", getHeadPic(userid));
+        //查询角色
+        Rows rolenameRows = dbConnect.runSqlQuery("select rolename from sys_userrole t1 " +
+                "inner join sys_role t2 ON t2.roleid=t1.roleid and t2.siteid=t1.siteid " +
+                "WHERE t1.userid=" + userid + " and t1.siteid='" + siteid + "'");
+        row.put("rolenames", StringUtils.join(rolenameRows.toArray("rolename"), ","));
+
+        Rows attinfoRows = Attachment.get(this, "sys_user", userid);
+        row.put("attinfos", attinfoRows);
+
+        //标签
+        ArrayList<String> tagList = DataTag.queryTag(this, "sys_user", userid, false);
+        //系统标签
+        tagList.addAll(DataTag.queryTag(this, "sys_user", userid, true));
+        row.put("tag", tagList);
+
+        Rows rows = dbConnect.runSqlQuery("SELECT count(*) count from sys_datacollect WHERE  siteid='" + siteid + "' and type=2 and ownertable='sys_user' and ownerid='"+userid+"'");
+        row.put("count_like", rows.get(0).getLong("count"));
+
+
+        return getSucReturnObject().setData(row).toString();
+    }
+
     @API(title = "更新游客信息", apiversion = R.ID20240511151602.v1.class)
     public String updatevisitorsInfo() throws YosException {
         String phonenumber = content.getStringValue("phonenumber");
@@ -109,6 +147,7 @@ public class visitors extends Controller {
         updateSQL.setValue("phonenumber", content.getStringValue("phonenumber"));
         updateSQL.setValue("email", content.getStringValue("email"));
         updateSQL.setValue("address", content.getStringValue("address"));
+        updateSQL.setValue("remarks", content.getStringValue("remarks"));
         updateSQL.update();