diff --git a/src/com/engine/salary/component/Page.java b/src/com/engine/salary/component/Page.java new file mode 100644 index 000000000..a23215bfb --- /dev/null +++ b/src/com/engine/salary/component/Page.java @@ -0,0 +1,170 @@ +package com.engine.salary.component; + + +import java.util.ArrayList; +import java.util.List; + +public class Page extends ArrayList { + private static final long serialVersionUID = 1L; + + /** + * 页码,从1开始 + */ + private int pageNum; + /** + * 页面大小 + */ + private int pageSize; + /** + * 起始行 + */ + private int startRow; + /** + * 末行 + */ + private int endRow; + /** + * 总数 + */ + private long total; + /** + * 总页数 + */ + private int pages; + /** + * 包含count查询 + */ + private boolean count = true; + /** + * 分页合理化 + */ + private Boolean reasonable; + /** + * 当设置为true的时候,如果pagesize设置为0(或RowBounds的limit=0),就不执行分页,返回全部结果 + */ + private Boolean pageSizeZero; + + public Page() { + super(); + } + + + /** + * int[] rowBounds + * 0 : offset + * 1 : limit + */ + public Page(int[] rowBounds, boolean count) { + super(0); + if (rowBounds[0] == 0 && rowBounds[1] == Integer.MAX_VALUE) { + pageSizeZero = true; + this.pageSize = 0; + } else { + this.pageSize = rowBounds[1]; + this.pageNum = rowBounds[1] != 0 ? (int) (Math.ceil(((double) rowBounds[0] + rowBounds[1]) / rowBounds[1])) : 0; + } + this.startRow = rowBounds[0]; + this.count = count; + this.endRow = this.startRow + rowBounds[1]; + } + + public List getResult() { + return this; + } + + public int getPages() { + return pages; + } + + + public int getEndRow() { + return endRow; + } + + + public int getPageNum() { + return pageNum; + } + + + public int getPageSize() { + return pageSize; + } + + + public int getStartRow() { + return startRow; + } + + + public long getTotal() { + return total; + } + + public void setTotal(long total) { + this.total = total; + if (total == -1) { + pages = 1; + return; + } + if (pageSize > 0) { + pages = (int) (total / pageSize + ((total % pageSize == 0) ? 0 : 1)); + } else { + pages = 0; + } + //分页合理化,针对不合理的页码自动处理 + if ((reasonable != null && reasonable) && pageNum > pages) { + pageNum = pages; + calculateStartAndEndRow(); + } + } + + public Boolean getReasonable() { + return reasonable; + } + + + public Boolean getPageSizeZero() { + return pageSizeZero; + } + + + /** + * 计算起止行号 + */ + private void calculateStartAndEndRow() { + this.startRow = this.pageNum > 0 ? (this.pageNum - 1) * this.pageSize : 0; + this.endRow = this.startRow + this.pageSize * (this.pageNum > 0 ? 1 : 0); + } + + public boolean isCount() { + return this.count; + } + + + /** + * 转换为PageInfo + * + * @return + */ + public PageInfo toPageInfo() { + PageInfo pageInfo = new PageInfo(this); + return pageInfo; + } + + + @Override + public String toString() { + return "Page{" + + "count=" + count + + ", pageNum=" + pageNum + + ", pageSize=" + pageSize + + ", startRow=" + startRow + + ", endRow=" + endRow + + ", total=" + total + + ", pages=" + pages + + ", reasonable=" + reasonable + + ", pageSizeZero=" + pageSizeZero + + '}'; + } +} \ No newline at end of file diff --git a/src/com/engine/salary/component/PageInfo.java b/src/com/engine/salary/component/PageInfo.java new file mode 100644 index 000000000..6a630a6e4 --- /dev/null +++ b/src/com/engine/salary/component/PageInfo.java @@ -0,0 +1,380 @@ +package com.engine.salary.component; + + +import java.io.Serializable; +import java.util.Collection; +import java.util.List; + +/** + * 对Page 结果进行包装 + * pageHelper的替代 + *

Copyright: Copyright (c) 2024

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public class PageInfo implements Serializable { + private static final long serialVersionUID = 1L; + //当前页 + private int pageNum; + //每页的数量 + private int pageSize; + //当前页的数量 + private int size; + + //由于startRow和endRow不常用,这里说个具体的用法 + //可以在页面中"显示startRow到endRow 共size条数据" + + //当前页面第一个元素在数据库中的行号 + private int startRow; + //当前页面最后一个元素在数据库中的行号 + private int endRow; + //总记录数 + private long total; + //总页数 + private int pages; + //结果集 + private List list; + + //前一页 + private int prePage; + //下一页 + private int nextPage; + + //是否为第一页 + private boolean isFirstPage = false; + //是否为最后一页 + private boolean isLastPage = false; + //是否有前一页 + private boolean hasPreviousPage = false; + //是否有下一页 + private boolean hasNextPage = false; + //导航页码数 + private int navigatePages; + //所有导航页号 + private int[] navigatepageNums; + //导航条上的第一页 + private int navigateFirstPage; + //导航条上的最后一页 + private int navigateLastPage; + + public PageInfo() { + } + + /** + * 包装Page对象 + * + * @param list + */ + public PageInfo(List list) { + this(list, 8); + } + + /** + * 包装Page对象 + * + * @param list page结果 + * @param navigatePages 页码数量 + */ + public PageInfo(List list, int navigatePages) { + if (list instanceof Page) { + Page page = (Page) list; + this.pageNum = page.getPageNum(); + this.pageSize = page.getPageSize(); + + this.pages = page.getPages(); + this.list = page; + this.size = page.size(); + this.total = page.getTotal(); + //由于结果是>startRow的,所以实际的需要+1 + if (this.size == 0) { + this.startRow = 0; + this.endRow = 0; + } else { + this.startRow = page.getStartRow() + 1; + //计算实际的endRow(最后一页的时候特殊) + this.endRow = this.startRow - 1 + this.size; + } + } else if (list instanceof Collection) { + this.pageNum = 1; + this.pageSize = list.size(); + + this.pages = 1; + this.list = list; + this.size = list.size(); + this.total = list.size(); + this.startRow = 0; + this.endRow = list.size() > 0 ? list.size() - 1 : 0; + } + if (list instanceof Collection) { + this.navigatePages = navigatePages; + //计算导航页 + calcNavigatepageNums(); + //计算前后页,第一页,最后一页 + calcPage(); + //判断页面边界 + judgePageBoudary(); + } + } + + /** + * 计算导航页 + */ + private void calcNavigatepageNums() { + //当总页数小于或等于导航页码数时 + if (pages <= navigatePages) { + navigatepageNums = new int[pages]; + for (int i = 0; i < pages; i++) { + navigatepageNums[i] = i + 1; + } + } else { //当总页数大于导航页码数时 + navigatepageNums = new int[navigatePages]; + int startNum = pageNum - navigatePages / 2; + int endNum = pageNum + navigatePages / 2; + + if (startNum < 1) { + startNum = 1; + //(最前navigatePages页 + for (int i = 0; i < navigatePages; i++) { + navigatepageNums[i] = startNum++; + } + } else if (endNum > pages) { + endNum = pages; + //最后navigatePages页 + for (int i = navigatePages - 1; i >= 0; i--) { + navigatepageNums[i] = endNum--; + } + } else { + //所有中间页 + for (int i = 0; i < navigatePages; i++) { + navigatepageNums[i] = startNum++; + } + } + } + } + + /** + * 计算前后页,第一页,最后一页 + */ + private void calcPage() { + if (navigatepageNums != null && navigatepageNums.length > 0) { + navigateFirstPage = navigatepageNums[0]; + navigateLastPage = navigatepageNums[navigatepageNums.length - 1]; + if (pageNum > 1) { + prePage = pageNum - 1; + } + if (pageNum < pages) { + nextPage = pageNum + 1; + } + } + } + + /** + * 判定页面边界 + */ + private void judgePageBoudary() { + isFirstPage = pageNum == 1; + isLastPage = pageNum == pages; + hasPreviousPage = pageNum > 1; + hasNextPage = pageNum < pages; + } + + public int getPageNum() { + return pageNum; + } + + public void setPageNum(int pageNum) { + this.pageNum = pageNum; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + + public int getSize() { + return size; + } + + public void setSize(int size) { + this.size = size; + } + + public int getStartRow() { + return startRow; + } + + public void setStartRow(int startRow) { + this.startRow = startRow; + } + + public int getEndRow() { + return endRow; + } + + public void setEndRow(int endRow) { + this.endRow = endRow; + } + + public long getTotal() { + return total; + } + + public void setTotal(long total) { + this.total = total; + } + + public int getPages() { + return pages; + } + + public void setPages(int pages) { + this.pages = pages; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + @Deprecated + // firstPage就是1, 此函数获取的是导航条上的第一页, 容易产生歧义 + public int getFirstPage() { + return navigateFirstPage; + } + + @Deprecated + public void setFirstPage(int firstPage) { + this.navigateFirstPage = firstPage; + } + + public int getPrePage() { + return prePage; + } + + public void setPrePage(int prePage) { + this.prePage = prePage; + } + + public int getNextPage() { + return nextPage; + } + + public void setNextPage(int nextPage) { + this.nextPage = nextPage; + } + + @Deprecated + // 请用getPages()来获取最后一页, 此函数获取的是导航条上的最后一页, 容易产生歧义. + public int getLastPage() { + return navigateLastPage; + } + + @Deprecated + public void setLastPage(int lastPage) { + this.navigateLastPage = lastPage; + } + + public boolean isIsFirstPage() { + return isFirstPage; + } + + public void setIsFirstPage(boolean isFirstPage) { + this.isFirstPage = isFirstPage; + } + + public boolean isIsLastPage() { + return isLastPage; + } + + public void setIsLastPage(boolean isLastPage) { + this.isLastPage = isLastPage; + } + + public boolean isHasPreviousPage() { + return hasPreviousPage; + } + + public void setHasPreviousPage(boolean hasPreviousPage) { + this.hasPreviousPage = hasPreviousPage; + } + + public boolean isHasNextPage() { + return hasNextPage; + } + + public void setHasNextPage(boolean hasNextPage) { + this.hasNextPage = hasNextPage; + } + + public int getNavigatePages() { + return navigatePages; + } + + public void setNavigatePages(int navigatePages) { + this.navigatePages = navigatePages; + } + + public int[] getNavigatepageNums() { + return navigatepageNums; + } + + public void setNavigatepageNums(int[] navigatepageNums) { + this.navigatepageNums = navigatepageNums; + } + + public int getNavigateFirstPage() { + return navigateFirstPage; + } + + public int getNavigateLastPage() { + return navigateLastPage; + } + + public void setNavigateFirstPage(int navigateFirstPage) { + this.navigateFirstPage = navigateFirstPage; + } + + public void setNavigateLastPage(int navigateLastPage) { + this.navigateLastPage = navigateLastPage; + } + + @Override + public String toString() { + final StringBuffer sb = new StringBuffer("PageInfo{"); + sb.append("pageNum=").append(pageNum); + sb.append(", pageSize=").append(pageSize); + sb.append(", size=").append(size); + sb.append(", startRow=").append(startRow); + sb.append(", endRow=").append(endRow); + sb.append(", total=").append(total); + sb.append(", pages=").append(pages); + sb.append(", list=").append(list); + sb.append(", prePage=").append(prePage); + sb.append(", nextPage=").append(nextPage); + sb.append(", isFirstPage=").append(isFirstPage); + sb.append(", isLastPage=").append(isLastPage); + sb.append(", hasPreviousPage=").append(hasPreviousPage); + sb.append(", hasNextPage=").append(hasNextPage); + sb.append(", navigatePages=").append(navigatePages); + sb.append(", navigateFirstPage").append(navigateFirstPage); + sb.append(", navigateLastPage").append(navigateLastPage); + sb.append(", navigatepageNums="); + if (navigatepageNums == null) sb.append("null"); + else { + sb.append('['); + for (int i = 0; i < navigatepageNums.length; ++i) + sb.append(i == 0 ? "" : ", ").append(navigatepageNums[i]); + sb.append(']'); + } + sb.append('}'); + return sb.toString(); + } +} diff --git a/src/com/engine/salary/component/PageInterceptor.java b/src/com/engine/salary/component/PageInterceptor.java index 50958baf7..a41d739dd 100644 --- a/src/com/engine/salary/component/PageInterceptor.java +++ b/src/com/engine/salary/component/PageInterceptor.java @@ -1,7 +1,6 @@ package com.engine.salary.component; -import com.github.pagehelper.Page; import org.apache.commons.lang3.StringUtils; import org.apache.ibatis.binding.MapperMethod; import org.apache.ibatis.executor.parameter.ParameterHandler; diff --git a/src/com/engine/salary/enums/salaryarchive/SalaryArchiveItemAdjustReasonEnum.java b/src/com/engine/salary/enums/salaryarchive/SalaryArchiveItemAdjustReasonEnum.java index fb3f761cc..626635040 100644 --- a/src/com/engine/salary/enums/salaryarchive/SalaryArchiveItemAdjustReasonEnum.java +++ b/src/com/engine/salary/enums/salaryarchive/SalaryArchiveItemAdjustReasonEnum.java @@ -19,9 +19,9 @@ public enum SalaryArchiveItemAdjustReasonEnum implements BaseEnum { ONBOARD("ONBOARD", "入职", 85901), PROBATION_REVIEW("PROBATION_REVIEW", "转正", 85984), SALARY_ADJUSTMENT("SALARY_ADJUSTMENT", "调薪", 85985), - PROMOTION("SALARY_ADJUSTMENT", "晋升", 85985), - DEMOTION("SALARY_ADJUSTMENT", "降职", 85985), - JOB_TRANSFER("SALARY_ADJUSTMENT", "调岗", 85985), + PROMOTION("PROMOTION", "晋升", 85985), + DEMOTION("DEMOTION", "降职", 85985), + JOB_TRANSFER("JOB_TRANSFER", "调岗", 85985), POSITION_OR_SALARY_ADJUSTMENT("POSITION_OR_SALARY_ADJUSTMENT", "调岗调薪", 85986), DIMISSION("DIMISSION", "离职", 85902), OTHER("OTHER", "其他", 84500), diff --git a/src/com/engine/salary/mapper/salaryacct/SalaryAcctResultLogMapper.java b/src/com/engine/salary/mapper/salaryacct/SalaryAcctResultLogMapper.java index 13229c4f1..c69a4ce49 100644 --- a/src/com/engine/salary/mapper/salaryacct/SalaryAcctResultLogMapper.java +++ b/src/com/engine/salary/mapper/salaryacct/SalaryAcctResultLogMapper.java @@ -76,6 +76,6 @@ public interface SalaryAcctResultLogMapper { * @param salaryAcctEmployeeIds * @param lockSalaryItemIds */ - void deleteBySalaryAcctEmpIdExceptItemIds(@Param("salaryAcctEmployeeIds") Collection salaryAcctEmployeeIds, + void deleteBySalaryAcctEmpIdExceptItemIds(@Param("salaryAcctEmployeeIds") List salaryAcctEmployeeIds, @Param("exceptItems") Collection lockSalaryItemIds, @Param("updateTime") Date updateTime); } diff --git a/src/com/engine/salary/report/service/impl/SalaryStatisticsReportServiceImpl.java b/src/com/engine/salary/report/service/impl/SalaryStatisticsReportServiceImpl.java index 419759806..a772f9ed5 100644 --- a/src/com/engine/salary/report/service/impl/SalaryStatisticsReportServiceImpl.java +++ b/src/com/engine/salary/report/service/impl/SalaryStatisticsReportServiceImpl.java @@ -423,7 +423,7 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary Map> salaryAcctEmpResultMap = SalaryEntityUtil.group2Map(salaryAcctResultValues, SalaryAcctResultPO::getSalaryAcctEmpId); Map> map = new HashMap<>(); salaryAcctEmpResultMap.forEach((k, v) -> { - Map collect = v.stream().collect(Collectors.toMap(p -> Util.null2String(p.getSalaryItemId()), SalaryAcctResultPO::getResultValue, (key1, key2) -> key2)); + Map collect = v.stream().collect(Collectors.toMap(p -> Util.null2String(p.getSalaryItemId()), p -> Util.null2String(p.getResultValue()), (key1, key2) -> key2)); map.put(k, collect); }); @@ -1962,7 +1962,7 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary Map sameEmpIdYearMap = new HashMap<>(); String dimensionValue = data.getDimensionValue(); - dimensionSet.stream().sorted((a,b)->b.length()-a.length()).forEach(k -> { + dimensionSet.stream().sorted((a, b) -> b.length() - a.length()).forEach(k -> { if (dimensionValue == null) { List salaryAcctEmployees = SalaryStatisticsReportBO.listAcctEmpByRationGroupIndividual(k, dimension.getDimCode(), data.getList(), empIdYearMap, salaryAcctResultValueMap, data.getSalaryStatisticsItemList()); List lastSalaryAcctEmployees = SalaryStatisticsReportBO.listAcctEmpByRationGroupIndividual(k, dimension.getDimCode(), data.getLastList(), lastEmpIdYearMap, salaryAcctResultValueMap, data.getSalaryStatisticsItemList()); diff --git a/src/com/engine/salary/service/SalaryAcctResultLogService.java b/src/com/engine/salary/service/SalaryAcctResultLogService.java index 8edcf222d..81fb3f350 100644 --- a/src/com/engine/salary/service/SalaryAcctResultLogService.java +++ b/src/com/engine/salary/service/SalaryAcctResultLogService.java @@ -68,5 +68,5 @@ public interface SalaryAcctResultLogService { * @param salaryAcctEmployeeIds * @param lockSalaryItemIds */ - void deleteBySalaryAcctEmpIdExceptItemIds(Collection salaryAcctEmployeeIds, Collection lockSalaryItemIds); + void deleteBySalaryAcctEmpIdExceptItemIds(List salaryAcctEmployeeIds, Collection lockSalaryItemIds); } diff --git a/src/com/engine/salary/service/SalaryEmployeeService.java b/src/com/engine/salary/service/SalaryEmployeeService.java index 33898e40a..16afbb396 100644 --- a/src/com/engine/salary/service/SalaryEmployeeService.java +++ b/src/com/engine/salary/service/SalaryEmployeeService.java @@ -30,6 +30,7 @@ public interface SalaryEmployeeService { /** * 获取报表人员字段 + * * @return */ List listAllForReport(); @@ -44,6 +45,7 @@ public interface SalaryEmployeeService { /** * 获取人员信息 + * * @param ids * @return 全量 */ @@ -53,6 +55,7 @@ public interface SalaryEmployeeService { /** * 获取人员信息 + * * @param employeeId * @return 全量 */ @@ -60,6 +63,7 @@ public interface SalaryEmployeeService { /** * 获取人员信息 + * * @param simpleEmployeeIds * @return 简单 */ @@ -74,14 +78,16 @@ public interface SalaryEmployeeService { /** * 筛选导入人员信息可以在人力资源池中匹配到的人员信息 - * @param employeeList 人力资源池 - * @param userName 姓名 + * + * @param confValue 校验方式 + * @param employeeList 人力资源池 + * @param userName 姓名 * @param deparmentName 部门 - * @param mobile 手机号 - * @param workcode 工号 - * @param uid 人员id + * @param mobile 手机号 + * @param workcode 工号 + * @param uid 人员id */ - List matchImportEmployee(List employeeList, String userName, String deparmentName, String mobile, String workcode, Long uid); + List matchImportEmployee(String confValue, List employeeList, String userName, String deparmentName, String mobile, String workcode, Long uid); String empValidType(); @@ -97,29 +103,33 @@ public interface SalaryEmployeeService { /** * 根据离职日期获取离职信息 + * * @param formatDate */ Map getResignationMapByDate(String formatDate); /** * 扩展人员信息 + * * @param ids * @param param * @return */ List expandEmployeeInfo(List ids, EmployeeInfoExpandDTO param); - Map> expandEmployeeMap(List ids, EmployeeInfoExpandDTO param); + Map> expandEmployeeMap(List ids, EmployeeInfoExpandDTO param); /** * 保存扩展信息 + * * @param param */ void saveEmployeeExpandFieldSettings(EmployeeInfoExpandDTO param); /** * 获取扩展信息 + * * @param module * @return */ diff --git a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java index 30aad6422..cf1361513 100644 --- a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java @@ -267,7 +267,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction String workcode = dto.getJobNum(); //筛选导入人员信息可以在人力资源池中匹配到的人员信息 - List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(employees, userName, deparmentName, mobile, workcode, null); + List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(confValue,employees, userName, deparmentName, mobile, workcode, null); if (StringUtils.isBlank(userName) && "0".equals(confValue)) { //姓名 不能为空 diff --git a/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java b/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java index fc2b7db49..6d3d00770 100644 --- a/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java @@ -681,7 +681,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation String workcode = dto.getJobNum(); //筛选导入人员信息可以在人力资源池中匹配到的人员信息 - List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(employees, userName, deparmentName, mobile, workcode, null); + List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(confValue,employees, userName, deparmentName, mobile, workcode, null); //当人员信息导入筛选的全局配置为"0"时,姓名才是必填项 if (StringUtils.isBlank(userName) && "0".equals(confValue)) { diff --git a/src/com/engine/salary/service/impl/AttendQuoteDataServiceImpl.java b/src/com/engine/salary/service/impl/AttendQuoteDataServiceImpl.java index 6f968642e..9a03ab6f3 100644 --- a/src/com/engine/salary/service/impl/AttendQuoteDataServiceImpl.java +++ b/src/com/engine/salary/service/impl/AttendQuoteDataServiceImpl.java @@ -705,7 +705,7 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa List employeeSameIds = new ArrayList<>(); //筛选导入人员信息可以在人力资源池中匹配到的人员信息 - List emps = getSalaryEmployeeService(user).matchImportEmployee(employees, userName, deparmentName, mobile, workcode, null); + List emps = getSalaryEmployeeService(user).matchImportEmployee(confValue,employees, userName, deparmentName, mobile, workcode, null); //含在职和离职,选在职数据 if (CollectionUtils.isNotEmpty(emps) && emps.size() > 1) { employeeSameIds = emps.stream() diff --git a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java index 954346a88..57f2d20a6 100644 --- a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java @@ -250,7 +250,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction List employeeSameIds = new ArrayList<>(); //筛选导入人员信息可以在人力资源池中匹配到的人员信息 - List emps = getSalaryEmployeeService(user).matchImportEmployee(employees, userName, deparmentName, mobile, workcode, null); + List emps = getSalaryEmployeeService(user).matchImportEmployee(confValue,employees, userName, deparmentName, mobile, workcode, null); //含在职和离职,选在职数据 if (CollectionUtils.isNotEmpty(emps) && emps.size() > 1) { employeeSameIds = emps.stream() diff --git a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java index ef9e7f2ba..d8225fdab 100644 --- a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java @@ -253,8 +253,10 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { if (CollectionUtils.isEmpty(taxAgents)) { //防止普通用户查询 queryParam.setTaxAgents(Collections.singletonList(-1L)); - } else if (paymentOrganizationIds != null && paymentOrganizationIds.size() > 0){ - taxAgents.retainAll(paymentOrganizationIds); + } else { + if (paymentOrganizationIds != null && paymentOrganizationIds.size() > 0) { + taxAgents.retainAll(paymentOrganizationIds); + } queryParam.setTaxAgents(taxAgents); } } @@ -522,7 +524,6 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { OrderRuleVO orderRule = getSalarySysConfService(user).orderRule(); queryParam.setOrderRule(orderRule); - SalaryPageUtil.start(queryParam.getCurrent(), queryParam.getPageSize()); //系统人员核算明细 List list = getInsuranceAccountDetailMapper().list(queryParam); //非系统人员核算明细 @@ -1764,7 +1765,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } else { //筛选导入人员信息可以在人力资源池中匹配到的人员信息 - List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(salaryEmployees, dataValue, deparmentName, mobile, workcode, null); + List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(confValue,salaryEmployees, dataValue, deparmentName, mobile, workcode, null); if (CollectionUtils.isEmpty(employeeSameIds)) { isError = true; @@ -2786,7 +2787,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } else { //筛选导入人员信息可以在人力资源池中匹配到的人员信息 - List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(salaryEmployees, dataValue, deparmentName, mobile, workcode, null); + List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(confValue,salaryEmployees, dataValue, deparmentName, mobile, workcode, null); if (CollectionUtils.isEmpty(employeeSameIds)) { isError = true; @@ -3648,7 +3649,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } else { //筛选导入人员信息可以在人力资源池中匹配到的人员信息 - List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(salaryEmployees, name, departmentName, mobile, workcode, null); + List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(confValue,salaryEmployees, name, departmentName, mobile, workcode, null); if (CollectionUtils.isEmpty(employeeSameIds)) { isError = true; @@ -3931,7 +3932,6 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { OrderRuleVO orderRule = getSalarySysConfService(user).orderRule(); queryParam.setOrderRule(orderRule); - SalaryPageUtil.start(queryParam.getCurrent(), queryParam.getPageSize()); //系统人员核算明细 List list = getInsuranceAccountDetailMapper().list(queryParam); //非系统人员核算明细 diff --git a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java index 57c284d4e..9ce0b688a 100644 --- a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java @@ -1125,7 +1125,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { isError = true; } //筛选导入人员信息可以在人力资源池中匹配到的人员信息 - employees = getSalaryEmployeeService(user).matchImportEmployee(employeeByIds, userName, deparmentName, mobile, workcode, null); + employees = getSalaryEmployeeService(user).matchImportEmployee(confValue,employeeByIds, userName, deparmentName, mobile, workcode, null); } else { employees = employeeByIds.stream().filter(f -> f.getEmployeeId().equals(addEmployeeId)).collect(Collectors.toList()); } diff --git a/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java index 9a2be0a97..a0acbb9d9 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java @@ -1118,7 +1118,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc //salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(102838, "姓名不能为空"), i, i, j, j); } else { //筛选导入人员信息可以在人力资源池中匹配到的人员信息 - List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(salaryEmployees, dataValue, deparmentName, mobile, workcode, null); + List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(confValue, salaryEmployees, dataValue, deparmentName, mobile, workcode, null); if (CollectionUtils.isEmpty(employeeSameIds)) { isError = true; diff --git a/src/com/engine/salary/service/impl/SalaryAcctResultLogServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctResultLogServiceImpl.java index 72a128c1e..378920dbd 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctResultLogServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctResultLogServiceImpl.java @@ -60,7 +60,11 @@ public class SalaryAcctResultLogServiceImpl extends Service implements SalaryAcc } @Override - public void deleteBySalaryAcctEmpIdExceptItemIds(Collection salaryAcctEmployeeIds, Collection lockSalaryItemIds) { - getSalaryAcctResultLogMapper().deleteBySalaryAcctEmpIdExceptItemIds(salaryAcctEmployeeIds,lockSalaryItemIds, new Date()); + public void deleteBySalaryAcctEmpIdExceptItemIds(List salaryAcctEmployeeIds, Collection lockSalaryItemIds) { + // 分片 + List> partition = Lists.partition(salaryAcctEmployeeIds, 50); + partition.forEach(part -> { + getSalaryAcctResultLogMapper().deleteBySalaryAcctEmpIdExceptItemIds(part,lockSalaryItemIds, new Date()); + }); } } diff --git a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java index 9bf54bff1..307d48b75 100644 --- a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java @@ -217,15 +217,13 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee } @Override - public List matchImportEmployee(List employeeList, String userName, String deparmentName, String mobile, String workcode, Long uid) { + public List matchImportEmployee(String confValue, List employeeList, String userName, String deparmentName, String mobile, String workcode, Long uid) { if (uid != null) { return employeeList.stream() .filter(e -> Objects.equals(e.getEmployeeId(), uid)) .collect(Collectors.toList()); } - //查询对于人员信息导入筛选的全局配置 - String confValue = empValidType(); List employees = new ArrayList<>(); //“0”代表姓名+部门+手机号的匹配原则,“1”代表工号为唯一匹配原则 if ("0".equals(confValue)) { diff --git a/src/com/engine/salary/service/impl/SalarySobRangeServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobRangeServiceImpl.java index 31ea51336..37275ce6f 100644 --- a/src/com/engine/salary/service/impl/SalarySobRangeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobRangeServiceImpl.java @@ -330,7 +330,7 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange //筛选导入人员信息可以在人力资源池中匹配到的人员信息 List emps = getSalaryEmployeeService(user) - .matchImportEmployee(employees, userName, deparmentName, mobile, workcode, null); + .matchImportEmployee(confValue,employees, userName, deparmentName, mobile, workcode, null); //含在职和离职,选在职数据 if (CollectionUtils.isNotEmpty(emps) && emps.size() > 1) { employeeSameIds = emps.stream() diff --git a/src/com/engine/salary/service/impl/SpecialAddDeductionServiceImpl.java b/src/com/engine/salary/service/impl/SpecialAddDeductionServiceImpl.java index 073db566e..149d31fb3 100644 --- a/src/com/engine/salary/service/impl/SpecialAddDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/SpecialAddDeductionServiceImpl.java @@ -243,7 +243,7 @@ public class SpecialAddDeductionServiceImpl extends Service implements SpecialAd //筛选导入人员信息可以在人力资源池中匹配到的人员信息 List emps = getSalaryEmployeeService(user) - .matchImportEmployee(employees, userName, deparmentName, mobile, workcode, null); + .matchImportEmployee(confValue,employees, userName, deparmentName, mobile, workcode, null); //含在职和离职,选在职数据 if (CollectionUtils.isNotEmpty(emps) && emps.size() > 1) { employeeSameIds = emps.stream() diff --git a/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java index 2b7af54a5..202686434 100644 --- a/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java @@ -819,7 +819,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM //筛选导入人员信息可以在人力资源池中匹配到的人员信息 List emps = getSalaryEmployeeService() - .matchImportEmployee(employees, userName, deparmentName, mobile, workcode, null); + .matchImportEmployee(confValue,employees, userName, deparmentName, mobile, workcode, null); if (CollectionUtils.isNotEmpty(emps)) { employeeSameIds = emps.stream() .map(DataCollectionEmployee::getEmployeeId) diff --git a/src/com/engine/salary/util/page/PageInfo.java b/src/com/engine/salary/util/page/PageInfo.java index 86f73f742..da8313a78 100644 --- a/src/com/engine/salary/util/page/PageInfo.java +++ b/src/com/engine/salary/util/page/PageInfo.java @@ -10,7 +10,7 @@ import java.util.List; @Data @ToString -public class PageInfo extends com.github.pagehelper.PageInfo { +public class PageInfo extends com.engine.salary.component.PageInfo { Class clazz; public void setColumns(List columns) { diff --git a/src/com/engine/salary/util/page/SalaryPageUtil.java b/src/com/engine/salary/util/page/SalaryPageUtil.java index a91fe1d2a..d0a685913 100644 --- a/src/com/engine/salary/util/page/SalaryPageUtil.java +++ b/src/com/engine/salary/util/page/SalaryPageUtil.java @@ -1,6 +1,5 @@ package com.engine.salary.util.page; -import com.github.pagehelper.PageHelper; import org.apache.commons.collections4.CollectionUtils; import java.awt.*; @@ -13,13 +12,6 @@ import java.util.List; public class SalaryPageUtil { - public static void start(Integer pageNum, Integer pageSize) { - pageNum = pageNum == null || pageNum <= 0 ? 1 : pageNum; - pageSize = pageSize == null || pageSize <= 0 ? 10 : pageSize; - PageHelper.startPage(pageNum, pageSize); - } - - public static PageInfo buildPage(Integer pageNo, Integer pageSize) { pageNo = pageNo == null || pageNo <= 0 ? 1 : pageNo; pageSize = pageSize == null || pageSize <= 0 ? 10 : pageSize;