Merge pull request '部门台账和岗位台账列表增加附件字段并支持跳转' (#295) from 山西国药控股有限公司 into feature/cl
Reviewed-on: http://221.226.25.34:3000/liang.cheng/weaver-hrm-organization/pulls/295
This commit is contained in:
commit
2581f58cf5
|
|
@ -10,6 +10,7 @@ import com.engine.organization.mapper.department.DepartmentMapper;
|
|||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.file.ImageFileManager;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.company.DepartmentComInfo;
|
||||
|
|
@ -39,10 +40,11 @@ public class DepartmentBO {
|
|||
}
|
||||
|
||||
public static void setDeptLeader(List<DepartmentListDTO> departments) {
|
||||
|
||||
for (DepartmentListDTO dept : departments) {
|
||||
dept.setBmfzr(getEmployeeNameById(dept.getId()));
|
||||
|
||||
Map<String, String> data = getImageFileName(dept.getId());
|
||||
dept.setImageFileName(data.get("imageFileName"));
|
||||
dept.setImageFileId(data.get("imageFileId"));
|
||||
List<DepartmentListDTO> children = dept.getChildren();
|
||||
if (CollectionUtils.isNotEmpty(children)){
|
||||
setDeptLeader(children);
|
||||
|
|
@ -233,8 +235,19 @@ public class DepartmentBO {
|
|||
/**
|
||||
* 获取部门自定义表字段(附件)显示值 跳转链接
|
||||
*/
|
||||
private Map<String,String> getImageFileName(Integer depetId){
|
||||
return null;
|
||||
public static Map<String,String> getImageFileName(Integer depetId){
|
||||
|
||||
RecordSet rs = new RecordSet();
|
||||
Map<String,String> data = new HashMap<>(2);
|
||||
rs.executeQuery("select a.fjsc,b.imagefilename from hrmdepartmentdefined a \n" +
|
||||
" left join imagefile b on a.fjsc = b.imagefileid\n" +
|
||||
" where a.deptid = ?",depetId);
|
||||
if (rs.next()) {
|
||||
data.put("imageFileName",Util.null2String(rs.getString("imagefilename")));
|
||||
data.put("imageFileId",Util.null2String(rs.getString("fjsc")));
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ public class DepartmentListDTO {
|
|||
@TableTitle(labelId = 17616, title = "附件上传", dataIndex = "imageFileName", key = "imageFileName")
|
||||
private String imageFileName;
|
||||
|
||||
private String fileUrl;
|
||||
private String imageFileId;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import com.engine.organization.mapper.job.JobMapper;
|
|||
import com.engine.organization.transmethod.JobTransMethod;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.job.JobTitlesComInfo;
|
||||
|
||||
|
|
@ -93,6 +94,7 @@ public class JobBO {
|
|||
.build()).collect(Collectors.toList());
|
||||
List<String> usedIds = MapperProxyFactory.getProxy(JobMapper.class).listUsedId();
|
||||
Map<Long, List<JobListDTO>> collects = dtoList.stream().filter(item -> null != item.getParentJob() && 0 != item.getParentJob()).collect(Collectors.groupingBy(JobListDTO::getParentJob));
|
||||
|
||||
return dtoList.stream().peek(e -> {
|
||||
List<JobListDTO> childList = collects.get(e.getId());
|
||||
if (CollectionUtils.isNotEmpty(childList)) {
|
||||
|
|
@ -172,4 +174,7 @@ public class JobBO {
|
|||
}
|
||||
return MapperProxyFactory.getProxy(JobMapper.class).getJobById(jobId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,6 +89,14 @@ public class JobListDTO {
|
|||
//@TableTitle(title = "是否启用", dataIndex = "forbiddenTag", key = "forbiddenTag")
|
||||
//private Integer forbiddenTag;
|
||||
|
||||
/**
|
||||
* 附件上传
|
||||
*/
|
||||
@TableTitle(labelId = 17616, title = "附件上传", dataIndex = "imageFileName", key = "imageFileName")
|
||||
private String imageFileName;
|
||||
|
||||
private String imageFileId;
|
||||
|
||||
/**
|
||||
* 操作列
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ import com.engine.organization.util.page.PageUtil;
|
|||
import com.engine.organization.util.tree.SearchTreeUtil;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.StringUtil;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
|
|
@ -170,12 +171,26 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
jobListDTOS = jobListDTOS.stream().sorted(Comparator.comparingDouble(JobListDTO::getShowOrder).reversed()).collect(Collectors.toList());
|
||||
}
|
||||
List<JobListDTO> subList = PageUtil.subList(param.getCurrent(), param.getPageSize(), jobListDTOS);
|
||||
//QC
|
||||
subList.forEach(jobListDTO -> {
|
||||
Map<String, String> data = getImageFileName(jobListDTO.getId());
|
||||
jobListDTO.setImageFileName(data.get("imageFileName"));
|
||||
jobListDTO.setImageFileId(data.get("imageFileId"));
|
||||
});
|
||||
|
||||
pageInfos = new PageInfo<>(user, subList, JobListDTO.class);
|
||||
pageInfos.setTotal(jobListDTOS.size());
|
||||
} else {
|
||||
// 组合list
|
||||
List<JobListDTO> jobListDTOS = JobBO.buildDTOList(allList);
|
||||
List<JobListDTO> subList = PageUtil.subList(param.getCurrent(), param.getPageSize(), jobListDTOS);
|
||||
//QC
|
||||
subList.forEach(jobListDTO -> {
|
||||
Map<String, String> data = getImageFileName(jobListDTO.getId());
|
||||
jobListDTO.setImageFileName(data.get("imageFileName"));
|
||||
jobListDTO.setImageFileId(data.get("imageFileId"));
|
||||
});
|
||||
|
||||
pageInfos = new PageInfo<>(user, subList, JobListDTO.class);
|
||||
pageInfos.setTotal(jobListDTOS.size());
|
||||
}
|
||||
|
|
@ -786,4 +801,25 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取岗位表(jcl_org_job)新增字段(附件上传)显示值 跳转链接
|
||||
*/
|
||||
private Map<String,String> getImageFileName(Long id){
|
||||
|
||||
RecordSet rs = new RecordSet();
|
||||
String uploadFile = rs.getPropValue("hrmOrganization", "uploadFile");
|
||||
|
||||
Map<String,String> data = new HashMap<>(2);
|
||||
rs.executeQuery("select b.imagefileid,b.imagefilename from jcl_org_job a \n" +
|
||||
" left join imagefile b on a."+uploadFile+" = b.imagefileid\n" +
|
||||
" where a.id = ?;",id);
|
||||
if (rs.next()) {
|
||||
data.put("imageFileName",Util.null2String(rs.getString("imagefilename")));
|
||||
data.put("imageFileId",Util.null2String(rs.getString("imagefileid")));
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue