diff --git a/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java b/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java index ba0f7df9a..ca393d5df 100644 --- a/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java @@ -75,10 +75,12 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.springframework.beans.BeanUtils; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.StopWatch; +import weaver.conn.RecordSet; import weaver.conn.mybatis.MyBatisFactory; import weaver.general.BaseBean; import weaver.general.Util; import weaver.hrm.User; +import weaver.wechat.util.Utils; import java.math.BigDecimal; import java.text.SimpleDateFormat; @@ -3707,6 +3709,20 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService } page = getAuthService(user).auth(page, AuthFilterTypeEnum.DATA_OPT, InsuranceArchivesEmployeePO.class); + List empIds = page.stream().map(InsuranceArchivesEmployeePO::getEmployeeId).distinct().collect(Collectors.toList()); + // 路维光电二开,入职日期取自定义新增字段 + RecordSet rs = new RecordSet(); + List> partition = Lists.partition(empIds, 800); + HashMap rzrqMap = new HashMap<>(); + partition.forEach(par -> { + String sql = "SELECT id,field13 FROM cus_fielddata where scopeid=3 and SCOPE='HrmCustomFieldByInfoType' and id in ("+ StringUtils.join(par, ",") + ")"; + rs.execute(sql); + while (rs.next()) { + rzrqMap.put(SalaryEntityUtil.string2Long(rs.getString("id")), rs.getString("field13")); + } + }); + page.stream().forEach(emp -> emp.setCompanystartdate(Utils.null2String(rzrqMap.get(emp.getEmployeeId())))); + PageInfo pageInfo = SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), page, InsuranceArchivesEmployeePO.class); diff --git a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java index 1c11ad7f4..1b44f9171 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java @@ -68,9 +68,11 @@ import org.apache.poi.util.IOUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.springframework.beans.BeanUtils; import org.springframework.transaction.annotation.Transactional; +import weaver.conn.RecordSet; import weaver.file.ImageFileManager; import weaver.general.Util; import weaver.hrm.User; +import weaver.wechat.util.Utils; import java.io.InputStream; import java.math.BigDecimal; @@ -468,6 +470,20 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe // return map; // }).collect(Collectors.toList()); Map longTaxAgentPOMap = SalaryEntityUtil.convert2Map(taxAgentLists, TaxAgentPO::getId); + + // 路维光电二开,入职日期取自定义新增字段 + RecordSet rs = new RecordSet(); + List employeeIds = salaryArchives.stream().map(SalaryArchiveListDTO::getEmployeeId).distinct().collect(Collectors.toList()); + List> partition = Lists.partition(employeeIds, 800); + HashMap rzrqMap = new HashMap<>(); + partition.forEach(par -> { + String sql = "SELECT id,field13 FROM cus_fielddata where scopeid=3 and SCOPE='HrmCustomFieldByInfoType' and id in ("+ StringUtils.join(par, ",") + ")"; + rs.execute(sql); + while (rs.next()) { + rzrqMap.put(SalaryEntityUtil.string2Long(rs.getString("id")), rs.getString("field13")); + } + }); + // 3.组装数据 List> listMaps = new ArrayList<>(); salaryArchives.forEach(e -> { @@ -495,7 +511,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe map.put("employeeStatus", e.getEmployeeStatus()); map.put("payStartDate", SalaryDateUtil.getFormatLocalDate(e.getPayStartDate())); map.put("payEndDate", SalaryDateUtil.getFormatLocalDate(e.getPayEndDate())); - map.put("companystartdate", e.getCompanystartdate()); + map.put("companystartdate", Utils.null2String(rzrqMap.get(e.getEmployeeId()))); map.put("dismissdate", e.getDismissdate()); map.put("opts", e.getOpts()); diff --git a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java index 0a1e9dbe6..f63ea4618 100644 --- a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java @@ -48,6 +48,7 @@ import org.apache.commons.lang3.math.NumberUtils; import weaver.conn.RecordSet; import weaver.general.Util; import weaver.hrm.User; +import weaver.wechat.util.Utils; import java.util.*; import java.util.stream.Collectors; @@ -208,6 +209,18 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee employeeList = employeeList.stream().filter(e -> e.getAccountType() == null || e.getAccountType() == 0).collect(Collectors.toList()); } + // 路维光电二开,入职日期取自定义新增字段 + RecordSet rs = new RecordSet(); + List> partition = Lists.partition(ids, 800); + HashMap rzrqMap = new HashMap<>(); + partition.forEach(par -> { + String sql = "SELECT id,field13 FROM cus_fielddata where scopeid=3 and SCOPE='HrmCustomFieldByInfoType' and id in ("+ StringUtils.join(par, ",") + ")"; + rs.execute(sql); + while (rs.next()) { + rzrqMap.put(SalaryEntityUtil.string2Long(rs.getString("id")), rs.getString("field13")); + } + }); + employeeList.stream().forEach(emp -> emp.setCompanystartdate(Utils.null2String(rzrqMap.get(emp.getEmployeeId())))); SalaryI18nUtil.i18nList(employeeList); return employeeList; }