From 93d683a9a969125151e5611b2662138ec0e11797 Mon Sep 17 00:00:00 2001 From: cwchen <1048842385@qq.com> Date: Fri, 19 Apr 2024 17:56:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/core/constant/Constant.java | 2 ++ .../entity/background/vo/HumanManageVo.java | 2 ++ .../src/main/resources/bootstrap.yml | 6 ++--- .../background/mapper/HumanManageMapper.java | 12 ++++++++++ .../service/impl/HumanServiceImpl.java | 6 +++-- .../resources/mapper/HumanManageMapper.xml | 16 +++++++++---- .../service/impl/PersonnelControlImpl.java | 2 ++ .../mapper/PersonnelControlMapper.xml | 24 +++++++++---------- .../src/main/resources/mapper/VideoMapper.xml | 2 +- 9 files changed, 49 insertions(+), 23 deletions(-) diff --git a/securitycontrol-commons/securitycontrol-commons-core/src/main/java/com/securitycontrol/common/core/constant/Constant.java b/securitycontrol-commons/securitycontrol-commons-core/src/main/java/com/securitycontrol/common/core/constant/Constant.java index cd5d01d..6219b99 100644 --- a/securitycontrol-commons/securitycontrol-commons-core/src/main/java/com/securitycontrol/common/core/constant/Constant.java +++ b/securitycontrol-commons/securitycontrol-commons-core/src/main/java/com/securitycontrol/common/core/constant/Constant.java @@ -84,6 +84,8 @@ public class Constant { public final static String ACCESS_TYPE_IN = "入"; public final static String ACCESS_TYPE_OUT = "出"; public final static String TYPE = "1"; + /**安全帽*/ + public final static String AQM = "1804"; public final static String[] BUILD_ARR = {"12A0,合肥","12B0,马鞍山","12C0,芜湖","12D0,安庆","12F0,淮南", "12G0,宣城","12H0,阜阳","12J0,铜陵","12L0,蚌埠","12M0,滁州","12N0,六安","12P0,淮北","12Q0,宿州","12R0,池州", diff --git a/securitycontrol-commons/securitycontrol-commons-entity/src/main/java/com/securitycontrol/entity/background/vo/HumanManageVo.java b/securitycontrol-commons/securitycontrol-commons-entity/src/main/java/com/securitycontrol/entity/background/vo/HumanManageVo.java index 7a8be73..97df4d8 100644 --- a/securitycontrol-commons/securitycontrol-commons-entity/src/main/java/com/securitycontrol/entity/background/vo/HumanManageVo.java +++ b/securitycontrol-commons/securitycontrol-commons-entity/src/main/java/com/securitycontrol/entity/background/vo/HumanManageVo.java @@ -86,6 +86,8 @@ public class HumanManageVo { @ApiModelProperty(value = "创建时间") private String createTime; + @ApiModelProperty(value = "人员绑定安全帽名称") + private String bingDeviceName; @JsonInclude(JsonInclude.Include.NON_EMPTY) private List fileData; diff --git a/securitycontrol-gateway/src/main/resources/bootstrap.yml b/securitycontrol-gateway/src/main/resources/bootstrap.yml index 8a11d28..f28e084 100644 --- a/securitycontrol-gateway/src/main/resources/bootstrap.yml +++ b/securitycontrol-gateway/src/main/resources/bootstrap.yml @@ -17,11 +17,11 @@ spring: nacos: discovery: username: nacos - password: Jjsp@nacos2023 + password: nacos namespace: jjzhgd # 服务注册地址 server-addr: 127.0.0.1:8848 - # server-addr: 10.138.225.186:28848 + # server-addr: 10.138.225.186:28848 config: # 配置中心地址 server-addr: 127.0.0.1:8848 @@ -32,7 +32,7 @@ spring: shared-configs: - vsc-dev.yml username: nacos - password: Jjsp@nacos2023 + password: nacos namespace: jjzhgd # server-addr: 10.138.132.188:18848 management: diff --git a/securitycontrol-model/securitycontrol-background/src/main/java/com/securitycontrol/background/mapper/HumanManageMapper.java b/securitycontrol-model/securitycontrol-background/src/main/java/com/securitycontrol/background/mapper/HumanManageMapper.java index 45259b8..13b3515 100644 --- a/securitycontrol-model/securitycontrol-background/src/main/java/com/securitycontrol/background/mapper/HumanManageMapper.java +++ b/securitycontrol-model/securitycontrol-background/src/main/java/com/securitycontrol/background/mapper/HumanManageMapper.java @@ -179,6 +179,7 @@ public interface HumanManageMapper { /** * 获取人员入场 离场状态 + * * @param userId * @param accessType * @param type @@ -188,4 +189,15 @@ public interface HumanManageMapper { * @date 2024/4/18 10:13 */ String getUserAccessStatus(@Param("userId") String userId, @Param("accessType") String accessType, @Param("type") int type); + + /** + * 人员绑定安全帽 + * @param vo + * @param typeCode + * @return String + * @description + * @author cwchen + * @date 2024/4/19 16:01 + */ + String getUserBingCup(@Param("params") HumanManageVo vo,@Param("typeCode")String typeCode); } 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 c7f7efd..593868c 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 @@ -55,6 +55,8 @@ public class HumanServiceImpl implements HumanService { try { list = mapper.getHumanLists(dto); for (HumanManageVo vo : list) { + String bingDeviceName = mapper.getUserBingCup(vo,Constant.AQM); + vo.setBingDeviceName(bingDeviceName); String data = mapper.getUserAccessStatus(vo.getUserId(), Constant.ACCESS_TYPE, 1); if (StringUtils.isNotEmpty(data)) { String value = mapper.getUserAccessStatus(data, Constant.ACCESS_TYPE, 2); @@ -305,10 +307,10 @@ public class HumanServiceImpl implements HumanService { public AjaxResult bindDev(ParamDto dto) { try{ if (StringHelper.isEmpty(dto.getUserId())) { - AjaxResult.error("未选择人员"); + return AjaxResult.error("未选择人员"); } if (StringHelper.isEmpty(dto.getDevId())) { - AjaxResult.error("未选择安全帽"); + return AjaxResult.error("未选择安全帽"); } if(StringHelper.isEmpty(dto.getId())){ int bidNum=mapper.getBindHis(dto); diff --git a/securitycontrol-model/securitycontrol-background/src/main/resources/mapper/HumanManageMapper.xml b/securitycontrol-model/securitycontrol-background/src/main/resources/mapper/HumanManageMapper.xml index 4a3be94..c460539 100644 --- a/securitycontrol-model/securitycontrol-background/src/main/resources/mapper/HumanManageMapper.xml +++ b/securitycontrol-model/securitycontrol-background/src/main/resources/mapper/HumanManageMapper.xml @@ -87,7 +87,7 @@ - DELETE FROM t_team_people WHERE user_id = #{id} + UPDATE t_team_people SET del_falge = '1' WHERE user_id = #{id} update tb_user_bind_cap set bind_status=0 where people_id=#{userId} @@ -110,15 +110,16 @@ ttp.dept_name AS deptName FROM t_team_people ttp LEFT JOIN tb_work_team twt on ttp.team_id = twt.team_id - LEFT JOIN sys_dict sd ON ttp.user_type = sd.dict_code - LEFT JOIN tb_project tp ON twt.bid_code = tp.bid_code + LEFT JOIN sys_dict sd ON ttp.user_type = sd.dict_code AND sd.del_flag = 0 + LEFT JOIN tb_project tp ON twt.bid_code = tp.bid_code AND tp.del_flag = 0 - AND twt.bid_code = #{bidCode} + twt.bid_code = #{bidCode} AND INSTR(ttp.user_name,#{userName}) > 0 + AND ttp.del_falge = '0' @@ -201,4 +202,11 @@ WHERE tdd.device_id = #{userId} AND tdd.mode_name = #{accessType} AND tdd.del_flag = 0 + + \ No newline at end of file diff --git a/securitycontrol-model/securitycontrol-screen/src/main/java/com/securitycontrol/screen/service/impl/PersonnelControlImpl.java b/securitycontrol-model/securitycontrol-screen/src/main/java/com/securitycontrol/screen/service/impl/PersonnelControlImpl.java index 418111d..bd844ac 100644 --- a/securitycontrol-model/securitycontrol-screen/src/main/java/com/securitycontrol/screen/service/impl/PersonnelControlImpl.java +++ b/securitycontrol-model/securitycontrol-screen/src/main/java/com/securitycontrol/screen/service/impl/PersonnelControlImpl.java @@ -1,5 +1,6 @@ package com.securitycontrol.screen.service.impl; +import com.securitycontrol.common.core.constant.Constant; import com.securitycontrol.common.core.utils.uuid.IdUtils; import com.securitycontrol.common.core.web.domain.AjaxResult; import com.securitycontrol.entity.screen.dto.PersonnelControlDto; @@ -35,6 +36,7 @@ public class PersonnelControlImpl implements PersonnelControlService { */ @Override public List getWearEquipmentList(PersonnelControlDto dto) { + dto.setTypeCode(Integer.parseInt(Constant.AQM)); return mapper.getWearEquipmentList(dto); } diff --git a/securitycontrol-model/securitycontrol-screen/src/main/resources/mapper/PersonnelControlMapper.xml b/securitycontrol-model/securitycontrol-screen/src/main/resources/mapper/PersonnelControlMapper.xml index 30c2ac5..e0317a1 100644 --- a/securitycontrol-model/securitycontrol-screen/src/main/resources/mapper/PersonnelControlMapper.xml +++ b/securitycontrol-model/securitycontrol-screen/src/main/resources/mapper/PersonnelControlMapper.xml @@ -27,18 +27,16 @@ diff --git a/securitycontrol-model/securitycontrol-screen/src/main/resources/mapper/VideoMapper.xml b/securitycontrol-model/securitycontrol-screen/src/main/resources/mapper/VideoMapper.xml index 45d7286..f465a2f 100644 --- a/securitycontrol-model/securitycontrol-screen/src/main/resources/mapper/VideoMapper.xml +++ b/securitycontrol-model/securitycontrol-screen/src/main/resources/mapper/VideoMapper.xml @@ -7,7 +7,7 @@ (SELECT '0' AS id,'球机' AS title, '-1' AS parentId,'0' AS onLine,'1' AS level) UNION ALL ( - SELECT CONCAT('QJ',tcm.puid) AS id, + SELECT CONCAT('QJ',tcm.puid,'-',IFNULL(on_line,0)) AS id, tcm.pro_name AS title, '0' AS parentId, IFNULL(on_line,0) AS onLine,