项目库人员姓名工号

This commit is contained in:
caozhen
2023-09-11 17:42:30 +08:00
parent c47d8080f6
commit 407b346860
3 changed files with 28 additions and 2 deletions
@@ -6,6 +6,10 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.jero.modules.projectLibrary.entity.LawsProjectLibrary;
import com.jero.modules.projectLibrary.mapper.LawsProjectLibraryMapper;
import com.jero.modules.projectLibrary.service.ILawsProjectLibraryService;
import com.jero.modules.system.entity.SysUser;
import com.jero.modules.system.service.ISysUserService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.jero.common.exception.JeroBootException;
@@ -28,6 +32,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@Transactional(rollbackFor = JeroBootException.class)
public class LawsProjectLibraryServiceImpl extends ServiceImpl<LawsProjectLibraryMapper, LawsProjectLibrary> implements ILawsProjectLibraryService {
@Autowired
private ISysUserService sysUserService;
/**
* 分页查询
@@ -37,9 +43,24 @@ public class LawsProjectLibraryServiceImpl extends ServiceImpl<LawsProjectLibrar
HttpServletRequest req) {
QueryWrapper<LawsProjectLibrary> queryWrapper = QueryGenerator.initQueryWrapper(lawsProjectLibrary, req.getParameterMap());
Page<LawsProjectLibrary> page = new Page<>(pageNo, pageSize);
return page(page, queryWrapper);
Page<LawsProjectLibrary> libraryPage = page(page, queryWrapper);
this.voluation(libraryPage.getRecords());
return libraryPage;
}
/**
* 赋值姓名+工号
*/
private void voluation(List<LawsProjectLibrary> pageRecords){
for (LawsProjectLibrary pageRecord : pageRecords) {
String projectLeader = pageRecord.getProjectLeader();
if (StringUtils.isNotBlank(projectLeader)){
SysUser user = sysUserService.getById(projectLeader);
pageRecord.setNameWorkNo(user.getNameWorkNo());
}
}
}
/**
* 保存
*/