diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wgz/controller/WgzAppController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wgz/controller/WgzAppController.java index 97a700a..8f015fb 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wgz/controller/WgzAppController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wgz/controller/WgzAppController.java @@ -343,7 +343,7 @@ public class WgzAppController { /** * 【首页】【已报名项目】 已报名项目 */ - @ApiOperation("【首页】【已报名项目】 已报名项目)") + @ApiOperation("【首页】【已报名项目】 已报名项目") //@PreAuthorize("@ss.hasPermi('wgzApp:user:userRegisteredProject')") @GetMapping("/WgzAppUserRegisteredProject") public TableDataInfo userRegisteredProject(@Validated WgzAppRegisteredProjectReq req) { @@ -462,7 +462,7 @@ public class WgzAppController { } /** - * 【消息】获取消息列表-0全部 1报名 2工资 3其他 (打卡、系统) + * 【消息】获取消息列表 */ @ApiOperation("【消息】获取消息列表") //@PreAuthorize("@ss.hasPermi('wgzApp:user:userGetMessageList')") diff --git a/ruoyi-system/src/main/java/com/ruoyi/bgt/mapper/BgtProjectRecruitMapper.java b/ruoyi-system/src/main/java/com/ruoyi/bgt/mapper/BgtProjectRecruitMapper.java index 83f494b..16c73c1 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/bgt/mapper/BgtProjectRecruitMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/bgt/mapper/BgtProjectRecruitMapper.java @@ -39,7 +39,7 @@ public interface BgtProjectRecruitMapper extends BaseMapperPlus GetsTheMembersUnderTheCurrentProject (@Param("recruitId") Long recruitId); - Page userJobListing(@Param("page") Page page); + Page userJobListing(@Param("page") Page page,@Param("req") WgzAppJobListingReq req); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/bgt/service/impl/BgtProjectRecruitServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/bgt/service/impl/BgtProjectRecruitServiceImpl.java index 0069e7e..ce09b0b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/bgt/service/impl/BgtProjectRecruitServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/bgt/service/impl/BgtProjectRecruitServiceImpl.java @@ -209,7 +209,7 @@ public class BgtProjectRecruitServiceImpl extends ServicePlusImpl wgzUser = baseMapper.GetsTheMembersUnderTheCurrentProject(recruitId); + List wgzUser = baseMapper.GetsTheMembersUnderTheCurrentProject(wgzAppProjectDetailsRes.getId()); //3、数据组装 WgzAppCancelRegistrationProjectDetailsRes res = new WgzAppCancelRegistrationProjectDetailsRes(); BeanUtils.copyProperties(wgzAppProjectDetailsRes,res); @@ -220,10 +220,13 @@ public class BgtProjectRecruitServiceImpl extends ServicePlusImpl userJobListing(WgzAppJobListingReq req) { + //获取当前用户 + Long appUserId = SecurityUtils.getAppUserId(); + req.setUserId(appUserId); Page pe = new Page<>(); pe.setCurrent(req.getPageNum()); pe.setSize(req.getPageSize()); - return PageUtils.buildDataInfo(baseMapper.userJobListing(pe)); + return PageUtils.buildDataInfo(baseMapper.userJobListing(pe,req)); } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/req/WgzAppGetMessageListReq.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/req/WgzAppGetMessageListReq.java index c93960b..5f9abcc 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/req/WgzAppGetMessageListReq.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/req/WgzAppGetMessageListReq.java @@ -17,9 +17,9 @@ public class WgzAppGetMessageListReq extends PageReq { @ApiModelProperty(value = "接收人",hidden = true) private Long recipientId; - @ApiModelProperty("0 全部 1报名 2工资 3其他") + @ApiModelProperty("字典(message_large_type)") private String largeType; - @ApiModelProperty("largeType为3填写 (0补卡 1系统)") + @ApiModelProperty("字典(message_small_type)largeType为3填写") private String smallType; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/req/WgzAppJobListingReq.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/req/WgzAppJobListingReq.java index c06a5b7..9fcc94c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/req/WgzAppJobListingReq.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/req/WgzAppJobListingReq.java @@ -7,9 +7,12 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; +import javax.validation.constraints.NotNull; import java.io.Serializable; @Data @ApiModel("首页-招工列表请求对象") public class WgzAppJobListingReq extends PageReq { + @ApiModelProperty(value = "唯一标识",hidden = true) + private Long userId; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/req/WgzAppSubmitTheClockReq.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/req/WgzAppSubmitTheClockReq.java index 815f630..e62e486 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/req/WgzAppSubmitTheClockReq.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/req/WgzAppSubmitTheClockReq.java @@ -19,9 +19,10 @@ import java.io.Serializable; public class WgzAppSubmitTheClockReq implements Serializable { @ApiModelProperty("上下班打卡标识(0上班 1下班)") @NotBlank(message = "上下班打卡标识不能为空") - @Pattern(regexp = "[01]", message = "上下班打卡标识只能为 0 或 1") + @Pattern(regexp = "^[01]$", message = "上下班打卡标识只能是0或1") private String type; + @ApiModelProperty("打卡位置") @NotBlank(message = "打卡位置不能为空") private String pnchOsition; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/res/WgzAppGetMessageListRes.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/res/WgzAppGetMessageListRes.java index 998f36b..d1b4f1d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/res/WgzAppGetMessageListRes.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/res/WgzAppGetMessageListRes.java @@ -33,6 +33,12 @@ public class WgzAppGetMessageListRes implements Serializable { @ApiModelProperty("读状态(0未读 1已读)") private String readStatus; + @ApiModelProperty("大类型") + private String messageLargeType; + + @ApiModelProperty("小类型") + private String messageSmallType; + @ApiModelProperty("创建时间") private LocalDateTime createTime; @@ -55,14 +61,33 @@ public class WgzAppGetMessageListRes implements Serializable { private Long otherId; @ApiModelProperty("其它·补卡·补卡时间") - private Long otherFillingTime; + private LocalDateTime otherFillingTime; @ApiModelProperty("其它·补卡·补卡理由") - private Long otherReason; + private String otherReason; @ApiModelProperty("其它·补卡·申请人") - private Long otherApplicant; + private String otherApplicant; @ApiModelProperty("其它·补卡·申请时间") - private Long otherApplicationDate; + private LocalDateTime otherApplicationDate; + + //其它·请假 + @ApiModelProperty("其它·请假·请假ID") + private Long qjID; + + @ApiModelProperty("其它·请假·请假起始时间") + private LocalDateTime qjStartingTime; + + @ApiModelProperty("其它·请假·请假结算时间") + private LocalDateTime qjEndTime; + + @ApiModelProperty("其它·请假·理由") + private String qjReason; + + @ApiModelProperty("其它·请假·请假人") + private String qjName; + + @ApiModelProperty("其它·请假·请假时间") + private LocalDateTime qjLeaveTime; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/res/WgzAppMessageTypeStatisticsRes.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/res/WgzAppMessageTypeStatisticsRes.java index 3154e6b..386f739 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/res/WgzAppMessageTypeStatisticsRes.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/res/WgzAppMessageTypeStatisticsRes.java @@ -10,6 +10,7 @@ import lombok.experimental.Accessors; import java.io.Serializable; import java.time.LocalDate; import java.util.List; +import java.util.Map; @Data @NoArgsConstructor @@ -17,6 +18,6 @@ import java.util.List; @ApiModel("消息类型统计返回参数") public class WgzAppMessageTypeStatisticsRes implements Serializable { @ApiModelProperty("消息类型") - private List list; + private Map mp; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/mapper/WgzMessageMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/mapper/WgzMessageMapper.java index aacc424..e449893 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wgz/mapper/WgzMessageMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/mapper/WgzMessageMapper.java @@ -27,6 +27,9 @@ public interface WgzMessageMapper extends BaseMapperPlus { Page userGetMessageList(@Param("page") Page page,@Param("req") WgzAppGetMessageListReq req); - // //根据招工id获取到招工的信息+附件 + //根据招工id获取到招工的信息+附件 WgzAppRegistrationInformationRes findByRecruitIdData(@Param("recruitId") Long recruitId); + + //分页查询消息列表 + Page pagingQueryTheMessageList(@Param("page") Page page,@Param("req") WgzAppGetMessageListReq req); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/service/IWgzAttendanceService.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/IWgzAttendanceService.java index fd603c1..e105476 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wgz/service/IWgzAttendanceService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/IWgzAttendanceService.java @@ -134,4 +134,9 @@ public interface IWgzAttendanceService extends IServicePlus { */ LocalDate findByNumGetDate(Long userId, Long recruitId,Integer num); + /** + * 根据日期得到剩余还未结算的记录 + */ + List findByDateGetDateList(Long userId, Long recruitId,LocalDate date); + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzAttendanceServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzAttendanceServiceImpl.java index e76a72b..35c768a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzAttendanceServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzAttendanceServiceImpl.java @@ -177,8 +177,7 @@ public class WgzAttendanceServiceImpl extends ServicePlusImpl 0; }else{ //7、获取上次打卡时间与这次打卡时间的间隔是否超过3分钟 boolean flag = isMinutesDifferenceGreaterThanThree(we.getClockInTime(), now); @@ -206,13 +206,15 @@ public class WgzAttendanceServiceImpl extends ServicePlusImpl 0; } - return baseMapper.insert(wgzAttendance) > 0; } /** @@ -691,4 +693,19 @@ public class WgzAttendanceServiceImpl extends ServicePlusImpl findByDateGetDateList(Long userId, Long recruitId, LocalDate date) { + //1、获取所有考勤信息,前提条件是该用户的打卡时间要大于date + LambdaQueryWrapper wra = new LambdaQueryWrapper<>(); + wra.eq(WgzAttendance::getRecruitId, recruitId); + wra.eq(WgzAttendance::getUserId, userId); + wra.gt(WgzAttendance::getDate, date); + wra.orderByAsc(WgzAttendance::getDate); + List wgzAttendances = baseMapper.selectList(wra); + return wgzAttendances; + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzMessageServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzMessageServiceImpl.java index 871d991..da0b719 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzMessageServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzMessageServiceImpl.java @@ -21,6 +21,12 @@ import com.ruoyi.wgz.bo.res.WgzAppGetMessageListRes; import com.ruoyi.wgz.bo.res.WgzAppMessageTypeStatisticsRes; import com.ruoyi.wgz.bo.res.WgzAppRegistrationInformationRes; import com.ruoyi.wgz.bo.rests.WgzAppMessageTypeStatisticsTwo; +import com.ruoyi.wgz.domain.WgzLeave; +import com.ruoyi.wgz.domain.WgzReissueacard; +import com.ruoyi.wgz.domain.WgzUser; +import com.ruoyi.wgz.service.IWgzLeaveService; +import com.ruoyi.wgz.service.IWgzReissueacardService; +import com.ruoyi.wgz.service.IWgzUserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; @@ -32,10 +38,7 @@ import com.ruoyi.wgz.domain.WgzMessage; import com.ruoyi.wgz.mapper.WgzMessageMapper; import com.ruoyi.wgz.service.IWgzMessageService; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Collection; +import java.util.*; /** * 消息Service业务层处理 @@ -52,6 +55,15 @@ public class WgzMessageServiceImpl extends ServicePlusImpl list = new ArrayList<>(); + Map mp = new HashMap<>(); +// List list = new ArrayList<>(); //1、获取字典类型 List data = dictTypeService.selectDictDataByType("message_large_type"); for (SysDictData datum : data) { - WgzAppMessageTypeStatisticsTwo two = new WgzAppMessageTypeStatisticsTwo(); //2、统计数据 LambdaQueryWrapper wp = new LambdaQueryWrapper(). eq(WgzMessage::getRecipientId, id). eq(WgzMessage::getRecipientType, "1"). eq(WgzMessage::getReadStatus, "0"). eq(WgzMessage::getMessageLargeType, datum.getDictValue()); - two.setType(datum.getDictValue()); - two.setNum(baseMapper.delete(wp)); - list.add(two); + mp.put(datum.getDictValue(),baseMapper.selectCount(wp)); } - res.setList(list); - return res; + return res.setMp(mp); } @Override public TableDataInfo userGetMessageList(WgzAppGetMessageListReq req) { Long appUserId = SecurityUtils.getAppUserId(); + WgzUser wgz = wgzUserService.findByUserId(appUserId); + + req.setRecipientId(appUserId); Page queryDTOPage = new Page<>(); queryDTOPage.setCurrent(req.getPageNum()); queryDTOPage.setSize(req.getPageSize()); - return PageUtils.buildDataInfo(baseMapper.userGetMessageList(queryDTOPage,req)); + //1、分页查询出所有的小类型,然后循环查询小类型对应标题数据 + if(req.getLargeType() !=null && req.getLargeType().equals("3") && req.getSmallType()==null){ + Page pe = baseMapper.pagingQueryTheMessageList(queryDTOPage, req); + //2、循环小类型,然后去查询对应不同类的查询标题(主要针对0补卡、3请假) + pe.getRecords().stream().forEach(res -> { + //3、根据小类型去查询标题 + if(res.getMessageSmallType().equals("0")){ + WgzReissueacard byId = iWgzReissueacardService.getById(res.getTableId()); + res.setOtherId(byId.getId()). + setOtherFillingTime(byId.getNowTime()). + setOtherReason(byId.getReason()). + setOtherApplicant(wgz.getUsername()). + setOtherApplicationDate(byId.getCreateTime()); + } + if(res.getMessageSmallType().equals("3")){ + WgzLeave byId = iWgzLeaveService.getById(res.getTableId()); + res.setQjID(byId.getId()). + setQjStartingTime(byId.getStartTime()). + setQjEndTime(byId.getEndTime()). + setQjReason(byId.getReason()). + setQjName(wgz.getUsername()). + setQjLeaveTime(byId.getCreateTime()); + } + }); + return PageUtils.buildDataInfo(pe); + } + //2、走正常的全部+大类型+具体的小类型 + else{ + return PageUtils.buildDataInfo(baseMapper.userGetMessageList(queryDTOPage,req)); + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzPayCalculationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzPayCalculationServiceImpl.java index 0d9be29..5576098 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzPayCalculationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzPayCalculationServiceImpl.java @@ -29,10 +29,7 @@ import com.ruoyi.wgz.bo.WgzPayCalculationQueryBo; import com.ruoyi.wgz.bo.req.WgzAppApplyForPayrollSettlementListReq; import com.ruoyi.wgz.bo.req.WgzApplyForPayrollSettlementAddReq; import com.ruoyi.wgz.bo.res.WgzAppApplyForPayrollSettlementListRes; -import com.ruoyi.wgz.domain.WgzMessage; -import com.ruoyi.wgz.domain.WgzPayCalculation; -import com.ruoyi.wgz.domain.WgzPayCalculationFiles; -import com.ruoyi.wgz.domain.WgzUser; +import com.ruoyi.wgz.domain.*; import com.ruoyi.wgz.mapper.WgzPayCalculationMapper; import com.ruoyi.wgz.service.*; import org.springframework.beans.BeanUtils; @@ -175,26 +172,27 @@ public class WgzPayCalculationServiceImpl extends ServicePlusImpllambdaQuery(). -// eq(WgzPayCalculation::getUserId, user.getUserId()). -// eq(WgzPayCalculation::getRecruitId, recruitApply.getId()). -// orderByDesc(WgzPayCalculation::getCreateTime). -// last("LIMIT 1") -// ); -// if (wgzts != null) { -// LocalDate cutOffTime = wgzts.getCutOffTime(); -// Integer num = iWgzAttendanceService.attendanceDetail(user.getUserId(), recruitApply.getRecruitId(), null); -// } + //2、结算数据之前,需要先获取以往结算的数据(如果没有就说明第一次结算),然后得到剩余结算天数,再从剩余天数重新进行数据结算 + Integer num = 0; + LocalDate byNumGetDate = null; + WgzPayCalculation wgzts = baseMapper.selectOne(Wrappers.lambdaQuery(). + eq(WgzPayCalculation::getUserId, user.getUserId()). + eq(WgzPayCalculation::getRecruitId, recruitApply.getId()). + orderByDesc(WgzPayCalculation::getCreateTime). + last("LIMIT 1") + ); + if (wgzts != null) {//得到最后一次的结算截止时间和剩余未结算天数 + byNumGetDate = wgzts.getCutOffTime(); + num = iWgzAttendanceService.findByDateGetDateList(user.getUserId(), recruitApply.getRecruitId(), byNumGetDate).size(); - //2、获取当前人一共考勤打卡了多少天,然后计算当前结算的天数得到具体是考勤打卡对应的哪一天 - Integer num = iWgzAttendanceService.attendanceDetail(user.getUserId(), recruitApply.getRecruitId(), null); - if (num < req.getNum()) { - throw new RuntimeException("你的剩余考勤天数不满足你当前想要结算的天数!"); + }else{//得到即将结算截止的日期和剩余未结算天数 + byNumGetDate = iWgzAttendanceService.findByNumGetDate(user.getUserId(), recruitApply.getRecruitId(), req.getNum()); + num = iWgzAttendanceService.attendanceDetail(user.getUserId(), recruitApply.getRecruitId(), null); } - LocalDate byNumGetDate = iWgzAttendanceService.findByNumGetDate(user.getUserId(), recruitApply.getRecruitId(), req.getNum()); - //2、组装数据 + if (num < req.getNum()) { //判断剩余天数是否满足当前结算天数 + throw new RuntimeException("您剩余可结算天数为:"+num+"天,您当前想要结算的天数为:"+req.getNum()+"天,剩余天数不足!"); + } + //4、组装数据 WgzPayCalculation wgzPayCalculation = new WgzPayCalculation(); BeanUtils.copyProperties(req,wgzPayCalculation); wgzPayCalculation. @@ -202,9 +200,9 @@ public class WgzPayCalculationServiceImpl extends ServicePlusImpl diff --git a/ruoyi-system/src/main/resources/mapper/wgz/WgzMessageMapper.xml b/ruoyi-system/src/main/resources/mapper/wgz/WgzMessageMapper.xml index 28f186e..d2ebfe9 100644 --- a/ruoyi-system/src/main/resources/mapper/wgz/WgzMessageMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wgz/WgzMessageMapper.xml @@ -34,65 +34,98 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" a.table_id as tableId, a.table_name as tableName, a.read_status as readStatus, - a.create_time as createTime - + a.create_time as createTime, + a.message_large_type as messageLargeType, + a.message_small_type as messageSmallType + ,c.recruit_name as recruitName ,c.id as recruitId - + ,d.id as jsId ,d.recruit_name as jsName - + ,e.id as otherId ,e.now_time as otherFillingTime ,e.reason as otherReason ,f.username as otherApplicant ,e.create_time as otherApplicationDate + + ,g.id as qjID + ,g.start_time as qjStartingTime + ,g.end_time as qjEndTime + ,g.reason as qjReason + ,h.username as qjName + ,g.create_time as qjLeaveTime + FROM wgz_message as a - + LEFT JOIN bgt_project_recruit_apply as b ON b.id = a.table_id LEFT JOIN bgt_project_recruit as c ON c.id = b.recruit_id - + LEFT JOIN wgz_pay_calculation as d ON d.id = a.table_id - + LEFT JOIN wgz_reissueacard as e ON e.id = a.table_id LEFT JOIN wgz_user as f ON f.id = e.user_id - - LEFT JOIN wgz_reissueacard as e ON e.id = a.table_id - LEFT JOIN wgz_user as f ON f.id = e.user_id - - - LEFT JOIN wgz_reissueacard as e ON e.id = a.table_id - LEFT JOIN wgz_user as f ON f.id = e.user_id + + + + + + + + + + LEFT JOIN wgz_leave as g ON g.id = a.table_id + LEFT JOIN wgz_user as h ON h.id = g.user_id + + + + a.recipient_type = "1" AND a.recipient_id = #{req.recipientId} AND a.del_flag = "0" - - AND b.del_flag = "0" - AND c.del_flag = "0" + + AND a.message_large_type = #{req.largeType} - - AND d.del_flag = "0" - - - AND e.del_flag = "0" - AND f.del_flag = "0" - - - AND a.sender_type = "0" + + AND a.message_small_type = #{req.smallType} + + +