3.20优化
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package com.ruoyi.web.controller.wgz.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.ruoyi.bgt.domain.BgtProjectRecruit;
|
||||
import com.ruoyi.bgt.domain.BgtProjectRecruitApply;
|
||||
import com.ruoyi.bgt.service.IBgtProjectRecruitApplyService;
|
||||
@ -23,6 +24,7 @@
|
||||
import com.ruoyi.wgz.bo.rests.WgzAppUserAllRecruitmentTwo;
|
||||
import com.ruoyi.wgz.bo.rests.WgzAutonymAnnex;
|
||||
import com.ruoyi.wgz.bo.req.*;
|
||||
import com.ruoyi.wgz.domain.WgzAttendance;
|
||||
import com.ruoyi.wgz.domain.WgzPayCalculation;
|
||||
import com.ruoyi.wgz.domain.WgzQuestionsConfiguration;
|
||||
import com.ruoyi.wgz.service.*;
|
||||
@ -420,19 +422,29 @@
|
||||
*/
|
||||
@ApiOperation("【首页】【项目进行中|已完成项目】 详情")
|
||||
//@PreAuthorize("@ss.hasPermi('wgzApp:user:userProjectInProgressDetails')")
|
||||
@GetMapping("/WgzAppUserProjectInProgressDetails/{id}")
|
||||
public AjaxResult<WgzApplyForPayrollSettlementAddRes> userProjectInProgressDetails(@NotNull(message = "主键不能为空") @PathVariable("id") Long id) {
|
||||
@GetMapping("/WgzAppUserProjectInProgressDetails/{recruitApplyId}")
|
||||
public AjaxResult<WgzApplyForPayrollSettlementAddRes> userProjectInProgressDetails(@NotNull(message = "主键不能为空") @PathVariable("recruitApplyId") Long recruitApplyId) {
|
||||
WgzApplyForPayrollSettlementAddRes res = new WgzApplyForPayrollSettlementAddRes();
|
||||
Long appUserId = SecurityUtils.getAppUserId();
|
||||
BgtProjectRecruitApply by = iBgtProjectRecruitApplyService.selectByUserIdProjectRecruitApplyId(appUserId);
|
||||
BgtProjectRecruit appById = iBgtProjectRecruitService.getAppById(by.getRecruitId());
|
||||
// BgtProjectRecruitApply by = iBgtProjectRecruitApplyService.selectByUserIdProjectRecruitApplyId(appUserId);
|
||||
BgtProjectRecruitApply by = iBgtProjectRecruitApplyService.getById(recruitApplyId);
|
||||
// BgtProjectRecruit appById = iBgtProjectRecruitService.getAppById(by.getRecruitId());
|
||||
//1、先获取项目详情基本信息
|
||||
WgzAppProjectDetailsRes wgzAppProjectDetailsRes = iBgtProjectRecruitService.userProjectDetails(id);
|
||||
BeanUtils.copyProperties(wgzAppProjectDetailsRes, res);
|
||||
WgzAppProjectDetailsRes appById = iBgtProjectRecruitService.userProjectDetails(by.getRecruitId());
|
||||
BeanUtils.copyProperties(appById, res);
|
||||
//2、获取当前人员的打卡天数*单天金额=实际总工资金额
|
||||
BigDecimal recruitAmount = appById.getRecruitAmount();
|
||||
//查询实际考勤时间(只要有打卡就算出勤一条,异常也视为正常出勤,也就是说只要有上班or下班至少有一个有数据,那就证明出勤ok)
|
||||
Integer i = iWgzAttendanceService.attendanceDetail(appUserId, appById.getId(), null);
|
||||
int i = iWgzAttendanceService.count(
|
||||
new LambdaQueryWrapper<WgzAttendance>().
|
||||
eq(WgzAttendance::getUserId, appUserId).
|
||||
eq(WgzAttendance::getRecruitId, appById.getId()).and(wrapper -> wrapper
|
||||
.isNotNull(WgzAttendance::getClockInTime)
|
||||
.or()
|
||||
.isNotNull(WgzAttendance::getClockOutTime)
|
||||
)
|
||||
);
|
||||
// Integer i = iWgzAttendanceService.attendanceDetail(appUserId, appById.getId(), null);
|
||||
if (i==0){
|
||||
res.setNum(0);
|
||||
res.setTotalAmount(BigDecimal.valueOf(0));
|
||||
@ -443,7 +455,7 @@
|
||||
}
|
||||
res.setEntryTime(by.getEntryTime()).
|
||||
setLeaveTime(by.getLeaveTime()).
|
||||
setAmount(recruitAmount);
|
||||
setAmount(appById.getRecruitAmount());
|
||||
//3、查询当前进行中的项目是否有工资结算(多次追加)
|
||||
List<WgzPayCalculation> gzs = iWgzPayCalculationService.findByUserIdRecruitIdNewestData(appUserId, appById.getId());
|
||||
if (gzs.isEmpty()){
|
||||
@ -482,7 +494,7 @@
|
||||
*/
|
||||
@ApiOperation("【首页】【项目进行中】 项目进行中·申请工资结算(列表)")
|
||||
//@PreAuthorize("@ss.hasPermi('wgzApp:user:userApplyForPayrollSettlementList')")
|
||||
@GetMapping("/WgzAppUserApplyForPayrollSettlementList")
|
||||
// @GetMapping("/WgzAppUserApplyForPayrollSettlementList")
|
||||
public TableDataInfo<WgzAppApplyForPayrollSettlementListRes> userApplyForPayrollSettlementList(@Validated WgzAppApplyForPayrollSettlementListReq req) {
|
||||
return iWgzPayCalculationService.userApplyForPayrollSettlementList(req);
|
||||
}
|
||||
@ -493,8 +505,7 @@
|
||||
*/
|
||||
@ApiOperation("【首页】【项目进行中|已完成项目】 申请工资结算(详情)")
|
||||
//@PreAuthorize("@ss.hasPermi('wgzApp:user:userApplyForPayrollSettlementDetails')")
|
||||
@RepeatSubmit
|
||||
@PostMapping("/WgzAppUserApplyForPayrollSettlementDetails/{messageId}")
|
||||
@GetMapping("/WgzAppUserApplyForPayrollSettlementDetails/{id}")
|
||||
public AjaxResult<WgzAppUserApplyForPayrollSettlementDetails> userApplyForPayrollSettlementDetails(@NotNull(message = "主键ID不能为空") @PathVariable("id") Long id) {
|
||||
return AjaxResult.success(iWgzPayCalculationService.userApplyForPayrollSettlementDetails(id));
|
||||
}
|
||||
|
Reference in New Issue
Block a user