forked from integrated_whb/integrated_whb
人员定位工具类 企业ID变为传入参数
parent
6065abcbad
commit
f23f7f09d6
|
@ -237,7 +237,7 @@ public class IdentificationPartsController extends BaseController {
|
|||
PageData pageData = this.getPageData();
|
||||
String KEYWORDS = (String) pageData.getOrDefault("KEYWORDS", "");
|
||||
|
||||
JSONObject body = PLSUtil.getRyRegionList(KEYWORDS,Integer.parseInt(pageData.getString("currentPage")),Integer.parseInt(pageData.getString("showCount")));
|
||||
JSONObject body = PLSUtil.getRyRegionList(Jurisdiction.getCORPINFO_ID(),KEYWORDS,Integer.parseInt(pageData.getString("currentPage")),Integer.parseInt(pageData.getString("showCount")));
|
||||
|
||||
if (body != null) {
|
||||
List<JSONObject> list = body.getJSONArray("rows").toJavaList(JSONObject.class);
|
||||
|
|
|
@ -47,12 +47,12 @@ public class PLSUtil {
|
|||
* @Param: [java.lang.String, java.lang.Integer, java.lang.Integer] [keywords, currentPage, showCount]
|
||||
* @Return: com.alibaba.fastjson.JSONObject
|
||||
*/
|
||||
public static JSONObject getRyRegionList(String keywords,Integer currentPage,Integer showCount) throws Exception {
|
||||
public static JSONObject getRyRegionList(String CORPINFO_ID, String keywords,Integer currentPage,Integer showCount) throws Exception {
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
|
||||
headers.set("Authorization", getToken());
|
||||
headers.set("Authorization", getToken(CORPINFO_ID));
|
||||
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers);
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(PLSUtil.BAKEADDR.get(Jurisdiction.getCORPINFO_ID()) + "/region/region/list?pageNum=" +
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(PLSUtil.BAKEADDR.get(CORPINFO_ID) + "/region/region/list?pageNum=" +
|
||||
currentPage +
|
||||
"&pageSize=" + showCount +
|
||||
"&str=" + keywords + "&type=0", HttpMethod.GET, httpEntity, JSONObject.class);
|
||||
|
@ -77,9 +77,9 @@ public class PLSUtil {
|
|||
* @Param: [] []
|
||||
* @Return: java.lang.String
|
||||
*/
|
||||
public static String getToken() throws Exception {
|
||||
public static String getToken(String CORPINFO_ID) throws Exception {
|
||||
PageData pd = new PageData();
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||
pd.put("CORPINFO_ID", CORPINFO_ID);
|
||||
pd = corpplsinfoService.findById(pd);
|
||||
String token = pd.getString("TOKEN");
|
||||
String backAddr = pd.getString("POST_URL");
|
||||
|
@ -119,7 +119,7 @@ public class PLSUtil {
|
|||
public static boolean hasCardNumber(PageData user) throws Exception {
|
||||
// 根据 定位卡号获取对应的人
|
||||
String url = BAKEADDR.get(Jurisdiction.getCORPINFO_ID()) + "/deploy/card/peopleDisplay/" + user.getString("CARDNO");
|
||||
PageData response = sendGetHttpRequest(url, null, getToken());
|
||||
PageData response = sendGetHttpRequest(url, null, getToken(Jurisdiction.getCORPINFO_ID()));
|
||||
if (response != null) {
|
||||
if (!"200".equals(response.getString("code"))) {
|
||||
return false;
|
||||
|
@ -140,7 +140,7 @@ public class PLSUtil {
|
|||
public static PageData getCardNumberPeople(PageData user) throws Exception {
|
||||
// 根据 定位卡号获取对应的人
|
||||
String url = BAKEADDR.get(Jurisdiction.getCORPINFO_ID()) + "/deploy/card/peopleDisplay/" + user.getString("CARDNO");
|
||||
PageData response = sendGetHttpRequest(url, null, getToken());
|
||||
PageData response = sendGetHttpRequest(url, null, getToken(Jurisdiction.getCORPINFO_ID()));
|
||||
if (response != null) {
|
||||
if (!"200".equals(response.getString("code"))) {
|
||||
return null;
|
||||
|
@ -180,7 +180,7 @@ public class PLSUtil {
|
|||
loginPayload.put("deptName", "");
|
||||
loginPayload.put("deptId", "");
|
||||
loginPayload.put("avatar", "");
|
||||
PageData response = sendPostHttpRequest(url, loginPayload.toJSONString(), getToken());
|
||||
PageData response = sendPostHttpRequest(url, loginPayload.toJSONString(), getToken(Jurisdiction.getCORPINFO_ID()));
|
||||
return "200".equals(response.getString("code"));
|
||||
}
|
||||
|
||||
|
@ -214,13 +214,13 @@ public class PLSUtil {
|
|||
loginPayload.put("deptName", "");
|
||||
loginPayload.put("deptId", "");
|
||||
loginPayload.put("avatar", "");
|
||||
PageData response = sendPostHttpRequest(url, loginPayload.toJSONString(), getToken());
|
||||
PageData response = sendPostHttpRequest(url, loginPayload.toJSONString(), getToken(Jurisdiction.getCORPINFO_ID()));
|
||||
return "200".equals(response.getString("code"));
|
||||
}
|
||||
public static boolean removeUser(PageData user) throws Exception {
|
||||
String url = BAKEADDR.get(Jurisdiction.getCORPINFO_ID()) + "/deploy/psnmgt";
|
||||
PageData removeUser = usersService.findById(user);
|
||||
PageData response = sendDeleteHttpRequest(url, Long.parseLong(removeUser.getString("PLS_ID")), getToken());
|
||||
PageData response = sendDeleteHttpRequest(url, Long.parseLong(removeUser.getString("PLS_ID")), getToken(Jurisdiction.getCORPINFO_ID()));
|
||||
return "200".equals(response.getString("code"));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue