|
@@ -141,8 +141,7 @@ public class users extends Controller {
|
|
|
String changename = content.getString("name", "sys_users");
|
|
|
String changephonenumber = content.getString("phonenumber", "sys_users");
|
|
|
String changeremarks = content.getString("remarks", "sys_users");
|
|
|
- String accountprefix = Parameter.get(siteid, "accountprefix");
|
|
|
- String accountno = accountprefix + content.getStringValue("accountno");
|
|
|
+ String accountno = content.getStringValue("accountno");
|
|
|
JSONArray roleids = content.getJSONArray("roleids");
|
|
|
|
|
|
boolean isValidPhoneNumber = validatePhoneNumber(changephonenumber);
|
|
@@ -196,6 +195,8 @@ public class users extends Controller {
|
|
|
if (accountno.isEmpty()) {
|
|
|
createUserFactory = new CreateUserFactory(this, changename, changephonenumber, usertype, roleidslist.toArray(new Long[]{}), changeremarks);
|
|
|
} else {
|
|
|
+ String accountprefix = Parameter.get(siteid, "accountprefix");
|
|
|
+ accountno = accountprefix + accountno;
|
|
|
if (dbConnect.runSqlQuery("SELECT 1 from sys_users WHERE accountno ='" + accountno + "' ").isNotEmpty()) {
|
|
|
return getErrReturnObject().setErrMsg("当前账号【" + accountno + "】已存在").toString();
|
|
|
}
|
|
@@ -203,7 +204,7 @@ public class users extends Controller {
|
|
|
}
|
|
|
|
|
|
sqllist.addAll(createUserFactory.getSQL());
|
|
|
- changeuserid=createUserFactory.getUserid();
|
|
|
+ changeuserid = createUserFactory.getUserid();
|
|
|
content.put("userid", changeuserid);
|
|
|
} else {
|
|
|
if (accountno.isEmpty()) {
|
|
@@ -238,7 +239,7 @@ public class users extends Controller {
|
|
|
String[] oldroleids = dbConnect.runSqlQuery("select roleid from sys_userrole where siteid='" + siteid + "' and userid='" + changeuserid + "' order by roleid").toArray("roleid");
|
|
|
|
|
|
if (usertype == 21 || usertype == 22) {
|
|
|
- Rows rows = dbConnect.runSqlQuery("select * from sys_enterprise_hr where siteid='" + siteid + "' and sys_enterpriseid=" + sys_enterpriseid + " and userid=" + changeuserid );
|
|
|
+ Rows rows = dbConnect.runSqlQuery("select * from sys_enterprise_hr where siteid='" + siteid + "' and sys_enterpriseid=" + sys_enterpriseid + " and userid=" + changeuserid);
|
|
|
if (rows.isEmpty()) {
|
|
|
InsertSQL insertSQL = SQLFactory.createInsertSQL(this, "sys_enterprise_hr");
|
|
|
insertSQL.setValue("siteid", siteid);
|