新增消息列表及其它细节修改
This commit is contained in:
@ -4,6 +4,7 @@ import com.ruoyi.bgt.domain.BgtMessage;
|
||||
import com.ruoyi.bgt.bo.BgtMessageQueryBo;
|
||||
import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.wgz.domain.WgzMessage;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@ -52,4 +53,17 @@ public interface IBgtMessageService extends IServicePlus<BgtMessage> {
|
||||
* @return
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* LC-APP相关
|
||||
* =================================================================================================================
|
||||
* =================================================================================================================
|
||||
* =================================================================================================================
|
||||
*/
|
||||
|
||||
/**
|
||||
* 发送消息
|
||||
*/
|
||||
Boolean sendAMessage(BgtMessage bo);
|
||||
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.utils.PageUtils;
|
||||
import com.ruoyi.common.core.page.PagePlus;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.wgz.domain.WgzMessage;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@ -91,4 +92,16 @@ public class BgtMessageServiceImpl extends ServicePlusImpl<BgtMessageMapper, Bgt
|
||||
}
|
||||
return removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* LC-APP相关
|
||||
* =================================================================================================================
|
||||
* =================================================================================================================
|
||||
* =================================================================================================================
|
||||
*/
|
||||
|
||||
@Override
|
||||
public Boolean sendAMessage(BgtMessage bo) {
|
||||
return save(bo);
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ 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.bo.BgtProjectRecruitApplyQueryBo;
|
||||
import com.ruoyi.bgt.domain.BgtMessage;
|
||||
import com.ruoyi.bgt.domain.BgtProjectRecruit;
|
||||
import com.ruoyi.bgt.domain.BgtProjectRecruitApply;
|
||||
import com.ruoyi.bgt.domain.dto.BgtAttendanceDayDTO;
|
||||
@ -15,6 +16,7 @@ import com.ruoyi.bgt.domain.dto.BgtProjectRecruitApplyQueryDTO;
|
||||
import com.ruoyi.bgt.domain.dto.BgtScoreDTO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtProjectRecruitApplyVO;
|
||||
import com.ruoyi.bgt.mapper.BgtProjectRecruitApplyMapper;
|
||||
import com.ruoyi.bgt.service.IBgtMessageService;
|
||||
import com.ruoyi.bgt.service.IBgtProjectRecruitApplyService;
|
||||
import com.ruoyi.bgt.service.IBgtProjectRecruitService;
|
||||
import com.ruoyi.common.constants.WgzAndBgtMessageConstant;
|
||||
@ -64,6 +66,8 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
|
||||
private IBgtProjectRecruitService iBgtProjectRecruitService;
|
||||
@Autowired
|
||||
private IWgzMessageService iWgzMessageService;
|
||||
@Autowired
|
||||
private IBgtMessageService iBgtMessageService;
|
||||
|
||||
@Override
|
||||
public BgtProjectRecruitApply queryById(Long id){
|
||||
@ -216,15 +220,17 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
|
||||
throw new RuntimeException("系统消息发送失败!");
|
||||
}
|
||||
//4-2、当前用户发送消息给包工头
|
||||
wgzMessage.
|
||||
BgtMessage bgtMessage = new BgtMessage().
|
||||
setSenderType(USERTYPE_WGZ).
|
||||
setSenderId(appUserId).
|
||||
setRecipientType(USERTYPE_BGT).
|
||||
setRecipientId(appById.getUserId()).
|
||||
setHeadline(WgzAndBgtMessageConstant.wgzMessage(mp,"3")).
|
||||
setSubheading(WgzAndBgtMessageConstant.wgzMessage(mp,"4")).
|
||||
setTableId(bgtProjectRecruitApply.getId()).
|
||||
setTableName(SqlHelper.table(BgtProjectRecruitApply.class).getTableName()).
|
||||
setMessageLargeType(LARGE_APPLY);
|
||||
if (!iWgzMessageService.sendAMessage(wgzMessage)){
|
||||
if (!iBgtMessageService.sendAMessage(bgtMessage)){
|
||||
throw new RuntimeException("发送消息失败!");
|
||||
}
|
||||
}
|
||||
|
@ -18,9 +18,10 @@ public class WgzAppGetMessageListReq extends PageReq {
|
||||
@Hidden
|
||||
private Long recipientId;
|
||||
|
||||
@ApiModelProperty("大类型(字典)")
|
||||
private String messageLargeType;
|
||||
@ApiModelProperty("0 全部 1报名 2工资 3其他")
|
||||
@Hidden
|
||||
private String largeType;
|
||||
|
||||
@ApiModelProperty("小类型(字典,大类型为【其它】才复制给它)")
|
||||
private String messageSmallType;
|
||||
@ApiModelProperty("largeType为3填写 (0补卡 1系统)")
|
||||
private String smallType;
|
||||
}
|
||||
|
@ -6,10 +6,11 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("首页-招工列表请求对象")
|
||||
public class WgzAppJobListingReq extends BaseEntity {
|
||||
public class WgzAppJobListingReq implements Serializable {
|
||||
/** 分页大小 */
|
||||
@ApiModelProperty("分页大小")
|
||||
private Integer pageSize;
|
||||
|
@ -1,15 +1,68 @@
|
||||
package com.ruoyi.wgz.bo.res;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("获取消息列表返回参数")
|
||||
public class WgzAppGetMessageListRes implements Serializable {
|
||||
//消息主表
|
||||
@ApiModelProperty("消息主键自增ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("主标题")
|
||||
private String headline;
|
||||
|
||||
@ApiModelProperty("副标题")
|
||||
private String subheading;
|
||||
|
||||
@ApiModelProperty("表ID")
|
||||
private Long tableId;
|
||||
|
||||
@ApiModelProperty("表名")
|
||||
private String tableName;
|
||||
|
||||
@ApiModelProperty("读状态(0未读 1已读)")
|
||||
private String readStatus;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
//报名
|
||||
@ApiModelProperty("报名·招工主键ID")
|
||||
private Long recruitId;
|
||||
|
||||
@ApiModelProperty("报名·招工标题")
|
||||
private String recruitName;
|
||||
|
||||
//工资
|
||||
@ApiModelProperty("工资·结算主键ID")
|
||||
private Long jsId;
|
||||
|
||||
@ApiModelProperty("工资·结算招工标题")
|
||||
private String jsName;
|
||||
|
||||
//其它·补卡
|
||||
@ApiModelProperty("其它·补卡·补卡ID")
|
||||
private Long otherId;
|
||||
|
||||
@ApiModelProperty("其它·补卡·补卡时间")
|
||||
private Long otherFillingTime;
|
||||
|
||||
@ApiModelProperty("其它·补卡·补卡理由")
|
||||
private Long otherReason;
|
||||
|
||||
@ApiModelProperty("其它·补卡·申请人")
|
||||
private Long otherApplicant;
|
||||
|
||||
@ApiModelProperty("其它·补卡·申请时间")
|
||||
private Long otherApplicationDate;
|
||||
}
|
||||
|
@ -43,6 +43,13 @@ public class WgzAppJobListingRes implements Serializable {
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty("工种")
|
||||
private String typeOfWork;
|
||||
|
||||
@ApiModelProperty("申请者列表")
|
||||
List<BgtProjectRecruitApplyVO> applylist;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ import com.ruoyi.wgz.domain.WgzLeave;
|
||||
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
|
||||
import com.ruoyi.common.core.mybatisplus.cache.MybatisPlusRedisCache;
|
||||
import org.apache.ibatis.annotations.CacheNamespace;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 请假Mapper接口
|
||||
@ -24,6 +25,6 @@ public interface WgzLeaveMapper extends BaseMapperPlus<WgzLeave> {
|
||||
* @param page 分页对象
|
||||
* @return 分页查询结果
|
||||
*/
|
||||
Page<WgzAppLeaveHistoryListPageRes> userLeaveHistoryListPage(Page<WgzAppLeaveHistoryListPageReq> page);
|
||||
Page<WgzAppLeaveHistoryListPageRes> userLeaveHistoryListPage(@Param("page") Page<WgzAppLeaveHistoryListPageReq> page);
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,10 @@
|
||||
package com.ruoyi.wgz.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.bgt.domain.dto.BgtDailyClockListDTO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtDailyClockListVO;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppGetMessageListReq;
|
||||
import com.ruoyi.wgz.bo.res.WgzAppGetMessageListRes;
|
||||
import com.ruoyi.wgz.domain.WgzMessage;
|
||||
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
|
||||
import com.ruoyi.common.core.mybatisplus.cache.MybatisPlusRedisCache;
|
||||
@ -18,8 +23,6 @@ import java.util.Map;
|
||||
// 如使需切换数据源 请勿使用缓存 会造成数据不一致现象
|
||||
@CacheNamespace(implementation = MybatisPlusRedisCache.class, eviction = MybatisPlusRedisCache.class)
|
||||
public interface WgzMessageMapper extends BaseMapperPlus<WgzMessage> {
|
||||
/**
|
||||
* 消息类型统计(先分组再统计)
|
||||
*/
|
||||
List<Map<String, Object>> userMessageTypeStatistics(@Param("id") Long id);
|
||||
|
||||
Page<WgzAppGetMessageListRes> userGetMessageList(@Param("page") Page<WgzAppGetMessageListReq> page);
|
||||
}
|
||||
|
@ -1,10 +1,13 @@
|
||||
package com.ruoyi.wgz.service;
|
||||
|
||||
import com.ruoyi.wgz.bo.req.WgzAppGetMessageListReq;
|
||||
import com.ruoyi.wgz.bo.res.WgzAppGetMessageListRes;
|
||||
import com.ruoyi.wgz.bo.res.WgzAppMessageTypeStatisticsRes;
|
||||
import com.ruoyi.wgz.domain.WgzMessage;
|
||||
import com.ruoyi.wgz.bo.WgzMessageQueryBo;
|
||||
import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@ -70,4 +73,9 @@ public interface IWgzMessageService extends IServicePlus<WgzMessage> {
|
||||
* 消息类型统计
|
||||
*/
|
||||
WgzAppMessageTypeStatisticsRes userMessageTypeStatistics(Long id);
|
||||
|
||||
/**
|
||||
* 消息列表
|
||||
*/
|
||||
TableDataInfo<WgzAppGetMessageListRes> userGetMessageList(@Validated WgzAppGetMessageListReq req);
|
||||
}
|
||||
|
@ -7,7 +7,11 @@ import com.ruoyi.common.core.domain.entity.SysDictData;
|
||||
import com.ruoyi.common.utils.PageUtils;
|
||||
import com.ruoyi.common.core.page.PagePlus;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.system.service.ISysDictTypeService;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppGetMessageListReq;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppLeaveHistoryListPageReq;
|
||||
import com.ruoyi.wgz.bo.res.WgzAppGetMessageListRes;
|
||||
import com.ruoyi.wgz.bo.res.WgzAppMessageTypeStatisticsRes;
|
||||
import com.ruoyi.wgz.bo.rests.WgzAppMessageTypeStatisticsTwo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -135,4 +139,14 @@ public class WgzMessageServiceImpl extends ServicePlusImpl<WgzMessageMapper, Wgz
|
||||
res.setList(list);
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<WgzAppGetMessageListRes> userGetMessageList(WgzAppGetMessageListReq req) {
|
||||
Long appUserId = SecurityUtils.getAppUserId();
|
||||
req.setRecipientId(appUserId);
|
||||
Page<WgzAppGetMessageListReq> queryDTOPage = new Page<>();
|
||||
queryDTOPage.setCurrent(req.getPageNum());
|
||||
queryDTOPage.setSize(req.getPageSize());
|
||||
return PageUtils.buildDataInfo(baseMapper.userGetMessageList(queryDTOPage));
|
||||
}
|
||||
}
|
||||
|
@ -26,18 +26,62 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<!-- 消息类型统计(先分组再统计) -->
|
||||
<select id="userMessageTypeStatistics" resultType="java.util.Map">
|
||||
<select id="userGetMessageList" resultType="com.ruoyi.wgz.bo.res.WgzAppGetMessageListRes">
|
||||
SELECT
|
||||
message_large_type,
|
||||
count( 1 ) as ct
|
||||
a.id,
|
||||
a.headline,
|
||||
a.subheading,
|
||||
a.table_id as tableId,
|
||||
a.table_name as tableName,
|
||||
a.read_status as readStatus,
|
||||
a.create_time as createTime
|
||||
<if test="page.largeType == '1'">
|
||||
,c.recruit_name as recruitName
|
||||
,c.id as recruitId
|
||||
</if>
|
||||
<if test="page.largeType == '2'">
|
||||
,d.id as jsId
|
||||
,d.recruit_name as jsName
|
||||
</if>
|
||||
<if test="page.largeType == '3' and page.smallType == '0'">
|
||||
,e.id as otherId
|
||||
,e.now_time as otherFillingTime
|
||||
,e.reason as otherReason
|
||||
,f.username as otherApplicant
|
||||
,e.create_time as otherApplicationDate
|
||||
</if>
|
||||
FROM
|
||||
wgz_message
|
||||
WHERE
|
||||
recipient_id = #{id}
|
||||
AND recipient_type = "1"
|
||||
AND read_status = "0"
|
||||
GROUP BY
|
||||
message_large_type
|
||||
wgz_message as a
|
||||
<if test="page.largeType == '1'">
|
||||
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
|
||||
</if>
|
||||
<if test="page.largeType == '2'">
|
||||
LEFT JOIN wgz_pay_calculation as d ON d.id = a.table_id
|
||||
</if>
|
||||
<if test="page.largeType == '3' and page.smallType == '0'">
|
||||
LEFT JOIN wgz_reissueacard as e ON e.id = a.table_id
|
||||
LEFT JOIN wgz_user as f ON f.id = e.user_id
|
||||
</if>
|
||||
<where>
|
||||
a.recipient_type = "1" AND
|
||||
a.recipient_id = #{page.recipientId} AND
|
||||
a.del_flag = "0"
|
||||
<if test="page.largeType == '1'">
|
||||
AND b.del_flag = "0"
|
||||
AND c.del_flag = "0"
|
||||
</if>
|
||||
<if test="page.largeType == '2'">
|
||||
AND d.del_flag = "0"
|
||||
</if>
|
||||
<if test="page.largeType == '3' and page.smallType == '0'">
|
||||
AND e.del_flag = "0"
|
||||
AND f.del_flag = "0"
|
||||
</if>
|
||||
<if test="page.largeType == '3' and page.smallType == '1'">
|
||||
AND a.sender_type = "0"
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
Reference in New Issue
Block a user