部门台账和岗位台账列表增加附件字段并支持跳转

山西国药控股有限公司
Chengliang 1 month ago
parent 418a302fcb
commit 91d1c3a149

@ -10,6 +10,7 @@ import com.engine.organization.mapper.department.DepartmentMapper;
import com.engine.organization.util.db.MapperProxyFactory; import com.engine.organization.util.db.MapperProxyFactory;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import weaver.conn.RecordSet;
import weaver.file.ImageFileManager; import weaver.file.ImageFileManager;
import weaver.general.Util; import weaver.general.Util;
import weaver.hrm.company.DepartmentComInfo; import weaver.hrm.company.DepartmentComInfo;
@ -39,10 +40,11 @@ public class DepartmentBO {
} }
public static void setDeptLeader(List<DepartmentListDTO> departments) { public static void setDeptLeader(List<DepartmentListDTO> departments) {
for (DepartmentListDTO dept : departments) { for (DepartmentListDTO dept : departments) {
dept.setBmfzr(getEmployeeNameById(dept.getId())); 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(); List<DepartmentListDTO> children = dept.getChildren();
if (CollectionUtils.isNotEmpty(children)){ if (CollectionUtils.isNotEmpty(children)){
setDeptLeader(children); setDeptLeader(children);
@ -233,8 +235,19 @@ public class DepartmentBO {
/** /**
* *
*/ */
private Map<String,String> getImageFileName(Integer depetId){ public static Map<String,String> getImageFileName(Integer depetId){
return null;
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") @TableTitle(labelId = 17616, title = "附件上传", dataIndex = "imageFileName", key = "imageFileName")
private String 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.transmethod.JobTransMethod;
import com.engine.organization.util.db.MapperProxyFactory; import com.engine.organization.util.db.MapperProxyFactory;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import weaver.conn.RecordSet;
import weaver.general.Util; import weaver.general.Util;
import weaver.hrm.job.JobTitlesComInfo; import weaver.hrm.job.JobTitlesComInfo;
@ -93,6 +94,7 @@ public class JobBO {
.build()).collect(Collectors.toList()); .build()).collect(Collectors.toList());
List<String> usedIds = MapperProxyFactory.getProxy(JobMapper.class).listUsedId(); 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)); 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 -> { return dtoList.stream().peek(e -> {
List<JobListDTO> childList = collects.get(e.getId()); List<JobListDTO> childList = collects.get(e.getId());
if (CollectionUtils.isNotEmpty(childList)) { if (CollectionUtils.isNotEmpty(childList)) {
@ -172,4 +174,7 @@ public class JobBO {
} }
return MapperProxyFactory.getProxy(JobMapper.class).getJobById(jobId); return MapperProxyFactory.getProxy(JobMapper.class).getJobById(jobId);
} }
} }

@ -89,6 +89,14 @@ public class JobListDTO {
//@TableTitle(title = "是否启用", dataIndex = "forbiddenTag", key = "forbiddenTag") //@TableTitle(title = "是否启用", dataIndex = "forbiddenTag", key = "forbiddenTag")
//private Integer 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 com.engine.organization.util.tree.SearchTreeUtil;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import weaver.conn.RecordSet;
import weaver.general.StringUtil; import weaver.general.StringUtil;
import weaver.general.Util; import weaver.general.Util;
import weaver.hrm.User; 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()); jobListDTOS = jobListDTOS.stream().sorted(Comparator.comparingDouble(JobListDTO::getShowOrder).reversed()).collect(Collectors.toList());
} }
List<JobListDTO> subList = PageUtil.subList(param.getCurrent(), param.getPageSize(), jobListDTOS); 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 = new PageInfo<>(user, subList, JobListDTO.class);
pageInfos.setTotal(jobListDTOS.size()); pageInfos.setTotal(jobListDTOS.size());
} else { } else {
// 组合list // 组合list
List<JobListDTO> jobListDTOS = JobBO.buildDTOList(allList); List<JobListDTO> jobListDTOS = JobBO.buildDTOList(allList);
List<JobListDTO> subList = PageUtil.subList(param.getCurrent(), param.getPageSize(), jobListDTOS); 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 = new PageInfo<>(user, subList, JobListDTO.class);
pageInfos.setTotal(jobListDTOS.size()); 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…
Cancel
Save