diff --git a/src/com/engine/organization/entity/department/bo/DepartmentBO.java b/src/com/engine/organization/entity/department/bo/DepartmentBO.java index 7b539883..3a457800 100644 --- a/src/com/engine/organization/entity/department/bo/DepartmentBO.java +++ b/src/com/engine/organization/entity/department/bo/DepartmentBO.java @@ -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 departments) { - for (DepartmentListDTO dept : departments) { dept.setBmfzr(getEmployeeNameById(dept.getId())); - + Map data = getImageFileName(dept.getId()); + dept.setImageFileName(data.get("imageFileName")); + dept.setImageFileId(data.get("imageFileId")); List children = dept.getChildren(); if (CollectionUtils.isNotEmpty(children)){ setDeptLeader(children); @@ -233,8 +235,19 @@ public class DepartmentBO { /** * 获取部门自定义表字段(附件)显示值 跳转链接 */ - private Map getImageFileName(Integer depetId){ - return null; + public static Map getImageFileName(Integer depetId){ + + RecordSet rs = new RecordSet(); + Map 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; } } diff --git a/src/com/engine/organization/entity/department/dto/DepartmentListDTO.java b/src/com/engine/organization/entity/department/dto/DepartmentListDTO.java index 913d45a2..85a2fb51 100644 --- a/src/com/engine/organization/entity/department/dto/DepartmentListDTO.java +++ b/src/com/engine/organization/entity/department/dto/DepartmentListDTO.java @@ -91,7 +91,7 @@ public class DepartmentListDTO { @TableTitle(labelId = 17616, title = "附件上传", dataIndex = "imageFileName", key = "imageFileName") private String imageFileName; - private String fileUrl; + private String imageFileId; /** diff --git a/src/com/engine/organization/entity/job/bo/JobBO.java b/src/com/engine/organization/entity/job/bo/JobBO.java index e9b5c209..bdf0c4f8 100644 --- a/src/com/engine/organization/entity/job/bo/JobBO.java +++ b/src/com/engine/organization/entity/job/bo/JobBO.java @@ -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 usedIds = MapperProxyFactory.getProxy(JobMapper.class).listUsedId(); Map> collects = dtoList.stream().filter(item -> null != item.getParentJob() && 0 != item.getParentJob()).collect(Collectors.groupingBy(JobListDTO::getParentJob)); + return dtoList.stream().peek(e -> { List childList = collects.get(e.getId()); if (CollectionUtils.isNotEmpty(childList)) { @@ -172,4 +174,7 @@ public class JobBO { } return MapperProxyFactory.getProxy(JobMapper.class).getJobById(jobId); } + + + } diff --git a/src/com/engine/organization/entity/job/dto/JobListDTO.java b/src/com/engine/organization/entity/job/dto/JobListDTO.java index 25f07db3..f0e51e9d 100644 --- a/src/com/engine/organization/entity/job/dto/JobListDTO.java +++ b/src/com/engine/organization/entity/job/dto/JobListDTO.java @@ -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; + /** * 操作列 */ diff --git a/src/com/engine/organization/service/impl/JobServiceImpl.java b/src/com/engine/organization/service/impl/JobServiceImpl.java index b4a23232..fb0d9dc4 100644 --- a/src/com/engine/organization/service/impl/JobServiceImpl.java +++ b/src/com/engine/organization/service/impl/JobServiceImpl.java @@ -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 subList = PageUtil.subList(param.getCurrent(), param.getPageSize(), jobListDTOS); + //QC + subList.forEach(jobListDTO -> { + Map 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 jobListDTOS = JobBO.buildDTOList(allList); List subList = PageUtil.subList(param.getCurrent(), param.getPageSize(), jobListDTOS); + //QC + subList.forEach(jobListDTO -> { + Map 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 getImageFileName(Long id){ + + RecordSet rs = new RecordSet(); + String uploadFile = rs.getPropValue("hrmOrganization", "uploadFile"); + + Map 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; + } + }