优化
This commit is contained in:
		@ -1,11 +1,14 @@
 | 
			
		||||
package com.ruoyi.bgt.domain.dto;
 | 
			
		||||
 | 
			
		||||
import com.ruoyi.wgz.domain.WgzPayCalculationFiles;
 | 
			
		||||
import io.swagger.annotations.ApiModel;
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
import lombok.experimental.Accessors;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 工资结算分页查询对象 wgz_pay_calculation
 | 
			
		||||
 *
 | 
			
		||||
@ -28,5 +31,7 @@ public class BgtPayCalculationUpdateDTO {
 | 
			
		||||
	@ApiModelProperty("审核意见")
 | 
			
		||||
	private String auditorOpinion;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("附件实体数据")
 | 
			
		||||
	private List<WgzPayCalculationFiles> payCalculation;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -56,5 +56,6 @@ public class BgtPayCalculationDetailBaseVO {
 | 
			
		||||
	private Long taskId;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("务工者Id")
 | 
			
		||||
	@JsonFormat(shape = JsonFormat.Shape.STRING)
 | 
			
		||||
	private Long userId;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -682,7 +682,7 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
 | 
			
		||||
	public BgtProjectRecruitApply getOneByUserIdAndRecruitId(Long userId, Long recruitId) {
 | 
			
		||||
 | 
			
		||||
		List<BgtProjectRecruitApply> list = baseMapper.selectList(Wrappers.<BgtProjectRecruitApply>lambdaQuery()
 | 
			
		||||
			.eq(BgtProjectRecruitApply::getRemark, recruitId)
 | 
			
		||||
			.eq(BgtProjectRecruitApply::getRecruitId, recruitId)
 | 
			
		||||
			.eq(BgtProjectRecruitApply::getUserId, userId)
 | 
			
		||||
			.in(BgtProjectRecruitApply::getStatus, RecruitApplyStatus.getWorkStatus())
 | 
			
		||||
			.orderByDesc(BgtProjectRecruitApply::getCreateTime));
 | 
			
		||||
 | 
			
		||||
@ -26,6 +26,7 @@ import com.ruoyi.common.core.domain.entity.SysUser;
 | 
			
		||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
 | 
			
		||||
import com.ruoyi.common.core.page.TableDataInfo;
 | 
			
		||||
import com.ruoyi.common.enums.AuditStatus;
 | 
			
		||||
import com.ruoyi.common.exception.BaseException;
 | 
			
		||||
import com.ruoyi.common.utils.PageUtils;
 | 
			
		||||
import com.ruoyi.common.utils.SecurityUtils;
 | 
			
		||||
import com.ruoyi.fbs.domain.FbsProjectTask;
 | 
			
		||||
@ -402,6 +403,10 @@ public class WgzPayCalculationServiceImpl extends ServicePlusImpl<WgzPayCalculat
 | 
			
		||||
				iWgzPayCalculationMiddleService.removeByIds(list.stream().map(WgzPayCalculationMiddle::getId).collect(Collectors.toList()));
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		//添加附件
 | 
			
		||||
		if(CollectionUtils.isNotEmpty(dto.getPayCalculation())){
 | 
			
		||||
			iWgzPayCalculationFilesService.saveBatch(dto.getPayCalculation());
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		//发消息
 | 
			
		||||
		HashMap<String, String> mp = new HashMap<>();
 | 
			
		||||
@ -525,6 +530,15 @@ public class WgzPayCalculationServiceImpl extends ServicePlusImpl<WgzPayCalculat
 | 
			
		||||
			});
 | 
			
		||||
		}
 | 
			
		||||
		updateBatchById(payList);
 | 
			
		||||
 | 
			
		||||
		//存附件
 | 
			
		||||
		List<WgzPayCalculationFiles> files = dto.getPayCalculation();
 | 
			
		||||
		if(CollectionUtil.isNotEmpty(files)){
 | 
			
		||||
			files.forEach(file -> {
 | 
			
		||||
				file.setCalculationId(payCalculation.getId());
 | 
			
		||||
			});
 | 
			
		||||
			iWgzPayCalculationFilesService.saveBatch(files);
 | 
			
		||||
		}
 | 
			
		||||
		return save;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@ -562,9 +576,18 @@ public class WgzPayCalculationServiceImpl extends ServicePlusImpl<WgzPayCalculat
 | 
			
		||||
			int sum = list.stream().mapToInt(WgzPayCalculation::getNum).sum();
 | 
			
		||||
			i = i - sum;
 | 
			
		||||
		}
 | 
			
		||||
		if(i<=0){
 | 
			
		||||
			throw new BaseException("工资已全部结算完毕");
 | 
			
		||||
		}
 | 
			
		||||
		vo.setNum(i);
 | 
			
		||||
 | 
			
		||||
		//个人信息
 | 
			
		||||
		WgzUser wgzUser = wgzUserService.findByUserId(userId);
 | 
			
		||||
		vo.setUserId(userId);
 | 
			
		||||
		vo.setUserName(wgzUser.getUsername());
 | 
			
		||||
		vo.setPhone(wgzUser.getPhone());
 | 
			
		||||
		vo.setBank(wgzUser.getBank());
 | 
			
		||||
		vo.setCardNo(wgzUser.getCardNo());
 | 
			
		||||
		return vo;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user