|
|
@@ -87,6 +87,37 @@ public class usercenter extends Controller {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @API(title = "查询个人信息", apiversion = R.ID2026011009311302.v1.class)
|
|
|
+ public String queryUserInfo() throws YosException {
|
|
|
+
|
|
|
+ SQLFactory sqlFactory = new SQLFactory(this, "查询个人信息");
|
|
|
+ sqlFactory.addParameter("siteid", siteid);
|
|
|
+ sqlFactory.addParameter("userid", userid);
|
|
|
+ Rows userrows = dbConnect.runSqlQuery(sqlFactory.getSQL());
|
|
|
+ for (Row row : userrows) {
|
|
|
+ row.put("attinfos", getAttachmentUrl("sys_users", userid));
|
|
|
+ }
|
|
|
+ Row userrow = userrows.isNotEmpty() ? userrows.get(0) : new Row();
|
|
|
+
|
|
|
+ String sql = " SELECT count(sa_customersid) count from sa_customers t1 " +
|
|
|
+ " INNER JOIN sys_datateam t2 ON t2.ownertable='sa_customers' AND ownerid=t1.sa_customersid AND t2.isleader=1 " +
|
|
|
+ " WHERE t1.siteid='" + siteid + "' AND t2.userid=" + userid + " AND datastatus IN (0,1)";
|
|
|
+ Rows rows = dbConnect.runSqlQuery(sql);
|
|
|
+ userrow.put("customers", rows.isEmpty() ? 0 : rows.get(0).getInteger("count"));
|
|
|
+ sql = sql + " and t1.status ='已开发'";
|
|
|
+ rows = dbConnect.runSqlQuery(sql);
|
|
|
+ userrow.put("dev_customers", rows.isEmpty() ? 0 : rows.get(0).getInteger("count"));
|
|
|
+
|
|
|
+ sql = " SELECT count(DISTINCT t1.sa_agentsid) count from sys_enterprise_tradefield t1 " +
|
|
|
+ " INNER JOIN sys_hr t2 ON t2.hrid=t1.hrid " +
|
|
|
+ " WHERE t2.siteid='" + siteid + "' AND t2.userid='" + userid + "'";
|
|
|
+ rows = dbConnect.runSqlQuery(sql);
|
|
|
+ userrow.put("agents", rows.isEmpty() ? 0 : rows.get(0).getInteger("count"));
|
|
|
+
|
|
|
+ return getSucReturnObject().setData(userrow).toString();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@API(title = "账户密码修改")
|
|
|
public String changePassWord() throws YosException {
|
|
|
String password = content.getString("password");//MD5加密
|
|
|
@@ -142,7 +173,7 @@ public class usercenter extends Controller {
|
|
|
JSONObject object = new JSONObject();
|
|
|
object.put("code", 1);
|
|
|
object.put("msg", "手机验证码为:" + password);
|
|
|
- return getReturnObject().setCode("0015", new String[] {password}).toString(); //手机验证码为:
|
|
|
+ return getReturnObject().setCode("0015", new String[]{password}).toString(); //手机验证码为:
|
|
|
} else {
|
|
|
JSONObject object = new JSONObject();
|
|
|
Sms sms = new Sms();
|
|
|
@@ -215,7 +246,7 @@ public class usercenter extends Controller {
|
|
|
JSONObject object = new JSONObject();
|
|
|
object.put("code", 1);
|
|
|
object.put("msg", "手机验证码为:" + password);
|
|
|
- return getReturnObject().setCode("0015", new String[] {password}).toString(); //手机验证码为:
|
|
|
+ return getReturnObject().setCode("0015", new String[]{password}).toString(); //手机验证码为:
|
|
|
} else {
|
|
|
JSONObject object = new JSONObject();
|
|
|
Sms sms = new Sms();
|