Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@ -206,12 +206,11 @@ public class PgsProgressCategoryController extends BaseController {
|
||||
|
||||
// 关闭读取器
|
||||
excelReader.finish();
|
||||
|
||||
if (allData.isEmpty()) {
|
||||
return R.ok();
|
||||
/*if (allData.isEmpty()) {
|
||||
return R.fail("未读取到有效数据");
|
||||
}
|
||||
// 处理导入的数据
|
||||
// TODO: 添加你的业务逻辑
|
||||
List<PgsProgressCategory> list = new ArrayList<>();
|
||||
for (PgsProgressCategoryVo vo : allData) {
|
||||
list.add(pgsProgressCategoryService.convertVoToEntity(vo));
|
||||
@ -237,7 +236,7 @@ public class PgsProgressCategoryController extends BaseController {
|
||||
return R.fail("更新失败");
|
||||
}
|
||||
|
||||
return R.ok("导入成功,共更新 " + list.size() + " 条数据");
|
||||
return R.ok("导入成功,共更新 " + list.size() + " 条数据");*/
|
||||
} catch (Exception e) {
|
||||
log.error("导入Excel文件失败", e);
|
||||
return R.fail("导入失败: " + e.getMessage());
|
||||
|
||||
@ -37,7 +37,7 @@ public class BusUserProjectRelevancy implements Serializable {
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 用户类型(0系统管理员 1普通人员 2项目管理员)
|
||||
* 用户类型(0系统管理员 1普通人员 2项目管理员 3分包人员)
|
||||
*/
|
||||
private String userType;
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ public class BusUserProjectRelevancyCreateReq implements Serializable {
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 用户类型(0系统管理员 1普通人员 2项目管理员)
|
||||
* 用户类型(0系统管理员 1普通人员 2项目管理员 3分包人员)
|
||||
*/
|
||||
@NotBlank(message = "用户类型不能为空")
|
||||
private String userType;
|
||||
|
||||
@ -26,7 +26,7 @@ public class BusUserProjectRelevancyQueryReq implements Serializable {
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 用户类型(0系统管理员 1普通人员 2项目管理员)
|
||||
* 用户类型(0系统管理员 1普通人员 2项目管理员 3分包人员)
|
||||
*/
|
||||
private String userType;
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ public class BusUserProjectRelevancyUpdateReq implements Serializable {
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 用户类型(0系统管理员 1普通人员 2项目管理员)
|
||||
* 用户类型(0系统管理员 1普通人员 2项目管理员 3分包人员)
|
||||
*/
|
||||
@NotBlank(message = "用户类型不能为空")
|
||||
private String userType;
|
||||
|
||||
@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.Date;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 质量-施工日志对象 qlt_quality_construction_log
|
||||
@ -37,12 +37,12 @@ public class QltQualityConstructionLog extends BaseEntity {
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 发生日期
|
||||
*/
|
||||
private Date happenDate;
|
||||
private LocalDate happenDate;
|
||||
|
||||
/**
|
||||
* 生产情况
|
||||
|
||||
@ -1,11 +1,10 @@
|
||||
package org.dromara.quality.domain.dto.qualityconstructionlog;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
@ -25,8 +24,7 @@ public class QltQualityConstructionLogCreateReq implements Serializable {
|
||||
/**
|
||||
* 发生日期
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||
private Date happenDate;
|
||||
private LocalDate happenDate;
|
||||
|
||||
/**
|
||||
* 生产情况
|
||||
@ -52,6 +50,6 @@ public class QltQualityConstructionLogCreateReq implements Serializable {
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
private String title;
|
||||
|
||||
}
|
||||
|
||||
@ -1,11 +1,10 @@
|
||||
package org.dromara.quality.domain.dto.qualityconstructionlog;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
@ -25,12 +24,11 @@ public class QltQualityConstructionLogQueryReq implements Serializable {
|
||||
/**
|
||||
* 发生日期
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||
private Date happenDate;
|
||||
private LocalDate happenDate;
|
||||
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
private String title;
|
||||
}
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
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;
|
||||
@ -8,7 +7,6 @@ import lombok.Data;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
|
||||
@ -4,13 +4,14 @@ import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.translation.annotation.Translation;
|
||||
import org.dromara.common.translation.constant.TransConstant;
|
||||
import org.dromara.quality.domain.QltQualityConstructionLog;
|
||||
import org.dromara.system.domain.vo.SysOssVo;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
@ -32,16 +33,22 @@ public class QltQualityConstructionLogVo implements Serializable {
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
@Translation(type = TransConstant.PROJECT_ID_TO_NAME, mapper = "projectId")
|
||||
private String projectName;
|
||||
|
||||
/**
|
||||
* 发生日期
|
||||
*/
|
||||
@ExcelProperty(value = "发生日期")
|
||||
private Date happenDate;
|
||||
private LocalDate happenDate;
|
||||
|
||||
/**
|
||||
* 生产情况
|
||||
@ -69,7 +76,8 @@ public class QltQualityConstructionLogVo implements Serializable {
|
||||
/**
|
||||
* 附件列表
|
||||
*/
|
||||
private List<SysOssVo> fileList;
|
||||
@Translation(type = TransConstant.OSS_ID_TO_URL, mapper = "file")
|
||||
private String fileList;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
@ -77,6 +85,12 @@ public class QltQualityConstructionLogVo implements Serializable {
|
||||
@ExcelProperty(value = "创建者")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建者名称
|
||||
*/
|
||||
@Translation(type = TransConstant.USER_ID_TO_NICKNAME)
|
||||
private String createByName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ -86,6 +100,6 @@ public class QltQualityConstructionLogVo implements Serializable {
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
private String title;
|
||||
|
||||
}
|
||||
|
||||
@ -20,8 +20,7 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.oss.core.OssClient;
|
||||
import org.dromara.common.oss.exception.OssException;
|
||||
import org.dromara.common.oss.factory.OssFactory;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.project.domain.BusProject;
|
||||
import org.dromara.common.utils.DocumentUtil;
|
||||
import org.dromara.project.service.IBusProjectService;
|
||||
import org.dromara.quality.constant.QltQualityConstant;
|
||||
import org.dromara.quality.domain.QltQualityConstructionLog;
|
||||
@ -32,10 +31,8 @@ import org.dromara.quality.domain.vo.qualityconstructionlog.QltQualityConstructi
|
||||
import org.dromara.quality.mapper.QltQualityConstructionLogMapper;
|
||||
import org.dromara.quality.service.IQltQualityConstructionLogService;
|
||||
import org.dromara.system.domain.vo.SysOssVo;
|
||||
import org.dromara.system.domain.vo.SysUserVo;
|
||||
import org.dromara.system.service.ISysOssService;
|
||||
import org.dromara.system.service.ISysUserService;
|
||||
import org.dromara.common.utils.DocumentUtil;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -47,8 +44,8 @@ import java.io.InputStream;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
/**
|
||||
@ -200,24 +197,6 @@ public class QltQualityConstructionLogServiceImpl extends ServiceImpl<QltQuality
|
||||
return qualityConstructionLogVo;
|
||||
}
|
||||
BeanUtils.copyProperties(qualityConstructionLog, qualityConstructionLogVo);
|
||||
// 关联项目信息
|
||||
Long projectId = qualityConstructionLog.getProjectId();
|
||||
if (projectId != null) {
|
||||
qualityConstructionLogVo.setProjectName(projectService.getById(projectId).getProjectName());
|
||||
}
|
||||
// 关联创建用户信息
|
||||
Long createBy = qualityConstructionLog.getCreateBy();
|
||||
if (createBy != null) {
|
||||
SysUserVo sysUserVo = userService.selectUserById(createBy);
|
||||
qualityConstructionLogVo.setCreateBy(sysUserVo.getNickName());
|
||||
}
|
||||
// 关联附件信息
|
||||
String file = qualityConstructionLog.getFile();
|
||||
if (StringUtils.isNotBlank(file)) {
|
||||
List<Long> ossIdList = Arrays.stream(file.split(",")).map(Long::parseLong).toList();
|
||||
List<SysOssVo> ossVoList = ossService.listByIds(ossIdList);
|
||||
qualityConstructionLogVo.setFileList(ossVoList);
|
||||
}
|
||||
return qualityConstructionLogVo;
|
||||
}
|
||||
|
||||
@ -234,7 +213,7 @@ public class QltQualityConstructionLogServiceImpl extends ServiceImpl<QltQuality
|
||||
return lqw;
|
||||
}
|
||||
Long projectId = req.getProjectId();
|
||||
Date happenDate = req.getHappenDate();
|
||||
LocalDate happenDate = req.getHappenDate();
|
||||
// 精准查询
|
||||
lqw.eq(ObjectUtils.isNotEmpty(projectId), QltQualityConstructionLog::getProjectId, projectId);
|
||||
lqw.eq(ObjectUtils.isNotEmpty(happenDate), QltQualityConstructionLog::getHappenDate, happenDate);
|
||||
@ -260,50 +239,11 @@ public class QltQualityConstructionLogServiceImpl extends ServiceImpl<QltQuality
|
||||
if (CollUtil.isEmpty(qualityConstructionLogList)) {
|
||||
return qualityConstructionLogVoPage;
|
||||
}
|
||||
// 获取项目名称
|
||||
List<Long> projectIdList = qualityConstructionLogList.stream().map(QltQualityConstructionLog::getProjectId).distinct().toList();
|
||||
if (projectIdList.size() != 1) {
|
||||
throw new ServiceException("仅能查询单个项目下的施工日志", HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
BusProject project = projectService.getById(projectIdList.get(0));
|
||||
if (project == null) {
|
||||
throw new ServiceException("项目不存在", HttpStatus.NOT_FOUND);
|
||||
}
|
||||
// 获取创建用户信息
|
||||
List<Long> createByList = qualityConstructionLogList.stream().map(QltQualityConstructionLog::getCreateBy).distinct().toList();
|
||||
List<SysUserVo> userVoList = userService.selectUserByIds(createByList, null);
|
||||
Map<Long, String> userMap = userVoList.stream().collect(Collectors.toMap(SysUserVo::getUserId, SysUserVo::getNickName));
|
||||
// 获取附件信息
|
||||
List<Long> ossIdList = qualityConstructionLogList.stream().map(QltQualityConstructionLog::getFile).filter(StringUtils::isNotBlank)
|
||||
.flatMap(fileId -> Arrays.stream(fileId.split(",")).map(Long::parseLong)).distinct().toList();
|
||||
Map<Long, List<SysOssVo>> ossMap = ossService.listByIds(ossIdList)
|
||||
.stream().collect(Collectors.groupingBy(SysOssVo::getOssId));
|
||||
// 对象列表 => 封装对象列表
|
||||
List<QltQualityConstructionLogVo> qualityConstructionLogVoList = qualityConstructionLogList.stream().map(qualityConstructionLog -> {
|
||||
QltQualityConstructionLogVo qualityConstructionLogVo = new QltQualityConstructionLogVo();
|
||||
// 对象转封装类
|
||||
BeanUtils.copyProperties(qualityConstructionLog, qualityConstructionLogVo);
|
||||
// 项目名称
|
||||
qualityConstructionLogVo.setProjectName(project.getProjectName());
|
||||
// 创建用户姓名
|
||||
Long createBy = qualityConstructionLog.getCreateBy();
|
||||
String createByName = null;
|
||||
if (userMap.containsKey(createBy)) {
|
||||
createByName = userMap.get(createBy);
|
||||
}
|
||||
qualityConstructionLogVo.setCreateBy(createByName);
|
||||
// 附件信息
|
||||
String file = qualityConstructionLog.getFile();
|
||||
List<SysOssVo> fileList = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(file)) {
|
||||
List<Long> fileIdList = Arrays.stream(file.split(",")).map(Long::parseLong).toList();
|
||||
for (Long fileId : fileIdList) {
|
||||
if (ossMap.containsKey(fileId)) {
|
||||
fileList.add(ossMap.get(fileId).get(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
qualityConstructionLogVo.setFileList(fileList);
|
||||
return qualityConstructionLogVo;
|
||||
}).toList();
|
||||
qualityConstructionLogVoPage.setRecords(qualityConstructionLogVoList);
|
||||
@ -395,8 +335,8 @@ public class QltQualityConstructionLogServiceImpl extends ServiceImpl<QltQuality
|
||||
replacementMap.put("${createTime}", createTime != null ? DateUtils.formatDateTime(createTime) : "");
|
||||
String projectName = projectService.getById(qualityConstructionLog.getProjectId()).getProjectName();
|
||||
replacementMap.put("${projectName}", projectName);
|
||||
Date happenDate = qualityConstructionLog.getHappenDate();
|
||||
replacementMap.put("${happenDate}", happenDate != null ? DateUtils.formatDate(happenDate) : "");
|
||||
LocalDate happenDate = qualityConstructionLog.getHappenDate();
|
||||
replacementMap.put("${happenDate}", happenDate != null ? happenDate.toString() : "");
|
||||
replacementMap.put("${productionStatus}", qualityConstructionLog.getProductionStatus());
|
||||
replacementMap.put("${technologyQuality}", qualityConstructionLog.getTechnologyQuality());
|
||||
replacementMap.put("${remark}", qualityConstructionLog.getRemark());
|
||||
|
||||
@ -4,9 +4,10 @@ import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.core.domain.vo.IdAndNameVO;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import org.dromara.common.translation.annotation.Translation;
|
||||
import org.dromara.common.translation.constant.TransConstant;
|
||||
import org.dromara.safety.domain.HseSafetyLog;
|
||||
|
||||
import java.io.Serial;
|
||||
@ -132,9 +133,15 @@ public class HseSafetyLogVo implements Serializable {
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
* 创建者
|
||||
*/
|
||||
private IdAndNameVO creator;
|
||||
private Long createBy;
|
||||
|
||||
/**
|
||||
* 创建者名称
|
||||
*/
|
||||
@Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "createBy")
|
||||
private String createByName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
|
||||
@ -11,7 +11,6 @@ import org.dromara.common.core.utils.ObjectUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.project.service.IBusProjectService;
|
||||
import org.dromara.safety.domain.HseQuestionsCategory;
|
||||
import org.dromara.safety.domain.dto.questionscategory.HseQuestionsCategoryCreateReq;
|
||||
|
||||
@ -10,7 +10,6 @@ import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.ObjectUtils;
|
||||
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.project.service.IBusProjectService;
|
||||
import org.dromara.safety.domain.HseQuestionsConfig;
|
||||
import org.dromara.safety.domain.dto.questionsconfig.HseQuestionsConfigCreateReq;
|
||||
|
||||
@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.dromara.bigscreen.domain.dto.WeatherQueryReq;
|
||||
import org.dromara.common.core.constant.HttpStatus;
|
||||
import org.dromara.common.core.domain.vo.IdAndNameVO;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.ObjectUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
@ -184,15 +183,6 @@ public class HseSafetyLogServiceImpl extends ServiceImpl<HseSafetyLogMapper, Hse
|
||||
return safetyLogVo;
|
||||
}
|
||||
BeanUtils.copyProperties(safetyLog, safetyLogVo);
|
||||
// 关联创建用户信息
|
||||
Long createBy = safetyLog.getCreateBy();
|
||||
if (createBy != null) {
|
||||
SysUserVo sysUserVo = userMapper.selectVoById(createBy);
|
||||
if (sysUserVo != null) {
|
||||
safetyLogVo.setCreator(IdAndNameVO.build(sysUserVo.getUserId(), sysUserVo.getNickName()));
|
||||
}
|
||||
|
||||
}
|
||||
return safetyLogVo;
|
||||
}
|
||||
|
||||
@ -216,7 +206,7 @@ public class HseSafetyLogServiceImpl extends ServiceImpl<HseSafetyLogMapper, Hse
|
||||
// 联表查询
|
||||
if (StringUtils.isNotBlank(creatorName)) {
|
||||
LambdaQueryWrapper<SysUser> userQueryWrapper = new LambdaQueryWrapper<>();
|
||||
userQueryWrapper.like(SysUser::getUserName, creatorName);
|
||||
userQueryWrapper.like(SysUser::getNickName, creatorName);
|
||||
List<SysUserVo> sysUserVos = userMapper.selectUserList(userQueryWrapper);
|
||||
if (CollUtil.isNotEmpty(sysUserVos)) {
|
||||
List<Long> userIds = sysUserVos.stream().map(SysUserVo::getUserId).toList();
|
||||
|
||||
@ -14,7 +14,6 @@ import org.dromara.common.core.utils.ObjectUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.contractor.domain.SubContractor;
|
||||
import org.dromara.contractor.service.ISubContractorService;
|
||||
import org.dromara.project.domain.BusProjectTeam;
|
||||
@ -267,7 +266,10 @@ public class HseTeamMeetingServiceImpl extends ServiceImpl<HseTeamMeetingMapper,
|
||||
lqw.eq(ObjectUtils.isNotEmpty(projectId), HseTeamMeeting::getProjectId, projectId);
|
||||
lqw.eq(ObjectUtils.isNotEmpty(teamId), HseTeamMeeting::getTeamId, teamId);
|
||||
lqw.eq(ObjectUtils.isNotEmpty(contractorId), HseTeamMeeting::getContractorId, contractorId);
|
||||
lqw.eq(ObjectUtils.isNotEmpty(meetingDate), HseTeamMeeting::getMeetingDate, meetingDate);
|
||||
if (meetingDate != null) {
|
||||
lqw.ge(HseTeamMeeting::getMeetingDate, meetingDate);
|
||||
lqw.lt(HseTeamMeeting::getMeetingDate, meetingDate.plusDays(1));
|
||||
}
|
||||
lqw.orderByDesc(HseTeamMeeting::getCreateTime);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user