优化
This commit is contained in:
@ -0,0 +1,131 @@
|
||||
package com.ruoyi.web.controller.bgt;
|
||||
|
||||
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.vo.BgtMessageCountVO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtMessageOtherVO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtMessageVO;
|
||||
import com.ruoyi.bgt.service.IBgtMessageService;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 消息Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@Api(value = "App包工头消息控制器", tags = {"App包工头消息管理"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RestController
|
||||
@RequestMapping("/app/bgt/message")
|
||||
public class AppBgtMessageController extends BaseController {
|
||||
|
||||
private final IBgtMessageService iBgtMessageService;
|
||||
|
||||
@ApiOperation("未读消息统计")
|
||||
@GetMapping("/countUnread")
|
||||
public AjaxResult<BgtMessageCountVO> count() {
|
||||
return AjaxResult.success(iBgtMessageService.countUnread());
|
||||
}
|
||||
|
||||
@ApiOperation("我的消息列表")
|
||||
@GetMapping("/myList")
|
||||
public TableDataInfo<BgtMessageVO> myList(BgtMessageMyListDTO dto) {
|
||||
return iBgtMessageService.queryMyPageList(dto);
|
||||
}
|
||||
|
||||
@ApiOperation("其他消息列表")
|
||||
@GetMapping("/otherList")
|
||||
public TableDataInfo<BgtMessageOtherVO> otherList(BgtMessageOtherDTO dto) {
|
||||
return iBgtMessageService.queryOtherPageList(dto);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询消息列表
|
||||
*/
|
||||
@ApiOperation("查询消息列表")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BgtMessage> list(@Validated BgtMessageQueryBo bo) {
|
||||
return iBgtMessageService.queryPageList(bo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出消息列表
|
||||
*/
|
||||
@ApiOperation("导出消息列表")
|
||||
@Log(title = "消息", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult<BgtMessage> export(@Validated BgtMessageQueryBo bo) {
|
||||
List<BgtMessage> list = iBgtMessageService.queryList(bo);
|
||||
ExcelUtil<BgtMessage> util = new ExcelUtil<BgtMessage>(BgtMessage.class);
|
||||
return util.exportExcel(list, "消息");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取消息详细信息
|
||||
*/
|
||||
@ApiOperation("获取消息详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('bgt:message:query')")
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult<BgtMessage> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(iBgtMessageService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增消息
|
||||
*/
|
||||
@ApiOperation("新增消息")
|
||||
@PreAuthorize("@ss.hasPermi('bgt:message:add')")
|
||||
@Log(title = "消息", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit
|
||||
@PostMapping()
|
||||
public AjaxResult<Void> add(@Validated @RequestBody BgtMessage bo) {
|
||||
return toAjax(iBgtMessageService.insert(bo) ? 1 : 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改消息
|
||||
*/
|
||||
@ApiOperation("修改消息")
|
||||
@PreAuthorize("@ss.hasPermi('bgt:message:edit')")
|
||||
@Log(title = "消息", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit
|
||||
@PutMapping()
|
||||
public AjaxResult<Void> edit(@Validated @RequestBody BgtMessage bo) {
|
||||
return toAjax(iBgtMessageService.update(bo) ? 1 : 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除消息
|
||||
*/
|
||||
@ApiOperation("删除消息")
|
||||
@PreAuthorize("@ss.hasPermi('bgt:message:remove')")
|
||||
@Log(title = "消息" , businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(iBgtMessageService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0);
|
||||
}
|
||||
}
|
@ -42,6 +42,11 @@ public class AppBgtProjectRecruitApplyController extends BaseController {
|
||||
|
||||
private final IWgzUserService wgzUserService;
|
||||
|
||||
/**
|
||||
* 务工者申请列表 状态 为报名(0)和通过(1)
|
||||
*
|
||||
*
|
||||
*/
|
||||
@ApiOperation("App务工者列表(分页)")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BgtProjectRecruitApplyVO> listPage(@Validated BgtProjectRecruitApplyQueryDTO dto) {
|
||||
|
@ -35,9 +35,9 @@ public class AppBgtProjectRecruitController extends BaseController {
|
||||
private final IBgtProjectRecruitService iBgtProjectRecruitService;
|
||||
|
||||
/**
|
||||
* 查询包工头招工列表
|
||||
* 查询包工头招工列表 状态为通过和报名
|
||||
*/
|
||||
@ApiOperation("App我的招工")
|
||||
@ApiOperation("我的招工")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BgtProjectRecruitVO> list(@Validated BgtProjectRecruitQueryDTO dto) {
|
||||
return iBgtProjectRecruitService.appQueryPageList(dto);
|
||||
@ -46,7 +46,7 @@ public class AppBgtProjectRecruitController extends BaseController {
|
||||
/**
|
||||
* 获取包工头招工详细信息
|
||||
*/
|
||||
@ApiOperation("App我的招工任务详情")
|
||||
@ApiOperation("我的招工任务详情")
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult<BgtProjectRecruitDetailVO> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("id") Long id) {
|
||||
|
@ -34,7 +34,9 @@ public class AppFbsProjectTaskController extends BaseController {
|
||||
private final IFbsProjectTaskService iFbsProjectTaskService;
|
||||
|
||||
/**
|
||||
* app项目任务列表
|
||||
* 首页任务列表 任务状态 申请(0) 是否我的任务 false
|
||||
* 我的任务列表 任务状态 申请(0) 进行(1) 完成(2) 是否我的任务 true
|
||||
*
|
||||
*/
|
||||
@ApiOperation("App包工头任务列表/我的任务")
|
||||
@GetMapping("/list")
|
||||
@ -49,7 +51,7 @@ public class AppFbsProjectTaskController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("App获取项目任务详细信息")
|
||||
@ApiOperation("项目任务详细信息-基本信息")
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult<AppTaskDetailVO> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("id") Long id) {
|
||||
|
@ -0,0 +1,33 @@
|
||||
package com.ruoyi.common.enums;
|
||||
|
||||
/**
|
||||
* 用户状态
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public enum BgtMessageType
|
||||
{
|
||||
TASK("1", "包工头同意"),
|
||||
SETTLEMENT("2", "包工头拒绝"),
|
||||
OTHER("3", "务工者同意"),
|
||||
;
|
||||
|
||||
private final String code;
|
||||
private final String info;
|
||||
|
||||
BgtMessageType(String code, String info)
|
||||
{
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public String getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo()
|
||||
{
|
||||
return info;
|
||||
}
|
||||
}
|
@ -5,6 +5,8 @@ import org.apache.commons.lang3.time.DateFormatUtils;
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@ -157,4 +159,19 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
||||
// long sec = diff % nd % nh % nm / ns;
|
||||
return day + "天" + hour + "小时" + min + "分钟";
|
||||
}
|
||||
|
||||
|
||||
public static LocalDate str2Localdate(String time,String format){
|
||||
// 定义日期格式
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(format);
|
||||
LocalDate localDate = null;
|
||||
try {
|
||||
// 将字符串转换为 LocalDate
|
||||
localDate = LocalDate.parse(time, formatter);
|
||||
|
||||
} catch (Exception e) {
|
||||
System.out.println("日期格式不正确,转换失败: " + e.getMessage());
|
||||
}
|
||||
return localDate;
|
||||
}
|
||||
}
|
||||
|
@ -1,20 +1,15 @@
|
||||
package com.ruoyi.bgt.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 消息对象 bgt_message
|
||||
@ -33,7 +28,7 @@ public class BgtMessage implements Serializable {
|
||||
|
||||
/** 主键自增ID */
|
||||
@ApiModelProperty("主键自增ID")
|
||||
@TableId(value = "id")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/** 发送类型(0系统 1务工者 2包工头) */
|
||||
|
@ -0,0 +1,32 @@
|
||||
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;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 消息对象 bgt_message
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("消息列表查询对象")
|
||||
public class BgtMessageMyListDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/** 分页大小 */
|
||||
@ApiModelProperty("分页大小")
|
||||
private Integer pageSize;
|
||||
/** 当前页数 */
|
||||
@ApiModelProperty("当前页数")
|
||||
private Integer pageNum;
|
||||
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package com.ruoyi.bgt.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 java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 消息对象 bgt_message
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("其他消息查询对象")
|
||||
public class BgtMessageOtherDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/** 分页大小 */
|
||||
@ApiModelProperty("分页大小")
|
||||
private Integer pageSize;
|
||||
/** 当前页数 */
|
||||
@ApiModelProperty("当前页数")
|
||||
private Integer pageNum;
|
||||
|
||||
@ApiModelProperty("日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd hh", timezone = "GMT+8")
|
||||
private LocalDateTime date;
|
||||
|
||||
@ApiModelProperty("小类型(字典bgt_message_small_type)")
|
||||
private String messageSmallType;
|
||||
|
||||
}
|
@ -6,7 +6,6 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ -22,9 +21,11 @@ public class BgtProjectRecruitApplyQueryDTO extends BaseEntity {
|
||||
private Integer pageNum;
|
||||
|
||||
@ApiModelProperty("招工ID列表")
|
||||
@NotEmpty(message = "招工ID列表不能为空")
|
||||
private List<Long> recruitIds;
|
||||
|
||||
@ApiModelProperty("任务Id")
|
||||
private Long taskId;
|
||||
|
||||
@ApiModelProperty("选择状态(0报名 1包工同意 2包工头拒绝(截止时间)3务工者同意 4务工者拒绝 5进场 6离场)")
|
||||
private List<String> status;
|
||||
|
||||
|
@ -0,0 +1,33 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* 消息对象 bgt_message
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("未读消息统计视图对象")
|
||||
public class BgtMessageCountVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty("任务消息")
|
||||
private Integer taskMessageCount;
|
||||
|
||||
@ApiModelProperty("结算消息")
|
||||
private Integer settlementMessageCount;
|
||||
|
||||
@ApiModelProperty("其他消息")
|
||||
private Integer otherMessageCount;
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
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;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 消息对象 bgt_message
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("其他消息列表视图对象")
|
||||
public class BgtMessageOtherVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty("主键自增ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("表ID")
|
||||
private Long tableId;
|
||||
|
||||
@ApiModelProperty("标题")
|
||||
private String headline;
|
||||
|
||||
@ApiModelProperty("副标题")
|
||||
private String subheading;
|
||||
|
||||
@ApiModelProperty("大类型(字典bgt_message_large_type)")
|
||||
private String messageLargeType;
|
||||
|
||||
@ApiModelProperty("小类型(字典bgt_message_small_type)")
|
||||
private String messageSmallType;
|
||||
|
||||
@ApiModelProperty("读状态(0未读 1已读)")
|
||||
private String readStatus;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
//补卡
|
||||
@ApiModelProperty("现补卡时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
private LocalDateTime nowTime;
|
||||
|
||||
//报名 付款
|
||||
@ApiModelProperty("招工主题")
|
||||
private String recruitName;
|
||||
|
||||
//请假
|
||||
@ApiModelProperty("请假开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@ApiModelProperty("请假结束时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
//请假 补卡
|
||||
@ApiModelProperty("申请人")
|
||||
private String username;
|
||||
|
||||
@ApiModelProperty("补卡/请假理由")
|
||||
private String reason;
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
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.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 消息对象 bgt_message
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("消息列表视图对象")
|
||||
public class BgtMessageVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty("主键自增ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("表ID")
|
||||
private Long tableId;
|
||||
|
||||
@ApiModelProperty("标题")
|
||||
private String headline;
|
||||
|
||||
@ApiModelProperty("副标题")
|
||||
private String subheading;
|
||||
|
||||
@ApiModelProperty("大类型(字典bgt_message_large_type)")
|
||||
private String messageLargeType;
|
||||
|
||||
@ApiModelProperty("小类型(字典bgt_message_small_type)")
|
||||
private String messageSmallType;
|
||||
|
||||
@ApiModelProperty("读状态(0未读 1已读)")
|
||||
private String readStatus;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -56,5 +56,8 @@ public class BgtProjectRecruitApplyVO implements Serializable {
|
||||
@ApiModelProperty("任务名")
|
||||
private String taskName;
|
||||
|
||||
@ApiModelProperty("0报名 1包工同意 2包工头拒绝(截止时间)3务工者同意 4务工者拒绝 5进场 6离场")
|
||||
private String status;
|
||||
|
||||
|
||||
}
|
||||
|
@ -108,4 +108,10 @@ public class BgtProjectRecruitDetailVO implements Serializable {
|
||||
|
||||
@ApiModelProperty("申请者列表")
|
||||
List<BgtProjectRecruitApplyVO> applylist;
|
||||
|
||||
@ApiModelProperty("总人数")
|
||||
private Integer totalNum;
|
||||
|
||||
@ApiModelProperty("同意人数")
|
||||
private Integer passNum;
|
||||
}
|
||||
|
@ -1,9 +1,13 @@
|
||||
package com.ruoyi.bgt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.bgt.domain.BgtMessage;
|
||||
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
|
||||
import com.ruoyi.bgt.domain.dto.BgtMessageOtherDTO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtMessageOtherVO;
|
||||
import com.ruoyi.common.core.mybatisplus.cache.MybatisPlusRedisCache;
|
||||
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
|
||||
import org.apache.ibatis.annotations.CacheNamespace;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 消息Mapper接口
|
||||
@ -15,4 +19,5 @@ import org.apache.ibatis.annotations.CacheNamespace;
|
||||
@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);
|
||||
}
|
||||
|
@ -1,10 +1,14 @@
|
||||
package com.ruoyi.bgt.service;
|
||||
|
||||
import com.ruoyi.bgt.domain.BgtMessage;
|
||||
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.vo.BgtMessageCountVO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtMessageOtherVO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtMessageVO;
|
||||
import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.wgz.domain.WgzMessage;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@ -66,4 +70,18 @@ public interface IBgtMessageService extends IServicePlus<BgtMessage> {
|
||||
*/
|
||||
Boolean sendAMessage(BgtMessage bo);
|
||||
|
||||
/**
|
||||
* 我的未读消息统计
|
||||
*/
|
||||
BgtMessageCountVO countUnread();
|
||||
|
||||
/**
|
||||
* 我的消息列表
|
||||
*/
|
||||
TableDataInfo<BgtMessageVO> queryMyPageList(BgtMessageMyListDTO dto);
|
||||
|
||||
/**
|
||||
* 其他消息列表
|
||||
*/
|
||||
TableDataInfo<BgtMessageOtherVO> queryOtherPageList(BgtMessageOtherDTO dto);
|
||||
}
|
||||
|
@ -14,10 +14,7 @@ import com.ruoyi.wgz.bo.res.WgzAppJobListingRes;
|
||||
import com.ruoyi.wgz.bo.res.WgzAppProjectDetailsRes;
|
||||
import com.ruoyi.wgz.bo.res.WgzAppRegisteredProjectRes;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@ -73,10 +70,15 @@ public interface IBgtProjectRecruitService extends IServicePlus<BgtProjectRecrui
|
||||
|
||||
/**
|
||||
* 查询单个
|
||||
* @return
|
||||
*/
|
||||
BgtProjectRecruitDetailVO appQueryById(Long id);
|
||||
|
||||
/**
|
||||
* 获取任务下的所有招工Id
|
||||
*/
|
||||
List<Long> getRecruitIdsByTaskId(Long taskId);
|
||||
|
||||
|
||||
/**
|
||||
* LC-APP相关
|
||||
* =================================================================================================================
|
||||
|
@ -2,23 +2,32 @@ package com.ruoyi.bgt.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.utils.PageUtils;
|
||||
import com.ruoyi.common.core.page.PagePlus;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.wgz.domain.WgzMessage;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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.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.BgtMessageVO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtProjectRecruitApplyVO;
|
||||
import com.ruoyi.bgt.mapper.BgtMessageMapper;
|
||||
import com.ruoyi.bgt.service.IBgtMessageService;
|
||||
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 org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 消息Service业务层处理
|
||||
@ -104,4 +113,38 @@ public class BgtMessageServiceImpl extends ServicePlusImpl<BgtMessageMapper, Bgt
|
||||
public Boolean sendAMessage(BgtMessage bo) {
|
||||
return save(bo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BgtMessageCountVO countUnread() {
|
||||
List<BgtMessage> bgtMessages = baseMapper.selectList(Wrappers.<BgtMessage>lambdaQuery()
|
||||
.eq(BgtMessage::getRecipientId, SecurityUtils.getAppUserId())
|
||||
.eq(BgtMessage::getReadStatus, "0"));
|
||||
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());
|
||||
return bgtMessageCountVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<BgtMessageVO> queryMyPageList(BgtMessageMyListDTO dto) {
|
||||
LambdaQueryWrapper<BgtMessage> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(BgtMessage::getRecipientId, SecurityUtils.getAppUserId());
|
||||
Page<BgtMessage> result = page(PageUtils.buildPage(), wrapper);
|
||||
Page<BgtMessageVO> bgtMessageVOPage = new Page<>();
|
||||
bgtMessageVOPage.setTotal(result.getTotal());
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ import com.ruoyi.common.constants.WgzAndBgtMessageConstant;
|
||||
import com.ruoyi.common.core.domain.entity.SysDictData;
|
||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.domain.dto.AnnexDTO;
|
||||
import com.ruoyi.common.enums.RecruitApplyStatus;
|
||||
import com.ruoyi.common.exception.BaseException;
|
||||
import com.ruoyi.common.service.IAnnexService;
|
||||
@ -61,14 +62,14 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
|
||||
@Autowired
|
||||
private IWgzUserService wgzUserService;
|
||||
@Autowired
|
||||
private IBgtProjectRecruitApplyService iBgtProjectRecruitApplyService;
|
||||
@Autowired
|
||||
private IBgtProjectRecruitService iBgtProjectRecruitService;
|
||||
@Autowired
|
||||
private IWgzMessageService iWgzMessageService;
|
||||
@Autowired
|
||||
private IBgtMessageService iBgtMessageService;
|
||||
@Autowired
|
||||
private IWgzMessageService wgzMessageService;
|
||||
@Autowired
|
||||
private ISysDictTypeService dictTypeService;
|
||||
|
||||
@Override
|
||||
@ -128,6 +129,15 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
|
||||
|
||||
@Override
|
||||
public TableDataInfo<BgtProjectRecruitApplyVO> appQueryPageList(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);
|
||||
}
|
||||
}
|
||||
|
||||
Page<BgtProjectRecruitApplyQueryDTO> queryDTOPage = new Page<>();
|
||||
queryDTOPage.setCurrent(dto.getPageNum());
|
||||
queryDTOPage.setSize(dto.getPageSize());
|
||||
@ -156,7 +166,26 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
|
||||
recruitApply.setEntryTime(dto.getEntryTime());
|
||||
recruitApply.setStatus(RecruitApplyStatus.BGT_PASS.getCode());
|
||||
dto.getEntryMaterials().addAll(dto.getInsurances());
|
||||
for (AnnexDTO annexDTO : dto.getEntryMaterials()) {
|
||||
annexDTO.setRecruitId(recruitApply.getRecruitId());
|
||||
}
|
||||
annexService.insertBatch(dto.getEntryMaterials());
|
||||
//发消息
|
||||
HashMap<String, String> mp = new HashMap<>();
|
||||
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)
|
||||
.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_APPLY)
|
||||
.setMessageSmallType(SMALL_SYSTEM);
|
||||
wgzMessageService.sendAMessage(wgzMessage);
|
||||
return updateById(recruitApply);
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@ import com.ruoyi.bgt.bo.BgtProjectRecruitQueryBo;
|
||||
import com.ruoyi.bgt.domain.BgtProjectRecruit;
|
||||
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.BgtProjectRecruitVO;
|
||||
import com.ruoyi.bgt.mapper.BgtProjectRecruitMapper;
|
||||
@ -33,10 +34,8 @@ import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 包工头招工Service业务层处理
|
||||
@ -53,6 +52,10 @@ public class BgtProjectRecruitServiceImpl extends ServicePlusImpl<BgtProjectRecr
|
||||
@Autowired
|
||||
private IBgtProjectRecruitApplyService bgtProjectRecruitApplyService;
|
||||
|
||||
/**
|
||||
* 包工头招工任务能看到的申请状态
|
||||
*/
|
||||
private static final List<String> applyStatus = Arrays.asList(RecruitApplyStatus.SIGN_UP.getCode(),RecruitApplyStatus.BGT_PASS.getCode());
|
||||
|
||||
@Override
|
||||
public BgtProjectRecruit queryById(Long id){
|
||||
@ -130,7 +133,7 @@ public class BgtProjectRecruitServiceImpl extends ServicePlusImpl<BgtProjectRecr
|
||||
for(BgtProjectRecruitVO vo : queryVOPage.getRecords()) {
|
||||
BgtProjectRecruitApplyQueryDTO bgtProjectRecruitApplyQueryDTO = new BgtProjectRecruitApplyQueryDTO();
|
||||
bgtProjectRecruitApplyQueryDTO.setRecruitIds(Collections.singletonList(vo.getId()));
|
||||
bgtProjectRecruitApplyQueryDTO.setStatus(dto.getStatus());
|
||||
bgtProjectRecruitApplyQueryDTO.setStatus(applyStatus);
|
||||
vo.setApplylist(bgtProjectRecruitApplyService.appQueryList(bgtProjectRecruitApplyQueryDTO));
|
||||
}
|
||||
return PageUtils.buildDataInfo(queryVOPage);
|
||||
@ -144,11 +147,22 @@ public class BgtProjectRecruitServiceImpl extends ServicePlusImpl<BgtProjectRecr
|
||||
vo.setTaskName(task.getTaskName());
|
||||
BgtProjectRecruitApplyQueryDTO bgtProjectRecruitApplyQueryDTO = new BgtProjectRecruitApplyQueryDTO();
|
||||
bgtProjectRecruitApplyQueryDTO.setRecruitIds(Collections.singletonList(vo.getId()));
|
||||
bgtProjectRecruitApplyQueryDTO.setStatus(Collections.singletonList(RecruitApplyStatus.SIGN_UP.getCode()));
|
||||
vo.setApplylist(bgtProjectRecruitApplyService.appQueryList(bgtProjectRecruitApplyQueryDTO));
|
||||
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)));
|
||||
return vo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> getRecruitIdsByTaskId(Long taskId) {
|
||||
LambdaQueryWrapper<BgtProjectRecruit> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(BgtProjectRecruit::getTaskId, taskId);
|
||||
return baseMapper.selectList(wrapper).stream().map(BgtProjectRecruit::getId).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* LC-APP相关
|
||||
* =================================================================================================================
|
||||
|
@ -24,6 +24,9 @@ public class AnnexDTO {
|
||||
/** 用户类型 */
|
||||
@ApiModelProperty("用户类型")
|
||||
private String userType;
|
||||
|
||||
@ApiModelProperty("招工任务ID")
|
||||
private Long recruitId;
|
||||
/** 附件类型 */
|
||||
@ApiModelProperty("附件类型")
|
||||
private String annexType;
|
||||
|
@ -19,6 +19,8 @@ public class AppTaskDetailRecruitVO {
|
||||
List<BgtProjectRecruitApplyVO> applyList;
|
||||
|
||||
|
||||
@ApiModelProperty("总数")
|
||||
private Integer total;
|
||||
|
||||
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ import com.ruoyi.bgt.domain.BgtProjectRecruit;
|
||||
import com.ruoyi.bgt.domain.dto.BgtProjectRecruitApplyQueryDTO;
|
||||
import com.ruoyi.bgt.domain.dto.BgtWageApplicationQueryDTO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtAttendanceCountVO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtProjectRecruitApplyVO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtWageApplicationListVO;
|
||||
import com.ruoyi.bgt.service.IBgtProjectRecruitApplyService;
|
||||
import com.ruoyi.bgt.service.IBgtProjectRecruitService;
|
||||
@ -22,6 +23,7 @@ import com.ruoyi.common.enums.AuditStatus;
|
||||
import com.ruoyi.common.enums.ProjectTaskStatus;
|
||||
import com.ruoyi.common.enums.RecruitApplyStatus;
|
||||
import com.ruoyi.common.util.DataUtil;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.PageUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.fbs.bo.FbsProjectTaskQueryBo;
|
||||
@ -39,6 +41,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@ -203,18 +206,33 @@ public class FbsProjectTaskServiceImpl extends ServicePlusImpl<FbsProjectTaskMap
|
||||
|
||||
@Override
|
||||
public AppTaskDetailAttendanceVO attendance(Long id) {
|
||||
FbsProjectTask task = getById(id);
|
||||
LocalDate taskBeginTime = DateUtils.str2Localdate(task.getTaskBeginTime(), DateUtils.YYYY_MM_DD);
|
||||
LocalDate taskEndTime = DateUtils.str2Localdate(task.getTaskEndTime(), DateUtils.YYYY_MM_DD);
|
||||
//考勤情况
|
||||
AppTaskDetailAttendanceVO appTaskDetailVO = new AppTaskDetailAttendanceVO();
|
||||
appTaskDetailVO.setId(id);
|
||||
LocalDate date = LocalDate.now();
|
||||
LocalDate startOfMonth = date.withDayOfMonth(1);
|
||||
List<BgtAttendanceCountVO> countVOS = attendanceService.countByTaskId(id, startOfMonth, date);
|
||||
if(taskEndTime!=null &&taskEndTime.isBefore(date)){
|
||||
date = taskEndTime;
|
||||
}
|
||||
LocalDate startTime = date.minusDays(7);
|
||||
if (taskBeginTime!=null &&taskBeginTime.isAfter(startTime)){
|
||||
startTime = taskBeginTime;
|
||||
}
|
||||
List<BgtAttendanceCountVO>
|
||||
countVOS = attendanceService.countByTaskId(id, startTime, date);
|
||||
if(CollectionUtil.isNotEmpty(countVOS)){
|
||||
BgtAttendanceCountVO vo = countVOS.get(0);
|
||||
appTaskDetailVO.setCountVOS(DataUtil.fillMissingDates(countVOS, startOfMonth, date));
|
||||
appTaskDetailVO.setCountVOS(DataUtil.fillMissingDates(countVOS, startTime, date));
|
||||
appTaskDetailVO.setTotalNum(vo.getTotalNum());
|
||||
appTaskDetailVO.setReportToDutyNum(vo.getReportToDutyNum());
|
||||
appTaskDetailVO.setReportToDutyRate(vo.getReportToDutyNum()/vo.getTotalNum()*100);
|
||||
if(vo.getTotalNum()!=0){
|
||||
int rate = new BigDecimal(vo.getReportToDutyNum()).divide(new BigDecimal(vo.getTotalNum()), 2, RoundingMode.HALF_UP)
|
||||
.multiply(new BigDecimal(100)).intValue();
|
||||
appTaskDetailVO.setReportToDutyRate(rate);
|
||||
}
|
||||
|
||||
}
|
||||
return appTaskDetailVO;
|
||||
}
|
||||
@ -261,7 +279,9 @@ public class FbsProjectTaskServiceImpl extends ServicePlusImpl<FbsProjectTaskMap
|
||||
BgtProjectRecruitApplyQueryDTO bgtProjectRecruitApplyQueryDTO = new BgtProjectRecruitApplyQueryDTO();
|
||||
bgtProjectRecruitApplyQueryDTO.setRecruitIds(recruitIds);
|
||||
bgtProjectRecruitApplyQueryDTO.setStatus(Collections.singletonList(RecruitApplyStatus.WORKING.getCode()));
|
||||
appTaskDetailVO.setApplyList(recruitApplyService.appQueryList(bgtProjectRecruitApplyQueryDTO));
|
||||
List<BgtProjectRecruitApplyVO> vos = recruitApplyService.appQueryList(bgtProjectRecruitApplyQueryDTO);
|
||||
appTaskDetailVO.setTotal(vos.size());
|
||||
appTaskDetailVO.setApplyList(vos.subList(0, Math.min(vos.size(), 3)));
|
||||
return appTaskDetailVO;
|
||||
}
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ 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;
|
||||
@ -20,6 +21,7 @@ import com.ruoyi.common.constants.WgzAndBgtMessageConstant;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.AuditStatus;
|
||||
import com.ruoyi.common.utils.PageUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.fbs.domain.FbsProjectTask;
|
||||
@ -28,6 +30,10 @@ import com.ruoyi.wgz.bo.WgzPayCalculationQueryBo;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppApplyForPayrollSettlementListReq;
|
||||
import com.ruoyi.wgz.bo.req.WgzApplyForPayrollSettlementAddReq;
|
||||
import com.ruoyi.wgz.bo.res.WgzAppApplyForPayrollSettlementListRes;
|
||||
import com.ruoyi.wgz.domain.WgzMessage;
|
||||
import com.ruoyi.wgz.domain.WgzPayCalculation;
|
||||
import com.ruoyi.wgz.domain.WgzPayCalculationFiles;
|
||||
import com.ruoyi.wgz.domain.WgzUser;
|
||||
import com.ruoyi.wgz.domain.*;
|
||||
import com.ruoyi.wgz.mapper.WgzPayCalculationMapper;
|
||||
import com.ruoyi.wgz.service.*;
|
||||
@ -45,6 +51,9 @@ import java.util.Map;
|
||||
|
||||
import static com.ruoyi.common.constants.WgzAndBgtMessageConstant.*;
|
||||
|
||||
import static com.ruoyi.common.constants.WgzAndBgtMessageConstant.*;
|
||||
import static com.ruoyi.common.constants.WgzAndBgtMessageConstant.SMALL_SYSTEM;
|
||||
|
||||
/**
|
||||
* 工资结算Service业务层处理
|
||||
*
|
||||
@ -72,6 +81,9 @@ public class WgzPayCalculationServiceImpl extends ServicePlusImpl<WgzPayCalculat
|
||||
@Autowired
|
||||
private IWgzAttendanceService attendanceService;
|
||||
|
||||
@Autowired
|
||||
private IWgzMessageService wgzMessageService;
|
||||
|
||||
@Autowired
|
||||
private IWgzMessageService iWgzMessageService;
|
||||
|
||||
@ -251,6 +263,24 @@ public class WgzPayCalculationServiceImpl extends ServicePlusImpl<WgzPayCalculat
|
||||
public Boolean appUpdate(BgtPayCalculationUpdateDTO dto) {
|
||||
WgzPayCalculation payCalculation = BeanUtil.copyProperties(dto, WgzPayCalculation.class);
|
||||
payCalculation.setAuditorTime(LocalDateTime.now());
|
||||
|
||||
//发消息
|
||||
//发消息
|
||||
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_PAY, AuditStatus.PASS.getCode().equals(dto.getAuditorType()));
|
||||
WgzMessage wgzMessage = new WgzMessage()
|
||||
.setSenderType(USERTYPE_BGT)
|
||||
.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)
|
||||
.setMessageSmallType(SMALL_SYSTEM);
|
||||
wgzMessageService.sendAMessage(wgzMessage);
|
||||
return updateById(payCalculation);
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,7 @@ 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;
|
||||
@ -60,6 +61,9 @@ public class WgzReissueacardServiceImpl extends ServicePlusImpl<WgzReissueacardM
|
||||
@Autowired
|
||||
private IWgzAttendanceService iWgzAttendanceService;
|
||||
|
||||
@Autowired
|
||||
private IWgzMessageService wgzMessageService;
|
||||
|
||||
@Autowired
|
||||
private IWgzMessageService iWgzMessageService;
|
||||
|
||||
@ -233,7 +237,27 @@ public class WgzReissueacardServiceImpl extends ServicePlusImpl<WgzReissueacardM
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean appUpdate(BgtReissueacardUpdateDTO dto) {
|
||||
return updateById(BeanUtil.copyProperties(dto,WgzReissueacard.class));
|
||||
WgzReissueacard byId = getById(dto.getId());
|
||||
BeanUtil.copyProperties(dto, byId);
|
||||
boolean b = updateById(byId);
|
||||
//发消息
|
||||
HashMap<String, String> mp = new HashMap<>();
|
||||
mp.put("projectName",iBgtProjectRecruitService.getById(byId.getRecruitId()).getRecruitName());
|
||||
mp.put("auditor",SecurityUtils.getUsername());
|
||||
Map<String, String> map = bgtMessage(mp, BGT_TYPE_MAKE_UP, true);
|
||||
WgzMessage wgzMessage = new WgzMessage()
|
||||
.setSenderType(USERTYPE_BGT)
|
||||
.setRecipientType(USERTYPE_WGZ)
|
||||
.setRecipientId(byId.getUserId())
|
||||
.setHeadline(map.get(HEADLINE))
|
||||
.setSubheading(map.get(SUBHEADING))
|
||||
.setTableId(byId.getId())
|
||||
.setTableName(SqlHelper.table(WgzReissueacard.class).getTableName())
|
||||
.setMessageLargeType(LARGE_OTHER)
|
||||
.setMessageSmallType(SMALL_CARD);
|
||||
wgzMessageService.sendAMessage(wgzMessage);
|
||||
return b;
|
||||
}
|
||||
}
|
||||
|
@ -25,5 +25,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="queryOtherPageList" resultType="com.ruoyi.bgt.domain.vo.BgtMessageOtherVO">
|
||||
|
||||
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
@ -24,6 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
wu.score,
|
||||
wu.avatar_name,
|
||||
wu.username,
|
||||
bpra.status,
|
||||
wu.type_of_work,
|
||||
bpr.recruit_name,
|
||||
fpt.task_name
|
||||
@ -48,6 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
order by bpra.create_time desc,bpra.status asc
|
||||
</select>
|
||||
|
||||
<select id="todayAttendanceList" resultType="com.ruoyi.bgt.domain.vo.BgtProjectRecruitApplyVO">
|
||||
|
@ -33,13 +33,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="countByTaskId" resultType="com.ruoyi.bgt.domain.vo.BgtAttendanceCountVO">
|
||||
select count(1) as reportToDutyNum,
|
||||
date,
|
||||
(select count(1) from bgt_project_recruit_apply where entry_time <= date
|
||||
(select count(1) from bgt_project_recruit_apply where entry_time <= date and (leave_time is null or leave_time>date)
|
||||
and recruit_id in (select id from bgt_project_recruit where task_id = #{taskId} )) as totalNum
|
||||
from wgz_attendance
|
||||
where date between #{beginDate} and #{endDate}
|
||||
and (missed_in = 0 or missed_out = 0)
|
||||
and recruit_id in (select id from bgt_project_recruit where task_id = #{taskId} )
|
||||
group by date
|
||||
group by date order by date
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
Reference in New Issue
Block a user