安全模块、人员模块app接口

This commit is contained in:
lcj
2025-09-02 15:14:06 +08:00
parent a3ef525ab6
commit 79edeb6ccd
29 changed files with 455 additions and 96 deletions

View File

@ -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<SubConstructionUserVo> 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<SubConstructionUserVo> queryById(@NotNull(message = "主键不能为空")
@PathVariable Long id) {
return R.ok(constructionUserService.queryById(id));
}
/**
* 根据身份证图片获取身份证信息
*/

View File

@ -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;
}

View File

@ -713,6 +713,7 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
String clock = req.getClock();
String userRole = req.getUserRole();
String notUserRole = req.getNotUserRole();
LocalDate entryDate = req.getEntryDate();
// 模糊查询
lqw.like(StringUtils.isNotBlank(userName), SubConstructionUser::getUserName, userName);
lqw.like(StringUtils.isNotBlank(nation), SubConstructionUser::getNation, nation);
@ -742,6 +743,7 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
}
}
lqw.ne(StringUtils.isNotBlank(notUserRole), SubConstructionUser::getUserRole, notUserRole);
lqw.le(ObjectUtils.isNotEmpty(entryDate), SubConstructionUser::getEntryDate, entryDate);
return lqw;
}

View File

@ -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.idempotent.annotation.RepeatSubmit;
import org.dromara.common.log.annotation.Log;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.web.core.BaseController;
import org.dromara.project.domain.dto.constructionuserexit.BusConstructionUserExitCreateReq;
import org.dromara.project.service.IBusConstructionUserExitService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 施工人员入场退场记录信息 app 接口
*
* @author lilemy
* @date 2025-09-02 14:29
*/
@Validated
@RestController
@RequestMapping("/app/project/constructionUserExit")
public class BusConstructionUserExitAppController extends BaseController {
@Resource
private IBusConstructionUserExitService constructionUserExitService;
@Log(title = "施工人员入场退场记录信息", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> addExitRecord(@Validated @RequestBody BusConstructionUserExitCreateReq req) {
return toAjax(constructionUserExitService.addRecord(req));
}
}

View File

@ -12,6 +12,8 @@ import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 项目 app 接口
*
* @author lilemy
* @date 2025-07-24 15:14
*/

View File

@ -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<BusProjectTeamForemanVo> listForeman(@NotNull(message = "主键不能为空")
@PathVariable Long id) {
return R.ok(projectTeamService.queryForemanListById(id));
}
}

View File

@ -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<BusProjectTeamMemberVo>> list(BusProjectTeamMemberQueryReq req) {
List<BusProjectTeamMemberVo> list = projectTeamMemberService.queryList(req);
return R.ok(list);
}
}

View File

@ -58,9 +58,14 @@ public class BusConstructionUserExit implements Serializable {
private Date leaveDate;
/**
* 退场文件
* 工资发放凭证
*/
private String path;
private String salaryVoucherFile;
/**
* 工资结算确认书
*/
private String salaryConfirmationFile;
/**
* 备注

View File

@ -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;
}

View File

@ -21,9 +21,14 @@ public class BusProjectTeamMemberExitReq implements Serializable {
private Long id;
/**
* 文件路径
* 工资发放凭证
*/
private String filePath;
private String salaryVoucherFile;
/**
* 工资结算确认书
*/
private String salaryConfirmationFile;
/**
* 备注

View File

@ -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<String> pathUrl;
@ExcelProperty(value = "工资结算确认书")
private String salaryConfirmationFile;
/**
* 工资发放凭证url
*/
private List<String> salaryVoucherFileUrl;
/**
* 工资结算确认书url
*/
private List<String> salaryConfirmationFileUrl;
/**
* 备注

View File

@ -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<BusConstructio
*/
Page<BusConstructionUserExitVo> getVoPage(Page<BusConstructionUserExit> constructionUserExitPage);
/**
* 新增施工人员入场退场记录信息
*
* @param req 新增参数
* @return 新增结果
*/
Boolean addRecord(BusConstructionUserExitCreateReq req);
}

View File

@ -81,6 +81,14 @@ public interface IBusProjectTeamService extends IService<BusProjectTeam> {
*/
List<BusProjectTeamForemanVo> queryForemanListByProjectId(Long projectId);
/**
* 获取指定id的班组和班组长列表
*
* @param id 班组id
* @return 项目班组和班组长列表
*/
BusProjectTeamForemanVo queryForemanListById(Long id);
/**
* 获取项目班组视图对象
*

View File

@ -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<BusConstruct
return constructionUserExitVo;
}
BeanUtils.copyProperties(constructionUserExit, constructionUserExitVo);
String path = constructionUserExitVo.getPath();
if (StringUtils.isNotBlank(path)) {
List<Long> 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<Long> 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<Long> 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<BusConstruct
return constructionUserExitVoPage;
}
/**
* 新增施工人员入场退场记录信息
*
* @param req 新增参数
* @return 新增结果
*/
@Override
public Boolean addRecord(BusConstructionUserExitCreateReq req) {
return null;
}
}

View File

@ -236,8 +236,9 @@ public class BusProjectTeamMemberServiceImpl extends ServiceImpl<BusProjectTeamM
// 判断是否有权限操作对应项目下的内容
Long userId = LoginHelper.getUserId();
Long id = req.getId();
String filePath = req.getFilePath();
if (StringUtils.isBlank(filePath)) {
String salaryVoucherFile = req.getSalaryVoucherFile();
String salaryConfirmationFile = req.getSalaryConfirmationFile();
if (StringUtils.isAnyBlank(salaryVoucherFile, salaryConfirmationFile)) {
throw new ServiceException("请上传退场文件", HttpStatus.BAD_REQUEST);
}
BusProjectTeamMember projectTeamMember = this.getById(id);
@ -255,7 +256,8 @@ public class BusProjectTeamMemberServiceImpl extends ServiceImpl<BusProjectTeamM
BusConstructionUserExit constructionUserExit = new BusConstructionUserExit();
constructionUserExit.setProjectId(constructionUser.getProjectId());
constructionUserExit.setUserId(constructionUser.getId());
constructionUserExit.setPath(filePath);
constructionUserExit.setSalaryVoucherFile(salaryVoucherFile);
constructionUserExit.setSalaryConfirmationFile(salaryConfirmationFile);
constructionUserExit.setTeamId(constructionUser.getTeamId());
constructionUserExit.setSfzNumber(constructionUser.getSfzNumber());
constructionUserExit.setEntryDate(constructionUser.getEntryDate());

View File

@ -298,6 +298,42 @@ public class BusProjectTeamServiceImpl extends ServiceImpl<BusProjectTeamMapper,
}).toList();
}
/**
* 获取指定id的班组和班组长列表
*
* @param id 班组id
* @return 项目班组和班组长列表
*/
@Override
public BusProjectTeamForemanVo queryForemanListById(Long id) {
BusProjectTeamForemanVo vo = new BusProjectTeamForemanVo();
BusProjectTeam team = this.getById(id);
if (team == null) {
throw new ServiceException("对应项目班组不存在", HttpStatus.NOT_FOUND);
}
List<BusProjectTeamMember> teamMemberList = projectTeamMemberService.lambdaQuery()
.eq(BusProjectTeamMember::getTeamId, id)
.eq(BusProjectTeamMember::getPostId, BusProjectTeamMemberPostEnum.FOREMAN.getValue())
.list();
if (CollUtil.isEmpty(teamMemberList)) {
return vo;
}
List<Long> foremanIdList = teamMemberList.stream().map(BusProjectTeamMember::getMemberId).distinct().toList();
// 获取项目班组长信息
List<SubConstructionUser> foremanList = constructionUserService.listByIds(foremanIdList);
List<BusForemanVo> 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;
}
/**
* 获取项目班组视图对象
*

View File

@ -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<Long> add(@Validated(AddGroup.class) @RequestBody HseSafetyLogCreateReq req) {
public R<Long> 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<Void> edit(@Validated(EditGroup.class) @RequestBody HseSafetyLogUpdateReq req) {
public R<Void> edit(@Validated @RequestBody HseSafetyLogUpdateReq req) {
return toAjax(safetyLogService.updateByBo(req));
}

View File

@ -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<Long> add(@Validated(AddGroup.class) @RequestBody HseTeamMeetingCreateReq req) {
public R<Long> 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<Void> edit(@Validated(EditGroup.class) @RequestBody HseTeamMeetingUpdateReq req) {
public R<Void> edit(@Validated @RequestBody HseTeamMeetingUpdateReq req) {
return toAjax(teamMeetingService.updateByBo(req));
}

View File

@ -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<HseSafetyLogVo> list(HseSafetyLogQueryReq req, PageQuery pageQuery) {
return safetyLogService.queryPageList(req, pageQuery);
}
/**
* 新增安全日志
*/
@PostMapping("/insert")
public R<Long> insert(@Validated @RequestBody HseSafetyLogCreateReq req) {
return R.ok(safetyLogService.insertByBo(req));
}
/**
* 获取安全日志详细信息
*
* @param id 主键
*/
@GetMapping("/{id}")
public R<HseSafetyLogVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long id) {
return R.ok(safetyLogService.queryById(id));
}
}

View File

@ -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<HseTeamMeetingVo> list(HseTeamMeetingQueryReq req, PageQuery pageQuery) {
return teamMeetingService.queryPageList(req, pageQuery);
}
/**
* 新增站班会
*/
@PostMapping("/insert")
public R<Long> insert(@Validated @RequestBody HseTeamMeetingCreateReq req) {
return R.ok(teamMeetingService.insertByBo(req));
}
/**
* 获取站班会详细信息
*
* @param id 主键
*/
@GetMapping("/{id}")
public R<HseTeamMeetingVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long id) {
return R.ok(teamMeetingService.queryById(id));
}
}

View File

@ -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;
/**
* 宣讲人

View File

@ -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;
/**

View File

@ -15,11 +15,6 @@ public class HseSafetyLogQueryReq implements Serializable {
@Serial
private static final long serialVersionUID = 2954315254418593105L;
/**
* 主键id
*/
private Long id;
/**
* 项目id
*/

View File

@ -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<String> participantIdList;
/**
* 班会内容
*/
@NotBlank(message = "班会内容不能为空")
private String content;
/**

View File

@ -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<String> participantIdList;
/**
* 班会内容
*/

View File

@ -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;
/**
* 宣讲人

View File

@ -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;
/**
* 创建时间
*/

View File

@ -198,7 +198,6 @@ public class HseSafetyLogServiceImpl extends ServiceImpl<HseSafetyLogMapper, Hse
if (req == null) {
return lqw;
}
Long id = req.getId();
Long projectId = req.getProjectId();
String dateOfOccurrence = req.getDateOfOccurrence();
String creatorName = req.getCreatorName();
@ -213,7 +212,6 @@ public class HseSafetyLogServiceImpl extends ServiceImpl<HseSafetyLogMapper, Hse
}
}
// 精确查询
lqw.eq(ObjectUtils.isNotEmpty(id), HseSafetyLog::getId, id);
lqw.eq(ObjectUtils.isNotEmpty(projectId), HseSafetyLog::getProjectId, projectId);
lqw.eq(ObjectUtils.isNotEmpty(dateOfOccurrence), HseSafetyLog::getDateOfOccurrence, dateOfOccurrence);
return lqw;

View File

@ -15,11 +15,9 @@ 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.common.satoken.utils.LoginHelper;
import org.dromara.contractor.domain.SubConstructionUser;
import org.dromara.contractor.domain.SubContractor;
import org.dromara.contractor.service.ISubContractorService;
import org.dromara.project.domain.BusProjectTeam;
import org.dromara.contractor.service.ISubConstructionUserService;
import org.dromara.project.service.IBusProjectService;
import org.dromara.project.service.IBusProjectTeamService;
import org.dromara.safety.domain.HseTeamMeeting;
@ -30,7 +28,9 @@ import org.dromara.safety.domain.vo.teammeeting.HseTeamMeetingVo;
import org.dromara.safety.mapper.HseTeamMeetingMapper;
import org.dromara.safety.service.IHseTeamMeetingService;
import org.dromara.system.domain.vo.SysOssVo;
import org.dromara.system.domain.vo.SysUserVo;
import org.dromara.system.service.ISysOssService;
import org.dromara.system.service.ISysUserService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -53,7 +53,7 @@ public class HseTeamMeetingServiceImpl extends ServiceImpl<HseTeamMeetingMapper,
private ISysOssService ossService;
@Resource
private ISubConstructionUserService constructionUserService;
private ISysUserService userService;
@Resource
private ISubContractorService contractorService;
@ -230,23 +230,17 @@ public class HseTeamMeetingServiceImpl extends ServiceImpl<HseTeamMeetingMapper,
String participantId = teamMeeting.getParticipantId();
List<Long> participantIdList = JSONUtil.toList(participantId, Long.class);
if (CollUtil.isNotEmpty(participantIdList)) {
LambdaQueryWrapper<SubConstructionUser> constructionUserLambdaQueryWrapper = Wrappers.lambdaQuery(SubConstructionUser.class)
.select(SubConstructionUser::getId, SubConstructionUser::getUserName)
.in(SubConstructionUser::getId, participantIdList);
List<SubConstructionUser> constructionUserList = constructionUserService.list(constructionUserLambdaQueryWrapper);
List<IdAndNameVO> idAndNameVOList = constructionUserList.stream()
.map(constructionUser -> IdAndNameVO.build(constructionUser.getId(), constructionUser.getUserName()))
List<SysUserVo> userVos = userService.selectUserByIds(participantIdList, null);
List<IdAndNameVO> idAndNameVOList = userVos.stream()
.map(constructionUser -> IdAndNameVO.build(constructionUser.getUserId(), constructionUser.getNickName()))
.toList();
teamMeetingVo.setParticipantList(idAndNameVOList);
}
// 查询对应宣讲人
Long compereId = teamMeeting.getCompereId();
if (compereId != null) {
LambdaQueryWrapper<SubConstructionUser> 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<HseTeamMeetingMapper,
if (req == null) {
return lqw;
}
Long id = req.getId();
Long projectId = req.getProjectId();
Long teamId = req.getTeamId();
Long contractorId = req.getContractorId();
LocalDate meetingDate = req.getMeetingDate();
Long compereId = req.getCompereId();
List<String> 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<HseTeamMeetingMapper,
Map<Long, List<SubContractor>> contractorMap = contractorService.listByIds(contractorIdList)
.stream().collect(Collectors.groupingBy(SubContractor::getId));
// 获取对应参会人
Set<Long> userIdList = new HashSet<>();
List<Long> 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<HseTeamMeetingMapper,
// 获取对应宣讲人
Set<Long> compereIdList = teamMeetingList.stream().map(HseTeamMeeting::getCompereId).collect(Collectors.toSet());
userIdList.addAll(compereIdList);
Map<Long, List<SubConstructionUser>> userMap = constructionUserService.listByIds(userIdList)
.stream().collect(Collectors.groupingBy(SubConstructionUser::getId));
Map<Long, String> userMap = userService.selectUserByIds(userIdList, null)
.stream().collect(Collectors.toMap(SysUserVo::getUserId, SysUserVo::getNickName, (key1, key2) -> key1));
// 对象列表 => 封装对象列表
List<HseTeamMeetingVo> teamMeetingVoList = teamMeetingList.stream().map(teamMeeting -> {
HseTeamMeetingVo teamMeetingVo = new HseTeamMeetingVo();
@ -352,7 +335,7 @@ public class HseTeamMeetingServiceImpl extends ServiceImpl<HseTeamMeetingMapper,
// 关联宣讲人信息
String compereName = null;
if (userMap.containsKey(teamMeeting.getCompereId())) {
compereName = userMap.get(teamMeeting.getCompereId()).getFirst().getUserName();
compereName = userMap.get(teamMeeting.getCompereId());
}
teamMeetingVo.setCompereName(compereName);
// 关联参会人信息
@ -362,8 +345,8 @@ public class HseTeamMeetingServiceImpl extends ServiceImpl<HseTeamMeetingMapper,
if (CollUtil.isNotEmpty(idList)) {
for (Long userId : idList) {
if (userMap.containsKey(userId)) {
SubConstructionUser constructionUser = userMap.get(userId).getFirst();
participantList.add(IdAndNameVO.build(constructionUser.getId(), constructionUser.getUserName()));
String nikeName = userMap.get(userId);
participantList.add(IdAndNameVO.build(userId, nikeName));
}
}
}