diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/bgt/AppBgtLeaveController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/bgt/AppBgtLeaveController.java index c1c36d4..6884ac8 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/bgt/AppBgtLeaveController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/bgt/AppBgtLeaveController.java @@ -1,13 +1,17 @@ package com.ruoyi.web.controller.bgt; +import cn.hutool.core.bean.BeanUtil; import com.ruoyi.bgt.domain.dto.BgtLeaveUpdateDTO; +import com.ruoyi.bgt.domain.vo.BgtLeaveDetailVO; 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.enums.BusinessType; import com.ruoyi.wgz.domain.WgzLeave; +import com.ruoyi.wgz.domain.WgzUser; import com.ruoyi.wgz.service.IWgzLeaveService; +import com.ruoyi.wgz.service.IWgzUserService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; @@ -30,15 +34,20 @@ import javax.validation.constraints.NotNull; public class AppBgtLeaveController extends BaseController { private final IWgzLeaveService iWgzLeaveService; + private final IWgzUserService wgzUserService; /** * 获取请假详细信息 */ @ApiOperation("获取请假详细信息") @GetMapping("/{id}") - public AjaxResult getInfo(@NotNull(message = "主键不能为空") + public AjaxResult getInfo(@NotNull(message = "主键不能为空") @PathVariable("id") Long id) { - return AjaxResult.success(iWgzLeaveService.queryById(id)); + WgzLeave wgzLeave = iWgzLeaveService.queryById(id); + WgzUser byUserId = wgzUserService.findByUserId(wgzLeave.getUserId()); + BgtLeaveDetailVO bgtLeaveDetailVO = BeanUtil.copyProperties(wgzLeave, BgtLeaveDetailVO.class); + bgtLeaveDetailVO.setAvatarName(byUserId.getAvatarName()); + return AjaxResult.success(bgtLeaveDetailVO); } @ApiOperation("请假审核") diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/fbs/AppFbsMessageController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/fbs/AppFbsMessageController.java new file mode 100644 index 0000000..d6a026b --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/fbs/AppFbsMessageController.java @@ -0,0 +1,72 @@ +package com.ruoyi.web.controller.fbs; + +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.fbs.domain.FbsMessage; +import com.ruoyi.fbs.domain.dto.FbsMessageDetailDTO; +import com.ruoyi.fbs.domain.dto.FbsMessageMyListDTO; +import com.ruoyi.fbs.domain.vo.FbsMessageCountVO; +import com.ruoyi.fbs.domain.vo.FbsMessageDetailVO; +import com.ruoyi.fbs.domain.vo.FbsMessageVO; +import com.ruoyi.fbs.service.IFbsMessageService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * 消息Controller + * + * @author ruoyi + * @date 2025-03-28 + */ +@Api(value = "App分包商消息控制器", tags = {"App分包商"}) +@RequiredArgsConstructor(onConstructor_ = @Autowired) +@RestController +@RequestMapping("/app/fbs/message") +public class AppFbsMessageController extends BaseController { + + private final IFbsMessageService iFbsMessageService; + + @ApiOperation("分包商未读消息统计") + @GetMapping("/countUnread") + public AjaxResult count() { + return AjaxResult.success(iFbsMessageService.countUnread()); + } + + + @ApiOperation("分包商消息列表") + @GetMapping("/myList") + public TableDataInfo myList(FbsMessageMyListDTO dto) { + return iFbsMessageService.queryMyPageList(dto); + } + + + @ApiOperation("分包商消息详情列表") + @GetMapping("/detailList") + public TableDataInfo otherList(FbsMessageDetailDTO dto) { + return iFbsMessageService.queryDetailPageList(dto); + } + + + @ApiOperation("分包商消息已读") + @PutMapping("/read/{id}") + public AjaxResult read(@PathVariable(value = "id") Long id) { + FbsMessage fbsMessage = new FbsMessage(); + fbsMessage.setId(id); + fbsMessage.setReadStatus("1"); + return AjaxResult.success(iFbsMessageService.updateById(fbsMessage)); + } + + @ApiOperation("分包商消息已操作") + @PutMapping("/operation/{id}") + public AjaxResult operation(@PathVariable(value = "id") Long id) { + FbsMessage fbsMessage = new FbsMessage(); + fbsMessage.setId(id); + fbsMessage.setIsOperation("2"); + return AjaxResult.success(iFbsMessageService.updateById(fbsMessage)); + } + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/fbs/AppFbsWageApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/fbs/AppFbsWageApplicationController.java index fac18ae..faf699c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/fbs/AppFbsWageApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/fbs/AppFbsWageApplicationController.java @@ -1,5 +1,10 @@ package com.ruoyi.web.controller.fbs; +import cn.hutool.core.bean.BeanUtil; +import com.ruoyi.bgt.domain.BgtWageApplication; +import com.ruoyi.bgt.domain.vo.BgtWageApplicationDetailVO; +import com.ruoyi.bgt.domain.vo.BgtWageApplicationVO; +import com.ruoyi.bgt.service.IBgtWageApplicationService; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.RepeatSubmit; import com.ruoyi.common.core.controller.BaseController; @@ -8,7 +13,10 @@ import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.fbs.domain.FbsWageApplication; import com.ruoyi.fbs.domain.dto.FbsWageApplicationListDTO; +import com.ruoyi.fbs.domain.dto.FbsWageAuditDTO; +import com.ruoyi.fbs.domain.dto.FbsWageAuditListDTO; import com.ruoyi.fbs.service.IFbsWageApplicationService; +import com.ruoyi.zbf.service.IZbfProjectService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; @@ -24,13 +32,15 @@ import javax.validation.constraints.NotNull; * @author ruoyi * @date 2025-03-26 */ -@Api(value = "APP分包商工资申请控制器", tags = {"APP分包商"}) +@Api(value = "App分包商工资申请控制器", tags = {"App分包商"}) @RequiredArgsConstructor(onConstructor_ = @Autowired) @RestController @RequestMapping("/app/fbs/application") public class AppFbsWageApplicationController extends BaseController { private final IFbsWageApplicationService iFbsWageApplicationService; + private final IBgtWageApplicationService iBgtWageApplicationService; + private final IZbfProjectService iZbfProjectService; @ApiOperation("分包商查询自己的工资申请列表") @GetMapping("/list") @@ -50,8 +60,35 @@ public class AppFbsWageApplicationController extends BaseController { @RepeatSubmit @PostMapping() public AjaxResult add(@Validated @RequestBody FbsWageApplication bo) { - //todo: 插入审核人的名字 - return AjaxResult.success(iFbsWageApplicationService.insert(bo)); +// ZbfProject byId = iZbfProjectService.getById(bo.getProjectId()); +// +// bo.setReviewerName(byId.getUnitName()) + return AjaxResult.success(iFbsWageApplicationService.insert(bo)); } + + @ApiOperation("分包商查询审核工资申请列表") + @GetMapping("/audit/list") + public TableDataInfo auditList(@Validated FbsWageAuditListDTO dto) { + return iBgtWageApplicationService.fbsAuditPageList(dto); + } + + @ApiOperation("分包商查询审核工资申请详细信息") + @GetMapping("/audit/{id}") + public AjaxResult getAuditInfo(@NotNull(message = "主键不能为空") + @PathVariable("id") Long id) { + return AjaxResult.success(iBgtWageApplicationService.appQueryById(id)); + } + + @ApiOperation("分包商审核包工头工资申请") + @Log(title = "分包商审核包工头工资申请", businessType = BusinessType.UPDATE) + @RepeatSubmit + @PutMapping("/audit") + public AjaxResult audit(@Validated @RequestBody FbsWageAuditDTO dto) { + BgtWageApplication bo = iBgtWageApplicationService.getById(dto.getId()); + BeanUtil.copyProperties(dto, bo); + return AjaxResult.success(iBgtWageApplicationService.update(bo)); + } + + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/fbs/FbsMessageController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/fbs/FbsMessageController.java new file mode 100644 index 0000000..f6a50ca --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/fbs/FbsMessageController.java @@ -0,0 +1,108 @@ +package com.ruoyi.web.controller.fbs; + +import java.util.List; +import java.util.Arrays; + +import com.ruoyi.fbs.domain.FbsMessage; +import lombok.RequiredArgsConstructor; +import javax.validation.constraints.*; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import com.ruoyi.common.annotation.RepeatSubmit; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.fbs.bo.FbsMessageQueryBo; +import com.ruoyi.fbs.service.IFbsMessageService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; + +/** + * 消息Controller + * + * @author ruoyi + * @date 2025-03-28 + */ +@Api(value = "消息控制器", tags = {"消息管理"}) +@RequiredArgsConstructor(onConstructor_ = @Autowired) +@RestController +@RequestMapping("/fbs/message") +public class FbsMessageController extends BaseController { + + private final IFbsMessageService iFbsMessageService; + + /** + * 查询消息列表 + */ + @ApiOperation("查询消息列表") + @PreAuthorize("@ss.hasPermi('fbs:message:list')") + @GetMapping("/list") + public TableDataInfo list(@Validated FbsMessageQueryBo bo) { + return iFbsMessageService.queryPageList(bo); + } + + /** + * 导出消息列表 + */ + @ApiOperation("导出消息列表") + @PreAuthorize("@ss.hasPermi('fbs:message:export')") + @Log(title = "消息", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(@Validated FbsMessageQueryBo bo) { + List list = iFbsMessageService.queryList(bo); + ExcelUtil util = new ExcelUtil(FbsMessage.class); + return util.exportExcel(list, "消息"); + } + + /** + * 获取消息详细信息 + */ + @ApiOperation("获取消息详细信息") + @PreAuthorize("@ss.hasPermi('fbs:message:query')") + @GetMapping("/{id}") + public AjaxResult getInfo(@NotNull(message = "主键不能为空") + @PathVariable("id") Long id) { + return AjaxResult.success(iFbsMessageService.queryById(id)); + } + + /** + * 新增消息 + */ + @ApiOperation("新增消息") + @PreAuthorize("@ss.hasPermi('fbs:message:add')") + @Log(title = "消息", businessType = BusinessType.INSERT) + @RepeatSubmit + @PostMapping() + public AjaxResult add(@Validated @RequestBody FbsMessage bo) { + return toAjax(iFbsMessageService.insert(bo) ? 1 : 0); + } + + /** + * 修改消息 + */ + @ApiOperation("修改消息") + @PreAuthorize("@ss.hasPermi('fbs:message:edit')") + @Log(title = "消息", businessType = BusinessType.UPDATE) + @RepeatSubmit + @PutMapping() + public AjaxResult edit(@Validated @RequestBody FbsMessage bo) { + return toAjax(iFbsMessageService.update(bo) ? 1 : 0); + } + + /** + * 删除消息 + */ + @ApiOperation("删除消息") + @PreAuthorize("@ss.hasPermi('fbs:message:remove')") + @Log(title = "消息" , businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(iFbsMessageService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/fbs/FbsProjectSectionController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/fbs/FbsProjectSectionController.java new file mode 100644 index 0000000..92ce451 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/fbs/FbsProjectSectionController.java @@ -0,0 +1,37 @@ +package com.ruoyi.web.controller.fbs; + +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.fbs.domain.dto.FbsProjectSectionListDTO; +import com.ruoyi.fbs.domain.vo.FbsProjectSectionListVO; +import com.ruoyi.zbf.service.IZbfProjectSectionService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 总包方项目标段Controller + * + * @author ruoyi + * @date 2025-02-17 + */ +@Api(value = "App分包商项目标段控制器", tags = {"App分包商"}) +@RequiredArgsConstructor(onConstructor_ = @Autowired) +@RestController +@RequestMapping("/app/fbs/section") +public class FbsProjectSectionController extends BaseController { + + private final IZbfProjectSectionService iZbfProjectSectionService; + + @ApiOperation("分包商查询自己的项目分包列表") + @GetMapping("/fbsSubList") + public TableDataInfo fbsSubList(@Validated FbsProjectSectionListDTO dto) { + return iZbfProjectSectionService.fbsSubList(dto); + } + +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/enums/BgtMessageType.java b/ruoyi-common/src/main/java/com/ruoyi/common/enums/BgtMessageType.java index 6fd1e8c..36158fb 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/enums/BgtMessageType.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/enums/BgtMessageType.java @@ -7,9 +7,9 @@ package com.ruoyi.common.enums; */ public enum BgtMessageType { - TASK("1", "包工头同意"), - SETTLEMENT("2", "包工头拒绝"), - OTHER("3", "务工者同意"), + TASK("1", "任务/报名"), + SETTLEMENT("2", "结算"), + OTHER("3", "其他"), ; private final String code; diff --git a/ruoyi-system/src/main/java/com/ruoyi/bgt/domain/BgtWageApplication.java b/ruoyi-system/src/main/java/com/ruoyi/bgt/domain/BgtWageApplication.java index 70b3cf2..2f186fe 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/bgt/domain/BgtWageApplication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/bgt/domain/BgtWageApplication.java @@ -1,9 +1,6 @@ package com.ruoyi.bgt.domain; -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.*; import com.ruoyi.common.annotation.Excel; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -32,7 +29,7 @@ public class BgtWageApplication implements Serializable { /** 主键ID */ @ApiModelProperty("主键ID") - @TableId(value = "id") + @TableId(value = "id", type = IdType.AUTO) private Long id; /** 项目ID */ @@ -85,7 +82,7 @@ public class BgtWageApplication implements Serializable { private String cardNo; @ApiModelProperty("申请时间") - private String applyTime; + private LocalDateTime applyTime; /** 申请金额 */ @Excel(name = "申请金额") @@ -117,6 +114,9 @@ public class BgtWageApplication implements Serializable { @ApiModelProperty("审核人Id") private Long reviewerId; + @ApiModelProperty("审核人名字") + private String reviewerName; + /** 删除标志(0代表存在 2代表删除) */ @Excel(name = "删除标志" , readConverterExp = "0=代表存在,2=代表删除") @ApiModelProperty("删除标志(0代表存在 2代表删除)") diff --git a/ruoyi-system/src/main/java/com/ruoyi/bgt/domain/vo/BgtLeaveDetailVO.java b/ruoyi-system/src/main/java/com/ruoyi/bgt/domain/vo/BgtLeaveDetailVO.java new file mode 100644 index 0000000..e3f6637 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/bgt/domain/vo/BgtLeaveDetailVO.java @@ -0,0 +1,108 @@ +package com.ruoyi.bgt.domain.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.time.LocalDateTime; +import java.time.LocalTime; + +/** + * 请假对象 wgz_leave + * + * @author ruoyi + * @date 2025-02-19 + */ +@Data +@ApiModel("请假视图对象") +public class BgtLeaveDetailVO { + + + + /** 主键自增ID */ + @ApiModelProperty("主键自增ID") + private Long id; + + + @ApiModelProperty("项目ID") + private Long recruitId; + + + @ApiModelProperty("招工申请主键自增id") + private Long applyKey; + + + + @ApiModelProperty("请假人") + private Long userId; + + + @ApiModelProperty("招工主题") + private String subject; + + + @ApiModelProperty("请假类型(字典)") + private String leaveType; + + @ApiModelProperty("开始时间") + private LocalDateTime startTime; + + + @ApiModelProperty("结束时间") + private LocalDateTime endTime; + + @ApiModelProperty("请假事由") + private String reason; + + + @ApiModelProperty("审核人ID") + private Long auditorUserId; + + + @ApiModelProperty("审核状态(0待审核 1审核中 2已同意 3已拒绝 4=已取消)") + private String auditorType; + + + @ApiModelProperty("审核意见") + private String auditorOpinion; + + @ApiModelProperty("同意|拒绝时间") + private LocalDateTime auditorTime; + + @ApiModelProperty("上班时间") + private LocalTime workingTime; + + + @ApiModelProperty("下班时间") + private LocalTime closingTime; + + + @ApiModelProperty("取消请假") + private LocalDateTime cancelLeave; + + + @ApiModelProperty("删除标志(0代表存在 2代表删除)") + private String delFlag; + + + @ApiModelProperty("创建者") + private String createBy; + + @ApiModelProperty("创建时间") + private LocalDateTime createTime; + + + @ApiModelProperty("更新者") + private String updateBy; + + + @ApiModelProperty("更新时间") + private LocalDateTime updateTime; + + @ApiModelProperty("备注") + private String remark; + + @ApiModelProperty("头像地址") + private String avatarName; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/bgt/domain/vo/BgtWageApplicationDetailVO.java b/ruoyi-system/src/main/java/com/ruoyi/bgt/domain/vo/BgtWageApplicationDetailVO.java index ad7ea3f..89d01ff 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/bgt/domain/vo/BgtWageApplicationDetailVO.java +++ b/ruoyi-system/src/main/java/com/ruoyi/bgt/domain/vo/BgtWageApplicationDetailVO.java @@ -45,8 +45,8 @@ public class BgtWageApplicationDetailVO { private String username; @ApiModelProperty("申请时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + private LocalDateTime applyTime; @ApiModelProperty("联系电话") private String phone; diff --git a/ruoyi-system/src/main/java/com/ruoyi/bgt/domain/vo/BgtWageApplicationVO.java b/ruoyi-system/src/main/java/com/ruoyi/bgt/domain/vo/BgtWageApplicationVO.java index 4af8cc7..59163db 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/bgt/domain/vo/BgtWageApplicationVO.java +++ b/ruoyi-system/src/main/java/com/ruoyi/bgt/domain/vo/BgtWageApplicationVO.java @@ -36,8 +36,8 @@ public class BgtWageApplicationVO { private BigDecimal applicantAmount; @ApiModelProperty("申请时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + private LocalDateTime applyTime; @ApiModelProperty("任务名") private String taskName; diff --git a/ruoyi-system/src/main/java/com/ruoyi/bgt/mapper/BgtWageApplicationMapper.java b/ruoyi-system/src/main/java/com/ruoyi/bgt/mapper/BgtWageApplicationMapper.java index 8711e6c..aa12ba4 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/bgt/mapper/BgtWageApplicationMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/bgt/mapper/BgtWageApplicationMapper.java @@ -7,6 +7,7 @@ import com.ruoyi.bgt.domain.vo.BgtWageApplicationListVO; import com.ruoyi.bgt.domain.vo.BgtWageApplicationVO; import com.ruoyi.common.core.mybatisplus.cache.MybatisPlusRedisCache; import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus; +import com.ruoyi.fbs.domain.dto.FbsWageAuditListDTO; import org.apache.ibatis.annotations.CacheNamespace; import org.apache.ibatis.annotations.Param; @@ -25,4 +26,9 @@ public interface BgtWageApplicationMapper extends BaseMapperPlus appQueryPageList(@Param("page") Page page, @Param("dto") BgtWageApplicationQueryDTO dto); List appQueryList(@Param("dto") BgtWageApplicationQueryDTO dto); + + /** + * 分包商查询包工头的工资申请 + */ + Page fbsAuditPageList(@Param("page") Page page, @Param("dto") FbsWageAuditListDTO dto); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/bgt/service/IBgtWageApplicationService.java b/ruoyi-system/src/main/java/com/ruoyi/bgt/service/IBgtWageApplicationService.java index 097d52e..d4791e7 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/bgt/service/IBgtWageApplicationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/bgt/service/IBgtWageApplicationService.java @@ -8,6 +8,7 @@ import com.ruoyi.bgt.domain.vo.BgtWageApplicationListVO; import com.ruoyi.bgt.domain.vo.BgtWageApplicationVO; import com.ruoyi.common.core.mybatisplus.core.IServicePlus; import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.fbs.domain.dto.FbsWageAuditListDTO; import java.util.Collection; import java.util.List; @@ -71,4 +72,11 @@ public interface IBgtWageApplicationService extends IServicePlus appQueryList(BgtWageApplicationQueryDTO dto); + + + /** + * 分包商查询审核列表 + */ + TableDataInfo fbsAuditPageList(FbsWageAuditListDTO dto); + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/bgt/service/impl/BgtWageApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/bgt/service/impl/BgtWageApplicationServiceImpl.java index 4e8565a..4f67ed7 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/bgt/service/impl/BgtWageApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/bgt/service/impl/BgtWageApplicationServiceImpl.java @@ -19,7 +19,9 @@ import com.ruoyi.bgt.service.IBgtWageApplicationService; import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.utils.PageUtils; +import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.fbs.domain.FbsProjectTask; +import com.ruoyi.fbs.domain.dto.FbsWageAuditListDTO; import com.ruoyi.fbs.service.IFbsProjectTaskService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -151,4 +153,14 @@ public class BgtWageApplicationServiceImpl extends ServicePlusImpl appQueryList(BgtWageApplicationQueryDTO dto) { return baseMapper.appQueryList(dto); } + + @Override + public TableDataInfo fbsAuditPageList(FbsWageAuditListDTO dto) { + Page queryDTOPage = new Page<>(); + queryDTOPage.setCurrent(dto.getPageNum()); + queryDTOPage.setSize(dto.getPageSize()); + dto.setReviewerId(SecurityUtils.getAppUserId()); + Page queryVOPage = baseMapper.fbsAuditPageList(queryDTOPage, dto); + return PageUtils.buildDataInfo(queryVOPage); + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/common/constants/FbsMessageConstant.java b/ruoyi-system/src/main/java/com/ruoyi/common/constants/FbsMessageConstant.java new file mode 100644 index 0000000..268a249 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/common/constants/FbsMessageConstant.java @@ -0,0 +1,140 @@ +package com.ruoyi.common.constants; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class FbsMessageConstant { + // 公共常量 + + public static final String FBS_LARGE_TASK = "1"; //大类型-任务 + public static final String FBS_LARGE_SETTLEMENT = "2"; //大类型-结算 + public static final String FBS_LARGE_OTHER = "3"; //大类型-其它 + + public static final String FBS_SMALL_SIGN_UP = "1"; //小类型-包工头报名 + public static final String FBS_SMALL_PAY = "2"; //小类型-付款 + public static final String FBS_SMALL_LEAVE = "3"; //小类型-进度 + + public static final List AUDIT_TYPE = Arrays.asList("2", "3"); + /** + * ============================================分包商->包工头 模板================================================== + * ============================================分包商->包工头 模板================================================== + * ============================================分包商->包工头 模板================================================== + */ + + //任务审批 + public static final String FBS_SIGN_UP_APPLY_HEADLINE = "您申请的【%s】任务,已得到回复!"; + public static final String FBS_SIGN_UP_APPLY_SUBHEADING = "您申请的【%s】任务,审核人【%s】已%s!"; + //工资审批 + public static final String FBS_PAY_APPLY_HEADLINE = "您【%s】任务工资申请已审批!"; + public static final String FBS_PAY_APPLY_SUBHEADING = "您申请的【%s】任务工资,审核人【%s】已%s!"; + //进度审批 + public static final String FBS_PROGRESS_HEADLINE = "您【%s】任务的上传进度已审批!"; + public static final String FBS_PROGRESS_SUBHEADING = "您【%s】任务的上传进度,审核人【%s】已%s!"; + + + //分包商->包工头 消息类型 + public static final String FBS_TYPE_SIGN_UP = "1"; //包工头报名 + public static final String FBS_TYPE_PAY = "2"; //付款 + public static final String FBS_TYPE_PROGRESS = "3"; //进度 + + + + /** + * ============================================系统->分包商 模板================================================== + * ============================================系统->分包商 模板================================================== + * ============================================系统->分包商 模板================================================== + */ + //承接任务 + public static final String FBS_SUB_APPLY_HEADLINE = "您已成功申请【%s】项目【%s】分包"; + public static final String FBS_SUB_APPLY_SUBHEADING = "您已成功申请到【%s】项目【%s】分包,请耐心等待回复!"; + //取消承接任务 + public static final String FBS_TASK_APPLY_CANCEL_HEADLINE = "您已成功取消【%s】项目【%s】分包申请!"; + public static final String FBS_TASK_APPLY_CANCEL_SUBHEADING = "您已成功取消【%s】项目【%s】分包申请"; + //工资结算 + public static final String FBS_SETTLEMENT_APPLY_HEADLINE = "您正在申请【%s】项目【%s】分包,总共【%s】元的工资结算操作!"; + public static final String FBS_SETTLEMENT_APPLY_SUBHEADING = "您已成功发起金额为【%s】元的工资结算操作,请耐心等待回复!"; + + + //系统->包工头 消息类型 + public static final String FBS_TYPE_TASK = "4"; //任务报名 + public static final String FBS_TYPE_TASK_CANCEL = "5"; //任务取消 + public static final String FBS_TYPE_SETTLEMENT = "6"; //结算 + + + /** + * ============================================分包商->总包方 模板================================================== + * ============================================分包商->总包方 模板================================================== + * ============================================分包商->总包方 模板================================================== + */ + //承接任务 + public static final String FBS_TO_ZBF_APPLY_SUB_HEADLINE = "分包商【%s】正在向你申请承接【%s】项目【%s】分包!"; + public static final String FBS_TO_ZBF_APPLY_SUB_SUBHEADING = "分包商【%s】正在向你申请承接【%s】项目【%s】分包,您可点击查看更多信息!"; + //工资结算 + public static final String FBS_TO_ZBF_SETTLEMENT_APPLY_HEADLINE = "分包商【%s】正在向你发起工资结算!"; + public static final String FBS_TO_ZBF_SETTLEMENT_APPLY_SUBHEADING = "分包商【%s】向你发起金额为【%s】元的工资结算操作!"; + + //分包商->总包方 消息类型 + public static final String FBS_TYPE_SUB_TO_ZBF = "7"; //任务 + public static final String FBS_TYPE_SETTLEMEN_TO_FBGT = "8"; //结算 + + + /** + * ============================================调用方法================================================== + * ============================================调用方法================================================== + * ============================================调用方法================================================== + */ + //主副标志 + public static final String HEADLINE = "headline"; //主标题 + public static final String SUBHEADING = "subheading"; //副标题 + + //包工头消息返回 + public static Map bgtMessage(Map mp, String type, Boolean isPass) { + Map map = new HashMap<>(); + String pass = isPass ? "通过" : "拒绝"; + String projectName = mp.get("projectName"); + String subName = mp.get("subName"); + String auditor = mp.get("auditor"); + String amount = mp.get("amount"); + switch (type) { + case "1": + map.put(HEADLINE, String.format(FBS_SIGN_UP_APPLY_HEADLINE, projectName)); + map.put(SUBHEADING, String.format(FBS_SIGN_UP_APPLY_SUBHEADING, projectName, auditor, pass)); + break; + case "2": + map.put(HEADLINE, String.format(FBS_PAY_APPLY_HEADLINE, projectName)); + map.put(SUBHEADING, String.format(FBS_PAY_APPLY_SUBHEADING, projectName, auditor, pass)); + break; + case "3": + map.put(HEADLINE, String.format(FBS_PROGRESS_HEADLINE, projectName)); + map.put(SUBHEADING, String.format(FBS_PROGRESS_SUBHEADING, projectName, auditor, pass)); + break; + case "4": + map.put(HEADLINE, String.format(FBS_SUB_APPLY_HEADLINE, projectName,subName)); + map.put(SUBHEADING, String.format(FBS_SUB_APPLY_SUBHEADING, projectName,subName)); + break; + case "5": + map.put(HEADLINE, String.format(FBS_TASK_APPLY_CANCEL_HEADLINE, projectName,subName)); + map.put(SUBHEADING, String.format(FBS_TASK_APPLY_CANCEL_SUBHEADING, projectName,subName)); + break; + case "6": + map.put(HEADLINE, String.format(FBS_SETTLEMENT_APPLY_HEADLINE, projectName,subName,amount)); + map.put(SUBHEADING, String.format(FBS_SETTLEMENT_APPLY_SUBHEADING, amount)); + break; + case "7": + map.put(HEADLINE, String.format(FBS_TO_ZBF_APPLY_SUB_HEADLINE, auditor, projectName,subName)); + map.put(SUBHEADING, String.format(FBS_TO_ZBF_APPLY_SUB_SUBHEADING, auditor, projectName,subName)); + break; + case "8": + map.put(HEADLINE, String.format(FBS_TO_ZBF_SETTLEMENT_APPLY_HEADLINE, auditor)); + map.put(SUBHEADING, String.format(FBS_TO_ZBF_SETTLEMENT_APPLY_SUBHEADING, auditor,amount)); + break; + default: + break; + } + return map; + } + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/fbs/bo/FbsMessageQueryBo.java b/ruoyi-system/src/main/java/com/ruoyi/fbs/bo/FbsMessageQueryBo.java new file mode 100644 index 0000000..decf086 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/fbs/bo/FbsMessageQueryBo.java @@ -0,0 +1,79 @@ +package com.ruoyi.fbs.bo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.LocalDate; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 消息分页查询对象 fbs_message + * + * @author ruoyi + * @date 2025-03-28 + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel("消息分页查询对象") +public class FbsMessageQueryBo extends BaseEntity { + + /** 分页大小 */ + @ApiModelProperty("分页大小") + private Integer pageSize; + /** 当前页数 */ + @ApiModelProperty("当前页数") + private Integer pageNum; + /** 排序列 */ + @ApiModelProperty("排序列") + private String orderByColumn; + /** 排序的方向desc或者asc */ + @ApiModelProperty(value = "排序的方向", example = "asc,desc") + private String isAsc; + + + /** 发送类型(0系统 1务工者 2包工头 3分包商 4总包方) */ + @ApiModelProperty("发送类型(0系统 1务工者 2包工头 3分包商 4总包方)") + private String senderType; + /** 发送人 */ + @ApiModelProperty("发送人") + private Long senderId; + /** 接收类型(1务工者 2包工头 3分包商 4总包方) */ + @ApiModelProperty("接收类型(1务工者 2包工头 3分包商 4总包方)") + private String recipientType; + /** 接收人 */ + @ApiModelProperty("接收人") + private Long recipientId; + /** 标题 */ + @ApiModelProperty("标题") + private String headline; + /** 副标题 */ + @ApiModelProperty("副标题") + private String subheading; + /** 表ID */ + @ApiModelProperty("表ID") + private Long tableId; + /** 表名 */ + @ApiModelProperty("表名") + private String tableName; + /** 大类型(字典bgt_message_large_type) */ + @ApiModelProperty("大类型(字典bgt_message_large_type)") + private String messageLargeType; + /** 小类型(字典bgt_message_small_type) */ + @ApiModelProperty("小类型(字典bgt_message_small_type)") + private String messageSmallType; + /** 读状态(0未读 1已读) */ + @ApiModelProperty("读状态(0未读 1已读)") + private String readStatus; + /** 是否需要操作(0不需要 1需要 2已操作) */ + @ApiModelProperty("是否需要操作(0不需要 1需要 2已操作)") + private String isOperation; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/fbs/domain/FbsMessage.java b/ruoyi-system/src/main/java/com/ruoyi/fbs/domain/FbsMessage.java new file mode 100644 index 0000000..0db4f41 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/fbs/domain/FbsMessage.java @@ -0,0 +1,133 @@ +package com.ruoyi.fbs.domain; + +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.time.LocalDateTime; +import java.time.LocalTime; +import java.time.LocalDate; + +/** + * 消息对象 fbs_message + * + * @author ruoyi + * @date 2025-03-28 + */ +@Data +@NoArgsConstructor +@Accessors(chain = true) +@TableName("fbs_message") +@ApiModel("消息视图对象") +public class FbsMessage implements Serializable { + + private static final long serialVersionUID=1L; + + /** 主键自增ID */ + @ApiModelProperty("主键自增ID") + @TableId(value = "id") + private Long id; + + /** 发送类型(0系统 1务工者 2包工头 3分包商 4总包方) */ + @Excel(name = "发送类型" , readConverterExp = "0=系统,1=务工者,2=包工头,3=分包商,4=总包方") + @ApiModelProperty("发送类型(0系统 1务工者 2包工头 3分包商 4总包方)") + private String senderType; + + /** 发送人 */ + @Excel(name = "发送人") + @ApiModelProperty("发送人") + private Long senderId; + + /** 接收类型(1务工者 2包工头 3分包商 4总包方) */ + @Excel(name = "接收类型" , readConverterExp = "1=务工者,2=包工头,3=分包商,4=总包方") + @ApiModelProperty("接收类型(1务工者 2包工头 3分包商 4总包方)") + private String recipientType; + + /** 接收人 */ + @Excel(name = "接收人") + @ApiModelProperty("接收人") + private Long recipientId; + + /** 标题 */ + @Excel(name = "标题") + @ApiModelProperty("标题") + private String headline; + + /** 副标题 */ + @Excel(name = "副标题") + @ApiModelProperty("副标题") + private String subheading; + + /** 表ID */ + @Excel(name = "表ID") + @ApiModelProperty("表ID") + private Long tableId; + + /** 表名 */ + @Excel(name = "表名") + @ApiModelProperty("表名") + private String tableName; + + /** 大类型(字典bgt_message_large_type) */ + @Excel(name = "大类型" , readConverterExp = "字=典bgt_message_large_type") + @ApiModelProperty("大类型(字典bgt_message_large_type)") + private String messageLargeType; + + /** 小类型(字典bgt_message_small_type) */ + @Excel(name = "小类型" , readConverterExp = "字=典bgt_message_small_type") + @ApiModelProperty("小类型(字典bgt_message_small_type)") + private String messageSmallType; + + /** 读状态(0未读 1已读) */ + @Excel(name = "读状态" , readConverterExp = "0=未读,1=已读") + @ApiModelProperty("读状态(0未读 1已读)") + private String readStatus; + + /** 删除标志(0代表存在 2代表删除) */ + @Excel(name = "删除标志" , readConverterExp = "0=代表存在,2=代表删除") + @ApiModelProperty("删除标志(0代表存在 2代表删除)") + private String delFlag; + + /** 创建者 */ + @Excel(name = "创建者") + @ApiModelProperty("创建者") + @TableField(fill = FieldFill.INSERT) + private String createBy; + + /** 创建时间 */ + @Excel(name = "创建时间" , width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty("创建时间") + @TableField(fill = FieldFill.INSERT) + private LocalDateTime createTime; + + /** 更新者 */ + @Excel(name = "更新者") + @ApiModelProperty("更新者") + @TableField(fill = FieldFill.INSERT_UPDATE) + private String updateBy; + + /** 更新时间 */ + @Excel(name = "更新时间" , width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty("更新时间") + @TableField(fill = FieldFill.INSERT_UPDATE) + private LocalDateTime updateTime; + + /** 备注 */ + @Excel(name = "备注") + @ApiModelProperty("备注") + private String remark; + + /** 是否需要操作(0不需要 1需要 2已操作) */ + @Excel(name = "是否需要操作" , readConverterExp = "0=不需要,1=需要,2=已操作") + @ApiModelProperty("是否需要操作(0不需要 1需要 2已操作)") + private String isOperation; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/fbs/domain/FbsWageApplication.java b/ruoyi-system/src/main/java/com/ruoyi/fbs/domain/FbsWageApplication.java index d2d480b..8827ca1 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/fbs/domain/FbsWageApplication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/fbs/domain/FbsWageApplication.java @@ -1,9 +1,7 @@ package com.ruoyi.fbs.domain; -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.common.annotation.Excel; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -32,7 +30,7 @@ public class FbsWageApplication implements Serializable { /** 主键ID */ @ApiModelProperty("主键ID") - @TableId(value = "id") + @TableId(value = "id", type = IdType.AUTO) private Long id; /** 项目ID */ @@ -98,6 +96,7 @@ public class FbsWageApplication implements Serializable { /** 申请时间 */ @Excel(name = "申请时间" , width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") @ApiModelProperty("申请时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") private LocalDateTime applyTime; /** 用工情况 */ diff --git a/ruoyi-system/src/main/java/com/ruoyi/fbs/domain/dto/FbsMessageDetailDTO.java b/ruoyi-system/src/main/java/com/ruoyi/fbs/domain/dto/FbsMessageDetailDTO.java new file mode 100644 index 0000000..226c09a --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/fbs/domain/dto/FbsMessageDetailDTO.java @@ -0,0 +1,46 @@ +package com.ruoyi.fbs.domain.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDate; + +/** + * 消息对象 bgt_message + * + * @author ruoyi + * @date 2025-02-25 + */ +@Data +@NoArgsConstructor +@Accessors(chain = true) +@ApiModel("分包商消息详情查询对象") +public class FbsMessageDetailDTO { + + /** 分页大小 */ + @ApiModelProperty("分页大小") + private Integer pageSize; + /** 当前页数 */ + @ApiModelProperty("当前页数") + private Integer pageNum; + + @ApiModelProperty("日期") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd") + private LocalDate date; + + @ApiModelProperty("大类型(字典bgt_message_large_type)") + private String messageLargeType; + + @ApiModelProperty("小类型(字典bgt_message_small_type)") + private String messageSmallType; + + @ApiModelProperty("是否待处理") + private Boolean isHandle = false; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/fbs/domain/dto/FbsMessageMyListDTO.java b/ruoyi-system/src/main/java/com/ruoyi/fbs/domain/dto/FbsMessageMyListDTO.java new file mode 100644 index 0000000..8f37b9d --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/fbs/domain/dto/FbsMessageMyListDTO.java @@ -0,0 +1,28 @@ +package com.ruoyi.fbs.domain.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +/** + * 消息对象 bgt_message + * + * @author ruoyi + * @date 2025-02-25 + */ +@Data +@NoArgsConstructor +@Accessors(chain = true) +@ApiModel("消息列表查询对象") +public class FbsMessageMyListDTO { + + /** 分页大小 */ + @ApiModelProperty("分页大小") + private Integer pageSize; + /** 当前页数 */ + @ApiModelProperty("当前页数") + private Integer pageNum; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/fbs/domain/dto/FbsProjectSectionListDTO.java b/ruoyi-system/src/main/java/com/ruoyi/fbs/domain/dto/FbsProjectSectionListDTO.java new file mode 100644 index 0000000..dcb29d3 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/fbs/domain/dto/FbsProjectSectionListDTO.java @@ -0,0 +1,23 @@ +package com.ruoyi.fbs.domain.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel("分包商项目列表查询条件") +public class FbsProjectSectionListDTO { + + @ApiModelProperty("分页大小") + private Integer pageSize; + /** 当前页数 */ + @ApiModelProperty("当前页数") + private Integer pageNum; + + @ApiModelProperty("项目Id") + private Long projectId; + + @ApiModelProperty(value = "分包商Id",hidden = true) + private Long fbsUserId; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/fbs/domain/dto/FbsWageAuditDTO.java b/ruoyi-system/src/main/java/com/ruoyi/fbs/domain/dto/FbsWageAuditDTO.java new file mode 100644 index 0000000..ca62dc2 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/fbs/domain/dto/FbsWageAuditDTO.java @@ -0,0 +1,28 @@ +package com.ruoyi.fbs.domain.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * 包工头工资申请分页查询对象 bgt_wage_application + * + * @author ruoyi + * @date 2025-02-20 + */ + +@Data +@ApiModel("App包工头工资申请分页查询对象") +public class FbsWageAuditDTO { + + @ApiModelProperty("主键ID") + @NotNull(message = "主键ID不能为空") + private Long id; + + @ApiModelProperty("审核状态(1审核中 2已审核 3未通过)") + private String auditStatus; + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/fbs/domain/dto/FbsWageAuditListDTO.java b/ruoyi-system/src/main/java/com/ruoyi/fbs/domain/dto/FbsWageAuditListDTO.java new file mode 100644 index 0000000..ee5e769 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/fbs/domain/dto/FbsWageAuditListDTO.java @@ -0,0 +1,41 @@ +package com.ruoyi.fbs.domain.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 包工头工资申请分页查询对象 bgt_wage_application + * + * @author ruoyi + * @date 2025-02-20 + */ + +@Data +@ApiModel("App包工头工资申请分页查询对象") +public class FbsWageAuditListDTO { + + /** 分页大小 */ + @ApiModelProperty("分页大小") + private Integer pageSize; + /** 当前页数 */ + @ApiModelProperty("当前页数") + private Integer pageNum; + + @ApiModelProperty("任务ID") + private Long taskId; + + @ApiModelProperty("任务名") + private String taskName; + /** 申请人ID */ + @ApiModelProperty("审核人ID") + private Long reviewerId; + /** 审核状态(1审核中 2已审核 3未审核) */ +// @ApiModelProperty("审核状态(1审核中 2已审核 3未通过)") +// private String auditStatus; + + @ApiModelProperty("筛选(1申请中 2已结算)") + private Integer type; + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/fbs/domain/vo/FbsMessageCountVO.java b/ruoyi-system/src/main/java/com/ruoyi/fbs/domain/vo/FbsMessageCountVO.java new file mode 100644 index 0000000..39141b8 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/fbs/domain/vo/FbsMessageCountVO.java @@ -0,0 +1,36 @@ +package com.ruoyi.fbs.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 FbsMessageCountVO implements Serializable { + + private static final long serialVersionUID=1L; + + @ApiModelProperty("申请消息") + private Integer taskMessageCount; + + @ApiModelProperty("结算消息") + private Integer settlementMessageCount; + + @ApiModelProperty("其他消息") + private Integer otherMessageCount; + + @ApiModelProperty("待处理消息") + private Integer handleMessageCount; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/fbs/domain/vo/FbsMessageDetailVO.java b/ruoyi-system/src/main/java/com/ruoyi/fbs/domain/vo/FbsMessageDetailVO.java new file mode 100644 index 0000000..84410cc --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/fbs/domain/vo/FbsMessageDetailVO.java @@ -0,0 +1,58 @@ +package com.ruoyi.fbs.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 FbsMessageDetailVO implements Serializable { + + private static final long serialVersionUID=1L; + + @ApiModelProperty("主键自增ID") + private Long id; + + @ApiModelProperty("发送人") + @JsonFormat(shape = JsonFormat.Shape.STRING) + private Long senderId; + + @ApiModelProperty("表ID") + private Long tableId; + + @ApiModelProperty("标题") + private String headline; + + @ApiModelProperty("副标题") + private String subheading; + + @ApiModelProperty("大类型(字典bgt_message_large_type)") + private String messageLargeType; + + @ApiModelProperty("小类型(字典bgt_message_small_type)") + private String messageSmallType; + + @ApiModelProperty("读状态(0未读 1已读)") + private String readStatus; + + @ApiModelProperty("创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + private LocalDateTime createTime; + + @ApiModelProperty("是否需要操作(0不需要 1需要 2已操作)") + private String isOperation ; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/fbs/domain/vo/FbsMessageVO.java b/ruoyi-system/src/main/java/com/ruoyi/fbs/domain/vo/FbsMessageVO.java new file mode 100644 index 0000000..00a2117 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/fbs/domain/vo/FbsMessageVO.java @@ -0,0 +1,55 @@ +package com.ruoyi.fbs.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 FbsMessageVO implements Serializable { + + private static final long serialVersionUID=1L; + + @ApiModelProperty("主键自增ID") + private Long id; + + @ApiModelProperty("表ID") + private Long tableId; + + @ApiModelProperty("发送人") + @JsonFormat(shape = JsonFormat.Shape.STRING) + private Long senderId; + + @ApiModelProperty("标题") + private String headline; + + @ApiModelProperty("副标题") + private String subheading; + + @ApiModelProperty("大类型(字典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; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/fbs/mapper/FbsMessageMapper.java b/ruoyi-system/src/main/java/com/ruoyi/fbs/mapper/FbsMessageMapper.java new file mode 100644 index 0000000..653a52e --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/fbs/mapper/FbsMessageMapper.java @@ -0,0 +1,18 @@ +package com.ruoyi.fbs.mapper; + +import com.ruoyi.fbs.domain.FbsMessage; +import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus; +import com.ruoyi.common.core.mybatisplus.cache.MybatisPlusRedisCache; +import org.apache.ibatis.annotations.CacheNamespace; + +/** + * 消息Mapper接口 + * + * @author ruoyi + * @date 2025-03-28 + */ +// 如使需切换数据源 请勿使用缓存 会造成数据不一致现象 +@CacheNamespace(implementation = MybatisPlusRedisCache.class, eviction = MybatisPlusRedisCache.class) +public interface FbsMessageMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/fbs/service/IFbsMessageService.java b/ruoyi-system/src/main/java/com/ruoyi/fbs/service/IFbsMessageService.java new file mode 100644 index 0000000..3d25e8e --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/fbs/service/IFbsMessageService.java @@ -0,0 +1,75 @@ +package com.ruoyi.fbs.service; + +import com.ruoyi.common.core.mybatisplus.core.IServicePlus; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.fbs.bo.FbsMessageQueryBo; +import com.ruoyi.fbs.domain.FbsMessage; +import com.ruoyi.fbs.domain.dto.FbsMessageDetailDTO; +import com.ruoyi.fbs.domain.dto.FbsMessageMyListDTO; +import com.ruoyi.fbs.domain.vo.FbsMessageCountVO; +import com.ruoyi.fbs.domain.vo.FbsMessageDetailVO; +import com.ruoyi.fbs.domain.vo.FbsMessageVO; + +import java.util.Collection; +import java.util.List; + +/** + * 消息Service接口 + * + * @author ruoyi + * @date 2025-03-28 + */ +public interface IFbsMessageService extends IServicePlus { + /** + * 查询单个 + * @return + */ + FbsMessage queryById(Long id); + + /** + * 查询列表 + */ + TableDataInfo queryPageList(FbsMessageQueryBo bo); + + /** + * 查询列表 + */ + List queryList(FbsMessageQueryBo bo); + + /** + * 根据新增业务对象插入消息 + * @param bo 消息新增业务对象 + * @return + */ + Boolean insert(FbsMessage bo); + + /** + * 根据编辑业务对象修改消息 + * @param bo 消息编辑业务对象 + * @return + */ + Boolean update(FbsMessage bo); + + /** + * 校验并删除数据 + * @param ids 主键集合 + * @param isValid 是否校验,true-删除前校验,false-不校验 + * @return + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); + + /** + * 分包商的未读消息统计 + */ + FbsMessageCountVO countUnread(); + + /** + * 分包商的消息列表 + */ + TableDataInfo queryMyPageList(FbsMessageMyListDTO dto); + + /** + * 消息详情列表 + */ + TableDataInfo queryDetailPageList(FbsMessageDetailDTO dto); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/fbs/service/impl/FbsMessageServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/fbs/service/impl/FbsMessageServiceImpl.java new file mode 100644 index 0000000..3453d14 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/fbs/service/impl/FbsMessageServiceImpl.java @@ -0,0 +1,207 @@ +package com.ruoyi.fbs.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.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.fbs.bo.FbsMessageQueryBo; +import com.ruoyi.fbs.domain.FbsMessage; +import com.ruoyi.fbs.domain.dto.FbsMessageDetailDTO; +import com.ruoyi.fbs.domain.dto.FbsMessageMyListDTO; +import com.ruoyi.fbs.domain.vo.FbsMessageCountVO; +import com.ruoyi.fbs.domain.vo.FbsMessageDetailVO; +import com.ruoyi.fbs.domain.vo.FbsMessageVO; +import com.ruoyi.fbs.mapper.FbsMessageMapper; +import com.ruoyi.fbs.service.IFbsMessageService; +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.WgzAndBgtMessageConstant.OPERATION_NEED; + +/** + * 消息Service业务层处理 + * + * @author ruoyi + * @date 2025-03-28 + */ +@Service +public class FbsMessageServiceImpl extends ServicePlusImpl implements IFbsMessageService { + + @Override + public FbsMessage queryById(Long id){ + return getById(id); + } + + @Override + public TableDataInfo queryPageList(FbsMessageQueryBo bo) { + Page result = page(PageUtils.buildPage(), buildQueryWrapper(bo)); + return PageUtils.buildDataInfo(result); + } + + @Override + public List queryList(FbsMessageQueryBo bo) { + return list(buildQueryWrapper(bo)); + } + + private LambdaQueryWrapper buildQueryWrapper(FbsMessageQueryBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(StrUtil.isNotBlank(bo.getSenderType()), FbsMessage::getSenderType, bo.getSenderType()); + lqw.eq(bo.getSenderId() != null, FbsMessage::getSenderId, bo.getSenderId()); + lqw.eq(StrUtil.isNotBlank(bo.getRecipientType()), FbsMessage::getRecipientType, bo.getRecipientType()); + lqw.eq(bo.getRecipientId() != null, FbsMessage::getRecipientId, bo.getRecipientId()); + lqw.eq(StrUtil.isNotBlank(bo.getHeadline()), FbsMessage::getHeadline, bo.getHeadline()); + lqw.eq(StrUtil.isNotBlank(bo.getSubheading()), FbsMessage::getSubheading, bo.getSubheading()); + lqw.eq(bo.getTableId() != null, FbsMessage::getTableId, bo.getTableId()); + lqw.like(StrUtil.isNotBlank(bo.getTableName()), FbsMessage::getTableName, bo.getTableName()); + lqw.eq(StrUtil.isNotBlank(bo.getMessageLargeType()), FbsMessage::getMessageLargeType, bo.getMessageLargeType()); + lqw.eq(StrUtil.isNotBlank(bo.getMessageSmallType()), FbsMessage::getMessageSmallType, bo.getMessageSmallType()); + lqw.eq(StrUtil.isNotBlank(bo.getReadStatus()), FbsMessage::getReadStatus, bo.getReadStatus()); + lqw.eq(StrUtil.isNotBlank(bo.getIsOperation()), FbsMessage::getIsOperation, bo.getIsOperation()); + return lqw; + } + + @Override + public Boolean insert(FbsMessage bo) { + FbsMessage add = BeanUtil.toBean(bo, FbsMessage.class); + validEntityBeforeSave(add); + return save(add); + } + + @Override + public Boolean update(FbsMessage bo) { + FbsMessage update = BeanUtil.toBean(bo, FbsMessage.class); + validEntityBeforeSave(update); + return updateById(update); + } + + /** + * 保存前的数据校验 + * + * @param entity 实体类数据 + */ + private void validEntityBeforeSave(FbsMessage entity){ + //TODO 做一些数据校验,如唯一约束 + } + + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return removeByIds(ids); + } + + @Override + public FbsMessageCountVO countUnread() { + List fbsMessages = baseMapper.selectList(Wrappers.lambdaQuery() + .eq(FbsMessage::getRecipientId, SecurityUtils.getAppUserId()) + .eq(FbsMessage::getReadStatus, "0")); + Map map = fbsMessages.stream().collect(Collectors.groupingBy(FbsMessage::getMessageLargeType, Collectors.counting())); + + FbsMessageCountVO fbsMessageCountVO = new FbsMessageCountVO(); + fbsMessageCountVO.setTaskMessageCount(map.getOrDefault(BgtMessageType.TASK.getCode(), 0L).intValue()); + fbsMessageCountVO.setSettlementMessageCount(map.getOrDefault(BgtMessageType.SETTLEMENT.getCode(), 0L).intValue()); + fbsMessageCountVO.setOtherMessageCount(map.getOrDefault(BgtMessageType.OTHER.getCode(), 0L).intValue()); + + Integer handle = baseMapper.selectCount(Wrappers.lambdaQuery() + .eq(FbsMessage::getRecipientId, SecurityUtils.getAppUserId()) + .eq(FbsMessage::getIsOperation, OPERATION_NEED)); + fbsMessageCountVO.setHandleMessageCount(handle); + return fbsMessageCountVO; + } + + @Override + public TableDataInfo queryMyPageList(FbsMessageMyListDTO dto) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(FbsMessage::getRecipientId, SecurityUtils.getAppUserId()); + wrapper.orderByDesc(FbsMessage::getCreateTime); + Page result = page(PageUtils.buildPage(), wrapper); + Page fbsMessageVOPage = new Page<>(); + fbsMessageVOPage.setTotal(result.getTotal()); + fbsMessageVOPage.setRecords(BeanUtil.copyToList(result.getRecords(), FbsMessageVO.class)); + return PageUtils.buildDataInfo(fbsMessageVOPage); + } + + + @Override + public TableDataInfo queryDetailPageList(FbsMessageDetailDTO dto) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(FbsMessage::getRecipientId, SecurityUtils.getAppUserId()); + wrapper.eq(StrUtil.isNotBlank(dto.getMessageLargeType()), FbsMessage::getMessageLargeType, dto.getMessageLargeType()); + wrapper.eq(StrUtil.isNotBlank(dto.getMessageSmallType()), FbsMessage::getMessageSmallType, dto.getMessageSmallType()); + wrapper.eq(dto.getIsHandle(), FbsMessage::getIsOperation,OPERATION_NEED); + if(dto.getDate() != null) { + wrapper.between(FbsMessage::getCreateTime, dto.getDate().atStartOfDay(), dto.getDate().atStartOfDay().with(LocalTime.MAX)); + } + wrapper.orderByDesc(FbsMessage::getId); + Page result = page(PageUtils.buildPage(), wrapper); + Page page = new Page<>(); + page.setTotal(result.getTotal()); + + ArrayList fbsMessageDetailVOS = new ArrayList<>(); + + for (FbsMessage message : result.getRecords()) { + FbsMessageDetailVO fbsMessageDetailVO = BeanUtil.copyProperties(message, FbsMessageDetailVO.class); +// if (BGT_LARGE_TASK.equals(message.getMessageLargeType())) { +// FbsProjectTask task = taskService.getById(message.getTableId()); +// bgtMessageDetailVO.setTaskName(task.getTaskName()); +// } else if (BGT_LARGE_SETTLEMENT.equals(message.getMessageLargeType())) { +// BgtWageApplication wageApplication = wageApplicationService.getById(message.getTableId()); +// FbsProjectTask task = taskService.getById(wageApplication.getTaskId()); +// bgtMessageDetailVO.setTaskName(task.getTaskName()); +// } 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.findByUserId(wgzLeave.getUserId()).getUsername()); +// bgtMessageDetailVO.setStartTime(wgzLeave.getStartTime()); +// bgtMessageDetailVO.setEndTime(wgzLeave.getEndTime()); +// break; +// case BGT_SMALL_MAKE_UP: +// WgzReissueacard reissueCard = reissueacardService.getById(message.getTableId()); +// bgtMessageDetailVO.setReason(reissueCard.getReason()); +// bgtMessageDetailVO.setUsername(wgzUserService.findByUserId(reissueCard.getUserId()).getUsername()); +// bgtMessageDetailVO.setNowTime(reissueCard.getNowTime()); +// break; +// case BGT_SMALL_REPORT_MAKE_UP: +// WgzDailyClock dailyClock = dailyClockService.getById(message.getTableId()); +// BgtProjectRecruit recruitClock = recruitService.getById(dailyClock.getRecruitId()); +// bgtMessageDetailVO.setUsername(wgzUserService.findByUserId(dailyClock.getUserId()).getUsername()); +// bgtMessageDetailVO.setRecruitName(recruitClock.getRecruitName()); +// break; +// default: +// break; +// } +// } + fbsMessageDetailVOS.add(fbsMessageDetailVO); + } + page.setRecords(fbsMessageDetailVOS); + return PageUtils.buildDataInfo(page); + } + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/zbf/domain/ZbfProjectSubcontractingApply.java b/ruoyi-system/src/main/java/com/ruoyi/zbf/domain/ZbfProjectSubcontractingApply.java index ae3932d..93309fa 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/zbf/domain/ZbfProjectSubcontractingApply.java +++ b/ruoyi-system/src/main/java/com/ruoyi/zbf/domain/ZbfProjectSubcontractingApply.java @@ -1,9 +1,6 @@ package com.ruoyi.zbf.domain; -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.*; import com.ruoyi.common.annotation.Excel; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -31,7 +28,7 @@ public class ZbfProjectSubcontractingApply implements Serializable { /** 主键ID */ @ApiModelProperty("主键ID") - @TableId(value = "id") + @TableId(value = "id", type = IdType.AUTO) private Long id; /** 项目ID */ diff --git a/ruoyi-system/src/main/java/com/ruoyi/zbf/mapper/ZbfProjectSectionMapper.java b/ruoyi-system/src/main/java/com/ruoyi/zbf/mapper/ZbfProjectSectionMapper.java index 922b150..cd5ba8d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/zbf/mapper/ZbfProjectSectionMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/zbf/mapper/ZbfProjectSectionMapper.java @@ -1,10 +1,14 @@ package com.ruoyi.zbf.mapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.common.core.mybatisplus.cache.MybatisPlusRedisCache; import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus; +import com.ruoyi.fbs.domain.dto.FbsProjectSectionListDTO; +import com.ruoyi.fbs.domain.vo.FbsProjectSectionListVO; import com.ruoyi.zbf.domain.ZbfProjectSection; import org.apache.ibatis.annotations.CacheNamespace; +import org.apache.ibatis.annotations.Param; /** * 总包方项目标段Mapper接口 @@ -16,4 +20,7 @@ import org.apache.ibatis.annotations.CacheNamespace; @CacheNamespace(implementation = MybatisPlusRedisCache.class, eviction = MybatisPlusRedisCache.class) public interface ZbfProjectSectionMapper extends BaseMapperPlus { + // 查询分包商已加入的项目标段 + Page joinSectionList(@Param("page") Page page, @Param("dto") FbsProjectSectionListDTO dto); + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/zbf/service/IZbfProjectSectionService.java b/ruoyi-system/src/main/java/com/ruoyi/zbf/service/IZbfProjectSectionService.java index 5ef4cb7..c5c4928 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/zbf/service/IZbfProjectSectionService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/zbf/service/IZbfProjectSectionService.java @@ -3,6 +3,8 @@ package com.ruoyi.zbf.service; import com.ruoyi.common.core.mybatisplus.core.IServicePlus; import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.fbs.domain.dto.FbsProjectSectionListDTO; +import com.ruoyi.fbs.domain.vo.FbsProjectSectionListVO; import com.ruoyi.zbf.bo.ZbfProjectSectionQueryBo; import com.ruoyi.zbf.domain.ZbfProjectSection; @@ -53,4 +55,10 @@ public interface IZbfProjectSectionService extends IServicePlus ids, Boolean isValid); + + + /** + * 分包商查询自己的项目分包列表 + */ + TableDataInfo fbsSubList(FbsProjectSectionListDTO dto) ; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/zbf/service/impl/ZbfProjectSectionServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/zbf/service/impl/ZbfProjectSectionServiceImpl.java index 4a26b52..3ca1854 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/zbf/service/impl/ZbfProjectSectionServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/zbf/service/impl/ZbfProjectSectionServiceImpl.java @@ -8,12 +8,20 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.utils.PageUtils; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.fbs.domain.dto.FbsProjectSectionListDTO; +import com.ruoyi.fbs.domain.vo.FbsProjectSectionListVO; +import com.ruoyi.fbs.domain.vo.FbsProjectSubcontractingListVO; import com.ruoyi.zbf.bo.ZbfProjectSectionQueryBo; import com.ruoyi.zbf.domain.ZbfProjectSection; +import com.ruoyi.zbf.domain.ZbfProjectSubcontracting; import com.ruoyi.zbf.mapper.ZbfProjectSectionMapper; import com.ruoyi.zbf.service.IZbfProjectSectionService; +import com.ruoyi.zbf.service.IZbfProjectSubcontractingService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Map; @@ -27,6 +35,9 @@ import java.util.Map; @Service public class ZbfProjectSectionServiceImpl extends ServicePlusImpl implements IZbfProjectSectionService { + @Autowired + private IZbfProjectSubcontractingService zbfProjectSubcontractingService; + @Override public ZbfProjectSection queryById(Long id){ return getById(id); @@ -82,4 +93,31 @@ public class ZbfProjectSectionServiceImpl extends ServicePlusImpl fbsSubList(FbsProjectSectionListDTO dto) { + Page queryDTOPage = new Page<>(); + queryDTOPage.setCurrent(dto.getPageNum()); + queryDTOPage.setSize(dto.getPageSize()); + dto.setFbsUserId(SecurityUtils.getAppUserId()); + Page queryVOPage = baseMapper.joinSectionList(queryDTOPage, dto); + + for (FbsProjectSectionListVO sectionListVO : queryVOPage.getRecords()){ + //分包处理 + List subListVO = new ArrayList<>(); + //查询标段下的所有已承接的分包 + List subList = zbfProjectSubcontractingService.list(Wrappers.lambdaQuery() + .eq(ZbfProjectSubcontracting::getSectionId, sectionListVO.getId()) + .eq(ZbfProjectSubcontracting::getUserId, SecurityUtils.getAppUserId())); + + for (ZbfProjectSubcontracting sub : subList){ + FbsProjectSubcontractingListVO fbsProjectSubcontractingListVO = new FbsProjectSubcontractingListVO(); + BeanUtil.copyProperties(sub, fbsProjectSubcontractingListVO); + subListVO.add(fbsProjectSubcontractingListVO); + } + sectionListVO.setSubList(subListVO); + } + + return PageUtils.buildDataInfo(queryVOPage); + } } diff --git a/ruoyi-system/src/main/resources/mapper/bgt/BgtWageApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/bgt/BgtWageApplicationMapper.xml index f7f76a2..9d19d06 100644 --- a/ruoyi-system/src/main/resources/mapper/bgt/BgtWageApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/bgt/BgtWageApplicationMapper.xml @@ -30,7 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" bwa.task_staff_num, bwa.task_address, bwa.applicant_amount, - bwa.create_time, + bwa.apply_time, bwa.id, bwa.username, bwa.project_name, @@ -73,5 +73,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" order by bwa.create_time desc + diff --git a/ruoyi-system/src/main/resources/mapper/fbs/FbsMessageMapper.xml b/ruoyi-system/src/main/resources/mapper/fbs/FbsMessageMapper.xml new file mode 100644 index 0000000..f8218db --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/fbs/FbsMessageMapper.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wgz/WgzLeaveMapper.xml b/ruoyi-system/src/main/resources/mapper/wgz/WgzLeaveMapper.xml index 52e7f0d..29a4785 100644 --- a/ruoyi-system/src/main/resources/mapper/wgz/WgzLeaveMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wgz/WgzLeaveMapper.xml @@ -67,7 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and a.auditor_type = #{dto.auditorType} - + and a.auditor_type in (0,1,2,3) diff --git a/ruoyi-system/src/main/resources/mapper/zbf/ZbfProjectSectionMapper.xml b/ruoyi-system/src/main/resources/mapper/zbf/ZbfProjectSectionMapper.xml index 4b2daa1..1080c4d 100644 --- a/ruoyi-system/src/main/resources/mapper/zbf/ZbfProjectSectionMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/zbf/ZbfProjectSectionMapper.xml @@ -17,5 +17,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + diff --git a/ruoyi/uploadPath/appResource/recruitDefault.png b/ruoyi/uploadPath/appResource/recruitDefault.png new file mode 100644 index 0000000..134310a Binary files /dev/null and b/ruoyi/uploadPath/appResource/recruitDefault.png differ