Merge branch 'develop' of https://gitee.com/jmlcl/weaver-hrm-organization into feature/dxf

pull/130/MERGE^2
dxfeng 3 years ago
commit c8b93b70b4

@ -1,7 +1,6 @@
package com.engine.organization.mapper.resource;
import com.engine.organization.entity.hrmresource.param.HrmResourceSearchParam;
import com.engine.organization.entity.hrmresource.po.HrmResourcePO;
import com.engine.organization.entity.hrmresource.vo.HrmResourceVO;
import org.apache.ibatis.annotations.Param;
@ -15,5 +14,5 @@ import java.util.List;
**/
public interface ResourceMapper {
List<HrmResourceVO> listAll(@Param("param")HrmResourceSearchParam param);
List<HrmResourceVO> listAll(@Param("ids")List<Long> ids);
}

@ -17,28 +17,35 @@
left join jcl_org_comp c on t.company_id = c.id
left join jcl_org_hrmresource t1 on t.manager_id = t1.id
where 1 = 1
<include refid="likeSql"/>
<if test="param.departmentId != null and param.departmentId != ''">
and t.department_id = #{param.departmentId}
</if>
<if test="param.companyId != null and param.companyId != ''">
and t.company_id = #{param.companyId}
</if>
<if test="param.mobile != null and param.mobile != ''">
and t.mobile = #{param.mobile}
</if>
<if test="param.telephone != null and param.telephone != ''">
and t.telephone = #{param.telephone}
</if>
<if test="param.managerId != null and param.managerId != ''">
and t.manager_id = #{param.managerId}
</if>
<if test="param.mobileCall != null and param.mobileCall != ''">
and t.mobile_call = #{param.mobileCall}
</if>
<if test="param.jobTitle != null and param.jobTitle != ''">
and t.job_title = #{param.jobTitle}
<if test="ids != null and ids.size > 0" >
AND t.id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</if>
<!--<include refid="likeSql"/>-->
<!--<if test="param.departmentId != null and param.departmentId != ''">-->
<!--and t.department_id = #{param.departmentId}-->
<!--</if>-->
<!--<if test="param.companyId != null and param.companyId != ''">-->
<!--and t.company_id = #{param.companyId}-->
<!--</if>-->
<!--<if test="param.mobile != null and param.mobile != ''">-->
<!--and t.mobile = #{param.mobile}-->
<!--</if>-->
<!--<if test="param.telephone != null and param.telephone != ''">-->
<!--and t.telephone = #{param.telephone}-->
<!--</if>-->
<!--<if test="param.managerId != null and param.managerId != ''">-->
<!--and t.manager_id = #{param.managerId}-->
<!--</if>-->
<!--<if test="param.mobileCall != null and param.mobileCall != ''">-->
<!--and t.mobile_call = #{param.mobileCall}-->
<!--</if>-->
<!--<if test="param.jobTitle != null and param.jobTitle != ''">-->
<!--and t.job_title = #{param.jobTitle}-->
<!--</if>-->
order by t.id asc;
</select>

@ -3,6 +3,8 @@ package com.engine.organization.service;
import com.engine.organization.entity.hrmresource.param.HrmResourceSearchParam;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import java.util.List;
/**
* @Author weaver_cl
* @Description:
@ -13,8 +15,8 @@ public interface ExportCommonService {
/**
*
* @param param
* @param ids
* @return
*/
XSSFWorkbook resourceExport(HrmResourceSearchParam param);
XSSFWorkbook resourceExport(List<Long> ids);
}

@ -21,11 +21,9 @@ import java.util.*;
public class ExportCommonServiceImpl extends Service implements ExportCommonService {
@Override
public XSSFWorkbook resourceExport(HrmResourceSearchParam param) {
public XSSFWorkbook resourceExport(List<Long> ids) {
param.setPageSize(null);
param.setCurrent(null);
List<HrmResourceVO> hrmResourceVOS = MapperProxyFactory.getProxy(ResourceMapper.class).listAll(param);
List<HrmResourceVO> hrmResourceVOS = MapperProxyFactory.getProxy(ResourceMapper.class).listAll(ids);
if (hrmResourceVOS == null) {
hrmResourceVOS = new ArrayList<>();
}

@ -235,11 +235,9 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
ArrayList<MenuBtn> rightMenuList = new ArrayList<>();
topMenuList.add(MenuBtn.builder().isBatch("1").isTop("1").menuFun("new").menuIcon("icon-coms-New-Flow").menuName("新建人员").type("BTN_Addnew").build());
topMenuList.add(MenuBtn.builder().isBatch("1").isTop("1").menuFun("import").menuIcon("icon-coms-leading-in").menuName("导入人员").type("BTN_Import").build());
topMenuList.add(MenuBtn.builder().isBatch("1").isTop("1").menuFun("export").menuIcon("icon-coms02-coms2-export").menuName("全部导出").type("BTN_Export").build());
btnDatas.put("topMenu", topMenuList);
rightMenuList.add(MenuBtn.builder().isBatch("1").isTop("1").menuFun("new").menuIcon("icon-coms-New-Flow").menuName("新建人员").type("BTN_Addnew").build());
rightMenuList.add(MenuBtn.builder().isBatch("1").isTop("1").menuFun("import").menuIcon("icon-coms-leading-in").menuName("导入人员").type("BTN_Import").build());
rightMenuList.add(MenuBtn.builder().isBatch("1").isTop("1").menuFun("export").menuIcon("icon-coms02-coms2-export").menuName("全部导出").type("BTN_Export").build());
rightMenuList.add(MenuBtn.builder().isBatch("0").isTop("0").menuFun("custom").menuIcon("icon-coms-task-list").menuName("显示列定制").type("BTN_COLUMN").build());
btnDatas.put("rightMenu", rightMenuList);
return btnDatas;

@ -13,6 +13,7 @@ import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
@ -20,6 +21,10 @@ import javax.ws.rs.core.StreamingOutput;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* @Author weaver_cl
@ -36,10 +41,15 @@ public class ExportCommonController {
@GET
@Path("/resource/export")
@Produces(MediaType.APPLICATION_OCTET_STREAM)
public Response resourceExport(@Context HttpServletRequest request, @Context HttpServletResponse response) {
HrmResourceSearchParam param = buildResourceParam(request);
public Response resourceExport(@Context HttpServletRequest request, @Context HttpServletResponse response,
@QueryParam("ids") String ids) {
//HrmResourceSearchParam param = buildResourceParam(request);
List<Long> idList = new ArrayList<>();
if (StringUtils.isNotBlank(ids)){
idList = Arrays.stream(ids.split(",")).map(Long::parseLong).collect(Collectors.toList());
}
User user = HrmUserVarify.getUser(request, response);
XSSFWorkbook workbook = getExportCommonWrapper(user).resourceExport(param);
XSSFWorkbook workbook = getExportCommonWrapper(user).resourceExport(idList);
String time = LocalDate.now().toString();
String fileName = "人员导出" + time;
try {

@ -2,12 +2,13 @@ package com.engine.organization.wrapper;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.organization.entity.hrmresource.param.HrmResourceSearchParam;
import com.engine.organization.service.ExportCommonService;
import com.engine.organization.service.impl.ExportCommonServiceImpl;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import weaver.hrm.User;
import java.util.List;
/**
* @Author weaver_cl
* @Description:
@ -20,7 +21,7 @@ public class ExportCommonWrapper extends Service {
return ServiceUtil.getService(ExportCommonServiceImpl.class,user);
}
public XSSFWorkbook resourceExport(HrmResourceSearchParam param) {
return getExportCommonService(user).resourceExport(param);
public XSSFWorkbook resourceExport(List<Long> ids) {
return getExportCommonService(user).resourceExport(ids);
}
}

Loading…
Cancel
Save