From a7ac882e3084e2be61b5f854e7dd7e33abc044da Mon Sep 17 00:00:00 2001 From: cwchen <1048842385@qq.com> Date: Fri, 22 Mar 2024 18:13:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E8=BD=A6=E7=AE=A1=E7=90=86-=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DeviceOfBdServiceImpl.java | 24 ++++- .../service/impl/HumanServiceImpl.java | 89 +++++++++++-------- .../service/impl/TeamServiceImpl.java | 36 +++++--- 3 files changed, 96 insertions(+), 53 deletions(-) diff --git a/securitycontrol-model/securitycontrol-background/src/main/java/com/securitycontrol/background/service/impl/DeviceOfBdServiceImpl.java b/securitycontrol-model/securitycontrol-background/src/main/java/com/securitycontrol/background/service/impl/DeviceOfBdServiceImpl.java index ce81677..2a57e0a 100644 --- a/securitycontrol-model/securitycontrol-background/src/main/java/com/securitycontrol/background/service/impl/DeviceOfBdServiceImpl.java +++ b/securitycontrol-model/securitycontrol-background/src/main/java/com/securitycontrol/background/service/impl/DeviceOfBdServiceImpl.java @@ -43,7 +43,11 @@ public class DeviceOfBdServiceImpl implements IDeviceOfBdService { @Override public List getDeviceBdList(DeviceBdDto dto) { List list = new ArrayList<>(); - list = mapper.getDeviceBdList(dto); + try { + list = mapper.getDeviceBdList(dto); + } catch (Exception e) { + log.error("获取边带列表",e); + } return list; } @@ -81,7 +85,11 @@ public class DeviceOfBdServiceImpl implements IDeviceOfBdService { @Override public AjaxResult getDeviceBdById(DeviceBdDto dto) { DeviceBdVo vo = new DeviceBdVo(); - vo = mapper.getDeviceBdById(dto); + try { + vo = mapper.getDeviceBdById(dto); + } catch (Exception e) { + log.error("边带设备详情",e); + } return AjaxResult.success(vo); } @@ -109,7 +117,11 @@ public class DeviceOfBdServiceImpl implements IDeviceOfBdService { @Override public List getDeviceBdChildList(DeviceBdDto dto) { List list = new ArrayList<>(); - list = mapper.getDeviceBdChildList(dto); + try { + list = mapper.getDeviceBdChildList(dto); + } catch (Exception e) { + log.error("获取边带子设备列表",e); + } return list; } @@ -146,7 +158,11 @@ public class DeviceOfBdServiceImpl implements IDeviceOfBdService { @Override public AjaxResult getDeviceBdChildById(DeviceBdDto dto) { DeviceBdChildVo vo = new DeviceBdChildVo(); - vo = mapper.getDeviceBdChildById(dto); + try { + vo = mapper.getDeviceBdChildById(dto); + } catch (Exception e) { + log.error("边带子设备详情",e); + } return AjaxResult.success(vo); } diff --git a/securitycontrol-model/securitycontrol-background/src/main/java/com/securitycontrol/background/service/impl/HumanServiceImpl.java b/securitycontrol-model/securitycontrol-background/src/main/java/com/securitycontrol/background/service/impl/HumanServiceImpl.java index 5a624f9..5058e31 100644 --- a/securitycontrol-model/securitycontrol-background/src/main/java/com/securitycontrol/background/service/impl/HumanServiceImpl.java +++ b/securitycontrol-model/securitycontrol-background/src/main/java/com/securitycontrol/background/service/impl/HumanServiceImpl.java @@ -20,7 +20,6 @@ import com.securitycontrol.system.api.RemoteFileService; import com.securitycontrol.system.api.domain.SysFile; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.interceptor.TransactionAspectSupport; @@ -48,7 +47,11 @@ public class HumanServiceImpl implements HumanService { @Override public List getHumanLists(ParamDto dto) { List list = new ArrayList<>(); - list = mapper.getHumanLists(dto); + try { + list = mapper.getHumanLists(dto); + } catch (Exception e) { + log.error("获取人员列表",e); + } return list; } @@ -156,28 +159,32 @@ public class HumanServiceImpl implements HumanService { @Override public AjaxResult getPersonnelById(ParamDto dto) { HumanManageVo vo = new HumanManageVo(); - vo = mapper.getPersonnelById(dto); - String decryptIdNumber = AesCbcUtils.decrypt(vo.getIdNumber()); - if(decryptIdNumber != null){ - vo.setIdNumber(decryptIdNumber); - } - List resourceFileVos = mapper.getFiles(vo.getUserId()); - if (CollectionUtils.isNotEmpty(resourceFileVos)) { - List list = new ArrayList<>(); - for (ResourceFileVo fileVo : resourceFileVos) { - String base64 = null; - Result result = remoteFileService.getImgBase64(fileVo.getFileId(), SecurityConstants.INNER); - if (result != null && result.getCode() == HttpStatus.SUCCESS && result.getData() != null) { - String jsonString = JSON.toJSONString(result.getData()); - JSONObject item = JSON.parseObject(jsonString); - base64 = item.getString("url"); - } - HumanManageVo.FileData fileData = new HumanManageVo.FileData(); - fileData.setFileId(fileVo.getFileId()); - fileData.setBase64Url(base64); - list.add(fileData); + try { + vo = mapper.getPersonnelById(dto); + String decryptIdNumber = AesCbcUtils.decrypt(vo.getIdNumber()); + if(decryptIdNumber != null){ + vo.setIdNumber(decryptIdNumber); } - vo.setFileData(list); + List resourceFileVos = mapper.getFiles(vo.getUserId()); + if (CollectionUtils.isNotEmpty(resourceFileVos)) { + List list = new ArrayList<>(); + for (ResourceFileVo fileVo : resourceFileVos) { + String base64 = null; + Result result = remoteFileService.getImgBase64(fileVo.getFileId(), SecurityConstants.INNER); + if (result != null && result.getCode() == HttpStatus.SUCCESS && result.getData() != null) { + String jsonString = JSON.toJSONString(result.getData()); + JSONObject item = JSON.parseObject(jsonString); + base64 = item.getString("url"); + } + HumanManageVo.FileData fileData = new HumanManageVo.FileData(); + fileData.setFileId(fileVo.getFileId()); + fileData.setBase64Url(base64); + list.add(fileData); + } + vo.setFileData(list); + } + } catch (Exception e) { + log.error("人员详情",e); } return AjaxResult.success(vo); } @@ -212,21 +219,25 @@ public class HumanServiceImpl implements HumanService { @Override public AjaxResult viewPersonnelFile(ParamDto dto) { List list = new ArrayList<>(); - List resourceFileVos = mapper.getFiles(dto.getId()); - if (CollectionUtils.isNotEmpty(resourceFileVos)) { - for (ResourceFileVo fileVo : resourceFileVos) { - String base64 = null; - Result result = remoteFileService.getImgBase64(fileVo.getFileId(), SecurityConstants.INNER); - if (result != null && result.getCode() == HttpStatus.SUCCESS && result.getData() != null) { - String jsonString = JSON.toJSONString(result.getData()); - JSONObject item = JSON.parseObject(jsonString); - base64 = item.getString("url"); + try { + List resourceFileVos = mapper.getFiles(dto.getId()); + if (CollectionUtils.isNotEmpty(resourceFileVos)) { + for (ResourceFileVo fileVo : resourceFileVos) { + String base64 = null; + Result result = remoteFileService.getImgBase64(fileVo.getFileId(), SecurityConstants.INNER); + if (result != null && result.getCode() == HttpStatus.SUCCESS && result.getData() != null) { + String jsonString = JSON.toJSONString(result.getData()); + JSONObject item = JSON.parseObject(jsonString); + base64 = item.getString("url"); + } + HumanManageVo.FileData fileData = new HumanManageVo.FileData(); + fileData.setFileId(fileVo.getFileId()); + fileData.setBase64Url(base64); + list.add(fileData); } - HumanManageVo.FileData fileData = new HumanManageVo.FileData(); - fileData.setFileId(fileVo.getFileId()); - fileData.setBase64Url(base64); - list.add(fileData); } + } catch (Exception e) { + log.error("人员照片预览",e); } return AjaxResult.success(list); } @@ -234,7 +245,11 @@ public class HumanServiceImpl implements HumanService { @Override public List getPersonnelAccessLists(ParamDto dto) { List list = new ArrayList<>(); - list = mapper.getPersonnelAccessLists(dto); + try { + list = mapper.getPersonnelAccessLists(dto); + } catch (Exception e) { + log.error("获取人员出入记录",e); + } return list; } } diff --git a/securitycontrol-model/securitycontrol-background/src/main/java/com/securitycontrol/background/service/impl/TeamServiceImpl.java b/securitycontrol-model/securitycontrol-background/src/main/java/com/securitycontrol/background/service/impl/TeamServiceImpl.java index 1ff99d8..d077a80 100644 --- a/securitycontrol-model/securitycontrol-background/src/main/java/com/securitycontrol/background/service/impl/TeamServiceImpl.java +++ b/securitycontrol-model/securitycontrol-background/src/main/java/com/securitycontrol/background/service/impl/TeamServiceImpl.java @@ -35,10 +35,14 @@ public class TeamServiceImpl implements TeamService { @Override public List getTeamLists(ParamDto dto) { List list = new ArrayList<>(); - list = mapper.getTeamLists(dto); - for (TeamManageVo vo : list) { - int num = mapper.getTeamUserNum(vo.getTeamId()); - vo.setTeamNum(String.valueOf(num)); + try { + list = mapper.getTeamLists(dto); + for (TeamManageVo vo : list) { + int num = mapper.getTeamUserNum(vo.getTeamId()); + vo.setTeamNum(String.valueOf(num)); + } + } catch (Exception e) { + log.error("获取班组列表",e); } return list; } @@ -138,7 +142,11 @@ public class TeamServiceImpl implements TeamService { @Override public List getTeamUserLists(ParamDto dto) { List list = new ArrayList<>(); - list = mapper.getTeamUserLists(dto); + try { + list = mapper.getTeamUserLists(dto); + } catch (Exception e) { + log.error("获取班组人员列表",e); + } return list; } @@ -161,15 +169,19 @@ public class TeamServiceImpl implements TeamService { Map map = new HashMap<>(16); List> teamUsers = new ArrayList<>(); List> noBandingUsers = new ArrayList<>(); - List> list = mapper.getTeamUserAndNoBandingUser(dto); - if(CollectionUtils.isNotEmpty(list)){ - for (Map stringMap : list) { - if(Objects.equals(stringMap.get("type"),"1")){ - teamUsers.add(stringMap); - }else if(Objects.equals(stringMap.get("type"),"2")){ - noBandingUsers.add(stringMap); + try { + List> list = mapper.getTeamUserAndNoBandingUser(dto); + if(CollectionUtils.isNotEmpty(list)){ + for (Map stringMap : list) { + if(Objects.equals(stringMap.get("type"),"1")){ + teamUsers.add(stringMap); + }else if(Objects.equals(stringMap.get("type"),"2")){ + noBandingUsers.add(stringMap); + } } } + } catch (Exception e) { + log.error("获取班组组员和未加入班组人员",e); } map.put("teamUsers",teamUsers); map.put("noBandingUsers",noBandingUsers);