考勤
This commit is contained in:
@ -63,8 +63,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.*;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.LocalDate;
|
||||
@ -1164,7 +1163,7 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
|
||||
// 获取文件字节数组
|
||||
byte[] bytes = file.getBytes();
|
||||
// Base64 编码
|
||||
reqBase64 = URLEncoder.encode(Base64.getEncoder().encodeToString(bytes), StandardCharsets.UTF_8);
|
||||
reqBase64 = Base64.getEncoder().encodeToString(bytes);
|
||||
} catch (IOException e) {
|
||||
throw new ServiceException("图片转换失败,请重新上传");
|
||||
}
|
||||
@ -1187,11 +1186,12 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
|
||||
try (InputStream is = storage.getObjectContent(path)) {
|
||||
byte[] bytes = IoUtil.readBytes(is);
|
||||
// Base64 编码
|
||||
faceBase64 = URLEncoder.encode(Base64.getEncoder().encodeToString(bytes), StandardCharsets.UTF_8);
|
||||
faceBase64 = Base64.getEncoder().encodeToString(bytes);
|
||||
} catch (IOException e) {
|
||||
// 针对单个文件处理异常,可以选择记录日志或终止处理
|
||||
throw new OssException("处理文件[" + path + "]失败,错误信息: " + e.getMessage());
|
||||
}
|
||||
|
||||
HumanFaceReq faceReq = new HumanFaceReq();
|
||||
faceReq.setImage(faceBase64);
|
||||
List<HumanFaceReq> list = List.of(request, faceReq);
|
||||
|
@ -0,0 +1,105 @@
|
||||
package org.dromara.message.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.message.domain.vo.MsgAppNoticeVo;
|
||||
import org.dromara.message.domain.bo.MsgAppNoticeBo;
|
||||
import org.dromara.message.service.IMsgAppNoticeService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* app消息
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-09-03
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/message/appNotice")
|
||||
public class MsgAppNoticeController extends BaseController {
|
||||
|
||||
private final IMsgAppNoticeService msgAppNoticeService;
|
||||
|
||||
/**
|
||||
* 查询app消息列表
|
||||
*/
|
||||
@SaCheckPermission("message:appNotice:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<MsgAppNoticeVo> list(MsgAppNoticeBo bo, PageQuery pageQuery) {
|
||||
return msgAppNoticeService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出app消息列表
|
||||
*/
|
||||
@SaCheckPermission("message:appNotice:export")
|
||||
@Log(title = "app消息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(MsgAppNoticeBo bo, HttpServletResponse response) {
|
||||
List<MsgAppNoticeVo> list = msgAppNoticeService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "app消息", MsgAppNoticeVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取app消息详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("message:appNotice:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<MsgAppNoticeVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(msgAppNoticeService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增app消息
|
||||
*/
|
||||
@SaCheckPermission("message:appNotice:add")
|
||||
@Log(title = "app消息", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody MsgAppNoticeBo bo) {
|
||||
return toAjax(msgAppNoticeService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改app消息
|
||||
*/
|
||||
@SaCheckPermission("message:appNotice:edit")
|
||||
@Log(title = "app消息", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody MsgAppNoticeBo bo) {
|
||||
return toAjax(msgAppNoticeService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除app消息
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("message:appNotice:remove")
|
||||
@Log(title = "app消息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(msgAppNoticeService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
package org.dromara.message.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* app消息对象 msg_app_notice
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-09-03
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("msg_app_notice")
|
||||
public class MsgAppNotice extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 接收通知的用户ID
|
||||
*/
|
||||
private Long recipientId;
|
||||
|
||||
/**
|
||||
* 发送通知的用户ID(系统通知 0)
|
||||
*/
|
||||
private Long senderId;
|
||||
|
||||
/**
|
||||
* 通知内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 查看状态(0未读 1已读)
|
||||
*/
|
||||
private String viewStatus;
|
||||
|
||||
/**
|
||||
* 消息类型
|
||||
*/
|
||||
private String msgType;
|
||||
|
||||
/**
|
||||
* 聊天类型
|
||||
*/
|
||||
private String talkType;
|
||||
|
||||
/**
|
||||
* 所属模块
|
||||
*/
|
||||
private String msgSource;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
package org.dromara.message.domain.bo;
|
||||
|
||||
import org.dromara.message.domain.MsgAppNotice;
|
||||
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.*;
|
||||
|
||||
/**
|
||||
* app消息业务对象 msg_app_notice
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-09-03
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = MsgAppNotice.class, reverseConvertGenerate = false)
|
||||
public class MsgAppNoticeBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 接收通知的用户ID
|
||||
*/
|
||||
@NotNull(message = "接收通知的用户ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long recipientId;
|
||||
|
||||
/**
|
||||
* 发送通知的用户ID(系统通知 0)
|
||||
*/
|
||||
@NotNull(message = "发送通知的用户ID(系统通知 0)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long senderId;
|
||||
|
||||
/**
|
||||
* 通知内容
|
||||
*/
|
||||
@NotBlank(message = "通知内容不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 查看状态(0未读 1已读)
|
||||
*/
|
||||
@NotBlank(message = "查看状态(0未读 1已读)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String viewStatus;
|
||||
|
||||
/**
|
||||
* 消息类型
|
||||
*/
|
||||
private String msgType;
|
||||
|
||||
/**
|
||||
* 聊天类型
|
||||
*/
|
||||
private String talkType;
|
||||
|
||||
/**
|
||||
* 所属模块
|
||||
*/
|
||||
private String msgSource;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
package org.dromara.message.domain.vo;
|
||||
|
||||
import org.dromara.message.domain.MsgAppNotice;
|
||||
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;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* app消息视图对象 msg_app_notice
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-09-03
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = MsgAppNotice.class)
|
||||
public class MsgAppNoticeVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
@ExcelProperty(value = "项目ID")
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 接收通知的用户ID
|
||||
*/
|
||||
@ExcelProperty(value = "接收通知的用户ID")
|
||||
private Long recipientId;
|
||||
|
||||
/**
|
||||
* 发送通知的用户ID(系统通知 0)
|
||||
*/
|
||||
@ExcelProperty(value = "发送通知的用户ID", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "系=统通知,0=")
|
||||
private Long senderId;
|
||||
|
||||
/**
|
||||
* 通知内容
|
||||
*/
|
||||
@ExcelProperty(value = "通知内容")
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 查看状态(0未读 1已读)
|
||||
*/
|
||||
@ExcelProperty(value = "查看状态(0未读 1已读)")
|
||||
private String viewStatus;
|
||||
|
||||
/**
|
||||
* 消息类型
|
||||
*/
|
||||
@ExcelProperty(value = "消息类型")
|
||||
private String msgType;
|
||||
|
||||
/**
|
||||
* 聊天类型
|
||||
*/
|
||||
@ExcelProperty(value = "聊天类型")
|
||||
private String talkType;
|
||||
|
||||
/**
|
||||
* 所属模块
|
||||
*/
|
||||
@ExcelProperty(value = "所属模块")
|
||||
private String msgSource;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.message.mapper;
|
||||
|
||||
import org.dromara.message.domain.MsgAppNotice;
|
||||
import org.dromara.message.domain.vo.MsgAppNoticeVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* app消息Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-09-03
|
||||
*/
|
||||
public interface MsgAppNoticeMapper extends BaseMapperPlus<MsgAppNotice, MsgAppNoticeVo> {
|
||||
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package org.dromara.message.service;
|
||||
|
||||
import org.dromara.message.domain.vo.MsgAppNoticeVo;
|
||||
import org.dromara.message.domain.bo.MsgAppNoticeBo;
|
||||
import org.dromara.message.domain.MsgAppNotice;
|
||||
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;
|
||||
|
||||
/**
|
||||
* app消息Service接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-09-03
|
||||
*/
|
||||
public interface IMsgAppNoticeService extends IService<MsgAppNotice>{
|
||||
|
||||
/**
|
||||
* 查询app消息
|
||||
*
|
||||
* @param id 主键
|
||||
* @return app消息
|
||||
*/
|
||||
MsgAppNoticeVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询app消息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return app消息分页列表
|
||||
*/
|
||||
TableDataInfo<MsgAppNoticeVo> queryPageList(MsgAppNoticeBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的app消息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return app消息列表
|
||||
*/
|
||||
List<MsgAppNoticeVo> queryList(MsgAppNoticeBo bo);
|
||||
|
||||
/**
|
||||
* 新增app消息
|
||||
*
|
||||
* @param bo app消息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(MsgAppNoticeBo bo);
|
||||
|
||||
/**
|
||||
* 修改app消息
|
||||
*
|
||||
* @param bo app消息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(MsgAppNoticeBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除app消息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@ -0,0 +1,138 @@
|
||||
package org.dromara.message.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
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.springframework.stereotype.Service;
|
||||
import org.dromara.message.domain.bo.MsgAppNoticeBo;
|
||||
import org.dromara.message.domain.vo.MsgAppNoticeVo;
|
||||
import org.dromara.message.domain.MsgAppNotice;
|
||||
import org.dromara.message.mapper.MsgAppNoticeMapper;
|
||||
import org.dromara.message.service.IMsgAppNoticeService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* app消息Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-09-03
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class MsgAppNoticeServiceImpl extends ServiceImpl<MsgAppNoticeMapper, MsgAppNotice> implements IMsgAppNoticeService {
|
||||
|
||||
private final MsgAppNoticeMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询app消息
|
||||
*
|
||||
* @param id 主键
|
||||
* @return app消息
|
||||
*/
|
||||
@Override
|
||||
public MsgAppNoticeVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询app消息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return app消息分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<MsgAppNoticeVo> queryPageList(MsgAppNoticeBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<MsgAppNotice> lqw = buildQueryWrapper(bo);
|
||||
Page<MsgAppNoticeVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的app消息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return app消息列表
|
||||
*/
|
||||
@Override
|
||||
public List<MsgAppNoticeVo> queryList(MsgAppNoticeBo bo) {
|
||||
LambdaQueryWrapper<MsgAppNotice> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<MsgAppNotice> buildQueryWrapper(MsgAppNoticeBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<MsgAppNotice> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(MsgAppNotice::getId);
|
||||
lqw.eq(bo.getProjectId() != null, MsgAppNotice::getProjectId, bo.getProjectId());
|
||||
lqw.eq(bo.getRecipientId() != null, MsgAppNotice::getRecipientId, bo.getRecipientId());
|
||||
lqw.eq(bo.getSenderId() != null, MsgAppNotice::getSenderId, bo.getSenderId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContent()), MsgAppNotice::getContent, bo.getContent());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getViewStatus()), MsgAppNotice::getViewStatus, bo.getViewStatus());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getMsgType()), MsgAppNotice::getMsgType, bo.getMsgType());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getTalkType()), MsgAppNotice::getTalkType, bo.getTalkType());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getMsgSource()), MsgAppNotice::getMsgSource, bo.getMsgSource());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增app消息
|
||||
*
|
||||
* @param bo app消息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(MsgAppNoticeBo bo) {
|
||||
MsgAppNotice add = MapstructUtils.convert(bo, MsgAppNotice.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改app消息
|
||||
*
|
||||
* @param bo app消息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(MsgAppNoticeBo bo) {
|
||||
MsgAppNotice update = MapstructUtils.convert(bo, MsgAppNotice.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(MsgAppNotice entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除app消息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
@ -1,7 +1,12 @@
|
||||
package org.dromara.project.controller.app;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
@ -9,14 +14,27 @@ 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.common.web.core.BaseController;
|
||||
import org.dromara.contractor.domain.SubConstructionUser;
|
||||
import org.dromara.contractor.service.ISubConstructionUserService;
|
||||
import org.dromara.project.domain.BusProjectTeamMember;
|
||||
import org.dromara.project.domain.dto.reissuecard.BusReissueCardAddReq;
|
||||
import org.dromara.project.domain.dto.reissuecard.BusReissueCardManagerReviewReq;
|
||||
import org.dromara.project.domain.dto.reissuecard.BusReissueCardQueryReq;
|
||||
import org.dromara.project.domain.enums.BusProjectTeamMemberPostEnum;
|
||||
import org.dromara.project.domain.vo.projectteam.BusForemanVo;
|
||||
import org.dromara.project.domain.vo.projectteam.BusProjectTeamForemanVo;
|
||||
import org.dromara.project.domain.vo.projectteam.BusProjectTeamVo;
|
||||
import org.dromara.project.domain.vo.reissuecard.BusReissueCardVo;
|
||||
import org.dromara.project.service.IBusProjectTeamMemberService;
|
||||
import org.dromara.project.service.IBusProjectTeamService;
|
||||
import org.dromara.project.service.IBusReissueCardService;
|
||||
import org.dromara.system.domain.vo.SysUserVo;
|
||||
import org.dromara.system.service.ISysUserService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* app补卡
|
||||
* @author lilemy
|
||||
@ -33,6 +51,12 @@ public class BusReissueCardAppController extends BaseController {
|
||||
@Resource
|
||||
private ISubConstructionUserService constructionUserService;
|
||||
|
||||
@Resource
|
||||
private ISysUserService userService;
|
||||
|
||||
@Resource
|
||||
private IBusProjectTeamMemberService busProjectTeamMemberService;
|
||||
|
||||
/**
|
||||
* 查询当前登录用户补卡申请列表
|
||||
*/
|
||||
@ -53,4 +77,39 @@ public class BusReissueCardAppController extends BaseController {
|
||||
return R.ok(reissueCardService.add(req));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取审批人列表
|
||||
*/
|
||||
@GetMapping("/auditList")
|
||||
public R<List<BusForemanVo>> auditList() {
|
||||
Long userId = LoginHelper.getUserId();
|
||||
SubConstructionUser bySysUserId = constructionUserService.getBySysUserId(userId);
|
||||
if(bySysUserId == null){
|
||||
throw new ServiceException("当前用户并不是施工人员");
|
||||
}
|
||||
if (bySysUserId.getTeamId()== null) {
|
||||
throw new ServiceException("当前用户未加入班组");
|
||||
}
|
||||
List<BusProjectTeamMember> list = busProjectTeamMemberService.list(Wrappers.lambdaQuery(BusProjectTeamMember.class)
|
||||
.eq(BusProjectTeamMember::getTeamId, bySysUserId.getTeamId())
|
||||
.eq(BusProjectTeamMember::getPostId, "1")
|
||||
);
|
||||
if(CollectionUtil.isEmpty(list)){
|
||||
throw new ServiceException("当前班组尚未设置班组长");
|
||||
}
|
||||
List<Long> list1 = list.stream().map(BusProjectTeamMember::getMemberId).toList();
|
||||
|
||||
List<SubConstructionUser> foremanList = constructionUserService.list(Wrappers.lambdaQuery(SubConstructionUser.class)
|
||||
.in(SubConstructionUser::getSysUserId, list1)
|
||||
);
|
||||
|
||||
List<BusForemanVo> foremanVoList = foremanList.stream().map(constructionUser -> {
|
||||
BusForemanVo foremanVo = new BusForemanVo();
|
||||
foremanVo.setForemanId(constructionUser.getSysUserId());
|
||||
foremanVo.setForemanName(constructionUser.getUserName());
|
||||
return foremanVo;
|
||||
}).toList();
|
||||
return R.ok(foremanVoList);
|
||||
}
|
||||
}
|
||||
|
@ -33,6 +33,15 @@ public class BusReissueCardAddReq implements Serializable {
|
||||
*/
|
||||
private String userExplain;
|
||||
|
||||
/**
|
||||
* 班组长
|
||||
*/
|
||||
private Long gangerId;
|
||||
|
||||
/**
|
||||
* 班组长名字
|
||||
*/
|
||||
private String gangerName;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
|
@ -111,4 +111,6 @@ public class BusAttendanceVo implements Serializable {
|
||||
private String lat;
|
||||
|
||||
|
||||
@ExcelProperty(value = "纬度")
|
||||
private Integer week;
|
||||
}
|
||||
|
@ -452,12 +452,16 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
||||
|
||||
boolean b = relevancyList.stream().allMatch(relevancy -> "1".equals(relevancy.getUserType()));
|
||||
|
||||
|
||||
return baseMapper.selectVoList(Wrappers.lambdaQuery(BusAttendance.class)
|
||||
List<BusAttendanceVo> busAttendanceVos = baseMapper.selectVoList(Wrappers.lambdaQuery(BusAttendance.class)
|
||||
.eq(BusAttendance::getUserId, userId)
|
||||
.eq(b, BusAttendance::getProjectId, projectId)
|
||||
.in(BusAttendance::getClockStatus, abnormalList)
|
||||
);
|
||||
//转换星期几
|
||||
for (BusAttendanceVo busAttendanceVo : busAttendanceVos) {
|
||||
busAttendanceVo.setWeek(busAttendanceVo.getClockDate().getDayOfWeek().getValue());
|
||||
}
|
||||
return busAttendanceVos;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -271,7 +271,9 @@ public class BusProjectTeamServiceImpl extends ServiceImpl<BusProjectTeamMapper,
|
||||
return List.of();
|
||||
}
|
||||
// 获取项目班组长信息
|
||||
List<SubConstructionUser> foremanList = constructionUserService.listByIds(foremanIdList);
|
||||
List<SubConstructionUser> foremanList = constructionUserService.list(Wrappers.lambdaQuery(SubConstructionUser.class)
|
||||
.in(SubConstructionUser::getSysUserId, foremanIdList)
|
||||
);
|
||||
Map<Long, List<SubConstructionUser>> foremanMap = foremanList.stream()
|
||||
.collect(Collectors.groupingBy(SubConstructionUser::getTeamId));
|
||||
// 封装数据
|
||||
|
@ -324,7 +324,6 @@ public class BusReissueCardServiceImpl extends ServiceImpl<BusReissueCardMapper,
|
||||
if (CollUtil.isNotEmpty(busReissueCards)) {
|
||||
throw new ServiceException("已提交该申请");
|
||||
}
|
||||
|
||||
save(bean);
|
||||
return bean.getId();
|
||||
}
|
||||
|
@ -42,7 +42,6 @@ public class QltQualityConstructionLogAppController extends BaseController {
|
||||
/**
|
||||
* 查询质量-施工日志列表
|
||||
*/
|
||||
@SaCheckPermission("quality:qualityConstructionLog:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<QltQualityConstructionLogVo> list(QltQualityConstructionLogQueryReq req, PageQuery pageQuery) {
|
||||
return qualityConstructionLogService.queryPageList(req, pageQuery);
|
||||
@ -51,7 +50,6 @@ public class QltQualityConstructionLogAppController extends BaseController {
|
||||
/**
|
||||
* 导出质量-施工日志列表
|
||||
*/
|
||||
@SaCheckPermission("quality:qualityConstructionLog:export")
|
||||
@Log(title = "质量-施工日志", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(QltQualityConstructionLogQueryReq req, HttpServletResponse response) {
|
||||
@ -62,7 +60,6 @@ public class QltQualityConstructionLogAppController extends BaseController {
|
||||
/**
|
||||
* 根据主键导出质量-施工日志
|
||||
*/
|
||||
@SaCheckPermission("quality:qualityConstructionLog:exportWord")
|
||||
@Log(title = "质量-施工日志", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export/word")
|
||||
public void exportWordById(@NotNull(message = "主键不能为空") Long id,
|
||||
@ -75,7 +72,6 @@ public class QltQualityConstructionLogAppController extends BaseController {
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("quality:qualityConstructionLog:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<QltQualityConstructionLogVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
@ -85,7 +81,6 @@ public class QltQualityConstructionLogAppController extends BaseController {
|
||||
/**
|
||||
* 新增质量-施工日志
|
||||
*/
|
||||
@SaCheckPermission("quality:qualityConstructionLog:add")
|
||||
@Log(title = "质量-施工日志", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
@ -96,7 +91,6 @@ public class QltQualityConstructionLogAppController extends BaseController {
|
||||
/**
|
||||
* 修改质量-施工日志
|
||||
*/
|
||||
@SaCheckPermission("quality:qualityConstructionLog:edit")
|
||||
@Log(title = "质量-施工日志", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
@ -109,7 +103,6 @@ public class QltQualityConstructionLogAppController extends BaseController {
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("quality:qualityConstructionLog:remove")
|
||||
@Log(title = "质量-施工日志", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
|
@ -57,7 +57,6 @@ public class QltQualityInspectionAppController extends BaseController {
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("quality:qualityInspection:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<QltQualityInspectionVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
|
@ -1,5 +1,6 @@
|
||||
package org.dromara.quality.domain.dto.qualityinspection;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
@ -75,6 +76,7 @@ public class QltQualityInspectionCreateReq implements Serializable {
|
||||
/**
|
||||
* 回复期限日期
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date replyPeriodDate;
|
||||
|
||||
/**
|
||||
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.message.mapper.MsgAppNoticeMapper">
|
||||
|
||||
</mapper>
|
Reference in New Issue
Block a user