手机端排查未在电子围栏禁止排查

pull/4/head
dearlin 2024-01-25 17:24:05 +08:00
parent 648d5df8e7
commit cf1573cbaa
5 changed files with 15 additions and 8 deletions

View File

@ -1,5 +1,6 @@
package com.zcloud.controller.check;
import com.alibaba.fastjson.JSONObject;
import com.zcloud.controller.base.BaseController;
import com.zcloud.entity.Page;
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.UsersService;
import com.zcloud.util.DateUtil;
import com.zcloud.util.PLSUtil;
import com.zcloud.util.ReturnMap;
import com.zcloud.util.Tools;
import org.springframework.beans.factory.annotation.Autowired;
@ -568,8 +570,12 @@ public class AppListManagerController extends BaseController {
@LogAnno(menuType = "手机", menuServer = "隐患排查", instructionsOperate = "清单管理", instructionsType = "判断是人员是否在电子围栏中")
public Object isInElectronicFence() throws Exception {
PageData pd = this.getPageData();
return ReturnMap.error("当前人员不在电子围栏中禁止排查清单");
if (!Tools.notEmpty(pd.getString("PLS_ID"))) {
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("当前人员不在电子围栏中禁止排查清单");
}
/**

View File

@ -135,6 +135,7 @@ public class LoginController extends BaseController {
map.put("CORPINFO_ID", pd.getString("CORPINFO_ID"));
map.put("CORP_NAME", cpd.getString("CORP_NAME"));
map.put("PROVINCE", cpd.getString("PROVINCE"));
map.put("PLS_ID", pd.getOrDefault("PLS_ID",""));
// PageData dpd = new PageData();
// dpd.put("DEPARTMENT_ID", pd.getString("DEPARTMENT_ID"));
// dpd=departmentService.findById(dpd);

View File

@ -251,7 +251,7 @@ public class UsersServiceImpl implements UsersService {
public String changeOrUpdUserCardNo(PageData nowuser) throws Exception {
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;
}
// 有变化看库里是否有人在用这个新卡号

View File

@ -62,19 +62,19 @@ public class PLSUtil {
}
/**
* @Description:
* @Description:
* @Author: dearLin
* @Date: 2024/1/25/025 14:37
* @Param: [java.lang.String, java.lang.Integer, java.lang.Integer] [keywords, currentPage, showCount]
* @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();
headers.set("Authorization", getToken(CORPINFO_ID));
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 +
"&uuid=" + ELECTRONIC_FENCE_ID, HttpMethod.GET, httpEntity, JSONObject.class);
"&uuid=" + ELECTRONIC_FENCE_ID, HttpMethod.GET, httpEntity, Boolean.class);
return exchange.getBody();
}

View File

@ -36,7 +36,7 @@ public class Tools {
* @return truefalse
*/
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);
}
/**