设计优化
This commit is contained in:
		| @ -183,7 +183,7 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU | |||||||
|             List<BusProjectTeamAppVo> byUserId = projectTeamService.getByUserId(userId, req.getProjectId()); |             List<BusProjectTeamAppVo> byUserId = projectTeamService.getByUserId(userId, req.getProjectId()); | ||||||
|  |  | ||||||
|             if (CollectionUtil.isEmpty(byUserId)) { |             if (CollectionUtil.isEmpty(byUserId)) { | ||||||
|                 return new TableDataInfo<>(); |                 return TableDataInfo.build(new ArrayList<>()); | ||||||
|             } |             } | ||||||
|             list1 = byUserId.stream().map(BusProjectTeamAppVo::getId).toList(); |             list1 = byUserId.stream().map(BusProjectTeamAppVo::getId).toList(); | ||||||
|         } |         } | ||||||
| @ -1394,6 +1394,7 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU | |||||||
|         SysUserBo sysUserBo = new SysUserBo(); |         SysUserBo sysUserBo = new SysUserBo(); | ||||||
|         sysUserBo.setUserId(userId); |         sysUserBo.setUserId(userId); | ||||||
|         sysUserBo.setNickName(user.getUserName()); |         sysUserBo.setNickName(user.getUserName()); | ||||||
|  |         sysUserBo.setSex(user.getSex()); | ||||||
|         userService.updateUser(sysUserBo); |         userService.updateUser(sysUserBo); | ||||||
|         return user.getId(); |         return user.getId(); | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -295,7 +295,7 @@ public class SubUserSalaryDetailServiceImpl extends ServiceImpl<SubUserSalaryDet | |||||||
|             List<BusProjectTeamAppVo> byUserId = projectTeamService.getByUserId(userId, dto.getProjectId()); |             List<BusProjectTeamAppVo> byUserId = projectTeamService.getByUserId(userId, dto.getProjectId()); | ||||||
|  |  | ||||||
|             if(CollectionUtil.isEmpty(byUserId)){ |             if(CollectionUtil.isEmpty(byUserId)){ | ||||||
|                 return new TableDataInfo<>(); |                 return  TableDataInfo.build(new ArrayList<>()); | ||||||
|             } |             } | ||||||
|             list1 = byUserId.stream().map(BusProjectTeamAppVo::getId).toList(); |             list1 = byUserId.stream().map(BusProjectTeamAppVo::getId).toList(); | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -0,0 +1,105 @@ | |||||||
|  | package org.dromara.design.controller; | ||||||
|  |  | ||||||
|  | import java.util.List; | ||||||
|  |  | ||||||
|  | import lombok.RequiredArgsConstructor; | ||||||
|  | import jakarta.servlet.http.HttpServletResponse; | ||||||
|  | import jakarta.validation.constraints.*; | ||||||
|  | import cn.dev33.satoken.annotation.SaCheckPermission; | ||||||
|  | import org.springframework.web.bind.annotation.*; | ||||||
|  | import org.springframework.validation.annotation.Validated; | ||||||
|  | import org.dromara.common.idempotent.annotation.RepeatSubmit; | ||||||
|  | import org.dromara.common.log.annotation.Log; | ||||||
|  | import org.dromara.common.web.core.BaseController; | ||||||
|  | import org.dromara.common.mybatis.core.page.PageQuery; | ||||||
|  | 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.log.enums.BusinessType; | ||||||
|  | import org.dromara.common.excel.utils.ExcelUtil; | ||||||
|  | import org.dromara.design.domain.vo.DesSmsRecordVo; | ||||||
|  | import org.dromara.design.domain.bo.DesSmsRecordBo; | ||||||
|  | import org.dromara.design.service.IDesSmsRecordService; | ||||||
|  | import org.dromara.common.mybatis.core.page.TableDataInfo; | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * 设计图纸短信记录 | ||||||
|  |  * | ||||||
|  |  * @author Lion Li | ||||||
|  |  * @date 2025-10-13 | ||||||
|  |  */ | ||||||
|  | @Validated | ||||||
|  | @RequiredArgsConstructor | ||||||
|  | @RestController | ||||||
|  | @RequestMapping("/design/smsRecord") | ||||||
|  | public class DesSmsRecordController extends BaseController { | ||||||
|  |  | ||||||
|  |     private final IDesSmsRecordService desSmsRecordService; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 查询设计图纸短信记录列表 | ||||||
|  |      */ | ||||||
|  |     @SaCheckPermission("design:smsRecord:list") | ||||||
|  |     @GetMapping("/list") | ||||||
|  |     public TableDataInfo<DesSmsRecordVo> list(DesSmsRecordBo bo, PageQuery pageQuery) { | ||||||
|  |         return desSmsRecordService.queryPageList(bo, pageQuery); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 导出设计图纸短信记录列表 | ||||||
|  |      */ | ||||||
|  |     @SaCheckPermission("design:smsRecord:export") | ||||||
|  |     @Log(title = "设计图纸短信记录", businessType = BusinessType.EXPORT) | ||||||
|  |     @PostMapping("/export") | ||||||
|  |     public void export(DesSmsRecordBo bo, HttpServletResponse response) { | ||||||
|  |         List<DesSmsRecordVo> list = desSmsRecordService.queryList(bo); | ||||||
|  |         ExcelUtil.exportExcel(list, "设计图纸短信记录", DesSmsRecordVo.class, response); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 获取设计图纸短信记录详细信息 | ||||||
|  |      * | ||||||
|  |      * @param id 主键 | ||||||
|  |      */ | ||||||
|  |     @SaCheckPermission("design:smsRecord:query") | ||||||
|  |     @GetMapping("/{id}") | ||||||
|  |     public R<DesSmsRecordVo> getInfo(@NotNull(message = "主键不能为空") | ||||||
|  |                                      @PathVariable Long id) { | ||||||
|  |         return R.ok(desSmsRecordService.queryById(id)); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 新增设计图纸短信记录 | ||||||
|  |      */ | ||||||
|  |     @SaCheckPermission("design:smsRecord:add") | ||||||
|  |     @Log(title = "设计图纸短信记录", businessType = BusinessType.INSERT) | ||||||
|  |     @RepeatSubmit() | ||||||
|  |     @PostMapping() | ||||||
|  |     public R<Void> add(@Validated(AddGroup.class) @RequestBody DesSmsRecordBo bo) { | ||||||
|  |         return toAjax(desSmsRecordService.insertByBo(bo)); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 修改设计图纸短信记录 | ||||||
|  |      */ | ||||||
|  |     @SaCheckPermission("design:smsRecord:edit") | ||||||
|  |     @Log(title = "设计图纸短信记录", businessType = BusinessType.UPDATE) | ||||||
|  |     @RepeatSubmit() | ||||||
|  |     @PutMapping() | ||||||
|  |     public R<Void> edit(@Validated(EditGroup.class) @RequestBody DesSmsRecordBo bo) { | ||||||
|  |         return toAjax(desSmsRecordService.updateByBo(bo)); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 删除设计图纸短信记录 | ||||||
|  |      * | ||||||
|  |      * @param ids 主键串 | ||||||
|  |      */ | ||||||
|  |     @SaCheckPermission("design:smsRecord:remove") | ||||||
|  |     @Log(title = "设计图纸短信记录", businessType = BusinessType.DELETE) | ||||||
|  |     @DeleteMapping("/{ids}") | ||||||
|  |     public R<Void> remove(@NotEmpty(message = "主键不能为空") | ||||||
|  |                           @PathVariable Long[] ids) { | ||||||
|  |         return toAjax(desSmsRecordService.deleteWithValidByIds(List.of(ids), true)); | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -40,12 +40,9 @@ public class DesVolumeFileAppController extends BaseController { | |||||||
|     private IDesVolumeFileService desVolumeFileService; |     private IDesVolumeFileService desVolumeFileService; | ||||||
|  |  | ||||||
|  |  | ||||||
|     /** |     @GetMapping("/joinList") | ||||||
|      * app图纸管理分页查询 |     public TableDataInfo<DesVolumeFileJoinVo> joinList(DesVolumeFileBo bo, PageQuery pageQuery) { | ||||||
|      */ |         return desVolumeFileService.queryJoinPageList(bo, pageQuery); | ||||||
|     @GetMapping("/list") |  | ||||||
|     public TableDataInfo<DesVolumeFileAppVo> list(DesVolumeFileAppPageDto dto, PageQuery pageQuery) { |  | ||||||
|         return desVolumeFileService.queryAppPageList(dto, pageQuery); |  | ||||||
|     } |     } | ||||||
|  |  | ||||||
| } | } | ||||||
|  | |||||||
| @ -0,0 +1,52 @@ | |||||||
|  | package org.dromara.design.controller.app; | ||||||
|  |  | ||||||
|  | import cn.dev33.satoken.annotation.SaCheckPermission; | ||||||
|  | import jakarta.servlet.http.HttpServletResponse; | ||||||
|  | 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; | ||||||
|  | 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.web.core.BaseController; | ||||||
|  | import org.dromara.design.domain.bo.DesVolumeFileViewerBo; | ||||||
|  | import org.dromara.design.domain.vo.volumefileviewer.DesVolumeFileViewerVo; | ||||||
|  | import org.dromara.design.service.IDesVolumeFileViewerService; | ||||||
|  | import org.springframework.validation.annotation.Validated; | ||||||
|  | import org.springframework.web.bind.annotation.*; | ||||||
|  |  | ||||||
|  | import java.util.List; | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * 卷册文件查阅人 | ||||||
|  |  * | ||||||
|  |  * @author lilemy | ||||||
|  |  * @date 2025-08-14 | ||||||
|  |  */ | ||||||
|  | @Validated | ||||||
|  | @RequiredArgsConstructor | ||||||
|  | @RestController | ||||||
|  | @RequestMapping("/app/design/volumeFileViewer") | ||||||
|  | public class DesVolumeFileViewerAppController extends BaseController { | ||||||
|  |  | ||||||
|  |     private final IDesVolumeFileViewerService desVolumeFileViewerService; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 新增卷册文件查阅人 | ||||||
|  |      */ | ||||||
|  |     @Log(title = "卷册文件查阅人", businessType = BusinessType.INSERT) | ||||||
|  |     @RepeatSubmit() | ||||||
|  |     @PostMapping() | ||||||
|  |     public R<Void> add(@Validated(AddGroup.class) @RequestBody DesVolumeFileViewerBo bo) { | ||||||
|  |         return toAjax(desVolumeFileViewerService.insertByBo(bo)); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  | } | ||||||
|  |  | ||||||
|  |  | ||||||
| @ -0,0 +1,46 @@ | |||||||
|  | package org.dromara.design.domain; | ||||||
|  |  | ||||||
|  | import org.dromara.common.mybatis.core.domain.BaseEntity; | ||||||
|  | import com.baomidou.mybatisplus.annotation.*; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.EqualsAndHashCode; | ||||||
|  |  | ||||||
|  | import java.io.Serial; | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * 设计图纸短信记录对象 des_sms_record | ||||||
|  |  * | ||||||
|  |  * @author Lion Li | ||||||
|  |  * @date 2025-10-13 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @EqualsAndHashCode(callSuper = true) | ||||||
|  | @TableName("des_sms_record") | ||||||
|  | public class DesSmsRecord extends BaseEntity { | ||||||
|  |  | ||||||
|  |     @Serial | ||||||
|  |     private static final long serialVersionUID = 1L; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 主键ID | ||||||
|  |      */ | ||||||
|  |     @TableId(value = "id") | ||||||
|  |     private Long id; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 图纸id | ||||||
|  |      */ | ||||||
|  |     private Long volumeFileId; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 0-不需要再次发送 1-需要再次发送 | ||||||
|  |      */ | ||||||
|  |     private String again; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 用户类型(1-项目经理,2-设计部主任) | ||||||
|  |      */ | ||||||
|  |     private String type; | ||||||
|  |  | ||||||
|  |  | ||||||
|  | } | ||||||
| @ -0,0 +1,46 @@ | |||||||
|  | package org.dromara.design.domain.bo; | ||||||
|  |  | ||||||
|  | import org.dromara.design.domain.DesSmsRecord; | ||||||
|  | import org.dromara.common.mybatis.core.domain.BaseEntity; | ||||||
|  | import org.dromara.common.core.validate.AddGroup; | ||||||
|  | import org.dromara.common.core.validate.EditGroup; | ||||||
|  | import io.github.linpeilie.annotations.AutoMapper; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.EqualsAndHashCode; | ||||||
|  | import jakarta.validation.constraints.*; | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * 设计图纸短信记录业务对象 des_sms_record | ||||||
|  |  * | ||||||
|  |  * @author Lion Li | ||||||
|  |  * @date 2025-10-13 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @EqualsAndHashCode(callSuper = true) | ||||||
|  | @AutoMapper(target = DesSmsRecord.class, reverseConvertGenerate = false) | ||||||
|  | public class DesSmsRecordBo extends BaseEntity { | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 主键ID | ||||||
|  |      */ | ||||||
|  |     @NotNull(message = "主键ID不能为空", groups = { EditGroup.class }) | ||||||
|  |     private Long id; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 图纸id | ||||||
|  |      */ | ||||||
|  |     @NotNull(message = "图纸id不能为空", groups = { AddGroup.class, EditGroup.class }) | ||||||
|  |     private Long volumeFileId; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 0-不需要再次发送 1-需要再次发送 | ||||||
|  |      */ | ||||||
|  |     private String again; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 用户类型(1-项目经理,2-设计部主任) | ||||||
|  |      */ | ||||||
|  |     private String type; | ||||||
|  |  | ||||||
|  |  | ||||||
|  | } | ||||||
| @ -62,7 +62,7 @@ public class DesVolumeFileBo extends BaseEntity { | |||||||
|  |  | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|      * 备注 |      * 项目id | ||||||
|      */ |      */ | ||||||
|     private Long projectId; |     private Long projectId; | ||||||
|  |  | ||||||
| @ -78,6 +78,9 @@ public class DesVolumeFileBo extends BaseEntity { | |||||||
|     private String documentName; |     private String documentName; | ||||||
|  |  | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 审核状态 | ||||||
|  |      */ | ||||||
|     private String auditStatus; |     private String auditStatus; | ||||||
|  |  | ||||||
| } | } | ||||||
|  | |||||||
| @ -0,0 +1,56 @@ | |||||||
|  | package org.dromara.design.domain.vo; | ||||||
|  |  | ||||||
|  | import org.dromara.design.domain.DesSmsRecord; | ||||||
|  | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||||||
|  | import com.alibaba.excel.annotation.ExcelProperty; | ||||||
|  | import org.dromara.common.excel.annotation.ExcelDictFormat; | ||||||
|  | import org.dromara.common.excel.convert.ExcelDictConvert; | ||||||
|  | import io.github.linpeilie.annotations.AutoMapper; | ||||||
|  | import lombok.Data; | ||||||
|  |  | ||||||
|  | import java.io.Serial; | ||||||
|  | import java.io.Serializable; | ||||||
|  | import java.util.Date; | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * 设计图纸短信记录视图对象 des_sms_record | ||||||
|  |  * | ||||||
|  |  * @author Lion Li | ||||||
|  |  * @date 2025-10-13 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @ExcelIgnoreUnannotated | ||||||
|  | @AutoMapper(target = DesSmsRecord.class) | ||||||
|  | public class DesSmsRecordVo implements Serializable { | ||||||
|  |  | ||||||
|  |     @Serial | ||||||
|  |     private static final long serialVersionUID = 1L; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 主键ID | ||||||
|  |      */ | ||||||
|  |     @ExcelProperty(value = "主键ID") | ||||||
|  |     private Long id; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 图纸id | ||||||
|  |      */ | ||||||
|  |     @ExcelProperty(value = "图纸id") | ||||||
|  |     private Long volumeFileId; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 0-不需要再次发送 1-需要再次发送 | ||||||
|  |      */ | ||||||
|  |     @ExcelProperty(value = "0-不需要再次发送 1-需要再次发送") | ||||||
|  |     private String again; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 用户类型(1-项目经理,2-设计部主任) | ||||||
|  |      */ | ||||||
|  |     @ExcelProperty(value = "用户类型(1-项目经理,2-设计部主任)") | ||||||
|  |     private String type; | ||||||
|  |  | ||||||
|  |  | ||||||
|  | } | ||||||
| @ -0,0 +1,15 @@ | |||||||
|  | package org.dromara.design.mapper; | ||||||
|  |  | ||||||
|  | import org.dromara.design.domain.DesSmsRecord; | ||||||
|  | import org.dromara.design.domain.vo.DesSmsRecordVo; | ||||||
|  | import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * 设计图纸短信记录Mapper接口 | ||||||
|  |  * | ||||||
|  |  * @author Lion Li | ||||||
|  |  * @date 2025-10-13 | ||||||
|  |  */ | ||||||
|  | public interface DesSmsRecordMapper extends BaseMapperPlus<DesSmsRecord, DesSmsRecordVo> { | ||||||
|  |  | ||||||
|  | } | ||||||
| @ -0,0 +1,81 @@ | |||||||
|  | package org.dromara.design.service; | ||||||
|  |  | ||||||
|  | import org.dromara.design.domain.vo.DesSmsRecordVo; | ||||||
|  | import org.dromara.design.domain.bo.DesSmsRecordBo; | ||||||
|  | import org.dromara.design.domain.DesSmsRecord; | ||||||
|  | import org.dromara.common.mybatis.core.page.TableDataInfo; | ||||||
|  | import org.dromara.common.mybatis.core.page.PageQuery; | ||||||
|  |  | ||||||
|  | import com.baomidou.mybatisplus.extension.service.IService; | ||||||
|  | import java.util.Collection; | ||||||
|  | import java.util.List; | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * 设计图纸短信记录Service接口 | ||||||
|  |  * | ||||||
|  |  * @author Lion Li | ||||||
|  |  * @date 2025-10-13 | ||||||
|  |  */ | ||||||
|  | public interface IDesSmsRecordService extends IService<DesSmsRecord>{ | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 查询设计图纸短信记录 | ||||||
|  |      * | ||||||
|  |      * @param id 主键 | ||||||
|  |      * @return 设计图纸短信记录 | ||||||
|  |      */ | ||||||
|  |     DesSmsRecordVo queryById(Long id); | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 分页查询设计图纸短信记录列表 | ||||||
|  |      * | ||||||
|  |      * @param bo        查询条件 | ||||||
|  |      * @param pageQuery 分页参数 | ||||||
|  |      * @return 设计图纸短信记录分页列表 | ||||||
|  |      */ | ||||||
|  |     TableDataInfo<DesSmsRecordVo> queryPageList(DesSmsRecordBo bo, PageQuery pageQuery); | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 查询符合条件的设计图纸短信记录列表 | ||||||
|  |      * | ||||||
|  |      * @param bo 查询条件 | ||||||
|  |      * @return 设计图纸短信记录列表 | ||||||
|  |      */ | ||||||
|  |     List<DesSmsRecordVo> queryList(DesSmsRecordBo bo); | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 新增设计图纸短信记录 | ||||||
|  |      * | ||||||
|  |      * @param bo 设计图纸短信记录 | ||||||
|  |      * @return 是否新增成功 | ||||||
|  |      */ | ||||||
|  |     Boolean insertByBo(DesSmsRecordBo bo); | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 修改设计图纸短信记录 | ||||||
|  |      * | ||||||
|  |      * @param bo 设计图纸短信记录 | ||||||
|  |      * @return 是否修改成功 | ||||||
|  |      */ | ||||||
|  |     Boolean updateByBo(DesSmsRecordBo bo); | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 校验并批量删除设计图纸短信记录信息 | ||||||
|  |      * | ||||||
|  |      * @param ids     待删除的主键集合 | ||||||
|  |      * @param isValid 是否进行有效性校验 | ||||||
|  |      * @return 是否删除成功 | ||||||
|  |      */ | ||||||
|  |     Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); | ||||||
|  |  | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 创建短信记录 | ||||||
|  |      * | ||||||
|  |      * @param volumeFileId 卷册文件id | ||||||
|  |      */ | ||||||
|  |     void createSmsRecord(Long volumeFileId); | ||||||
|  |  | ||||||
|  |  | ||||||
|  |     void updateSmsRecord(Long volumeFileId); | ||||||
|  | } | ||||||
| @ -0,0 +1,228 @@ | |||||||
|  | package org.dromara.design.service.impl; | ||||||
|  |  | ||||||
|  | import cn.hutool.core.collection.CollectionUtil; | ||||||
|  | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||||
|  | import jakarta.annotation.Resource; | ||||||
|  | import org.dromara.common.core.utils.MapstructUtils; | ||||||
|  | import org.dromara.common.core.utils.StringUtils; | ||||||
|  | import org.dromara.common.mybatis.core.page.TableDataInfo; | ||||||
|  | import org.dromara.common.mybatis.core.page.PageQuery; | ||||||
|  | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||||
|  | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||||||
|  | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||||
|  | import lombok.RequiredArgsConstructor; | ||||||
|  | import org.dromara.design.domain.DesVolumeCatalog; | ||||||
|  | import org.dromara.design.domain.DesVolumeFile; | ||||||
|  | import org.dromara.design.domain.DesVolumeFileViewer; | ||||||
|  | import org.dromara.design.service.IDesVolumeCatalogService; | ||||||
|  | import org.dromara.design.service.IDesVolumeFileService; | ||||||
|  | import org.dromara.design.service.IDesVolumeFileViewerService; | ||||||
|  | import org.dromara.system.domain.SysUser; | ||||||
|  | import org.dromara.system.service.ISysRoleService; | ||||||
|  | import org.dromara.system.service.ISysUserService; | ||||||
|  | import org.springframework.context.annotation.Lazy; | ||||||
|  | import org.springframework.scheduling.annotation.Async; | ||||||
|  | import org.springframework.stereotype.Service; | ||||||
|  | import org.dromara.design.domain.bo.DesSmsRecordBo; | ||||||
|  | import org.dromara.design.domain.vo.DesSmsRecordVo; | ||||||
|  | import org.dromara.design.domain.DesSmsRecord; | ||||||
|  | import org.dromara.design.mapper.DesSmsRecordMapper; | ||||||
|  | import org.dromara.design.service.IDesSmsRecordService; | ||||||
|  |  | ||||||
|  | import java.util.ArrayList; | ||||||
|  | import java.util.List; | ||||||
|  | import java.util.Map; | ||||||
|  | import java.util.Collection; | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * 设计图纸短信记录Service业务层处理 | ||||||
|  |  * | ||||||
|  |  * @author Lion Li | ||||||
|  |  * @date 2025-10-13 | ||||||
|  |  */ | ||||||
|  | @RequiredArgsConstructor | ||||||
|  | @Service | ||||||
|  | public class DesSmsRecordServiceImpl extends ServiceImpl<DesSmsRecordMapper, DesSmsRecord> implements IDesSmsRecordService { | ||||||
|  |  | ||||||
|  |     private final DesSmsRecordMapper baseMapper; | ||||||
|  |  | ||||||
|  |     @Resource | ||||||
|  |     @Lazy | ||||||
|  |     private IDesVolumeFileViewerService volumeFileViewerService; | ||||||
|  |  | ||||||
|  |     @Resource | ||||||
|  |     @Lazy | ||||||
|  |     private ISysRoleService roleService; | ||||||
|  |  | ||||||
|  |     @Resource | ||||||
|  |     @Lazy | ||||||
|  |     private ISysUserService userService; | ||||||
|  |  | ||||||
|  |     @Resource | ||||||
|  |     @Lazy | ||||||
|  |     private IDesVolumeFileService designFileService; | ||||||
|  |  | ||||||
|  |     @Resource | ||||||
|  |     @Lazy | ||||||
|  |     private IDesVolumeCatalogService volumeCatalogService; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 查询设计图纸短信记录 | ||||||
|  |      * | ||||||
|  |      * @param id 主键 | ||||||
|  |      * @return 设计图纸短信记录 | ||||||
|  |      */ | ||||||
|  |     @Override | ||||||
|  |     public DesSmsRecordVo queryById(Long id) { | ||||||
|  |         return baseMapper.selectVoById(id); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 分页查询设计图纸短信记录列表 | ||||||
|  |      * | ||||||
|  |      * @param bo        查询条件 | ||||||
|  |      * @param pageQuery 分页参数 | ||||||
|  |      * @return 设计图纸短信记录分页列表 | ||||||
|  |      */ | ||||||
|  |     @Override | ||||||
|  |     public TableDataInfo<DesSmsRecordVo> queryPageList(DesSmsRecordBo bo, PageQuery pageQuery) { | ||||||
|  |         LambdaQueryWrapper<DesSmsRecord> lqw = buildQueryWrapper(bo); | ||||||
|  |         Page<DesSmsRecordVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); | ||||||
|  |         return TableDataInfo.build(result); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 查询符合条件的设计图纸短信记录列表 | ||||||
|  |      * | ||||||
|  |      * @param bo 查询条件 | ||||||
|  |      * @return 设计图纸短信记录列表 | ||||||
|  |      */ | ||||||
|  |     @Override | ||||||
|  |     public List<DesSmsRecordVo> queryList(DesSmsRecordBo bo) { | ||||||
|  |         LambdaQueryWrapper<DesSmsRecord> lqw = buildQueryWrapper(bo); | ||||||
|  |         return baseMapper.selectVoList(lqw); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     private LambdaQueryWrapper<DesSmsRecord> buildQueryWrapper(DesSmsRecordBo bo) { | ||||||
|  |         Map<String, Object> params = bo.getParams(); | ||||||
|  |         LambdaQueryWrapper<DesSmsRecord> lqw = Wrappers.lambdaQuery(); | ||||||
|  |         lqw.orderByDesc(DesSmsRecord::getId); | ||||||
|  |         lqw.eq(bo.getVolumeFileId() != null, DesSmsRecord::getVolumeFileId, bo.getVolumeFileId()); | ||||||
|  |         lqw.eq(StringUtils.isNotBlank(bo.getAgain()), DesSmsRecord::getAgain, bo.getAgain()); | ||||||
|  |         lqw.eq(StringUtils.isNotBlank(bo.getType()), DesSmsRecord::getType, bo.getType()); | ||||||
|  |         return lqw; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 新增设计图纸短信记录 | ||||||
|  |      * | ||||||
|  |      * @param bo 设计图纸短信记录 | ||||||
|  |      * @return 是否新增成功 | ||||||
|  |      */ | ||||||
|  |     @Override | ||||||
|  |     public Boolean insertByBo(DesSmsRecordBo bo) { | ||||||
|  |         DesSmsRecord add = MapstructUtils.convert(bo, DesSmsRecord.class); | ||||||
|  |         validEntityBeforeSave(add); | ||||||
|  |         boolean flag = baseMapper.insert(add) > 0; | ||||||
|  |         if (flag) { | ||||||
|  |             bo.setId(add.getId()); | ||||||
|  |         } | ||||||
|  |         return flag; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 修改设计图纸短信记录 | ||||||
|  |      * | ||||||
|  |      * @param bo 设计图纸短信记录 | ||||||
|  |      * @return 是否修改成功 | ||||||
|  |      */ | ||||||
|  |     @Override | ||||||
|  |     public Boolean updateByBo(DesSmsRecordBo bo) { | ||||||
|  |         DesSmsRecord update = MapstructUtils.convert(bo, DesSmsRecord.class); | ||||||
|  |         validEntityBeforeSave(update); | ||||||
|  |         return baseMapper.updateById(update) > 0; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 保存前的数据校验 | ||||||
|  |      */ | ||||||
|  |     private void validEntityBeforeSave(DesSmsRecord entity) { | ||||||
|  |         //TODO 做一些数据校验,如唯一约束 | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 校验并批量删除设计图纸短信记录信息 | ||||||
|  |      * | ||||||
|  |      * @param ids     待删除的主键集合 | ||||||
|  |      * @param isValid 是否进行有效性校验 | ||||||
|  |      * @return 是否删除成功 | ||||||
|  |      */ | ||||||
|  |     @Override | ||||||
|  |     public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { | ||||||
|  |         if (isValid) { | ||||||
|  |             //TODO 做一些业务上的校验,判断是否需要校验 | ||||||
|  |         } | ||||||
|  |         return baseMapper.deleteByIds(ids) > 0; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     @Override | ||||||
|  |     @Async | ||||||
|  |     public void createSmsRecord(Long volumeFileId) { | ||||||
|  |  | ||||||
|  |         List<DesSmsRecord> desSmsRecords = new ArrayList<>(); | ||||||
|  |  | ||||||
|  |         DesSmsRecord desSmsRecord = new DesSmsRecord(); | ||||||
|  |         desSmsRecord.setVolumeFileId(volumeFileId); | ||||||
|  |         desSmsRecord.setAgain("1"); | ||||||
|  |         desSmsRecord.setType("1"); | ||||||
|  |         desSmsRecords.add(desSmsRecord); | ||||||
|  |  | ||||||
|  |         DesSmsRecord desSmsRecord1 = new DesSmsRecord(); | ||||||
|  |         desSmsRecord1.setVolumeFileId(volumeFileId); | ||||||
|  |         desSmsRecord1.setAgain("1"); | ||||||
|  |         desSmsRecord1.setType("2"); | ||||||
|  |  | ||||||
|  |         desSmsRecords.add(desSmsRecord1); | ||||||
|  |         baseMapper.insertBatch(desSmsRecords); | ||||||
|  |  | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     @Override | ||||||
|  |     @Async | ||||||
|  |     public void updateSmsRecord(Long volumeFileId) { | ||||||
|  |         List<DesSmsRecord> desSmsRecords = baseMapper.selectList(Wrappers.<DesSmsRecord>lambdaQuery() | ||||||
|  |             .eq(DesSmsRecord::getVolumeFileId, volumeFileId) | ||||||
|  |             .eq(DesSmsRecord::getAgain, "1") | ||||||
|  |         ); | ||||||
|  |         for (DesSmsRecord record : desSmsRecords) { | ||||||
|  |             DesVolumeFile desVolumeFile = designFileService.getById(record.getVolumeFileId()); | ||||||
|  |             DesVolumeCatalog desVolumeCatalog = volumeCatalogService.getById(desVolumeFile.getVolumeCatalogId()); | ||||||
|  |  | ||||||
|  |             List<Long> longs = new ArrayList<>(); | ||||||
|  |             if (record.getType().equals("1")) { | ||||||
|  |                 longs = roleService.selectRoleIdsByName("项目经理"); | ||||||
|  |             } else { | ||||||
|  |                 longs.add(1961028169115197442L); | ||||||
|  |             } | ||||||
|  |             if (CollectionUtil.isEmpty(longs)) { | ||||||
|  |                 continue; | ||||||
|  |             } | ||||||
|  |             List<SysUser> sysUsers = userService.selectUserByRoleIdsAndProjectId(longs, desVolumeCatalog.getProjectId()); | ||||||
|  |             List<Long> userIds = sysUsers.stream().map(SysUser::getUserId).toList(); | ||||||
|  |             if (CollectionUtil.isEmpty(userIds)) { | ||||||
|  |                 continue; | ||||||
|  |             } | ||||||
|  |             List<DesVolumeFileViewer> list = volumeFileViewerService.list(Wrappers.lambdaQuery(DesVolumeFileViewer.class) | ||||||
|  |                 .eq(DesVolumeFileViewer::getVolumeFileId, record.getVolumeFileId()) | ||||||
|  |                 .in(DesVolumeFileViewer::getUserId, userIds) | ||||||
|  |             ); | ||||||
|  |             List<Long> list1 = list.stream().map(DesVolumeFileViewer::getUserId).toList(); | ||||||
|  |  | ||||||
|  |             List<SysUser> list2 = sysUsers.stream().filter(vo -> !list1.contains(vo.getUserId())).toList(); | ||||||
|  |             if (list2.isEmpty()) { | ||||||
|  |                 record.setAgain("0"); | ||||||
|  |                 baseMapper.updateById(record); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -34,10 +34,7 @@ import org.dromara.design.domain.dto.volumefile.DesVolumeFileCreateReq; | |||||||
| import org.dromara.design.domain.vo.BusDrawingreviewReceiptsVo; | import org.dromara.design.domain.vo.BusDrawingreviewReceiptsVo; | ||||||
| import org.dromara.design.domain.vo.volumefile.*; | import org.dromara.design.domain.vo.volumefile.*; | ||||||
| import org.dromara.design.mapper.DesVolumeFileMapper; | import org.dromara.design.mapper.DesVolumeFileMapper; | ||||||
| import org.dromara.design.service.IBusDrawingreviewReceiptsService; | import org.dromara.design.service.*; | ||||||
| import org.dromara.design.service.IDesDrawingService; |  | ||||||
| import org.dromara.design.service.IDesVolumeCatalogService; |  | ||||||
| import org.dromara.design.service.IDesVolumeFileService; |  | ||||||
| import org.dromara.project.domain.BusProject; | import org.dromara.project.domain.BusProject; | ||||||
| import org.dromara.project.service.IBusProjectService; | import org.dromara.project.service.IBusProjectService; | ||||||
| import org.dromara.system.domain.SysUser; | import org.dromara.system.domain.SysUser; | ||||||
| @ -95,6 +92,9 @@ public class DesVolumeFileServiceImpl extends ServiceImpl<DesVolumeFileMapper, D | |||||||
|     @Resource |     @Resource | ||||||
|     private ISysRoleService roleService; |     private ISysRoleService roleService; | ||||||
|  |  | ||||||
|  |     @Resource | ||||||
|  |     private IDesSmsRecordService desSmsRecordService; | ||||||
|  |  | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|      * 分页查询卷册文件列表 |      * 分页查询卷册文件列表 | ||||||
| @ -626,7 +626,8 @@ public class DesVolumeFileServiceImpl extends ServiceImpl<DesVolumeFileMapper, D | |||||||
|  |  | ||||||
|             List<SysUser> sysUsers = userService.selectUserByRoleIdsAndProjectId(longs, byId.getProjectId()); |             List<SysUser> sysUsers = userService.selectUserByRoleIdsAndProjectId(longs, byId.getProjectId()); | ||||||
|             asyncUtil.sendSms(sysUsers.stream().map(SysUser::getPhonenumber).toList(), "config5"); |             asyncUtil.sendSms(sysUsers.stream().map(SysUser::getPhonenumber).toList(), "config5"); | ||||||
|             asyncUtil.sendSse(sysUsers.stream().map(SysUser::getUserId).toList(), "有新的蓝图审批完成"); |             asyncUtil.sendSse(sysUsers.stream().map(SysUser::getUserId).toList(), "有新的过程图纸审批完成"); | ||||||
|  |             desSmsRecordService.createSmsRecord(desVolumeFile.getId()); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|     } |     } | ||||||
| @ -698,6 +699,7 @@ public class DesVolumeFileServiceImpl extends ServiceImpl<DesVolumeFileMapper, D | |||||||
|             List<SysUser> sysUsers = userService.selectUserByRoleIdsAndProjectId(longs, byId.getProjectId()); |             List<SysUser> sysUsers = userService.selectUserByRoleIdsAndProjectId(longs, byId.getProjectId()); | ||||||
|             asyncUtil.sendSms(sysUsers.stream().map(SysUser::getPhonenumber).toList(), "config5"); |             asyncUtil.sendSms(sysUsers.stream().map(SysUser::getPhonenumber).toList(), "config5"); | ||||||
|             asyncUtil.sendSse(sysUsers.stream().map(SysUser::getUserId).toList(), "有新的蓝图审批完成"); |             asyncUtil.sendSse(sysUsers.stream().map(SysUser::getUserId).toList(), "有新的蓝图审批完成"); | ||||||
|  |             desSmsRecordService.createSmsRecord(desVolumeFile.getId()); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -3,6 +3,7 @@ package org.dromara.design.service.impl; | |||||||
|  |  | ||||||
|  |  | ||||||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||||
|  | import jakarta.annotation.Resource; | ||||||
| import org.dromara.common.core.utils.MapstructUtils; | import org.dromara.common.core.utils.MapstructUtils; | ||||||
| import org.dromara.common.core.utils.StringUtils; | import org.dromara.common.core.utils.StringUtils; | ||||||
| import org.dromara.common.mybatis.core.page.TableDataInfo; | import org.dromara.common.mybatis.core.page.TableDataInfo; | ||||||
| @ -13,6 +14,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||||||
| import lombok.RequiredArgsConstructor; | import lombok.RequiredArgsConstructor; | ||||||
| import org.dromara.common.satoken.utils.LoginHelper; | import org.dromara.common.satoken.utils.LoginHelper; | ||||||
| import org.dromara.design.domain.vo.volumefileviewer.DesVolumeFileViewerVo; | import org.dromara.design.domain.vo.volumefileviewer.DesVolumeFileViewerVo; | ||||||
|  | import org.dromara.design.service.IDesSmsRecordService; | ||||||
|  | import org.springframework.context.annotation.Lazy; | ||||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||||
| import org.dromara.design.domain.bo.DesVolumeFileViewerBo; | import org.dromara.design.domain.bo.DesVolumeFileViewerBo; | ||||||
|  |  | ||||||
| @ -36,6 +39,8 @@ public class DesVolumeFileViewerServiceImpl extends ServiceImpl<DesVolumeFileVie | |||||||
|  |  | ||||||
|     private final DesVolumeFileViewerMapper baseMapper; |     private final DesVolumeFileViewerMapper baseMapper; | ||||||
|  |  | ||||||
|  |     private final IDesSmsRecordService desSmsRecordService; | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|      * 查询卷册文件查阅人 |      * 查询卷册文件查阅人 | ||||||
|      * |      * | ||||||
| @ -98,6 +103,7 @@ public class DesVolumeFileViewerServiceImpl extends ServiceImpl<DesVolumeFileVie | |||||||
|         if (flag) { |         if (flag) { | ||||||
|             bo.setId(add.getId()); |             bo.setId(add.getId()); | ||||||
|         } |         } | ||||||
|  |         desSmsRecordService.updateSmsRecord(bo.getVolumeFileId()); | ||||||
|         return flag; |         return flag; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  | |||||||
| @ -0,0 +1,99 @@ | |||||||
|  | package org.dromara.job.design; | ||||||
|  |  | ||||||
|  | import cn.hutool.core.collection.CollectionUtil; | ||||||
|  | import com.aizuda.snailjob.client.job.core.annotation.JobExecutor; | ||||||
|  | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||||
|  | import jakarta.annotation.Resource; | ||||||
|  | import lombok.extern.slf4j.Slf4j; | ||||||
|  | import org.dromara.common.utils.AsyncUtil; | ||||||
|  | import org.dromara.design.domain.DesSmsRecord; | ||||||
|  | import org.dromara.design.domain.DesVolumeCatalog; | ||||||
|  | import org.dromara.design.domain.DesVolumeFile; | ||||||
|  | import org.dromara.design.domain.DesVolumeFileViewer; | ||||||
|  | import org.dromara.design.service.IDesSmsRecordService; | ||||||
|  | import org.dromara.design.service.IDesVolumeCatalogService; | ||||||
|  | import org.dromara.design.service.IDesVolumeFileService; | ||||||
|  | import org.dromara.design.service.IDesVolumeFileViewerService; | ||||||
|  | import org.dromara.system.domain.SysUser; | ||||||
|  | import org.dromara.system.service.ISysRoleService; | ||||||
|  | import org.dromara.system.service.ISysUserService; | ||||||
|  | import org.springframework.stereotype.Component; | ||||||
|  |  | ||||||
|  | import java.util.ArrayList; | ||||||
|  | import java.util.Date; | ||||||
|  | import java.util.List; | ||||||
|  |  | ||||||
|  | @Slf4j | ||||||
|  | @Component | ||||||
|  | public class DesignFileJob { | ||||||
|  |  | ||||||
|  |     @Resource | ||||||
|  |     private IDesSmsRecordService desSmsRecordService; | ||||||
|  |     @Resource | ||||||
|  |     private IDesVolumeFileService designFileService; | ||||||
|  |     @Resource | ||||||
|  |     private IDesVolumeFileViewerService volumeFileViewerService; | ||||||
|  |     @Resource | ||||||
|  |     private IDesVolumeCatalogService volumeCatalogService; | ||||||
|  |     @Resource | ||||||
|  |     private ISysRoleService roleService; | ||||||
|  |  | ||||||
|  |     @Resource | ||||||
|  |     private ISysUserService userService; | ||||||
|  |  | ||||||
|  |     @Resource | ||||||
|  |     private AsyncUtil asyncUtil; | ||||||
|  |  | ||||||
|  |  | ||||||
|  |     @JobExecutor(name = "designFileSms") | ||||||
|  |     public void designFileSms() { | ||||||
|  |         log.info("执行定时任务:设计图纸查看短信提醒"); | ||||||
|  |  | ||||||
|  |         //查询到时间的记录 | ||||||
|  |         // 计算3天前的时间(当前时间 - 3天的毫秒数) | ||||||
|  |         long threeDaysMillis = 3L * 24 * 60 * 60 * 1000; // 3天的毫秒数 | ||||||
|  |         Date threeDaysAgo = new Date(System.currentTimeMillis() - threeDaysMillis); | ||||||
|  |  | ||||||
|  |         // 查询条件:again为"1",且创建时间 <= 3天前 | ||||||
|  |         List<DesSmsRecord> records = desSmsRecordService.list(Wrappers.lambdaQuery(DesSmsRecord.class) | ||||||
|  |             .eq(DesSmsRecord::getAgain, "1") | ||||||
|  |             .le(DesSmsRecord::getCreateTime, threeDaysAgo) // Date类型直接比较 | ||||||
|  |         ); | ||||||
|  |         for (DesSmsRecord record : records) { | ||||||
|  |             DesVolumeFile desVolumeFile = designFileService.getById(record.getVolumeFileId()); | ||||||
|  |             DesVolumeCatalog desVolumeCatalog = volumeCatalogService.getById(desVolumeFile.getVolumeCatalogId()); | ||||||
|  |  | ||||||
|  |             List<Long> longs = new ArrayList<>(); | ||||||
|  |             if(record.getType().equals("1")){ | ||||||
|  |                 longs = roleService.selectRoleIdsByName("项目经理"); | ||||||
|  |             }else { | ||||||
|  |                 longs.add(1961028169115197442L); | ||||||
|  |             } | ||||||
|  |             if(CollectionUtil.isEmpty(longs)){ | ||||||
|  |                 continue; | ||||||
|  |             } | ||||||
|  |             List<SysUser> sysUsers = userService.selectUserByRoleIdsAndProjectId(longs, desVolumeCatalog.getProjectId()); | ||||||
|  |             List<Long> userIds = sysUsers.stream().map(SysUser::getUserId).toList(); | ||||||
|  |             if(CollectionUtil.isEmpty(userIds)){ | ||||||
|  |                 continue; | ||||||
|  |             } | ||||||
|  |  | ||||||
|  |             List<DesVolumeFileViewer> list = volumeFileViewerService.list(Wrappers.lambdaQuery(DesVolumeFileViewer.class) | ||||||
|  |                 .eq(DesVolumeFileViewer::getVolumeFileId, record.getVolumeFileId()) | ||||||
|  |                 .in(DesVolumeFileViewer::getUserId, userIds) | ||||||
|  |             ); | ||||||
|  |             List<Long> list1 = list.stream().map(DesVolumeFileViewer::getUserId).toList(); | ||||||
|  |             //找出没有查看的人 发送短信 | ||||||
|  |             List<SysUser> list2 = sysUsers.stream().filter(vo -> !list1.contains(vo.getUserId())).toList(); | ||||||
|  |             asyncUtil.sendSms(list2.stream().map(SysUser::getPhonenumber).toList(), "config5"); | ||||||
|  |  | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         List<Long> list1 = records.stream().map(DesSmsRecord::getId).toList(); | ||||||
|  |  | ||||||
|  |         desSmsRecordService.lambdaUpdate().in(DesSmsRecord::getId, list1) | ||||||
|  |             .set(DesSmsRecord::getAgain, "0").update(); | ||||||
|  |  | ||||||
|  |         log.info("定时任务:设计图纸查看短信提醒 完成"); | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -63,6 +63,13 @@ public class BusLeaveAppController extends BaseController { | |||||||
|         return leaveService.listByAuditRole(req, pageQuery); |         return leaveService.listByAuditRole(req, pageQuery); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 获取请假信息 | ||||||
|  |      */ | ||||||
|  |     @GetMapping("/{id}") | ||||||
|  |     public R<BusLeaveVo> queryById(@PathVariable Long id) { | ||||||
|  |         return R.ok(leaveService.queryById(id)); | ||||||
|  |     } | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|      * 提交请假 |      * 提交请假 | ||||||
|  | |||||||
| @ -12,4 +12,7 @@ public class BusLeaveAuditDto { | |||||||
|      * 意见(1未读 2同意 3拒绝) |      * 意见(1未读 2同意 3拒绝) | ||||||
|      */ |      */ | ||||||
|     private String gangerOpinion; |     private String gangerOpinion; | ||||||
|  |  | ||||||
|  |     private String gangerExplain; | ||||||
|  |  | ||||||
| } | } | ||||||
|  | |||||||
| @ -77,5 +77,5 @@ public class BusReissueCardUpdateReq implements Serializable { | |||||||
|      */ |      */ | ||||||
|     private LocalDate date; |     private LocalDate date; | ||||||
|  |  | ||||||
|  |     private String gangerExplain; | ||||||
| } | } | ||||||
|  | |||||||
| @ -7,11 +7,13 @@ import lombok.Data; | |||||||
| import org.dromara.common.excel.annotation.ExcelDictFormat; | import org.dromara.common.excel.annotation.ExcelDictFormat; | ||||||
| import org.dromara.common.excel.convert.ExcelDictConvert; | import org.dromara.common.excel.convert.ExcelDictConvert; | ||||||
| import org.dromara.project.domain.BusLeave; | import org.dromara.project.domain.BusLeave; | ||||||
|  | import org.dromara.project.domain.vo.reissuecard.AuditUserVo; | ||||||
|  |  | ||||||
| import java.io.Serial; | import java.io.Serial; | ||||||
| import java.io.Serializable; | import java.io.Serializable; | ||||||
| import java.time.LocalDateTime; | import java.time.LocalDateTime; | ||||||
| import java.util.Date; | import java.util.Date; | ||||||
|  | import java.util.List; | ||||||
|  |  | ||||||
|  |  | ||||||
| /** | /** | ||||||
| @ -155,11 +157,20 @@ public class BusLeaveVo implements Serializable { | |||||||
|     @ExcelProperty(value = "备注") |     @ExcelProperty(value = "备注") | ||||||
|     private String remark; |     private String remark; | ||||||
|  |  | ||||||
|     /** |  | ||||||
|      * 审核状态 |  | ||||||
|      */ |  | ||||||
|     /** |     /** | ||||||
|      * 请假申请状态 |      * 请假申请状态 | ||||||
|      */ |      */ | ||||||
|     private String auditStatus; |     private String auditStatus; | ||||||
|  |  | ||||||
|  |     private List<AuditUserVo> auditors; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 申请人类型(0-施工人员 1-管理人员 2-分包人员) | ||||||
|  |      */ | ||||||
|  |     private String userType; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 头像 | ||||||
|  |      */ | ||||||
|  |     private String avatar; | ||||||
| } | } | ||||||
|  | |||||||
| @ -10,6 +10,7 @@ import org.dromara.project.domain.dto.leave.*; | |||||||
| import org.dromara.project.domain.dto.reissuecard.BusReissueCardQueryReq; | import org.dromara.project.domain.dto.reissuecard.BusReissueCardQueryReq; | ||||||
| import org.dromara.project.domain.vo.leave.BusLeaveVo; | import org.dromara.project.domain.vo.leave.BusLeaveVo; | ||||||
| import org.dromara.project.domain.vo.reissuecard.BusReissueCardVo; | import org.dromara.project.domain.vo.reissuecard.BusReissueCardVo; | ||||||
|  | import org.springframework.web.bind.annotation.PathVariable; | ||||||
|  |  | ||||||
| import java.time.LocalDate; | import java.time.LocalDate; | ||||||
| import java.time.LocalDateTime; | import java.time.LocalDateTime; | ||||||
| @ -127,4 +128,5 @@ public interface IBusLeaveService extends IService<BusLeave> { | |||||||
|  |  | ||||||
|     Boolean  audit(BusLeaveAuditDto dto); |     Boolean  audit(BusLeaveAuditDto dto); | ||||||
|  |  | ||||||
|  |  | ||||||
| } | } | ||||||
|  | |||||||
| @ -526,24 +526,13 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B | |||||||
|         List<BusAttendance> attendanceList = this.lambdaQuery() |         List<BusAttendance> attendanceList = this.lambdaQuery() | ||||||
|             .eq(BusAttendance::getProjectId, projectId) |             .eq(BusAttendance::getProjectId, projectId) | ||||||
|             .eq(BusAttendance::getClockDate, LocalDate.now()) |             .eq(BusAttendance::getClockDate, LocalDate.now()) | ||||||
|  |             .in(BusAttendance::getClockStatus, ATTENDANCE_STATUS) | ||||||
|  |             .apply(" user_id not in (select sys_user_id from sub_construction_user where project_id = {0} and user_role != '0' )", projectId) | ||||||
|             .list(); |             .list(); | ||||||
|         if (CollUtil.isEmpty(attendanceList)) { |         if (CollUtil.isEmpty(attendanceList)) { | ||||||
|             return List.of(); |             return List.of(); | ||||||
|         } |         } | ||||||
|         Map<Long, List<BusAttendance>> attendanceMap = attendanceList.stream() |         return attendanceList.stream().map(BusAttendance::getUserId).distinct().toList(); | ||||||
|             .collect(Collectors.groupingBy(BusAttendance::getUserId)); |  | ||||||
|         List<Long> attendedUserIds = new ArrayList<>(); |  | ||||||
|         for (Map.Entry<Long, List<BusAttendance>> entry : attendanceMap.entrySet()) { |  | ||||||
|             Long userId = entry.getKey(); |  | ||||||
|             List<BusAttendance> records = entry.getValue(); |  | ||||||
|  |  | ||||||
|             boolean allValid = records.stream() |  | ||||||
|                 .anyMatch(record -> ATTENDANCE_STATUS.contains(record.getClockStatus())); |  | ||||||
|             if (allValid) { |  | ||||||
|                 attendedUserIds.add(userId); |  | ||||||
|             } |  | ||||||
|         } |  | ||||||
|         return attendedUserIds; |  | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |  | ||||||
| @ -973,7 +962,7 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B | |||||||
|             List<BusProjectTeamAppVo> byUserId = projectTeamService.getByUserId(userId, dto.getProjectId()); |             List<BusProjectTeamAppVo> byUserId = projectTeamService.getByUserId(userId, dto.getProjectId()); | ||||||
|  |  | ||||||
|             if(CollectionUtil.isEmpty(byUserId)){ |             if(CollectionUtil.isEmpty(byUserId)){ | ||||||
|                 return new TableDataInfo<>(); |                 return TableDataInfo.build(new ArrayList<>()); | ||||||
|             } |             } | ||||||
|             list1 = byUserId.stream().map(BusProjectTeamAppVo::getId).toList(); |             list1 = byUserId.stream().map(BusProjectTeamAppVo::getId).toList(); | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -2,6 +2,7 @@ package org.dromara.project.service.impl; | |||||||
|  |  | ||||||
| import cn.hutool.core.bean.BeanUtil; | import cn.hutool.core.bean.BeanUtil; | ||||||
| import cn.hutool.core.collection.CollUtil; | import cn.hutool.core.collection.CollUtil; | ||||||
|  | import cn.hutool.core.collection.CollectionUtil; | ||||||
| import cn.hutool.core.convert.Convert; | import cn.hutool.core.convert.Convert; | ||||||
| import cn.hutool.core.map.MapUtil; | import cn.hutool.core.map.MapUtil; | ||||||
| import cn.hutool.core.util.ObjectUtil; | import cn.hutool.core.util.ObjectUtil; | ||||||
| @ -17,6 +18,7 @@ import org.dromara.common.core.domain.R; | |||||||
| import org.dromara.common.core.domain.event.ProcessDeleteEvent; | import org.dromara.common.core.domain.event.ProcessDeleteEvent; | ||||||
| import org.dromara.common.core.domain.event.ProcessEvent; | import org.dromara.common.core.domain.event.ProcessEvent; | ||||||
| import org.dromara.common.core.domain.event.ProcessTaskEvent; | import org.dromara.common.core.domain.event.ProcessTaskEvent; | ||||||
|  | import org.dromara.common.core.domain.model.LoginUser; | ||||||
| import org.dromara.common.core.enums.BusinessStatusEnum; | import org.dromara.common.core.enums.BusinessStatusEnum; | ||||||
| import org.dromara.common.core.exception.ServiceException; | import org.dromara.common.core.exception.ServiceException; | ||||||
| import org.dromara.common.core.utils.DateUtils; | import org.dromara.common.core.utils.DateUtils; | ||||||
| @ -33,10 +35,16 @@ import org.dromara.project.domain.dto.leave.*; | |||||||
| import org.dromara.project.domain.dto.reissuecard.BusReissueCardQueryReq; | import org.dromara.project.domain.dto.reissuecard.BusReissueCardQueryReq; | ||||||
| import org.dromara.project.domain.enums.*; | import org.dromara.project.domain.enums.*; | ||||||
| import org.dromara.project.domain.vo.leave.BusLeaveVo; | import org.dromara.project.domain.vo.leave.BusLeaveVo; | ||||||
|  | import org.dromara.project.domain.vo.reissuecard.AuditUserVo; | ||||||
| import org.dromara.project.domain.vo.reissuecard.BusReissueCardVo; | import org.dromara.project.domain.vo.reissuecard.BusReissueCardVo; | ||||||
| import org.dromara.project.mapper.BusLeaveMapper; | import org.dromara.project.mapper.BusLeaveMapper; | ||||||
| import org.dromara.project.service.*; | import org.dromara.project.service.*; | ||||||
|  | import org.dromara.system.domain.SysUser; | ||||||
|  | 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.ISysRoleService; | import org.dromara.system.service.ISysRoleService; | ||||||
|  | import org.dromara.system.service.ISysUserService; | ||||||
| import org.dromara.workflow.domain.TestLeave; | import org.dromara.workflow.domain.TestLeave; | ||||||
| import org.springframework.beans.BeanUtils; | import org.springframework.beans.BeanUtils; | ||||||
| import org.springframework.context.annotation.Lazy; | import org.springframework.context.annotation.Lazy; | ||||||
| @ -81,6 +89,12 @@ public class BusLeaveServiceImpl extends ServiceImpl<BusLeaveMapper, BusLeave> | |||||||
|     @Resource |     @Resource | ||||||
|     private ISysRoleService roleService; |     private ISysRoleService roleService; | ||||||
|  |  | ||||||
|  |     @Resource | ||||||
|  |     private ISysUserService userService; | ||||||
|  |  | ||||||
|  |     @Resource | ||||||
|  |     private ISysOssService ossService; | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|      * 查询施工人员请假申请 |      * 查询施工人员请假申请 | ||||||
|      * |      * | ||||||
| @ -89,7 +103,46 @@ public class BusLeaveServiceImpl extends ServiceImpl<BusLeaveMapper, BusLeave> | |||||||
|      */ |      */ | ||||||
|     @Override |     @Override | ||||||
|     public BusLeaveVo queryById(Long id) { |     public BusLeaveVo queryById(Long id) { | ||||||
|         return baseMapper.selectVoById(id); |         BusLeaveVo busLeaveVo = baseMapper.selectVoById(id); | ||||||
|  |  | ||||||
|  |         String userType = busLeaveVo.getUserType(); | ||||||
|  |         //两个角色 一个审核分包的=6,一个审核管理的=7 | ||||||
|  |         List<SysUser> sysUsers = new ArrayList<>(); | ||||||
|  |         if(busLeaveVo.getGangerId()==null){ | ||||||
|  |             if("1".equals(userType)){ | ||||||
|  |                 sysUsers = userService.selectUserByRoleIdAndProjectId(6L, busLeaveVo.getProjectId()); | ||||||
|  |             } else if ("2".equals(userType)) { | ||||||
|  |                 sysUsers = userService.selectUserByRoleIdAndProjectId(7L, busLeaveVo.getProjectId()); | ||||||
|  |             } | ||||||
|  |         }else { | ||||||
|  |             SysUserVo sysUserVo = userService.selectUserById(busLeaveVo.getGangerId()); | ||||||
|  |             if(sysUserVo != null){ | ||||||
|  |                 busLeaveVo.setGangerName(sysUserVo.getNickName()); | ||||||
|  |                 if(sysUserVo.getAvatar() != null){ | ||||||
|  |                     SysOssVo byId1 = ossService.getById(sysUserVo.getAvatar()); | ||||||
|  |                     if(byId1 != null){ | ||||||
|  |                         busLeaveVo.setAvatar(byId1.getUrl()); | ||||||
|  |                     } | ||||||
|  |  | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         if(CollectionUtil.isNotEmpty(sysUsers)){ | ||||||
|  |             busLeaveVo.setAuditors(sysUsers.stream().map(sysUser -> { | ||||||
|  |                 AuditUserVo userVo = new AuditUserVo(); | ||||||
|  |                 userVo.setUserId(sysUser.getUserId()); | ||||||
|  |                 userVo.setNickName(sysUser.getNickName()); | ||||||
|  |                 if(sysUser.getAvatar() != null){ | ||||||
|  |                     SysOssVo byId1 = ossService.getById(sysUser.getAvatar()); | ||||||
|  |                     if(byId1 != null){ | ||||||
|  |                         userVo.setAvatar(byId1.getUrl()); | ||||||
|  |                     } | ||||||
|  |                 } | ||||||
|  |                 return userVo; | ||||||
|  |             }).collect(Collectors.toList())); | ||||||
|  |         } | ||||||
|  |         return  busLeaveVo; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
| @ -377,7 +430,7 @@ public class BusLeaveServiceImpl extends ServiceImpl<BusLeaveMapper, BusLeave> | |||||||
|  |  | ||||||
|         LambdaQueryWrapper<BusLeave> wrappers = new LambdaQueryWrapper<>(); |         LambdaQueryWrapper<BusLeave> wrappers = new LambdaQueryWrapper<>(); | ||||||
|         wrappers.eq(BusLeave::getUserId, userId) |         wrappers.eq(BusLeave::getUserId, userId) | ||||||
|             .eq(BusLeave::getAuditStatus, BusinessStatusEnum.FINISH.getStatus()) |             .eq(BusLeave::getGangerOpinion, "2") | ||||||
|             .le(BusLeave::getStartTime, clockTime)    // 请假开始时间 <= 当天打卡时间 |             .le(BusLeave::getStartTime, clockTime)    // 请假开始时间 <= 当天打卡时间 | ||||||
|             .ge(BusLeave::getEndTime, clockTime);   // 请假结束时间 >= 当天打卡时间 |             .ge(BusLeave::getEndTime, clockTime);   // 请假结束时间 >= 当天打卡时间 | ||||||
|  |  | ||||||
| @ -397,8 +450,8 @@ public class BusLeaveServiceImpl extends ServiceImpl<BusLeaveMapper, BusLeave> | |||||||
|  |  | ||||||
|         // 3. 构造查询条件 |         // 3. 构造查询条件 | ||||||
|         LambdaQueryWrapper<BusLeave> wrapper = new LambdaQueryWrapper<>(); |         LambdaQueryWrapper<BusLeave> wrapper = new LambdaQueryWrapper<>(); | ||||||
|         wrapper |         wrapper.eq(BusLeave::getUserId, userId) | ||||||
|             .eq(BusLeave::getUserId, userId) |             .ne(BusLeave::getGangerOpinion, "3") | ||||||
|             .le(BusLeave::getStartTime, newEnd)     // 已有记录的开始时间 < 新记录的结束时间 |             .le(BusLeave::getStartTime, newEnd)     // 已有记录的开始时间 < 新记录的结束时间 | ||||||
|             .ge(BusLeave::getEndTime, newStart);    // 已有记录的结束时间 > 新记录的开始时间 |             .ge(BusLeave::getEndTime, newStart);    // 已有记录的结束时间 > 新记录的开始时间 | ||||||
|  |  | ||||||
| @ -419,14 +472,14 @@ public class BusLeaveServiceImpl extends ServiceImpl<BusLeaveMapper, BusLeave> | |||||||
|  |  | ||||||
|         lqw.eq(ObjectUtils.isNotEmpty(req.getUserId()), BusLeave::getUserId, req.getUserId()); |         lqw.eq(ObjectUtils.isNotEmpty(req.getUserId()), BusLeave::getUserId, req.getUserId()); | ||||||
|  |  | ||||||
|         List<BusUserProjectRelevancy> relevancyList = userProjectRelevancyService.list( | //        List<BusUserProjectRelevancy> relevancyList = userProjectRelevancyService.list( | ||||||
|             Wrappers.lambdaQuery(BusUserProjectRelevancy.class) | //            Wrappers.lambdaQuery(BusUserProjectRelevancy.class) | ||||||
|             .eq(BusUserProjectRelevancy::getProjectId, req.getProjectId()) | //            .eq(BusUserProjectRelevancy::getProjectId, req.getProjectId()) | ||||||
|             .eq(BusUserProjectRelevancy::getUserId, req.getUserId())); | //            .eq(BusUserProjectRelevancy::getUserId, req.getUserId())); | ||||||
|  |  | ||||||
|         boolean b = relevancyList.stream().anyMatch(relevancy -> "2".equals(relevancy.getUserType())); | //        boolean b = relevancyList.stream().anyMatch(relevancy -> "2".equals(relevancy.getUserType())); | ||||||
|  |  | ||||||
|         lqw.eq(!b, BusLeave::getProjectId, req.getProjectId()); |         lqw.eq(BusLeave::getProjectId, req.getProjectId()); | ||||||
|         // 新增日期范围筛选条件 |         // 新增日期范围筛选条件 | ||||||
|         if (req.getDate() != null) { |         if (req.getDate() != null) { | ||||||
|             LocalDateTime dateStart = LocalDateTime.of(req.getDate(), LocalTime.MIN); |             LocalDateTime dateStart = LocalDateTime.of(req.getDate(), LocalTime.MIN); | ||||||
| @ -438,7 +491,6 @@ public class BusLeaveServiceImpl extends ServiceImpl<BusLeaveMapper, BusLeave> | |||||||
|         ); |         ); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  |  | ||||||
|         Page<BusLeave> result = this.page(pageQuery.build(), lqw); |         Page<BusLeave> result = this.page(pageQuery.build(), lqw); | ||||||
|         return TableDataInfo.build(this.getVoPage(result)); |         return TableDataInfo.build(this.getVoPage(result)); | ||||||
|     } |     } | ||||||
| @ -462,10 +514,10 @@ public class BusLeaveServiceImpl extends ServiceImpl<BusLeaveMapper, BusLeave> | |||||||
|  |  | ||||||
|         List<String> type = new ArrayList<>(); |         List<String> type = new ArrayList<>(); | ||||||
|         if(roleIds.contains(7L)){ |         if(roleIds.contains(7L)){ | ||||||
|             type.add("7"); |             type.add("1"); | ||||||
|         } |         } | ||||||
|         if(roleIds.contains(6L)){ |         if(roleIds.contains(6L)){ | ||||||
|             type.add("6"); |             type.add("2"); | ||||||
|         } |         } | ||||||
|         if(CollUtil.isEmpty(type)){ |         if(CollUtil.isEmpty(type)){ | ||||||
|             return TableDataInfo.build(); |             return TableDataInfo.build(); | ||||||
| @ -489,6 +541,15 @@ public class BusLeaveServiceImpl extends ServiceImpl<BusLeaveMapper, BusLeave> | |||||||
|         } |         } | ||||||
|         String gangerOpinion = dto.getGangerOpinion(); |         String gangerOpinion = dto.getGangerOpinion(); | ||||||
|         busLeave.setGangerOpinion(gangerOpinion); |         busLeave.setGangerOpinion(gangerOpinion); | ||||||
|  |         busLeave.setGangerExplain(dto.getGangerExplain()); | ||||||
|  |         if(busLeave.getGangerId() == null){ | ||||||
|  |             LoginUser loginUser = LoginHelper.getLoginUser(); | ||||||
|  |             busLeave.setGangerId(loginUser.getUserId()); | ||||||
|  |             busLeave.setGangerName(loginUser.getNickname()); | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         busLeave.setGangerTime(LocalDateTime.now()); | ||||||
|  |  | ||||||
|         int i = baseMapper.updateById(busLeave); |         int i = baseMapper.updateById(busLeave); | ||||||
|  |  | ||||||
|         if(gangerOpinion.equals("2")){ |         if(gangerOpinion.equals("2")){ | ||||||
|  | |||||||
| @ -15,6 +15,7 @@ import org.dromara.common.core.constant.HttpStatus; | |||||||
| import org.dromara.common.core.domain.event.ProcessDeleteEvent; | import org.dromara.common.core.domain.event.ProcessDeleteEvent; | ||||||
| import org.dromara.common.core.domain.event.ProcessEvent; | import org.dromara.common.core.domain.event.ProcessEvent; | ||||||
| import org.dromara.common.core.domain.event.ProcessTaskEvent; | import org.dromara.common.core.domain.event.ProcessTaskEvent; | ||||||
|  | import org.dromara.common.core.domain.model.LoginUser; | ||||||
| import org.dromara.common.core.enums.BusinessStatusEnum; | import org.dromara.common.core.enums.BusinessStatusEnum; | ||||||
| import org.dromara.common.core.exception.ServiceException; | import org.dromara.common.core.exception.ServiceException; | ||||||
| import org.dromara.common.core.utils.DateUtils; | import org.dromara.common.core.utils.DateUtils; | ||||||
| @ -117,10 +118,12 @@ public class BusReissueCardServiceImpl extends ServiceImpl<BusReissueCardMapper, | |||||||
|         String userType = busReissueCardVo.getUserType(); |         String userType = busReissueCardVo.getUserType(); | ||||||
|         //两个角色 一个审核分包的=6,一个审核管理的=7 |         //两个角色 一个审核分包的=6,一个审核管理的=7 | ||||||
|         List<SysUser> sysUsers = new ArrayList<>(); |         List<SysUser> sysUsers = new ArrayList<>(); | ||||||
|  |         if(busReissueCardVo.getGangerId()==null){ | ||||||
|             if("1".equals(userType)){ |             if("1".equals(userType)){ | ||||||
|                 sysUsers = userService.selectUserByRoleIdAndProjectId(6L, busReissueCardVo.getProjectId()); |                 sysUsers = userService.selectUserByRoleIdAndProjectId(6L, busReissueCardVo.getProjectId()); | ||||||
|             } else if ("2".equals(userType)) { |             } else if ("2".equals(userType)) { | ||||||
|                 sysUsers = userService.selectUserByRoleIdAndProjectId(7L, busReissueCardVo.getProjectId()); |                 sysUsers = userService.selectUserByRoleIdAndProjectId(7L, busReissueCardVo.getProjectId()); | ||||||
|  |             } | ||||||
|         }else { |         }else { | ||||||
|             SysUserVo sysUserVo = userService.selectUserById(busReissueCardVo.getGangerId()); |             SysUserVo sysUserVo = userService.selectUserById(busReissueCardVo.getGangerId()); | ||||||
|             if(sysUserVo != null){ |             if(sysUserVo != null){ | ||||||
| @ -134,6 +137,7 @@ public class BusReissueCardServiceImpl extends ServiceImpl<BusReissueCardMapper, | |||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         if(CollectionUtil.isNotEmpty(sysUsers)){ |         if(CollectionUtil.isNotEmpty(sysUsers)){ | ||||||
|             busReissueCardVo.setAuditors(sysUsers.stream().map(sysUser -> { |             busReissueCardVo.setAuditors(sysUsers.stream().map(sysUser -> { | ||||||
|                 AuditUserVo userVo = new AuditUserVo(); |                 AuditUserVo userVo = new AuditUserVo(); | ||||||
| @ -193,6 +197,15 @@ public class BusReissueCardServiceImpl extends ServiceImpl<BusReissueCardMapper, | |||||||
|             throw new ServiceException("未找到该申请"); |             throw new ServiceException("未找到该申请"); | ||||||
|         } |         } | ||||||
|         Long attendanceId = bean.getAttendanceId(); |         Long attendanceId = bean.getAttendanceId(); | ||||||
|  |         bean.setGangerTime(LocalDateTime.now()); | ||||||
|  |  | ||||||
|  |  | ||||||
|  |         if(bean.getGangerId()==null){ | ||||||
|  |             LoginUser loginUser = LoginHelper.getLoginUser(); | ||||||
|  |             bean.setGangerId(loginUser.getUserId()); | ||||||
|  |             bean.setGangerName(loginUser.getNickname()); | ||||||
|  |         } | ||||||
|  |  | ||||||
|         BeanUtil.copyProperties(req, bean); |         BeanUtil.copyProperties(req, bean); | ||||||
|         boolean b = updateById(bean); |         boolean b = updateById(bean); | ||||||
|         if("2".equals(bean.getGangerOpinion())){ |         if("2".equals(bean.getGangerOpinion())){ | ||||||
| @ -399,10 +412,10 @@ public class BusReissueCardServiceImpl extends ServiceImpl<BusReissueCardMapper, | |||||||
|         //两个角色 一个审核分包的=6,一个审核管理的=7 |         //两个角色 一个审核分包的=6,一个审核管理的=7 | ||||||
|         List<String> type = new ArrayList<>(); |         List<String> type = new ArrayList<>(); | ||||||
|         if(roleIds.contains(7L)){ |         if(roleIds.contains(7L)){ | ||||||
|             type.add("7"); |             type.add("1"); | ||||||
|         } |         } | ||||||
|         if(roleIds.contains(6L)){ |         if(roleIds.contains(6L)){ | ||||||
|             type.add("6"); |             type.add("2"); | ||||||
|         } |         } | ||||||
|         if(CollUtil.isEmpty(type)){ |         if(CollUtil.isEmpty(type)){ | ||||||
|             return TableDataInfo.build(); |             return TableDataInfo.build(); | ||||||
| @ -459,6 +472,15 @@ public class BusReissueCardServiceImpl extends ServiceImpl<BusReissueCardMapper, | |||||||
|             throw new ServiceException("未找到该申请"); |             throw new ServiceException("未找到该申请"); | ||||||
|         } |         } | ||||||
|         Long attendanceId = bean.getAttendanceId(); |         Long attendanceId = bean.getAttendanceId(); | ||||||
|  |         bean.setGangerTime(LocalDateTime.now()); | ||||||
|  |  | ||||||
|  |  | ||||||
|  |         if(bean.getGangerId()==null){ | ||||||
|  |             LoginUser loginUser = LoginHelper.getLoginUser(); | ||||||
|  |             bean.setGangerId(loginUser.getUserId()); | ||||||
|  |             bean.setGangerName(loginUser.getNickname()); | ||||||
|  |         } | ||||||
|  |  | ||||||
|         BeanUtil.copyProperties(req, bean); |         BeanUtil.copyProperties(req, bean); | ||||||
|         boolean b = updateById(bean); |         boolean b = updateById(bean); | ||||||
|         if("2".equals(bean.getGangerOpinion())){ |         if("2".equals(bean.getGangerOpinion())){ | ||||||
|  | |||||||
| @ -92,4 +92,9 @@ public class HseSafetyInspectionCreateReq implements Serializable { | |||||||
|      */ |      */ | ||||||
|     private String remark; |     private String remark; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 问题隐患 | ||||||
|  |      */ | ||||||
|  |     private String hiddenDanger; | ||||||
|  |  | ||||||
| } | } | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 zt
					zt