From 6ef339849e619c24010c1cdddf61fb0cf611dad7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BD=97=E6=88=90?= <2847920761@qq.com> Date: Wed, 26 Feb 2025 15:34:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=81=AF=E5=8F=91=E9=80=81=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wgz/controller/WgzAppController.java | 20 +++- .../bgt/mapper/BgtProjectRecruitMapper.java | 2 +- .../BgtProjectRecruitApplyServiceImpl.java | 110 +++++++++++++++--- .../impl/BgtProjectRecruitServiceImpl.java | 2 +- .../constants/WgzAndBgtMessageConstant.java | 96 +++++++++++++-- .../system/service/ISysDictTypeService.java | 9 ++ .../service/impl/SysDictTypeServiceImpl.java | 22 ++++ .../ruoyi/wgz/bo/req/WgzAppReadUnreadReq.java | 18 +++ .../WgzAppPersonalBasicInformationRes.java | 2 +- .../res/WgzAppUserClockingConditionRes.java | 2 +- .../ruoyi/wgz/domain/WgzPayCalculation.java | 2 +- .../ruoyi/wgz/service/IWgzMessageService.java | 7 ++ .../impl/WgzAttendanceServiceImpl.java | 30 ++++- .../service/impl/WgzMessageServiceImpl.java | 8 ++ .../impl/WgzPayCalculationServiceImpl.java | 65 +++++++++-- .../impl/WgzReissueacardServiceImpl.java | 76 ++++++++++-- .../mapper/bgt/BgtProjectRecruitMapper.xml | 2 +- 17 files changed, 412 insertions(+), 61 deletions(-) create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wgz/bo/req/WgzAppReadUnreadReq.java 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 09663f9..e0ed675 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 @@ -240,7 +240,6 @@ public class WgzAppController { return AjaxResult.success(iWgzDailyClockService.userDailyClock(req)); } - /** * 【日报】日报日历·日报记录 */ @@ -462,7 +461,6 @@ public class WgzAppController { return AjaxResult.success(iWgzMessageService.userMessageTypeStatistics(appUserId)); } - /** * 【消息】获取消息列表-0全部 1报名 2工资 3其他 (打卡、系统) */ @@ -488,8 +486,8 @@ public class WgzAppController { */ @ApiOperation("【消息】【报名消息】 报名消息·确认|拒绝报名") //@PreAuthorize("@ss.hasPermi('wgzApp:user:userConfirmRegistration')") - @GetMapping("/WgzAppUserConfirmRegistration") - public AjaxResult userConfirmRegistration(@Validated WgzAppConfirmRegistrationReq req) { + @PutMapping("/WgzAppUserConfirmRegistration") + public AjaxResult userConfirmRegistration(@Validated @RequestBody WgzAppConfirmRegistrationReq req) { return AjaxResult.success(iBgtProjectRecruitApplyService.userConfirmRegistration(req)); } @@ -511,7 +509,7 @@ public class WgzAppController { * 【我的】【签协议】协议列表 1-劳动合同 */ - @ApiOperation("通用·附件获取(仅限和务工者直接关联的)") + @ApiOperation("【通用】附件获取(仅限和务工者直接关联的)") //@PreAuthorize("@ss.hasPermi('wgzApp:user:userAttachmentAcquisition')") @GetMapping("/wgzUserAttachmentAcquisition") public AjaxResult userAttachmentAcquisition(@Validated WgzAppAttachmentAcquisitionReq req) { @@ -559,7 +557,7 @@ public class WgzAppController { * 【我的】【请假】 获取上下班时间 * 【考勤打卡】【打卡】 获取上下班时间 */ - @ApiOperation("通用·获取上下班时间") + @ApiOperation("【通用】获取上下班时间") //@PreAuthorize("@ss.hasPermi('wgzApp:user:userGetCommutingTime')") @GetMapping("/WgzAppUserGetCommutingTime")//PageReq public AjaxResult> userGetCommutingTime() { @@ -575,6 +573,16 @@ public class WgzAppController { return AjaxResult.success(mp); } + /** + * 【消息】 + */ + @ApiOperation("【通用】修改已读未读状态") + //@PreAuthorize("@ss.hasPermi('wgzApp:user:userReadUnread')") + @PutMapping("/WgzAppUserReadUnread") + public AjaxResult userReadUnread(@Validated @RequestBody WgzAppReadUnreadReq req) { + return AjaxResult.success(iWgzMessageService.userReadUnread(req)); + } + /** 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 66da2eb..83f494b 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); - TableDataInfo userJobListing(@Param("page") Page page); + Page userJobListing(@Param("page") Page page); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/bgt/service/impl/BgtProjectRecruitApplyServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/bgt/service/impl/BgtProjectRecruitApplyServiceImpl.java index b12e102..24351e1 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/bgt/service/impl/BgtProjectRecruitApplyServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/bgt/service/impl/BgtProjectRecruitApplyServiceImpl.java @@ -17,6 +17,7 @@ import com.ruoyi.bgt.service.IBgtMessageService; import com.ruoyi.bgt.service.IBgtProjectRecruitApplyService; import com.ruoyi.bgt.service.IBgtProjectRecruitService; import com.ruoyi.common.constants.WgzAndBgtMessageConstant; +import com.ruoyi.common.core.domain.entity.SysDictData; import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.RecruitApplyStatus; @@ -24,6 +25,7 @@ import com.ruoyi.common.exception.BaseException; import com.ruoyi.common.service.IAnnexService; import com.ruoyi.common.utils.PageUtils; import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.system.service.ISysDictTypeService; import com.ruoyi.wgz.bo.req.WgzAppConfirmRegistrationReq; import com.ruoyi.wgz.bo.req.WgzAppUnderwayReq; import com.ruoyi.wgz.bo.res.WgzAppUnderwayRes; @@ -66,6 +68,8 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl bgtProjectRecruitApplies = baseMapper.selectList(lqw); + if (bgtProjectRecruitApplies.isEmpty()){ + throw new RuntimeException("异常,还未查询到您进入了工地!"); + } if (bgtProjectRecruitApplies.size()>1){ throw new RuntimeException("异常,查询到用户同时在多个工地务工!"); } - if (bgtProjectRecruitApplies.isEmpty()){ - return null; - } return bgtProjectRecruitApplies.get(0); } @@ -221,15 +225,18 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl0){ + SysDictData typeOfWork = dictTypeService.selectDictDataByTypeAndData("type_of_work", byId.getTypeOfWork()); Map mp = new HashMap<>(); mp.put("projectName",appById.getRecruitName()); + mp.put("userName",byId.getUsername()); + mp.put("post",typeOfWork.getDictLabel()); //4-1、系统发送消息给当前用户 WgzMessage wgzMessage = new WgzMessage(). setSenderType(USERTYPE_SYSTEM). setRecipientType(USERTYPE_WGZ). setRecipientId(appUserId). - setHeadline(WgzAndBgtMessageConstant.wgzMessage(mp,"1")). - setSubheading(WgzAndBgtMessageConstant.wgzMessage(mp,"2")). + setHeadline(WgzAndBgtMessageConstant.wgzMessage(mp,"101")). + setSubheading(WgzAndBgtMessageConstant.wgzMessage(mp,"102")). setTableId(bgtProjectRecruitApply.getId()). setTableName(SqlHelper.table(BgtProjectRecruitApply.class).getTableName()). setMessageLargeType(LARGE_OTHER). @@ -243,11 +250,12 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl mp = new HashMap<>(); + mp.put("projectName",recruit.getRecruitName()); + mp.put("userName",byUserId.getUsername()); + mp.put("post",typeOfWork.getDictLabel()); + if (req.getStatus().equals("3")){ + WgzMessage wgzMessage = new WgzMessage(). + setSenderType(USERTYPE_SYSTEM). + setRecipientType(USERTYPE_WGZ). + setRecipientId(byUserId.getUserId()). + setHeadline(WgzAndBgtMessageConstant.wgzMessage(mp,"105")). + setSubheading(WgzAndBgtMessageConstant.wgzMessage(mp,"106")). + setTableId(apply.getId()). + setTableName(SqlHelper.table(BgtProjectRecruitApply.class).getTableName()). + setMessageLargeType(LARGE_APPLY); + if (!iWgzMessageService.sendAMessage(wgzMessage)){ + throw new RuntimeException("系统消息报名拒绝发送失败!"); + } + BgtMessage bgtMessage = new BgtMessage(). + setSenderType(USERTYPE_WGZ). + setSenderId(byUserId.getUserId()). + setRecipientType(USERTYPE_BGT). + setRecipientId(apply.getUserId()). + setHeadline(WgzAndBgtMessageConstant.wgzMessage(mp,"203")). + setSubheading(WgzAndBgtMessageConstant.wgzMessage(mp,"204")). + setTableId(apply.getId()). + setTableName(SqlHelper.table(BgtProjectRecruitApply.class).getTableName()). + setMessageLargeType(BGT_LARGE). + setMessageSmallType(BGT_TYPE_SIGN_UP); + if (!iBgtMessageService.sendAMessage(bgtMessage)){ + throw new RuntimeException("发送报名拒绝消息失败!"); + } + return true; + } + //系统同意消息 + if (req.getStatus().equals("4")){ + WgzMessage wgzMessage = new WgzMessage(). + setSenderType(USERTYPE_SYSTEM). + setRecipientType(USERTYPE_WGZ). + setRecipientId(byUserId.getUserId()). + setHeadline(WgzAndBgtMessageConstant.wgzMessage(mp,"107")). + setSubheading(WgzAndBgtMessageConstant.wgzMessage(mp,"108")). + setTableId(apply.getId()). + setTableName(SqlHelper.table(BgtProjectRecruitApply.class).getTableName()). + setMessageLargeType(LARGE_APPLY); + if (!iWgzMessageService.sendAMessage(wgzMessage)){ + throw new RuntimeException("系统消息报名同意发送失败!"); + } + BgtMessage bgtMessage = new BgtMessage(). + setSenderType(USERTYPE_WGZ). + setSenderId(byUserId.getUserId()). + setRecipientType(USERTYPE_BGT). + setRecipientId(apply.getUserId()). + setHeadline(WgzAndBgtMessageConstant.wgzMessage(mp,"205")). + setSubheading(WgzAndBgtMessageConstant.wgzMessage(mp,"206")). + setTableId(apply.getId()). + setTableName(SqlHelper.table(BgtProjectRecruitApply.class).getTableName()). + setMessageLargeType(BGT_LARGE). + setMessageSmallType(BGT_TYPE_SIGN_UP); + if (!iBgtMessageService.sendAMessage(bgtMessage)){ + throw new RuntimeException("发送报名同意消息失败!"); + } + return true; + } + return false; } } 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 41aa2e4..1e65527 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 @@ -194,7 +194,7 @@ public class BgtProjectRecruitServiceImpl extends ServicePlusImpl pe = new Page<>(); pe.setCurrent(req.getPageNum()); pe.setSize(req.getPageSize()); - return baseMapper.userJobListing(pe); + return PageUtils.buildDataInfo(baseMapper.userJobListing(pe)); } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/common/constants/WgzAndBgtMessageConstant.java b/ruoyi-system/src/main/java/com/ruoyi/common/constants/WgzAndBgtMessageConstant.java index 0966705..afe78d3 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/common/constants/WgzAndBgtMessageConstant.java +++ b/ruoyi-system/src/main/java/com/ruoyi/common/constants/WgzAndBgtMessageConstant.java @@ -22,38 +22,111 @@ public class WgzAndBgtMessageConstant { * =====================================================务工者===================================================== */ - //【报名】系统给务工者提示 + /** + * 系统给务工者提示 + */ + //【报名申请】1-2 public static final String WGZ_SYSTEM_HEADLINE_APPLY = "您已申请【%s】项目!"; public static final String WGZ_SYSTEM_SUBHEADING_APPLY = "您已成功申请到【%s】项目,请耐心等待回复!"; + //【取消报名】3-4 public static final String WGZ_SYSTEM_HEADLINE_APPLY_CANCEL = "您已申请取消【%s】项目!"; public static final String WGZ_SYSTEM_SUBHEADING_APPLY_CANCEL = "您已成功取消【%s】项目,祝您早日找到心仪的工作!"; - //【报名】务工者给包工头提示 + //【拒绝报名】5-6 + public static final String WGZ_SYSTEM_HEADLINE_APPLY_REFUSE = "您已回拒【%s】项目!"; + public static final String WGZ_SYSTEM_SUBHEADING_APPLY_REFUSE = "您已成功拒绝【%s】项目,祝您早日找到心仪的工作!"; + //【确认报名】7-8 + public static final String WGZ_SYSTEM_HEADLINE_APPLY_AFFIRM = "您已成功进入【%s】项目!"; + public static final String WGZ_SYSTEM_SUBHEADING_APPLY_AFFIRM = "您已成功进入【%s】项目,祝你平平安安赚大钱!"; + //【补卡申请】9-10 + public static final String WGZ_SYSTEM_HEADLINE_REISSUEACARD = "您已申请了【%s】项目,【%s】的补卡操作!"; + public static final String WGZ_SYSTEM_SUBHEADING_REISSUEACARD = "您已成功发起了【%s】的补卡申请,请耐心等待回复!"; + //【工资结算】11-12 + public static final String WGZ_SYSTEM_HEADLINE_PAYCALCULATION = "您正在申请【%s】项目,为期【%s】天的工资结算操作!"; + public static final String WGZ_SYSTEM_SUBHEADING_PAYCALCULATION = "您已成功发起为期【%s】天,金额为【%s】的工资结算操作,请耐心等待回复!"; + /** + * 务工者给包工头提示 + */ + //【报名】1-2 public static final String WGZ_HEADLINE_APPLY = "务工者【%s】正在向你申请【%s】的岗位!"; public static final String WGZ__SUBHEADING_APPLY = "务工者【%s】正在向你申请【%s】岗位,您可点击查看更多信息!"; + //【拒绝报名】3-4 + public static final String WGZ_HEADLINE_APPLY_REFUSE = "务工者【%s】已委婉的回拒了您提供的【%s】岗位!"; + public static final String WGZ__SUBHEADING_APPLY_REFUSE = "务工者【%s】已委婉的回拒了您提供的【%s】岗位,并祝你做大做强!"; + //【确认报名】5-6 + public static final String WGZ_HEADLINE_APPLY_AFFIRM = "务工者【%s】已成功加入了您团队!"; + public static final String WGZ__SUBHEADING_APPLY_AFFIRM = "务工者【%s】已同意进入了您提供的【%s】岗位!"; + //【补卡申请】7-8 + public static final String WGZ_HEADLINE_REISSUEACARD = "务工者【%s】正在向你发起补卡申请!"; + public static final String WGZ__SUBHEADING_REISSUEACARD = "务工者【%s】向你发起【%s】的补卡申请操作!"; + //【工资结算】9-10 + public static final String WGZ_HEADLINE_PAYCALCULATION = "务工者【%s】正在向你发起工资结算!"; + public static final String WGZ__SUBHEADING_PAYCALCULATION = "务工者【%s】向你发起为期【%s】天,金额为【%s】圆整的工资结算操作!"; //务工者消息返回 public static String wgzMessage(Map mp, String type) { switch (type){ //系统申请报名提示 - case "1": + case "101": return String.format(WGZ_SYSTEM_HEADLINE_APPLY, mp.get("projectName")); - case "2": + case "102": return String.format(WGZ_SYSTEM_SUBHEADING_APPLY, mp.get("projectName")); - //务工者向包工头申请报名提示 - case "3": - return String.format(WGZ_HEADLINE_APPLY, mp.get("userName"), mp.get("post")); - case "4": - return String.format(WGZ__SUBHEADING_APPLY, mp.get("userName"),mp.get("post")); //系统取消报名提示 - case "5": + case "103": return String.format(WGZ_SYSTEM_HEADLINE_APPLY_CANCEL, mp.get("projectName")); - case "6": + case "104": return String.format(WGZ_SYSTEM_SUBHEADING_APPLY_CANCEL, mp.get("projectName")); + //系统拒绝报名提示 + case "105": + return String.format(WGZ_SYSTEM_HEADLINE_APPLY_REFUSE, mp.get("projectName")); + case "106": + return String.format(WGZ_SYSTEM_SUBHEADING_APPLY_REFUSE, mp.get("projectName")); + //系统确认报名提示 + case "107": + return String.format(WGZ_SYSTEM_HEADLINE_APPLY_AFFIRM, mp.get("projectName")); + case "108": + return String.format(WGZ_SYSTEM_SUBHEADING_APPLY_AFFIRM, mp.get("projectName")); + //系统补卡申请提示 + case "109": + return String.format(WGZ_SYSTEM_HEADLINE_REISSUEACARD, mp.get("projectName"),mp.get("data")); + case "110": + return String.format(WGZ_SYSTEM_SUBHEADING_REISSUEACARD, mp.get("projectName")); + //系统工资结算申请提示 + case "111": + return String.format(WGZ_SYSTEM_HEADLINE_PAYCALCULATION,mp.get("projectName"), mp.get("num")); + case "112": + return String.format(WGZ_SYSTEM_SUBHEADING_PAYCALCULATION, mp.get("num"),mp.get("money")); + //务工者向包工头申请报名 + case "201": + return String.format(WGZ_HEADLINE_APPLY, mp.get("userName"), mp.get("post")); + case "202": + return String.format(WGZ__SUBHEADING_APPLY, mp.get("userName"),mp.get("post")); + //务工者向包工头拒绝报名 + case "203": + return String.format(WGZ_HEADLINE_APPLY_REFUSE, mp.get("userName"), mp.get("post")); + case "204": + return String.format(WGZ__SUBHEADING_APPLY_REFUSE, mp.get("userName"),mp.get("post")); + //务工者向包工头确认报名 + case "205": + return String.format(WGZ_HEADLINE_APPLY_AFFIRM, mp.get("userName")); + case "206": + return String.format(WGZ__SUBHEADING_APPLY_AFFIRM, mp.get("userName"),mp.get("post")); + //务工者向包工头发起补卡申请 + case "207": + return String.format(WGZ_HEADLINE_REISSUEACARD, mp.get("userName")); + case "208": + return String.format(WGZ__SUBHEADING_REISSUEACARD, mp.get("userName"),mp.get("data")); + //务工者向包工头发起工资结算 + case "209": + return String.format(WGZ_HEADLINE_PAYCALCULATION, mp.get("userName")); + case "210": + return String.format(WGZ__SUBHEADING_PAYCALCULATION, mp.get("userName"),mp.get("num"),mp.get("money")); default: return "未知类型"; } } + + /** * =====================================================包工头===================================================== * =====================================================包工头===================================================== @@ -78,6 +151,7 @@ public class WgzAndBgtMessageConstant { public static final String SUBHEADING = "subheading"; //副标题 //消息类型 + public static final String BGT_LARGE = "3"; //大类型固定为3 public static final String BGT_TYPE_SIGN_UP = "1"; //务工者报名 public static final String BGT_TYPE_PAY = "2"; //付款 public static final String BGT_TYPE_LEAVE = "3"; //请假 diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java index a5d8de5..cd9902b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java @@ -102,4 +102,13 @@ public interface ISysDictTypeService extends IServicePlus { * @return 结果 */ public String checkDictTypeUnique(SysDictType dictType); + + + /** + * 根据字典类型+字典数据 = 指定字典 + * + * @param dictType 字典类型 + * @return 字典数据集合信息 + */ + public SysDictData selectDictDataByTypeAndData(String dictType,String dictData); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java index a090ead..b03f239 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java @@ -23,6 +23,7 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.PostConstruct; import javax.annotation.Resource; import java.util.Arrays; +import java.util.Collections; import java.util.List; import java.util.Map; @@ -235,4 +236,25 @@ public class SysDictTypeServiceImpl extends ServicePlusImpl dictDatas = DictUtils.getDictCache(dictType); + if (CollUtil.isNotEmpty(dictDatas)) { + for (SysDictData data : dictDatas) { + if (data.getDictValue().equals(dictData)){ + return data; + } + } + } + dictDatas = dictDataMapper.selectDictDataByType(dictType); + if (CollUtil.isNotEmpty(dictDatas)) { + for (SysDictData data : dictDatas) { + if (data.getDictValue().equals(dictData)){ + return data; + } + } + } + return null; + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/req/WgzAppReadUnreadReq.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/req/WgzAppReadUnreadReq.java new file mode 100644 index 0000000..9f407d0 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/req/WgzAppReadUnreadReq.java @@ -0,0 +1,18 @@ +package com.ruoyi.wgz.bo.req; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +@Data +@NoArgsConstructor +@Accessors(chain = true) +@ApiModel("修改已读未读状态请求对象") +public class WgzAppReadUnreadReq implements Serializable { + @ApiModelProperty("消息主键自增ID") + private Long messageId; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/res/WgzAppPersonalBasicInformationRes.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/res/WgzAppPersonalBasicInformationRes.java index 0a1ef10..34839de 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/res/WgzAppPersonalBasicInformationRes.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/res/WgzAppPersonalBasicInformationRes.java @@ -24,7 +24,7 @@ public class WgzAppPersonalBasicInformationRes implements Serializable { @ApiModelProperty("姓名") private String username; - @ApiModelProperty("性别") + @ApiModelProperty("性别字典sys_user_sex") private String gender; @ApiModelProperty("民族") diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/res/WgzAppUserClockingConditionRes.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/res/WgzAppUserClockingConditionRes.java index 80ed826..0c6e54b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/res/WgzAppUserClockingConditionRes.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/res/WgzAppUserClockingConditionRes.java @@ -13,6 +13,6 @@ import java.io.Serializable; @Accessors(chain = true) @ApiModel("考勤打卡·APP用户今日打卡状态") public class WgzAppUserClockingConditionRes implements Serializable { - @ApiModelProperty("务工者今日打卡状态:0上班 1下班 2请假") + @ApiModelProperty("务工者今日打卡状态:0上班 1下班 2请假 3已完成") private Integer clockingCondition; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/domain/WgzPayCalculation.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/domain/WgzPayCalculation.java index ead98a2..e7f09af 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wgz/domain/WgzPayCalculation.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/domain/WgzPayCalculation.java @@ -84,7 +84,7 @@ public class WgzPayCalculation implements Serializable { /** 出勤天数 */ @Excel(name = "出勤天数") @ApiModelProperty("出勤天数") - private Long num; + private Integer num; /** 务工状态 */ @Excel(name = "务工状态") diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/service/IWgzMessageService.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/IWgzMessageService.java index 80ca732..1869885 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wgz/service/IWgzMessageService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/IWgzMessageService.java @@ -1,6 +1,8 @@ package com.ruoyi.wgz.service; +import com.ruoyi.wgz.bo.req.WgzAppConfirmRegistrationReq; import com.ruoyi.wgz.bo.req.WgzAppGetMessageListReq; +import com.ruoyi.wgz.bo.req.WgzAppReadUnreadReq; import com.ruoyi.wgz.bo.res.WgzAppGetMessageListRes; import com.ruoyi.wgz.bo.res.WgzAppMessageTypeStatisticsRes; import com.ruoyi.wgz.bo.res.WgzAppRegistrationInformationRes; @@ -84,4 +86,9 @@ public interface IWgzMessageService extends IServicePlus { * 根据消息招工申请信息的主键ID去获取招工信息 */ WgzAppRegistrationInformationRes userRegistrationInformation(Long messageId); + + /** + * 修改已读未读状态 + */ + Boolean userReadUnread(@Validated WgzAppReadUnreadReq req); } 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 9c501ff..e84315b 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 @@ -188,7 +188,7 @@ public class WgzAttendanceServiceImpl extends ServicePlusImpl 0; } + /** + * 判断两个 LocalDateTime 之间的差值分钟数是否超过 3 + * @param startTime 开始时间 + * @param endTime 结束时间 + * @return 如果差值分钟数超过 3 返回 true,否则返回 false + */ + public static boolean isMinutesDifferenceGreaterThanThree(LocalDateTime startTime, LocalDateTime endTime) { + // 计算两个时间之间的持续时间 + Duration duration = Duration.between(startTime, endTime); + // 获取持续时间的分钟数 + long minutes = duration.toMinutes(); + // 判断分钟数是否超过 3 + return Math.abs(minutes) > 3; + } + @Override public WgzAppUserClockingConditionRes userClockingCondition() { WgzAppUserClockingConditionRes res = new WgzAppUserClockingConditionRes(); @@ -217,10 +237,14 @@ public class WgzAttendanceServiceImpl extends ServicePlusImpl 0; + } } 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 94bbd0d..6d753b3 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 @@ -5,14 +5,18 @@ 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.baomidou.mybatisplus.extension.toolkit.SqlHelper; +import com.ruoyi.bgt.domain.BgtMessage; import com.ruoyi.bgt.domain.BgtProjectRecruit; import com.ruoyi.bgt.domain.BgtProjectRecruitApply; import com.ruoyi.bgt.domain.dto.BgtPayCalculationDetailBaseVO; import com.ruoyi.bgt.domain.dto.BgtPayCalculationDetailListVO; import com.ruoyi.bgt.domain.dto.BgtPayCalculationListDTO; import com.ruoyi.bgt.domain.dto.BgtPayCalculationUpdateDTO; +import com.ruoyi.bgt.service.IBgtMessageService; import com.ruoyi.bgt.service.IBgtProjectRecruitApplyService; import com.ruoyi.bgt.service.IBgtProjectRecruitService; +import com.ruoyi.common.constants.WgzAndBgtMessageConstant; import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; import com.ruoyi.common.core.page.TableDataInfo; @@ -24,14 +28,9 @@ 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.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.IWgzAttendanceService; -import com.ruoyi.wgz.service.IWgzPayCalculationFilesService; -import com.ruoyi.wgz.service.IWgzPayCalculationService; -import com.ruoyi.wgz.service.IWgzUserService; +import com.ruoyi.wgz.service.*; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -40,9 +39,12 @@ import org.springframework.transaction.annotation.Transactional; import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.Collection; +import java.util.HashMap; import java.util.List; import java.util.Map; +import static com.ruoyi.common.constants.WgzAndBgtMessageConstant.*; + /** * 工资结算Service业务层处理 * @@ -70,6 +72,12 @@ public class WgzPayCalculationServiceImpl extends ServicePlusImpl mp = new HashMap<>(); + mp.put("projectName", recruit.getRecruitName()); + mp.put("userName", byId.getUsername()); + mp.put("num", String.valueOf(wgzPayCalculation.getNum())); + mp.put("money", String.valueOf(new BigDecimal(wgzPayCalculation.getNum()).multiply(wgzPayCalculation.getRecruitAmount()))); + WgzMessage wgzMessage = new WgzMessage(). + setSenderType(USERTYPE_SYSTEM). + setRecipientType(USERTYPE_WGZ). + setRecipientId(user.getUserId()). + setHeadline(WgzAndBgtMessageConstant.wgzMessage(mp,"111")). + setSubheading(WgzAndBgtMessageConstant.wgzMessage(mp,"112")). + setTableId(wgzPayCalculation.getId()). + setTableName(SqlHelper.table(WgzPayCalculation.class).getTableName()). + setMessageLargeType(LARGE_SALARY); + if (!iWgzMessageService.sendAMessage(wgzMessage)){ + throw new RuntimeException("系统工资结算消息发送失败!"); + } + BgtMessage bgtMessage = new BgtMessage(). + setSenderType(USERTYPE_WGZ). + setSenderId(user.getUserId()). + setRecipientType(USERTYPE_BGT). + setRecipientId(recruit.getUserId()). + setHeadline(WgzAndBgtMessageConstant.wgzMessage(mp,"209")). + setSubheading(WgzAndBgtMessageConstant.wgzMessage(mp,"210")). + setTableId(wgzPayCalculation.getId()). + setTableName(SqlHelper.table(WgzPayCalculation.class).getTableName()). + setMessageLargeType(BGT_LARGE). + setMessageSmallType(BGT_TYPE_PAY); + if (!iBgtMessageService.sendAMessage(bgtMessage)){ + throw new RuntimeException("发送补卡消息失败!"); + } + return true; + } return save(wgzPayCalculation); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzReissueacardServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzReissueacardServiceImpl.java index 9f14e18..4a6e07f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzReissueacardServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzReissueacardServiceImpl.java @@ -5,12 +5,16 @@ 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.baomidou.mybatisplus.extension.toolkit.SqlHelper; +import com.ruoyi.bgt.domain.BgtMessage; import com.ruoyi.bgt.domain.BgtProjectRecruit; import com.ruoyi.bgt.domain.BgtProjectRecruitApply; import com.ruoyi.bgt.domain.dto.BgtReissueacardListDTO; import com.ruoyi.bgt.domain.dto.BgtReissueacardUpdateDTO; +import com.ruoyi.bgt.service.IBgtMessageService; import com.ruoyi.bgt.service.IBgtProjectRecruitApplyService; import com.ruoyi.bgt.service.IBgtProjectRecruitService; +import com.ruoyi.common.constants.WgzAndBgtMessageConstant; import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.utils.PageUtils; @@ -20,19 +24,23 @@ import com.ruoyi.wgz.bo.req.WgzAppCardReplacementApplicationReq; import com.ruoyi.wgz.bo.req.WgzAppReplacementCardRecordReq; import com.ruoyi.wgz.bo.res.WgzReplacementCardRecordRes; import com.ruoyi.wgz.domain.WgzAttendance; +import com.ruoyi.wgz.domain.WgzMessage; import com.ruoyi.wgz.domain.WgzReissueacard; +import com.ruoyi.wgz.domain.WgzUser; import com.ruoyi.wgz.mapper.WgzReissueacardMapper; import com.ruoyi.wgz.service.IWgzAttendanceService; +import com.ruoyi.wgz.service.IWgzMessageService; import com.ruoyi.wgz.service.IWgzReissueacardService; +import com.ruoyi.wgz.service.IWgzUserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.math.BigDecimal; import java.time.format.DateTimeFormatter; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.Objects; +import java.util.*; + +import static com.ruoyi.common.constants.WgzAndBgtMessageConstant.*; /** * 补卡申请Service业务层处理 @@ -52,6 +60,15 @@ public class WgzReissueacardServiceImpl extends ServicePlusImpl 0; + setAttendanceId(recruit.getUserId()); + int insert = baseMapper.insert(wgzReissueacard); + //6、发送消息 + WgzUser byId = wgzUserService.findByUserId(appUserId); + Map mp = new HashMap<>(); + mp.put("projectName", recruit.getRecruitName()); + mp.put("userName", byId.getUsername()); + mp.put("data",String.valueOf(req.getNowTime())); + if (insert > 0) { + WgzMessage wgzMessage = new WgzMessage(). + setSenderType(USERTYPE_SYSTEM). + setRecipientType(USERTYPE_WGZ). + setRecipientId(appUserId). + setHeadline(WgzAndBgtMessageConstant.wgzMessage(mp,"109")). + setSubheading(WgzAndBgtMessageConstant.wgzMessage(mp,"110")). + setTableId(wgzReissueacard.getId()). + setTableName(SqlHelper.table(WgzReissueacard.class).getTableName()). + setMessageLargeType(LARGE_OTHER). + setMessageSmallType(SMALL_CARD); + if (!iWgzMessageService.sendAMessage(wgzMessage)){ + throw new RuntimeException("系统补卡消息发送失败!"); + } + BgtMessage bgtMessage = new BgtMessage(). + setSenderType(USERTYPE_WGZ). + setSenderId(appUserId). + setRecipientType(USERTYPE_BGT). + setRecipientId(recruit.getUserId()). + setHeadline(WgzAndBgtMessageConstant.wgzMessage(mp,"207")). + setSubheading(WgzAndBgtMessageConstant.wgzMessage(mp,"208")). + setTableId(wgzReissueacard.getId()). + setTableName(SqlHelper.table(BgtProjectRecruitApply.class).getTableName()). + setMessageLargeType(BGT_LARGE). + setMessageSmallType(BGT_TYPE_MAKE_UP); + if (!iBgtMessageService.sendAMessage(bgtMessage)){ + throw new RuntimeException("发送补卡消息失败!"); + } + return true; + } + return false; } diff --git a/ruoyi-system/src/main/resources/mapper/bgt/BgtProjectRecruitMapper.xml b/ruoyi-system/src/main/resources/mapper/bgt/BgtProjectRecruitMapper.xml index b8e03d0..2dbc40e 100644 --- a/ruoyi-system/src/main/resources/mapper/bgt/BgtProjectRecruitMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/bgt/BgtProjectRecruitMapper.xml @@ -93,7 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" c.task_name, c.task_address, c.task_img, - (SELECT count(1) FROM bgt_project_recruit_apply WHERE recruit_id = a.id) as numberOfRegistered + (SELECT count(1) FROM bgt_project_recruit_apply WHERE recruit_id = b.id) as numberOfRegistered FROM bgt_project_recruit as b LEFT JOIN fbs_project_task as c ON (c.id = b.task_id AND c.del_flag = 0)