总包方

This commit is contained in:
zt
2025-04-10 09:31:24 +08:00
parent 069529f78c
commit f1814f781c
52 changed files with 1119 additions and 98 deletions

View File

@ -5,6 +5,8 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotNull;
@Data
@Accessors(chain = true)
@ApiModel("总包方任务进度列表查询对象")
@ -16,6 +18,7 @@ public class ZbfProgressListDTO {
@ApiModelProperty("当前页数")
private Integer pageNum;
@ApiModelProperty("项目ID")
private Long projectId;
@ApiModelProperty("项目分包Id")
@NotNull(message = "项目分包Id不能为空")
private Long subId;
}

View File

@ -0,0 +1,21 @@
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 ZbfSubBgtListDTO {
@ApiModelProperty("分页大小")
private Integer pageSize;
/** 当前页数 */
@ApiModelProperty("当前页数")
private Integer pageNum;
@ApiModelProperty("分包ID")
@NotNull(message = "分包ID不能为空")
private Long subId;
}

View File

@ -5,7 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel("分包商项目分包切换列表查询条件")
@ApiModel("总包方项目分包切换列表查询条件")
public class ZbfSubSwitchListDTO {
@ApiModelProperty("分页大小")

View File

@ -0,0 +1,35 @@
package com.ruoyi.zbf.domain.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 分包商工资申请分页查询对象 fbs_wage_application
*
* @author ruoyi
* @date 2025-03-26
*/
@Data
@ApiModel("总包方工资审核查询对象")
public class ZbfWageApplicationListDTO {
/** 分页大小 */
@ApiModelProperty("分页大小")
private Integer pageSize;
/** 当前页数 */
@ApiModelProperty("当前页数")
private Integer pageNum;
@ApiModelProperty("类型0-申请中 1-已结算")
private Integer type;
@ApiModelProperty("项目Id")
private Long projectId;
@ApiModelProperty("项目分包Id")
private Long subId;
}

View File

@ -0,0 +1,28 @@
package com.ruoyi.zbf.domain.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* 包工头工资申请分页查询对象 bgt_wage_application
*
* @author ruoyi
* @date 2025-02-20
*/
@Data
@ApiModel("App包工头工资申请分页查询对象")
public class ZbfWageAuditDTO {
@ApiModelProperty("主键ID")
@NotNull(message = "主键ID不能为空")
private Long id;
@ApiModelProperty("审核状态1审核中 2已审核 3未通过")
private String auditStatus;
}

View File

@ -0,0 +1,16 @@
package com.ruoyi.zbf.domain.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@Data
@ApiModel("分包商修改用户信息")
public class ZfbUserInfoUpdateDTO {
@ApiModelProperty("头像")
@NotBlank(message = "头像不能为空")
private String avatarName;
}

View File

@ -16,6 +16,6 @@ public class ZbfProgressListVO {
@ApiModelProperty("进度")
private Integer progress;
@ApiModelProperty("项目名称")
@ApiModelProperty("任务名称")
private String taskName;
}

View File

@ -16,7 +16,7 @@ import lombok.experimental.Accessors;
@NoArgsConstructor
@Accessors(chain = true)
@ApiModel("App总包方项目详情-任务进度视图对象")
public class ZbfProjectDetailProgressVO {
public class ZbfProgressVO {
@ApiModelProperty("总进度")
private Integer totalProgress = 0;

View File

@ -0,0 +1,29 @@
package com.ruoyi.zbf.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel("总包方分包详情班组长列表视图对象")
public class ZbfSubBgtListVO {
@ApiModelProperty("主键ID")
private String id;
@ApiModelProperty("唯一标识")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long userId;
@ApiModelProperty("姓名")
private String username;
@ApiModelProperty("联系电话")
private String phone;
@ApiModelProperty("头像地址")
private String avatarName;
}

View File

@ -0,0 +1,23 @@
package com.ruoyi.zbf.domain.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel("总包方分包用工数量统计")
public class ZbfSubPersonCountVO {
@ApiModelProperty("人员总数")
private Integer totalCount;
@ApiModelProperty("进场总数")
private Integer entryCount;
@ApiModelProperty("退场总数")
private Integer leaveCount;
}

View File

@ -1,10 +1,13 @@
package com.ruoyi.zbf.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.mybatisplus.cache.MybatisPlusRedisCache;
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
import com.ruoyi.zbf.domain.ZbfProjectSubcontracting;
import com.ruoyi.zbf.domain.dto.ZbfSubBgtListDTO;
import com.ruoyi.zbf.domain.vo.ZbfSubBgtListVO;
import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Param;
/**
* 总包方项目分包Mapper接口
@ -16,4 +19,5 @@ import org.apache.ibatis.annotations.CacheNamespace;
@CacheNamespace(implementation = MybatisPlusRedisCache.class, eviction = MybatisPlusRedisCache.class)
public interface ZbfProjectSubcontractingMapper extends BaseMapperPlus<ZbfProjectSubcontracting> {
Page<ZbfSubBgtListVO> bgtList(@Param("page") Page<ZbfSubBgtListDTO> page, @Param("dto") ZbfSubBgtListDTO dto);
}

View File

@ -57,4 +57,16 @@ public interface IZbfMessageService extends IServicePlus<ZbfMessage> {
* 发送消息
*/
Boolean sendAMessage(ZbfMessage bo);
/**
* 已操作
*/
void operation(String senderType,Long senderId,String recipientType,Long recipientId,Long tableId,String tableName);
/**
* 批量已操作
*/
void operationBatch(String recipientType,Long recipientId,List<Long> tableIds,String tableName);
}

View File

@ -172,7 +172,7 @@ public interface IZbfProjectService extends IServicePlus<ZbfProject> {
/**
* 总包方项目详情-用工进度
*/
ZbfProjectDetailProgressVO zbfProgress(Long projectId);
ZbfProgressVO zbfProgress(Long projectId);
/**
* 总包方项目详情-用工进度列表
@ -184,10 +184,6 @@ public interface IZbfProjectService extends IServicePlus<ZbfProject> {
*/
ZbfProjectDetailWageVO zbfWage(Long projectId);
/**
* 总包方项目详情-付款情况查看更多
*/
TableDataInfo<ZbfWageApplicationVO> zbfWageList(Long projectId);
/**
* 总包方项目详情-项目切换
*/

View File

@ -5,6 +5,10 @@ import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.zbf.bo.ZbfProjectSubcontractingQueryBo;
import com.ruoyi.zbf.domain.ZbfProjectSubcontracting;
import com.ruoyi.zbf.domain.dto.ZbfProgressListDTO;
import com.ruoyi.zbf.domain.dto.ZbfSubBgtListDTO;
import com.ruoyi.zbf.domain.vo.*;
import org.springframework.validation.annotation.Validated;
import java.util.Collection;
import java.util.List;
@ -54,4 +58,28 @@ public interface IZbfProjectSubcontractingService extends IServicePlus<ZbfProjec
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
/**
* 总包方项目分包详情-分包商人员总数
*/
ZbfSubPersonCountVO subPersonCount(Long subId);
/**
* 总包方项目分包详情-班组长列表
*/
TableDataInfo<ZbfSubBgtListVO> bgtList(ZbfSubBgtListDTO dto);
/**
* 总包方项目分包详情-用工进度
*/
ZbfProgressVO zbfSubProgress(Long subId);
/**
* 总包方项目分包详情-用工进度列表
*/
TableDataInfo<ZbfProgressListVO> zbfSubProgressList(@Validated ZbfProgressListDTO dto);
/**
* 总包方项目详情-付款情况
*/
ZbfProjectDetailWageVO zbfSubWage(Long subId);
}

View File

@ -68,4 +68,19 @@ public interface IZbfUserService extends IServicePlus<ZbfUser> {
* 企业认证
*/
Long authenticate(CompanyAuthenticateDTO dto);
/**
* 根据信用代码查询用户
*/
ZbfUser selectUserByCreditCode(String creditCode);
/**
* 登录查询
*/
ZbfUser loginSelect(String key);
/**
* 修改头像
*/
Boolean editAvatar(String avatarName);
}

View File

@ -3,6 +3,7 @@ package com.ruoyi.zbf.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
@ -18,6 +19,8 @@ import java.util.Collection;
import java.util.List;
import java.util.Map;
import static com.ruoyi.common.constants.WgzAndBgtMessageConstant.OPERATION_ALREADY;
/**
* 消息Service业务层处理
*
@ -96,4 +99,29 @@ public class ZbfMessageServiceImpl extends ServicePlusImpl<ZbfMessageMapper, Zbf
public Boolean sendAMessage(ZbfMessage bo) {
return save(bo);
}
@Override
public void operation(String senderType, Long senderId, String recipientType, Long recipientId, Long tableId, String tableName) {
LambdaUpdateWrapper<ZbfMessage> wrapper = new LambdaUpdateWrapper<>();
wrapper.eq(ZbfMessage::getRecipientId, recipientId);
wrapper.eq(ZbfMessage::getRecipientType, recipientType);
wrapper.eq(ZbfMessage::getSenderId, senderId);
wrapper.eq(ZbfMessage::getSenderType, senderType);
wrapper.eq(ZbfMessage::getTableId, tableId);
wrapper.eq(ZbfMessage::getTableName, tableName);
wrapper.set(ZbfMessage::getIsOperation, OPERATION_ALREADY);
update(wrapper);
}
@Override
public void operationBatch(String recipientType, Long recipientId, List<Long> tableIds, String tableName) {
LambdaUpdateWrapper<ZbfMessage> wrapper = new LambdaUpdateWrapper<>();
wrapper.eq(ZbfMessage::getRecipientId, recipientId);
wrapper.eq(ZbfMessage::getRecipientType, recipientType);
wrapper.in(ZbfMessage::getTableId, tableIds);
wrapper.eq(ZbfMessage::getTableName, tableName);
wrapper.set(ZbfMessage::getIsOperation, OPERATION_ALREADY);
update(wrapper);
}
}

View File

@ -27,7 +27,9 @@ import com.ruoyi.fbs.domain.dto.FbsProjectListDTO;
import com.ruoyi.fbs.domain.vo.*;
import com.ruoyi.fbs.service.IFbsProjectTaskService;
import com.ruoyi.fbs.service.IFbsWageApplicationService;
import com.ruoyi.wgz.domain.WgzPayCalculation;
import com.ruoyi.wgz.service.IWgzAttendanceService;
import com.ruoyi.wgz.service.IWgzPayCalculationService;
import com.ruoyi.zbf.bo.ZbfProjectQueryBo;
import com.ruoyi.zbf.domain.ZbfProject;
import com.ruoyi.zbf.domain.ZbfProjectSection;
@ -77,6 +79,8 @@ public class ZbfProjectServiceImpl extends ServicePlusImpl<ZbfProjectMapper, Zbf
private IBgtProjectRecruitApplyService bgtProjectRecruitApplyService;
@Autowired
private IWgzAttendanceService wgzAttendanceService;
@Autowired
private IWgzPayCalculationService wgzPayCalculationService;
@Override
@ -519,7 +523,7 @@ public class ZbfProjectServiceImpl extends ServicePlusImpl<ZbfProjectMapper, Zbf
//查询所有创建的任务
List<FbsProjectTask> taskList = fbsProjectTaskService.list(Wrappers.<FbsProjectTask>lambdaQuery()
.eq(FbsProjectTask::getCreateId, SecurityUtils.getAppUserId())
.eq(FbsProjectTask::getProjectId, dto)
.eq(FbsProjectTask::getProjectId, dto.getProjectId())
);
List<Long> taskIds = taskList.stream().map(FbsProjectTask::getId).collect(Collectors.toList());
if(CollectionUtil.isNotEmpty(taskIds)){
@ -728,12 +732,12 @@ public class ZbfProjectServiceImpl extends ServicePlusImpl<ZbfProjectMapper, Zbf
}
@Override
public ZbfProjectDetailProgressVO zbfProgress(Long projectId) {
public ZbfProgressVO zbfProgress(Long projectId) {
//查询所有创建的任务
List<FbsProjectTask> taskList = fbsProjectTaskService.list(Wrappers.<FbsProjectTask>lambdaQuery()
.eq(FbsProjectTask::getProjectId, projectId)
);
ZbfProjectDetailProgressVO vo = new ZbfProjectDetailProgressVO();
ZbfProgressVO vo = new ZbfProgressVO();
List<Long> taskIds = taskList.stream().map(FbsProjectTask::getId).collect(Collectors.toList());
if(CollectionUtil.isNotEmpty(taskIds)){
List<BgtProjectTaskProgress> progressByTaskIds = bgtProjectTaskProgressService.getProgressByTaskIds(taskIds);
@ -772,20 +776,32 @@ public class ZbfProjectServiceImpl extends ServicePlusImpl<ZbfProjectMapper, Zbf
BigDecimal totalAmount = subList.stream().map(ZbfProjectSubcontracting::getSubAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
vo.setTotalAmount(totalAmount);
//接收金额
//已结算金额
vo.setPayAmount(BigDecimal.ZERO);
BigDecimal wgzAmount = BigDecimal.ZERO;
if(CollectionUtil.isNotEmpty(subIds)){
List<FbsWageApplication> passList= fbsWageApplicationService.getPassListBySubIds(subIds);
BigDecimal payAmount = passList.stream().map(FbsWageApplication::getApplicantAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
vo.setPayAmount(payAmount);
//查询分包下的任务
List<FbsProjectTask> taskList = fbsProjectTaskService.list(Wrappers.<FbsProjectTask>lambdaQuery()
.in(FbsProjectTask::getSubId, subIds)
);
List<Long> taskIds = taskList.stream().map(FbsProjectTask::getId).collect(Collectors.toList());
if(CollectionUtil.isNotEmpty(taskIds)){
List<WgzPayCalculation> passListByTaskIds = wgzPayCalculationService.getPassListByTaskIds(taskIds);
for (WgzPayCalculation wgzPayCalculation : passListByTaskIds){
BigDecimal multiply = wgzPayCalculation.getRecruitAmount().multiply(new BigDecimal(wgzPayCalculation.getNum()));
wgzAmount = wgzAmount.add(multiply);
}
}
}
vo.setWgzAmount(wgzAmount);
return vo;
}
@Override
public TableDataInfo<ZbfWageApplicationVO> zbfWageList(Long projectId) {
return null;
}
@Override
public TableDataInfo<ZbfProject> zbfSwitchList(ZbfProjectSwitchListDTO dto) {

View File

@ -1,22 +1,38 @@
package com.ruoyi.zbf.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
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.ruoyi.bgt.domain.BgtProjectRecruitApply;
import com.ruoyi.bgt.domain.BgtProjectTaskProgress;
import com.ruoyi.bgt.service.IBgtProjectRecruitApplyService;
import com.ruoyi.bgt.service.IBgtProjectTaskProgressService;
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.RecruitApplyStatus;
import com.ruoyi.common.utils.PageUtils;
import com.ruoyi.fbs.domain.FbsProjectTask;
import com.ruoyi.fbs.domain.FbsWageApplication;
import com.ruoyi.fbs.service.IFbsProjectTaskService;
import com.ruoyi.fbs.service.IFbsWageApplicationService;
import com.ruoyi.wgz.domain.WgzPayCalculation;
import com.ruoyi.wgz.service.IWgzPayCalculationService;
import com.ruoyi.zbf.bo.ZbfProjectSubcontractingQueryBo;
import com.ruoyi.zbf.domain.ZbfProjectSubcontracting;
import com.ruoyi.zbf.domain.dto.ZbfProgressListDTO;
import com.ruoyi.zbf.domain.dto.ZbfSubBgtListDTO;
import com.ruoyi.zbf.domain.vo.*;
import com.ruoyi.zbf.mapper.ZbfProjectSubcontractingMapper;
import com.ruoyi.zbf.service.IZbfProjectSubcontractingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
/**
* 总包方项目分包Service业务层处理
@ -27,6 +43,17 @@ import java.util.Map;
@Service
public class ZbfProjectSubcontractingServiceImpl extends ServicePlusImpl<ZbfProjectSubcontractingMapper, ZbfProjectSubcontracting> implements IZbfProjectSubcontractingService {
@Autowired
private IFbsProjectTaskService fbsProjectTaskService;
@Autowired
private IBgtProjectRecruitApplyService bgtProjectRecruitApplyService;
@Autowired
private IBgtProjectTaskProgressService bgtProjectTaskProgressService;
@Autowired
private IFbsWageApplicationService fbsWageApplicationService;
@Autowired
private IWgzPayCalculationService wgzPayCalculationService;
@Override
public ZbfProjectSubcontracting queryById(Long id){
return getById(id);
@ -86,4 +113,102 @@ public class ZbfProjectSubcontractingServiceImpl extends ServicePlusImpl<ZbfProj
}
return removeByIds(ids);
}
@Override
public ZbfSubPersonCountVO subPersonCount(Long subId) {
//查询分包下的所有任务
int entryCount = 0;
int leaveCount = 0;
List<FbsProjectTask> taskList = fbsProjectTaskService.list(Wrappers.<FbsProjectTask>lambdaQuery()
.eq(FbsProjectTask::getSubId, subId));
if (CollectionUtil.isNotEmpty(taskList)){
List<Long> taskIds = taskList.stream().map(FbsProjectTask::getId).collect(Collectors.toList());
List<BgtProjectRecruitApply> recruitApplyList = bgtProjectRecruitApplyService.list(Wrappers.<BgtProjectRecruitApply>lambdaQuery()
.in(BgtProjectRecruitApply::getTaskId, taskIds)
.in(BgtProjectRecruitApply::getStatus, RecruitApplyStatus.getWorkStatus()));
entryCount = (int) recruitApplyList.stream().filter(recruitApply -> RecruitApplyStatus.WORKING.getCode().equals(recruitApply.getStatus())).count();
leaveCount = (int) recruitApplyList.stream().filter(recruitApply -> RecruitApplyStatus.OUT_WORK.getCode().equals(recruitApply.getStatus())).count();
}
ZbfSubPersonCountVO vo = new ZbfSubPersonCountVO();
vo.setEntryCount(entryCount);
vo.setLeaveCount(leaveCount);
vo.setTotalCount(entryCount+leaveCount);
return vo;
}
@Override
public TableDataInfo<ZbfSubBgtListVO> bgtList(ZbfSubBgtListDTO dto) {
Page<ZbfSubBgtListDTO> queryDTOPage = new Page<>();
queryDTOPage.setCurrent(dto.getPageNum());
queryDTOPage.setSize(dto.getPageSize());
Page<ZbfSubBgtListVO> page = baseMapper.bgtList(queryDTOPage, dto);
return PageUtils.buildDataInfo(page);
}
@Override
public ZbfProgressVO zbfSubProgress(Long subId) {
//查询所有创建的任务
List<FbsProjectTask> taskList = fbsProjectTaskService.list(Wrappers.<FbsProjectTask>lambdaQuery()
.eq(FbsProjectTask::getSubId, subId)
);
ZbfProgressVO vo = new ZbfProgressVO();
List<Long> taskIds = taskList.stream().map(FbsProjectTask::getId).collect(Collectors.toList());
if(CollectionUtil.isNotEmpty(taskIds)){
List<BgtProjectTaskProgress> progressByTaskIds = bgtProjectTaskProgressService.getProgressByTaskIds(taskIds);
vo.setProgress(progressByTaskIds.stream().mapToInt(BgtProjectTaskProgress::getProgress).sum());
vo.setTotalProgress(taskList.size() * 100);
}
return vo;
}
@Override
public TableDataInfo<ZbfProgressListVO> zbfSubProgressList(ZbfProgressListDTO dto) {
Page<ZbfProgressListVO> voPage = new Page<>();
//查询所有创建的任务
List<FbsProjectTask> taskList = fbsProjectTaskService.list(Wrappers.<FbsProjectTask>lambdaQuery()
.eq(FbsProjectTask::getSubId, dto.getSubId())
);
List<Long> taskIds = taskList.stream().map(FbsProjectTask::getId).collect(Collectors.toList());
if(CollectionUtil.isNotEmpty(taskIds)){
TableDataInfo<BgtProjectTaskProgress> progressByTaskIds = bgtProjectTaskProgressService.getProgressByTaskIds(dto.getPageSize(), dto.getPageNum(), taskIds);
voPage.setTotal(progressByTaskIds.getTotal());
voPage.setRecords(BeanUtil.copyToList(progressByTaskIds.getRows(), ZbfProgressListVO.class));
}
return PageUtils.buildDataInfo(voPage);
}
@Override
public ZbfProjectDetailWageVO zbfSubWage(Long subId) {
ZbfProjectDetailWageVO vo = new ZbfProjectDetailWageVO();
ZbfProjectSubcontracting subcontracting = getById(subId);
//总金额
vo.setTotalAmount(subcontracting.getSubAmount());
//已结算金额
vo.setPayAmount(BigDecimal.ZERO);
BigDecimal wgzAmount = BigDecimal.ZERO;
List<FbsWageApplication> passList = fbsWageApplicationService.getPassListBySubIds(Collections.singletonList(subId));
BigDecimal payAmount = passList.stream().map(FbsWageApplication::getApplicantAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
vo.setPayAmount(payAmount);
//查询分包下的任务
List<FbsProjectTask> taskList = fbsProjectTaskService.list(Wrappers.<FbsProjectTask>lambdaQuery()
.eq(FbsProjectTask::getSubId, subId)
);
List<Long> taskIds = taskList.stream().map(FbsProjectTask::getId).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(taskIds)) {
List<WgzPayCalculation> passListByTaskIds = wgzPayCalculationService.getPassListByTaskIds(taskIds);
for (WgzPayCalculation wgzPayCalculation : passListByTaskIds) {
BigDecimal multiply = wgzPayCalculation.getRecruitAmount().multiply(new BigDecimal(wgzPayCalculation.getNum()));
wgzAmount = wgzAmount.add(multiply);
}
}
vo.setWgzAmount(wgzAmount);
return vo;
}
}

View File

@ -10,7 +10,9 @@ import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.domain.Company;
import com.ruoyi.common.domain.dto.CompanyAuthenticateDTO;
import com.ruoyi.common.exception.BaseException;
import com.ruoyi.common.service.ICompanyService;
import com.ruoyi.common.util.ValidUtil;
import com.ruoyi.common.utils.PageUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.zbf.bo.ZbfUserQueryBo;
@ -118,6 +120,26 @@ public class ZbfUserServiceImpl extends ServicePlusImpl<ZbfUserMapper, ZbfUser>
@Override
public Long authenticate(CompanyAuthenticateDTO dto) {
// 校验银行卡号
if (!ValidUtil.isValidBankCard(dto.getCardNo())) {
throw new BaseException("银行卡号格式不正确");
}
//校验电话
if (!ValidUtil.isValidChineseMobile(dto.getContactPhone())) {
throw new BaseException("手机号格式不正确");
}
boolean b = ValidUtil.verifyCreditCode(dto.getCreditCode());
if (!b) {
throw new BaseException("统一社会信用代码格式不正确");
}
Company companyByCreditCode = companyService.getCompanyByCreditCode(dto.getCreditCode());
if (companyByCreditCode != null) {
throw new RuntimeException("该企业已认证");
}
Company company = BeanUtil.copyProperties(dto, Company.class);
companyService.save(company);
ZbfUser zbfUser = selectUserByUserId(SecurityUtils.getAppUserId());
@ -125,4 +147,30 @@ public class ZbfUserServiceImpl extends ServicePlusImpl<ZbfUserMapper, ZbfUser>
updateById(zbfUser);
return company.getId();
}
@Override
public ZbfUser selectUserByCreditCode(String creditCode) {
Company company = companyService.getCompanyByCreditCode(creditCode);
if (company != null) {
return baseMapper.selectOne(new LambdaQueryWrapper<ZbfUser>().eq(ZbfUser::getCompanyId, company.getId()));
}
return null;
}
@Override
public ZbfUser loginSelect(String key) {
ZbfUser zbfUser = selectUserByPhone(key);
if(zbfUser != null){
return zbfUser;
}
zbfUser = selectUserByCreditCode(key);
return zbfUser;
}
@Override
public Boolean editAvatar(String avatarName) {
ZbfUser zbfUser = selectUserByUserId(SecurityUtils.getAppUserId());
zbfUser.setAvatarName(avatarName);
return updateById(zbfUser);
}
}