diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/contractor/controller/app/SubConstructionUserAppController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/contractor/controller/app/SubConstructionUserAppController.java index a50979db..e5333663 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/contractor/controller/app/SubConstructionUserAppController.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/contractor/controller/app/SubConstructionUserAppController.java @@ -1,12 +1,16 @@ package org.dromara.contractor.controller.app; import jakarta.annotation.Resource; +import jakarta.validation.constraints.NotNull; import org.dromara.common.core.domain.R; import org.dromara.common.log.annotation.Log; import org.dromara.common.log.enums.BusinessType; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.common.mybatis.core.page.TableDataInfo; import org.dromara.common.satoken.utils.LoginHelper; import org.dromara.contractor.domain.SubConstructionUser; import org.dromara.contractor.domain.dto.constructionuser.SubConstructionUserAuthenticationReq; +import org.dromara.contractor.domain.dto.constructionuser.SubConstructionUserQueryReq; import org.dromara.contractor.domain.vo.constructionuser.SubConstructionUserOrcBankVo; import org.dromara.contractor.domain.vo.constructionuser.SubConstructionUserOrcIdCardVo; import org.dromara.contractor.domain.vo.constructionuser.SubConstructionUserVo; @@ -29,6 +33,14 @@ public class SubConstructionUserAppController { @Resource private ISubConstructionUserService constructionUserService; + /** + * 查询施工人员列表 + */ + @GetMapping("/list") + public TableDataInfo queryList(SubConstructionUserQueryReq req, PageQuery pageQuery) { + return constructionUserService.queryPageList(req, pageQuery); + } + /** * 获取当前登录用户实名信息 */ @@ -38,6 +50,15 @@ public class SubConstructionUserAppController { return R.ok(constructionUserService.getVo(constructionUser)); } + /** + * 根据id查询施工人员信息 + */ + @GetMapping("/{id}") + public R queryById(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(constructionUserService.queryById(id)); + } + /** * 根据身份证图片获取身份证信息 */ diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/contractor/domain/dto/constructionuser/SubConstructionUserQueryReq.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/contractor/domain/dto/constructionuser/SubConstructionUserQueryReq.java index 94c1587b..75dba85b 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/contractor/domain/dto/constructionuser/SubConstructionUserQueryReq.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/contractor/domain/dto/constructionuser/SubConstructionUserQueryReq.java @@ -4,6 +4,7 @@ import lombok.Data; import java.io.Serial; import java.io.Serializable; +import java.time.LocalDate; /** * @author lilemy @@ -85,4 +86,9 @@ public class SubConstructionUserQueryReq implements Serializable { */ private String notUserRole; + /** + * 入场时间 + */ + private LocalDate entryDate; + } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/contractor/service/impl/SubConstructionUserServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/contractor/service/impl/SubConstructionUserServiceImpl.java index b3f07149..1611d7da 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/contractor/service/impl/SubConstructionUserServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/contractor/service/impl/SubConstructionUserServiceImpl.java @@ -713,6 +713,7 @@ public class SubConstructionUserServiceImpl extends ServiceImpl addExitRecord(@Validated @RequestBody BusConstructionUserExitCreateReq req) { + return toAjax(constructionUserExitService.addRecord(req)); + } + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/controller/app/BusProjectAppController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/controller/app/BusProjectAppController.java index ded4be99..035c650a 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/controller/app/BusProjectAppController.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/controller/app/BusProjectAppController.java @@ -12,6 +12,8 @@ import org.springframework.web.bind.annotation.RestController; import java.util.List; /** + * 项目 app 接口 + * * @author lilemy * @date 2025-07-24 15:14 */ diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/controller/app/BusProjectTeamAppController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/controller/app/BusProjectTeamAppController.java new file mode 100644 index 00000000..0cdd866d --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/controller/app/BusProjectTeamAppController.java @@ -0,0 +1,37 @@ +package org.dromara.project.controller.app; + +import jakarta.annotation.Resource; +import jakarta.validation.constraints.NotNull; +import org.dromara.common.core.domain.R; +import org.dromara.common.web.core.BaseController; +import org.dromara.project.domain.vo.projectteam.BusProjectTeamForemanVo; +import org.dromara.project.service.IBusProjectTeamService; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 项目班组 app 接口 + * + * @author lilemy + * @date 2025-09-02 09:57 + */ +@Validated +@RestController +@RequestMapping("/app/project/projectTeam") +public class BusProjectTeamAppController extends BaseController { + + @Resource + private IBusProjectTeamService projectTeamService; + + /** + * 根据id查询项目班组班组长信息列表 + */ + @GetMapping("/listForeman/{id}") + public R listForeman(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(projectTeamService.queryForemanListById(id)); + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/controller/app/BusProjectTeamMemberAppController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/controller/app/BusProjectTeamMemberAppController.java new file mode 100644 index 00000000..66926877 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/controller/app/BusProjectTeamMemberAppController.java @@ -0,0 +1,38 @@ +package org.dromara.project.controller.app; + +import jakarta.annotation.Resource; +import org.dromara.common.core.domain.R; +import org.dromara.common.web.core.BaseController; +import org.dromara.project.domain.dto.projectteammember.BusProjectTeamMemberQueryReq; +import org.dromara.project.domain.vo.projectteammember.BusProjectTeamMemberVo; +import org.dromara.project.service.IBusProjectTeamMemberService; +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; + +import java.util.List; + +/** + * 项目班组下的成员 app 接口 + * + * @author lilemy + * @date 2025-09-02 09:35 + */ +@Validated +@RestController +@RequestMapping("/app/project/projectTeamMember") +public class BusProjectTeamMemberAppController extends BaseController { + + @Resource + private IBusProjectTeamMemberService projectTeamMemberService; + + /** + * 查询项目班组下的成员列表 + */ + @GetMapping("/list") + public R> list(BusProjectTeamMemberQueryReq req) { + List list = projectTeamMemberService.queryList(req); + return R.ok(list); + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/BusConstructionUserExit.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/BusConstructionUserExit.java index 7669c079..0c83aa24 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/BusConstructionUserExit.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/BusConstructionUserExit.java @@ -58,9 +58,14 @@ public class BusConstructionUserExit implements Serializable { private Date leaveDate; /** - * 退场文件 + * 工资发放凭证 */ - private String path; + private String salaryVoucherFile; + + /** + * 工资结算确认书 + */ + private String salaryConfirmationFile; /** * 备注 diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/dto/constructionuserexit/BusConstructionUserExitCreateReq.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/dto/constructionuserexit/BusConstructionUserExitCreateReq.java new file mode 100644 index 00000000..fca27027 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/dto/constructionuserexit/BusConstructionUserExitCreateReq.java @@ -0,0 +1,37 @@ +package org.dromara.project.domain.dto.constructionuserexit; + +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; + +/** + * @author lilemy + * @date 2025-09-02 14:42 + */ +@Data +public class BusConstructionUserExitCreateReq implements Serializable { + + @Serial + private static final long serialVersionUID = -722474400854585360L; + + /** + * 主键id + */ + private Long userId; + + /** + * 工资发放凭证 + */ + private String salaryVoucherFile; + + /** + * 工资结算确认书 + */ + private String salaryConfirmationFile; + + /** + * 备注 + */ + private String remark; +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/dto/projectteammember/BusProjectTeamMemberExitReq.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/dto/projectteammember/BusProjectTeamMemberExitReq.java index c7f42da4..e3f90839 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/dto/projectteammember/BusProjectTeamMemberExitReq.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/dto/projectteammember/BusProjectTeamMemberExitReq.java @@ -21,9 +21,14 @@ public class BusProjectTeamMemberExitReq implements Serializable { private Long id; /** - * 文件路径 + * 工资发放凭证 */ - private String filePath; + private String salaryVoucherFile; + + /** + * 工资结算确认书 + */ + private String salaryConfirmationFile; /** * 备注 diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/vo/constructionuserexit/BusConstructionUserExitVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/vo/constructionuserexit/BusConstructionUserExitVo.java index b194eaef..efff647d 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/vo/constructionuserexit/BusConstructionUserExitVo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/domain/vo/constructionuserexit/BusConstructionUserExitVo.java @@ -69,15 +69,26 @@ public class BusConstructionUserExitVo implements Serializable { private Date leaveDate; /** - * 退场文件 + * 工资发放凭证 */ - @ExcelProperty(value = "退场文件") - private String path; + @ExcelProperty(value = "工资发放凭证") + private String salaryVoucherFile; /** - * 退场文件url + * 工资结算确认书 */ - private List pathUrl; + @ExcelProperty(value = "工资结算确认书") + private String salaryConfirmationFile; + + /** + * 工资发放凭证url + */ + private List salaryVoucherFileUrl; + + /** + * 工资结算确认书url + */ + private List salaryConfirmationFileUrl; /** * 备注 diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/IBusConstructionUserExitService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/IBusConstructionUserExitService.java index 22aded98..d0357f56 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/IBusConstructionUserExitService.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/IBusConstructionUserExitService.java @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService; import org.dromara.common.mybatis.core.page.PageQuery; import org.dromara.common.mybatis.core.page.TableDataInfo; import org.dromara.project.domain.BusConstructionUserExit; +import org.dromara.project.domain.dto.constructionuserexit.BusConstructionUserExitCreateReq; import org.dromara.project.domain.dto.constructionuserexit.BusConstructionUserExitQueryReq; import org.dromara.project.domain.vo.constructionuserexit.BusConstructionUserExitVo; @@ -68,4 +69,11 @@ public interface IBusConstructionUserExitService extends IService getVoPage(Page constructionUserExitPage); + /** + * 新增施工人员入场退场记录信息 + * + * @param req 新增参数 + * @return 新增结果 + */ + Boolean addRecord(BusConstructionUserExitCreateReq req); } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/IBusProjectTeamService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/IBusProjectTeamService.java index a37904c9..e88c2f65 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/IBusProjectTeamService.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/IBusProjectTeamService.java @@ -81,6 +81,14 @@ public interface IBusProjectTeamService extends IService { */ List queryForemanListByProjectId(Long projectId); + /** + * 获取指定id的班组和班组长列表 + * + * @param id 班组id + * @return 项目班组和班组长列表 + */ + BusProjectTeamForemanVo queryForemanListById(Long id); + /** * 获取项目班组视图对象 * diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/impl/BusConstructionUserExitServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/impl/BusConstructionUserExitServiceImpl.java index d4de186f..fc2f592f 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/impl/BusConstructionUserExitServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/project/service/impl/BusConstructionUserExitServiceImpl.java @@ -11,6 +11,7 @@ import org.dromara.common.core.utils.StringUtils; import org.dromara.common.mybatis.core.page.PageQuery; import org.dromara.common.mybatis.core.page.TableDataInfo; import org.dromara.project.domain.BusConstructionUserExit; +import org.dromara.project.domain.dto.constructionuserexit.BusConstructionUserExitCreateReq; import org.dromara.project.domain.dto.constructionuserexit.BusConstructionUserExitQueryReq; import org.dromara.project.domain.vo.constructionuserexit.BusConstructionUserExitVo; import org.dromara.project.mapper.BusConstructionUserExitMapper; @@ -86,10 +87,15 @@ public class BusConstructionUserExitServiceImpl extends ServiceImpl ossIdList = Arrays.stream(path.split(",")).map(Long::parseLong).toList(); - constructionUserExitVo.setPathUrl(ossService.listByIds(ossIdList).stream().map(SysOssVo::getUrl).toList()); + String salaryVoucherFile = constructionUserExitVo.getSalaryVoucherFile(); + if (StringUtils.isNotBlank(salaryVoucherFile)) { + List ossIdList = Arrays.stream(salaryVoucherFile.split(",")).map(Long::parseLong).toList(); + constructionUserExitVo.setSalaryVoucherFileUrl(ossService.listByIds(ossIdList).stream().map(SysOssVo::getUrl).toList()); + } + String salaryConfirmationFile = constructionUserExitVo.getSalaryConfirmationFile(); + if (StringUtils.isNotBlank(salaryConfirmationFile)) { + List ossIdList = Arrays.stream(salaryConfirmationFile.split(",")).map(Long::parseLong).toList(); + constructionUserExitVo.setSalaryConfirmationFileUrl(ossService.listByIds(ossIdList).stream().map(SysOssVo::getUrl).toList()); } return constructionUserExitVo; } @@ -150,4 +156,15 @@ public class BusConstructionUserExitServiceImpl extends ServiceImpl teamMemberList = projectTeamMemberService.lambdaQuery() + .eq(BusProjectTeamMember::getTeamId, id) + .eq(BusProjectTeamMember::getPostId, BusProjectTeamMemberPostEnum.FOREMAN.getValue()) + .list(); + if (CollUtil.isEmpty(teamMemberList)) { + return vo; + } + List foremanIdList = teamMemberList.stream().map(BusProjectTeamMember::getMemberId).distinct().toList(); + // 获取项目班组长信息 + List foremanList = constructionUserService.listByIds(foremanIdList); + List foremanVoList = foremanList.stream().map(constructionUser -> { + BusForemanVo foremanVo = new BusForemanVo(); + foremanVo.setForemanId(constructionUser.getId()); + foremanVo.setForemanName(constructionUser.getUserName()); + return foremanVo; + }).toList(); + vo.setId(team.getId()); + vo.setTeamName(team.getTeamName()); + vo.setProjectId(team.getProjectId()); + vo.setForemanList(foremanVoList); + return vo; + } + /** * 获取项目班组视图对象 * diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/controller/HseSafetyLogController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/controller/HseSafetyLogController.java index 48e1ace6..743b7da3 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/controller/HseSafetyLogController.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/controller/HseSafetyLogController.java @@ -6,8 +6,6 @@ import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotNull; import lombok.RequiredArgsConstructor; import org.dromara.common.core.domain.R; -import org.dromara.common.core.validate.AddGroup; -import org.dromara.common.core.validate.EditGroup; import org.dromara.common.excel.utils.ExcelUtil; import org.dromara.common.idempotent.annotation.RepeatSubmit; import org.dromara.common.log.annotation.Log; @@ -78,7 +76,7 @@ public class HseSafetyLogController extends BaseController { @Log(title = "安全日志", businessType = BusinessType.INSERT) @RepeatSubmit() @PostMapping() - public R add(@Validated(AddGroup.class) @RequestBody HseSafetyLogCreateReq req) { + public R add(@Validated @RequestBody HseSafetyLogCreateReq req) { return R.ok(safetyLogService.insertByBo(req)); } @@ -89,7 +87,7 @@ public class HseSafetyLogController extends BaseController { @Log(title = "安全日志", businessType = BusinessType.UPDATE) @RepeatSubmit() @PutMapping() - public R edit(@Validated(EditGroup.class) @RequestBody HseSafetyLogUpdateReq req) { + public R edit(@Validated @RequestBody HseSafetyLogUpdateReq req) { return toAjax(safetyLogService.updateByBo(req)); } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/controller/HseTeamMeetingController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/controller/HseTeamMeetingController.java index 681fc7b4..52c4a1d2 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/controller/HseTeamMeetingController.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/controller/HseTeamMeetingController.java @@ -6,8 +6,6 @@ import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotNull; import lombok.RequiredArgsConstructor; import org.dromara.common.core.domain.R; -import org.dromara.common.core.validate.AddGroup; -import org.dromara.common.core.validate.EditGroup; import org.dromara.common.excel.utils.ExcelUtil; import org.dromara.common.idempotent.annotation.RepeatSubmit; import org.dromara.common.log.annotation.Log; @@ -78,7 +76,7 @@ public class HseTeamMeetingController extends BaseController { @Log(title = "站班会", businessType = BusinessType.INSERT) @RepeatSubmit() @PostMapping() - public R add(@Validated(AddGroup.class) @RequestBody HseTeamMeetingCreateReq req) { + public R add(@Validated @RequestBody HseTeamMeetingCreateReq req) { return R.ok(teamMeetingService.insertByBo(req)); } @@ -89,7 +87,7 @@ public class HseTeamMeetingController extends BaseController { @Log(title = "站班会", businessType = BusinessType.UPDATE) @RepeatSubmit() @PutMapping() - public R edit(@Validated(EditGroup.class) @RequestBody HseTeamMeetingUpdateReq req) { + public R edit(@Validated @RequestBody HseTeamMeetingUpdateReq req) { return toAjax(teamMeetingService.updateByBo(req)); } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/controller/app/HseSafetyLogAppController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/controller/app/HseSafetyLogAppController.java new file mode 100644 index 00000000..9d346edb --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/controller/app/HseSafetyLogAppController.java @@ -0,0 +1,56 @@ +package org.dromara.safety.controller.app; + +import jakarta.annotation.Resource; +import jakarta.validation.constraints.NotNull; +import org.dromara.common.core.domain.R; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.web.core.BaseController; +import org.dromara.safety.domain.dto.safetylog.HseSafetyLogCreateReq; +import org.dromara.safety.domain.dto.safetylog.HseSafetyLogQueryReq; +import org.dromara.safety.domain.vo.safetylog.HseSafetyLogVo; +import org.dromara.safety.service.IHseSafetyLogService; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +/** + * 安全日志 app 接口 + * + * @author lilemy + * @date 2025-09-01 18:44 + */ +@Validated +@RestController +@RequestMapping("/app/safety/safetyLog") +public class HseSafetyLogAppController extends BaseController { + + @Resource + private IHseSafetyLogService safetyLogService; + + /** + * 分页查询安全日志列表 + */ + @GetMapping("/list") + public TableDataInfo list(HseSafetyLogQueryReq req, PageQuery pageQuery) { + return safetyLogService.queryPageList(req, pageQuery); + } + + /** + * 新增安全日志 + */ + @PostMapping("/insert") + public R insert(@Validated @RequestBody HseSafetyLogCreateReq req) { + return R.ok(safetyLogService.insertByBo(req)); + } + + /** + * 获取安全日志详细信息 + * + * @param id 主键 + */ + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(safetyLogService.queryById(id)); + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/controller/app/HseTeamMeetingAppController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/controller/app/HseTeamMeetingAppController.java new file mode 100644 index 00000000..ae8819fe --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/controller/app/HseTeamMeetingAppController.java @@ -0,0 +1,56 @@ +package org.dromara.safety.controller.app; + +import jakarta.annotation.Resource; +import jakarta.validation.constraints.NotNull; +import org.dromara.common.core.domain.R; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.web.core.BaseController; +import org.dromara.safety.domain.dto.teammeeting.HseTeamMeetingCreateReq; +import org.dromara.safety.domain.dto.teammeeting.HseTeamMeetingQueryReq; +import org.dromara.safety.domain.vo.teammeeting.HseTeamMeetingVo; +import org.dromara.safety.service.IHseTeamMeetingService; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +/** + * 站班会 app 接口 + * + * @author lilemy + * @date 2025-09-01 17:39 + */ +@Validated +@RestController +@RequestMapping("/app/safety/teamMeeting") +public class HseTeamMeetingAppController extends BaseController { + + @Resource + private IHseTeamMeetingService teamMeetingService; + + /** + * 分页查询站班会列表 + */ + @GetMapping("/list") + public TableDataInfo list(HseTeamMeetingQueryReq req, PageQuery pageQuery) { + return teamMeetingService.queryPageList(req, pageQuery); + } + + /** + * 新增站班会 + */ + @PostMapping("/insert") + public R insert(@Validated @RequestBody HseTeamMeetingCreateReq req) { + return R.ok(teamMeetingService.insertByBo(req)); + } + + /** + * 获取站班会详细信息 + * + * @param id 主键 + */ + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(teamMeetingService.queryById(id)); + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/HseTeamMeeting.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/HseTeamMeeting.java index fddbb38b..f3a9ee16 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/HseTeamMeeting.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/HseTeamMeeting.java @@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode; import org.dromara.common.mybatis.core.domain.BaseEntity; import java.io.Serial; -import java.util.Date; +import java.time.LocalDate; /** * 站班会对象 hse_team_meeting @@ -47,7 +47,7 @@ public class HseTeamMeeting extends BaseEntity { /** * 开会时间 */ - private Date meetingDate; + private LocalDate meetingDate; /** * 宣讲人 diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/dto/safetylog/HseSafetyLogCreateReq.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/dto/safetylog/HseSafetyLogCreateReq.java index 01cd2c8c..00f75912 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/dto/safetylog/HseSafetyLogCreateReq.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/dto/safetylog/HseSafetyLogCreateReq.java @@ -1,5 +1,7 @@ package org.dromara.safety.domain.dto.safetylog; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; import lombok.Data; import java.io.Serial; @@ -18,11 +20,13 @@ public class HseSafetyLogCreateReq implements Serializable { /** * 项目id */ + @NotNull(message = "项目id不能为空") private Long projectId; /** * 发生日期 */ + @NotBlank(message = "发生日期不能为空") private String dateOfOccurrence; /** diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/dto/safetylog/HseSafetyLogQueryReq.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/dto/safetylog/HseSafetyLogQueryReq.java index a3210af4..d10c2879 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/dto/safetylog/HseSafetyLogQueryReq.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/dto/safetylog/HseSafetyLogQueryReq.java @@ -15,11 +15,6 @@ public class HseSafetyLogQueryReq implements Serializable { @Serial private static final long serialVersionUID = 2954315254418593105L; - /** - * 主键id - */ - private Long id; - /** * 项目id */ diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/dto/teammeeting/HseTeamMeetingCreateReq.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/dto/teammeeting/HseTeamMeetingCreateReq.java index 2ed4026a..5fc6f70a 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/dto/teammeeting/HseTeamMeetingCreateReq.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/dto/teammeeting/HseTeamMeetingCreateReq.java @@ -1,11 +1,12 @@ package org.dromara.safety.domain.dto.teammeeting; -import com.fasterxml.jackson.annotation.JsonFormat; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; import lombok.Data; import java.io.Serial; import java.io.Serializable; -import java.util.Date; +import java.time.LocalDate; import java.util.List; /** @@ -21,37 +22,43 @@ public class HseTeamMeetingCreateReq implements Serializable { /** * 项目id */ + @NotNull(message = "项目id不能为空") private Long projectId; /** * 班组id */ + @NotNull(message = "班组id不能为空") private Long teamId; /** * 分包公司id */ + @NotNull(message = "分包公司id不能为空") private Long contractorId; /** * 开会时间 */ - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") - private Date meetingDate; + @NotNull(message = "开会时间不能为空") + private LocalDate meetingDate; /** * 宣讲人 */ + @NotNull(message = "宣讲人不能为空") private Long compereId; /** * 参与人id(多个用,号隔开) */ + @NotNull(message = "参与人不能为空") private List participantIdList; /** * 班会内容 */ + @NotBlank(message = "班会内容不能为空") private String content; /** diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/dto/teammeeting/HseTeamMeetingQueryReq.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/dto/teammeeting/HseTeamMeetingQueryReq.java index 1527990e..f36abc01 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/dto/teammeeting/HseTeamMeetingQueryReq.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/dto/teammeeting/HseTeamMeetingQueryReq.java @@ -17,11 +17,6 @@ public class HseTeamMeetingQueryReq implements Serializable { @Serial private static final long serialVersionUID = 8880866939746311233L; - /** - * 主键id - */ - private Long id; - /** * 项目id */ @@ -42,16 +37,6 @@ public class HseTeamMeetingQueryReq implements Serializable { */ private LocalDate meetingDate; - /** - * 宣讲人 - */ - private Long compereId; - - /** - * 参与人id(多个用,号隔开) - */ - private List participantIdList; - /** * 班会内容 */ diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/dto/teammeeting/HseTeamMeetingUpdateReq.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/dto/teammeeting/HseTeamMeetingUpdateReq.java index 547fa069..a7fd49f1 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/dto/teammeeting/HseTeamMeetingUpdateReq.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/dto/teammeeting/HseTeamMeetingUpdateReq.java @@ -1,11 +1,11 @@ package org.dromara.safety.domain.dto.teammeeting; -import com.fasterxml.jackson.annotation.JsonFormat; +import jakarta.validation.constraints.NotNull; import lombok.Data; import java.io.Serial; import java.io.Serializable; -import java.util.Date; +import java.time.LocalDate; import java.util.List; /** @@ -21,13 +21,9 @@ public class HseTeamMeetingUpdateReq implements Serializable { /** * 主键id */ + @NotNull(message = "主键id不能为空") private Long id; - /** - * 项目id - */ - private Long projectId; - /** * 班组id */ @@ -41,8 +37,7 @@ public class HseTeamMeetingUpdateReq implements Serializable { /** * 开会时间 */ - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") - private Date meetingDate; + private LocalDate meetingDate; /** * 宣讲人 diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/vo/teammeeting/HseTeamMeetingVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/vo/teammeeting/HseTeamMeetingVo.java index 7d993a8e..85801480 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/vo/teammeeting/HseTeamMeetingVo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/vo/teammeeting/HseTeamMeetingVo.java @@ -5,8 +5,8 @@ import com.alibaba.excel.annotation.ExcelProperty; import io.github.linpeilie.annotations.AutoMapper; import lombok.Data; import org.dromara.common.core.domain.vo.IdAndNameVO; -import org.dromara.common.excel.annotation.ExcelDictFormat; -import org.dromara.common.excel.convert.ExcelDictConvert; +import org.dromara.common.translation.annotation.Translation; +import org.dromara.common.translation.constant.TransConstant; import org.dromara.safety.domain.HseTeamMeeting; import java.io.Serial; @@ -78,13 +78,13 @@ public class HseTeamMeetingVo implements Serializable { /** * 宣讲人 */ + @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "compereId") private String compereName; /** * 参与人id(多个用,号隔开) */ - @ExcelProperty(value = "参与人id", converter = ExcelDictConvert.class) - @ExcelDictFormat(readConverterExp = "多=个用,号隔开") + @ExcelProperty(value = "参与人id") private String participantId; /** @@ -115,6 +115,17 @@ public class HseTeamMeetingVo implements Serializable { @ExcelProperty(value = "备注") private String remark; + /** + * 创建者 + */ + private Long createBy; + + /** + * 创建者名称 + */ + @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "createBy") + private String createByName; + /** * 创建时间 */ diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/impl/HseSafetyLogServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/impl/HseSafetyLogServiceImpl.java index 5fbded06..ef5bbc7e 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/impl/HseSafetyLogServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/impl/HseSafetyLogServiceImpl.java @@ -198,7 +198,6 @@ public class HseSafetyLogServiceImpl extends ServiceImpl participantIdList = JSONUtil.toList(participantId, Long.class); if (CollUtil.isNotEmpty(participantIdList)) { - LambdaQueryWrapper constructionUserLambdaQueryWrapper = Wrappers.lambdaQuery(SubConstructionUser.class) - .select(SubConstructionUser::getId, SubConstructionUser::getUserName) - .in(SubConstructionUser::getId, participantIdList); - List constructionUserList = constructionUserService.list(constructionUserLambdaQueryWrapper); - List idAndNameVOList = constructionUserList.stream() - .map(constructionUser -> IdAndNameVO.build(constructionUser.getId(), constructionUser.getUserName())) + List userVos = userService.selectUserByIds(participantIdList, null); + List idAndNameVOList = userVos.stream() + .map(constructionUser -> IdAndNameVO.build(constructionUser.getUserId(), constructionUser.getNickName())) .toList(); teamMeetingVo.setParticipantList(idAndNameVOList); } // 查询对应宣讲人 Long compereId = teamMeeting.getCompereId(); if (compereId != null) { - LambdaQueryWrapper constructionUserLambdaQueryWrapper = Wrappers.lambdaQuery(SubConstructionUser.class) - .select(SubConstructionUser::getId, SubConstructionUser::getUserName) - .eq(SubConstructionUser::getId, compereId); - SubConstructionUser constructionUser = constructionUserService.getOne(constructionUserLambdaQueryWrapper); - teamMeetingVo.setCompereName(constructionUser.getUserName()); + SysUserVo userVo = userService.selectUserById(compereId); + teamMeetingVo.setCompereName(userVo.getUserName()); } // 查询对应文件信息 String picture = teamMeeting.getPicture(); @@ -271,31 +265,20 @@ public class HseTeamMeetingServiceImpl extends ServiceImpl participantIdList = req.getParticipantIdList(); String content = req.getContent(); String remark = req.getRemark(); - // JSON 数组查询 - if (CollUtil.isNotEmpty(participantIdList)) { - for (String participantId : participantIdList) { - lqw.like(HseTeamMeeting::getParticipantId, "\"" + participantId + "\""); - } - } // 模糊查询 lqw.like(StringUtils.isNotBlank(content), HseTeamMeeting::getContent, content); lqw.like(StringUtils.isNotBlank(remark), HseTeamMeeting::getRemark, remark); // 精准查询 - lqw.eq(ObjectUtils.isNotEmpty(id), HseTeamMeeting::getId, id); lqw.eq(ObjectUtils.isNotEmpty(projectId), HseTeamMeeting::getProjectId, projectId); lqw.eq(ObjectUtils.isNotEmpty(teamId), HseTeamMeeting::getTeamId, teamId); lqw.eq(ObjectUtils.isNotEmpty(contractorId), HseTeamMeeting::getContractorId, contractorId); lqw.eq(ObjectUtils.isNotEmpty(meetingDate), HseTeamMeeting::getMeetingDate, meetingDate); - lqw.eq(ObjectUtils.isNotEmpty(compereId), HseTeamMeeting::getCompereId, compereId); return lqw; } @@ -323,7 +306,7 @@ public class HseTeamMeetingServiceImpl extends ServiceImpl> contractorMap = contractorService.listByIds(contractorIdList) .stream().collect(Collectors.groupingBy(SubContractor::getId)); // 获取对应参会人 - Set userIdList = new HashSet<>(); + List userIdList = new ArrayList<>(); for (HseTeamMeeting teamMeeting : teamMeetingList) { String participantId = teamMeeting.getParticipantId(); userIdList.addAll(JSONUtil.toList(participantId, Long.class)); @@ -331,8 +314,8 @@ public class HseTeamMeetingServiceImpl extends ServiceImpl compereIdList = teamMeetingList.stream().map(HseTeamMeeting::getCompereId).collect(Collectors.toSet()); userIdList.addAll(compereIdList); - Map> userMap = constructionUserService.listByIds(userIdList) - .stream().collect(Collectors.groupingBy(SubConstructionUser::getId)); + Map userMap = userService.selectUserByIds(userIdList, null) + .stream().collect(Collectors.toMap(SysUserVo::getUserId, SysUserVo::getNickName, (key1, key2) -> key1)); // 对象列表 => 封装对象列表 List teamMeetingVoList = teamMeetingList.stream().map(teamMeeting -> { HseTeamMeetingVo teamMeetingVo = new HseTeamMeetingVo(); @@ -352,7 +335,7 @@ public class HseTeamMeetingServiceImpl extends ServiceImpl