|
|
|
@ -18,6 +18,7 @@ import weaver.conn.RecordSet;
|
|
|
|
|
import weaver.general.BaseBean;
|
|
|
|
|
import weaver.general.PageIdConst;
|
|
|
|
|
import com.cloudstore.eccom.result.WeaResultMsg;
|
|
|
|
|
import weaver.general.StringUtil;
|
|
|
|
|
import weaver.general.Util;
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
@ -214,7 +215,12 @@ public class ResourceSnipServiceImpl extends Service implements ResourceSnipServ
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, List<HistoryResourcePO>> hrResource(String companyStartDate) {
|
|
|
|
|
public Map<String, List<HistoryResourcePO>> hrResource(Map<String, Object> param) {
|
|
|
|
|
|
|
|
|
|
String companyStartDate = Util.null2String(param.get("companyStartDate"));
|
|
|
|
|
String status = Util.null2String(param.get("status"));
|
|
|
|
|
String subcompanyId = Util.null2String(param.get("subcompanyId"));
|
|
|
|
|
String departmentId = Util.null2String(param.get("departmentId"));
|
|
|
|
|
|
|
|
|
|
Map<String, List<HistoryResourcePO>> resultMap = new HashMap<>(4);
|
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
@ -233,14 +239,35 @@ public class ResourceSnipServiceImpl extends Service implements ResourceSnipServ
|
|
|
|
|
String firstDayStr = firstDay.format(DATE_FORMATTER);
|
|
|
|
|
String lastDayStr = lastDay.format(DATE_FORMATTER);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rs.executeQuery("select a.id,a.workcode,a.lastname,a.birthday,a.sex,a.subcompanyid1,a.departmentid,a.managerid,a.companystartdate,\n" +
|
|
|
|
|
String sql = "select a.id,a.workcode,a.lastname,a.birthday,a.sex,a.subcompanyid1,a.departmentid,a.managerid,a.companystartdate,\n" +
|
|
|
|
|
"a.createdate,a.accumfundaccount,b."+account+" as account,b."+bankField+" as bankname,c."+femdate+" as femdate,\n" +
|
|
|
|
|
"a.startdate,a.enddate,a.jobtitle,a.status,a.educationlevel,a.mobile,a.certificatenum,\n" +
|
|
|
|
|
"a.nativeplace,b."+regresidentplace+" as regresidentplace from hrmresource a\n" +
|
|
|
|
|
"left join cus_fielddata b on a.id = b.id and b.scopeid = 1\n" +
|
|
|
|
|
"left join cus_fielddata c on a.id = c.id and c.scopeid = -1\n" +
|
|
|
|
|
"where a.companystartdate <= '"+lastDayStr+"'");
|
|
|
|
|
"where a.companystartdate <= '"+lastDayStr+"'";
|
|
|
|
|
|
|
|
|
|
if (!StringUtil.isEmpty(subcompanyId) && !StringUtil.isEmpty(departmentId)) {
|
|
|
|
|
sql += " and (a.subcompanyid1 = "+subcompanyId+" or a.departmentid ="+departmentId+")";
|
|
|
|
|
} else if (!StringUtil.isEmpty(subcompanyId)) {
|
|
|
|
|
sql += " and a.subcompanyid1 ="+subcompanyId;
|
|
|
|
|
}else if (!StringUtil.isEmpty(departmentId)) {
|
|
|
|
|
sql += " and a.departmentid ="+departmentId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!"9".equals(status)) {
|
|
|
|
|
//在职
|
|
|
|
|
if ("8".equals(status)) {
|
|
|
|
|
sql += " and a.status < 4";
|
|
|
|
|
}else {
|
|
|
|
|
sql += " and a.status = "+status;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rs.executeQuery(sql);
|
|
|
|
|
|
|
|
|
|
List<HistoryResourcePO> historyResourceList = new ArrayList<>();
|
|
|
|
|
while (rs.next()) {
|
|
|
|
@ -334,19 +361,21 @@ public class ResourceSnipServiceImpl extends Service implements ResourceSnipServ
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
resultMap.put("data",filteredList);
|
|
|
|
|
return resultMap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public XSSFWorkbook hrResourceExport(HttpServletRequest request, HttpServletResponse response, String companyStartDate) {
|
|
|
|
|
public XSSFWorkbook hrResourceExport(HttpServletRequest request, HttpServletResponse response, Map<String, Object> param) {
|
|
|
|
|
BaseBean bb = new BaseBean();
|
|
|
|
|
|
|
|
|
|
String companyStartDate = Util.null2String(param.get("companyStartDate"));
|
|
|
|
|
//全字段导出
|
|
|
|
|
List<Object> headerList = Arrays.asList("编号","姓名","出生日期","性别","分部","部门","岗位","直接上级","入职日期","离职日期","状态","创建日期","公积金账户","工资账户","工资银行","首次参保时间",
|
|
|
|
|
"合同开始日期","合同结束日期","学历","电话","身份证号","籍贯","户口所在地");
|
|
|
|
|
|
|
|
|
|
Map<String, List<HistoryResourcePO>> stringMap = hrResource(companyStartDate);
|
|
|
|
|
Map<String, List<HistoryResourcePO>> stringMap = hrResource(param);
|
|
|
|
|
List<HistoryResourcePO> historyResourcePOS = stringMap.get("data");
|
|
|
|
|
|
|
|
|
|
List<List<Object>> rows = new LinkedList<>();
|
|
|
|
|