优化
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; | ||||
| 	} | ||||
| } | ||||
|  | ||||
| @ -117,7 +117,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||||
|         CASE | ||||
|         WHEN wa.leave_mark_id = 1 THEN '请假' | ||||
|         WHEN wa.late = 0 and wa.early_leave = 0 and wa.missed_in = 0 and wa.missed_out = 0 THEN '正常' | ||||
|         WHEN wa.late = 1 or wa.early_leave = 1 or wa.missed_in = 1 or wa.missed_out = 1 THEN '异常' | ||||
|         WHEN wa.late = 1 or wa.early_leave = 1 or wa.clock_in_time is null or wa.clock_out_time is null THEN '异常' | ||||
|         ELSE '异常' | ||||
|         END AS attendance_status | ||||
|         FROM bgt_project_recruit_apply bpra | ||||
| @ -131,7 +131,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||||
|             and (wa.late = 0 and wa.early_leave = 0 and wa.missed_in = 0 and wa.missed_out = 0) and leave_mark_id is null | ||||
|         </if> | ||||
|         <if test="dto.attendanceType !=null and dto.attendanceType ==2 "> | ||||
|             and (wa.late = 1 or wa.early_leave = 1 or wa.missed_in = 1 or wa.missed_out = 1) and leave_mark_id is null | ||||
|             and (wa.late = 1 or wa.early_leave = 1 or wa.clock_in_time is null or wa.clock_out_time is null) and leave_mark_id is null | ||||
|         </if> | ||||
|         <if test="dto.attendanceType !=null and dto.attendanceType ==3 "> | ||||
|             and wa.leave_mark_id = 1 | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 zt
					zt