忘了提交了
This commit is contained in:
parent
2fd7323d79
commit
8361200034
42
pom.xml
42
pom.xml
|
@ -347,27 +347,27 @@
|
|||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!--office工具-->
|
||||
<dependency>
|
||||
<groupId>com.luhuiguo</groupId>
|
||||
<artifactId>aspose-words</artifactId>
|
||||
<version>23.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.luhuiguo</groupId>
|
||||
<artifactId>aspose-pdf</artifactId>
|
||||
<version>23.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.luhuiguo</groupId>
|
||||
<artifactId>aspose-cells</artifactId>
|
||||
<version>23.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.luhuiguo</groupId>
|
||||
<artifactId>aspose-slides</artifactId>
|
||||
<version>23.1</version>
|
||||
</dependency>
|
||||
<!--office工具 暂且使用第三方服务-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.luhuiguo</groupId>-->
|
||||
<!-- <artifactId>aspose-words</artifactId>-->
|
||||
<!-- <version>23.1</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.luhuiguo</groupId>-->
|
||||
<!-- <artifactId>aspose-pdf</artifactId>-->
|
||||
<!-- <version>23.1</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.luhuiguo</groupId>-->
|
||||
<!-- <artifactId>aspose-cells</artifactId>-->
|
||||
<!-- <version>23.1</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.luhuiguo</groupId>-->
|
||||
<!-- <artifactId>aspose-slides</artifactId>-->
|
||||
<!-- <version>23.1</version>-->
|
||||
<!-- </dependency>-->
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ spring.boot.admin.client:
|
|||
instance:
|
||||
service-host-type: IP
|
||||
username: ruoyi
|
||||
password: 123456
|
||||
password: Mz123456!
|
||||
|
||||
--- # snail-job 配置
|
||||
snail-job:
|
||||
|
|
|
@ -9,7 +9,7 @@ spring.boot.admin.client:
|
|||
instance:
|
||||
service-host-type: IP
|
||||
username: ruoyi
|
||||
password: 123456
|
||||
password: Mz123456!
|
||||
|
||||
--- # snail-job 配置
|
||||
snail-job:
|
||||
|
|
|
@ -6,7 +6,7 @@ spring.boot.admin.client:
|
|||
instance:
|
||||
service-host-type: IP
|
||||
username: ruoyi
|
||||
password: 123456
|
||||
password: Mz123456!
|
||||
|
||||
--- # snail-job 配置
|
||||
snail-job:
|
||||
|
|
|
@ -60,6 +60,16 @@ public class RegexValidator extends Validator {
|
|||
return isMatchRegex(ACCOUNT, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查输入的密码是否匹配预定义的规则
|
||||
*
|
||||
* @param value 要验证的密码
|
||||
* @return 如果密码符合规则,返回 true;否则,返回 false。
|
||||
*/
|
||||
public static boolean isPassword(CharSequence value) {
|
||||
return isMatchRegex(PASSWORD, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证输入的账号是否符合规则,如果不符合,则抛出 ValidateException 异常
|
||||
*
|
||||
|
|
|
@ -14,7 +14,7 @@ spring:
|
|||
security:
|
||||
user:
|
||||
name: ruoyi
|
||||
password: 123456
|
||||
password: Mz123456!
|
||||
boot:
|
||||
admin:
|
||||
ui:
|
||||
|
@ -42,4 +42,4 @@ spring.boot.admin.client:
|
|||
instance:
|
||||
service-host-type: IP
|
||||
username: ruoyi
|
||||
password: 123456
|
||||
password: Mz123456!
|
||||
|
|
|
@ -44,4 +44,4 @@ spring.boot.admin.client:
|
|||
instance:
|
||||
service-host-type: IP
|
||||
username: ruoyi
|
||||
password: 123456
|
||||
password: Mz123456!
|
||||
|
|
|
@ -44,4 +44,4 @@ spring.boot.admin.client:
|
|||
instance:
|
||||
service-host-type: IP
|
||||
username: ruoyi
|
||||
password: 123456
|
||||
password: Mz123456!
|
||||
|
|
|
@ -95,22 +95,22 @@
|
|||
<artifactId>ruoyi-common-websocket</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.luhuiguo</groupId>
|
||||
<artifactId>aspose-words</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.luhuiguo</groupId>
|
||||
<artifactId>aspose-pdf</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.luhuiguo</groupId>
|
||||
<artifactId>aspose-cells</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.luhuiguo</groupId>
|
||||
<artifactId>aspose-slides</artifactId>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.luhuiguo</groupId>-->
|
||||
<!-- <artifactId>aspose-words</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.luhuiguo</groupId>-->
|
||||
<!-- <artifactId>aspose-pdf</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.luhuiguo</groupId>-->
|
||||
<!-- <artifactId>aspose-cells</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.luhuiguo</groupId>-->
|
||||
<!-- <artifactId>aspose-slides</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
|
|
@ -47,12 +47,21 @@ public class SysOssResourceController extends BaseController {
|
|||
/**
|
||||
* 待审核查询列表
|
||||
*/
|
||||
@SaCheckPermission("file:textbook:awaitList")
|
||||
@SaCheckPermission("file:resource:awaitList")
|
||||
@GetMapping("/await/pageList")
|
||||
public TableDataInfo<SysOssResourceVo> awaitList(SysOssResourceBo bo, PageQuery pageQuery) {
|
||||
return sysOssResourceService.queryAwaitPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 待审核数量
|
||||
*/
|
||||
@SaCheckPermission("file:resource:review")
|
||||
@GetMapping("/await/count")
|
||||
public R<Long> awaitListCount(SysOssResourceBo bo) {
|
||||
return R.ok(sysOssResourceService.countAwaitList(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取专题资源文件详细信息
|
||||
*
|
||||
|
@ -89,6 +98,7 @@ public class SysOssResourceController extends BaseController {
|
|||
@PathVariable Long[] ossIds) {
|
||||
return toAjax(sysOssResourceService.deleteWithValidByIds(List.of(ossIds), true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核
|
||||
*
|
||||
|
@ -127,6 +137,7 @@ public class SysOssResourceController extends BaseController {
|
|||
|
||||
/**
|
||||
* 下载
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("file:resource:download")
|
||||
|
|
|
@ -53,6 +53,14 @@ public class SysOssTextbookController extends BaseController {
|
|||
return sysOssTextbookService.queryAwaitPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 待审核数量
|
||||
*/
|
||||
@SaCheckPermission("file:textbook:review")
|
||||
@GetMapping("/await/count")
|
||||
public R<Long> awaitListCount(SysOssTextbookBo bo) {
|
||||
return R.ok(sysOssTextbookService.countAwaitList(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取同步教材文件的详细信息
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package org.dromara.system.controller.portal;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import cn.hutool.core.lang.tree.Tree;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
@ -71,7 +70,7 @@ public class PortalController extends BaseController {
|
|||
*
|
||||
* @param showId 主键
|
||||
*/
|
||||
@SaCheckPermission("home:show:query")
|
||||
@SaIgnore
|
||||
@GetMapping("/show/{showId}")
|
||||
public R<SysHomeShowVo> getShowInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long showId) {
|
||||
|
|
|
@ -10,6 +10,7 @@ import jakarta.validation.constraints.NotNull;
|
|||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.constant.TenantConstants;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.utils.regex.RegexValidator;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.encrypt.annotation.ApiEncrypt;
|
||||
|
@ -91,6 +92,10 @@ public class SysTenantController extends BaseController {
|
|||
if (!tenantService.checkCompanyNameUnique(bo)) {
|
||||
return R.fail("新增租户'" + bo.getCompanyName() + "'失败,企业名称已存在");
|
||||
}
|
||||
String password = bo.getPassword();
|
||||
if (!RegexValidator.isPassword(password)) {
|
||||
return R.fail("密码复杂度不合规");
|
||||
}
|
||||
return toAjax(TenantHelper.ignore(() -> tenantService.insertByBo(bo)));
|
||||
}
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.dromara.common.core.domain.R;
|
|||
import org.dromara.common.core.domain.model.LoginUser;
|
||||
import org.dromara.common.core.utils.StreamUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.core.utils.regex.RegexValidator;
|
||||
import org.dromara.common.encrypt.annotation.ApiEncrypt;
|
||||
import org.dromara.common.excel.core.ExcelResult;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
|
@ -157,19 +158,22 @@ public class SysUserController extends BaseController {
|
|||
@PostMapping
|
||||
public R<Void> add(@Validated @RequestBody SysUserBo user) {
|
||||
deptService.checkDeptDataScope(user.getDeptId());
|
||||
String password = user.getPassword();
|
||||
if (!userService.checkUserNameUnique(user)) {
|
||||
return R.fail("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
|
||||
} else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) {
|
||||
return R.fail("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
|
||||
} else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) {
|
||||
return R.fail("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
||||
} else if (!RegexValidator.isPassword(password)) {
|
||||
return R.fail("新增用户'" + user.getUserName() + "'失败,密码复杂度不合规");
|
||||
}
|
||||
if (TenantHelper.isEnable()) {
|
||||
if (!tenantService.checkAccountBalance(TenantHelper.getTenantId())) {
|
||||
return R.fail("当前租户下用户名额不足,请联系管理员");
|
||||
}
|
||||
}
|
||||
user.setPassword(BCrypt.hashpw(user.getPassword()));
|
||||
user.setPassword(BCrypt.hashpw(password));
|
||||
return toAjax(userService.insertUser(user));
|
||||
}
|
||||
|
||||
|
@ -231,7 +235,11 @@ public class SysUserController extends BaseController {
|
|||
public R<Void> resetPwd(@RequestBody SysUserBo user) {
|
||||
userService.checkUserAllowed(user.getUserId());
|
||||
userService.checkUserDataScope(user.getUserId());
|
||||
user.setPassword(BCrypt.hashpw(user.getPassword()));
|
||||
String password = user.getPassword();
|
||||
if (!RegexValidator.isPassword(password)) {
|
||||
return R.fail("密码复杂度不合规");
|
||||
}
|
||||
user.setPassword(BCrypt.hashpw(password));
|
||||
return toAjax(userService.resetUserPwd(user.getUserId(), user.getPassword()));
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ public interface SysOssResourceMapper extends BaseMapperPlus<SysOssResource, Sys
|
|||
@DataColumn(key = "userName", value = "r.create_by")
|
||||
})
|
||||
Page<SysOssResourceVo> selectPageAwaitList(@Param("page") Page<SysOssTextbook> page,
|
||||
@Param(Constants.WRAPPER) Wrapper<SysOssTextbook> queryWrapper);
|
||||
@Param(Constants.WRAPPER) Wrapper<SysOssResource> queryWrapper);
|
||||
|
||||
int addDownloadNum(Long id);
|
||||
int addPreviewNum(Long id);
|
||||
|
|
|
@ -68,8 +68,10 @@ public interface ISysOssPersonService {
|
|||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
Boolean copyByBo(SysOssPersonBo bo);
|
||||
|
||||
Boolean moveByBo(SysOssPersonBo bo);
|
||||
|
||||
void download(Long id, HttpServletResponse response) throws Exception;
|
||||
|
||||
String preview(Long id);
|
||||
}
|
||||
|
|
|
@ -44,6 +44,13 @@ public interface ISysOssResourceService {
|
|||
*/
|
||||
TableDataInfo<SysOssResourceVo> queryAwaitPageList(SysOssResourceBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 待审核数量
|
||||
*
|
||||
* @param bo 查询条件
|
||||
*/
|
||||
Long countAwaitList(SysOssResourceBo bo);
|
||||
|
||||
/**
|
||||
* 查询符合条件的【请填写功能名称】列表
|
||||
*
|
||||
|
|
|
@ -44,6 +44,13 @@ public interface ISysOssTextbookService {
|
|||
*/
|
||||
TableDataInfo<SysOssTextbookVo> queryAwaitPageList(SysOssTextbookBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 待审核数量
|
||||
*
|
||||
* @param bo 查询条件
|
||||
*/
|
||||
Long countAwaitList(SysOssTextbookBo bo);
|
||||
|
||||
/**
|
||||
* 查询符合条件的【请填写功能名称】列表
|
||||
*
|
||||
|
@ -78,10 +85,13 @@ public interface ISysOssTextbookService {
|
|||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
Boolean reviewByBo(SysOssTextbookBo bo);
|
||||
|
||||
Boolean copyByBo(SysOssTextbookBo bo);
|
||||
|
||||
Boolean moveByBo(SysOssTextbookBo bo);
|
||||
|
||||
void download(Long id, HttpServletResponse response) throws Exception;
|
||||
|
||||
String preview(Long id);
|
||||
|
||||
}
|
||||
|
|
|
@ -17,7 +17,6 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|||
import org.dromara.common.mybatis.helper.DataBaseHelper;
|
||||
import org.dromara.system.domain.SysCatalogResource;
|
||||
import org.dromara.system.domain.SysOssResource;
|
||||
import org.dromara.system.domain.SysOssTextbook;
|
||||
import org.dromara.system.domain.bo.SysOssResourceBo;
|
||||
import org.dromara.system.domain.vo.SysCatalogResourceVo;
|
||||
import org.dromara.system.domain.vo.SysOssResourceVo;
|
||||
|
@ -74,7 +73,7 @@ public class SysOssResourceServiceImpl implements ISysOssResourceService {
|
|||
|
||||
@Override
|
||||
public TableDataInfo<SysOssResourceVo> queryAwaitPageList(SysOssResourceBo bo, PageQuery pageQuery) {
|
||||
QueryWrapper<SysOssTextbook> wrapper = Wrappers.query();
|
||||
QueryWrapper<SysOssResource> wrapper = Wrappers.query();
|
||||
wrapper.le("r.status", 0)
|
||||
.eq(StringUtils.isNotEmpty(bo.getFileSuffix()), "r.file_suffix", bo.getFileSuffix())
|
||||
.like(StringUtils.isNotEmpty(bo.getFileName()), "r.file_name", bo.getFileName())
|
||||
|
@ -83,6 +82,16 @@ public class SysOssResourceServiceImpl implements ISysOssResourceService {
|
|||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long countAwaitList(SysOssResourceBo bo) {
|
||||
QueryWrapper<SysOssResource> wrapper = Wrappers.query();
|
||||
|
||||
wrapper.eq("r.status", -1)
|
||||
.eq(StringUtils.isNotEmpty(bo.getFileSuffix()), "r.file_suffix", bo.getFileSuffix())
|
||||
.like(StringUtils.isNotEmpty(bo.getFileName()), "r.file_name", bo.getFileName());
|
||||
return baseMapper.selectCount(wrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的【请填写功能名称】列表
|
||||
*
|
||||
|
|
|
@ -2,7 +2,6 @@ package org.dromara.system.service.impl;
|
|||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
@ -10,12 +9,9 @@ import jakarta.servlet.http.HttpServletResponse;
|
|||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StreamUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.helper.DataBaseHelper;
|
||||
import org.dromara.system.domain.SysCatalogTextbook;
|
||||
import org.dromara.system.domain.SysOssTextbook;
|
||||
import org.dromara.system.domain.bo.SysOssTextbookBo;
|
||||
import org.dromara.system.domain.vo.SysCatalogTextbookVo;
|
||||
|
@ -79,19 +75,28 @@ public class SysOssTextbookServiceImpl implements ISysOssTextbookService {
|
|||
wrapper.le("ot.status", 0)
|
||||
.eq(StringUtils.isNotEmpty(bo.getFileSuffix()), "ot.file_suffix", bo.getFileSuffix())
|
||||
.like(StringUtils.isNotEmpty(bo.getFileName()), "ot.file_name", bo.getFileName())
|
||||
.and(ObjectUtil.isNotNull(bo.getCatalogId()), w -> {
|
||||
List<SysCatalogTextbook> list = catalogService.selectList(new LambdaQueryWrapper<SysCatalogTextbook>()
|
||||
.select(SysCatalogTextbook::getCatalogId)
|
||||
.apply(DataBaseHelper.findInSet(bo.getCatalogId(), "ancestors")));
|
||||
List<Long> ids = StreamUtils.toList(list, SysCatalogTextbook::getCatalogId);
|
||||
ids.add(bo.getCatalogId());
|
||||
w.in("ot.catalog_id", ids);
|
||||
})
|
||||
// .and(ObjectUtil.isNotNull(bo.getCatalogId()), w -> {
|
||||
// List<SysCatalogTextbook> list = catalogService.selectList(new LambdaQueryWrapper<SysCatalogTextbook>()
|
||||
// .select(SysCatalogTextbook::getCatalogId)
|
||||
// .apply(DataBaseHelper.findInSet(bo.getCatalogId(), "ancestors")));
|
||||
// List<Long> ids = StreamUtils.toList(list, SysCatalogTextbook::getCatalogId);
|
||||
// ids.add(bo.getCatalogId());
|
||||
// w.in("ot.catalog_id", ids);
|
||||
// })
|
||||
.orderByDesc("ot.create_time");
|
||||
Page<SysOssTextbookVo> result = baseMapper.selectPageAwaitList(pageQuery.build(), wrapper);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long countAwaitList(SysOssTextbookBo bo) {
|
||||
QueryWrapper<SysOssTextbook> wrapper = Wrappers.query();
|
||||
|
||||
wrapper.eq("ot.status", -1)
|
||||
.eq(StringUtils.isNotEmpty(bo.getFileSuffix()), "ot.file_suffix", bo.getFileSuffix())
|
||||
.like(StringUtils.isNotEmpty(bo.getFileName()), "ot.file_name", bo.getFileName());
|
||||
return baseMapper.selectCount(wrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的【请填写功能名称】列表
|
||||
|
|
Loading…
Reference in New Issue