Ver Fonte

1、常用功能模块调整
2、验证签名密码

dzx há 1 ano atrás
pai
commit
5c325fd1ef

+ 14 - 0
src/main/java/com/xjrsoft/module/organization/controller/UserController.java

@@ -666,4 +666,18 @@ public class UserController {
         }
         return RT.ok(list.get(0).getFileUrl());
     }
+
+    @GetMapping("/check-signpassword")
+    @ApiOperation(value = "验证登录者的签名密码")
+    public RT<Boolean> checkSignpassword(@Valid @RequestBody UploadSignDto dto) {
+        long loginIdAsLong = StpUtil.getLoginIdAsLong();
+        User user = userService.getById(loginIdAsLong);
+        if(user.getSignFolderId() != null && user.getSignFolderId() != dto.getFolderId()){
+            return RT.error("未上传签名");
+        }
+        if (!BCrypt.checkpw(dto.getSignPassword(), user.getSignPassword())) {
+            return RT.error("密码填写错误!");
+        }
+        return RT.ok(true);
+    }
 }

+ 9 - 0
src/main/java/com/xjrsoft/module/organization/dto/CheckSignPasswordDto.java

@@ -0,0 +1,9 @@
+package com.xjrsoft.module.organization.dto;
+
+import lombok.Data;
+
+@Data
+public class CheckSignPasswordDto {
+    private Long signFolderId;
+    private String signPassword;
+}

+ 2 - 1
src/main/java/com/xjrsoft/module/system/controller/SystemMenuCommonlyUsedController.java

@@ -74,6 +74,7 @@ public class SystemMenuCommonlyUsedController {
     public RT<List<SystemMenuCommonlyUsedPageVo>> noPage(@Valid SystemMenuCommonlyUsedPageDto dto) {
 
         MPJLambdaWrapper<SystemMenuCommonlyUsed> queryWrapper = MPJWrappers.<SystemMenuCommonlyUsed>lambdaJoin()
+                .distinct()
                 .orderByDesc(SystemMenuCommonlyUsed::getId)
                 .select(SystemMenuCommonlyUsed.class, x -> VoToColumnUtil.fieldsToColumns(SystemMenuCommonlyUsedPageVo.class).contains(x.getProperty()))
                 .select("t.id",SystemMenuCommonlyUsedPageVo::getId)
@@ -96,7 +97,7 @@ public class SystemMenuCommonlyUsedController {
     @ApiOperation(value = "删除常用功能设置")
     @SaCheckPermission("systemmenucommonlyused:delete")
     public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
-        return RT.ok(systemMenuCommonlyUsedService.removeBatchByIds(ids));
+        return RT.ok(systemMenuCommonlyUsedService.removeByMenuId(ids));
     }
 
     @GetMapping(value = "/info")

+ 1 - 0
src/main/java/com/xjrsoft/module/system/service/ISystemMenuCommonlyUsedService.java

@@ -14,4 +14,5 @@ import java.util.List;
 */
 
 public interface ISystemMenuCommonlyUsedService extends MPJBaseService<SystemMenuCommonlyUsed> {
+    Boolean removeByMenuId(List<Long> ids);
 }

+ 9 - 0
src/main/java/com/xjrsoft/module/system/service/impl/SystemMenuCommonlyUsedServiceImpl.java

@@ -1,5 +1,7 @@
 package com.xjrsoft.module.system.service.impl;
 
+import cn.dev33.satoken.stp.StpUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.yulichang.base.MPJBaseServiceImpl;
 import com.xjrsoft.module.system.entity.SystemMenuCommonlyUsed;
@@ -22,4 +24,11 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 @Service
 @AllArgsConstructor
 public class SystemMenuCommonlyUsedServiceImpl extends MPJBaseServiceImpl<SystemMenuCommonlyUsedMapper, SystemMenuCommonlyUsed> implements ISystemMenuCommonlyUsedService {
+    @Override
+    public Boolean removeByMenuId(List<Long> ids) {
+        return this.remove(
+            new QueryWrapper<SystemMenuCommonlyUsed>().lambda()
+            .eq(SystemMenuCommonlyUsed::getCreateUserId, StpUtil.getLoginIdAsLong()).in(SystemMenuCommonlyUsed::getMenuId, ids)
+        );
+    }
 }