forked from dyf/fys-Multi-tenant
文件管理代码优化
This commit is contained in:
@ -23,4 +23,8 @@ public class AppFileVo {
|
||||
* 文件url
|
||||
*/
|
||||
private String fileUrl;
|
||||
/**
|
||||
* 文件类型(1:操作说明,2:产品参数)
|
||||
*/
|
||||
private Long fileType;
|
||||
}
|
||||
|
@ -172,6 +172,7 @@ public class AppUserServiceImpl implements IAppUserService {
|
||||
appUserVo.setNickName(user.getNickName());
|
||||
appUserVo.setGender(user.getSex());
|
||||
appUserVo.setPhone(user.getPhonenumber());
|
||||
appUserVo.setRegion(user.getRegion());
|
||||
if(user.getAvatar() != null){
|
||||
SysOssVo oss = sysOssService.getById(user.getAvatar());
|
||||
if(oss != null){
|
||||
@ -192,8 +193,11 @@ public class AppUserServiceImpl implements IAppUserService {
|
||||
AppUser updUser= new AppUser();
|
||||
updUser.setUserId(appUser.getUserId());
|
||||
updUser.setNickName(bo.getNickName());
|
||||
SysOssVo oss = sysOssService.upload(bo.getFile());
|
||||
updUser.setAvatar(oss.getOssId());
|
||||
if(bo.getFile() != null){
|
||||
SysOssVo oss = sysOssService.upload(bo.getFile());
|
||||
updUser.setAvatar(oss.getOssId());
|
||||
}
|
||||
|
||||
updUser.setRegion(bo.getRegion());
|
||||
updUser.setSex(bo.getGender());
|
||||
return baseMapper.update(updUser, new LambdaQueryWrapper<AppUser>().eq(AppUser::getUserId, appUser.getUserId()));
|
||||
|
@ -5,16 +5,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<mapper namespace="com.fuyuanshen.app.mapper.AppBusinessFileMapper">
|
||||
|
||||
<select id="queryAppFileList" resultType="com.fuyuanshen.app.domain.vo.AppFileVo">
|
||||
select a.id,a.business_id,a.file_id,b.file_name,b.url fileUrl from app_business_file a left join sys_oss b on a.file_id = b.oss_id
|
||||
select a.id,a.business_id,a.file_id,b.file_name,b.url fileUrl,a.file_type from app_business_file a left join sys_oss b on a.file_id = b.oss_id
|
||||
where
|
||||
<if test="createBy != null">
|
||||
a.create_by = #{createBy}
|
||||
</if>
|
||||
<if test="businessId != null">
|
||||
and a.business_id = #{businessId}
|
||||
</if>
|
||||
<if test="fileId != null">
|
||||
and a.file_id = #{fileId}
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
a.create_by = #{createBy}
|
||||
<if test="fileType != null">
|
||||
and a.file_type = #{fileType}
|
||||
</if>
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
|
Reference in New Issue
Block a user