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; 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 com.engine.organization.entity.hrmresource.vo.HrmResourceVO;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -15,5 +14,5 @@ import java.util.List;
**/ **/
public interface ResourceMapper { 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_comp c on t.company_id = c.id
left join jcl_org_hrmresource t1 on t.manager_id = t1.id left join jcl_org_hrmresource t1 on t.manager_id = t1.id
where 1 = 1 where 1 = 1
<include refid="likeSql"/> <if test="ids != null and ids.size > 0" >
<if test="param.departmentId != null and param.departmentId != ''"> AND t.id IN
and t.department_id = #{param.departmentId} <foreach collection="ids" open="(" item="id" separator="," close=")">
</if> #{id}
<if test="param.companyId != null and param.companyId != ''"> </foreach>
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> </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; order by t.id asc;
</select> </select>

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

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

@ -235,11 +235,9 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
ArrayList<MenuBtn> rightMenuList = new ArrayList<>(); 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("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("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); 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("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("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()); rightMenuList.add(MenuBtn.builder().isBatch("0").isTop("0").menuFun("custom").menuIcon("icon-coms-task-list").menuName("显示列定制").type("BTN_COLUMN").build());
btnDatas.put("rightMenu", rightMenuList); btnDatas.put("rightMenu", rightMenuList);
return btnDatas; return btnDatas;

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

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

Loading…
Cancel
Save