forked from integrated_whb/integrated_whb
手机端排查未在电子围栏禁止排查
parent
648d5df8e7
commit
cf1573cbaa
|
@ -1,5 +1,6 @@
|
||||||
package com.zcloud.controller.check;
|
package com.zcloud.controller.check;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.zcloud.controller.base.BaseController;
|
import com.zcloud.controller.base.BaseController;
|
||||||
import com.zcloud.entity.Page;
|
import com.zcloud.entity.Page;
|
||||||
import com.zcloud.entity.PageData;
|
import com.zcloud.entity.PageData;
|
||||||
|
@ -12,6 +13,7 @@ import com.zcloud.service.risk.RiskPointService;
|
||||||
import com.zcloud.service.system.DepartmentService;
|
import com.zcloud.service.system.DepartmentService;
|
||||||
import com.zcloud.service.system.UsersService;
|
import com.zcloud.service.system.UsersService;
|
||||||
import com.zcloud.util.DateUtil;
|
import com.zcloud.util.DateUtil;
|
||||||
|
import com.zcloud.util.PLSUtil;
|
||||||
import com.zcloud.util.ReturnMap;
|
import com.zcloud.util.ReturnMap;
|
||||||
import com.zcloud.util.Tools;
|
import com.zcloud.util.Tools;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -568,8 +570,12 @@ public class AppListManagerController extends BaseController {
|
||||||
@LogAnno(menuType = "手机", menuServer = "隐患排查", instructionsOperate = "清单管理", instructionsType = "判断是人员是否在电子围栏中")
|
@LogAnno(menuType = "手机", menuServer = "隐患排查", instructionsOperate = "清单管理", instructionsType = "判断是人员是否在电子围栏中")
|
||||||
public Object isInElectronicFence() throws Exception {
|
public Object isInElectronicFence() throws Exception {
|
||||||
PageData pd = this.getPageData();
|
PageData pd = this.getPageData();
|
||||||
|
if (!Tools.notEmpty(pd.getString("PLS_ID"))) {
|
||||||
return ReturnMap.error("当前人员不在电子围栏中禁止排查清单");
|
return ReturnMap.error("当前人员未绑定定位卡号");
|
||||||
|
}
|
||||||
|
boolean jsonObject = PLSUtil.determineWhetherThePersonIsInTheElectronicFence(pd.getString("CORPINFO_ID"), Integer.valueOf(pd.getString("PLS_ID")), pd.getString("ELECTRONIC_FENCE_ID"));
|
||||||
|
if (jsonObject) return ReturnMap.ok();
|
||||||
|
return ReturnMap.error("当前人员不在电子围栏中禁止排查清单");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -135,6 +135,7 @@ public class LoginController extends BaseController {
|
||||||
map.put("CORPINFO_ID", pd.getString("CORPINFO_ID"));
|
map.put("CORPINFO_ID", pd.getString("CORPINFO_ID"));
|
||||||
map.put("CORP_NAME", cpd.getString("CORP_NAME"));
|
map.put("CORP_NAME", cpd.getString("CORP_NAME"));
|
||||||
map.put("PROVINCE", cpd.getString("PROVINCE"));
|
map.put("PROVINCE", cpd.getString("PROVINCE"));
|
||||||
|
map.put("PLS_ID", pd.getOrDefault("PLS_ID",""));
|
||||||
// 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);
|
||||||
|
|
|
@ -251,7 +251,7 @@ public class UsersServiceImpl implements UsersService {
|
||||||
public String changeOrUpdUserCardNo(PageData nowuser) throws Exception {
|
public String changeOrUpdUserCardNo(PageData nowuser) throws Exception {
|
||||||
PageData oldUser = usersMapper.findById(nowuser);
|
PageData oldUser = usersMapper.findById(nowuser);
|
||||||
// 先判断人员新的定位卡号是否有变化,没变化直接可以修改
|
// 先判断人员新的定位卡号是否有变化,没变化直接可以修改
|
||||||
if (oldUser.getString("CARDNO").equals(nowuser.getString("CARDNO"))) {
|
if (oldUser.getString("CARDNO") == null || oldUser.getOrDefault("CARDNO","").equals(nowuser.getString("CARDNO"))) {
|
||||||
return Const.CAN_CHENG_USER;
|
return Const.CAN_CHENG_USER;
|
||||||
}
|
}
|
||||||
// 有变化看库里是否有人在用这个新卡号
|
// 有变化看库里是否有人在用这个新卡号
|
||||||
|
|
|
@ -62,19 +62,19 @@ public class PLSUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 电子围栏列表
|
* @Description: 根据定位卡号获取人是否再电子围栏里
|
||||||
* @Author: dearLin
|
* @Author: dearLin
|
||||||
* @Date: 2024/1/25/025 14:37
|
* @Date: 2024/1/25/025 14:37
|
||||||
* @Param: [java.lang.String, java.lang.Integer, java.lang.Integer] [keywords, currentPage, showCount]
|
* @Param: [java.lang.String, java.lang.Integer, java.lang.Integer] [keywords, currentPage, showCount]
|
||||||
* @Return: com.alibaba.fastjson.JSONObject
|
* @Return: com.alibaba.fastjson.JSONObject
|
||||||
*/
|
*/
|
||||||
public static JSONObject determineWhetherThePersonIsInTheElectronicFence(String CORPINFO_ID, Integer PLS_ID, String ELECTRONIC_FENCE_ID) throws Exception {
|
public static Boolean determineWhetherThePersonIsInTheElectronicFence(String CORPINFO_ID, Integer PLS_ID, String ELECTRONIC_FENCE_ID) throws Exception {
|
||||||
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) + "/region/api/electronicFence/determineWhetherThePersonIsInTheElectronicFence2?psn=" +
|
ResponseEntity<Boolean> exchange = restTemplate.exchange(PLSUtil.BAKEADDR.get(CORPINFO_ID) + "/region/api/electronicFence/determineWhetherThePersonIsInTheElectronicFence2?psn=" +
|
||||||
PLS_ID +
|
PLS_ID +
|
||||||
"&uuid=" + ELECTRONIC_FENCE_ID, HttpMethod.GET, httpEntity, JSONObject.class);
|
"&uuid=" + ELECTRONIC_FENCE_ID, HttpMethod.GET, httpEntity, Boolean.class);
|
||||||
return exchange.getBody();
|
return exchange.getBody();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ public class Tools {
|
||||||
* @return 不为空则返回true,否则返回false
|
* @return 不为空则返回true,否则返回false
|
||||||
*/
|
*/
|
||||||
public static boolean notEmpty(String s){
|
public static boolean notEmpty(String s){
|
||||||
return s!=null && !"".equals(s) && !"null".equals(s);
|
return s!=null && !"".equals(s) && !"null".equals(s)&& !"undefined".equals(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue