总包方

This commit is contained in:
zt
2025-04-11 11:39:38 +08:00
parent f1814f781c
commit b52be6eeab
25 changed files with 410 additions and 71 deletions

View File

@ -0,0 +1,26 @@
package com.ruoyi.zbf.domain.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
@Data
@ApiModel("分包商项目切换列表查询条件")
public class ZbfProjectTaskDTO {
@ApiModelProperty("分页大小")
private Integer pageSize;
/** 当前页数 */
@ApiModelProperty("当前页数")
private Integer pageNum;
@ApiModelProperty("分包ID")
@NotNull(message = "分包ID不能为空")
private Long subId;
@ApiModelProperty("包工头用户Id")
@NotNull(message = "包工头用户Id不能为空")
private Long bgtUserId;
}

View File

@ -0,0 +1,32 @@
package com.ruoyi.zbf.domain.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
@Data
@ApiModel("分包商任务详情务工者申请列表查询对象")
public class ZbfProjectTaskUserDTO {
@ApiModelProperty("分页大小")
private Integer pageSize;
/** 当前页数 */
@ApiModelProperty("当前页数")
private Integer pageNum;
@ApiModelProperty("包工头用户ID")
@NotNull(message = "包工头用户ID不能为空")
private Long bgtUserId;
@ApiModelProperty("分包ID")
@NotNull(message = "分包ID不能为空")
private Long subId;
@ApiModelProperty("选择状态5-进场6-离场")
private Integer status;
@ApiModelProperty("务工者名字")
private String username;
}

View File

@ -0,0 +1,20 @@
package com.ruoyi.zbf.domain.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
@Data
@ApiModel("总包方项目分包查看包工头所有任务查询参数")
public class ZbfTaskAllDTO {
@ApiModelProperty("包工头用户ID")
@NotNull(message = "包工头用户ID不能为空")
private Long bgtUserId;
@ApiModelProperty("分包ID")
@NotNull(message = "分包ID不能为空")
private Long subId;
}

View File

@ -514,6 +514,10 @@ public class ZbfProjectServiceImpl extends ServicePlusImpl<ZbfProjectMapper, Zbf
vo.setProgress(progressByTaskIds.stream().mapToInt(BgtProjectTaskProgress::getProgress).sum());
vo.setTotalProgress(taskList.size() * 100);
}
if(vo.getTotalProgress() != 0){
int i = new BigDecimal(vo.getProgress()).divide(new BigDecimal(vo.getTotalProgress()), 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100)).intValue();
vo.setProgressCompute(i);
}
return vo;
}

View File

@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
import com.ruoyi.common.core.domain.entity.FbsUser;
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.ProjectStatus;
@ -17,6 +18,7 @@ import com.ruoyi.common.utils.PageUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.fbs.domain.FbsMessage;
import com.ruoyi.fbs.service.IFbsMessageService;
import com.ruoyi.fbs.service.IFbsUserService;
import com.ruoyi.zbf.bo.ZbfProjectSubcontractingApplyQueryBo;
import com.ruoyi.zbf.domain.ZbfMessage;
import com.ruoyi.zbf.domain.ZbfProject;
@ -34,6 +36,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.stream.Collectors;
import static com.ruoyi.common.constants.BgtMessageConstant.HEADLINE;
import static com.ruoyi.common.constants.BgtMessageConstant.SUBHEADING;
@ -58,6 +61,8 @@ public class ZbfProjectSubcontractingApplyServiceImpl extends ServicePlusImpl<Zb
private IFbsMessageService fbsMessageService;
@Autowired
private IZbfMessageService zbfMessageService;
@Autowired
private IFbsUserService fbsUserService;
@Override
@ -92,6 +97,10 @@ public class ZbfProjectSubcontractingApplyServiceImpl extends ServicePlusImpl<Zb
public Boolean insert(ZbfProjectSubcontractingApply bo) {
ZbfProjectSubcontractingApply add = BeanUtil.toBean(bo, ZbfProjectSubcontractingApply.class);
Long appUserId = SecurityUtils.getAppUserId();
FbsUser fbsUser = fbsUserService.selectUserByUserId(appUserId);
if( fbsUser.getCompanyId()==null){
throw new BaseException("尚未企业认证");
}
add.setFbsUserId(appUserId);
validEntityBeforeSave(add);
ZbfProjectSubcontracting sub = projectSubcontractingService.getById(bo.getSubId());
@ -230,7 +239,7 @@ public class ZbfProjectSubcontractingApplyServiceImpl extends ServicePlusImpl<Zb
fbsMessages.add(fbsMessage);
}
fbsMessageService.saveBatch(fbsMessages);
// fbsMessageService.operationBatch(USERTYPE_FBS,SecurityUtils.getAppUserId(),list.stream().map(FbsProjectTaskApply::getId).collect(Collectors.toList()),SqlHelper.table(FbsProjectTaskApply.class).getTableName());
zbfMessageService.operationBatch(USERTYPE_ZBF,SecurityUtils.getAppUserId(),list.stream().map(ZbfProjectSubcontractingApply::getId).collect(Collectors.toList()),SqlHelper.table(ZbfProjectSubcontractingApply.class).getTableName());
return super.updateBatchById(list);
}