|
|
@@ -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();
|
|
|
|
|
|
|