This commit is contained in:
cwchen 2024-04-19 17:56:36 +08:00
parent d3d677e57a
commit 93d683a9a9
9 changed files with 49 additions and 23 deletions

View File

@ -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,池州",

View File

@ -86,6 +86,8 @@ public class HumanManageVo {
@ApiModelProperty(value = "创建时间")
private String createTime;
@ApiModelProperty(value = "人员绑定安全帽名称")
private String bingDeviceName;
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private List<HumanManageVo.FileData> fileData;

View File

@ -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:

View File

@ -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);
}

View File

@ -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);

View File

@ -87,7 +87,7 @@
</delete>
<!--删除人员-->
<delete id="delPersonnelById">
DELETE FROM t_team_people WHERE user_id = #{id}
UPDATE t_team_people SET del_falge = '1' WHERE user_id = #{id}
</delete>
<update id="delBind">
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
<where>
<if test="bidCode!=null and bidCode !=''">
AND twt.bid_code = #{bidCode}
twt.bid_code = #{bidCode}
</if>
<if test="userName!=null and userName !=''">
AND INSTR(ttp.user_name,#{userName}) > 0
</if>
AND ttp.del_falge = '0'
</where>
</select>
<!--人员是否存在-->
@ -201,4 +202,11 @@
WHERE tdd.device_id = #{userId} AND tdd.mode_name = #{accessType} AND tdd.del_flag = 0
</if>
</select>
<!--人员绑定安全帽-->
<select id="getUserBingCup" resultType="java.lang.String">
SELECT td.device_name AS deviceName
FROM tb_user_bind_cap tubc
LEFT JOIN tb_device td ON tubc.device_id = td.device_id AND td.device_type = #{typeCode}
WHERE tubc.people_id = #{params.userId} AND tubc.bind_status = '1'
</select>
</mapper>

View File

@ -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<PersonnelControlVo> getWearEquipmentList(PersonnelControlDto dto) {
dto.setTypeCode(Integer.parseInt(Constant.AQM));
return mapper.getWearEquipmentList(dto);
}

View File

@ -27,18 +27,16 @@
<!--人员管控-穿戴装备-->
<select id="getWearEquipmentList" resultType="com.securitycontrol.entity.screen.vo.PersonnelControlVo">
SELECT
tbd.device_type AS deviceType,
su.user_name AS userName,
tbd.device_name AS deviceName,
trd.status AS status
FROM t_team_people ttp
JOIN sys_user su ON ttp.user_id = su.user_id
JOIN tb_work_team twt ON ttp.team_id = twt.team_id
JOIN tb_user_bind_cap tuc ON ttp.user_id = tuc.people_id
JOIN tb_device tbd ON tuc.device_id = tbd.device_id
JOIN tb_rel_device trd ON tbd.device_id = trd.device_id
WHERE twt.bid_code = #{bidCode}
SELECT td.device_name AS deviceName,
ttp.user_name AS userName,
sd.dict_name AS deviceType,
td.on_line AS status
FROM tb_user_bind_cap tubc
LEFT JOIN tb_device td ON tubc.device_id = td.device_id AND td.device_type = #{typeCode}
LEFT JOIN t_team_people ttp ON tubc.people_id = ttp.user_id AND ttp.del_falge = '0'
LEFT JOIN sys_dict sd ON td.device_type = sd.dict_code AND sd.del_flag = 0
INNER JOIN tb_work_team twt ON ttp.team_id = twt.team_id AND twt.bid_code = #{bidCode}
WHERE tubc.bind_status = '1'
</select>
<!--人员管控-人员列表-->
<select id="getPersonnelList" resultType="com.securitycontrol.entity.screen.vo.PersonnelControlVo">
@ -74,7 +72,7 @@
FROM
tb_warn tw
WHERE
tw.warn_type = 1806
tw.warn_type = 9995
AND tw.bid_code = #{bidCode}
AND DATE(tw.warn_time) = CURDATE();
</select>

View File

@ -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,