|
@@ -211,9 +211,9 @@ public class users extends Controller {
|
|
|
return getErrReturnObject().setErrMsg("账号不能为空").toString();
|
|
|
}
|
|
|
|
|
|
- if (dbConnect.runSqlQuery("SELECT * from sys_users WHERE accountno ='" + accountno + "' and userid!=" + changeuserid).isNotEmpty()) {
|
|
|
- return getErrReturnObject().setErrMsg("账号【" + accountno + "】已存在").toString();
|
|
|
- }
|
|
|
+// if (dbConnect.runSqlQuery("SELECT * from sys_users WHERE accountno ='" + accountno + "' and userid!=" + changeuserid).isNotEmpty()) {
|
|
|
+// return getErrReturnObject().setErrMsg("账号【" + accountno + "】已存在").toString();
|
|
|
+// }
|
|
|
|
|
|
SQLFactory sqlFactory = new SQLFactory(this, "账号修改");
|
|
|
sqlFactory.addParameter("userid", changeuserid);
|
|
@@ -221,7 +221,7 @@ public class users extends Controller {
|
|
|
sqlFactory.addParameter("changeby", username);
|
|
|
sqlFactory.addParameter("phonenumber", changephonenumber);
|
|
|
sqlFactory.addParameter("remarks", changeremarks);
|
|
|
- sqlFactory.addParameter("accountno", accountno);
|
|
|
+// sqlFactory.addParameter("accountno", accountno);
|
|
|
sqllist.add(sqlFactory.getSQL());
|
|
|
|
|
|
for (Long roleid : roleidslist) {
|
|
@@ -350,6 +350,26 @@ public class users extends Controller {
|
|
|
@CACHEING_CLEAN(cms = {@cm(clazz = users.class, method = {"query_userList", "query_userMain"})})
|
|
|
public String deleteUserSite() throws YosException {
|
|
|
JSONArray userids = content.getJSONArray("userids");
|
|
|
+
|
|
|
+
|
|
|
+ for (Object obj : userids) {
|
|
|
+ Long userid = Long.valueOf(obj.toString());
|
|
|
+ Rows rows = dbConnect.runSqlQuery("SELECT `status` from sys_enterprise_hr t1 " +
|
|
|
+ "INNER JOIN sa_agents t2 ON t2.sys_enterpriseid=t1.sys_enterpriseid " +
|
|
|
+ "WHERE t1.userid=" + userid);
|
|
|
+ if (rows.isNotEmpty()) {
|
|
|
+ String status = rows.get(0).getString("status");
|
|
|
+ if (status.equals("启用")) {
|
|
|
+ return getErrReturnObject().setErrMsg("检测到经销商已启用,无法删除").toString();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ DeleteSQL deleteSQL=SQLFactory.createDeleteSQL(this,"sys_enterprise_hr");
|
|
|
+ deleteSQL.setSiteid(siteid);
|
|
|
+ deleteSQL.setWhere("userid",userids.toArray());
|
|
|
+ deleteSQL.delete();
|
|
|
+
|
|
|
SQLFactory sqlFactory = new SQLFactory(this, "账号站点删除");
|
|
|
sqlFactory.addParameter_in("userid", userids.toArray());
|
|
|
sqlFactory.addParameter("siteid", siteid);
|