优化
This commit is contained in:
@ -0,0 +1,33 @@
|
||||
package com.ruoyi.bgt.domain.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 工资结算分页查询对象 wgz_pay_calculation
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("包工头请假审核对象")
|
||||
public class BgtLeaveUpdateDTO {
|
||||
|
||||
@ApiModelProperty("主键自增ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("审核状态(0待审核 1审核中 2已同意 3已拒绝 4=已取消)")
|
||||
private String auditorType;
|
||||
|
||||
|
||||
@ApiModelProperty("审核意见")
|
||||
private String auditorOpinion;
|
||||
|
||||
|
||||
}
|
@ -8,7 +8,7 @@ import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 消息对象 bgt_message
|
||||
@ -20,7 +20,7 @@ import java.time.LocalDateTime;
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("其他消息查询对象")
|
||||
public class BgtMessageOtherDTO implements Serializable {
|
||||
public class BgtMessageDetailDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ -32,8 +32,11 @@ public class BgtMessageOtherDTO implements Serializable {
|
||||
private Integer pageNum;
|
||||
|
||||
@ApiModelProperty("日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd hh", timezone = "GMT+8")
|
||||
private LocalDateTime date;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private LocalDate date;
|
||||
|
||||
@ApiModelProperty("大类型(字典bgt_message_large_type)")
|
||||
private String messageLargeType;
|
||||
|
||||
@ApiModelProperty("小类型(字典bgt_message_small_type)")
|
||||
private String messageSmallType;
|
@ -20,7 +20,7 @@ import java.time.LocalDateTime;
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("其他消息列表视图对象")
|
||||
public class BgtMessageOtherVO implements Serializable {
|
||||
public class BgtMessageDetailVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ -46,6 +46,7 @@ public class BgtMessageOtherVO implements Serializable {
|
||||
private String readStatus;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
//补卡
|
@ -50,6 +50,9 @@ public class BgtProjectRecruitApplyVO implements Serializable {
|
||||
@ApiModelProperty("工种")
|
||||
private String typeOfWork;
|
||||
|
||||
@ApiModelProperty("招工ID")
|
||||
private Long recruitId;
|
||||
|
||||
@ApiModelProperty("招工主题")
|
||||
private String recruitName;
|
||||
|
||||
|
@ -107,7 +107,7 @@ public class BgtProjectRecruitDetailVO implements Serializable {
|
||||
private LocalTime endWorkTime;
|
||||
|
||||
@ApiModelProperty("申请者列表")
|
||||
List<BgtProjectRecruitApplyVO> applylist;
|
||||
List<BgtProjectRecruitApplyVO> applyList;
|
||||
|
||||
@ApiModelProperty("总人数")
|
||||
private Integer totalNum;
|
||||
|
@ -0,0 +1,41 @@
|
||||
package com.ruoyi.bgt.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;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 包工头招工对象 bgt_project_recruit
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-17
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("App包工头招工详情-务工者申请列表对象")
|
||||
public class BgtProjectRecruitDetailWgzListVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/** 主键ID */
|
||||
@ApiModelProperty("主键ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("申请者列表")
|
||||
List<BgtProjectRecruitApplyVO> applyList;
|
||||
|
||||
@ApiModelProperty("总人数")
|
||||
private Integer totalNum;
|
||||
|
||||
@ApiModelProperty("同意人数")
|
||||
private Integer passNum;
|
||||
|
||||
@ApiModelProperty("未选择人数")
|
||||
private Integer notSelectNum;
|
||||
}
|
@ -55,6 +55,6 @@ public class BgtProjectRecruitVO implements Serializable {
|
||||
private String typeOfWork;
|
||||
|
||||
@ApiModelProperty("申请者列表")
|
||||
List<BgtProjectRecruitApplyVO> applylist;
|
||||
List<BgtProjectRecruitApplyVO> applyList;
|
||||
|
||||
}
|
||||
|
@ -2,8 +2,8 @@ package com.ruoyi.bgt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.bgt.domain.BgtMessage;
|
||||
import com.ruoyi.bgt.domain.dto.BgtMessageOtherDTO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtMessageOtherVO;
|
||||
import com.ruoyi.bgt.domain.dto.BgtMessageDetailDTO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtMessageDetailVO;
|
||||
import com.ruoyi.common.core.mybatisplus.cache.MybatisPlusRedisCache;
|
||||
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
|
||||
import org.apache.ibatis.annotations.CacheNamespace;
|
||||
@ -19,5 +19,5 @@ import org.apache.ibatis.annotations.Param;
|
||||
@CacheNamespace(implementation = MybatisPlusRedisCache.class, eviction = MybatisPlusRedisCache.class)
|
||||
public interface BgtMessageMapper extends BaseMapperPlus<BgtMessage> {
|
||||
|
||||
Page<BgtMessageOtherVO> queryOtherPageList(@Param("page")Page<BgtMessageOtherDTO> page,@Param("dto") BgtMessageOtherDTO dto);
|
||||
Page<BgtMessageDetailVO> queryOtherPageList(@Param("page")Page<BgtMessageDetailDTO> page, @Param("dto") BgtMessageDetailDTO dto);
|
||||
}
|
||||
|
@ -3,9 +3,9 @@ package com.ruoyi.bgt.service;
|
||||
import com.ruoyi.bgt.bo.BgtMessageQueryBo;
|
||||
import com.ruoyi.bgt.domain.BgtMessage;
|
||||
import com.ruoyi.bgt.domain.dto.BgtMessageMyListDTO;
|
||||
import com.ruoyi.bgt.domain.dto.BgtMessageOtherDTO;
|
||||
import com.ruoyi.bgt.domain.dto.BgtMessageDetailDTO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtMessageCountVO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtMessageOtherVO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtMessageDetailVO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtMessageVO;
|
||||
import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
@ -81,7 +81,7 @@ public interface IBgtMessageService extends IServicePlus<BgtMessage> {
|
||||
TableDataInfo<BgtMessageVO> queryMyPageList(BgtMessageMyListDTO dto);
|
||||
|
||||
/**
|
||||
* 其他消息列表
|
||||
* 消息详情列表
|
||||
*/
|
||||
TableDataInfo<BgtMessageOtherVO> queryOtherPageList(BgtMessageOtherDTO dto);
|
||||
TableDataInfo<BgtMessageDetailVO> queryDetailPageList(BgtMessageDetailDTO dto);
|
||||
}
|
||||
|
@ -10,8 +10,6 @@ import com.ruoyi.bgt.domain.vo.BgtProjectRecruitApplyVO;
|
||||
import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppConfirmRegistrationReq;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppUnderwayReq;
|
||||
import com.ruoyi.wgz.bo.res.WgzAppUnderwayRes;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@ -107,6 +105,11 @@ public interface IBgtProjectRecruitApplyService extends IServicePlus<BgtProjectR
|
||||
*/
|
||||
Boolean quit(Long id);
|
||||
|
||||
/**
|
||||
* 批量退场
|
||||
*/
|
||||
void quitBatch(Long taskId);
|
||||
|
||||
/**
|
||||
* 评分
|
||||
*/
|
||||
|
@ -4,6 +4,7 @@ import com.ruoyi.bgt.bo.BgtProjectRecruitQueryBo;
|
||||
import com.ruoyi.bgt.domain.BgtProjectRecruit;
|
||||
import com.ruoyi.bgt.domain.dto.BgtProjectRecruitQueryDTO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtProjectRecruitDetailVO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtProjectRecruitDetailWgzListVO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtProjectRecruitVO;
|
||||
import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
@ -17,6 +18,7 @@ import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 包工头招工Service接口
|
||||
@ -73,12 +75,22 @@ public interface IBgtProjectRecruitService extends IServicePlus<BgtProjectRecrui
|
||||
*/
|
||||
BgtProjectRecruitDetailVO appQueryById(Long id);
|
||||
|
||||
/**
|
||||
* 务工者统计
|
||||
*/
|
||||
BgtProjectRecruitDetailWgzListVO wgzList(Long id);
|
||||
|
||||
/**
|
||||
* 获取任务下的所有招工Id
|
||||
*/
|
||||
List<Long> getRecruitIdsByTaskId(Long taskId);
|
||||
|
||||
|
||||
/**
|
||||
* 获取任务下的所有招工Id和招工名称
|
||||
*/
|
||||
Map<Long,String> getRecruitIdAndNameByTaskId(Long taskId);
|
||||
|
||||
/**
|
||||
* LC-APP相关
|
||||
* =================================================================================================================
|
||||
|
@ -7,28 +7,41 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.bgt.bo.BgtMessageQueryBo;
|
||||
import com.ruoyi.bgt.domain.BgtMessage;
|
||||
import com.ruoyi.bgt.domain.BgtProjectRecruit;
|
||||
import com.ruoyi.bgt.domain.BgtProjectRecruitApply;
|
||||
import com.ruoyi.bgt.domain.dto.BgtMessageDetailDTO;
|
||||
import com.ruoyi.bgt.domain.dto.BgtMessageMyListDTO;
|
||||
import com.ruoyi.bgt.domain.dto.BgtMessageOtherDTO;
|
||||
import com.ruoyi.bgt.domain.dto.BgtProjectRecruitApplyQueryDTO;
|
||||
import com.ruoyi.bgt.domain.dto.BgtProjectRecruitQueryDTO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtMessageCountVO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtMessageOtherVO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtMessageDetailVO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtMessageVO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtProjectRecruitApplyVO;
|
||||
import com.ruoyi.bgt.mapper.BgtMessageMapper;
|
||||
import com.ruoyi.bgt.service.IBgtMessageService;
|
||||
import com.ruoyi.bgt.service.IBgtProjectRecruitApplyService;
|
||||
import com.ruoyi.bgt.service.IBgtProjectRecruitService;
|
||||
import com.ruoyi.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.wgz.domain.WgzLeave;
|
||||
import com.ruoyi.wgz.domain.WgzPayCalculation;
|
||||
import com.ruoyi.wgz.domain.WgzReissueacard;
|
||||
import com.ruoyi.wgz.service.IWgzLeaveService;
|
||||
import com.ruoyi.wgz.service.IWgzPayCalculationService;
|
||||
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 java.time.LocalTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.ruoyi.common.constants.BgtMessageConstant.*;
|
||||
|
||||
/**
|
||||
* 消息Service业务层处理
|
||||
*
|
||||
@ -38,69 +51,87 @@ import java.util.stream.Collectors;
|
||||
@Service
|
||||
public class BgtMessageServiceImpl extends ServicePlusImpl<BgtMessageMapper, BgtMessage> implements IBgtMessageService {
|
||||
|
||||
@Override
|
||||
public BgtMessage queryById(Long id){
|
||||
return getById(id);
|
||||
}
|
||||
@Autowired
|
||||
private IBgtProjectRecruitApplyService recruitApplyService;
|
||||
|
||||
@Override
|
||||
public TableDataInfo<BgtMessage> queryPageList(BgtMessageQueryBo bo) {
|
||||
Page<BgtMessage> result = page(PageUtils.buildPage(), buildQueryWrapper(bo));
|
||||
return PageUtils.buildDataInfo(result);
|
||||
}
|
||||
@Autowired
|
||||
private IBgtProjectRecruitService recruitService;
|
||||
|
||||
@Override
|
||||
public List<BgtMessage> queryList(BgtMessageQueryBo bo) {
|
||||
return list(buildQueryWrapper(bo));
|
||||
}
|
||||
@Autowired
|
||||
private IWgzPayCalculationService payCalculationService;
|
||||
|
||||
private LambdaQueryWrapper<BgtMessage> buildQueryWrapper(BgtMessageQueryBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BgtMessage> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(StrUtil.isNotBlank(bo.getSenderType()), BgtMessage::getSenderType, bo.getSenderType());
|
||||
lqw.eq(bo.getSenderId() != null, BgtMessage::getSenderId, bo.getSenderId());
|
||||
lqw.eq(StrUtil.isNotBlank(bo.getRecipientType()), BgtMessage::getRecipientType, bo.getRecipientType());
|
||||
lqw.eq(bo.getRecipientId() != null, BgtMessage::getRecipientId, bo.getRecipientId());
|
||||
lqw.eq(StrUtil.isNotBlank(bo.getHeadline()), BgtMessage::getHeadline, bo.getHeadline());
|
||||
lqw.eq(StrUtil.isNotBlank(bo.getSubheading()), BgtMessage::getSubheading, bo.getSubheading());
|
||||
lqw.eq(bo.getTableId() != null, BgtMessage::getTableId, bo.getTableId());
|
||||
lqw.like(StrUtil.isNotBlank(bo.getTableName()), BgtMessage::getTableName, bo.getTableName());
|
||||
lqw.eq(StrUtil.isNotBlank(bo.getMessageLargeType()), BgtMessage::getMessageLargeType, bo.getMessageLargeType());
|
||||
lqw.eq(StrUtil.isNotBlank(bo.getMessageSmallType()), BgtMessage::getMessageSmallType, bo.getMessageSmallType());
|
||||
lqw.eq(StrUtil.isNotBlank(bo.getReadStatus()), BgtMessage::getReadStatus, bo.getReadStatus());
|
||||
return lqw;
|
||||
}
|
||||
@Autowired
|
||||
private IWgzLeaveService leaveService;
|
||||
|
||||
@Override
|
||||
public Boolean insert(BgtMessage bo) {
|
||||
BgtMessage add = BeanUtil.toBean(bo, BgtMessage.class);
|
||||
validEntityBeforeSave(add);
|
||||
return save(add);
|
||||
}
|
||||
@Autowired
|
||||
private IWgzUserService wgzUserService;
|
||||
|
||||
@Override
|
||||
public Boolean update(BgtMessage bo) {
|
||||
BgtMessage update = BeanUtil.toBean(bo, BgtMessage.class);
|
||||
validEntityBeforeSave(update);
|
||||
return updateById(update);
|
||||
}
|
||||
@Autowired
|
||||
private IWgzReissueacardService reissueacardService;
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*
|
||||
* @param entity 实体类数据
|
||||
*/
|
||||
private void validEntityBeforeSave(BgtMessage entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
@Override
|
||||
public BgtMessage queryById(Long id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return removeByIds(ids);
|
||||
}
|
||||
@Override
|
||||
public TableDataInfo<BgtMessage> queryPageList(BgtMessageQueryBo bo) {
|
||||
Page<BgtMessage> result = page(PageUtils.buildPage(), buildQueryWrapper(bo));
|
||||
return PageUtils.buildDataInfo(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BgtMessage> queryList(BgtMessageQueryBo bo) {
|
||||
return list(buildQueryWrapper(bo));
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BgtMessage> buildQueryWrapper(BgtMessageQueryBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BgtMessage> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(StrUtil.isNotBlank(bo.getSenderType()), BgtMessage::getSenderType, bo.getSenderType());
|
||||
lqw.eq(bo.getSenderId() != null, BgtMessage::getSenderId, bo.getSenderId());
|
||||
lqw.eq(StrUtil.isNotBlank(bo.getRecipientType()), BgtMessage::getRecipientType, bo.getRecipientType());
|
||||
lqw.eq(bo.getRecipientId() != null, BgtMessage::getRecipientId, bo.getRecipientId());
|
||||
lqw.eq(StrUtil.isNotBlank(bo.getHeadline()), BgtMessage::getHeadline, bo.getHeadline());
|
||||
lqw.eq(StrUtil.isNotBlank(bo.getSubheading()), BgtMessage::getSubheading, bo.getSubheading());
|
||||
lqw.eq(bo.getTableId() != null, BgtMessage::getTableId, bo.getTableId());
|
||||
lqw.like(StrUtil.isNotBlank(bo.getTableName()), BgtMessage::getTableName, bo.getTableName());
|
||||
lqw.eq(StrUtil.isNotBlank(bo.getMessageLargeType()), BgtMessage::getMessageLargeType, bo.getMessageLargeType());
|
||||
lqw.eq(StrUtil.isNotBlank(bo.getMessageSmallType()), BgtMessage::getMessageSmallType, bo.getMessageSmallType());
|
||||
lqw.eq(StrUtil.isNotBlank(bo.getReadStatus()), BgtMessage::getReadStatus, bo.getReadStatus());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean insert(BgtMessage bo) {
|
||||
BgtMessage add = BeanUtil.toBean(bo, BgtMessage.class);
|
||||
validEntityBeforeSave(add);
|
||||
return save(add);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean update(BgtMessage bo) {
|
||||
BgtMessage update = BeanUtil.toBean(bo, BgtMessage.class);
|
||||
validEntityBeforeSave(update);
|
||||
return updateById(update);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*
|
||||
* @param entity 实体类数据
|
||||
*/
|
||||
private void validEntityBeforeSave(BgtMessage entity) {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* LC-APP相关
|
||||
@ -122,9 +153,9 @@ public class BgtMessageServiceImpl extends ServicePlusImpl<BgtMessageMapper, Bgt
|
||||
Map<String, Long> map = bgtMessages.stream().collect(Collectors.groupingBy(BgtMessage::getMessageLargeType, Collectors.counting()));
|
||||
|
||||
BgtMessageCountVO bgtMessageCountVO = new BgtMessageCountVO();
|
||||
bgtMessageCountVO.setTaskMessageCount(map.getOrDefault(BgtMessageType.TASK.getCode(),0L).intValue());
|
||||
bgtMessageCountVO.setSettlementMessageCount(map.getOrDefault(BgtMessageType.SETTLEMENT.getCode(),0L).intValue());
|
||||
bgtMessageCountVO.setOtherMessageCount(map.getOrDefault(BgtMessageType.OTHER.getCode(),0L).intValue());
|
||||
bgtMessageCountVO.setTaskMessageCount(map.getOrDefault(BgtMessageType.TASK.getCode(), 0L).intValue());
|
||||
bgtMessageCountVO.setSettlementMessageCount(map.getOrDefault(BgtMessageType.SETTLEMENT.getCode(), 0L).intValue());
|
||||
bgtMessageCountVO.setOtherMessageCount(map.getOrDefault(BgtMessageType.OTHER.getCode(), 0L).intValue());
|
||||
return bgtMessageCountVO;
|
||||
}
|
||||
|
||||
@ -135,16 +166,62 @@ public class BgtMessageServiceImpl extends ServicePlusImpl<BgtMessageMapper, Bgt
|
||||
Page<BgtMessage> result = page(PageUtils.buildPage(), wrapper);
|
||||
Page<BgtMessageVO> bgtMessageVOPage = new Page<>();
|
||||
bgtMessageVOPage.setTotal(result.getTotal());
|
||||
bgtMessageVOPage.setRecords(BeanUtil.copyToList(result.getRecords(),BgtMessageVO.class));
|
||||
bgtMessageVOPage.setRecords(BeanUtil.copyToList(result.getRecords(), BgtMessageVO.class));
|
||||
return PageUtils.buildDataInfo(bgtMessageVOPage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<BgtMessageOtherVO> queryOtherPageList(BgtMessageOtherDTO dto) {
|
||||
Page<BgtMessageOtherDTO> queryDTOPage = new Page<>();
|
||||
queryDTOPage.setCurrent(dto.getPageNum());
|
||||
queryDTOPage.setSize(dto.getPageSize());
|
||||
Page<BgtMessageOtherVO> queryVOPage = baseMapper.queryOtherPageList(queryDTOPage, dto);
|
||||
return PageUtils.buildDataInfo(queryVOPage);
|
||||
public TableDataInfo<BgtMessageDetailVO> queryDetailPageList(BgtMessageDetailDTO dto) {
|
||||
LambdaQueryWrapper<BgtMessage> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(BgtMessage::getRecipientId, SecurityUtils.getAppUserId());
|
||||
wrapper.eq(StrUtil.isNotBlank(dto.getMessageLargeType()), BgtMessage::getMessageLargeType, dto.getMessageLargeType());
|
||||
wrapper.eq(StrUtil.isNotBlank(dto.getMessageSmallType()), BgtMessage::getMessageSmallType, dto.getMessageSmallType());
|
||||
wrapper.between(dto.getDate() != null, BgtMessage::getCreateTime, dto.getDate().atStartOfDay(), dto.getDate().atStartOfDay().with(LocalTime.MAX));
|
||||
Page<BgtMessage> result = page(PageUtils.buildPage(), wrapper);
|
||||
Page<BgtMessageDetailVO> bgtMessageVOPage = new Page<>();
|
||||
bgtMessageVOPage.setTotal(result.getTotal());
|
||||
|
||||
ArrayList<BgtMessageDetailVO> bgtMessageVOS = new ArrayList<>();
|
||||
|
||||
for (BgtMessage message : result.getRecords()) {
|
||||
BgtMessageDetailVO bgtMessageDetailVO = BeanUtil.copyProperties(message, BgtMessageDetailVO.class);
|
||||
if (BGT_LARGE_TASK.equals(message.getMessageLargeType())) {
|
||||
// todo
|
||||
} else if (BGT_LARGE_SETTLEMENT.equals(message.getMessageLargeType())) {
|
||||
// todo
|
||||
} else if (BGT_LARGE_OTHER.equals(message.getMessageLargeType())) {
|
||||
|
||||
switch (message.getMessageSmallType()) {
|
||||
case BGT_SMALL_SIGN_UP:
|
||||
BgtProjectRecruitApply recruitApply = recruitApplyService.getById(message.getTableId());
|
||||
BgtProjectRecruit recruit = recruitService.getById(recruitApply.getRecruitId());
|
||||
bgtMessageDetailVO.setRecruitName(recruit.getRecruitName());
|
||||
break;
|
||||
case BGT_SMALL_PAY:
|
||||
WgzPayCalculation payCalculation = payCalculationService.getById(message.getTableId());
|
||||
BgtProjectRecruit recruitPay = recruitService.getById(payCalculation.getRecruitId());
|
||||
bgtMessageDetailVO.setRecruitName(recruitPay.getRecruitName());
|
||||
break;
|
||||
case BGT_SMALL_LEAVE:
|
||||
WgzLeave wgzLeave = leaveService.getById(message.getTableId());
|
||||
bgtMessageDetailVO.setReason(wgzLeave.getReason());
|
||||
bgtMessageDetailVO.setUsername(wgzUserService.getById(wgzLeave.getUserId()).getUsername());
|
||||
bgtMessageDetailVO.setStartTime(wgzLeave.getStartTime());
|
||||
bgtMessageDetailVO.setEndTime(wgzLeave.getEndTime());
|
||||
break;
|
||||
case BGT_SMALL_MAKE_UP:
|
||||
WgzReissueacard reissueacard = reissueacardService.getById(message.getTableId());
|
||||
bgtMessageDetailVO.setReason(reissueacard.getReason());
|
||||
bgtMessageDetailVO.setUsername(wgzUserService.getById(reissueacard.getUserId()).getUsername());
|
||||
bgtMessageDetailVO.setNowTime(reissueacard.getNowTime());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
bgtMessageVOS.add(bgtMessageDetailVO);
|
||||
}
|
||||
}
|
||||
bgtMessageVOPage.setRecords(bgtMessageVOS);
|
||||
return PageUtils.buildDataInfo(bgtMessageVOPage);
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package com.ruoyi.bgt.service.impl;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
|
||||
@ -10,13 +11,15 @@ 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.*;
|
||||
import com.ruoyi.bgt.domain.dto.BgtAttendanceDayDTO;
|
||||
import com.ruoyi.bgt.domain.dto.BgtProjectRecruitApplyConsentDTO;
|
||||
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;
|
||||
import com.ruoyi.common.core.domain.entity.SysDictData;
|
||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
@ -37,6 +40,8 @@ import com.ruoyi.wgz.service.IWgzMessageService;
|
||||
import com.ruoyi.wgz.service.IWgzScoreRecordService;
|
||||
import com.ruoyi.wgz.service.IWgzUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -44,6 +49,7 @@ import java.text.DecimalFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
|
||||
import static com.ruoyi.common.constants.BgtMessageConstant.*;
|
||||
import static com.ruoyi.common.constants.WgzAndBgtMessageConstant.*;
|
||||
|
||||
/**
|
||||
@ -62,78 +68,79 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
|
||||
@Autowired
|
||||
private IWgzUserService wgzUserService;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private IBgtProjectRecruitService iBgtProjectRecruitService;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private IWgzMessageService iWgzMessageService;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private IBgtMessageService iBgtMessageService;
|
||||
@Autowired
|
||||
private IWgzMessageService wgzMessageService;
|
||||
@Autowired
|
||||
private ISysDictTypeService dictTypeService;
|
||||
|
||||
@Override
|
||||
public BgtProjectRecruitApply queryById(Long id){
|
||||
return getById(id);
|
||||
}
|
||||
@Override
|
||||
public BgtProjectRecruitApply queryById(Long id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<BgtProjectRecruitApply> queryPageList(BgtProjectRecruitApplyQueryBo bo) {
|
||||
Page<BgtProjectRecruitApply> result = page(PageUtils.buildPage(), buildQueryWrapper(bo));
|
||||
return PageUtils.buildDataInfo(result);
|
||||
}
|
||||
@Override
|
||||
public TableDataInfo<BgtProjectRecruitApply> queryPageList(BgtProjectRecruitApplyQueryBo bo) {
|
||||
Page<BgtProjectRecruitApply> result = page(PageUtils.buildPage(), buildQueryWrapper(bo));
|
||||
return PageUtils.buildDataInfo(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BgtProjectRecruitApply> queryList(BgtProjectRecruitApplyQueryBo bo) {
|
||||
return list(buildQueryWrapper(bo));
|
||||
}
|
||||
@Override
|
||||
public List<BgtProjectRecruitApply> queryList(BgtProjectRecruitApplyQueryBo bo) {
|
||||
return list(buildQueryWrapper(bo));
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BgtProjectRecruitApply> buildQueryWrapper(BgtProjectRecruitApplyQueryBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BgtProjectRecruitApply> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getRecruitId() != null, BgtProjectRecruitApply::getRecruitId, bo.getRecruitId());
|
||||
lqw.eq(bo.getUserId() != null, BgtProjectRecruitApply::getUserId, bo.getUserId());
|
||||
return lqw;
|
||||
}
|
||||
private LambdaQueryWrapper<BgtProjectRecruitApply> buildQueryWrapper(BgtProjectRecruitApplyQueryBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BgtProjectRecruitApply> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getRecruitId() != null, BgtProjectRecruitApply::getRecruitId, bo.getRecruitId());
|
||||
lqw.eq(bo.getUserId() != null, BgtProjectRecruitApply::getUserId, bo.getUserId());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean insert(BgtProjectRecruitApply bo) {
|
||||
BgtProjectRecruitApply add = BeanUtil.toBean(bo, BgtProjectRecruitApply.class);
|
||||
validEntityBeforeSave(add);
|
||||
return save(add);
|
||||
}
|
||||
@Override
|
||||
public Boolean insert(BgtProjectRecruitApply bo) {
|
||||
BgtProjectRecruitApply add = BeanUtil.toBean(bo, BgtProjectRecruitApply.class);
|
||||
validEntityBeforeSave(add);
|
||||
return save(add);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean update(BgtProjectRecruitApply bo) {
|
||||
BgtProjectRecruitApply update = BeanUtil.toBean(bo, BgtProjectRecruitApply.class);
|
||||
validEntityBeforeSave(update);
|
||||
return updateById(update);
|
||||
}
|
||||
@Override
|
||||
public Boolean update(BgtProjectRecruitApply bo) {
|
||||
BgtProjectRecruitApply update = BeanUtil.toBean(bo, BgtProjectRecruitApply.class);
|
||||
validEntityBeforeSave(update);
|
||||
return updateById(update);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*
|
||||
* @param entity 实体类数据
|
||||
*/
|
||||
private void validEntityBeforeSave(BgtProjectRecruitApply entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*
|
||||
* @param entity 实体类数据
|
||||
*/
|
||||
private void validEntityBeforeSave(BgtProjectRecruitApply entity) {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return removeByIds(ids);
|
||||
}
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return removeByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<BgtProjectRecruitApplyVO> appQueryPageList(BgtProjectRecruitApplyQueryDTO dto) {
|
||||
if(dto.getTaskId()!=null){
|
||||
if (dto.getTaskId() != null) {
|
||||
List<Long> recruitIdsByTaskId = iBgtProjectRecruitService.getRecruitIdsByTaskId(dto.getTaskId());
|
||||
if(dto.getRecruitIds()==null){
|
||||
if (dto.getRecruitIds() == null) {
|
||||
dto.setRecruitIds(recruitIdsByTaskId);
|
||||
}else {
|
||||
} else {
|
||||
dto.getRecruitIds().addAll(recruitIdsByTaskId);
|
||||
}
|
||||
}
|
||||
@ -147,6 +154,14 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
|
||||
|
||||
@Override
|
||||
public List<BgtProjectRecruitApplyVO> appQueryList(BgtProjectRecruitApplyQueryDTO dto) {
|
||||
if (dto.getTaskId() != null) {
|
||||
List<Long> recruitIdsByTaskId = iBgtProjectRecruitService.getRecruitIdsByTaskId(dto.getTaskId());
|
||||
if (dto.getRecruitIds() == null) {
|
||||
dto.setRecruitIds(recruitIdsByTaskId);
|
||||
} else {
|
||||
dto.getRecruitIds().addAll(recruitIdsByTaskId);
|
||||
}
|
||||
}
|
||||
return baseMapper.appQueryList(dto);
|
||||
}
|
||||
|
||||
@ -160,7 +175,7 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
|
||||
.in(BgtProjectRecruitApply::getStatus, Arrays.asList(RecruitApplyStatus.WGZ_PASS.getCode(), RecruitApplyStatus.WORKING.getCode()))
|
||||
.isNotNull(BgtProjectRecruitApply::getLeaveTime));
|
||||
|
||||
if(CollectionUtil.isNotEmpty(list)){
|
||||
if (CollectionUtil.isNotEmpty(list)) {
|
||||
throw new BaseException("该务工者已进入其他工地");
|
||||
}
|
||||
recruitApply.setEntryTime(dto.getEntryTime());
|
||||
@ -172,8 +187,8 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
|
||||
annexService.insertBatch(dto.getEntryMaterials());
|
||||
//发消息
|
||||
HashMap<String, String> mp = new HashMap<>();
|
||||
mp.put("projectName",iBgtProjectRecruitService.getById(recruitApply.getRecruitId()).getRecruitName());
|
||||
mp.put("auditor",SecurityUtils.getUsername());
|
||||
mp.put("projectName", iBgtProjectRecruitService.getById(recruitApply.getRecruitId()).getRecruitName());
|
||||
mp.put("auditor", SecurityUtils.getUsername());
|
||||
Map<String, String> map = bgtMessage(mp, BGT_TYPE_SIGN_UP, true);
|
||||
WgzMessage wgzMessage = new WgzMessage()
|
||||
.setSenderType(USERTYPE_BGT)
|
||||
@ -185,13 +200,11 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
|
||||
.setTableName(SqlHelper.table(BgtProjectRecruitApply.class).getTableName())
|
||||
.setMessageLargeType(LARGE_APPLY)
|
||||
.setMessageSmallType(SMALL_SYSTEM);
|
||||
wgzMessageService.sendAMessage(wgzMessage);
|
||||
iWgzMessageService.sendAMessage(wgzMessage);
|
||||
return updateById(recruitApply);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* LC-APP相关
|
||||
* =================================================================================================================
|
||||
@ -204,15 +217,15 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
|
||||
*/
|
||||
@Override
|
||||
public BgtProjectRecruitApply selectByUserIdProjectRecruitApplyId(Long id) {
|
||||
String[] strings = {"3","5"};
|
||||
String[] strings = {"3", "5"};
|
||||
LambdaQueryWrapper<BgtProjectRecruitApply> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(BgtProjectRecruitApply::getUserId, id).
|
||||
in(BgtProjectRecruitApply::getStatus, strings); //包工头+务工者同意 or 进场 才算进场ok
|
||||
List<BgtProjectRecruitApply> bgtProjectRecruitApplies = baseMapper.selectList(lqw);
|
||||
if (bgtProjectRecruitApplies.isEmpty()){
|
||||
if (bgtProjectRecruitApplies.isEmpty()) {
|
||||
throw new RuntimeException("异常,还未查询到您进入了工地!");
|
||||
}
|
||||
if (bgtProjectRecruitApplies.size()>1){
|
||||
if (bgtProjectRecruitApplies.size() > 1) {
|
||||
throw new RuntimeException("异常,查询到用户同时在多个工地务工!");
|
||||
}
|
||||
return bgtProjectRecruitApplies.get(0);
|
||||
@ -228,23 +241,23 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
|
||||
//3、检查当前用户是否已经有工地了、检查当前用户是否满足对应工种
|
||||
Integer i = baseMapper.selectCount(
|
||||
new LambdaQueryWrapper<BgtProjectRecruitApply>().
|
||||
eq(BgtProjectRecruitApply::getUserId, appUserId).
|
||||
in(BgtProjectRecruitApply::getStatus, "3","5")
|
||||
eq(BgtProjectRecruitApply::getUserId, appUserId).
|
||||
in(BgtProjectRecruitApply::getStatus, "3", "5")
|
||||
);
|
||||
if (i>0){
|
||||
if (i > 0) {
|
||||
throw new RuntimeException("已有工地!不可再次申请!");
|
||||
}
|
||||
WgzUser byId = wgzUserService.findByUserId(appUserId);
|
||||
if (!Objects.equals(appById.getTypeOfWork(), byId.getTypeOfWork())){
|
||||
if (!Objects.equals(appById.getTypeOfWork(), byId.getTypeOfWork())) {
|
||||
throw new RuntimeException("工种不匹配!");
|
||||
}
|
||||
//4、判断当前用户是否已经申请过了,如果已经申请过了,就不能再次申请了
|
||||
Integer integer = baseMapper.selectCount(
|
||||
new LambdaQueryWrapper<BgtProjectRecruitApply>().
|
||||
eq(BgtProjectRecruitApply::getUserId, appUserId).
|
||||
eq(BgtProjectRecruitApply::getRecruitId, id)
|
||||
eq(BgtProjectRecruitApply::getUserId, appUserId).
|
||||
eq(BgtProjectRecruitApply::getRecruitId, id)
|
||||
);
|
||||
if (integer>0){
|
||||
if (integer > 0) {
|
||||
throw new RuntimeException("已申请过了!不可再次申请!");
|
||||
}
|
||||
//3、插入数据
|
||||
@ -253,24 +266,24 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
|
||||
bgtProjectRecruitApply.setUserId(appUserId);
|
||||
int insert = baseMapper.insert(bgtProjectRecruitApply);
|
||||
//4、发送消息
|
||||
if (insert>0){
|
||||
if (insert > 0) {
|
||||
SysDictData typeOfWork = dictTypeService.selectDictDataByTypeAndData("type_of_work", byId.getTypeOfWork());
|
||||
Map<String, String> mp = new HashMap<>();
|
||||
mp.put("projectName",appById.getRecruitName());
|
||||
mp.put("userName",byId.getUsername());
|
||||
mp.put("post",typeOfWork.getDictLabel());
|
||||
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,"101")).
|
||||
setSubheading(WgzAndBgtMessageConstant.wgzMessage(mp,"102")).
|
||||
setHeadline(wgzMessage(mp, "101")).
|
||||
setSubheading(wgzMessage(mp, "102")).
|
||||
setTableId(bgtProjectRecruitApply.getId()).
|
||||
setTableName(SqlHelper.table(BgtProjectRecruitApply.class).getTableName()).
|
||||
setMessageLargeType(LARGE_OTHER).
|
||||
setMessageSmallType(SMALL_SYSTEM);
|
||||
if (!iWgzMessageService.sendAMessage(wgzMessage)){
|
||||
if (!iWgzMessageService.sendAMessage(wgzMessage)) {
|
||||
throw new RuntimeException("系统消息发送失败!");
|
||||
}
|
||||
//4-2、当前用户发送消息给包工头
|
||||
@ -279,29 +292,90 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
|
||||
setSenderId(appUserId).
|
||||
setRecipientType(USERTYPE_BGT).
|
||||
setRecipientId(appById.getUserId()).
|
||||
setHeadline(WgzAndBgtMessageConstant.wgzMessage(mp,"201")).
|
||||
setSubheading(WgzAndBgtMessageConstant.wgzMessage(mp,"202")).
|
||||
setHeadline(wgzMessage(mp, "201")).
|
||||
setSubheading(wgzMessage(mp, "202")).
|
||||
setTableId(bgtProjectRecruitApply.getId()).
|
||||
setTableName(SqlHelper.table(BgtProjectRecruitApply.class).getTableName()).
|
||||
setMessageLargeType(BGT_LARGE).
|
||||
setMessageLargeType(BGT_LARGE_OTHER).
|
||||
setMessageSmallType(BGT_TYPE_SIGN_UP);
|
||||
if (!iBgtMessageService.sendAMessage(bgtMessage)){
|
||||
if (!iBgtMessageService.sendAMessage(bgtMessage)) {
|
||||
throw new RuntimeException("发送消息失败!");
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public List<BgtProjectRecruitApplyVO> todayAttendanceList(BgtAttendanceDayDTO dto){
|
||||
public List<BgtProjectRecruitApplyVO> todayAttendanceList(BgtAttendanceDayDTO dto) {
|
||||
return baseMapper.todayAttendanceList(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean quit(Long id) {
|
||||
return super.lambdaUpdate().eq(BgtProjectRecruitApply::getId, id)
|
||||
.set(BgtProjectRecruitApply::getLeaveTime, LocalDate.now())
|
||||
.set(BgtProjectRecruitApply::getStatus, RecruitApplyStatus.OUT_WORK.getCode())
|
||||
.update();
|
||||
BgtProjectRecruitApply recruitApply = getById(id);
|
||||
BgtProjectRecruit recruit = iBgtProjectRecruitService.getById(recruitApply.getRecruitId());
|
||||
|
||||
//发消息
|
||||
HashMap<String, String> mp = new HashMap<>();
|
||||
mp.put("projectName", recruit.getRecruitName());
|
||||
mp.put("auditor", SecurityUtils.getUsername());
|
||||
Map<String, String> map = bgtMessage(mp, BGT_TYPE_EXIT, true);
|
||||
WgzMessage wgzMessage = new WgzMessage()
|
||||
.setSenderType(USERTYPE_BGT)
|
||||
.setRecipientType(USERTYPE_WGZ)
|
||||
.setRecipientId(recruitApply.getUserId())
|
||||
.setHeadline(map.get(HEADLINE))
|
||||
.setSubheading(map.get(SUBHEADING))
|
||||
.setTableId(recruitApply.getId())
|
||||
.setTableName(SqlHelper.table(BgtProjectRecruitApply.class).getTableName())
|
||||
.setMessageLargeType(LARGE_OTHER)
|
||||
.setMessageSmallType(SMALL_EXIT);
|
||||
iWgzMessageService.sendAMessage(wgzMessage);
|
||||
|
||||
recruitApply.setStatus(RecruitApplyStatus.OUT_WORK.getCode());
|
||||
recruitApply.setLeaveTime(LocalDate.now());
|
||||
|
||||
return updateById(recruitApply);
|
||||
}
|
||||
|
||||
@Async
|
||||
@Override
|
||||
public void quitBatch(Long taskId) {
|
||||
BgtProjectRecruitApplyQueryDTO dto = new BgtProjectRecruitApplyQueryDTO();
|
||||
dto.setTaskId(taskId);
|
||||
dto.setStatus(Collections.singletonList(RecruitApplyStatus.WORKING.getCode()));
|
||||
List<BgtProjectRecruitApplyVO> bgtProjectRecruitApplyVOS = appQueryList(dto);
|
||||
|
||||
if (CollectionUtil.isNotEmpty(bgtProjectRecruitApplyVOS)) {
|
||||
//发消息
|
||||
List<WgzMessage> wgzMessages = new ArrayList<>();
|
||||
List<Long> ids = new ArrayList<>();
|
||||
for (BgtProjectRecruitApplyVO vo : bgtProjectRecruitApplyVOS) {
|
||||
ids.add(vo.getId());
|
||||
HashMap<String, String> mp = new HashMap<>();
|
||||
mp.put("projectName", vo.getRecruitName());
|
||||
mp.put("auditor", "系统");
|
||||
Map<String, String> map = bgtMessage(mp, BGT_TYPE_EXIT, false);
|
||||
WgzMessage wgzMessage = new WgzMessage()
|
||||
.setSenderType(USERTYPE_BGT)
|
||||
.setRecipientType(USERTYPE_WGZ)
|
||||
.setRecipientId(vo.getUserId())
|
||||
.setHeadline(map.get(HEADLINE))
|
||||
.setSubheading(map.get(SUBHEADING))
|
||||
.setTableId(vo.getRecruitId())
|
||||
.setTableName(SqlHelper.table(BgtProjectRecruitApply.class).getTableName())
|
||||
.setMessageLargeType(LARGE_OTHER)
|
||||
.setMessageSmallType(SMALL_EXIT);
|
||||
wgzMessages.add(wgzMessage);
|
||||
}
|
||||
iWgzMessageService.saveBatch(wgzMessages);
|
||||
LambdaUpdateWrapper<BgtProjectRecruitApply> wrapper = new LambdaUpdateWrapper<>();
|
||||
wrapper.in(BgtProjectRecruitApply::getId, ids)
|
||||
.set(BgtProjectRecruitApply::getLeaveTime, LocalDate.now())
|
||||
.set(BgtProjectRecruitApply::getStatus, RecruitApplyStatus.OUT_WORK.getCode());
|
||||
update(wrapper);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -330,24 +404,24 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
|
||||
BgtProjectRecruitApply bgtProjectRecruitApply = new BgtProjectRecruitApply();
|
||||
bgtProjectRecruitApply.setId(recruitApplyId);
|
||||
bgtProjectRecruitApply.setStatus("7");
|
||||
if(baseMapper.updateById(bgtProjectRecruitApply) >0){
|
||||
if (baseMapper.updateById(bgtProjectRecruitApply) > 0) {
|
||||
Long appUserId = SecurityUtils.getAppUserId();
|
||||
BgtProjectRecruitApply by = selectByUserIdProjectRecruitApplyId(appUserId);
|
||||
BgtProjectRecruit appById = iBgtProjectRecruitService.getAppById(by.getUserId());
|
||||
Map<String, String> mp = new HashMap<>();
|
||||
mp.put("projectName",appById.getRecruitName());
|
||||
mp.put("projectName", appById.getRecruitName());
|
||||
//发送取消报名的系统消息
|
||||
WgzMessage wgzMessage = new WgzMessage().
|
||||
setSenderType(USERTYPE_SYSTEM).
|
||||
setRecipientType(USERTYPE_WGZ).
|
||||
setRecipientId(appUserId).
|
||||
setHeadline(WgzAndBgtMessageConstant.wgzMessage(mp,"103")).
|
||||
setSubheading(WgzAndBgtMessageConstant.wgzMessage(mp,"104")).
|
||||
setHeadline(wgzMessage(mp, "103")).
|
||||
setSubheading(wgzMessage(mp, "104")).
|
||||
setTableId(bgtProjectRecruitApply.getId()).
|
||||
setTableName(SqlHelper.table(BgtProjectRecruitApply.class).getTableName()).
|
||||
setMessageLargeType(LARGE_OTHER).
|
||||
setMessageSmallType(SMALL_SYSTEM);
|
||||
if (!iWgzMessageService.sendAMessage(wgzMessage)){
|
||||
if (!iWgzMessageService.sendAMessage(wgzMessage)) {
|
||||
throw new RuntimeException("系统消息发送失败!");
|
||||
}
|
||||
return true;
|
||||
@ -361,7 +435,7 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
|
||||
Page<WgzAppUnderwayReq> pe = new Page<>();
|
||||
pe.setCurrent(req.getPageNum());
|
||||
pe.setSize(req.getPageSize());
|
||||
return PageUtils.buildDataInfo(baseMapper.underwayPage(pe,req));
|
||||
return PageUtils.buildDataInfo(baseMapper.underwayPage(pe, req));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -376,26 +450,26 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
|
||||
apply.setId(req.getRecruitApplyId());
|
||||
apply.setStatus(req.getStatus());
|
||||
int insert = baseMapper.insert(apply);
|
||||
if (insert == 0){
|
||||
if (insert == 0) {
|
||||
throw new RuntimeException("插入数据失败!");
|
||||
}
|
||||
//4系统拒绝消息
|
||||
SysDictData typeOfWork = dictTypeService.selectDictDataByTypeAndData("type_of_work", recruit.getTypeOfWork());
|
||||
Map<String, String> mp = new HashMap<>();
|
||||
mp.put("projectName",recruit.getRecruitName());
|
||||
mp.put("userName",byUserId.getUsername());
|
||||
mp.put("post",typeOfWork.getDictLabel());
|
||||
if (req.getStatus().equals("3")){
|
||||
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")).
|
||||
setHeadline(wgzMessage(mp, "105")).
|
||||
setSubheading(wgzMessage(mp, "106")).
|
||||
setTableId(apply.getId()).
|
||||
setTableName(SqlHelper.table(BgtProjectRecruitApply.class).getTableName()).
|
||||
setMessageLargeType(LARGE_APPLY);
|
||||
if (!iWgzMessageService.sendAMessage(wgzMessage)){
|
||||
if (!iWgzMessageService.sendAMessage(wgzMessage)) {
|
||||
throw new RuntimeException("系统消息报名拒绝发送失败!");
|
||||
}
|
||||
BgtMessage bgtMessage = new BgtMessage().
|
||||
@ -403,29 +477,29 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
|
||||
setSenderId(byUserId.getUserId()).
|
||||
setRecipientType(USERTYPE_BGT).
|
||||
setRecipientId(apply.getUserId()).
|
||||
setHeadline(WgzAndBgtMessageConstant.wgzMessage(mp,"203")).
|
||||
setSubheading(WgzAndBgtMessageConstant.wgzMessage(mp,"204")).
|
||||
setHeadline(wgzMessage(mp, "203")).
|
||||
setSubheading(wgzMessage(mp, "204")).
|
||||
setTableId(apply.getId()).
|
||||
setTableName(SqlHelper.table(BgtProjectRecruitApply.class).getTableName()).
|
||||
setMessageLargeType(BGT_LARGE).
|
||||
setMessageLargeType(BGT_LARGE_OTHER).
|
||||
setMessageSmallType(BGT_TYPE_SIGN_UP);
|
||||
if (!iBgtMessageService.sendAMessage(bgtMessage)){
|
||||
if (!iBgtMessageService.sendAMessage(bgtMessage)) {
|
||||
throw new RuntimeException("发送报名拒绝消息失败!");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
//系统同意消息
|
||||
if (req.getStatus().equals("4")){
|
||||
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")).
|
||||
setHeadline(wgzMessage(mp, "107")).
|
||||
setSubheading(wgzMessage(mp, "108")).
|
||||
setTableId(apply.getId()).
|
||||
setTableName(SqlHelper.table(BgtProjectRecruitApply.class).getTableName()).
|
||||
setMessageLargeType(LARGE_APPLY);
|
||||
if (!iWgzMessageService.sendAMessage(wgzMessage)){
|
||||
if (!iWgzMessageService.sendAMessage(wgzMessage)) {
|
||||
throw new RuntimeException("系统消息报名同意发送失败!");
|
||||
}
|
||||
BgtMessage bgtMessage = new BgtMessage().
|
||||
@ -433,13 +507,13 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
|
||||
setSenderId(byUserId.getUserId()).
|
||||
setRecipientType(USERTYPE_BGT).
|
||||
setRecipientId(apply.getUserId()).
|
||||
setHeadline(WgzAndBgtMessageConstant.wgzMessage(mp,"205")).
|
||||
setSubheading(WgzAndBgtMessageConstant.wgzMessage(mp,"206")).
|
||||
setHeadline(wgzMessage(mp, "205")).
|
||||
setSubheading(wgzMessage(mp, "206")).
|
||||
setTableId(apply.getId()).
|
||||
setTableName(SqlHelper.table(BgtProjectRecruitApply.class).getTableName()).
|
||||
setMessageLargeType(BGT_LARGE).
|
||||
setMessageLargeType(BGT_LARGE_OTHER).
|
||||
setMessageSmallType(BGT_TYPE_SIGN_UP);
|
||||
if (!iBgtMessageService.sendAMessage(bgtMessage)){
|
||||
if (!iBgtMessageService.sendAMessage(bgtMessage)) {
|
||||
throw new RuntimeException("发送报名同意消息失败!");
|
||||
}
|
||||
return true;
|
||||
|
@ -11,6 +11,7 @@ import com.ruoyi.bgt.domain.dto.BgtProjectRecruitApplyQueryDTO;
|
||||
import com.ruoyi.bgt.domain.dto.BgtProjectRecruitQueryDTO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtProjectRecruitApplyVO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtProjectRecruitDetailVO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtProjectRecruitDetailWgzListVO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtProjectRecruitVO;
|
||||
import com.ruoyi.bgt.mapper.BgtProjectRecruitMapper;
|
||||
import com.ruoyi.bgt.service.IBgtProjectRecruitApplyService;
|
||||
@ -22,7 +23,6 @@ import com.ruoyi.common.utils.PageUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.fbs.domain.FbsProjectTask;
|
||||
import com.ruoyi.fbs.service.IFbsProjectTaskService;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppDailyRecordReq;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppJobListingReq;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppRegisteredProjectReq;
|
||||
import com.ruoyi.wgz.bo.res.WgzAppCancelRegistrationProjectDetailsRes;
|
||||
@ -134,7 +134,7 @@ public class BgtProjectRecruitServiceImpl extends ServicePlusImpl<BgtProjectRecr
|
||||
BgtProjectRecruitApplyQueryDTO bgtProjectRecruitApplyQueryDTO = new BgtProjectRecruitApplyQueryDTO();
|
||||
bgtProjectRecruitApplyQueryDTO.setRecruitIds(Collections.singletonList(vo.getId()));
|
||||
bgtProjectRecruitApplyQueryDTO.setStatus(applyStatus);
|
||||
vo.setApplylist(bgtProjectRecruitApplyService.appQueryList(bgtProjectRecruitApplyQueryDTO));
|
||||
vo.setApplyList(bgtProjectRecruitApplyService.appQueryList(bgtProjectRecruitApplyQueryDTO));
|
||||
}
|
||||
return PageUtils.buildDataInfo(queryVOPage);
|
||||
}
|
||||
@ -145,14 +145,21 @@ public class BgtProjectRecruitServiceImpl extends ServicePlusImpl<BgtProjectRecr
|
||||
BgtProjectRecruitDetailVO vo = BeanUtil.toBean(recruit, BgtProjectRecruitDetailVO.class);
|
||||
FbsProjectTask task = fbsProjectTaskService.getById(vo.getTaskId());
|
||||
vo.setTaskName(task.getTaskName());
|
||||
return vo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BgtProjectRecruitDetailWgzListVO wgzList(Long id) {
|
||||
BgtProjectRecruitDetailWgzListVO vo = new BgtProjectRecruitDetailWgzListVO();
|
||||
BgtProjectRecruitApplyQueryDTO bgtProjectRecruitApplyQueryDTO = new BgtProjectRecruitApplyQueryDTO();
|
||||
bgtProjectRecruitApplyQueryDTO.setRecruitIds(Collections.singletonList(vo.getId()));
|
||||
bgtProjectRecruitApplyQueryDTO.setRecruitIds(Collections.singletonList(id));
|
||||
bgtProjectRecruitApplyQueryDTO.setStatus(applyStatus);
|
||||
List<BgtProjectRecruitApplyVO> bgtProjectRecruitApplyVOS = bgtProjectRecruitApplyService.appQueryList(bgtProjectRecruitApplyQueryDTO);
|
||||
vo.setTotalNum(bgtProjectRecruitApplyVOS.size());
|
||||
int count = (int)bgtProjectRecruitApplyVOS.stream().filter(apply -> apply.getStatus().equals(RecruitApplyStatus.BGT_PASS.getCode())).count();
|
||||
vo.setPassNum(count);
|
||||
vo.setApplylist(bgtProjectRecruitApplyVOS.subList(0, Math.min(count, 3)));
|
||||
vo.setNotSelectNum(vo.getTotalNum()-vo.getPassNum());
|
||||
vo.setApplyList(bgtProjectRecruitApplyVOS.subList(0, Math.min(count, 3)));
|
||||
return vo;
|
||||
}
|
||||
|
||||
@ -163,6 +170,14 @@ public class BgtProjectRecruitServiceImpl extends ServicePlusImpl<BgtProjectRecr
|
||||
return baseMapper.selectList(wrapper).stream().map(BgtProjectRecruit::getId).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, String> getRecruitIdAndNameByTaskId(Long taskId) {
|
||||
LambdaQueryWrapper<BgtProjectRecruit> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(BgtProjectRecruit::getTaskId, taskId);
|
||||
List<BgtProjectRecruit> bgtProjectRecruits = baseMapper.selectList(wrapper);
|
||||
return bgtProjectRecruits.stream().collect(Collectors.toMap(BgtProjectRecruit::getId,BgtProjectRecruit::getRecruitName));
|
||||
}
|
||||
|
||||
/**
|
||||
* LC-APP相关
|
||||
* =================================================================================================================
|
||||
|
@ -12,11 +12,14 @@ import com.ruoyi.bgt.domain.dto.BgtProjectTaskProgressQueryDTO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtProjectTaskProgressDetailVO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtProjectTaskProgressVO;
|
||||
import com.ruoyi.bgt.mapper.BgtProjectTaskProgressMapper;
|
||||
import com.ruoyi.bgt.service.IBgtProjectRecruitApplyService;
|
||||
import com.ruoyi.bgt.service.IBgtProjectTaskProgressService;
|
||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.ProjectTaskStatus;
|
||||
import com.ruoyi.common.utils.PageUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.fbs.domain.FbsProjectTask;
|
||||
import com.ruoyi.fbs.service.IFbsProjectTaskService;
|
||||
import com.ruoyi.zbf.service.IZbfProjectService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -41,6 +44,9 @@ public class BgtProjectTaskProgressServiceImpl extends ServicePlusImpl<BgtProjec
|
||||
@Autowired
|
||||
private IFbsProjectTaskService fbsProjectTaskService;
|
||||
|
||||
@Autowired
|
||||
private IBgtProjectRecruitApplyService recruitApplyService;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
@ -81,6 +87,13 @@ public class BgtProjectTaskProgressServiceImpl extends ServicePlusImpl<BgtProjec
|
||||
public Boolean insert(BgtProjectTaskProgress bo) {
|
||||
BgtProjectTaskProgress add = BeanUtil.toBean(bo, BgtProjectTaskProgress.class);
|
||||
validEntityBeforeSave(add);
|
||||
if(add.getProgress() == 100){
|
||||
//更改任务状态
|
||||
fbsProjectTaskService.lambdaUpdate().set(FbsProjectTask::getStatus, ProjectTaskStatus.COMPLETE.getCode())
|
||||
.eq(FbsProjectTask::getId, add.getTaskId()).update();
|
||||
//批量退场
|
||||
recruitApplyService.quitBatch(add.getTaskId());
|
||||
}
|
||||
return save(add);
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,88 @@
|
||||
package com.ruoyi.common.constants;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class BgtMessageConstant {
|
||||
// 公共常量
|
||||
|
||||
public static final String BGT_LARGE_TASK = "1"; //大类型-任务
|
||||
public static final String BGT_LARGE_SETTLEMENT = "2"; //大类型-结算
|
||||
public static final String BGT_LARGE_OTHER = "3"; //大类型-其它
|
||||
|
||||
public static final String BGT_SMALL_SIGN_UP = "1"; //小类型-务工者报名
|
||||
public static final String BGT_SMALL_PAY = "2"; //小类型-付款
|
||||
public static final String BGT_SMALL_LEAVE = "3"; //小类型-请假
|
||||
public static final String BGT_SMALL_MAKE_UP = "4"; //小类型-补卡
|
||||
public static final String BGT_SMALL_SYSTEM = "5"; //小类型-系统
|
||||
|
||||
/**
|
||||
* ============================================包工头->务工者==================================================
|
||||
* ============================================包工头->务工者==================================================
|
||||
* ============================================包工头->务工者==================================================
|
||||
*/
|
||||
|
||||
//模板
|
||||
public static final String BGT_SIGN_UP_APPLY_HEADLINE = "您申请的【%s】项目,已得到回复!";
|
||||
public static final String BGT_SIGN_UP_APPLY_SUBHEADING = "您申请的【%s】项目,审核人【%s】已%s!";
|
||||
public static final String BGT_PAY_APPLY_HEADLINE = "您【%s】项目工资申请已审批!";
|
||||
public static final String BGT_PAY_APPLY_SUBHEADING = "您申请的【%s】项目工资,审核人【%s】已%s!";
|
||||
public static final String BGT_LEAVE_APPLY_HEADLINE = "您【%s】项目的请假申请已审批!";
|
||||
public static final String BGT_LEAVE_APPLY_SUBHEADING = "您【%s】项目的请假申请,审核人【%s】已%s!";
|
||||
public static final String BGT_LEAVE_MAKE_UP_HEADLINE = "您【%s】项目的补卡申请已审批!";
|
||||
public static final String BGT_LEAVE_MAKE_UP_SUBHEADING = "您【%s】项目的补卡申请,审核人【%s】已%s!";
|
||||
public static final String BGT_LEAVE_EXIT_HEADLINE = "您已从【%s】项目退场!";
|
||||
public static final String BGT_LEAVE_EXIT_SUBHEADING_ONE = "您已被【%s】指定从【%s】项目退场!";
|
||||
public static final String BGT_LEAVE_EXIT_SUBHEADING_TWO = "【%s】项目已完结,自动退场!";
|
||||
|
||||
|
||||
//主副标志
|
||||
public static final String HEADLINE = "headline"; //主标题
|
||||
public static final String SUBHEADING = "subheading"; //副标题
|
||||
|
||||
//消息类型
|
||||
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"; //请假
|
||||
public static final String BGT_TYPE_MAKE_UP = "4"; //补卡
|
||||
public static final String BGT_TYPE_EXIT = "5"; //退场
|
||||
|
||||
//包工头消息返回
|
||||
public static Map<String, String> bgtMessage(Map<String, String> mp, String type, Boolean isPass) {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
String pass = isPass ? "通过" : "拒绝";
|
||||
String projectName = mp.get("projectName");
|
||||
String auditor = mp.get("auditor");
|
||||
switch (type) {
|
||||
case "1":
|
||||
map.put(HEADLINE, String.format(BGT_SIGN_UP_APPLY_HEADLINE, projectName));
|
||||
map.put(SUBHEADING, String.format(BGT_SIGN_UP_APPLY_SUBHEADING, projectName, auditor, pass));
|
||||
break;
|
||||
case "2":
|
||||
map.put(HEADLINE, String.format(BGT_PAY_APPLY_HEADLINE, projectName));
|
||||
map.put(SUBHEADING, String.format(BGT_PAY_APPLY_SUBHEADING, projectName, auditor, pass));
|
||||
break;
|
||||
case "3":
|
||||
map.put(HEADLINE, String.format(BGT_LEAVE_APPLY_HEADLINE, projectName));
|
||||
map.put(SUBHEADING, String.format(BGT_LEAVE_APPLY_SUBHEADING, projectName, auditor, pass));
|
||||
break;
|
||||
case "4":
|
||||
map.put(HEADLINE, String.format(BGT_LEAVE_MAKE_UP_HEADLINE, projectName));
|
||||
map.put(SUBHEADING, String.format(BGT_LEAVE_MAKE_UP_SUBHEADING, projectName, auditor, pass));
|
||||
break;
|
||||
case "5":
|
||||
map.put(HEADLINE, String.format(BGT_LEAVE_EXIT_HEADLINE, projectName));
|
||||
if (isPass) {
|
||||
map.put(SUBHEADING, String.format(BGT_LEAVE_EXIT_SUBHEADING_ONE, auditor, projectName));
|
||||
} else {
|
||||
map.put(SUBHEADING, String.format(BGT_LEAVE_EXIT_SUBHEADING_TWO, projectName));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
package com.ruoyi.common.constants;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class WgzAndBgtMessageConstant {
|
||||
@ -8,6 +7,7 @@ public class WgzAndBgtMessageConstant {
|
||||
public static final String USERTYPE_SYSTEM = "0"; //系统
|
||||
public static final String USERTYPE_WGZ = "1"; //务工者
|
||||
public static final String USERTYPE_BGT = "2"; //包工头
|
||||
public static final String USERTYPE_FBS = "3"; //分包商
|
||||
|
||||
public static final String LARGE_APPLY = "0"; //大类型-报名
|
||||
public static final String LARGE_SALARY = "1"; //大类型-工资
|
||||
@ -15,6 +15,7 @@ public class WgzAndBgtMessageConstant {
|
||||
public static final String SMALL_CARD = "0"; //小类型-补卡
|
||||
public static final String SMALL_SYSTEM = "1"; //小类型-系统
|
||||
public static final String SMALL_EXIT = "2"; //小类型-退场
|
||||
public static final String SMALL_LEAVE = "3"; //小类型-请假
|
||||
|
||||
|
||||
/**
|
||||
@ -148,67 +149,6 @@ public class WgzAndBgtMessageConstant {
|
||||
* =====================================================包工头=====================================================
|
||||
*/
|
||||
|
||||
//模板
|
||||
public static final String BGT_SIGN_UP_APPLY_HEADLINE = "您申请的【%s】项目,已得到回复!";
|
||||
public static final String BGT_SIGN_UP_APPLY_SUBHEADING = "您申请的【%s】项目,审核人【%s】已%s!";
|
||||
public static final String BGT_PAY_APPLY_HEADLINE = "您【%s】项目工资申请已审批!";
|
||||
public static final String BGT_PAY_APPLY_SUBHEADING = "您申请的【%s】项目工资,审核人【%s】已%s!";
|
||||
public static final String BGT_LEAVE_APPLY_HEADLINE = "您【%s】项目的请假申请已审批!";
|
||||
public static final String BGT_LEAVE_APPLY_SUBHEADING = "您【%s】项目的请假申请,审核人【%s】已%s!";
|
||||
public static final String BGT_LEAVE_MAKE_UP_HEADLINE = "您【%s】项目的补卡申请已审批!";
|
||||
public static final String BGT_LEAVE_MAKE_UP_SUBHEADING = "您【%s】项目的补卡申请,审核人【%s】已%s!";
|
||||
public static final String BGT_LEAVE_EXIT_HEADLINE = "您已从【%s】项目退场!";
|
||||
public static final String BGT_LEAVE_EXIT_SUBHEADING_ONE = "您已被【%s】指定从【%s】项目退场!";
|
||||
public static final String BGT_LEAVE_EXIT_SUBHEADING_TWO = "【%s】项目已完结,自动退场!";
|
||||
|
||||
//主副标志
|
||||
public static final String HEADLINE = "headline"; //主标题
|
||||
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"; //请假
|
||||
public static final String BGT_TYPE_MAKE_UP = "4"; //补卡
|
||||
public static final String BGT_TYPE_EXIT = "5"; //退场
|
||||
|
||||
//包工头消息返回
|
||||
public static Map<String,String> bgtMessage(Map<String, String> mp, String type,Boolean isPass) {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
String pass = isPass ? "通过" : "拒绝";
|
||||
String projectName = mp.get("projectName");
|
||||
String auditor = mp.get("auditor");
|
||||
switch (type){
|
||||
case "1":
|
||||
map.put(HEADLINE, String.format(BGT_SIGN_UP_APPLY_HEADLINE, projectName));
|
||||
map.put(SUBHEADING, String.format(BGT_SIGN_UP_APPLY_SUBHEADING, projectName,auditor,pass));
|
||||
break;
|
||||
case "2":
|
||||
map.put(HEADLINE, String.format(BGT_PAY_APPLY_HEADLINE, projectName));
|
||||
map.put(SUBHEADING, String.format(BGT_PAY_APPLY_SUBHEADING, projectName,auditor,pass));
|
||||
break;
|
||||
case "3":
|
||||
map.put(HEADLINE, String.format(BGT_LEAVE_APPLY_HEADLINE, projectName));
|
||||
map.put(SUBHEADING, String.format(BGT_LEAVE_APPLY_SUBHEADING, projectName,auditor,pass));
|
||||
break;
|
||||
case "4":
|
||||
map.put(HEADLINE, String.format(BGT_LEAVE_MAKE_UP_HEADLINE, projectName));
|
||||
map.put(SUBHEADING, String.format(BGT_LEAVE_MAKE_UP_SUBHEADING, projectName,auditor,pass));
|
||||
break;
|
||||
case "5":
|
||||
map.put(HEADLINE, String.format(BGT_LEAVE_EXIT_HEADLINE, projectName));
|
||||
if(isPass){
|
||||
map.put(SUBHEADING, String.format(BGT_LEAVE_EXIT_SUBHEADING_ONE, auditor,projectName));
|
||||
}else {
|
||||
map.put(SUBHEADING, String.format(BGT_LEAVE_EXIT_SUBHEADING_TWO, projectName));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -1,13 +1,14 @@
|
||||
package com.ruoyi.wgz.service;
|
||||
|
||||
import com.ruoyi.bgt.domain.dto.BgtLeaveUpdateDTO;
|
||||
import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.wgz.bo.WgzLeaveQueryBo;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppCancelLeaveReq;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppLeaveHistoryListPageReq;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppSubmitLeaveReq;
|
||||
import com.ruoyi.wgz.bo.res.WgzAppLeaveHistoryListPageRes;
|
||||
import com.ruoyi.wgz.domain.WgzLeave;
|
||||
import com.ruoyi.wgz.bo.WgzLeaveQueryBo;
|
||||
import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
@ -93,4 +94,10 @@ public interface IWgzLeaveService extends IServicePlus<WgzLeave> {
|
||||
* 查看指定人、指定项目、指定日期是否请假
|
||||
*/
|
||||
WgzLeave FindAskForLeaveOrNotInfo(Long appUserId, Long recruitId, String date);
|
||||
|
||||
/**
|
||||
* 包工头审核
|
||||
*/
|
||||
Boolean bgtAudit(BgtLeaveUpdateDTO dto);
|
||||
|
||||
}
|
||||
|
@ -1,40 +1,47 @@
|
||||
package com.ruoyi.wgz.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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.BgtProjectRecruit;
|
||||
import com.ruoyi.bgt.domain.BgtProjectRecruitApply;
|
||||
import com.ruoyi.bgt.domain.dto.BgtProjectTaskProgressQueryDTO;
|
||||
import com.ruoyi.bgt.domain.dto.BgtLeaveUpdateDTO;
|
||||
import com.ruoyi.bgt.service.IBgtProjectRecruitApplyService;
|
||||
import com.ruoyi.bgt.service.IBgtProjectRecruitService;
|
||||
import com.ruoyi.common.utils.PageUtils;
|
||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.AuditStatus;
|
||||
import com.ruoyi.common.utils.PageUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.wgz.bo.WgzLeaveQueryBo;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppCancelLeaveReq;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppLeaveHistoryListPageReq;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppSubmitLeaveReq;
|
||||
import com.ruoyi.wgz.bo.res.WgzAppLeaveHistoryListPageRes;
|
||||
import com.ruoyi.wgz.domain.WgzDailyClock;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import com.ruoyi.wgz.domain.WgzAttendance;
|
||||
import com.ruoyi.wgz.domain.WgzLeave;
|
||||
import com.ruoyi.wgz.domain.WgzMessage;
|
||||
import com.ruoyi.wgz.mapper.WgzLeaveMapper;
|
||||
import com.ruoyi.wgz.service.IWgzAttendanceService;
|
||||
import com.ruoyi.wgz.service.IWgzLeaveService;
|
||||
import com.ruoyi.wgz.service.IWgzMessageService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.ruoyi.wgz.bo.WgzLeaveQueryBo;
|
||||
import com.ruoyi.wgz.domain.WgzLeave;
|
||||
import com.ruoyi.wgz.mapper.WgzLeaveMapper;
|
||||
import com.ruoyi.wgz.service.IWgzLeaveService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.ruoyi.common.constants.BgtMessageConstant.*;
|
||||
import static com.ruoyi.common.constants.WgzAndBgtMessageConstant.*;
|
||||
|
||||
/**
|
||||
* 请假Service业务层处理
|
||||
@ -50,6 +57,12 @@ public class WgzLeaveServiceImpl extends ServicePlusImpl<WgzLeaveMapper, WgzLeav
|
||||
@Autowired
|
||||
private IBgtProjectRecruitService iBgtProjectRecruitService;
|
||||
|
||||
@Autowired
|
||||
private IWgzMessageService wgzMessageService;
|
||||
|
||||
@Autowired
|
||||
private IWgzAttendanceService attendanceService;
|
||||
|
||||
@Override
|
||||
public WgzLeave queryById(Long id){
|
||||
return getById(id);
|
||||
@ -195,4 +208,52 @@ public class WgzLeaveServiceImpl extends ServicePlusImpl<WgzLeaveMapper, WgzLeav
|
||||
.apply("date_format(start_time,'%Y-%m-%d') = {0}", date);
|
||||
return baseMapper.selectOne(apply);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean bgtAudit(BgtLeaveUpdateDTO dto) {
|
||||
WgzLeave wgzLeave = getById(dto.getId());
|
||||
BeanUtil.copyProperties(dto, wgzLeave);
|
||||
wgzLeave.setAuditorTime(LocalDateTime.now());
|
||||
BgtProjectRecruit recruit = iBgtProjectRecruitService.getById(wgzLeave.getRecruitId());
|
||||
|
||||
//发消息
|
||||
HashMap<String, String> mp = new HashMap<>();
|
||||
mp.put("projectName",recruit.getRecruitName());
|
||||
mp.put("auditor",SecurityUtils.getUsername());
|
||||
Map<String, String> map = bgtMessage(mp, BGT_TYPE_LEAVE, AuditStatus.PASS.getCode().equals(dto.getAuditorType()));
|
||||
WgzMessage wgzMessage = new WgzMessage()
|
||||
.setSenderType(USERTYPE_BGT)
|
||||
.setRecipientType(USERTYPE_WGZ)
|
||||
.setRecipientId(wgzLeave.getUserId())
|
||||
.setHeadline(map.get(HEADLINE))
|
||||
.setSubheading(map.get(SUBHEADING))
|
||||
.setTableId(wgzLeave.getId())
|
||||
.setTableName(SqlHelper.table(WgzLeave.class).getTableName())
|
||||
.setMessageLargeType(LARGE_OTHER)
|
||||
.setMessageSmallType(SMALL_LEAVE);
|
||||
wgzMessageService.sendAMessage(wgzMessage);
|
||||
|
||||
//考勤信息
|
||||
List<WgzAttendance> list = attendanceService.list(Wrappers.<WgzAttendance>lambdaQuery()
|
||||
.eq(WgzAttendance::getRecruitId, recruit.getId())
|
||||
.eq(WgzAttendance::getUserId, wgzLeave.getUserId())
|
||||
.eq(WgzAttendance::getDate, wgzLeave.getStartTime().toLocalDate()));
|
||||
if(CollectionUtil.isNotEmpty(list)){
|
||||
WgzAttendance wgzAttendance = list.get(0);
|
||||
wgzAttendance.setLeaveMarkId(wgzLeave.getId());
|
||||
wgzAttendance.setExceptionType("7");
|
||||
attendanceService.updateById(wgzAttendance);
|
||||
}else {
|
||||
WgzAttendance wgzAttendance = new WgzAttendance();
|
||||
wgzAttendance.setRecruitId(recruit.getId());
|
||||
wgzAttendance.setUserId(wgzLeave.getUserId());
|
||||
wgzAttendance.setLeaveMarkId(wgzLeave.getId());
|
||||
wgzAttendance.setDailyWage(recruit.getRecruitAmount());
|
||||
wgzAttendance.setDate(wgzLeave.getStartTime().toLocalDate());
|
||||
wgzAttendance.setExceptionType("7");
|
||||
attendanceService.save(wgzAttendance);
|
||||
}
|
||||
return updateById(wgzLeave);
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,6 @@ 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.baomidou.mybatisplus.extension.toolkit.SqlHelper;
|
||||
import com.ruoyi.bgt.domain.BgtMessage;
|
||||
import com.ruoyi.bgt.domain.BgtProjectRecruit;
|
||||
import com.ruoyi.bgt.domain.BgtProjectRecruitApply;
|
||||
@ -34,7 +33,6 @@ 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;
|
||||
@ -49,11 +47,9 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.ruoyi.common.constants.BgtMessageConstant.*;
|
||||
import static com.ruoyi.common.constants.WgzAndBgtMessageConstant.*;
|
||||
|
||||
import static com.ruoyi.common.constants.WgzAndBgtMessageConstant.*;
|
||||
import static com.ruoyi.common.constants.WgzAndBgtMessageConstant.SMALL_SYSTEM;
|
||||
|
||||
/**
|
||||
* 工资结算Service业务层处理
|
||||
*
|
||||
@ -214,8 +210,8 @@ public class WgzPayCalculationServiceImpl extends ServicePlusImpl<WgzPayCalculat
|
||||
setSubheading(WgzAndBgtMessageConstant.wgzMessage(mp,"210")).
|
||||
setTableId(wgzPayCalculation.getId()).
|
||||
setTableName(SqlHelper.table(WgzPayCalculation.class).getTableName()).
|
||||
setMessageLargeType(BGT_LARGE).
|
||||
setMessageSmallType(BGT_TYPE_PAY);
|
||||
setMessageLargeType(BGT_LARGE_OTHER).
|
||||
setMessageSmallType(BGT_SMALL_PAY);
|
||||
if (!iBgtMessageService.sendAMessage(bgtMessage)){
|
||||
throw new RuntimeException("发送补卡消息失败!");
|
||||
}
|
||||
@ -261,10 +257,10 @@ public class WgzPayCalculationServiceImpl extends ServicePlusImpl<WgzPayCalculat
|
||||
|
||||
@Override
|
||||
public Boolean appUpdate(BgtPayCalculationUpdateDTO dto) {
|
||||
WgzPayCalculation payCalculation = BeanUtil.copyProperties(dto, WgzPayCalculation.class);
|
||||
WgzPayCalculation payCalculation = getById(dto.getId());
|
||||
BeanUtil.copyProperties(dto, payCalculation);
|
||||
payCalculation.setAuditorTime(LocalDateTime.now());
|
||||
|
||||
//发消息
|
||||
//发消息
|
||||
HashMap<String, String> mp = new HashMap<>();
|
||||
mp.put("projectName",iBgtProjectRecruitService.getById(payCalculation.getRecruitId()).getRecruitName());
|
||||
|
@ -6,7 +6,6 @@ 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.baomidou.mybatisplus.extension.toolkit.SqlHelper;
|
||||
import com.ruoyi.bgt.domain.BgtMessage;
|
||||
import com.ruoyi.bgt.domain.BgtProjectRecruit;
|
||||
import com.ruoyi.bgt.domain.BgtProjectRecruitApply;
|
||||
@ -37,10 +36,10 @@ 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.*;
|
||||
|
||||
import static com.ruoyi.common.constants.BgtMessageConstant.*;
|
||||
import static com.ruoyi.common.constants.WgzAndBgtMessageConstant.*;
|
||||
|
||||
/**
|
||||
@ -207,8 +206,8 @@ public class WgzReissueacardServiceImpl extends ServicePlusImpl<WgzReissueacardM
|
||||
setSubheading(WgzAndBgtMessageConstant.wgzMessage(mp,"208")).
|
||||
setTableId(wgzReissueacard.getId()).
|
||||
setTableName(SqlHelper.table(BgtProjectRecruitApply.class).getTableName()).
|
||||
setMessageLargeType(BGT_LARGE).
|
||||
setMessageSmallType(BGT_TYPE_MAKE_UP);
|
||||
setMessageLargeType(BGT_TYPE_SIGN_UP).
|
||||
setMessageSmallType(BGT_SMALL_MAKE_UP);
|
||||
if (!iBgtMessageService.sendAMessage(bgtMessage)){
|
||||
throw new RuntimeException("发送补卡消息失败!");
|
||||
}
|
||||
|
Reference in New Issue
Block a user