mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 07:46:40 +08:00
添加重新计算接口
This commit is contained in:
@@ -6,6 +6,7 @@ import cn.lihongjie.coal.base.dto.CommonQuery;
|
||||
import cn.lihongjie.coal.base.dto.IdRequest;
|
||||
import cn.lihongjie.coal.empSalary.dto.CreateEmpSalaryDto;
|
||||
import cn.lihongjie.coal.empSalary.dto.EmpSalaryDto;
|
||||
import cn.lihongjie.coal.empSalary.dto.InitSalaryDto;
|
||||
import cn.lihongjie.coal.empSalary.dto.UpdateEmpSalaryDto;
|
||||
import cn.lihongjie.coal.empSalary.service.EmpSalaryService;
|
||||
|
||||
@@ -74,8 +75,16 @@ public class EmpSalaryController {
|
||||
return this.service.batchSelectedEmpIds(request);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/initSalary")
|
||||
public Object initSalary(@RequestBody InitSalaryDto request) {
|
||||
this.service.initSalary(request);
|
||||
return true;
|
||||
}
|
||||
@PostMapping("/recalculate")
|
||||
public Object recalculate(@RequestBody IdRequest request) {
|
||||
this.service.recalculate(request);
|
||||
return true;
|
||||
}
|
||||
|
||||
@PostMapping("/archive")
|
||||
public Object archive(@RequestBody IdRequest request) {
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package cn.lihongjie.coal.empSalary.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@Data
|
||||
public class InitSalaryDto {
|
||||
|
||||
private String batchId;
|
||||
private List<String> employeesIds;
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import cn.lihongjie.coal.common.ReflectUtils;
|
||||
import cn.lihongjie.coal.empMonthAttendance.entity.EmpMonthAttendanceEntity;
|
||||
import cn.lihongjie.coal.empSalary.dto.CreateEmpSalaryDto;
|
||||
import cn.lihongjie.coal.empSalary.dto.EmpSalaryDto;
|
||||
import cn.lihongjie.coal.empSalary.dto.InitSalaryDto;
|
||||
import cn.lihongjie.coal.empSalary.dto.UpdateEmpSalaryDto;
|
||||
import cn.lihongjie.coal.empSalary.entity.EmpSalaryEntity;
|
||||
import cn.lihongjie.coal.empSalary.mapper.EmpSalaryMapper;
|
||||
@@ -314,13 +315,16 @@ public class EmpSalaryService extends BaseService<EmpSalaryEntity, EmpSalaryRepo
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/** 初始化工资 */
|
||||
@SneakyThrows
|
||||
public void initSalary(String batchId, List<String> employeesIds) {
|
||||
public void initSalary(InitSalaryDto initSalaryDto) {
|
||||
|
||||
EmpSalaryBatchEntity batch = batchService.get(batchId);
|
||||
EmpSalaryBatchEntity batch = batchService.get(initSalaryDto.getBatchId());
|
||||
|
||||
List<EmployeeDto> employees = employeeService.getDtoByIds(employeesIds);
|
||||
List<EmployeeDto> employees = employeeService.getDtoByIds(initSalaryDto.getEmployeesIds());
|
||||
|
||||
StopWatch stopWatch = new StopWatch("initSalary: " + batch.getId());
|
||||
|
||||
@@ -390,7 +394,7 @@ public class EmpSalaryService extends BaseService<EmpSalaryEntity, EmpSalaryRepo
|
||||
|
||||
stopWatch.start("queryHistorySalary");
|
||||
|
||||
List<EmpSalaryEntity> salaryHis = this.queryHisSalary(employeesIds);
|
||||
List<EmpSalaryEntity> salaryHis = this.queryHisSalary(initSalaryDto.getEmployeesIds());
|
||||
|
||||
Map<String, EmpSalaryEntity> salaryHisMap =
|
||||
salaryHis.stream()
|
||||
|
||||
Reference in New Issue
Block a user