Merge remote-tracking branch 'origin/dev' into dev

pull/5/head
chenxinying 2024-03-01 16:56:10 +08:00
commit 8482fa7e79
14 changed files with 100 additions and 44 deletions

View File

@ -2262,6 +2262,9 @@ public class AppHiddenController extends BaseController {
&& pd.get("isIndex").toString().equals("1")) { && pd.get("isIndex").toString().equals("1")) {
pd.put("SELF_USER_ID", pd.get("SELFUSERID")); pd.put("SELF_USER_ID", pd.get("SELFUSERID"));
} }
if ("undefined".equals(pd.getString("isIndex"))) {
pd.put("isIndex", "");
}
pd.put("ISMAIN", "0"); pd.put("ISMAIN", "0");
String DISPOSESTATE = pd.getString("DISPOSESTATE"); // 关键词检索条件 String DISPOSESTATE = pd.getString("DISPOSESTATE"); // 关键词检索条件
if (Tools.notEmpty(DISPOSESTATE)) { if (Tools.notEmpty(DISPOSESTATE)) {

View File

@ -726,7 +726,6 @@ public class CustomHiddenController extends BaseController {
if (IS_SELF != null && IS_SELF.equals("1")) if (IS_SELF != null && IS_SELF.equals("1"))
pd.put("SELF_USER_ID", Jurisdiction.getUSER_ID()); pd.put("SELF_USER_ID", Jurisdiction.getUSER_ID());
} }
;
// 旬 // 旬
if (pd.get("IS_XUN") != null && Tools.notEmpty(pd.get("IS_XUN").toString())) { if (pd.get("IS_XUN") != null && Tools.notEmpty(pd.get("IS_XUN").toString())) {
// 1-10 // 1-10

View File

@ -73,6 +73,7 @@ public class MapController extends BaseController {
public ReturnMap getAlarmTypeCount() throws Exception { public ReturnMap getAlarmTypeCount() throws Exception {
return ReturnMap.ok().put("data", PLSUtil.getAlarmTypeCount(Jurisdiction.getCORPINFO_ID())); return ReturnMap.ok().put("data", PLSUtil.getAlarmTypeCount(Jurisdiction.getCORPINFO_ID()));
} }
/** /**
* @Description: * @Description:
* @Author: dearLin * @Author: dearLin
@ -96,6 +97,7 @@ public class MapController extends BaseController {
} }
return returnMap; return returnMap;
} }
/** /**
* @Description: * @Description:
* @Author: dearLin * @Author: dearLin
@ -129,7 +131,7 @@ public class MapController extends BaseController {
@RequestMapping(value = "/getFenceList") @RequestMapping(value = "/getFenceList")
@ResponseBody @ResponseBody
public ReturnMap getFenceList() throws Exception { public ReturnMap getFenceList() throws Exception {
return ReturnMap.ok().put("data", PLSUtil.getAreaRegionList(Jurisdiction.getCORPINFO_ID(),1,999999)); return ReturnMap.ok().put("data", PLSUtil.getAreaRegionList(Jurisdiction.getCORPINFO_ID(), 1, 999999));
} }
/** /**
@ -143,6 +145,19 @@ public class MapController extends BaseController {
return eightWorkService.getEightWorks(); return eightWorkService.getEightWorks();
} }
/**
* @Description:
* @Param: [] []
* @Return: com.zcloud.util.ReturnMap
*/
@RequestMapping(value = "/getEightWorksByType")
@ResponseBody
public ReturnMap getEightWorksByType() throws Exception {
PageData pageData = this.getPageData();
pageData.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
return ReturnMap.ok().put("varList", eightWorkService.getEightWorksByType(pageData));
}
/** /**
* @Description: * @Description:
* @Param: [] [] * @Param: [] []
@ -187,6 +202,7 @@ public class MapController extends BaseController {
PageData cameraCount = videomanagerService.getCameraTopToShow(pageData); PageData cameraCount = videomanagerService.getCameraTopToShow(pageData);
return ReturnMap.ok().put("pd", cameraCount); return ReturnMap.ok().put("pd", cameraCount);
} }
/** /**
* @Description: * @Description:
* @Author: dearLin * @Author: dearLin
@ -202,6 +218,7 @@ public class MapController extends BaseController {
List<PageData> cameraCount = videomanagerService.getCameraAlarmCount(pageData); List<PageData> cameraCount = videomanagerService.getCameraAlarmCount(pageData);
return ReturnMap.ok().put("CameraAlarmCount", cameraCount); return ReturnMap.ok().put("CameraAlarmCount", cameraCount);
} }
/** /**
* @Description: * @Description:
* @Author: dearLin * @Author: dearLin
@ -260,8 +277,8 @@ public class MapController extends BaseController {
@ResponseBody @ResponseBody
public ReturnMap getCharacterTrajectories() throws Exception { public ReturnMap getCharacterTrajectories() throws Exception {
PageData pageData = getPageData(); PageData pageData = getPageData();
return ReturnMap.ok().put("data", PLSUtil.characterTrajectories(Jurisdiction.getCORPINFO_ID(),Integer.parseInt(pageData.getString("id")), return ReturnMap.ok().put("data", PLSUtil.characterTrajectories(Jurisdiction.getCORPINFO_ID(), Integer.parseInt(pageData.getString("id")),
pageData.getString("startTime"),pageData.getString("endTime"),Integer.parseInt(pageData.getString("type")))); pageData.getString("startTime"), pageData.getString("endTime"), Integer.parseInt(pageData.getString("type"))));
} }
/** /**
@ -288,7 +305,7 @@ public class MapController extends BaseController {
int year = calendar.get(Calendar.YEAR); int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH) + 1; int month = calendar.get(Calendar.MONTH) + 1;
String monthString = String.format(year+"-%02d", month); String monthString = String.format(year + "-%02d", month);
String firstDayOfMonth = String.format("%04d-%02d-01 00:00:00", year, month); String firstDayOfMonth = String.format("%04d-%02d-01 00:00:00", year, month);
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH)); calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
calendar.set(Calendar.HOUR_OF_DAY, 23); calendar.set(Calendar.HOUR_OF_DAY, 23);
@ -323,6 +340,7 @@ public class MapController extends BaseController {
public Object getCameraList() throws Exception { public Object getCameraList() throws Exception {
return ReturnMap.ok().put("varList", videomanagerService.getCameraList(getPageData())); return ReturnMap.ok().put("varList", videomanagerService.getCameraList(getPageData()));
} }
public static void main(String[] args) { public static void main(String[] args) {
List<Map<String, String>> timeArray = generateTimeArray(); List<Map<String, String>> timeArray = generateTimeArray();
for (Map<String, String> monthInfo : timeArray) { for (Map<String, String> monthInfo : timeArray) {

View File

@ -42,7 +42,7 @@ public class UserCardController extends BaseController {
ReturnMap returnMap = new ReturnMap(); ReturnMap returnMap = new ReturnMap();
page.setPd(pageData); page.setPd(pageData);
JSONObject body = PLSUtil.getUserCardDataList( JSONObject body = PLSUtil.getUserCardDataList(
Jurisdiction.getCORPINFO_ID(), Integer.parseInt(pageData.getString("currentPage")), Integer.parseInt(pageData.getString("showCount")), pageData.getString("str")); Jurisdiction.getCORPINFO_ID(), Integer.parseInt(pageData.getString("currentPage")), Integer.parseInt(pageData.getString("showCount")), pageData.getString("KEYWORDS"));
if (body != null) { if (body != null) {
List<JSONObject> list = body.getJSONArray("rows").toJavaList(JSONObject.class); List<JSONObject> list = body.getJSONArray("rows").toJavaList(JSONObject.class);
returnMap.put("varList", list); returnMap.put("varList", list);

View File

@ -100,6 +100,10 @@ public class IdentificationPartsController extends BaseController {
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
pd.put("ISDELETE", "0"); //是否删除 1-是 0-否 pd.put("ISDELETE", "0"); //是否删除 1-是 0-否
pd.put("ISMATCHING", "0"); pd.put("ISMATCHING", "0");
if (Tools.isEmpty(pd.getString("ELECTRONIC_FENCE_ID"))) {
pd.put("ELECTRONIC_FENCE_NAME", null);
pd.put("ELECTRONIC_FENCE_ID", null);
}
identificationpartsService.save(pd); identificationpartsService.save(pd);
if (files != null && files.length > 0) { if (files != null && files.length > 0) {
@ -237,7 +241,7 @@ public class IdentificationPartsController extends BaseController {
PageData pageData = this.getPageData(); PageData pageData = this.getPageData();
String KEYWORDS = (String) pageData.getOrDefault("KEYWORDS", ""); String KEYWORDS = (String) pageData.getOrDefault("KEYWORDS", "");
JSONObject body = PLSUtil.getRyRegionList(Jurisdiction.getCORPINFO_ID(),KEYWORDS,Integer.parseInt(pageData.getString("currentPage")),Integer.parseInt(pageData.getString("showCount")),0); JSONObject body = PLSUtil.getRyRegionList(Jurisdiction.getCORPINFO_ID(), KEYWORDS, Integer.parseInt(pageData.getString("currentPage")), Integer.parseInt(pageData.getString("showCount")), 0);
if (body != null) { if (body != null) {
List<JSONObject> list = body.getJSONArray("rows").toJavaList(JSONObject.class); List<JSONObject> list = body.getJSONArray("rows").toJavaList(JSONObject.class);

View File

@ -149,7 +149,7 @@ public class LoginController extends BaseController {
PageData dpd = new PageData(); PageData dpd = new PageData();
dpd.put("DEPARTMENT_ID", pd.getString("DEPARTMENT_ID")); dpd.put("DEPARTMENT_ID", pd.getString("DEPARTMENT_ID"));
dpd = departmentService.findById(dpd); dpd = departmentService.findById(dpd);
if (dpd.getString("FOREIGNPERSONNEL").equals("1")) { if ("1".equals(dpd.getString("FOREIGNPERSONNEL"))) {
return ReturnMap.error("账号密码不正确"); return ReturnMap.error("账号密码不正确");
} }
map.put("DEPARTMENT_NAME", dpd.getString("NAME")); map.put("DEPARTMENT_NAME", dpd.getString("NAME"));

View File

@ -445,6 +445,7 @@ public class UsersController extends BaseController {
String msg = usersService.changeOrUpdUserCardNo(pd); String msg = usersService.changeOrUpdUserCardNo(pd);
if (msg.equals(Const.CAN_CHENG_USER)) { if (msg.equals(Const.CAN_CHENG_USER)) {
if (PLSUtil.editUser(pd)) { if (PLSUtil.editUser(pd)) {
if (Tools.isEmpty(pd.getString("CARDNO"))) {pd.put("CARDNO", null);}
usersService.editUser(pd); //执行修改 usersService.editUser(pd); //执行修改
if ("true".equals(pd.getString("ISSTUDENT"))) { if ("true".equals(pd.getString("ISSTUDENT"))) {
if ("select".equals(pd.getString("letDutiesType"))) { if ("select".equals(pd.getString("letDutiesType"))) {

View File

@ -16,5 +16,7 @@ public interface EightWorkMapper {
List<PageData> getEightWorks(PageData corp); List<PageData> getEightWorks(PageData corp);
List<PageData> listAllForDiagnosis(PageData pd); List<PageData> listAllForDiagnosis(PageData pd);
List<PageData> getEightWorksByType(PageData pageData);
} }

View File

@ -112,7 +112,6 @@ public class CorpInfoServiceImpl implements CorpInfoService {
public PageData eightWorkBI(PageData pd) throws Exception{ public PageData eightWorkBI(PageData pd) throws Exception{
return corpinfoMapper.eightWorkBI(pd); return corpinfoMapper.eightWorkBI(pd);
} }
@Override @Override
public void updateEnterpriseId(PageData corpPage) { public void updateEnterpriseId(PageData corpPage) {
corpinfoMapper.updateEnterpriseId(corpPage); corpinfoMapper.updateEnterpriseId(corpPage);

View File

@ -19,4 +19,6 @@ public interface EightWorkService {
List<PageData> list(PageData pd)throws Exception; List<PageData> list(PageData pd)throws Exception;
List<PageData> listAllForDiagnosis(PageData pd)throws Exception; List<PageData> listAllForDiagnosis(PageData pd)throws Exception;
List<PageData> getEightWorksByType(PageData pageData);
} }

View File

@ -111,4 +111,10 @@ public class EightWorkServiceImpl implements EightWorkService {
return eightworkMapper.listAllForDiagnosis(pd); return eightworkMapper.listAllForDiagnosis(pd);
} }
@Override
public List<PageData> getEightWorksByType(PageData pageData) {
return eightworkMapper.getEightWorksByType(pageData);
}
} }

View File

@ -409,7 +409,7 @@ public class SafetyEnvironmentalServiceImpl implements SafetyEnvironmentalServic
hidden.put("HIDDENTYPE2", lists.get(1)); //隐患类型2 hidden.put("HIDDENTYPE2", lists.get(1)); //隐患类型2
hidden.put("HIDDENTYPE3", lists.get(2)); //隐患类型3 hidden.put("HIDDENTYPE3", lists.get(2)); //隐患类型3
} }
hidden.put("HIDDENTYPE_NAME", json.getString("HIDDENTYPE_NAME"));//隐患类型名称 hidden.put("HIDDENTYPE_NAME", StringUtils.isNotBlank(json.getString("HIDDENTYPENAME")) ? json.getString("HIDDENTYPENAME") : json.getString("HIDDENTYPE_NAME"));//隐患类型名称
hidden.put("LONGITUDE", json.getString("LONGITUDE")); //隐患位置经度 hidden.put("LONGITUDE", json.getString("LONGITUDE")); //隐患位置经度
hidden.put("LATITUDE", json.getString("LATITUDE")); //隐患位置纬度 hidden.put("LATITUDE", json.getString("LATITUDE")); //隐患位置纬度
hidden.put("DISCOVERYTIME", json.getString("DISCOVERYTIME")); //隐患发现时间 hidden.put("DISCOVERYTIME", json.getString("DISCOVERYTIME")); //隐患发现时间

View File

@ -39,7 +39,7 @@ public class PLSUtil {
headers.set("Authorization", getToken(CORPINFO_ID)); headers.set("Authorization", getToken(CORPINFO_ID));
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers); HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers);
ResponseEntity<JSONObject> exchange = restTemplate.exchange( 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 + currentPage +
"&pageSize=" + showCount, "&pageSize=" + showCount,
HttpMethod.GET, httpEntity, HttpMethod.GET, httpEntity,
@ -52,7 +52,7 @@ public class PLSUtil {
headers.set("Authorization", getToken(CORPINFO_ID)); headers.set("Authorization", getToken(CORPINFO_ID));
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers); HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers);
ResponseEntity<JSONObject> exchange = restTemplate.exchange( ResponseEntity<JSONObject> exchange = restTemplate.exchange(
PLSUtil.BAKEADDR.get(CORPINFO_ID) + url, getBakeAddr(CORPINFO_ID) + url,
HttpMethod.GET, httpEntity, HttpMethod.GET, httpEntity,
JSONObject.class); JSONObject.class);
return exchange.getBody(); return exchange.getBody();
@ -77,7 +77,7 @@ public class PLSUtil {
headers.set("Authorization", getToken(CORPINFO_ID)); headers.set("Authorization", getToken(CORPINFO_ID));
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers); HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers);
ResponseEntity<JSONObject> exchange = restTemplate.exchange( 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, HttpMethod.GET, httpEntity,
JSONObject.class); JSONObject.class);
return exchange.getBody(); return exchange.getBody();
@ -88,7 +88,7 @@ public class PLSUtil {
HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
headers.set("Authorization", getToken(CORPINFO_ID)); headers.set("Authorization", getToken(CORPINFO_ID));
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(uriVariables, headers); 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, HttpMethod.POST,
httpEntity, httpEntity,
JSONObject.class); JSONObject.class);
@ -99,7 +99,7 @@ public class PLSUtil {
HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
headers.set("Authorization", getToken(CORPINFO_ID)); headers.set("Authorization", getToken(CORPINFO_ID));
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers); 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, HttpMethod.GET,
httpEntity, httpEntity,
JSONObject.class); JSONObject.class);
@ -112,7 +112,7 @@ public class PLSUtil {
HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
headers.set("Authorization", getToken(CORPINFO_ID)); headers.set("Authorization", getToken(CORPINFO_ID));
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers); 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, HttpMethod.GET,
httpEntity, httpEntity,
JSONObject.class); JSONObject.class);
@ -124,7 +124,7 @@ public class PLSUtil {
HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
headers.set("Authorization", getToken(CORPINFO_ID)); headers.set("Authorization", getToken(CORPINFO_ID));
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(uriVariables, headers); 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, HttpMethod.PUT,
httpEntity, httpEntity,
JSONObject.class); JSONObject.class);
@ -135,7 +135,7 @@ public class PLSUtil {
HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
headers.set("Authorization", getToken(CORPINFO_ID)); headers.set("Authorization", getToken(CORPINFO_ID));
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers); 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, HttpMethod.DELETE,
httpEntity, httpEntity,
JSONObject.class); JSONObject.class);
@ -158,7 +158,7 @@ public class PLSUtil {
if (Tools.notEmpty(keywords)) { if (Tools.notEmpty(keywords)) {
url = url + 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); , HttpMethod.GET, httpEntity, JSONObject.class);
return exchange.getBody(); return exchange.getBody();
} }
@ -177,7 +177,7 @@ public class PLSUtil {
// "/region/alarm/list?pageNum=" + // "/region/alarm/list?pageNum=" +
// currentPage + "&pageSize=" + showCount +"&str=" + "&eleType="+eleType+ "&status="+status // currentPage + "&pageSize=" + showCount +"&str=" + "&eleType="+eleType+ "&status="+status
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers); 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=" "/region/alarm/list?eleType=" + eleType + "+&status=" + status + "&pageNum=" + currentPage + "&pageSize=" + showCount + "&str="
, HttpMethod.GET, httpEntity, JSONObject.class); , HttpMethod.GET, httpEntity, JSONObject.class);
return exchange.getBody(); return exchange.getBody();
@ -200,7 +200,7 @@ public class PLSUtil {
url = url + keywords; url = url + keywords;
} }
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers); 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); , HttpMethod.GET, httpEntity, JSONObject.class);
return exchange.getBody(); return exchange.getBody();
} }
@ -217,7 +217,7 @@ public class PLSUtil {
HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
headers.set("Authorization", getToken(CORPINFO_ID)); headers.set("Authorization", getToken(CORPINFO_ID));
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers); 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); "/device/camera/list?pageNum=1&pageSize=100000&str=", HttpMethod.GET, httpEntity, JSONObject.class);
return exchange.getBody(); return exchange.getBody();
} }
@ -246,11 +246,11 @@ public class PLSUtil {
uriVariables.put("alt", ""); uriVariables.put("alt", "");
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(uriVariables, headers); HttpEntity<JSONObject> httpEntity = new HttpEntity<>(uriVariables, headers);
// 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); // 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, HttpMethod.POST,
httpEntity, httpEntity,
JSONObject.class); JSONObject.class);
@ -273,7 +273,7 @@ public class PLSUtil {
uriVariables.put("camName", camera.getString("VIDEONAME")); uriVariables.put("camName", camera.getString("VIDEONAME"));
uriVariables.put("camId", camera.getString("PLS_ID")); uriVariables.put("camId", camera.getString("PLS_ID"));
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(uriVariables, headers); 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, HttpMethod.PUT, httpEntity,
JSONObject.class, uriVariables); JSONObject.class, uriVariables);
return exchange.getBody(); return exchange.getBody();
@ -290,7 +290,7 @@ public class PLSUtil {
HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
headers.set("Authorization", getToken(CORPINFO_ID)); headers.set("Authorization", getToken(CORPINFO_ID));
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers); 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(); return exchange.getBody();
} }
@ -311,7 +311,7 @@ public class PLSUtil {
if (Tools.notEmpty(keywords)) url += keywords; if (Tools.notEmpty(keywords)) url += keywords;
headers.set("Authorization", getToken(CORPINFO_ID)); headers.set("Authorization", getToken(CORPINFO_ID));
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers); 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(); return exchange.getBody();
} }
@ -325,7 +325,7 @@ public class PLSUtil {
headers.set("Authorization", getToken(CORPINFO_ID)); headers.set("Authorization", getToken(CORPINFO_ID));
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers); 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 + currentPage +
"&pageSize=" + showCount, HttpMethod.GET, httpEntity, JSONObject.class); "&pageSize=" + showCount, HttpMethod.GET, httpEntity, JSONObject.class);
return exchange.getBody(); return exchange.getBody();
@ -341,7 +341,7 @@ public class PLSUtil {
headers.set("Authorization", getToken(CORPINFO_ID)); headers.set("Authorization", getToken(CORPINFO_ID));
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers); 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); id, HttpMethod.GET, httpEntity, JSONObject.class);
return exchange.getBody(); return exchange.getBody();
} }
@ -355,7 +355,7 @@ public class PLSUtil {
headers.set("Authorization", getToken(CORPINFO_ID)); headers.set("Authorization", getToken(CORPINFO_ID));
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers); 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(); return exchange.getBody();
} }
@ -375,7 +375,7 @@ public class PLSUtil {
uriVariables.put("type", type); uriVariables.put("type", type);
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(uriVariables, headers); 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, HttpMethod.POST,
httpEntity, httpEntity,
JSONObject.class); JSONObject.class);
@ -393,7 +393,7 @@ public class PLSUtil {
headers.set("Authorization", getToken(CORPINFO_ID)); headers.set("Authorization", getToken(CORPINFO_ID));
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers); 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) + "/location/loca", HttpMethod.GET, httpEntity, JSONObject.class);
return exchange.getBody(); return exchange.getBody();
} }
@ -408,21 +408,30 @@ public class PLSUtil {
HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
headers.set("Authorization", getToken(CORPINFO_ID)); headers.set("Authorization", getToken(CORPINFO_ID));
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers); 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 + PLS_ID +
"&id=" + ELECTRONIC_FENCE_ID, HttpMethod.GET, httpEntity, Boolean.class); "&id=" + ELECTRONIC_FENCE_ID, HttpMethod.GET, httpEntity, Boolean.class);
return exchange.getBody(); return exchange.getBody();
} }
@PostConstruct private static void initBakeAddr(){
private void initBakeAddr() throws Exception { List<PageData> dataList = null;
List<PageData> dataList = corpplsinfoService.listAll(new PageData()); try {
dataList = corpplsinfoService.listAll(new PageData());
} catch (Exception e) {
throw new RuntimeException(e);
}
dataList.forEach(item -> { dataList.forEach(item -> {
BAKEADDR.put(item.getString("CORPINFO_ID"), item.getString("POST_URL")); 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 * @Description: token
* @Author: dearLin * @Author: dearLin
@ -449,7 +458,7 @@ public class PLSUtil {
if (response != null) { if (response != null) {
PageData valueData = JSONObject.parseObject(response.getString("data"), PageData.class); PageData valueData = JSONObject.parseObject(response.getString("data"), PageData.class);
token = valueData.getString("access_token"); token = valueData.getString("access_token");
String newExpireTime = DateUtil.getAfterHourDate("12"); String newExpireTime = DateUtil.getAfterHourDate("24");
pd.put("TOKEN", token); pd.put("TOKEN", token);
pd.put("EXPIRE_TIME", newExpireTime); pd.put("EXPIRE_TIME", newExpireTime);
corpplsinfoService.edit(pd); corpplsinfoService.edit(pd);
@ -472,7 +481,7 @@ public class PLSUtil {
public static boolean hasCardNumber(PageData user) throws Exception { public static boolean hasCardNumber(PageData user) throws Exception {
if (Tools.isEmpty(user.getString("CARDNO"))) {return true;} 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())); PageData response = sendGetHttpRequest(url, null, getToken(Jurisdiction.getCORPINFO_ID()));
if (response != null) { if (response != null) {
if (!"200".equals(response.getString("code"))) { if (!"200".equals(response.getString("code"))) {
@ -493,7 +502,7 @@ public class PLSUtil {
*/ */
public static PageData getCardNumberPeople(PageData user) throws Exception { 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())); PageData response = sendGetHttpRequest(url, null, getToken(Jurisdiction.getCORPINFO_ID()));
if (response != null) { if (response != null) {
if (!"200".equals(response.getString("code"))) { if (!"200".equals(response.getString("code"))) {
@ -513,7 +522,7 @@ public class PLSUtil {
* @Return: void * @Return: void
*/ */
public static PageData saveUser(PageData user) throws Exception { 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(); JSONObject loginPayload = new JSONObject();
loginPayload.put("name", user.getString("NAME")); loginPayload.put("name", user.getString("NAME"));
loginPayload.put("cardNo", user.getString("CARDNO")); loginPayload.put("cardNo", user.getString("CARDNO"));
@ -555,7 +564,7 @@ public class PLSUtil {
} }
return false; 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(); JSONObject loginPayload = new JSONObject();
loginPayload.put("name", user.getString("NAME")); loginPayload.put("name", user.getString("NAME"));
loginPayload.put("psnId", user.getString("PLS_ID")); loginPayload.put("psnId", user.getString("PLS_ID"));
@ -582,7 +591,7 @@ public class PLSUtil {
} }
public static boolean removeUser(PageData user) throws Exception { 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 removeUser = usersService.findById(user);
PageData response = sendDeleteHttpRequest(url, Long.parseLong(removeUser.getString("PLS_ID")), getToken(Jurisdiction.getCORPINFO_ID())); PageData response = sendDeleteHttpRequest(url, Long.parseLong(removeUser.getString("PLS_ID")), getToken(Jurisdiction.getCORPINFO_ID()));
return "200".equals(response.getString("code")); return "200".equals(response.getString("code"));

View File

@ -87,4 +87,17 @@
union all union all
select count(1) as count,sum(case when f.STEP_ID=15 then 1 else 0 end) as pass_count from BUS_HOTWORK f where DATE_FORMAT(f.CREATTIME,'%Y-%m')=#{MONTH} and f.CORPINFO_ID = #{CORPINFO_ID} and ISDELETE = 0 select count(1) as count,sum(case when f.STEP_ID=15 then 1 else 0 end) as pass_count from BUS_HOTWORK f where DATE_FORMAT(f.CREATTIME,'%Y-%m')=#{MONTH} and f.CORPINFO_ID = #{CORPINFO_ID} and ISDELETE = 0
</select> </select>
<select id="getEightWorksByType" resultType="com.zcloud.entity.PageData">
select
f.${TYPE}_ID ID,
f.CHECK_NO,
f.WORK_POSITION
from
BUS_${TYPE} f
left join (select * from(select * from vi_eightwork_flow_log log having 1 order by log.ACT_TIME desc
) 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 &gt; 0 and log.NEXT_STEP_ID != 99
</select>
</mapper> </mapper>