|
@@ -6,8 +6,11 @@ import common.Controller;
|
|
import common.YosException;
|
|
import common.YosException;
|
|
import common.annotation.API;
|
|
import common.annotation.API;
|
|
import common.data.*;
|
|
import common.data.*;
|
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
import restcontroller.R;
|
|
import restcontroller.R;
|
|
|
|
|
|
|
|
+import java.time.LocalDate;
|
|
|
|
+import java.time.temporal.ChronoUnit;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
|
|
import static restcontroller.webmanage.sale.enterprise.enterprise.validatePhoneNumber;
|
|
import static restcontroller.webmanage.sale.enterprise.enterprise.validatePhoneNumber;
|
|
@@ -25,7 +28,7 @@ public class visitors extends Controller {
|
|
super(content);
|
|
super(content);
|
|
}
|
|
}
|
|
|
|
|
|
- @API(title = "游客信息统计", apiversion = R.ID20240510104102.v1.class)
|
|
|
|
|
|
+ @API(title = "游客个人信息", apiversion = R.ID20240510104102.v1.class)
|
|
public String visitorsInfo() throws YosException {
|
|
public String visitorsInfo() throws YosException {
|
|
Row row = new Row();
|
|
Row row = new Row();
|
|
//统计我的访问店铺数量
|
|
//统计我的访问店铺数量
|
|
@@ -39,11 +42,36 @@ public class visitors extends Controller {
|
|
//收藏
|
|
//收藏
|
|
rows = dbConnect.runSqlQuery("SELECT count(*) count from sys_datacollect WHERE userid=" + userid + " and siteid='" + siteid + "' and type=1");
|
|
rows = dbConnect.runSqlQuery("SELECT count(*) count from sys_datacollect WHERE userid=" + userid + " and siteid='" + siteid + "' and type=1");
|
|
row.put("count_collect", rows.get(0).getLong("count"));
|
|
row.put("count_collect", rows.get(0).getLong("count"));
|
|
|
|
+ //订单
|
|
rows = dbConnect.runSqlQuery("SELECT count(*) count from sa_custorder WHERE createuserid=" + userid + " and siteid='" + siteid + "' and deleted=0");
|
|
rows = dbConnect.runSqlQuery("SELECT count(*) count from sa_custorder WHERE createuserid=" + userid + " and siteid='" + siteid + "' and deleted=0");
|
|
row.put("count_order", rows.get(0).getLong("count"));
|
|
row.put("count_order", rows.get(0).getLong("count"));
|
|
|
|
+ // 通讯录
|
|
|
|
+ row.put("count_addressbook", 0);
|
|
|
|
+ //考试成绩
|
|
|
|
+ rows = dbConnect.runSqlQuery("SELECT count(*) count from sat_courseware_test WHERE userid=" + userid + " and siteid='" + siteid + "' ");
|
|
|
|
+ row.put("count_coursewaretest", rows.get(0).getLong("count"));
|
|
|
|
+ // 问卷调查
|
|
|
|
+ row.put("count_questions", 0);
|
|
|
|
+ // 意见反馈
|
|
|
|
+ row.put("count_feedback", 0);
|
|
|
|
|
|
row.putAll(getUser(userid));
|
|
row.putAll(getUser(userid));
|
|
row.put("headpic", getHeadPic(userid));
|
|
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"), ","));
|
|
|
|
+ //加入团队时间
|
|
|
|
+ LocalDate startDate = LocalDate.parse(row.getString("createdate").substring(0, 10));
|
|
|
|
+ LocalDate endDate = LocalDate.now();
|
|
|
|
+ long days = ChronoUnit.DAYS.between(startDate, endDate);
|
|
|
|
+ row.put("joindays", days);
|
|
|
|
+ //签到时间
|
|
|
|
+ Rows signRows = dbConnect.runSqlQuery("SELECT count(DISTINCT t1.sat_sharematerialid) count from sat_sharematerial_read t1 " +
|
|
|
|
+ "inner join sat_sharematerial t2 ON t2.sat_sharematerialid=t1.sat_sharematerialid " +
|
|
|
|
+ "WHERE t2.classid=1 and t1.createuserid=" + userid + " and t1.type=0 and t1.siteid='" + siteid + "'");
|
|
|
|
+ row.put("signdays", signRows.get(0).getLong("count"));
|
|
|
|
|
|
return getSucReturnObject().setData(row).toString();
|
|
return getSucReturnObject().setData(row).toString();
|
|
}
|
|
}
|