This commit is contained in:
zt
2025-04-22 11:08:08 +08:00
parent 90c9c3e5d6
commit d99eaafd4c
17 changed files with 232 additions and 26 deletions

View File

@ -8,6 +8,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.fbs.domain.FbsWageApplication;
import com.ruoyi.fbs.service.IFbsWageApplicationService;
import com.ruoyi.wgz.service.IWgzAttendanceService;
import com.ruoyi.zbf.domain.ZbfProject;
import com.ruoyi.zbf.domain.dto.*;
import com.ruoyi.zbf.domain.vo.*;
@ -20,6 +21,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* 总包方项目Controller
@ -35,7 +37,7 @@ public class AppZbfProjectController extends BaseController {
private final IZbfProjectService iZbfProjectService;
private final IFbsWageApplicationService iFbsWageApplicationService;
private final IWgzAttendanceService attendanceService;
@ApiOperation("总包方新增项目")
@Log(title = "总包方新增项目", businessType = BusinessType.INSERT)
@ -59,7 +61,6 @@ public class AppZbfProjectController extends BaseController {
return AjaxResult.success(iZbfProjectService.zbfEditInfo(projectId));
}
@ApiOperation("总包方查询我的项目列表")
@GetMapping("/list")
public TableDataInfo<ZbfProjectListVO> list(@Validated ZbfProjectListDTO dto) {
@ -78,7 +79,6 @@ public class AppZbfProjectController extends BaseController {
return iZbfProjectService.conciseList(dto);
}
@ApiOperation("总包方项目详情-项目信息")
@GetMapping("/{projectId}")
public AjaxResult<ZbfProjectDetailVO> zbfInfo(@NotNull(message = "主键不能为空")
@ -141,9 +141,16 @@ public class AppZbfProjectController extends BaseController {
}
@ApiOperation("总包方项目详情-考勤情况-查看更多")
@GetMapping("/allCount")
public AjaxResult<ZbfAttendanceVO> allCount(@Validated ZbfAttendanceDTO dto) {
return AjaxResult.success(attendanceService.zbfAllCount(dto));
}
@ApiOperation("总包方项目详情-考勤情况-查看更多")
@GetMapping("/histogram")
public AjaxResult<List<ZbfDayAttendanceCountVO>> histogram(@Validated ZbfAttendanceDTO dto) {
return AjaxResult.success(attendanceService.zbfHistogram(dto));
}
}

View File

@ -6,6 +6,7 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.zbf.domain.ZbfProjectSubcontractingApply;
import com.ruoyi.zbf.domain.dto.ZbfProjectSubApplyListDTO;
import com.ruoyi.zbf.domain.vo.ZbfProjectSubcontractingApplyListVO;
import com.ruoyi.zbf.service.IZbfProjectSubcontractingApplyService;
@ -42,9 +43,17 @@ public class AppZbfProjectSubcontractingApplyController extends BaseController {
}
@ApiOperation("总包方项目分包详情-分包商申请列表")
@GetMapping("/fbsList/{subId}")
@GetMapping("/fbsList")
public TableDataInfo<ZbfProjectSubcontractingApplyListVO> getFbsList(ZbfProjectSubApplyListDTO dto) {
return iZbfProjectSubcontractingApplyService.getFbsList(dto);
}
@ApiOperation("总包方消息-分包商申请列表")
@GetMapping("/message/fbsList")
public TableDataInfo<ZbfProjectSubcontractingApplyListVO> getFbsListByApplyId(ZbfProjectSubApplyListDTO dto) {
ZbfProjectSubcontractingApply byId = iZbfProjectSubcontractingApplyService.getById(dto.getSubApplyId());
dto.setSubId(byId.getSubId());
return iZbfProjectSubcontractingApplyService.getFbsList(dto);
}
}

View File

@ -9,11 +9,13 @@ import com.ruoyi.fbs.domain.FbsWageApplication;
import com.ruoyi.fbs.service.IFbsUserService;
import com.ruoyi.fbs.service.IFbsWageApplicationService;
import com.ruoyi.zbf.domain.ZbfProjectSubcontracting;
import com.ruoyi.zbf.domain.ZbfProjectSubcontractingApply;
import com.ruoyi.zbf.domain.dto.ZbfProgressListDTO;
import com.ruoyi.zbf.domain.dto.ZbfSubBgtListDTO;
import com.ruoyi.zbf.domain.dto.ZbfWageApplicationListDTO;
import com.ruoyi.zbf.domain.vo.*;
import com.ruoyi.zbf.service.IZbfProjectSectionService;
import com.ruoyi.zbf.service.IZbfProjectSubcontractingApplyService;
import com.ruoyi.zbf.service.IZbfProjectSubcontractingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -43,6 +45,7 @@ public class AppZbfProjectSubcontractingController extends BaseController {
private final IZbfProjectSectionService iZbfProjectSectionService;
private final IFbsUserService iFbsUserService;
private final IFbsWageApplicationService iFbsWageApplicationService;
private final IZbfProjectSubcontractingApplyService iZbfProjectSubcontractingApplyService;
@ApiOperation("总包方项目分包详情-分包信息")
@GetMapping("/{id}")
@ -101,7 +104,16 @@ public class AppZbfProjectSubcontractingController extends BaseController {
}
@ApiOperation("总包方消息-分包信息")
@GetMapping("/message/{id}")
public AjaxResult<ZbfProjectSubcontractingDetailVO> getInfoByApplyId(@NotNull(message = "主键不能为空")
@PathVariable("id") Long id) {
ZbfProjectSubcontractingApply subcontractingApply = iZbfProjectSubcontractingApplyService.queryById(id);
ZbfProjectSubcontracting zbfProjectSubcontracting = iZbfProjectSubcontractingService.queryById(subcontractingApply.getSubId());
ZbfProjectSubcontractingDetailVO vo = BeanUtil.copyProperties(zbfProjectSubcontracting, ZbfProjectSubcontractingDetailVO.class);
vo.setSectionName(iZbfProjectSectionService.getById(vo.getSectionId()).getSectionName());
return AjaxResult.success(vo);
}
}

View File

@ -110,6 +110,13 @@ public class AppZbfProjectTaskController extends BaseController {
return iBgtWageApplicationService.taskWageList(dto);
}
@ApiOperation("总包方查询任务详情-工资结算审批列表-详情")
@GetMapping("/wageInfo/{id}")
public AjaxResult<BgtWageApplication> bgtWageInfo(@NotNull(message = "主键不能为空")
@PathVariable("id") Long id) {
return AjaxResult.success(iBgtWageApplicationService.getById(id));
}
@ApiOperation("总包方查询任务详情-单个-务工人员数量")
@GetMapping("/wgzList")
public TableDataInfo<BgtProjectRecruitApplyVO> taskWgzList(@Validated FbsProjectTaskUserDTO dto) {
@ -134,12 +141,6 @@ public class AppZbfProjectTaskController extends BaseController {
return iBgtProjectRecruitApplyService.taskWgzListAll(dto);
}
// @ApiOperation("分包商查询任务详情-任务切换列表")
// @GetMapping("/switchList")
// public TableDataInfo<FbsProjectTaskListVO> switchList(FbsTaskSwitchListDTO dto) {
// return iFbsProjectTaskService.switchList(dto);
// }
@ApiOperation("总包方查询包工头信息(点头像)")
@GetMapping("/bgt/{userId}")
public AjaxResult<BgtUser> bgt(@NotNull(message = "主键不能为空")

View File

@ -1,5 +1,8 @@
package com.ruoyi.common.enums;
import java.util.Arrays;
import java.util.List;
/**
* 项目状态
*
@ -32,5 +35,9 @@ public enum ProjectStatus
}
//在建的状态
public static List<String> getBuilding(){
return Arrays.asList(NOT_START.getCode(), START.getCode());
}
}

View File

@ -28,6 +28,9 @@ public class BgtPayCalculationDetailListVO {
@ApiModelProperty("申请人类型")
private String operatorType;
@ApiModelProperty("申请人名称")
private String userName;
@ApiModelProperty("创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTime;

View File

@ -15,6 +15,7 @@ public class ZbfMessageConstant {
public static final String ZBF_LARGE_SETTLEMENT = "2"; //大类型-结算
public static final String ZBF_LARGE_OTHER = "3"; //大类型-其它
public static final String ZBF_SMALL_SYSTEM = "0"; //小类型-系统
public static final String ZBF_SMALL_SIGN_UP = "1"; //小类型-分包商报名
public static final String ZBF_SMALL_PAY = "2"; //小类型-付款
public static final String ZBF_SMALL_PROGRESS = "3"; //小类型-进度

View File

@ -15,6 +15,8 @@ import com.ruoyi.wgz.bo.res.WgzAppCardReplacementApplicationRes;
import com.ruoyi.wgz.bo.res.WgzAppPunchTheCalendarRecordRes;
import com.ruoyi.wgz.bo.res.WgzAppUserClockingConditionRes;
import com.ruoyi.wgz.domain.WgzAttendance;
import com.ruoyi.zbf.domain.dto.ZbfAttendanceDTO;
import com.ruoyi.zbf.domain.vo.ZbfAttendanceVO;
import com.ruoyi.zbf.domain.vo.ZbfDayAttendanceCountVO;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
@ -136,8 +138,21 @@ public interface IWgzAttendanceService extends IServicePlus<WgzAttendance> {
*/
BgtAttendanceVO allCount(BgtAttendanceDTO dto);
/**
* 总包方总体考勤情况-统计
*/
ZbfAttendanceVO zbfAllCount(ZbfAttendanceDTO dto);
/**
* 总体考勤情况-柱状图
*/
List<BgtDayAttendanceCountVO> histogram(BgtAttendanceDTO dto);
/**
* 总包方总体考勤情况-柱状图
*/
List<ZbfDayAttendanceCountVO> zbfHistogram(ZbfAttendanceDTO dto);
/**
* 考勤详情,查询指定用户指定项目的指定天数考勤情况统计如若用户输入20但实际只有2天出勤
* 如若num为0,那么表示查询所有天数的考勤情况统计;

View File

@ -37,7 +37,11 @@ import com.ruoyi.wgz.domain.WgzReissueacard;
import com.ruoyi.wgz.mapper.WgzAttendanceMapper;
import com.ruoyi.wgz.service.IWgzAttendanceService;
import com.ruoyi.wgz.service.IWgzReissueacardService;
import com.ruoyi.zbf.domain.ZbfProject;
import com.ruoyi.zbf.domain.dto.ZbfAttendanceDTO;
import com.ruoyi.zbf.domain.vo.ZbfAttendanceVO;
import com.ruoyi.zbf.domain.vo.ZbfDayAttendanceCountVO;
import com.ruoyi.zbf.service.IZbfProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
@ -68,14 +72,15 @@ public class WgzAttendanceServiceImpl extends ServicePlusImpl<WgzAttendanceMappe
@Autowired
@Lazy
private IBgtProjectRecruitApplyService iBgtProjectRecruitApplyService;
@Autowired
private IBgtProjectRecruitService iBgtProjectRecruitService;
@Autowired
private IFbsProjectTaskService taskService;
@Autowired
private IWgzReissueacardService iWgzReissueacardService;
@Autowired
@Lazy
private IZbfProjectService zbfProjectService;
@ -537,6 +542,60 @@ public class WgzAttendanceServiceImpl extends ServicePlusImpl<WgzAttendanceMappe
return bgtAttendanceVO;
}
@Override
public ZbfAttendanceVO zbfAllCount(ZbfAttendanceDTO dto) {
ZbfAttendanceVO zbfAttendanceVO = new ZbfAttendanceVO();
ZbfProject zbfProject = zbfProjectService.getById(dto.getProjectId());
zbfAttendanceVO.setProjectId(zbfProject.getId());
zbfAttendanceVO.setProjectName(zbfProject.getProjectName());
LocalDate date = dto.getDate();
//当天总人数
Integer totalNum = dayTotalNumByProjectId(zbfProject.getId(), date);
zbfAttendanceVO.setTotalNum(totalNum);
//今日到岗人数
List<ZbfDayAttendanceCountVO> countVOS = countDayByProjectId(dto.getProjectId(), date, date);
if(CollectionUtil.isNotEmpty(countVOS)){
zbfAttendanceVO.setReportToDutyNum(countVOS.get(0).getReportToDutyNum());
}
//今日到岗率
if(zbfAttendanceVO.getReportToDutyNum()!=0){
int rate = new BigDecimal(zbfAttendanceVO.getReportToDutyNum()).divide(new BigDecimal(totalNum), 2, RoundingMode.HALF_UP)
.multiply(new BigDecimal(100)).intValue();
zbfAttendanceVO.setReportToDutyRate(rate);
}
//任务拥有的所有招工
List<BgtProjectRecruit> bgtProjectRecruits = iBgtProjectRecruitService.getBaseMapper().selectList(Wrappers.<BgtProjectRecruit>lambdaQuery()
.eq(BgtProjectRecruit::getProjectId, dto.getProjectId()));
List<Long> recruitIds = bgtProjectRecruits.stream().map(BgtProjectRecruit::getId).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(recruitIds)) {
//请假人数
Integer leaveNum = baseMapper.selectCount(Wrappers.<WgzAttendance>lambdaQuery().isNotNull(WgzAttendance::getLeaveMarkId)
.in(WgzAttendance::getRecruitId, recruitIds).eq(WgzAttendance::getDate, date));
zbfAttendanceVO.setLeaveNum(leaveNum);
//迟到人数
Integer lateNum = baseMapper.selectCount(Wrappers.<WgzAttendance>lambdaQuery().eq(WgzAttendance::getLate, 1)
.in(WgzAttendance::getRecruitId, recruitIds).eq(WgzAttendance::getDate, date));
zbfAttendanceVO.setLateNum(lateNum);
//早退人数
Integer earlyLeaveNum = baseMapper.selectCount(Wrappers.<WgzAttendance>lambdaQuery().eq(WgzAttendance::getEarlyLeave, 1)
.in(WgzAttendance::getRecruitId, recruitIds).eq(WgzAttendance::getDate, date));
zbfAttendanceVO.setEarlyLeaveNum(earlyLeaveNum);
}
//缺勤人数
zbfAttendanceVO.setAbsenceDutyNum(totalNum-zbfAttendanceVO.getReportToDutyNum()-zbfAttendanceVO.getLeaveNum());
return zbfAttendanceVO;
}
@Override
public List<BgtDayAttendanceCountVO> histogram(BgtAttendanceDTO dto) {
FbsProjectTask task = taskService.getById(dto.getTaskId());
@ -553,8 +612,16 @@ public class WgzAttendanceServiceImpl extends ServicePlusImpl<WgzAttendanceMappe
return DataUtil.fillMissingDates(bgtDayAttendanceCountVOS, startTime, endTime);
}
@Override
public List<ZbfDayAttendanceCountVO> zbfHistogram(ZbfAttendanceDTO dto) {
public void validTaskTime(FbsProjectTask task,LocalDate date){
LocalDate date = dto.getDate();
LocalDate startTime = date.minusDays(7);
List<ZbfDayAttendanceCountVO> zbfDayAttendanceCountVOS = countDayByProjectId(dto.getProjectId(), startTime, date);
return DataUtil.zbfFillMissingDates(zbfDayAttendanceCountVOS, startTime, date);
}
public void validTaskTime(FbsProjectTask task, LocalDate date){
LocalDate taskBeginTime = DateUtils.str2Localdate(task.getTaskBeginTime(), DateUtils.YYYY_MM_DD);
LocalDate taskEndTime = DateUtils.str2Localdate(task.getTaskEndTime(), DateUtils.YYYY_MM_DD);
if(taskEndTime == null){

View File

@ -529,9 +529,8 @@ public class WgzPayCalculationServiceImpl extends ServicePlusImpl<WgzPayCalculat
public TableDataInfo<BgtPayCalculationDetailListVO> record(BgtPayCalculationRecordDTO dto) {
LambdaQueryWrapper<WgzPayCalculation> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(WgzPayCalculation::getUserId, dto.getUserId())
.eq(WgzPayCalculation::getRecruitId, dto.getRecruitId())
.eq(dto.getRecruitId()!=null,WgzPayCalculation::getRecruitId, dto.getRecruitId())
.eq(WgzPayCalculation::getApplyKey, dto.getRecruitApplyId())
.eq(WgzPayCalculation::getAuditorUserId, SecurityUtils.getAppUserId())
.in(WgzPayCalculation::getAuditorType,AuditStatus.getAudit())
.orderByDesc(WgzPayCalculation::getCreateTime);
Page<WgzPayCalculation> result = page(PageUtils.buildPage(), wrapper);

View File

@ -0,0 +1,31 @@
package com.ruoyi.zbf.domain.dto;
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 org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotNull;
import java.time.LocalDate;
@Data
@NoArgsConstructor
@Accessors(chain = true)
@ApiModel("App总包方总体考勤查询对象")
public class ZbfAttendanceDTO {
@ApiModelProperty("项目ID")
@NotNull(message = "项目ID不能为空")
private Long projectId;
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty("日期")
private LocalDate date;
@ApiModelProperty("日期类型1日 2月")
private String dateType;
}

View File

@ -26,7 +26,7 @@ public class ZbfProjectListDTO {
@ApiModelProperty("项目名称")
private String projectName;
@ApiModelProperty("项目状态(0-未开工,1-已开工2已竣工3已停工)")
@ApiModelProperty("项目状态(1-已开工和未开工2已竣工)")
private String projectStatus;
}

View File

@ -4,8 +4,6 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
@Data
@ApiModel("分包商项目分包申请列表查询条件")
public class ZbfProjectSubApplyListDTO {
@ -17,9 +15,11 @@ public class ZbfProjectSubApplyListDTO {
private Integer pageNum;
@ApiModelProperty("分包ID")
@NotNull(message = "分包ID不能为空")
private Long subId;
@ApiModelProperty("分包申请ID")
private Long subApplyId;
@ApiModelProperty("名字")
private String username;
}

View File

@ -0,0 +1,44 @@
package com.ruoyi.zbf.domain.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Data
@NoArgsConstructor
@Accessors(chain = true)
@ApiModel("App总包方总体考勤统计视图对象")
public class ZbfAttendanceVO {
@ApiModelProperty("任务ID")
private Long projectId;
@ApiModelProperty("任务名")
private String projectName;
@ApiModelProperty("到岗人数")
private Integer reportToDutyNum = 0;
@ApiModelProperty("总人数")
private Integer totalNum = 0;
@ApiModelProperty("缺勤人数")
private Integer absenceDutyNum = 0;
@ApiModelProperty("请假人数")
private Integer leaveNum = 0;
@ApiModelProperty("迟到人数")
private Integer lateNum = 0;
@ApiModelProperty("外勤人数")
private Integer outDutyNum = 0;
@ApiModelProperty("早退人数")
private Integer earlyLeaveNum = 0;
@ApiModelProperty("到岗率")
private Integer reportToDutyRate= 0;
}

View File

@ -34,6 +34,9 @@ public class ZbfProjectSubcontractingApplyListVO {
@ApiModelProperty("头像")
private String avatarName;
@ApiModelProperty("公司ID")
private Long companyId;
@ApiModelProperty("公司名字")
private String companyName;

View File

@ -688,7 +688,7 @@ public class ZbfProjectServiceImpl extends ServicePlusImpl<ZbfProjectMapper, Zbf
sectionDeleteIds.addAll(sectionAddIds);
zbfProjectSectionService.remove(Wrappers.<ZbfProjectSection>lambdaQuery()
.eq(ZbfProjectSection::getProjectId, dto.getId())
.notIn(CollectionUtil.isNotEmpty(sectionDeleteIds), ZbfProjectSection::getId, sectionUpdateIds)
.notIn(CollectionUtil.isNotEmpty(sectionDeleteIds), ZbfProjectSection::getId, sectionDeleteIds)
);
//删除分包
@ -696,7 +696,7 @@ public class ZbfProjectServiceImpl extends ServicePlusImpl<ZbfProjectMapper, Zbf
subDeleteIds.addAll(subAddIds);
zbfProjectSubcontractingService.remove(Wrappers.<ZbfProjectSubcontracting>lambdaQuery()
.eq(ZbfProjectSubcontracting::getProjectId, dto.getId())
.notIn(CollectionUtil.isNotEmpty(subDeleteIds), ZbfProjectSubcontracting::getId, subUpdateIds)
.notIn(CollectionUtil.isNotEmpty(subDeleteIds), ZbfProjectSubcontracting::getId, subDeleteIds)
);
return update;
@ -793,7 +793,13 @@ public class ZbfProjectServiceImpl extends ServicePlusImpl<ZbfProjectMapper, Zbf
LambdaQueryWrapper<ZbfProject> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(ZbfProject::getUserId, SecurityUtils.getAppUserId());
wrapper.like(StrUtil.isNotBlank(dto.getProjectName()), ZbfProject::getProjectName, dto.getProjectName());
wrapper.eq(StrUtil.isNotBlank(dto.getProjectStatus()), ZbfProject::getProjectStatus, dto.getProjectStatus());
if(dto.getProjectStatus() != null){
if("1".equals(dto.getProjectStatus())){
wrapper.in(ZbfProject::getProjectStatus, ProjectStatus.getBuilding());
}else {
wrapper.eq(ZbfProject::getProjectStatus, dto.getProjectStatus());
}
}
wrapper.orderByDesc(ZbfProject::getId);
Page<ZbfProject> result = page(PageUtils.buildPage(), wrapper);
return PageUtils.buildDataInfo(result);

View File

@ -29,6 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
fu.username,
fu.phone,
fu.avatar_name,
fu.company_id,
cc.company_name
from zbf_project_subcontracting_apply zpsa
left join fbs_user fu on zpsa.fbs_user_id = fu.user_id