编写工资结算

This commit is contained in:
2025-02-21 16:15:49 +08:00
parent 1fa1862e77
commit 081f1f23d8
15 changed files with 240 additions and 8 deletions

View File

@ -34,6 +34,8 @@ import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalTime;
import java.util.ArrayList;
import java.util.HashMap;
@ -363,7 +365,46 @@ public class WgzAppController {
@ApiOperation("【首页】【项目进行中】 项目进行中")
@PreAuthorize("@ss.hasPermi('wgzApp:user:userUnderway')")
@GetMapping("/WgzAppUserUnderway")
public TableDataInfo<WgzAppRegisteredProjectRes> userUnderway(@Validated WgzAppUnderwayReq req) {
public TableDataInfo<WgzAppUnderwayRes> userUnderway(@Validated WgzAppUnderwayReq req) {
return iBgtProjectRecruitApplyService.userUnderway(req);
}
/**
* 【首页】【项目进行中】 项目进行中·申请工资结算(查询)
*/
@ApiOperation("【首页】【项目进行中】 项目进行中·申请工资结算(查询)")
@PreAuthorize("@ss.hasPermi('wgzApp:user:userApplyForPayrollSettlementFind')")
@GetMapping("/WgzAppUserApplyForPayrollSettlementFind")
public AjaxResult<WgzApplyForPayrollSettlementFindRes> userApplyForPayrollSettlementFind(@Validated WgzApplyForPayrollSettlementFindReq req) {
Long appUserId = SecurityUtils.getAppUserId();
BgtProjectRecruitApply by = iBgtProjectRecruitApplyService.selectByUserIdProjectRecruitApplyId(appUserId);
BgtProjectRecruit appById = iBgtProjectRecruitService.getAppById(by.getId());
//1、查询入场时间、退场时间、单天金额
BigDecimal recruitAmount = appById.getRecruitAmount();
//2、查询实际考勤时间只要有打卡就算出勤一条异常也视为正常出勤,也就是说只要有上班or下班至少有一个有数据那就证明出勤ok
Integer i = iWgzAttendanceService.attendanceDetail(appUserId, appById.getId(), 1);
if (i == 0){
throw new RuntimeException("您还未打卡");
}
//3、单天金额*实际考勤总天数=实际工资
BigDecimal totalAmount = recruitAmount.multiply(BigDecimal.valueOf(i));
WgzApplyForPayrollSettlementFindRes res = new WgzApplyForPayrollSettlementFindRes().
setEntryTime(by.getEntryTime()).
setLeaveTime(by.getLeaveTime()).
setAmount(recruitAmount).
setNum(i).
setTotalAmount(totalAmount);
return AjaxResult.success(res);
}
/**
* 【首页】【项目进行中】 项目进行中·申请工资结算(新增)
*/
@ApiOperation("【首页】【项目进行中】 项目进行中·申请工资结算(新增)")
@PreAuthorize("@ss.hasPermi('wgzApp:user:userApplyForPayrollSettlementAdd')")
@GetMapping("/WgzAppUserApplyForPayrollSettlementAdd")
public AjaxResult<WgzApplyForPayrollSettlementFindRes> userApplyForPayrollSettlementAdd(@Validated WgzApplyForPayrollSettlementFindReq req) {
return null;
}