forked from integrated_whb/integrated_whb
八项作业与优化三方定位系统后台地址的查询
parent
ee5192518b
commit
f7ebc6a958
|
@ -39,7 +39,7 @@ public class PLSUtil {
|
|||
headers.set("Authorization", getToken(CORPINFO_ID));
|
||||
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers);
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(
|
||||
PLSUtil.BAKEADDR.get(CORPINFO_ID) + "/deploy/card/list?sortThePowerLevel=1&pageNum=" +
|
||||
getBakeAddr(CORPINFO_ID) + "/deploy/card/list?sortThePowerLevel=1&pageNum=" +
|
||||
currentPage +
|
||||
"&pageSize=" + showCount,
|
||||
HttpMethod.GET, httpEntity,
|
||||
|
@ -52,7 +52,7 @@ public class PLSUtil {
|
|||
headers.set("Authorization", getToken(CORPINFO_ID));
|
||||
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers);
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(
|
||||
PLSUtil.BAKEADDR.get(CORPINFO_ID) + url,
|
||||
getBakeAddr(CORPINFO_ID) + url,
|
||||
HttpMethod.GET, httpEntity,
|
||||
JSONObject.class);
|
||||
return exchange.getBody();
|
||||
|
@ -77,7 +77,7 @@ public class PLSUtil {
|
|||
headers.set("Authorization", getToken(CORPINFO_ID));
|
||||
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers);
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(
|
||||
PLSUtil.BAKEADDR.get(CORPINFO_ID) + "/region/alarm/alarmStatistics?type=day",
|
||||
getBakeAddr(CORPINFO_ID) + "/region/alarm/alarmStatistics?type=day",
|
||||
HttpMethod.GET, httpEntity,
|
||||
JSONObject.class);
|
||||
return exchange.getBody();
|
||||
|
@ -88,7 +88,7 @@ public class PLSUtil {
|
|||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.set("Authorization", getToken(CORPINFO_ID));
|
||||
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(uriVariables, headers);
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(PLSUtil.BAKEADDR.get(CORPINFO_ID) + Url,
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(getBakeAddr(CORPINFO_ID) + Url,
|
||||
HttpMethod.POST,
|
||||
httpEntity,
|
||||
JSONObject.class);
|
||||
|
@ -99,7 +99,7 @@ public class PLSUtil {
|
|||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.set("Authorization", getToken(CORPINFO_ID));
|
||||
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers);
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(PLSUtil.BAKEADDR.get(CORPINFO_ID) + Url + id,
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(getBakeAddr(CORPINFO_ID) + Url + id,
|
||||
HttpMethod.GET,
|
||||
httpEntity,
|
||||
JSONObject.class);
|
||||
|
@ -112,7 +112,7 @@ public class PLSUtil {
|
|||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.set("Authorization", getToken(CORPINFO_ID));
|
||||
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers);
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(PLSUtil.BAKEADDR.get(CORPINFO_ID) + Url + params,
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(getBakeAddr(CORPINFO_ID) + Url + params,
|
||||
HttpMethod.GET,
|
||||
httpEntity,
|
||||
JSONObject.class);
|
||||
|
@ -124,7 +124,7 @@ public class PLSUtil {
|
|||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.set("Authorization", getToken(CORPINFO_ID));
|
||||
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(uriVariables, headers);
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(PLSUtil.BAKEADDR.get(CORPINFO_ID) + Url,
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(getBakeAddr(CORPINFO_ID) + Url,
|
||||
HttpMethod.PUT,
|
||||
httpEntity,
|
||||
JSONObject.class);
|
||||
|
@ -135,7 +135,7 @@ public class PLSUtil {
|
|||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.set("Authorization", getToken(CORPINFO_ID));
|
||||
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers);
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(PLSUtil.BAKEADDR.get(CORPINFO_ID) + Url + id,
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(getBakeAddr(CORPINFO_ID) + Url + id,
|
||||
HttpMethod.DELETE,
|
||||
httpEntity,
|
||||
JSONObject.class);
|
||||
|
@ -158,7 +158,7 @@ public class PLSUtil {
|
|||
if (Tools.notEmpty(keywords)) {
|
||||
url = url + keywords;
|
||||
}
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(PLSUtil.BAKEADDR.get(CORPINFO_ID) + url
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(getBakeAddr(CORPINFO_ID) + url
|
||||
, HttpMethod.GET, httpEntity, JSONObject.class);
|
||||
return exchange.getBody();
|
||||
}
|
||||
|
@ -177,7 +177,7 @@ public class PLSUtil {
|
|||
// "/region/alarm/list?pageNum=" +
|
||||
// currentPage + "&pageSize=" + showCount +"&str=" + "&eleType="+eleType+ "&status="+status
|
||||
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers);
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(PLSUtil.BAKEADDR.get(CORPINFO_ID) +
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(getBakeAddr(CORPINFO_ID) +
|
||||
"/region/alarm/list?eleType=" + eleType + "+&status=" + status + "&pageNum=" + currentPage + "&pageSize=" + showCount + "&str="
|
||||
, HttpMethod.GET, httpEntity, JSONObject.class);
|
||||
return exchange.getBody();
|
||||
|
@ -200,7 +200,7 @@ public class PLSUtil {
|
|||
url = url + keywords;
|
||||
}
|
||||
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers);
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(PLSUtil.BAKEADDR.get(CORPINFO_ID) + url
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(getBakeAddr(CORPINFO_ID) + url
|
||||
, HttpMethod.GET, httpEntity, JSONObject.class);
|
||||
return exchange.getBody();
|
||||
}
|
||||
|
@ -217,7 +217,7 @@ public class PLSUtil {
|
|||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.set("Authorization", getToken(CORPINFO_ID));
|
||||
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers);
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(PLSUtil.BAKEADDR.get(CORPINFO_ID) +
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(getBakeAddr(CORPINFO_ID) +
|
||||
"/device/camera/list?pageNum=1&pageSize=100000&str=", HttpMethod.GET, httpEntity, JSONObject.class);
|
||||
return exchange.getBody();
|
||||
}
|
||||
|
@ -246,11 +246,11 @@ public class PLSUtil {
|
|||
uriVariables.put("alt", "");
|
||||
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(uriVariables, headers);
|
||||
// HttpEntity<JSONObject> httpEntity = new HttpEntity<>(uriVariables,headers);
|
||||
// ResponseEntity<JSONObject> jsonObjectResponseEntity = restTemplate.postForEntity(PLSUtil.BAKEADDR.get(CORPINFO_ID) + "/device/camera",
|
||||
// ResponseEntity<JSONObject> jsonObjectResponseEntity = restTemplate.postForEntity(getBakeAddr(CORPINFO_ID) + "/device/camera",
|
||||
// httpEntity, JSONObject.class);
|
||||
|
||||
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(PLSUtil.BAKEADDR.get(CORPINFO_ID) + "/device/camera",
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(getBakeAddr(CORPINFO_ID) + "/device/camera",
|
||||
HttpMethod.POST,
|
||||
httpEntity,
|
||||
JSONObject.class);
|
||||
|
@ -273,7 +273,7 @@ public class PLSUtil {
|
|||
uriVariables.put("camName", camera.getString("VIDEONAME"));
|
||||
uriVariables.put("camId", camera.getString("PLS_ID"));
|
||||
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(uriVariables, headers);
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(PLSUtil.BAKEADDR.get(CORPINFO_ID) + "/device/camera",
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(getBakeAddr(CORPINFO_ID) + "/device/camera",
|
||||
HttpMethod.PUT, httpEntity,
|
||||
JSONObject.class, uriVariables);
|
||||
return exchange.getBody();
|
||||
|
@ -290,7 +290,7 @@ public class PLSUtil {
|
|||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.set("Authorization", getToken(CORPINFO_ID));
|
||||
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers);
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(PLSUtil.BAKEADDR.get(CORPINFO_ID) + "/device/camera/" + Integer.parseInt(camera.getString("PLS_ID")), HttpMethod.DELETE, httpEntity, JSONObject.class);
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(getBakeAddr(CORPINFO_ID) + "/device/camera/" + Integer.parseInt(camera.getString("PLS_ID")), HttpMethod.DELETE, httpEntity, JSONObject.class);
|
||||
return exchange.getBody();
|
||||
}
|
||||
|
||||
|
@ -311,7 +311,7 @@ public class PLSUtil {
|
|||
if (Tools.notEmpty(keywords)) url += keywords;
|
||||
headers.set("Authorization", getToken(CORPINFO_ID));
|
||||
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers);
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(PLSUtil.BAKEADDR.get(CORPINFO_ID) + url, HttpMethod.GET, httpEntity, JSONObject.class);
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(getBakeAddr(CORPINFO_ID) + url, HttpMethod.GET, httpEntity, JSONObject.class);
|
||||
return exchange.getBody();
|
||||
}
|
||||
|
||||
|
@ -325,7 +325,7 @@ public class PLSUtil {
|
|||
|
||||
headers.set("Authorization", getToken(CORPINFO_ID));
|
||||
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers);
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(PLSUtil.BAKEADDR.get(CORPINFO_ID) + "/region/region/list?pageNum=" +
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(getBakeAddr(CORPINFO_ID) + "/region/region/list?pageNum=" +
|
||||
currentPage +
|
||||
"&pageSize=" + showCount, HttpMethod.GET, httpEntity, JSONObject.class);
|
||||
return exchange.getBody();
|
||||
|
@ -341,7 +341,7 @@ public class PLSUtil {
|
|||
|
||||
headers.set("Authorization", getToken(CORPINFO_ID));
|
||||
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers);
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(PLSUtil.BAKEADDR.get(CORPINFO_ID) + "/region/region/" +
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(getBakeAddr(CORPINFO_ID) + "/region/region/" +
|
||||
id, HttpMethod.GET, httpEntity, JSONObject.class);
|
||||
return exchange.getBody();
|
||||
}
|
||||
|
@ -355,7 +355,7 @@ public class PLSUtil {
|
|||
|
||||
headers.set("Authorization", getToken(CORPINFO_ID));
|
||||
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers);
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(PLSUtil.BAKEADDR.get(CORPINFO_ID) + "/location/loca/personnelTrajectories",HttpMethod.GET, httpEntity, JSONObject.class);
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(getBakeAddr(CORPINFO_ID) + "/location/loca/personnelTrajectories",HttpMethod.GET, httpEntity, JSONObject.class);
|
||||
return exchange.getBody();
|
||||
}
|
||||
|
||||
|
@ -375,7 +375,7 @@ public class PLSUtil {
|
|||
uriVariables.put("type", type);
|
||||
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(uriVariables, headers);
|
||||
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(PLSUtil.BAKEADDR.get(CORPINFO_ID) + "/location/loca/characterTrajectories",
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(getBakeAddr(CORPINFO_ID) + "/location/loca/characterTrajectories",
|
||||
HttpMethod.POST,
|
||||
httpEntity,
|
||||
JSONObject.class);
|
||||
|
@ -393,7 +393,7 @@ public class PLSUtil {
|
|||
|
||||
headers.set("Authorization", getToken(CORPINFO_ID));
|
||||
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers);
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(PLSUtil.BAKEADDR.get(CORPINFO_ID) + "/api/prod-api/coordinate/realTime/data", HttpMethod.GET, httpEntity, JSONObject.class);
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(getBakeAddr(CORPINFO_ID) + "/api/prod-api/coordinate/realTime/data", HttpMethod.GET, httpEntity, JSONObject.class);
|
||||
return exchange.getBody();
|
||||
}
|
||||
|
||||
|
@ -408,21 +408,30 @@ public class PLSUtil {
|
|||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.set("Authorization", getToken(CORPINFO_ID));
|
||||
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers);
|
||||
ResponseEntity<Boolean> exchange = restTemplate.exchange(PLSUtil.BAKEADDR.get(CORPINFO_ID) + "/region/api/electronicFence/determineWhetherThePersonIsInTheElectronicFence2?psn=" +
|
||||
ResponseEntity<Boolean> exchange = restTemplate.exchange(getBakeAddr(CORPINFO_ID) + "/region/api/electronicFence/determineWhetherThePersonIsInTheElectronicFence2?psn=" +
|
||||
PLS_ID +
|
||||
"&id=" + ELECTRONIC_FENCE_ID, HttpMethod.GET, httpEntity, Boolean.class);
|
||||
return exchange.getBody();
|
||||
}
|
||||
|
||||
|
||||
@PostConstruct
|
||||
private void initBakeAddr() throws Exception {
|
||||
List<PageData> dataList = corpplsinfoService.listAll(new PageData());
|
||||
private static void initBakeAddr(){
|
||||
List<PageData> dataList = null;
|
||||
try {
|
||||
dataList = corpplsinfoService.listAll(new PageData());
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
dataList.forEach(item -> {
|
||||
BAKEADDR.put(item.getString("CORPINFO_ID"), item.getString("POST_URL"));
|
||||
});
|
||||
}
|
||||
|
||||
private static String getBakeAddr(String CORPINFO_ID) throws Exception {
|
||||
return BAKEADDR.computeIfAbsent(CORPINFO_ID, key -> {
|
||||
initBakeAddr();
|
||||
return BAKEADDR.get(CORPINFO_ID);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @Description: 获取token
|
||||
* @Author: dearLin
|
||||
|
@ -449,7 +458,7 @@ public class PLSUtil {
|
|||
if (response != null) {
|
||||
PageData valueData = JSONObject.parseObject(response.getString("data"), PageData.class);
|
||||
token = valueData.getString("access_token");
|
||||
String newExpireTime = DateUtil.getAfterHourDate("12");
|
||||
String newExpireTime = DateUtil.getAfterHourDate("24");
|
||||
pd.put("TOKEN", token);
|
||||
pd.put("EXPIRE_TIME", newExpireTime);
|
||||
corpplsinfoService.edit(pd);
|
||||
|
@ -472,7 +481,7 @@ public class PLSUtil {
|
|||
public static boolean hasCardNumber(PageData user) throws Exception {
|
||||
if (Tools.isEmpty(user.getString("CARDNO"))) {return true;}
|
||||
// 根据 定位卡号获取对应的人
|
||||
String url = BAKEADDR.get(Jurisdiction.getCORPINFO_ID()) + "/deploy/card/peopleDisplay/" + user.getString("CARDNO");
|
||||
String url = getBakeAddr(Jurisdiction.getCORPINFO_ID()) + "/deploy/card/peopleDisplay/" + user.getString("CARDNO");
|
||||
PageData response = sendGetHttpRequest(url, null, getToken(Jurisdiction.getCORPINFO_ID()));
|
||||
if (response != null) {
|
||||
if (!"200".equals(response.getString("code"))) {
|
||||
|
@ -493,7 +502,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");
|
||||
String url = getBakeAddr(Jurisdiction.getCORPINFO_ID()) + "/deploy/card/peopleDisplay/" + user.getString("CARDNO");
|
||||
PageData response = sendGetHttpRequest(url, null, getToken(Jurisdiction.getCORPINFO_ID()));
|
||||
if (response != null) {
|
||||
if (!"200".equals(response.getString("code"))) {
|
||||
|
@ -513,7 +522,7 @@ public class PLSUtil {
|
|||
* @Return: void
|
||||
*/
|
||||
public static PageData saveUser(PageData user) throws Exception {
|
||||
String url = BAKEADDR.get(Jurisdiction.getCORPINFO_ID()) + "/deploy/psnmgt/insertPsnIfon";
|
||||
String url = getBakeAddr(Jurisdiction.getCORPINFO_ID()) + "/deploy/psnmgt/insertPsnIfon";
|
||||
JSONObject loginPayload = new JSONObject();
|
||||
loginPayload.put("name", user.getString("NAME"));
|
||||
loginPayload.put("cardNo", user.getString("CARDNO"));
|
||||
|
@ -555,7 +564,7 @@ public class PLSUtil {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
String url = BAKEADDR.get(Jurisdiction.getCORPINFO_ID()) + "/deploy/psnmgt/updPsnInfoById";
|
||||
String url = getBakeAddr(Jurisdiction.getCORPINFO_ID()) + "/deploy/psnmgt/updPsnInfoById";
|
||||
JSONObject loginPayload = new JSONObject();
|
||||
loginPayload.put("name", user.getString("NAME"));
|
||||
loginPayload.put("psnId", user.getString("PLS_ID"));
|
||||
|
@ -582,7 +591,7 @@ public class PLSUtil {
|
|||
}
|
||||
|
||||
public static boolean removeUser(PageData user) throws Exception {
|
||||
String url = BAKEADDR.get(Jurisdiction.getCORPINFO_ID()) + "/deploy/psnmgt";
|
||||
String url = getBakeAddr(Jurisdiction.getCORPINFO_ID()) + "/deploy/psnmgt";
|
||||
PageData removeUser = usersService.findById(user);
|
||||
PageData response = sendDeleteHttpRequest(url, Long.parseLong(removeUser.getString("PLS_ID")), getToken(Jurisdiction.getCORPINFO_ID()));
|
||||
return "200".equals(response.getString("code"));
|
||||
|
|
|
@ -98,6 +98,6 @@
|
|||
) tmp group by tmp.WORK_ID) log on log.WORK_ID = f.${TYPE}_ID
|
||||
where f.ISDELETE = '0' and f.WORK_POSITION is not null
|
||||
and f.CORPINFO_ID = #{CORPINFO_ID}
|
||||
and f.STEP_ID > 0 and log.NEXT_STEP_ID != 99
|
||||
-- and f.STEP_ID > 0 and log.NEXT_STEP_ID != 99
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
Loading…
Reference in New Issue