Compare commits

5 Commits

Author SHA1 Message Date
5f36c25550 内容(报警信息) 2025-09-20 14:35:23 +08:00
9058dcfcb1 设备告警 2025-09-20 11:45:11 +08:00
3e19cd9db2 设置图片路径 2025-09-19 09:43:52 +08:00
397f227bfb Merge branch 'dyf-device' into 6170 2025-09-18 15:26:04 +08:00
1b2bf542fa 个人中心修改密码2 2025-09-18 15:25:32 +08:00
10 changed files with 46 additions and 22 deletions

View File

@ -1,6 +1,7 @@
package com.fuyuanshen.app.controller; package com.fuyuanshen.app.controller;
import com.fuyuanshen.app.model.AppRegisterBody; import com.fuyuanshen.app.model.AppRegisterBody;
import com.fuyuanshen.app.model.AppUpdatePasswordBody;
import com.fuyuanshen.app.service.AppLoginService; import com.fuyuanshen.app.service.AppLoginService;
import com.fuyuanshen.app.service.AppRegisterService; import com.fuyuanshen.app.service.AppRegisterService;
import com.fuyuanshen.common.core.domain.R; import com.fuyuanshen.common.core.domain.R;
@ -38,7 +39,7 @@ public class AppUserCenterController {
* 修改密码 * 修改密码
*/ */
@PostMapping("/updatePassword") @PostMapping("/updatePassword")
public R<Void> updatePassword(@Validated @RequestBody AppRegisterBody body) { public R<Void> updatePassword(@Validated @RequestBody AppUpdatePasswordBody body) {
registerService.updatePassword(body); registerService.updatePassword(body);
return R.ok(); return R.ok();
} }

View File

@ -0,0 +1,12 @@
package com.fuyuanshen.app.model;
import lombok.Data;
@Data
public class AppUpdatePasswordBody {
/**
* 登录密码
*/
private String password;
}

View File

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.fuyuanshen.app.domain.AppUser; import com.fuyuanshen.app.domain.AppUser;
import com.fuyuanshen.app.mapper.AppUserMapper; import com.fuyuanshen.app.mapper.AppUserMapper;
import com.fuyuanshen.app.model.AppRegisterBody; import com.fuyuanshen.app.model.AppRegisterBody;
import com.fuyuanshen.app.model.AppUpdatePasswordBody;
import com.fuyuanshen.common.core.constant.Constants; import com.fuyuanshen.common.core.constant.Constants;
import com.fuyuanshen.common.core.constant.GlobalConstants; import com.fuyuanshen.common.core.constant.GlobalConstants;
import com.fuyuanshen.common.core.domain.model.RegisterBody; import com.fuyuanshen.common.core.domain.model.RegisterBody;
@ -144,7 +145,7 @@ public class AppRegisterService {
userMapper.update(updateWrapper); userMapper.update(updateWrapper);
} }
public void updatePassword(AppRegisterBody body) { public void updatePassword(AppUpdatePasswordBody body) {
String username = AppLoginHelper.getUsername(); String username = AppLoginHelper.getUsername();
String password = body.getPassword(); String password = body.getPassword();
UpdateWrapper<AppUser> updateWrapper = new UpdateWrapper<>(); UpdateWrapper<AppUser> updateWrapper = new UpdateWrapper<>();

View File

@ -38,7 +38,6 @@ import static com.fuyuanshen.global.mqtt.constants.DeviceRedisKeyConstants.*;
@Slf4j @Slf4j
public class BjqAlarmRule implements MqttMessageRule { public class BjqAlarmRule implements MqttMessageRule {
private final IDeviceAlarmService deviceAlarmService; private final IDeviceAlarmService deviceAlarmService;
private final DeviceService deviceService; private final DeviceService deviceService;
@ -89,6 +88,8 @@ public class BjqAlarmRule implements MqttMessageRule {
deviceAlarmBo.setFinishTime(new Date()); deviceAlarmBo.setFinishTime(new Date());
String durationBetween = DurationUtils.getDurationBetween(deviceAlarmVo.getStartTime(), deviceAlarmBo.getFinishTime()); String durationBetween = DurationUtils.getDurationBetween(deviceAlarmVo.getStartTime(), deviceAlarmBo.getFinishTime());
deviceAlarmBo.setDurationTime(durationBetween); deviceAlarmBo.setDurationTime(durationBetween);
// 0已处理1未处理
deviceAlarmBo.setTreatmentState(0);
deviceAlarmService.updateByBo(deviceAlarmBo); deviceAlarmService.updateByBo(deviceAlarmBo);
} }
} }

View File

@ -126,9 +126,8 @@ public class AppPasswordAuthStrategy implements IAuthStrategy {
.eq(AppUser::getUserType, UserType.APP_USER.getUserType())); .eq(AppUser::getUserType, UserType.APP_USER.getUserType()));
if (ObjectUtil.isNull(user)) { if (ObjectUtil.isNull(user)) {
log.info("登录用户:{} 不存在.", username); log.info("登录用户:{} 不存在.", username);
// throw new UserException("user.not.exists", phonenumber); throw new UserException("user.not.exists", username);
// 新增AppUser用户
return null;
} else if (SystemConstants.DISABLE.equals(user.getStatus())) { } else if (SystemConstants.DISABLE.equals(user.getStatus())) {
log.info("登录用户:{} 已被停用.", username); log.info("登录用户:{} 已被停用.", username);
throw new UserException("user.blocked", username); throw new UserException("user.blocked", username);

View File

@ -68,12 +68,12 @@ public class DeviceAlarm extends TenantEntity {
/** /**
* 经度 * 经度
*/ */
private Long longitude; private Double longitude;
/** /**
* 纬度 * 纬度
*/ */
private Long latitude; private Double latitude;
/** /**
* 报警位置 * 报警位置
@ -99,7 +99,7 @@ public class DeviceAlarm extends TenantEntity {
* 0已处理1未处理 * 0已处理1未处理
* treatment_state * treatment_state
*/ */
private Long treatmentState; private Integer treatmentState;
/** /**

View File

@ -63,7 +63,7 @@ public class DeviceAlarmBo extends TenantEntity {
private String dataSource; private String dataSource;
/** /**
* 内容 * 内容(报警信息)
*/ */
private String content; private String content;

View File

@ -267,9 +267,13 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
// 处理上传的图片 // 处理上传的图片
if (deviceForm.getFile() != null) { if (deviceForm.getFile() != null) {
SysOssVo upload = ossService.upload(deviceForm.getFile());
// 设置图片路径 // 设置图片路径
deviceForm.setDevicePic(upload.getUrl()); SysOssVo oss = ossService.upload(deviceForm.getFile());
// 强制将HTTP替换为HTTPS
if (oss.getUrl() != null && oss.getUrl().startsWith("http://")) {
oss.setUrl(oss.getUrl().replaceFirst("^http://", "https://"));
}
deviceForm.setDevicePic(oss.getUrl());
} }
// 更新字段 // 更新字段

View File

@ -6,17 +6,21 @@
<!-- 查询设备告警列表 --> <!-- 查询设备告警列表 -->
<select id="selectVoPage" resultType="com.fuyuanshen.equipment.domain.vo.DeviceAlarmVo"> <select id="selectVoPage" resultType="com.fuyuanshen.equipment.domain.vo.DeviceAlarmVo">
select da.*, d.device_mac as deviceMac, d.device_imei as deviceImei, select da.*, d.device_mac as deviceMac, d.device_imei as deviceImei,d.device_name as deviceName,
d.device_type as deviceType,
d.type_name as deviceTypeName, d.device_pic as devicePic d.type_name as deviceTypeName, d.device_pic as devicePic
from device_alarm da from device_alarm da
left join device d on da.device_id = d.id left join device d on da.device_id = d.id
left join device_type dt on dt.id = da.device_type left join device_type dt on dt.id = d.device_type
<where> <where>
<if test="bo.content != null">
and d.device_name like concat('%', #{bo.content}, '%') or dt.type_name like concat('%', #{bo.content}, '%')
</if>
<if test="bo.deviceName != null"> <if test="bo.deviceName != null">
and da.device_name = #{bo.deviceName} and d.device_name like concat('%', #{bo.deviceName}, '%')
</if> </if>
<if test="bo.deviceType != null"> <if test="bo.deviceType != null">
and da.device_type = #{bo.deviceType} and dt.id = #{bo.deviceType}
</if> </if>
<if test="bo.deviceAction != null"> <if test="bo.deviceAction != null">
and da.device_action = #{bo.deviceAction} and da.device_action = #{bo.deviceAction}

View File

@ -351,13 +351,13 @@
<!-- 获取告警信息 --> <!-- 获取告警信息 -->
<select id="getAlarmInformation" resultType="com.fuyuanshen.equipment.domain.vo.AlarmInformationVo"> <select id="getAlarmInformation" resultType="com.fuyuanshen.equipment.domain.vo.AlarmInformationVo">
SELECT (SELECT COUNT(1) FROM device_alarm WHERE treatment_state = 0) AS alarmsTotal SELECT (SELECT COUNT(1) FROM device_alarm) AS alarmsTotal
, (SELECT COUNT(1) , (SELECT COUNT(1)
FROM device_alarm FROM device_alarm
WHERE treatment_state = 0) AS processingAlarm WHERE treatment_state = 0) AS processingAlarm
, (SELECT COUNT(1) , (SELECT COUNT(1)
FROM device_alarm FROM device_alarm
WHERE treatment_state = 0 AND WHERE
DATE (create_time) = CURDATE()) AS alarmsTotalToday DATE (create_time) = CURDATE()) AS alarmsTotalToday
, ( , (
SELECT COUNT (1) SELECT COUNT (1)
@ -425,7 +425,9 @@
<!-- 根据设备IMEI查询设备 --> <!-- 根据设备IMEI查询设备 -->
<select id="selectDeviceByImei" resultType="com.fuyuanshen.equipment.domain.Device"> <select id="selectDeviceByImei" resultType="com.fuyuanshen.equipment.domain.Device">
SELECT * FROM device WHERE device_imei = #{deviceImei} SELECT *
FROM device
WHERE device_imei = #{deviceImei}
</select> </select>
</mapper> </mapper>