From b0afaa6d630c6a263a114c7dcf1d30a4aedba21f Mon Sep 17 00:00:00 2001 From: cwchen <1048842385@qq.com> Date: Tue, 9 Apr 2024 10:52:07 +0800 Subject: [PATCH] =?UTF-8?q?APP=E4=BA=BA=E5=91=98=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../background/mapper/IAppMapper.java | 13 ++++++++ .../service/impl/AppServiceImpl.java | 30 +++++++++++++------ .../src/main/resources/mapper/AppMapper.xml | 18 ++++++++++- 3 files changed, 51 insertions(+), 10 deletions(-) diff --git a/securitycontrol-model/securitycontrol-background/src/main/java/com/securitycontrol/background/mapper/IAppMapper.java b/securitycontrol-model/securitycontrol-background/src/main/java/com/securitycontrol/background/mapper/IAppMapper.java index 6a56cd4..7b668aa 100644 --- a/securitycontrol-model/securitycontrol-background/src/main/java/com/securitycontrol/background/mapper/IAppMapper.java +++ b/securitycontrol-model/securitycontrol-background/src/main/java/com/securitycontrol/background/mapper/IAppMapper.java @@ -130,6 +130,7 @@ public interface IAppMapper { /** * 标段工程成本 + * * @param dto * @return List * @description @@ -137,4 +138,16 @@ public interface IAppMapper { * @date 2024/4/1 19:12 */ List getProCost(ParamDto dto); + + /** + * 获取人员出入状态 + * @param userId + * @param accessType + * @param type + * @return String + * @description + * @author cwchen + * @date 2024/4/3 18:03 + */ + String getUserAccessStatus(@Param("userId") String userId,@Param("accessType") String accessType,@Param("type")int type); } diff --git a/securitycontrol-model/securitycontrol-background/src/main/java/com/securitycontrol/background/service/impl/AppServiceImpl.java b/securitycontrol-model/securitycontrol-background/src/main/java/com/securitycontrol/background/service/impl/AppServiceImpl.java index 842448d..6d739b9 100644 --- a/securitycontrol-model/securitycontrol-background/src/main/java/com/securitycontrol/background/service/impl/AppServiceImpl.java +++ b/securitycontrol-model/securitycontrol-background/src/main/java/com/securitycontrol/background/service/impl/AppServiceImpl.java @@ -50,7 +50,7 @@ public class AppServiceImpl implements IAppService { ProVo proVo = new ProVo(); try { proVo = mapper.getProBrief(dto); - if(Objects.nonNull(proVo)){ + if (Objects.nonNull(proVo)) { List list = new ArrayList<>(); List resourceFileVos = mapper.getFiles(proVo.getProId()); if (CollectionUtils.isNotEmpty(resourceFileVos)) { @@ -101,6 +101,11 @@ public class AppServiceImpl implements IAppService { } else { vo.setSex(getGenderByIdCard(vo.getIdNumber())); } + String data = mapper.getUserAccessStatus(vo.getUserId(), Constant.ACCESS_TYPE, 1); + if (StringUtils.isNotEmpty(data)) { + String value = mapper.getUserAccessStatus(data, Constant.ACCESS_TYPE, 2); + vo.setStatus(StringUtils.isEmpty(value) ? "离场" : value); + } } } catch (Exception e) { log.error("人员管理", e); @@ -124,8 +129,15 @@ public class AppServiceImpl implements IAppService { List list = new ArrayList(); try { list = mapper.getCarList(dto); + for (VehicleVo vo : list) { + String data = mapper.getUserAccessStatus(vo.getCarNum(), Constant.ACCESS_TYPE, 1); + if (StringUtils.isNotEmpty(data)) { + String value = mapper.getUserAccessStatus(data, Constant.ACCESS_TYPE, 2); + vo.setAccessType(StringUtils.isEmpty(value) ? "离场" : value); + } + } } catch (Exception e) { - log.error("人员管理", e); + log.error("车辆管理", e); } return AjaxResult.success(list); } @@ -213,13 +225,13 @@ public class AppServiceImpl implements IAppService { item = JSON.parseObject(jsonString); // 施工进度 proGxPlanList = mapper.getProGxPlan(dto); - if(CollectionUtils.isNotEmpty(proGxPlanList)){ - proGxPlanList.forEach(mapData->{ + if (CollectionUtils.isNotEmpty(proGxPlanList)) { + proGxPlanList.forEach(mapData -> { String proType = String.valueOf(mapData.get("proType")); String bidCode = String.valueOf(mapData.get("bidCode")); String gxId = String.valueOf(mapData.get("gxId")); String name = mapper.getGtOrGxName(proType, bidCode, gxId); - mapData.put("name",name); + mapData.put("name", name); }); } // 标段工程成本 @@ -227,10 +239,10 @@ public class AppServiceImpl implements IAppService { } catch (Exception e) { log.error("工程管理", e); } - dataMap.put("vo",vo); - dataMap.put("item",item); - dataMap.put("proGxPlan",proGxPlanList); - dataMap.put("proCost",proCostList); + dataMap.put("vo", vo); + dataMap.put("item", item); + dataMap.put("proGxPlan", proGxPlanList); + dataMap.put("proCost", proCostList); return AjaxResult.success(dataMap); } } diff --git a/securitycontrol-model/securitycontrol-background/src/main/resources/mapper/AppMapper.xml b/securitycontrol-model/securitycontrol-background/src/main/resources/mapper/AppMapper.xml index 64682b0..646c91f 100644 --- a/securitycontrol-model/securitycontrol-background/src/main/resources/mapper/AppMapper.xml +++ b/securitycontrol-model/securitycontrol-background/src/main/resources/mapper/AppMapper.xml @@ -43,7 +43,8 @@ + + \ No newline at end of file