fix: 微信小程序接口对接修改。

This commit is contained in:
tianyongbao
2026-01-12 00:33:59 +08:00
parent e8fbb37062
commit 750e5351b3
13 changed files with 531 additions and 25 deletions

View File

@@ -71,7 +71,7 @@ public class DeviceController extends BaseController {
/**
* 新增设备管理
*/
@SaCheckPermission("fishery:device:add")
// @SaCheckPermission("fishery:device:add")
@Log(title = "设备管理", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()

View File

@@ -38,7 +38,7 @@ public class MessageOpRecordController extends BaseController {
/**
* 查询用户操作记录列表
*/
@SaCheckPermission("fishery:messageOpRecord:list")
// @SaCheckPermission("fishery:messageOpRecord:list")
@GetMapping("/list")
public TableDataInfo<MessageOpRecordVo> list(MessageOpRecordBo bo, PageQuery pageQuery) {
return messageOpRecordService.queryPageList(bo, pageQuery);

View File

@@ -1,7 +1,9 @@
package com.intc.fishery.controller;
import java.util.List;
import java.util.Map;
import com.intc.common.excel.utils.ExcelUtil;
import com.intc.common.satoken.utils.LoginHelper;
import lombok.RequiredArgsConstructor;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.*;
@@ -38,7 +40,7 @@ public class MessageWarnController extends BaseController {
/**
* 查询设备告警记录列表
*/
@SaCheckPermission("fishery:messageWarn:list")
// @SaCheckPermission("fishery:messageWarn:list")
@GetMapping("/list")
public TableDataInfo<MessageWarnVo> list(MessageWarnBo bo, PageQuery pageQuery) {
return messageWarnService.queryPageList(bo, pageQuery);
@@ -101,4 +103,21 @@ public class MessageWarnController extends BaseController {
@PathVariable Long[] ids) {
return toAjax(messageWarnService.deleteWithValidByIds(List.of(ids), true));
}
/**
* 已读一条消息
*/
@PutMapping("/read")
public R<Void> readMessage(@RequestParam("id") Long id) {
return toAjax(messageWarnService.readMessage(id));
}
/**
* 已读全部消息
*/
@PutMapping("/read/all")
public R<Void> readAllMessages() {
Long userId = LoginHelper.getUserId();
return toAjax(messageWarnService.readAllMessages(userId));
}
}

View File

@@ -39,7 +39,7 @@ public class PayOrderController extends BaseController {
/**
* 查询充值订单列表
*/
@SaCheckPermission("fishery:payOrder:list")
// @SaCheckPermission("fishery:payOrder:list")
@GetMapping("/list")
public TableDataInfo<PayOrderVo> list(PayOrderBo bo, PageQuery pageQuery) {
return payOrderService.queryPageList(bo, pageQuery);

View File

@@ -69,7 +69,7 @@ public class PondController extends BaseController {
*
* @param id 主键
*/
@SaCheckPermission("fishery:pond:query")
// @SaCheckPermission("fishery:pond:query")
@GetMapping("/{id}")
public R<PondVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long id) {
@@ -120,7 +120,7 @@ public class PondController extends BaseController {
/**
* 修改塘口管理
*/
@SaCheckPermission("fishery:pond:edit")
// @SaCheckPermission("fishery:pond:edit")
@Log(title = "塘口管理", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
@@ -133,7 +133,7 @@ public class PondController extends BaseController {
*
* @param ids 主键串
*/
@SaCheckPermission("fishery:pond:remove")
// @SaCheckPermission("fishery:pond:remove")
@Log(title = "塘口管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")

View File

@@ -65,4 +65,20 @@ public interface IMessageWarnService {
* @return 是否删除成功
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
/**
* 已读一条消息
*
* @param id 消息ID
* @return 是否成功
*/
Boolean readMessage(Long id);
/**
* 已读全部消息
*
* @param userId 用户ID
* @return 是否成功
*/
Boolean readAllMessages(Long userId);
}

View File

@@ -197,4 +197,38 @@ public class MessageWarnServiceImpl implements IMessageWarnService {
}
return baseMapper.deleteByIds(ids) > 0;
}
/**
* 已读一条消息
*
* @param id 消息ID
* @return 是否成功
*/
@Override
public Boolean readMessage(Long id) {
MessageWarn messageWarn = baseMapper.selectById(id);
if (messageWarn == null) {
return false;
}
messageWarn.setIsRead(1);
return baseMapper.updateById(messageWarn) > 0;
}
/**
* 已读全部消息
*
* @param userId 用户ID
* @return 是否成功
*/
@Override
public Boolean readAllMessages(Long userId) {
MessageWarn update = new MessageWarn();
update.setIsRead(1);
LambdaQueryWrapper<MessageWarn> wrapper = Wrappers.lambdaQuery(MessageWarn.class)
.eq(MessageWarn::getUserId, userId)
.eq(MessageWarn::getIsRead, 0);
return baseMapper.update(update, wrapper) > 0;
}
}