编写工资结算
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);
|
||||
|
@ -29,4 +29,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="underwayPage" resultType="com.ruoyi.wgz.bo.res.WgzAppUnderwayRes">
|
||||
SELECT
|
||||
b.*,
|
||||
c.task_name,
|
||||
c.task_address,
|
||||
c.task_img,
|
||||
(SELECT count(1) FROM bgt_project_recruit_apply WHERE recruit_id = a.id) as numberOfRegistered
|
||||
FROM
|
||||
bgt_project_recruit_apply as a
|
||||
LEFT JOIN bgt_project_recruit as b on(a.recruit_id = b.id and b.del_flag = 0 )
|
||||
LEFT JOIN fbs_project_task as c ON (b.task_id = c.id AND c.del_flag = 0)
|
||||
WHERE
|
||||
a.user_id = #{userId} AND
|
||||
a.status IN ('3', '5')AND
|
||||
a.del_flag = 0
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
@ -56,21 +56,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="userRegisteredProject" resultType="com.ruoyi.wgz.bo.res.WgzAppRegisteredProjectRes">
|
||||
SELECT
|
||||
a.*,
|
||||
b.task_name,
|
||||
b.task_address,
|
||||
b.task_img,
|
||||
b.*,
|
||||
c.task_name,
|
||||
c.task_address,
|
||||
c.task_img,
|
||||
(SELECT count(1) FROM bgt_project_recruit_apply WHERE recruit_id = a.id) as numberOfRegistered
|
||||
FROM
|
||||
bgt_project_recruit as a
|
||||
LEFT JOIN fbs_project_task as b ON (a.task_id = b.id AND b.del_flag = 0)
|
||||
bgt_project_recruit_apply as a
|
||||
LEFT JOIN bgt_project_recruit as b on(a.recruit_id = b.id and b.del_flag = 0 )
|
||||
LEFT JOIN fbs_project_task as c ON (b.task_id = c.id AND c.del_flag = 0)
|
||||
WHERE
|
||||
a.id = #{id} AND a.del_flag = 0
|
||||
a.user_id = #{id} AND
|
||||
(a.status = '0' or a.status = '1') AND
|
||||
a.del_flag = 0
|
||||
</select>
|
||||
|
||||
<select id="GetsTheMembersUnderTheCurrentProject" resultType="com.ruoyi.wgz.bo.rests.WgzAppCancelRegistrationProjectDetailsTwo">
|
||||
SELECT
|
||||
a.user_id,
|
||||
a.status,
|
||||
b.username,
|
||||
b.avatar_name,
|
||||
b.score
|
||||
|
Reference in New Issue
Block a user