增加根据username"登陆账号"返回"用户名(工号)方法,用在文档比对列表回显

This commit is contained in:
caozhen
2023-09-20 17:15:39 +08:00
parent 73b67d7f75
commit 25e8f2f367
3 changed files with 24 additions and 1 deletions
@@ -337,4 +337,9 @@ public interface ISysUserService extends IService<SysUser> {
* @return
*/
List<String> LawsWorkingGroupUserSearch(String userName, String userWorkNo, String userRoleName, String userPostName);
/**
* 根据username"登陆账号"返回"用户名(工号)"
*/
String getNameNoByUsername(String userName);
}
@@ -673,6 +673,19 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
return userRoles.stream().map(SysUser::getId).distinct().collect(Collectors.toList());
}
@Override
public String getNameNoByUsername(String userName) {
if (StringUtils.isBlank(userName)){
return "";
}
LambdaQueryWrapper<SysUser> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SysUser::getUsername, userName);
wrapper.eq(SysUser::getDelFlag, "0");
wrapper.last("limit 1");
SysUser sysUser = getOne(wrapper);
return sysUser == null ? userName : sysUser.getUsername() + "" + sysUser.getWorkNo() + "";
}
@Override
@Transactional(rollbackFor = Exception.class)
@@ -23,6 +23,7 @@ import com.jero.modules.laws.standard.entity.LawsOverseasStandard;
import com.jero.modules.laws.standard.service.ILawsEnterpriseStandardService;
import com.jero.modules.laws.standard.service.ILawsDomesticStandardService;
import com.jero.modules.laws.standard.service.ILawsOverseasStandardService;
import com.jero.modules.system.service.ISysUserService;
import com.jero.modules.system.util.MyStringUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -63,6 +64,8 @@ public class SarFileCompareInfoController extends JeroController<SarFileCompareI
private ILawsOverseasStandardService lawsOverseasStandardService; //海外标准
@Autowired
private ILawsEnterpriseStandardService ILawsEnterpriseStandardService; //企业标准
@Autowired
private ISysUserService sysUserService;
/**
* 分页列表查询
@@ -100,7 +103,7 @@ public class SarFileCompareInfoController extends JeroController<SarFileCompareI
info.setReleaseStateTitle(ReleaseConditionEnum.getTextByValue(info.getReleaseState(), cut));
info.setFileTypeLeft(getFileTypeText(info.getFileTypeLeft(), cut));
info.setFileTypeRight(getFileTypeText(info.getFileTypeRight(), cut));
//根据左右标准编号赋值标准ID、标准来源4个字段值
//根据左右标准编号赋值标准ID、标准来源4个字段值,补充创建人
this.assignment(info);
}
return Result.OK(pageList);
@@ -147,6 +150,8 @@ public class SarFileCompareInfoController extends JeroController<SarFileCompareI
}
}
}
String nameNoByUsername = sysUserService.getNameNoByUsername(info.getCreateBy());
info.setCreateBy(nameNoByUsername);
}
private String getFileTypeText(String fileType, String cut) {