编写工资结算
This commit is contained in:
		@ -1,10 +1,13 @@
 | 
			
		||||
package com.ruoyi.bgt.mapper;
 | 
			
		||||
 | 
			
		||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 | 
			
		||||
import com.ruoyi.bgt.domain.BgtProjectRecruitApply;
 | 
			
		||||
import com.ruoyi.bgt.domain.dto.BgtProjectRecruitApplyQueryDTO;
 | 
			
		||||
import com.ruoyi.bgt.domain.vo.BgtProjectRecruitApplyVO;
 | 
			
		||||
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
 | 
			
		||||
import com.ruoyi.common.core.mybatisplus.cache.MybatisPlusRedisCache;
 | 
			
		||||
import com.ruoyi.wgz.bo.req.WgzAppUnderwayReq;
 | 
			
		||||
import com.ruoyi.wgz.bo.res.WgzAppUnderwayRes;
 | 
			
		||||
import org.apache.ibatis.annotations.CacheNamespace;
 | 
			
		||||
import org.apache.ibatis.annotations.Param;
 | 
			
		||||
 | 
			
		||||
@ -21,4 +24,7 @@ import java.util.List;
 | 
			
		||||
public interface BgtProjectRecruitApplyMapper extends BaseMapperPlus<BgtProjectRecruitApply> {
 | 
			
		||||
 | 
			
		||||
	List<BgtProjectRecruitApplyVO> appQueryList(@Param("dto") BgtProjectRecruitApplyQueryDTO dto);
 | 
			
		||||
 | 
			
		||||
	// 获取指定项目下的所有成员(分页)
 | 
			
		||||
	Page<WgzAppUnderwayRes> underwayPage (@Param("page") Page<WgzAppUnderwayReq> page, @Param("userId") Long userId);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -7,9 +7,11 @@ import com.ruoyi.bgt.domain.vo.BgtProjectRecruitVO;
 | 
			
		||||
import com.ruoyi.common.core.mybatisplus.cache.MybatisPlusRedisCache;
 | 
			
		||||
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
 | 
			
		||||
import com.ruoyi.wgz.bo.req.WgzAppRegisteredProjectReq;
 | 
			
		||||
import com.ruoyi.wgz.bo.req.WgzAppUnderwayReq;
 | 
			
		||||
import com.ruoyi.wgz.bo.res.WgzAppCancelRegistrationProjectDetailsRes;
 | 
			
		||||
import com.ruoyi.wgz.bo.res.WgzAppProjectDetailsRes;
 | 
			
		||||
import com.ruoyi.wgz.bo.res.WgzAppRegisteredProjectRes;
 | 
			
		||||
import com.ruoyi.wgz.bo.res.WgzAppUnderwayRes;
 | 
			
		||||
import com.ruoyi.wgz.bo.rests.WgzAppCancelRegistrationProjectDetailsTwo;
 | 
			
		||||
import org.apache.ibatis.annotations.CacheNamespace;
 | 
			
		||||
import org.apache.ibatis.annotations.Param;
 | 
			
		||||
@ -30,7 +32,9 @@ public interface BgtProjectRecruitMapper extends BaseMapperPlus<BgtProjectRecrui
 | 
			
		||||
 | 
			
		||||
	WgzAppProjectDetailsRes userProjectDetails(@Param("id") Long id);
 | 
			
		||||
 | 
			
		||||
	// 获取指定用户已申请的项目信息
 | 
			
		||||
	Page<WgzAppRegisteredProjectRes> userRegisteredProject(@Param("page") Page<WgzAppRegisteredProjectReq> page,@Param("userId") Long userId);
 | 
			
		||||
 | 
			
		||||
	// 获取指定项目下的所有成员
 | 
			
		||||
	List<WgzAppCancelRegistrationProjectDetailsTwo> GetsTheMembersUnderTheCurrentProject (@Param("recruitId") Long recruitId);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -7,6 +7,9 @@ import com.ruoyi.bgt.domain.dto.BgtProjectRecruitApplyQueryDTO;
 | 
			
		||||
import com.ruoyi.bgt.domain.vo.BgtProjectRecruitApplyVO;
 | 
			
		||||
import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
 | 
			
		||||
import com.ruoyi.common.core.page.TableDataInfo;
 | 
			
		||||
import com.ruoyi.wgz.bo.req.WgzAppUnderwayReq;
 | 
			
		||||
import com.ruoyi.wgz.bo.res.WgzAppUnderwayRes;
 | 
			
		||||
import org.springframework.validation.annotation.Validated;
 | 
			
		||||
 | 
			
		||||
import java.util.Collection;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
@ -89,5 +92,10 @@ public interface IBgtProjectRecruitApplyService extends IServicePlus<BgtProjectR
 | 
			
		||||
	 */
 | 
			
		||||
	Boolean userCancelRegistration(Long recruitId);
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 项目进行中
 | 
			
		||||
	 */
 | 
			
		||||
	TableDataInfo<WgzAppUnderwayRes> userUnderway(@Validated WgzAppUnderwayReq req);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -20,6 +20,9 @@ import com.ruoyi.common.exception.BaseException;
 | 
			
		||||
import com.ruoyi.common.service.IAnnexService;
 | 
			
		||||
import com.ruoyi.common.utils.PageUtils;
 | 
			
		||||
import com.ruoyi.common.utils.SecurityUtils;
 | 
			
		||||
import com.ruoyi.wgz.bo.req.WgzAppRegisteredProjectReq;
 | 
			
		||||
import com.ruoyi.wgz.bo.req.WgzAppUnderwayReq;
 | 
			
		||||
import com.ruoyi.wgz.bo.res.WgzAppUnderwayRes;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
import org.springframework.transaction.annotation.Transactional;
 | 
			
		||||
@ -176,4 +179,14 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
 | 
			
		||||
		return baseMapper.deleteById(new LambdaQueryWrapper<BgtProjectRecruitApply>().eq(BgtProjectRecruitApply::getRecruitId, recruitId)) >0;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public TableDataInfo<WgzAppUnderwayRes> userUnderway(WgzAppUnderwayReq req) {
 | 
			
		||||
		Long userId = SecurityUtils.getAppUserId();
 | 
			
		||||
		Page<WgzAppUnderwayReq> pe = new Page<>();
 | 
			
		||||
		pe.setCurrent(req.getPageNum());
 | 
			
		||||
		pe.setSize(req.getPageSize());
 | 
			
		||||
		return PageUtils.buildDataInfo(baseMapper.underwayPage(pe, userId));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -2,15 +2,19 @@ package com.ruoyi.wgz.bo.req;
 | 
			
		||||
 | 
			
		||||
import com.ruoyi.common.bo.PageReq;
 | 
			
		||||
import io.swagger.annotations.ApiModel;
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
import lombok.experimental.Accessors;
 | 
			
		||||
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.math.BigDecimal;
 | 
			
		||||
import java.time.LocalDateTime;
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
@NoArgsConstructor
 | 
			
		||||
@Accessors(chain = true)
 | 
			
		||||
@ApiModel("项目进行中请求对象")
 | 
			
		||||
public class WgzAppUnderwayReq extends PageReq {
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,21 @@
 | 
			
		||||
package com.ruoyi.wgz.bo.req;
 | 
			
		||||
 | 
			
		||||
import io.swagger.annotations.ApiModel;
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
import lombok.experimental.Accessors;
 | 
			
		||||
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
@NoArgsConstructor
 | 
			
		||||
@Accessors(chain = true)
 | 
			
		||||
@ApiModel("工作结算查询请求对象")
 | 
			
		||||
public class WgzApplyForPayrollSettlementFindReq implements Serializable {
 | 
			
		||||
	@ApiModelProperty("招工ID")
 | 
			
		||||
	private Long recruitId;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("工资结算天数")
 | 
			
		||||
	private int num;
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,55 @@
 | 
			
		||||
package com.ruoyi.wgz.bo.res;
 | 
			
		||||
 | 
			
		||||
import io.swagger.annotations.ApiModel;
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
import lombok.experimental.Accessors;
 | 
			
		||||
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.math.BigDecimal;
 | 
			
		||||
import java.time.LocalDateTime;
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
@NoArgsConstructor
 | 
			
		||||
@Accessors(chain = true)
 | 
			
		||||
@ApiModel("项目进行中返回对象")
 | 
			
		||||
public class WgzAppUnderwayRes implements Serializable {
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("主键ID")
 | 
			
		||||
	private Long id;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("项目ID")
 | 
			
		||||
	private Long projectId;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("招工名称")
 | 
			
		||||
	private String recruitName;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("创建时间")
 | 
			
		||||
	private LocalDateTime createTime;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("封面图(多个逗号分隔)")
 | 
			
		||||
	private String coverPlan;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("招工数量")
 | 
			
		||||
	private Integer recruitStaffNum;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("招工金额")
 | 
			
		||||
	private BigDecimal recruitAmount;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("任务ID")
 | 
			
		||||
	private Long taskId;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("任务名称")
 | 
			
		||||
	private String taskName;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("任务地址")
 | 
			
		||||
	private String taskAddress;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("招工要求")
 | 
			
		||||
	private String recruitRequirement;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("已报名数量")
 | 
			
		||||
	private Integer numberOfRegistered;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,32 @@
 | 
			
		||||
package com.ruoyi.wgz.bo.res;
 | 
			
		||||
 | 
			
		||||
import io.swagger.annotations.ApiModel;
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
import lombok.experimental.Accessors;
 | 
			
		||||
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.math.BigDecimal;
 | 
			
		||||
import java.time.LocalDate;
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
@NoArgsConstructor
 | 
			
		||||
@Accessors(chain = true)
 | 
			
		||||
@ApiModel("工资结算查询返回")
 | 
			
		||||
public class WgzApplyForPayrollSettlementFindRes implements Serializable {
 | 
			
		||||
	@ApiModelProperty("进场时间")
 | 
			
		||||
	private LocalDate entryTime;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("离场时间")
 | 
			
		||||
	private LocalDate leaveTime;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("单天金额")
 | 
			
		||||
	private BigDecimal amount;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("出勤天数")
 | 
			
		||||
	private Integer num;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("总的金额")
 | 
			
		||||
	private BigDecimal TotalAmount;
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,6 @@
 | 
			
		||||
package com.ruoyi.wgz.bo.rests;
 | 
			
		||||
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
 | 
			
		||||
public class GetsTheMembersUnderTheCurrentProject implements Serializable {
 | 
			
		||||
}
 | 
			
		||||
@ -21,6 +21,9 @@ public class WgzAppCancelRegistrationProjectDetailsTwo implements Serializable {
 | 
			
		||||
	@ApiModelProperty("务工者ID")
 | 
			
		||||
	private Long userId;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("0报名 1包工同意  2包工头拒绝(截止时间)3务工者同意  4务工者拒绝  5进场 6离场")
 | 
			
		||||
	private String status;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("务工者名称")
 | 
			
		||||
	private String username;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -114,5 +114,9 @@ public interface IWgzAttendanceService extends IServicePlus<WgzAttendance> {
 | 
			
		||||
	 */
 | 
			
		||||
	BgtAttendanceVO attendanceDetail(BgtAttendanceDTO dto);
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 考勤详情,查询指定用户指定项目的指定天数考勤情况统计(如若用户输入20,但实际只有2天出勤)
 | 
			
		||||
	 */
 | 
			
		||||
	Integer attendanceDetail(Long userId,Long recruitId, Integer num);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -309,6 +309,20 @@ public class WgzAttendanceServiceImpl extends ServicePlusImpl<WgzAttendanceMappe
 | 
			
		||||
		return null;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public Integer attendanceDetail(Long userId,Long recruitId, Integer num){
 | 
			
		||||
		LambdaQueryWrapper<WgzAttendance> apply = new LambdaQueryWrapper<WgzAttendance>().
 | 
			
		||||
			eq(WgzAttendance::getUserId, userId).
 | 
			
		||||
			eq(WgzAttendance::getRecruitId, recruitId).and(wrapper -> wrapper
 | 
			
		||||
				.isNotNull(WgzAttendance::getClockInTime)
 | 
			
		||||
				.or()
 | 
			
		||||
				.isNotNull(WgzAttendance::getClockOutTime)
 | 
			
		||||
			);
 | 
			
		||||
		apply.orderByAsc(WgzAttendance::getDate);
 | 
			
		||||
		apply.last("LIMIT " + num);
 | 
			
		||||
		return baseMapper.selectCount(apply);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public List<BgtAttendanceCountVO> countByTaskId(Long taskId, LocalDate beginDate, LocalDate endDate) {
 | 
			
		||||
		return baseMapper.countByTaskId(taskId, beginDate, endDate);
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user