优化
This commit is contained in:
		| @ -9,6 +9,7 @@ import com.ruoyi.bgt.bo.BgtMessageQueryBo; | ||||
| import com.ruoyi.bgt.domain.BgtMessage; | ||||
| import com.ruoyi.bgt.domain.BgtProjectRecruit; | ||||
| import com.ruoyi.bgt.domain.BgtProjectRecruitApply; | ||||
| import com.ruoyi.bgt.domain.BgtWageApplication; | ||||
| import com.ruoyi.bgt.domain.dto.BgtMessageDetailDTO; | ||||
| import com.ruoyi.bgt.domain.dto.BgtMessageMyListDTO; | ||||
| import com.ruoyi.bgt.domain.vo.BgtMessageCountVO; | ||||
| @ -18,6 +19,7 @@ import com.ruoyi.bgt.mapper.BgtMessageMapper; | ||||
| import com.ruoyi.bgt.service.IBgtMessageService; | ||||
| import com.ruoyi.bgt.service.IBgtProjectRecruitApplyService; | ||||
| import com.ruoyi.bgt.service.IBgtProjectRecruitService; | ||||
| import com.ruoyi.bgt.service.IBgtWageApplicationService; | ||||
| import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; | ||||
| import com.ruoyi.common.core.page.TableDataInfo; | ||||
| import com.ruoyi.common.enums.BgtMessageType; | ||||
| @ -76,6 +78,9 @@ public class BgtMessageServiceImpl extends ServicePlusImpl<BgtMessageMapper, Bgt | ||||
| 	@Autowired | ||||
| 	private IWgzDailyClockService dailyClockService; | ||||
|  | ||||
| 	@Autowired | ||||
| 	private IBgtWageApplicationService wageApplicationService; | ||||
|  | ||||
| 	@Override | ||||
| 	public BgtMessage queryById(Long id) { | ||||
| 		return getById(id); | ||||
| @ -201,7 +206,8 @@ public class BgtMessageServiceImpl extends ServicePlusImpl<BgtMessageMapper, Bgt | ||||
| 				FbsProjectTask task = taskService.getById(message.getTableId()); | ||||
| 				bgtMessageDetailVO.setTaskName(task.getTaskName()); | ||||
| 			} else if (BGT_LARGE_SETTLEMENT.equals(message.getMessageLargeType())) { | ||||
| 				FbsProjectTask task = taskService.getById(message.getTableId()); | ||||
| 				BgtWageApplication wageApplication = wageApplicationService.getById(message.getTableId()); | ||||
| 				FbsProjectTask task = taskService.getById(wageApplication.getTaskId()); | ||||
| 				bgtMessageDetailVO.setTaskName(task.getTaskName()); | ||||
| 			} else if (BGT_LARGE_OTHER.equals(message.getMessageLargeType())) { | ||||
| 				switch (message.getMessageSmallType()) { | ||||
| @ -218,27 +224,27 @@ public class BgtMessageServiceImpl extends ServicePlusImpl<BgtMessageMapper, Bgt | ||||
| 					case BGT_SMALL_LEAVE: | ||||
| 						WgzLeave wgzLeave = leaveService.getById(message.getTableId()); | ||||
| 						bgtMessageDetailVO.setReason(wgzLeave.getReason()); | ||||
| 						bgtMessageDetailVO.setUsername(wgzUserService.getById(wgzLeave.getUserId()).getUsername()); | ||||
| 						bgtMessageDetailVO.setUsername(wgzUserService.findByUserId(wgzLeave.getUserId()).getUsername()); | ||||
| 						bgtMessageDetailVO.setStartTime(wgzLeave.getStartTime()); | ||||
| 						bgtMessageDetailVO.setEndTime(wgzLeave.getEndTime()); | ||||
| 						break; | ||||
| 					case BGT_SMALL_MAKE_UP: | ||||
| 						WgzReissueacard reissueCard = reissueacardService.getById(message.getTableId()); | ||||
| 						bgtMessageDetailVO.setReason(reissueCard.getReason()); | ||||
| 						bgtMessageDetailVO.setUsername(wgzUserService.getById(reissueCard.getUserId()).getUsername()); | ||||
| 						bgtMessageDetailVO.setUsername(wgzUserService.findByUserId(reissueCard.getUserId()).getUsername()); | ||||
| 						bgtMessageDetailVO.setNowTime(reissueCard.getNowTime()); | ||||
| 						break; | ||||
| 					case BGT_SMALL_REPORT_MAKE_UP: | ||||
| 						WgzDailyClock dailyClock = dailyClockService.getById(message.getTableId()); | ||||
| 						BgtProjectRecruit recruitClock = recruitService.getById(dailyClock.getRecruitId()); | ||||
| 						bgtMessageDetailVO.setUsername(wgzUserService.getById(dailyClock.getUserId()).getUsername()); | ||||
| 						bgtMessageDetailVO.setUsername(wgzUserService.findByUserId(dailyClock.getUserId()).getUsername()); | ||||
| 						bgtMessageDetailVO.setRecruitName(recruitClock.getRecruitName()); | ||||
| 						break; | ||||
| 					default: | ||||
| 						break; | ||||
| 				} | ||||
| 				bgtMessageVOS.add(bgtMessageDetailVO); | ||||
| 			} | ||||
| 			bgtMessageVOS.add(bgtMessageDetailVO); | ||||
| 		} | ||||
| 		bgtMessageVOPage.setRecords(bgtMessageVOS); | ||||
| 		return PageUtils.buildDataInfo(bgtMessageVOPage); | ||||
|  | ||||
| @ -102,7 +102,7 @@ public class BgtWageApplicationServiceImpl extends ServicePlusImpl<BgtWageApplic | ||||
| 			.setHeadline(map.get(HEADLINE)) | ||||
| 			.setSubheading(map.get(SUBHEADING)) | ||||
| 			.setTableId(add.getId()) | ||||
| 			.setTableName(SqlHelper.table(FbsProjectTask.class).getTableName()) | ||||
| 			.setTableName(SqlHelper.table(BgtWageApplication.class).getTableName()) | ||||
| 			.setMessageLargeType(BGT_LARGE_SETTLEMENT); | ||||
| 		bgtMessageService.sendAMessage(bgtMessage); | ||||
|         return save; | ||||
|  | ||||
| @ -28,6 +28,9 @@ public class WgzAppUserReplacementCardRecordDetailsRes implements Serializable { | ||||
| 	@ApiModelProperty("申请人姓名") | ||||
| 	private String userName; | ||||
|  | ||||
| 	@ApiModelProperty("申请人头像") | ||||
| 	private String avatarName; | ||||
|  | ||||
| 	@ApiModelProperty("打卡ID") | ||||
| 	private Long attendanceId; | ||||
|  | ||||
| @ -70,4 +73,6 @@ public class WgzAppUserReplacementCardRecordDetailsRes implements Serializable { | ||||
| 	@ApiModelProperty("创建时间|申请时间") | ||||
| 	private LocalDateTime createTime; | ||||
|  | ||||
| 	@ApiModelProperty("周几") | ||||
| 	private String weekday; | ||||
| } | ||||
|  | ||||
| @ -356,7 +356,7 @@ public class WgzPayCalculationServiceImpl extends ServicePlusImpl<WgzPayCalculat | ||||
| 	@Override | ||||
| 	public BgtPayCalculationDetailBaseVO baseInfo(Long userId, Long recruitId) { | ||||
| 		BgtPayCalculationDetailBaseVO vo = new BgtPayCalculationDetailBaseVO(); | ||||
| 		WgzUser wgzUser = wgzUserService.getById(userId); | ||||
| 		WgzUser wgzUser = wgzUserService.findByUserId(userId); | ||||
| 		vo.setScore(wgzUser.getScore()); | ||||
| 		vo.setUsername(wgzUser.getUsername()); | ||||
| 		vo.setAvatarName(wgzUser.getAvatarName()); | ||||
| @ -372,7 +372,7 @@ public class WgzPayCalculationServiceImpl extends ServicePlusImpl<WgzPayCalculat | ||||
| 			.last("limit 1")); | ||||
| 		vo.setEntryTime(apply.getEntryTime()); | ||||
|  | ||||
| 		Integer i = attendanceService.attendanceDetail(userId, apply.getId(), null); | ||||
| 		Integer i = attendanceService.attendanceDetail(userId, recruitId, null); | ||||
| 		BigDecimal totalAmount = recruit.getRecruitAmount().multiply(BigDecimal.valueOf(i)); | ||||
| 		vo.setAllAmount(totalAmount); | ||||
|  | ||||
| @ -383,7 +383,7 @@ public class WgzPayCalculationServiceImpl extends ServicePlusImpl<WgzPayCalculat | ||||
| 			BigDecimal multiply = gz.getRecruitAmount().multiply(BigDecimal.valueOf(gz.getNum())); | ||||
| 			addSum = addSum.add(multiply); | ||||
| 		} | ||||
| 		vo.setPayAmount(totalAmount); | ||||
| 		vo.setPayAmount(addSum); | ||||
|  | ||||
| 		vo.setResidueAmount(vo.getAllAmount().subtract(vo.getPayAmount())); | ||||
| 		return vo; | ||||
|  | ||||
| @ -109,8 +109,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||||
|         wu.avatar_name, | ||||
|         wu.username, | ||||
|         wu.type_of_work, | ||||
|         wu.identity_card, | ||||
|         bpr.recruit_name, | ||||
|         fpt.task_name, | ||||
|         bpra.task_id, | ||||
|         bpra.recruit_id, | ||||
|         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 '正常' | ||||
| @ -123,12 +126,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||||
|         LEFT JOIN wgz_user wu ON bpra.user_id = wu.user_id | ||||
|         LEFT JOIN wgz_attendance wa ON wa.user_id = wu.user_id AND wa.recruit_id = bpra.recruit_id AND wa.date = #{dto.date} | ||||
|         WHERE bpra.entry_time <= #{dto.date} and ((bpra.leave_time is null and bpra.status = '5')or leave_time>=#{dto.date}) | ||||
|         and bpra.recruit_id IN (SELECT id FROM bgt_project_recruit WHERE task_id = #{dto.taskId}) | ||||
|         and bpra.task_id  = #{dto.taskId} | ||||
|         <if test="dto.attendanceType !=null and dto.attendanceType ==1 "> | ||||
|             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 "> | ||||
|             (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.missed_in = 1 or wa.missed_out = 1) and leave_mark_id is null | ||||
|         </if> | ||||
|         <if test="dto.attendanceType !=null and dto.attendanceType ==3 "> | ||||
|             and wa.leave_mark_id = 1 | ||||
|  | ||||
| @ -45,9 +45,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||||
|     <select id="userReplacementCardRecordDetails" resultType="com.ruoyi.wgz.bo.res.WgzAppUserReplacementCardRecordDetailsRes"> | ||||
|         SELECT | ||||
|             a.*, | ||||
|             b.username, | ||||
|             b.avatar_name, | ||||
|             c.username as userName | ||||
|             b.username as auditorname, | ||||
|             b.avatar_name as auditorHead, | ||||
|             c.username as userName, | ||||
|             c.avatar_name | ||||
|         FROM | ||||
|             wgz_reissueacard a | ||||
|                 LEFT JOIN bgt_user b ON (a.auditor_user_id = b.user_id and b.del_flag = 0) | ||||
| @ -73,10 +74,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||||
|             a.auditor_user_id = #{dto.auditorUserId} | ||||
|             and a.recruit_id in (select id from bgt_project_recruit where task_id = #{dto.taskId}) | ||||
|         <if test="dto.auditorType != null and dto.auditorType != ''"> | ||||
|             and w.auditor_type = #{dto.auditorType} | ||||
|             and a.auditor_type = #{dto.auditorType} | ||||
|         </if> | ||||
|         <if test="dto.nowTime != null"> | ||||
|             and w.now_time = #{dto.nowTime} | ||||
|             and date(a.create_time) = #{dto.nowTime} | ||||
|         </if> | ||||
|         ORDER BY | ||||
|             a.id DESC | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 zt
					zt