Commit 4e4b2ac6 by huangjinxin

Merge remote-tracking branch 'origin/develop' into develop

2 parents 5c875dce e9c0347f
...@@ -40,8 +40,10 @@ public class MsgController { ...@@ -40,8 +40,10 @@ public class MsgController {
MsgQuery request) { MsgQuery request) {
CommonUtil.setNullValue(request); CommonUtil.setNullValue(request);
request.setUserId(userId); request.setUserId(userId);
if (!"is_read".equalsIgnoreCase(request.getSort())) { if (!"isRead".equalsIgnoreCase(request.getSort())) {
request.setSort("create_time"); request.setSort("create_time");
} else {
request.setSort("is_read");
} }
if (!"asc".equalsIgnoreCase(request.getSortType())) { if (!"asc".equalsIgnoreCase(request.getSortType())) {
request.setSortType("desc"); request.setSortType("desc");
...@@ -63,7 +65,7 @@ public class MsgController { ...@@ -63,7 +65,7 @@ public class MsgController {
* @date 2023/10/24 * @date 2023/10/24
*/ */
@PostMapping("/msg/delete") @PostMapping("/msg/delete")
public Result<Boolean> delete(@RequestHeader(name = "userId", required = true) String userId, @RequestBody @Valid IdDTO dto) { public Result<Boolean> delete(@RequestHeader(name = "userId", required = true) String userId, @RequestBody @Valid MsgDTO.IdDTO dto) {
AssertUtil.isNotEmpty(userId, "用户ID不能为空"); AssertUtil.isNotEmpty(userId, "用户ID不能为空");
AssertUtil.isNotNull(dto.getId(), "消息ID不能为空"); AssertUtil.isNotNull(dto.getId(), "消息ID不能为空");
msgService.delete(dto.getId(), userId); msgService.delete(dto.getId(), userId);
......
...@@ -69,8 +69,8 @@ public interface MsgDao extends JpaRepository<MsgEntity, Integer> { ...@@ -69,8 +69,8 @@ public interface MsgDao extends JpaRepository<MsgEntity, Integer> {
" join sys_user_org uo on u.id=uo.user_id" + " join sys_user_org uo on u.id=uo.user_id" +
" join sys_user_role ur on ur.user_id=u.id" + " join sys_user_role ur on ur.user_id=u.id" +
" join sys_role r on r.id=ur.role_id and r.name='分站派工'" + " join sys_role r on r.id=ur.role_id and r.name='分站派工'" +
" and IF(:groupId is not null, uo.org_id=:groupId and uo.org_level=2, 1=1)" + " and IF(:groupId is not null, ((uo.org_id=:groupId and uo.org_level=2) or (uo.org_id=:branchId and uo.org_level=1) or (uo.org_id=:clusterId and uo.org_level=0)), 1=1)" +
" and IF(:groupId is null and :branchId is not null, uo.org_id=:branchId and uo.org_level=1, 1=1)" + " and IF(:groupId is null and :branchId is not null, ((uo.org_id=:branchId and uo.org_level=1) or (uo.org_id=:clusterId and uo.org_level=0)), 1=1)" +
" and IF(:groupId is null and :branchId is null and :clusterId is not null, uo.org_id=:clusterId and uo.org_level=0, 1=1)" " and IF(:groupId is null and :branchId is null and :clusterId is not null, uo.org_id=:clusterId and uo.org_level=0, 1=1)"
, nativeQuery = true // 开启原生sql , nativeQuery = true // 开启原生sql
) )
......
package com.dituhui.pea.order.dto;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* 公共 id类
*
* @author RenPing
* @date 2023/10/26
*/
@Data
public class IdDTO {
@NotNull(message = "ID不能为空")
private Integer id;
}
...@@ -49,4 +49,12 @@ public class MsgDTO { ...@@ -49,4 +49,12 @@ public class MsgDTO {
@Min(value = 0, message = "标签类型格式不对") @Min(value = 0, message = "标签类型格式不对")
@Max(value = 1, message = "标签类型格式不对") @Max(value = 1, message = "标签类型格式不对")
private Integer tag; private Integer tag;
@Data
public static class IdDTO {
@NotNull(message = "ID不能为空")
private Integer id;
}
} }
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!