优化
This commit is contained in:
@ -4,17 +4,13 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("总体考勤情况-工资结算-基础信息")
|
||||
public class BgtPayCalculationDetailBaseVO {
|
||||
public class BgtPayCalculationDetailBaseVO {
|
||||
|
||||
@ApiModelProperty("姓名")
|
||||
private String username;
|
||||
@ -58,4 +54,7 @@ public class BgtPayCalculationDetailBaseVO {
|
||||
@ApiModelProperty("务工者Id")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty("是否能结算")
|
||||
private Boolean isPay;
|
||||
}
|
||||
|
@ -31,6 +31,8 @@ public interface BgtProjectRecruitApplyMapper extends BaseMapperPlus<BgtProjectR
|
||||
|
||||
List<BgtProjectRecruitApplyVO> appQueryList(@Param("dto") BgtProjectRecruitApplyQueryDTO dto);
|
||||
|
||||
List<BgtProjectRecruitApplyVO> htmlList(@Param("recruitId") Long recruitId);
|
||||
|
||||
// Page<BgtProjectRecruitApplyVO> dayAttendanceList(@Param("page")Page<BgtAttendanceDayDTO> queryDTOPage,@Param("dto") BgtAttendanceDayDTO dto);
|
||||
|
||||
// 总体考勤情况-人员出勤情况
|
||||
|
@ -81,6 +81,8 @@ public interface IBgtProjectRecruitApplyService extends IServicePlus<BgtProjectR
|
||||
*/
|
||||
List<BgtProjectRecruitApplyVO> appAllList(BgtProjectRecruitApplyQueryDTO dto);
|
||||
|
||||
List<BgtProjectRecruitApplyVO> htmlList(Long recruitId);
|
||||
|
||||
/**
|
||||
* LC-APP相关
|
||||
* =================================================================================================================
|
||||
@ -118,6 +120,11 @@ public interface IBgtProjectRecruitApplyService extends IServicePlus<BgtProjectR
|
||||
*/
|
||||
Boolean check(Long id);
|
||||
|
||||
/**
|
||||
* 退场检查
|
||||
*/
|
||||
Boolean quitCheck(Long id);
|
||||
|
||||
/**
|
||||
* 指定日期所有人员出勤情况
|
||||
*/
|
||||
|
@ -76,6 +76,11 @@ public interface IBgtProjectRecruitService extends IServicePlus<BgtProjectRecrui
|
||||
*/
|
||||
List<BgtProjectRecruit> appQueryList();
|
||||
|
||||
/**
|
||||
* 查询我发布的所有招工
|
||||
*/
|
||||
List<BgtProjectRecruit> htmlList(Long userId);
|
||||
|
||||
/**
|
||||
* 查询单个
|
||||
*/
|
||||
|
@ -212,6 +212,12 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
|
||||
return baseMapper.appQueryList(dto);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<BgtProjectRecruitApplyVO> htmlList(Long recruitId) {
|
||||
return baseMapper.htmlList(recruitId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WgzAppUserAllRecruitmentTwo> userAllRecruitment(Long userId,String type) {
|
||||
List<WgzAppUserAllRecruitmentTwo> res = baseMapper.userAllRecruitment(userId,type);
|
||||
@ -312,6 +318,17 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
|
||||
return annexService.checkEntry(recruitApply.getUserId(), recruitApply.getRecruitId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean quitCheck(Long id) {
|
||||
BgtProjectRecruitApply recruitApply = getById(id);
|
||||
//检查是否还有申请未审批
|
||||
Boolean reissueacard = wgzReissueacardService.isThereAnyApplicationsInReview(recruitApply.getRecruitId(), recruitApply.getUserId());
|
||||
Boolean leave = wgzLeaveService.isThereAnyApplicationsInReview(recruitApply.getRecruitId(), recruitApply.getUserId());
|
||||
Boolean dailyClock = dailyClockService.isThereAnyApplicationsInReview(recruitApply.getRecruitId(), recruitApply.getUserId());
|
||||
Boolean payCalculation = payCalculationService.isThereAnyApplicationsInReview(recruitApply.getRecruitId(), recruitApply.getUserId());
|
||||
return reissueacard || leave || dailyClock || payCalculation;
|
||||
}
|
||||
|
||||
/**
|
||||
* LC-APP相关
|
||||
* =================================================================================================================
|
||||
@ -454,13 +471,8 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
|
||||
recruit.setStatus(RecruitStatus.PROGRESS.getCode());
|
||||
iBgtProjectRecruitService.updateById(recruit);
|
||||
}
|
||||
//检查是否还有申请未审批
|
||||
Boolean reissueacard = wgzReissueacardService.isThereAnyApplicationsInReview(recruitApply.getRecruitId(), recruitApply.getUserId());
|
||||
Boolean leave = wgzLeaveService.isThereAnyApplicationsInReview(recruitApply.getRecruitId(), recruitApply.getUserId());
|
||||
Boolean dailyClock = dailyClockService.isThereAnyApplicationsInReview(recruitApply.getRecruitId(), recruitApply.getUserId());
|
||||
Boolean payCalculation = payCalculationService.isThereAnyApplicationsInReview(recruitApply.getRecruitId(), recruitApply.getUserId());
|
||||
|
||||
if(reissueacard || leave || dailyClock || payCalculation){
|
||||
if(quitCheck(id)){
|
||||
throw new BaseException("当前用户还有未审批的申请,无法退场!");
|
||||
}
|
||||
|
||||
|
@ -196,12 +196,28 @@ public class BgtProjectRecruitServiceImpl extends ServicePlusImpl<BgtProjectRecr
|
||||
.orderByDesc(BgtProjectRecruit::getCreateTime));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BgtProjectRecruit> htmlList(Long userId) {
|
||||
return list(Wrappers.<BgtProjectRecruit>lambdaQuery()
|
||||
.eq(BgtProjectRecruit::getUserId, userId)
|
||||
.ne(BgtProjectRecruit::getStatus, RecruitStatus.OVERDUE.getCode())
|
||||
.orderByDesc(BgtProjectRecruit::getCreateTime));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BgtProjectRecruitDetailVO appQueryById(Long id) {
|
||||
BgtProjectRecruit recruit = getById(id);
|
||||
BgtProjectRecruitDetailVO vo = BeanUtil.toBean(recruit, BgtProjectRecruitDetailVO.class);
|
||||
FbsProjectTask task = fbsProjectTaskService.getById(vo.getTaskId());
|
||||
vo.setTaskName(task.getTaskName());
|
||||
|
||||
// int count = bgtProjectRecruitApplyService.count(Wrappers.<BgtProjectRecruitApply>lambdaQuery()
|
||||
// .eq(BgtProjectRecruitApply::getRecruitId, vo.getId())
|
||||
// .in(BgtProjectRecruitApply::getStatus, RecruitApplyStatus.getFull()));
|
||||
// if(count >= vo.getRecruitStaffNum()){
|
||||
// vo.setStatus(RecruitStatus.FULL.getCode());
|
||||
// }
|
||||
|
||||
return vo;
|
||||
}
|
||||
|
||||
|
@ -510,8 +510,11 @@ public class WgzPayCalculationServiceImpl extends ServicePlusImpl<WgzPayCalculat
|
||||
addSum = addSum.add(multiply);
|
||||
}
|
||||
vo.setPayAmount(addSum);
|
||||
|
||||
vo.setResidueAmount(vo.getAllAmount().subtract(vo.getPayAmount()));
|
||||
|
||||
//未结算天数
|
||||
Integer days = attendanceService.attendanceDetail(userId, recruitId, null);
|
||||
vo.setIsPay(days>0);
|
||||
return vo;
|
||||
}
|
||||
|
||||
@ -604,17 +607,9 @@ public class WgzPayCalculationServiceImpl extends ServicePlusImpl<WgzPayCalculat
|
||||
vo.setWorkingState(recruitApply.getStatus().equals("5")?"1":"2");
|
||||
|
||||
//出勤天数
|
||||
//总天数
|
||||
//未结算天数
|
||||
Integer i = attendanceService.attendanceDetail(userId, recruitId, null);
|
||||
//已结算天数
|
||||
List<WgzPayCalculation> list = list(Wrappers.<WgzPayCalculation>lambdaQuery()
|
||||
.eq(WgzPayCalculation::getUserId, userId)
|
||||
.eq(WgzPayCalculation::getRecruitId, recruitId)
|
||||
.eq(WgzPayCalculation::getAuditorType, AuditStatus.PASS.getCode()));
|
||||
if(CollectionUtil.isNotEmpty(list)) {
|
||||
int sum = list.stream().mapToInt(WgzPayCalculation::getNum).sum();
|
||||
i = i - sum;
|
||||
}
|
||||
|
||||
if(i<=0){
|
||||
throw new BaseException("工资已全部结算完毕");
|
||||
}
|
||||
|
Reference in New Issue
Block a user