“导出修改”

pull/129/MERGE^2
Chengliang 3 years ago
parent 34715a05e7
commit 300ccd6d77

@ -15,5 +15,5 @@ import java.util.List;
**/
public interface ResourceMapper {
List<HrmResourceVO> listAll(@Param("param")HrmResourceSearchParam param);
List<HrmResourceVO> listAll(@Param("ids")List<Long> ids);
}

@ -16,29 +16,35 @@
left join JCL_ORG_DEPT d on t.department_id = d.id
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<>();
}

@ -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,7 @@ import javax.ws.rs.core.StreamingOutput;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.time.LocalDate;
import java.util.List;
/**
* @Author weaver_cl
@ -36,10 +38,11 @@ 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") List<Long> ids) {
//HrmResourceSearchParam param = buildResourceParam(request);
User user = HrmUserVarify.getUser(request, response);
XSSFWorkbook workbook = getExportCommonWrapper(user).resourceExport(param);
XSSFWorkbook workbook = getExportCommonWrapper(user).resourceExport(ids);
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