|
@@ -3,10 +3,7 @@ package common.crm;
|
|
|
import beans.parameter.Parameter;
|
|
import beans.parameter.Parameter;
|
|
|
import com.alibaba.fastjson2.JSONArray;
|
|
import com.alibaba.fastjson2.JSONArray;
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
-import common.AccessToken;
|
|
|
|
|
-import common.BaseClass;
|
|
|
|
|
-import common.ReturnObject_Err;
|
|
|
|
|
-import common.YosException;
|
|
|
|
|
|
|
+import common.*;
|
|
|
import common.data.*;
|
|
import common.data.*;
|
|
|
import common.data.db.DBConnect;
|
|
import common.data.db.DBConnect;
|
|
|
import common.password.UserPassword;
|
|
import common.password.UserPassword;
|
|
@@ -53,7 +50,10 @@ public class sso extends Basic {
|
|
|
/**
|
|
/**
|
|
|
* 验证请求正文中是否包含必填的键值
|
|
* 验证请求正文中是否包含必填的键值
|
|
|
*/
|
|
*/
|
|
|
- String[] mustkeys = {"accountno", "password", "systemclient"};
|
|
|
|
|
|
|
+ String[] mustkeys = {
|
|
|
|
|
+ "accountno",
|
|
|
|
|
+ "password",
|
|
|
|
|
+ "systemclient"};
|
|
|
for (String mustkey : mustkeys) {
|
|
for (String mustkey : mustkeys) {
|
|
|
if (!requestcontent.containsKey(mustkey)) {
|
|
if (!requestcontent.containsKey(mustkey)) {
|
|
|
this.createLoginLog(RequestContent, request, false, new JSONArray(), "json缺少KEY" + mustkey);
|
|
this.createLoginLog(RequestContent, request, false, new JSONArray(), "json缺少KEY" + mustkey);
|
|
@@ -175,7 +175,9 @@ public class sso extends Basic {
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
return new ReturnObject_Err().setErrMsg("请求正文格式错误,必须为JSONObject格式,请求内容:" + RequestContent);
|
|
return new ReturnObject_Err().setErrMsg("请求正文格式错误,必须为JSONObject格式,请求内容:" + RequestContent);
|
|
|
}
|
|
}
|
|
|
- String[] mustkeys = {"accesstoken", "accountno"};
|
|
|
|
|
|
|
+ String[] mustkeys = {
|
|
|
|
|
+ "accesstoken",
|
|
|
|
|
+ "accountno"};
|
|
|
for (String mustkey : mustkeys) {
|
|
for (String mustkey : mustkeys) {
|
|
|
if (!requestcontent.containsKey(mustkey)) {
|
|
if (!requestcontent.containsKey(mustkey)) {
|
|
|
return new ReturnObject_Err().setErrMsg("json缺少KEY" + mustkey);
|
|
return new ReturnObject_Err().setErrMsg("json缺少KEY" + mustkey);
|
|
@@ -221,7 +223,10 @@ public class sso extends Basic {
|
|
|
/**
|
|
/**
|
|
|
* 验证请求正文中是否包含必填的键值
|
|
* 验证请求正文中是否包含必填的键值
|
|
|
*/
|
|
*/
|
|
|
- String[] mustkeys = {"accountno", "password", "systemclient"};
|
|
|
|
|
|
|
+ String[] mustkeys = {
|
|
|
|
|
+ "accountno",
|
|
|
|
|
+ "password",
|
|
|
|
|
+ "systemclient"};
|
|
|
for (String mustkey : mustkeys) {
|
|
for (String mustkey : mustkeys) {
|
|
|
if (!requestcontent.containsKey(mustkey)) {
|
|
if (!requestcontent.containsKey(mustkey)) {
|
|
|
this.createLoginLog(RequestContent, request, false, new JSONArray(), "json缺少KEY" + mustkey);
|
|
this.createLoginLog(RequestContent, request, false, new JSONArray(), "json缺少KEY" + mustkey);
|
|
@@ -320,12 +325,13 @@ public class sso extends Basic {
|
|
|
roleidMapping.put("serviceStaff", 5211L);//客服人员
|
|
roleidMapping.put("serviceStaff", 5211L);//客服人员
|
|
|
roleidMapping.put("installer", 5206L);//安装师傅
|
|
roleidMapping.put("installer", 5206L);//安装师傅
|
|
|
|
|
|
|
|
-// roleidMapping.put("shopManager", 1L);//店长
|
|
|
|
|
-// roleidMapping.put("shopGuide", 1L);//导购
|
|
|
|
|
-// roleidMapping.put("salesman", 1L);//业务员
|
|
|
|
|
-// roleidMapping.put("designer", 1L);//设计师
|
|
|
|
|
-// roleidMapping.put("financialStaff", 1L);//财务人员
|
|
|
|
|
-// roleidMapping.put("warehouseKeeper", 1L);//仓管
|
|
|
|
|
|
|
+ roleidMapping.put("shopManager", 5513L);//店长
|
|
|
|
|
+ roleidMapping.put("shopGuide", 5513L);//导购
|
|
|
|
|
+ roleidMapping.put("salesman", 5513L);//业务员
|
|
|
|
|
+ roleidMapping.put("designer", 5513L);//设计师
|
|
|
|
|
+ roleidMapping.put("financialStaff", 5513L);//财务人员
|
|
|
|
|
+ roleidMapping.put("warehouseKeeper", 5513L);//仓管
|
|
|
|
|
+
|
|
|
// roleidMapping.put("marketoffice", 1L);//营销办公室(总公司)
|
|
// roleidMapping.put("marketoffice", 1L);//营销办公室(总公司)
|
|
|
// roleidMapping.put("agentRoleOnline", 1L);//电商站点(总公司)
|
|
// roleidMapping.put("agentRoleOnline", 1L);//电商站点(总公司)
|
|
|
// roleidMapping.put("headAfterSales", 1L);//售后服务部(总公司)
|
|
// roleidMapping.put("headAfterSales", 1L);//售后服务部(总公司)
|
|
@@ -381,6 +387,8 @@ public class sso extends Basic {
|
|
|
sqlDump.add(insertSQL);
|
|
sqlDump.add(insertSQL);
|
|
|
sqlDump.commit(dbConnect);
|
|
sqlDump.commit(dbConnect);
|
|
|
return true;
|
|
return true;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ YosLogger.logger.error("crm账号" + accountno + "的角色" + crm_roles.toJsonArray("description") + "不支持单点登录E-订单");
|
|
|
}
|
|
}
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
@@ -403,6 +411,13 @@ public class sso extends Basic {
|
|
|
roleidMapping.put("serviceStaff", 5211L);//客服人员
|
|
roleidMapping.put("serviceStaff", 5211L);//客服人员
|
|
|
roleidMapping.put("installer", 5206L);//安装师傅
|
|
roleidMapping.put("installer", 5206L);//安装师傅
|
|
|
|
|
|
|
|
|
|
+ roleidMapping.put("shopManager", 5513L);//店长
|
|
|
|
|
+ roleidMapping.put("shopGuide", 5513L);//导购
|
|
|
|
|
+ roleidMapping.put("salesman", 5513L);//业务员
|
|
|
|
|
+ roleidMapping.put("designer", 5513L);//设计师
|
|
|
|
|
+ roleidMapping.put("financialStaff", 5513L);//财务人员
|
|
|
|
|
+ roleidMapping.put("warehouseKeeper", 5513L);//仓管
|
|
|
|
|
+
|
|
|
boolean isboss = false;
|
|
boolean isboss = false;
|
|
|
Rows crm_roles = new DBConnect("CRM").runSqlQuery("select t1.uid,t1.hrid,t2.role_id,t3.role,t3.description,t3.sys from sys_user_info t1\n" + "inner join sys_user_role t2 on t1.uid=t2.uid\n" + "inner join sys_role t3 on t2.role_id=t3.id\n" + "where hrid='" + accountno + "'");
|
|
Rows crm_roles = new DBConnect("CRM").runSqlQuery("select t1.uid,t1.hrid,t2.role_id,t3.role,t3.description,t3.sys from sys_user_info t1\n" + "inner join sys_user_role t2 on t1.uid=t2.uid\n" + "inner join sys_role t3 on t2.role_id=t3.id\n" + "where hrid='" + accountno + "'");
|
|
|
ArrayList<Long> roleids = new ArrayList<>();//crm授权的角色
|
|
ArrayList<Long> roleids = new ArrayList<>();//crm授权的角色
|