APP人员管理

This commit is contained in:
cwchen 2024-04-09 10:52:07 +08:00
parent 869cceb811
commit b0afaa6d63
3 changed files with 51 additions and 10 deletions

View File

@ -130,6 +130,7 @@ public interface IAppMapper {
/**
* 标段工程成本
*
* @param dto
* @return List<ProjectCostVo>
* @description
@ -137,4 +138,16 @@ public interface IAppMapper {
* @date 2024/4/1 19:12
*/
List<ProjectCostVo> 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);
}

View File

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

View File

@ -43,7 +43,8 @@
</select>
<!--人员管理-->
<select id="getPersonnelList" resultType="com.securitycontrol.entity.background.vo.HumanManageVo">
SELECT ttp.user_name AS userName,
SELECT ttp.user_id AS userId,
ttp.user_name AS userName,
ttp.phone,
ttp.id_number AS idNumber,
IF(ttp.status = '1','在场','离场') AS status
@ -124,4 +125,19 @@
curry_day AS expenditureDate
FROM tb_project_cost tpc WHERE tpc.bid_code = #{bidCode}
</select>
<!--获取人员出入状态-->
<select id="getUserAccessStatus" resultType="java.lang.String">
<if test="type == 1">
SELECT tdd.device_id
FROM tb_device_value tdv
LEFT JOIN tb_device_detail tdd ON tdv.attribute_id = tdd.id AND tdd.del_flag = 0
WHERE tdv.val = #{userId}
</if>
<if test="type == 2">
SELECT tdv.val
FROM tb_device_detail tdd
LEFT JOIN tb_device_value tdv ON tdd.id = tdv.attribute_id
WHERE tdd.device_id = #{userId} AND tdd.mode_name = #{accessType} AND tdd.del_flag = 0
</if>
</select>
</mapper>