优化
This commit is contained in:
@ -83,7 +83,7 @@ public class BgtProjectTaskProgress implements Serializable {
|
||||
private String uploader;
|
||||
|
||||
@ApiModelProperty("上传时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
private LocalDateTime uploadTime;
|
||||
|
||||
/** 进度 */
|
||||
|
@ -117,6 +117,9 @@ public class BgtWageApplication implements Serializable {
|
||||
@ApiModelProperty("审核人名字")
|
||||
private String reviewerName;
|
||||
|
||||
@ApiModelProperty("审核意见")
|
||||
private String auditOpinion;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
@Excel(name = "删除标志" , readConverterExp = "0=代表存在,2=代表删除")
|
||||
@ApiModelProperty("删除标志(0代表存在 2代表删除)")
|
||||
|
@ -20,7 +20,7 @@ public class BgtProjectRecruitApplyUserDTO {
|
||||
@NotNull(message = "招工任务Id不能为空")
|
||||
private Long recruitId;
|
||||
|
||||
@ApiModelProperty("选择状态(0未选择 1已选择")
|
||||
@ApiModelProperty("选择状态(0未选择 1已选择 2其他")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty("务工者名字")
|
||||
|
@ -30,4 +30,10 @@ public class BgtScoreDTO {
|
||||
/** 评分内容 */
|
||||
@ApiModelProperty("评分内容")
|
||||
private String content;
|
||||
|
||||
@ApiModelProperty(value = "创建者",hidden = true)
|
||||
private String createBy;
|
||||
|
||||
@ApiModelProperty(value = "更新者",hidden = true)
|
||||
private String updateBy;
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ public class BgtPayCalculationDetailBaseVO {
|
||||
@ApiModelProperty("已付工资")
|
||||
private BigDecimal payAmount;
|
||||
|
||||
@ApiModelProperty("剩余工资")
|
||||
@ApiModelProperty("申请中工资")
|
||||
private BigDecimal residueAmount;
|
||||
|
||||
@ApiModelProperty("身份证号")
|
||||
|
@ -25,6 +25,9 @@ public class BgtPayCalculationDetailListVO {
|
||||
@ApiModelProperty("出勤天数")
|
||||
private Long num;
|
||||
|
||||
@ApiModelProperty("申请人类型")
|
||||
private String operatorType;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
@ -0,0 +1,53 @@
|
||||
package com.ruoyi.bgt.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 包工头招工申请对象 bgt_project_recruit_apply
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-18
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("App包工头招工HTML务工者信息")
|
||||
public class BgtProjectRecruitApplyHtmlVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty("主键ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("务工者用户ID")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty("姓名")
|
||||
private String username;
|
||||
|
||||
@ApiModelProperty("联系电话")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty("头像")
|
||||
private String avatarName;
|
||||
|
||||
@ApiModelProperty("招工ID")
|
||||
private Long recruitId;
|
||||
|
||||
@ApiModelProperty("招工主题")
|
||||
private String recruitName;
|
||||
|
||||
@ApiModelProperty("0报名 1包工同意 2包工头拒绝(截止时间)3务工者同意 4务工者拒绝 5进场 6离场")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty("上传状态(0,未上传 1-部分上传 2-已上传)")
|
||||
private String uploadType="0";
|
||||
}
|
@ -26,4 +26,7 @@ public class BgtProjectRecruitDetailWgzListVO {
|
||||
|
||||
@ApiModelProperty("未选择人数")
|
||||
private Integer notSelectNum;
|
||||
|
||||
@ApiModelProperty("其他人数")
|
||||
private Integer otherNum;
|
||||
}
|
||||
|
@ -28,12 +28,27 @@ public class BgtProjectTaskProgressDetailVO implements Serializable {
|
||||
@ApiModelProperty("主键ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("项目ID")
|
||||
private Long projectId;
|
||||
|
||||
@ApiModelProperty("项目名")
|
||||
private String projectName;
|
||||
|
||||
@ApiModelProperty("标段ID")
|
||||
private Long sectionId;
|
||||
|
||||
@ApiModelProperty("分包ID")
|
||||
private Long subId;
|
||||
|
||||
@ApiModelProperty("任务ID")
|
||||
private Long taskId;
|
||||
|
||||
@ApiModelProperty("任务名")
|
||||
private String taskName;
|
||||
|
||||
@ApiModelProperty("用工数量")
|
||||
private Integer taskStaffNum;
|
||||
|
||||
@ApiModelProperty("任务地址")
|
||||
private String taskAddress;
|
||||
|
||||
@ -43,31 +58,41 @@ public class BgtProjectTaskProgressDetailVO implements Serializable {
|
||||
@ApiModelProperty("负责人")
|
||||
private String director;
|
||||
|
||||
@ApiModelProperty("上传人ID")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||
private Long uploaderId;
|
||||
|
||||
@ApiModelProperty("上传人")
|
||||
private String uploader;
|
||||
|
||||
@ApiModelProperty("上传时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty("进度")
|
||||
private Integer progress;
|
||||
|
||||
@ApiModelProperty("用工数量")
|
||||
private Integer taskStaffNum;
|
||||
|
||||
@ApiModelProperty("审核状态(1审核中 2已审核 3未审核)")
|
||||
private String auditStatus;
|
||||
|
||||
@ApiModelProperty("上传时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty("进度描述")
|
||||
private String progressDescribe;
|
||||
|
||||
@ApiModelProperty("进度附件")
|
||||
private String progressAnnex;
|
||||
|
||||
@ApiModelProperty("审核状态(1审核中 2已审核 3未审核)")
|
||||
private String auditStatus;
|
||||
|
||||
@ApiModelProperty("审核人Id")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||
private Long reviewerId;
|
||||
|
||||
@ApiModelProperty("审核人名字")
|
||||
private String reviewerName;
|
||||
|
||||
@ApiModelProperty("审核意见")
|
||||
private String auditOpinion;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -26,9 +26,21 @@ public class BgtWageApplicationDetailVO {
|
||||
@ApiModelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("项目ID")
|
||||
private Long projectId;
|
||||
|
||||
@ApiModelProperty("项目名")
|
||||
private String projectName;
|
||||
|
||||
@ApiModelProperty("标段ID")
|
||||
private Long sectionId;
|
||||
|
||||
@ApiModelProperty("分包ID")
|
||||
private Long subId;
|
||||
|
||||
@ApiModelProperty("任务ID")
|
||||
private Long taskId;
|
||||
|
||||
@ApiModelProperty("任务名")
|
||||
private String taskName;
|
||||
|
||||
@ -41,6 +53,10 @@ public class BgtWageApplicationDetailVO {
|
||||
@ApiModelProperty("申请金额")
|
||||
private BigDecimal applicantAmount;
|
||||
|
||||
@ApiModelProperty("申请人ID")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty("申请人")
|
||||
private String username;
|
||||
|
||||
@ -72,4 +88,15 @@ public class BgtWageApplicationDetailVO {
|
||||
@ApiModelProperty("审核状态(1审核中 2已审核 3未审核)")
|
||||
private String auditStatus;
|
||||
|
||||
@ApiModelProperty("审核人Id")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||
private Long reviewerId;
|
||||
|
||||
@ApiModelProperty("审核人名字")
|
||||
private String reviewerName;
|
||||
|
||||
@ApiModelProperty("审核意见")
|
||||
private String auditOpinion;
|
||||
|
||||
|
||||
}
|
||||
|
@ -59,4 +59,7 @@ public class BgtWageApplicationVO {
|
||||
|
||||
@ApiModelProperty("审核状态(1审核中 2已审核 3未审核)")
|
||||
private String auditStatus;
|
||||
|
||||
@ApiModelProperty("审核意见")
|
||||
private String auditOpinion;
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import com.ruoyi.bgt.domain.dto.BgtAttendanceDayDTO;
|
||||
import com.ruoyi.bgt.domain.dto.BgtProjectRecruitApplyQueryDTO;
|
||||
import com.ruoyi.bgt.domain.dto.BgtProjectRecruitApplyUserDTO;
|
||||
import com.ruoyi.bgt.domain.dto.BgtProjectTaskUserDTO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtProjectRecruitApplyHtmlVO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtProjectRecruitApplyVO;
|
||||
import com.ruoyi.common.core.mybatisplus.cache.MybatisPlusRedisCache;
|
||||
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
|
||||
@ -33,7 +34,7 @@ public interface BgtProjectRecruitApplyMapper extends BaseMapperPlus<BgtProjectR
|
||||
|
||||
List<BgtProjectRecruitApplyVO> appQueryList(@Param("dto") BgtProjectRecruitApplyQueryDTO dto);
|
||||
|
||||
List<BgtProjectRecruitApplyVO> htmlList(@Param("recruitId") Long recruitId,@Param("isNotUpload")Boolean isNotUpload);
|
||||
List<BgtProjectRecruitApplyHtmlVO> htmlList(@Param("recruitId") Long recruitId, @Param("isNotUpload")Boolean isNotUpload);
|
||||
|
||||
// Page<BgtProjectRecruitApplyVO> dayAttendanceList(@Param("page")Page<BgtAttendanceDayDTO> queryDTOPage,@Param("dto") BgtAttendanceDayDTO dto);
|
||||
|
||||
|
@ -3,6 +3,7 @@ package com.ruoyi.bgt.service;
|
||||
import com.ruoyi.bgt.bo.BgtProjectRecruitApplyQueryBo;
|
||||
import com.ruoyi.bgt.domain.BgtProjectRecruitApply;
|
||||
import com.ruoyi.bgt.domain.dto.*;
|
||||
import com.ruoyi.bgt.domain.vo.BgtProjectRecruitApplyHtmlVO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtProjectRecruitApplyVO;
|
||||
import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
@ -96,7 +97,7 @@ public interface IBgtProjectRecruitApplyService extends IServicePlus<BgtProjectR
|
||||
*/
|
||||
List<BgtProjectRecruitApplyVO> appAllList(BgtProjectRecruitApplyQueryDTO dto);
|
||||
|
||||
List<BgtProjectRecruitApplyVO> htmlList(Long recruitId,Boolean isNotUpload);
|
||||
List<BgtProjectRecruitApplyHtmlVO> htmlList(Long recruitId, Boolean isNotUpload);
|
||||
|
||||
/**
|
||||
* LC-APP相关
|
||||
|
@ -12,6 +12,7 @@ import com.ruoyi.bgt.domain.BgtMessage;
|
||||
import com.ruoyi.bgt.domain.BgtProjectRecruit;
|
||||
import com.ruoyi.bgt.domain.BgtProjectRecruitApply;
|
||||
import com.ruoyi.bgt.domain.dto.*;
|
||||
import com.ruoyi.bgt.domain.vo.BgtProjectRecruitApplyHtmlVO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtProjectRecruitApplyVO;
|
||||
import com.ruoyi.bgt.mapper.BgtProjectRecruitApplyMapper;
|
||||
import com.ruoyi.bgt.service.IBgtMessageService;
|
||||
@ -20,6 +21,7 @@ import com.ruoyi.bgt.service.IBgtProjectRecruitService;
|
||||
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.domain.vo.AnnexUploadCountVO;
|
||||
import com.ruoyi.common.enums.RecruitApplyStatus;
|
||||
import com.ruoyi.common.enums.RecruitStatus;
|
||||
import com.ruoyi.common.exception.BaseException;
|
||||
@ -50,6 +52,7 @@ import java.time.LocalDate;
|
||||
import java.time.LocalTime;
|
||||
import java.time.temporal.TemporalAdjusters;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.ruoyi.common.constants.BgtMessageConstant.*;
|
||||
import static com.ruoyi.common.constants.WgzAndBgtMessageConstant.*;
|
||||
@ -237,8 +240,22 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
|
||||
|
||||
|
||||
@Override
|
||||
public List<BgtProjectRecruitApplyVO> htmlList(Long recruitId,Boolean isNotUpload) {
|
||||
return baseMapper.htmlList(recruitId,isNotUpload);
|
||||
public List<BgtProjectRecruitApplyHtmlVO> htmlList(Long recruitId, Boolean isNotUpload) {
|
||||
List<BgtProjectRecruitApplyHtmlVO> bgtProjectRecruitApplyVOS = baseMapper.htmlList(recruitId, isNotUpload);
|
||||
List<AnnexUploadCountVO> annexUploadCountVOS = annexService.countByRecruitId(recruitId);
|
||||
Map<String, Integer> map = annexUploadCountVOS.stream().collect(Collectors.toMap(vo->vo.getUserId()+"-"+vo.getRecruitApplyId(), AnnexUploadCountVO::getNum));
|
||||
if(!isNotUpload){
|
||||
for (BgtProjectRecruitApplyHtmlVO vo : bgtProjectRecruitApplyVOS){
|
||||
Integer i = map.get(vo.getUserId()+"-"+vo.getId());
|
||||
if (i != null && i == 1) {
|
||||
vo.setUploadType("1");
|
||||
}
|
||||
if (i != null && i == 2) {
|
||||
vo.setUploadType("2");
|
||||
}
|
||||
}
|
||||
}
|
||||
return bgtProjectRecruitApplyVOS;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -613,7 +630,6 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean score(BgtScoreDTO dto) {
|
||||
dto.setScoreBy(SecurityUtils.getAppUserId());
|
||||
Boolean insert = scoreRecordService.insert(BeanUtil.copyProperties(dto, WgzScoreRecord.class));
|
||||
|
||||
List<WgzScoreRecord> wgzScoreRecords = scoreRecordService.getBaseMapper().selectList(Wrappers.<WgzScoreRecord>lambdaQuery()
|
||||
|
@ -229,12 +229,13 @@ public class BgtProjectRecruitServiceImpl extends ServicePlusImpl<BgtProjectRecr
|
||||
wrapper.eq(BgtProjectRecruitApply::getRecruitId, id);
|
||||
wrapper.orderByDesc(BgtProjectRecruitApply::getCreateTime);
|
||||
List<BgtProjectRecruitApply> list = bgtProjectRecruitApplyService.list(wrapper);
|
||||
List<BgtProjectRecruitApplyVO> bgtProjectRecruitApplyVOS = BeanUtil.copyToList(list, BgtProjectRecruitApplyVO.class);
|
||||
|
||||
int count = (int)bgtProjectRecruitApplyVOS.stream().filter(apply -> apply.getStatus().equals(RecruitApplyStatus.SIGN_UP.getCode())).count();
|
||||
vo.setTotalNum(bgtProjectRecruitApplyVOS.size());
|
||||
int count = (int)list.stream().filter(apply -> apply.getStatus().equals(RecruitApplyStatus.SIGN_UP.getCode())).count();
|
||||
int otherNum = (int)list.stream().filter(apply -> RecruitApplyStatus.other().contains(apply.getStatus())).count();
|
||||
vo.setTotalNum(list.size());
|
||||
vo.setNotSelectNum(count);
|
||||
vo.setPassNum(vo.getTotalNum()-count);
|
||||
vo.setOtherNum(otherNum);
|
||||
vo.setPassNum(vo.getTotalNum()-count-otherNum);
|
||||
return vo;
|
||||
}
|
||||
|
||||
|
@ -134,13 +134,32 @@ public class BgtProjectTaskProgressServiceImpl extends ServicePlusImpl<BgtProjec
|
||||
* @param entity 实体类数据
|
||||
*/
|
||||
private void validEntityBeforeSave(BgtProjectTaskProgress entity){
|
||||
Integer lastProgress = getLastProgress(entity.getTaskId());
|
||||
LambdaQueryWrapper<BgtProjectTaskProgress> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(BgtProjectTaskProgress::getTaskId, entity.getTaskId());
|
||||
wrapper.orderByDesc(BgtProjectTaskProgress::getProgress);
|
||||
List<BgtProjectTaskProgress> list = baseMapper.selectList(wrapper);
|
||||
int lastProgress =0;
|
||||
if(CollectionUtil.isNotEmpty(list)){
|
||||
boolean b = list.stream().anyMatch(vo -> AuditStatus.AUDIT.getCode().equals(vo.getAuditStatus()));
|
||||
if(b){
|
||||
throw new BaseException("存在未审核的进度,请等待审核完成之后再提交");
|
||||
}
|
||||
// 找到第一个审核状态为通过的数据
|
||||
BgtProjectTaskProgress firstApproved = list.stream()
|
||||
.filter(vo -> AuditStatus.PASS.getCode().equals(vo.getAuditStatus()))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
if (firstApproved != null) {
|
||||
lastProgress = firstApproved.getProgress();
|
||||
if (firstApproved.getProgress() == 100) {
|
||||
throw new BaseException("当前任务进度已满");
|
||||
}
|
||||
}
|
||||
}
|
||||
if(lastProgress>=entity.getProgress()){
|
||||
throw new BaseException("当前进度不能小于等于上一个进度");
|
||||
}
|
||||
if(lastProgress==100){
|
||||
throw new BaseException("进度已满");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -16,6 +16,7 @@ import com.ruoyi.bgt.domain.vo.BgtWageApplicationVO;
|
||||
import com.ruoyi.bgt.mapper.BgtWageApplicationMapper;
|
||||
import com.ruoyi.bgt.service.IBgtMessageService;
|
||||
import com.ruoyi.bgt.service.IBgtWageApplicationService;
|
||||
import com.ruoyi.common.core.domain.entity.FbsUser;
|
||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.AuditStatus;
|
||||
@ -27,6 +28,7 @@ import com.ruoyi.fbs.domain.FbsProjectTask;
|
||||
import com.ruoyi.fbs.domain.dto.FbsWageAuditListDTO;
|
||||
import com.ruoyi.fbs.service.IFbsMessageService;
|
||||
import com.ruoyi.fbs.service.IFbsProjectTaskService;
|
||||
import com.ruoyi.fbs.service.IFbsUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -59,6 +61,9 @@ public class BgtWageApplicationServiceImpl extends ServicePlusImpl<BgtWageApplic
|
||||
@Autowired
|
||||
private IFbsMessageService fbsMessageService;
|
||||
|
||||
@Autowired
|
||||
private IFbsUserService fbsUserService;
|
||||
|
||||
|
||||
@Override
|
||||
public BgtWageApplication queryById(Long id){
|
||||
@ -100,6 +105,12 @@ public class BgtWageApplicationServiceImpl extends ServicePlusImpl<BgtWageApplic
|
||||
List<BgtWageApplication> list = list(Wrappers.<BgtWageApplication>lambdaQuery().eq(BgtWageApplication::getTaskId, bo.getTaskId())
|
||||
.eq(BgtWageApplication::getUserId, SecurityUtils.getAppUserId())
|
||||
.in(BgtWageApplication::getAuditStatus, AuditStatus.getUse()));
|
||||
|
||||
boolean b = list.stream()
|
||||
.anyMatch(app -> AuditStatus.AUDIT.getCode().equals(app.getAuditStatus()));
|
||||
if(b){
|
||||
throw new BaseException("您还有未审核的申请,待审核完之后在进行申请");
|
||||
}
|
||||
//收款金额
|
||||
int taskUseAmount = list.stream()
|
||||
.map(BgtWageApplication::getApplicantAmount)
|
||||
@ -116,6 +127,11 @@ public class BgtWageApplicationServiceImpl extends ServicePlusImpl<BgtWageApplic
|
||||
}
|
||||
|
||||
BgtWageApplication add = BeanUtil.toBean(bo, BgtWageApplication.class);
|
||||
FbsUser fbsUser = fbsUserService.selectUserByUserId(add.getReviewerId());
|
||||
if (fbsUser == null) {
|
||||
throw new BaseException("获取不到分包商信息");
|
||||
}
|
||||
add.setReviewerName(fbsUser.getUsername());
|
||||
boolean save = save(add);
|
||||
//系统发消息到包工头
|
||||
// HashMap<String, String> mp = new HashMap<>();
|
||||
|
@ -49,7 +49,9 @@ public class BgtMessageConstant {
|
||||
//取消选择
|
||||
public static final String BGT_LEAVE_REPORT_MAKE_UP_HEADLINE = "您【%s】项目的日报补卡已审批!";
|
||||
public static final String BGT_LEAVE_REPORT_MAKE_UP_SUBHEADING_ONE = "您【%s】项目的日报补卡,审核人【%s】已%s";
|
||||
|
||||
//主动结算工资
|
||||
public static final String BGT_ACTIVE_PAY_HEADLINE = "您【%s】项目的工资已结算!";
|
||||
public static final String BGT_ACTIVE_PAY_SUBHEADING = "您【%s】项目的工资已由包工头【%s】主动结算!";
|
||||
|
||||
//包工头->务工者 消息类型
|
||||
public static final String BGT_TYPE_SIGN_UP = "1"; //务工者报名
|
||||
@ -58,7 +60,8 @@ public class BgtMessageConstant {
|
||||
public static final String BGT_TYPE_MAKE_UP = "4"; //补卡
|
||||
public static final String BGT_TYPE_EXIT = "5"; //退场
|
||||
public static final String BGT_TYPE_CANSEL = "11"; //取消选择
|
||||
public static final String BGT_TYPE_REPORT_MAKE_UP = "12"; //日报补卡
|
||||
public static final String BGT_TYPE_REPORT_MAKE_UP = "12";
|
||||
public static final String BGT_TYPE_ACTIVE_PAY = "14"; //主动结算工资
|
||||
|
||||
|
||||
/**
|
||||
@ -177,6 +180,10 @@ public class BgtMessageConstant {
|
||||
map.put(HEADLINE, String.format(BGT_TO_FBG_PROGRESS_HEADLINE,auditor, projectName));
|
||||
map.put(SUBHEADING, String.format(BGT_TO_FBG_PROGRESS_SUBHEADING, auditor,projectName));
|
||||
break;
|
||||
case "14":
|
||||
map.put(HEADLINE, String.format(BGT_ACTIVE_PAY_HEADLINE, projectName));
|
||||
map.put(SUBHEADING, String.format(BGT_ACTIVE_PAY_SUBHEADING, projectName,auditor));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -0,0 +1,22 @@
|
||||
package com.ruoyi.common.domain.vo;
|
||||
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("附件对象")
|
||||
public class AnnexUploadCountVO {
|
||||
|
||||
@ApiModelProperty("用户ID")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty("申请ID")
|
||||
private Long recruitApplyId;
|
||||
|
||||
@ApiModelProperty("上传文件种类数量")
|
||||
private Integer num;
|
||||
}
|
@ -1,9 +1,13 @@
|
||||
package com.ruoyi.common.mapper;
|
||||
|
||||
import com.ruoyi.common.domain.Annex;
|
||||
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
|
||||
import com.ruoyi.common.core.mybatisplus.cache.MybatisPlusRedisCache;
|
||||
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
|
||||
import com.ruoyi.common.domain.Annex;
|
||||
import com.ruoyi.common.domain.vo.AnnexUploadCountVO;
|
||||
import org.apache.ibatis.annotations.CacheNamespace;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 附件Mapper接口
|
||||
@ -15,4 +19,7 @@ import org.apache.ibatis.annotations.CacheNamespace;
|
||||
@CacheNamespace(implementation = MybatisPlusRedisCache.class, eviction = MybatisPlusRedisCache.class)
|
||||
public interface AnnexMapper extends BaseMapperPlus<Annex> {
|
||||
|
||||
|
||||
List<AnnexUploadCountVO> countByRecruitId(@Param("recruitId")Long recruitId);
|
||||
|
||||
}
|
||||
|
@ -1,10 +1,11 @@
|
||||
package com.ruoyi.common.service;
|
||||
|
||||
import com.ruoyi.common.domain.Annex;
|
||||
import com.ruoyi.common.bo.AnnexQueryBo;
|
||||
import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.domain.Annex;
|
||||
import com.ruoyi.common.domain.dto.AnnexDTO;
|
||||
import com.ruoyi.common.domain.vo.AnnexUploadCountVO;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@ -90,4 +91,9 @@ public interface IAnnexService extends IServicePlus<Annex> {
|
||||
* 检查入场材料
|
||||
*/
|
||||
boolean checkEntry(Long userId,Long recruitId);
|
||||
|
||||
/**
|
||||
* 统计招工中的资料上传情况
|
||||
*/
|
||||
List<AnnexUploadCountVO> countByRecruitId(Long recruitId);
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.domain.Annex;
|
||||
import com.ruoyi.common.domain.dto.AnnexDTO;
|
||||
import com.ruoyi.common.domain.vo.AnnexUploadCountVO;
|
||||
import com.ruoyi.common.mapper.AnnexMapper;
|
||||
import com.ruoyi.common.service.IAnnexService;
|
||||
import com.ruoyi.common.tool.FileDeletionService;
|
||||
@ -183,4 +184,9 @@ public class AnnexServiceImpl extends ServicePlusImpl<AnnexMapper, Annex> implem
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AnnexUploadCountVO> countByRecruitId(Long recruitId) {
|
||||
return baseMapper.countByRecruitId(recruitId);
|
||||
}
|
||||
}
|
||||
|
@ -139,6 +139,9 @@ public class FbsWageApplication implements Serializable {
|
||||
@ApiModelProperty("审核人名字")
|
||||
private String reviewerName;
|
||||
|
||||
@ApiModelProperty("审核意见")
|
||||
private String auditOpinion;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
@Excel(name = "删除标志" , readConverterExp = "0=代表存在,2=代表删除")
|
||||
@ApiModelProperty("删除标志(0代表存在 2代表删除)")
|
||||
|
@ -17,6 +17,9 @@ public class FbsProjectListDTO {
|
||||
@ApiModelProperty("类型:0申请中,1已加入,2已竣工")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty("项目名字")
|
||||
private String projectName;
|
||||
|
||||
@ApiModelProperty(value = "分包商Id",hidden = true)
|
||||
private Long fbsUserId;
|
||||
|
||||
|
@ -14,7 +14,7 @@ import javax.validation.constraints.NotNull;
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel("App包工头工资申请分页查询对象")
|
||||
@ApiModel("App分包商工资申请审核")
|
||||
public class FbsWageAuditDTO {
|
||||
|
||||
@ApiModelProperty("主键ID")
|
||||
@ -24,5 +24,8 @@ public class FbsWageAuditDTO {
|
||||
@ApiModelProperty("审核状态(1审核中 2已审核 3未通过)")
|
||||
private String auditStatus;
|
||||
|
||||
@ApiModelProperty("审核意见")
|
||||
private String auditOpinion;
|
||||
|
||||
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ public class FbsWageAuditListDTO {
|
||||
// @ApiModelProperty("审核状态(1审核中 2已审核 3未通过)")
|
||||
// private String auditStatus;
|
||||
|
||||
@ApiModelProperty("筛选(1申请中 2已结算)")
|
||||
@ApiModelProperty("筛选(1申请中 2已结算 3未通过)")
|
||||
private Integer type;
|
||||
|
||||
|
||||
|
@ -155,6 +155,8 @@ public class BusinessTask
|
||||
bgtScoreDTO.setUserId(bgtProjectRecruitApply.getUserId());
|
||||
bgtScoreDTO.setScoreBy(map.get(bgtProjectRecruitApply.getRecruitId()));
|
||||
bgtScoreDTO.setContent("默认评分");
|
||||
bgtScoreDTO.setCreateBy("系统");
|
||||
bgtScoreDTO.setUpdateBy("系统");
|
||||
iBgtProjectRecruitApplyService.score(bgtScoreDTO);
|
||||
}
|
||||
|
||||
|
@ -94,4 +94,6 @@ public class WgzAppApplyForPayrollSettlementListRes implements Serializable {
|
||||
@ApiModelProperty("附件实体数据")
|
||||
private List<WgzPayCalculationFiles> payCalculation;
|
||||
|
||||
@ApiModelProperty("申请人类型")
|
||||
private String operatorType;
|
||||
}
|
||||
|
@ -144,6 +144,11 @@ public interface IWgzPayCalculationService extends IServicePlus<WgzPayCalculatio
|
||||
*/
|
||||
BigDecimal getAlreadyPay(Long userId, Long recruitApplyId);
|
||||
|
||||
/**
|
||||
* 根据招工申请获取这一次申请中的工资
|
||||
*/
|
||||
BigDecimal getApplyPay(Long userId, Long recruitApplyId);
|
||||
|
||||
/**
|
||||
* 获取任务下已审核通过的数据
|
||||
*/
|
||||
|
@ -514,7 +514,10 @@ public class WgzPayCalculationServiceImpl extends ServicePlusImpl<WgzPayCalculat
|
||||
//获取个人已结算工资
|
||||
BigDecimal alreadyPay = getAlreadyPay(userId, recruitApplyId);
|
||||
vo.setPayAmount(alreadyPay);
|
||||
vo.setResidueAmount(vo.getAllAmount().subtract(vo.getPayAmount()));
|
||||
|
||||
//获取个人申请中的工资
|
||||
BigDecimal applyPay = getApplyPay(userId, recruitApplyId);
|
||||
vo.setResidueAmount(applyPay);
|
||||
|
||||
//未结算天数
|
||||
Integer days = attendanceService.unFinishCount(userId, recruitId, recruitApplyId);
|
||||
@ -540,7 +543,7 @@ public class WgzPayCalculationServiceImpl extends ServicePlusImpl<WgzPayCalculat
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean bgtAdd(BgtApplyForWgzPayAddDTO dto) {
|
||||
|
||||
//添加申请
|
||||
@ -570,16 +573,16 @@ public class WgzPayCalculationServiceImpl extends ServicePlusImpl<WgzPayCalculat
|
||||
iWgzPayCalculationMiddleService.saveBatch(middleList);
|
||||
|
||||
//修改其余未审批申请的状态
|
||||
List<WgzPayCalculation> payList = list(Wrappers.<WgzPayCalculation>lambdaQuery().eq(WgzPayCalculation::getAuditorType, AuditStatus.UNREAD.getCode())
|
||||
.eq(WgzPayCalculation::getRecruitId, dto.getRecruitId())
|
||||
.eq(WgzPayCalculation::getApplyKey, dto.getRecruitApplyId())
|
||||
.eq(WgzPayCalculation::getUserId, dto.getUserId()));
|
||||
if(CollectionUtil.isNotEmpty(payList)) {
|
||||
payList.forEach(pay -> {
|
||||
pay.setAuditorType(AuditStatus.REFUSE.getCode());
|
||||
});
|
||||
}
|
||||
updateBatchById(payList);
|
||||
// List<WgzPayCalculation> payList = list(Wrappers.<WgzPayCalculation>lambdaQuery().eq(WgzPayCalculation::getAuditorType, AuditStatus.UNREAD.getCode())
|
||||
// .eq(WgzPayCalculation::getRecruitId, dto.getRecruitId())
|
||||
// .eq(WgzPayCalculation::getApplyKey, dto.getRecruitApplyId())
|
||||
// .eq(WgzPayCalculation::getUserId, dto.getUserId()));
|
||||
// if(CollectionUtil.isNotEmpty(payList)) {
|
||||
// payList.forEach(pay -> {
|
||||
// pay.setAuditorType(AuditStatus.REFUSE.getCode());
|
||||
// });
|
||||
// }
|
||||
// updateBatchById(payList);
|
||||
|
||||
//存附件
|
||||
List<WgzPayCalculationFiles> files = dto.getPayCalculation();
|
||||
@ -589,6 +592,22 @@ public class WgzPayCalculationServiceImpl extends ServicePlusImpl<WgzPayCalculat
|
||||
});
|
||||
iWgzPayCalculationFilesService.saveBatch(files);
|
||||
}
|
||||
//发消息
|
||||
HashMap<String, String> mp = new HashMap<>();
|
||||
mp.put("projectName",iBgtProjectRecruitService.getById(payCalculation.getRecruitId()).getRecruitName());
|
||||
mp.put("auditor",SecurityUtils.getUsername());
|
||||
Map<String, String> map = bgtMessage(mp, BGT_TYPE_ACTIVE_PAY, true);
|
||||
WgzMessage wgzMessage = new WgzMessage()
|
||||
.setSenderType(USERTYPE_BGT)
|
||||
.setSenderId(SecurityUtils.getAppUserId())
|
||||
.setRecipientType(USERTYPE_WGZ)
|
||||
.setRecipientId(payCalculation.getUserId())
|
||||
.setHeadline(map.get(HEADLINE))
|
||||
.setSubheading(map.get(SUBHEADING))
|
||||
.setTableId(payCalculation.getId())
|
||||
.setTableName(SqlHelper.table(WgzPayCalculation.class).getTableName())
|
||||
.setMessageLargeType(LARGE_SALARY);
|
||||
wgzMessageService.sendAMessage(wgzMessage);
|
||||
return save;
|
||||
}
|
||||
|
||||
@ -647,7 +666,24 @@ public class WgzPayCalculationServiceImpl extends ServicePlusImpl<WgzPayCalculat
|
||||
LambdaQueryWrapper<WgzPayCalculation> eq = new LambdaQueryWrapper<WgzPayCalculation>().
|
||||
eq(WgzPayCalculation::getUserId, userId).
|
||||
eq(WgzPayCalculation::getApplyKey, recruitApplyId).
|
||||
eq(WgzPayCalculation::getAuditorType, "2");
|
||||
eq(WgzPayCalculation::getAuditorType, AuditStatus.PASS.getCode());
|
||||
List<WgzPayCalculation> gzs = baseMapper.selectList(eq);
|
||||
|
||||
BigDecimal addSum = new BigDecimal(0);
|
||||
for (WgzPayCalculation gz : gzs) {
|
||||
//金额*天数=实际工资
|
||||
BigDecimal multiply = gz.getRecruitAmount().multiply(BigDecimal.valueOf(gz.getNum()));
|
||||
addSum = addSum.add(multiply);
|
||||
}
|
||||
return addSum;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getApplyPay(Long userId, Long recruitApplyId) {
|
||||
LambdaQueryWrapper<WgzPayCalculation> eq = new LambdaQueryWrapper<WgzPayCalculation>().
|
||||
eq(WgzPayCalculation::getUserId, userId).
|
||||
eq(WgzPayCalculation::getApplyKey, recruitApplyId).
|
||||
in(WgzPayCalculation::getAuditorType, AuditStatus.getToAudit());
|
||||
List<WgzPayCalculation> gzs = baseMapper.selectList(eq);
|
||||
|
||||
BigDecimal addSum = new BigDecimal(0);
|
||||
|
@ -0,0 +1,46 @@
|
||||
package com.ruoyi.zbf.domain.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 消息对象 bgt_message
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("总包方消息详情查询对象")
|
||||
public class ZbfMessageDetailDTO {
|
||||
|
||||
/** 分页大小 */
|
||||
@ApiModelProperty("分页大小")
|
||||
private Integer pageSize;
|
||||
/** 当前页数 */
|
||||
@ApiModelProperty("当前页数")
|
||||
private Integer pageNum;
|
||||
|
||||
@ApiModelProperty("日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate date;
|
||||
|
||||
@ApiModelProperty("大类型(字典fbs_message_large_type)")
|
||||
private String messageLargeType;
|
||||
|
||||
@ApiModelProperty("小类型(字典fbs_message_small_type)")
|
||||
private String messageSmallType;
|
||||
|
||||
@ApiModelProperty("是否待处理")
|
||||
private Boolean isHandle = false;
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.ruoyi.zbf.domain.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 消息对象 bgt_message
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("消息列表查询对象")
|
||||
public class ZbfMessageMyListDTO {
|
||||
|
||||
/** 分页大小 */
|
||||
@ApiModelProperty("分页大小")
|
||||
private Integer pageSize;
|
||||
/** 当前页数 */
|
||||
@ApiModelProperty("当前页数")
|
||||
private Integer pageNum;
|
||||
|
||||
}
|
@ -14,7 +14,7 @@ import javax.validation.constraints.NotNull;
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel("App包工头工资申请分页查询对象")
|
||||
@ApiModel("App总包方工资申请审核")
|
||||
public class ZbfWageAuditDTO {
|
||||
|
||||
@ApiModelProperty("主键ID")
|
||||
@ -24,5 +24,6 @@ public class ZbfWageAuditDTO {
|
||||
@ApiModelProperty("审核状态(1审核中 2已审核 3未通过)")
|
||||
private String auditStatus;
|
||||
|
||||
|
||||
@ApiModelProperty("审核意见")
|
||||
private String auditOpinion;
|
||||
}
|
||||
|
@ -0,0 +1,36 @@
|
||||
package com.ruoyi.zbf.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 消息对象 bgt_message
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("分包商未读消息统计视图对象")
|
||||
public class ZbfMessageCountVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty("项目消息")
|
||||
private Integer taskMessageCount;
|
||||
|
||||
@ApiModelProperty("结算消息")
|
||||
private Integer settlementMessageCount;
|
||||
|
||||
@ApiModelProperty("其他消息")
|
||||
private Integer otherMessageCount;
|
||||
|
||||
@ApiModelProperty("待处理消息")
|
||||
private Integer handleMessageCount;
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package com.ruoyi.zbf.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 消息对象 bgt_message
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("总包方消息列表详情视图对象")
|
||||
public class ZbfMessageDetailVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty("主键自增ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("发送人")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||
private Long senderId;
|
||||
|
||||
@ApiModelProperty("表ID")
|
||||
private Long tableId;
|
||||
|
||||
@ApiModelProperty("标题")
|
||||
private String headline;
|
||||
|
||||
@ApiModelProperty("副标题")
|
||||
private String subheading;
|
||||
|
||||
@ApiModelProperty("大类型(字典fbs_message_large_type)")
|
||||
private String messageLargeType;
|
||||
|
||||
@ApiModelProperty("小类型(字典fbs_message_small_type)")
|
||||
private String messageSmallType;
|
||||
|
||||
@ApiModelProperty("读状态(0未读 1已读)")
|
||||
private String readStatus;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty("是否需要操作(0不需要 1需要 2已操作)")
|
||||
private String isOperation ;
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package com.ruoyi.zbf.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 消息对象 bgt_message
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("总包方消息列表视图对象")
|
||||
public class ZbfMessageVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty("主键自增ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("表ID")
|
||||
private Long tableId;
|
||||
|
||||
@ApiModelProperty("发送人")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||
private Long senderId;
|
||||
|
||||
@ApiModelProperty("标题")
|
||||
private String headline;
|
||||
|
||||
@ApiModelProperty("副标题")
|
||||
private String subheading;
|
||||
|
||||
@ApiModelProperty("大类型(字典fbs_message_large_type)")
|
||||
private String messageLargeType;
|
||||
|
||||
@ApiModelProperty("小类型(字典fbs_message_small_type)")
|
||||
private String messageSmallType;
|
||||
|
||||
@ApiModelProperty("读状态(0未读 1已读)")
|
||||
private String readStatus;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -4,6 +4,11 @@ import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.zbf.bo.ZbfMessageQueryBo;
|
||||
import com.ruoyi.zbf.domain.ZbfMessage;
|
||||
import com.ruoyi.zbf.domain.dto.ZbfMessageDetailDTO;
|
||||
import com.ruoyi.zbf.domain.dto.ZbfMessageMyListDTO;
|
||||
import com.ruoyi.zbf.domain.vo.ZbfMessageCountVO;
|
||||
import com.ruoyi.zbf.domain.vo.ZbfMessageDetailVO;
|
||||
import com.ruoyi.zbf.domain.vo.ZbfMessageVO;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@ -68,5 +73,18 @@ public interface IZbfMessageService extends IServicePlus<ZbfMessage> {
|
||||
*/
|
||||
void operationBatch(String recipientType,Long recipientId,List<Long> tableIds,String tableName);
|
||||
|
||||
/**
|
||||
* 总包方的未读消息统计
|
||||
*/
|
||||
ZbfMessageCountVO countUnread();
|
||||
|
||||
/**
|
||||
* 总包方消息列表
|
||||
*/
|
||||
TableDataInfo<ZbfMessageVO> queryMyPageList(ZbfMessageMyListDTO dto);
|
||||
|
||||
/**
|
||||
* 消息详情列表
|
||||
*/
|
||||
TableDataInfo<ZbfMessageDetailVO> queryDetailPageList(ZbfMessageDetailDTO dto);
|
||||
}
|
||||
|
@ -8,18 +8,28 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BgtMessageType;
|
||||
import com.ruoyi.common.utils.PageUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.zbf.bo.ZbfMessageQueryBo;
|
||||
import com.ruoyi.zbf.domain.ZbfMessage;
|
||||
import com.ruoyi.zbf.domain.dto.ZbfMessageDetailDTO;
|
||||
import com.ruoyi.zbf.domain.dto.ZbfMessageMyListDTO;
|
||||
import com.ruoyi.zbf.domain.vo.ZbfMessageCountVO;
|
||||
import com.ruoyi.zbf.domain.vo.ZbfMessageDetailVO;
|
||||
import com.ruoyi.zbf.domain.vo.ZbfMessageVO;
|
||||
import com.ruoyi.zbf.mapper.ZbfMessageMapper;
|
||||
import com.ruoyi.zbf.service.IZbfMessageService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalTime;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.ruoyi.common.constants.WgzAndBgtMessageConstant.OPERATION_ALREADY;
|
||||
import static com.ruoyi.common.constants.WgzAndBgtMessageConstant.OPERATION_NEED;
|
||||
|
||||
/**
|
||||
* 消息Service业务层处理
|
||||
@ -124,4 +134,52 @@ public class ZbfMessageServiceImpl extends ServicePlusImpl<ZbfMessageMapper, Zbf
|
||||
update(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ZbfMessageCountVO countUnread() {
|
||||
List<ZbfMessage> zbfMessages = baseMapper.selectList(Wrappers.<ZbfMessage>lambdaQuery()
|
||||
.eq(ZbfMessage::getRecipientId, SecurityUtils.getAppUserId())
|
||||
.eq(ZbfMessage::getReadStatus, "0"));
|
||||
Map<String, Long> map = zbfMessages.stream().collect(Collectors.groupingBy(ZbfMessage::getMessageLargeType, Collectors.counting()));
|
||||
|
||||
ZbfMessageCountVO zbfMessageCountVO = new ZbfMessageCountVO();
|
||||
zbfMessageCountVO.setTaskMessageCount(map.getOrDefault(BgtMessageType.TASK.getCode(), 0L).intValue());
|
||||
zbfMessageCountVO.setSettlementMessageCount(map.getOrDefault(BgtMessageType.SETTLEMENT.getCode(), 0L).intValue());
|
||||
zbfMessageCountVO.setOtherMessageCount(map.getOrDefault(BgtMessageType.OTHER.getCode(), 0L).intValue());
|
||||
|
||||
Integer handle = baseMapper.selectCount(Wrappers.<ZbfMessage>lambdaQuery()
|
||||
.eq(ZbfMessage::getRecipientId, SecurityUtils.getAppUserId())
|
||||
.eq(ZbfMessage::getIsOperation, OPERATION_NEED));
|
||||
zbfMessageCountVO.setHandleMessageCount(handle);
|
||||
return zbfMessageCountVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<ZbfMessageVO> queryMyPageList(ZbfMessageMyListDTO dto) {
|
||||
LambdaQueryWrapper<ZbfMessage> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(ZbfMessage::getRecipientId, SecurityUtils.getAppUserId());
|
||||
wrapper.orderByDesc(ZbfMessage::getCreateTime);
|
||||
Page<ZbfMessage> result = page(PageUtils.buildPage(), wrapper);
|
||||
Page<ZbfMessageVO> page = new Page<>();
|
||||
page.setTotal(result.getTotal());
|
||||
page.setRecords(BeanUtil.copyToList(result.getRecords(), ZbfMessageVO.class));
|
||||
return PageUtils.buildDataInfo(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<ZbfMessageDetailVO> queryDetailPageList(ZbfMessageDetailDTO dto) {
|
||||
LambdaQueryWrapper<ZbfMessage> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(ZbfMessage::getRecipientId, SecurityUtils.getAppUserId());
|
||||
wrapper.eq(StrUtil.isNotBlank(dto.getMessageLargeType()), ZbfMessage::getMessageLargeType, dto.getMessageLargeType());
|
||||
wrapper.eq(StrUtil.isNotBlank(dto.getMessageSmallType()), ZbfMessage::getMessageSmallType, dto.getMessageSmallType());
|
||||
wrapper.eq(dto.getIsHandle(), ZbfMessage::getIsOperation,OPERATION_NEED);
|
||||
if(dto.getDate() != null) {
|
||||
wrapper.between(ZbfMessage::getCreateTime, dto.getDate().atStartOfDay(), dto.getDate().atStartOfDay().with(LocalTime.MAX));
|
||||
}
|
||||
wrapper.orderByDesc(ZbfMessage::getId);
|
||||
Page<ZbfMessage> result = page(PageUtils.buildPage(), wrapper);
|
||||
Page<ZbfMessageDetailVO> page = new Page<>();
|
||||
page.setTotal(result.getTotal());
|
||||
page.setRecords(BeanUtil.copyToList(result.getRecords(), ZbfMessageDetailVO.class));
|
||||
return PageUtils.buildDataInfo(page);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user