被删除文件恢复
This commit is contained in:
parent
4c85f9197c
commit
9b963d43f5
|
@ -1,20 +1,16 @@
|
|||
package com.dite.znpt.domain;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description: 统一定义顶层Entity实体审计 基类
|
||||
|
@ -41,11 +37,6 @@ public class AuditableEntity implements Serializable {
|
|||
@ApiModelProperty(value = "修改人id", hidden = true)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty(value = "id集合", example = "[]", notes = "id集合")
|
||||
@TableField(exist = false)
|
||||
private List<String> idList;
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty(value = "当前页", example = "1", notes = "0")
|
||||
@TableField(exist = false)
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
package com.dite.znpt.domain.entity;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.dite.znpt.domain.AuditableEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/07/27 19:51
|
||||
* @Description: 项目日报信息表实体类
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("project_daily_report")
|
||||
@ApiModel(value="ProjectDailyReportEntity对象", description="项目日报信息表")
|
||||
public class ProjectDailyReportEntity extends AuditableEntity implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -88597301057742621L;
|
||||
|
||||
@ExcelProperty("主键")
|
||||
@ApiModelProperty("主键")
|
||||
@TableId(value = "report_id", type = IdType.ASSIGN_ID)
|
||||
private String reportId;
|
||||
|
||||
@ExcelProperty("项目id")
|
||||
@ApiModelProperty("项目id")
|
||||
@TableField("project_id")
|
||||
private String projectId;
|
||||
|
||||
@ExcelProperty("日报日期")
|
||||
@ApiModelProperty("日报日期")
|
||||
@TableField("report_date")
|
||||
private LocalDate reportDate;
|
||||
|
||||
@ExcelProperty("日报提交人")
|
||||
@ApiModelProperty("日报提交人")
|
||||
@TableField("submit_user")
|
||||
private String submitUser;
|
||||
}
|
||||
|
|
@ -1,18 +1,19 @@
|
|||
package com.dite.znpt.domain.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.dite.znpt.domain.AuditableEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
|
@ -165,7 +166,7 @@ public class ProjectEntity extends AuditableEntity implements Serializable {
|
|||
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
private LocalDate startDate;
|
||||
|
||||
// 施工人员,安全经理,项目经理,商务,财务,高级管理员,项目远程顾问外部协作者,质量经理、现场经理及工作组长。
|
||||
@ApiModelProperty(value = "结束时间")
|
||||
private LocalDate endDate;
|
||||
}
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/07/17 21:58
|
||||
* @Description: 项目预算信息表导入请求类
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="ProjectBudgetInfo导入请求对象", description="项目预算信息表")
|
||||
public class ProjectBudgetInfoImportReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 580212651388155611L;
|
||||
|
||||
|
||||
@ExcelProperty(value = "项目名称")
|
||||
private String projectName;
|
||||
|
||||
@ExcelProperty(value = "预算名称")
|
||||
private String budgetName;
|
||||
|
||||
@ExcelProperty(value = "预算类型")
|
||||
private String budgetType;
|
||||
|
||||
@ExcelProperty(value = "预算金额(万元)")
|
||||
private Double budgetAmount;
|
||||
|
||||
@ExcelProperty(value = "预算说明")
|
||||
private String budgetDesc;
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/07/27 19:51
|
||||
* @Description: 项目日报信息请求实体
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("项目日报信息列表请求实体")
|
||||
public class ProjectDailyReportListReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 913060537944500760L;
|
||||
|
||||
@ApiModelProperty("查询关键字")
|
||||
private String keyword;
|
||||
|
||||
@ApiModelProperty("项目日报信息Id")
|
||||
private String reportId;
|
||||
|
||||
@ApiModelProperty("项目id")
|
||||
private String projectId;
|
||||
|
||||
@ApiModelProperty("日报日期")
|
||||
private LocalDate reportDate;
|
||||
|
||||
@ApiModelProperty("日报提交人")
|
||||
private String submitUser;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/07/27 19:51
|
||||
* @Description: 项目日报信息表请求类
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="ProjectDailyReport请求对象", description="项目日报信息表")
|
||||
public class ProjectDailyReportReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -35936236241363317L;
|
||||
|
||||
@ApiModelProperty("主键")
|
||||
private String reportId;
|
||||
|
||||
@NotNull(message = "项目id不能为空")
|
||||
@ApiModelProperty("项目id")
|
||||
private String projectId;
|
||||
|
||||
@NotNull(message = "日报日期不能为空")
|
||||
@ApiModelProperty("日报日期")
|
||||
private LocalDate reportDate;
|
||||
|
||||
@NotBlank(message = "日报提交人不能为空")
|
||||
@Size(max = 32, message = "日报提交人长度不能超过32字符")
|
||||
@ApiModelProperty("日报提交人")
|
||||
private String submitUser;
|
||||
|
||||
@NotBlank(message = "日报附件id不能为空")
|
||||
@ApiModelProperty("日报附件id")
|
||||
private String reportAttachId;
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import com.dite.znpt.domain.entity.AttachInfoEntity;
|
||||
import com.dite.znpt.domain.entity.ProjectDailyReportEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/07/27 19:51
|
||||
* @Description: 项目日报信息响应实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("项目日报信息响应实体")
|
||||
public class ProjectDailyReportResp extends ProjectDailyReportEntity {
|
||||
|
||||
@ApiModelProperty("日报附件")
|
||||
private AttachInfoEntity reportAttach;
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.dite.znpt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dite.znpt.domain.entity.ProjectDailyReportEntity;
|
||||
import com.dite.znpt.domain.vo.ProjectDailyReportListReq;
|
||||
import com.dite.znpt.domain.vo.ProjectDailyReportResp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/07/27 19:51
|
||||
* @Description: 项目日报信息表数据库访问层
|
||||
*/
|
||||
public interface ProjectDailyReportMapper extends BaseMapper<ProjectDailyReportEntity> {
|
||||
List<ProjectDailyReportResp> queryBySelective(ProjectDailyReportListReq projectDailyReportReq);
|
||||
}
|
||||
|
|
@ -23,7 +23,7 @@ public interface AttachInfoService extends IService<AttachInfoEntity> {
|
|||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
List<AttachInfoEntity> listByBusinessIds(List<String> businessIds, String businessType);
|
||||
List<AttachInfoEntity> listByBusinessIds(List<String> businessIds, AttachBusinessTypeEnum businessType);
|
||||
|
||||
/**
|
||||
* 功能描述:新增附件信息
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
package com.dite.znpt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dite.znpt.domain.entity.ProjectDailyReportEntity;
|
||||
import com.dite.znpt.domain.vo.ProjectDailyReportListReq;
|
||||
import com.dite.znpt.domain.vo.ProjectDailyReportReq;
|
||||
import com.dite.znpt.domain.vo.ProjectDailyReportResp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/07/27 19:51
|
||||
* @Description: 项目日报信息表服务接口
|
||||
*/
|
||||
public interface ProjectDailyReportService extends IService<ProjectDailyReportEntity> {
|
||||
|
||||
/**
|
||||
* 功能描述:查询项目日报信息列表
|
||||
*
|
||||
* @param projectDailyReportReq 项目日报信息
|
||||
* @return {@link List }<{@link ProjectDailyReportResp }>
|
||||
* @author huise23
|
||||
* @date 2025/07/27 19:51
|
||||
**/
|
||||
List<ProjectDailyReportResp> selectList(ProjectDailyReportListReq projectDailyReportReq);
|
||||
|
||||
/**
|
||||
* 功能描述:查询单条项目日报信息
|
||||
*
|
||||
* @param reportId 项目日报信息Id
|
||||
* @return {@link ProjectDailyReportResp }
|
||||
* @author huise23
|
||||
* @date 2025/07/27 19:51
|
||||
**/
|
||||
ProjectDailyReportResp selectById(String reportId);
|
||||
|
||||
/**
|
||||
* 功能描述:新增项目日报信息
|
||||
*
|
||||
* @param projectDailyReportReq 项目日报信息
|
||||
* @author huise23
|
||||
* @date 2025/07/27 19:51
|
||||
**/
|
||||
void saveData(ProjectDailyReportReq projectDailyReportReq);
|
||||
|
||||
/**
|
||||
* 功能描述:更新项目日报信息
|
||||
*
|
||||
* @param projectDailyReportReq 项目日报信息
|
||||
* @author huise23
|
||||
* @date 2025/07/27 19:51
|
||||
**/
|
||||
void updateData(ProjectDailyReportReq projectDailyReportReq);
|
||||
|
||||
/**
|
||||
* 功能描述:删除项目日报信息
|
||||
*
|
||||
* @param reportId 项目日报信息Id
|
||||
* @author huise23
|
||||
* @date 2025/07/27 19:51
|
||||
**/
|
||||
void deleteById(String reportId);
|
||||
|
||||
/**
|
||||
* 功能描述:我今天
|
||||
*
|
||||
* @return {@link ProjectDailyReportResp }
|
||||
* @author cuizhibin
|
||||
* @date 2025/07/27 19:53
|
||||
**/
|
||||
ProjectDailyReportResp myToday(String projectId);
|
||||
}
|
||||
|
|
@ -30,6 +30,7 @@ import java.net.URLEncoder;
|
|||
import java.rmi.ServerException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
@ -51,9 +52,9 @@ public class AttachInfoServiceImpl extends ServiceImpl<FileInfoMapper, AttachInf
|
|||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
@Override
|
||||
public List<AttachInfoEntity> listByBusinessIds(List<String> businessIds, String businessType) {
|
||||
public List<AttachInfoEntity> listByBusinessIds(List<String> businessIds, AttachBusinessTypeEnum businessType) {
|
||||
return lambdaQuery().in(AttachInfoEntity::getBusinessId, businessIds)
|
||||
.eq(StrUtil.isNotEmpty(businessType), AttachInfoEntity::getBusinessType, businessType)
|
||||
.eq(Objects.nonNull(businessType), AttachInfoEntity::getBusinessType, businessType.getCode())
|
||||
.list();
|
||||
}
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ import com.dite.znpt.service.PartService;
|
|||
import com.dite.znpt.util.PageUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -98,6 +99,7 @@ public class AudioFileInfoServiceImpl extends ServiceImpl<AudioFileInfoMapper, A
|
|||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public List<AudioFileInfoResp> batchUpload(String imageId, MultipartFile[] files) {
|
||||
ImageEntity image = imageMapper.selectById(imageId);
|
||||
if(null == image){
|
||||
|
@ -120,7 +122,7 @@ public class AudioFileInfoServiceImpl extends ServiceImpl<AudioFileInfoMapper, A
|
|||
}
|
||||
}
|
||||
}
|
||||
baseMapper.insert(list);
|
||||
saveBatch(list);
|
||||
return BeanUtil.copyToList(list, AudioFileInfoResp.class);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,138 @@
|
|||
package com.dite.znpt.service.impl;
|
||||
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.dite.znpt.constant.Message;
|
||||
import com.dite.znpt.domain.entity.AttachInfoEntity;
|
||||
import com.dite.znpt.domain.entity.ProjectDailyReportEntity;
|
||||
import com.dite.znpt.domain.vo.ProjectDailyReportListReq;
|
||||
import com.dite.znpt.domain.vo.ProjectDailyReportReq;
|
||||
import com.dite.znpt.domain.vo.ProjectDailyReportResp;
|
||||
import com.dite.znpt.enums.AttachBusinessTypeEnum;
|
||||
import com.dite.znpt.exception.ServiceException;
|
||||
import com.dite.znpt.mapper.ProjectDailyReportMapper;
|
||||
import com.dite.znpt.service.AttachInfoService;
|
||||
import com.dite.znpt.service.ProjectDailyReportService;
|
||||
import com.dite.znpt.util.PageUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/07/27 19:51
|
||||
* @Description: 项目日报信息表服务实现类
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class ProjectDailyReportServiceImpl extends ServiceImpl<ProjectDailyReportMapper, ProjectDailyReportEntity> implements ProjectDailyReportService {
|
||||
|
||||
private final AttachInfoService attachInfoService;
|
||||
|
||||
/**
|
||||
* 功能描述:查询项目日报信息列表
|
||||
*
|
||||
* @param projectDailyReportReq 项目日报信息信息
|
||||
* @return {@link List }<{@link ProjectDailyReportResp }>
|
||||
* @author huise23
|
||||
* @date 2025/07/27 19:51
|
||||
**/
|
||||
@Override
|
||||
public List<ProjectDailyReportResp> selectList(ProjectDailyReportListReq projectDailyReportReq) {
|
||||
PageUtil.startPage();
|
||||
List<ProjectDailyReportResp> respList= this.baseMapper.queryBySelective(projectDailyReportReq);
|
||||
if (CollUtil.isNotEmpty(respList)) {
|
||||
List<String> reportIds = respList.stream().map(ProjectDailyReportResp::getReportId).toList();
|
||||
Map<String, AttachInfoEntity> attachMap = attachInfoService.listByBusinessIds(reportIds, AttachBusinessTypeEnum.PROJECT_DAILY_REPORT)
|
||||
.stream().collect(Collectors.toMap(AttachInfoEntity::getBusinessId, Function.identity()));
|
||||
respList.forEach(resp -> {
|
||||
resp.setReportAttach(attachMap.get(resp.getReportId()));
|
||||
});
|
||||
}
|
||||
return respList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:查询单条项目日报信息
|
||||
*
|
||||
* @param reportId 项目日报信息Id
|
||||
* @return {@link ProjectDailyReportResp }
|
||||
* @author huise23
|
||||
* @date 2025/07/27 19:51
|
||||
**/
|
||||
@Override
|
||||
public ProjectDailyReportResp selectById(String reportId) {
|
||||
ProjectDailyReportListReq projectDailyReportReq = new ProjectDailyReportListReq();
|
||||
projectDailyReportReq.setReportId(reportId);
|
||||
|
||||
List<ProjectDailyReportResp> list = selectList(projectDailyReportReq);
|
||||
return CollUtil.isNotEmpty(list) ? CollUtil.getFirst(list) : new ProjectDailyReportResp();
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:新增项目日报信息
|
||||
*
|
||||
* @param projectDailyReportReq 项目日报信息
|
||||
* @author huise23
|
||||
* @date 2025/07/27 19:51
|
||||
**/
|
||||
@Override
|
||||
public void saveData(ProjectDailyReportReq projectDailyReportReq) {
|
||||
ProjectDailyReportResp myToday = myToday(projectDailyReportReq.getProjectId());
|
||||
if (Objects.nonNull(myToday)) {
|
||||
throw new ServiceException(Message.DAILY_REPORT_EXISTS);
|
||||
}
|
||||
ProjectDailyReportEntity entity = BeanUtil.copyProperties(projectDailyReportReq, ProjectDailyReportEntity.class);
|
||||
save(entity);
|
||||
attachInfoService.updateBusinessIdByAttachIds(entity.getReportId(), ListUtil.of(projectDailyReportReq.getReportAttachId()), AttachBusinessTypeEnum.PROJECT_DAILY_REPORT);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:更新项目日报信息
|
||||
*
|
||||
* @param projectDailyReportReq 项目日报信息
|
||||
* @author huise23
|
||||
* @date 2025/07/27 19:51
|
||||
**/
|
||||
@Override
|
||||
public void updateData(ProjectDailyReportReq projectDailyReportReq) {
|
||||
ProjectDailyReportEntity entity = BeanUtil.copyProperties(projectDailyReportReq, ProjectDailyReportEntity.class);
|
||||
updateById(entity);
|
||||
attachInfoService.updateBusinessIdByAttachIds(entity.getReportId(), ListUtil.of(projectDailyReportReq.getReportAttachId()), AttachBusinessTypeEnum.PROJECT_DAILY_REPORT);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:删除项目日报信息
|
||||
*
|
||||
* @param reportId 项目日报信息Id
|
||||
* @author huise23
|
||||
* @date 2025/07/27 19:51
|
||||
**/
|
||||
@Override
|
||||
public void deleteById(String reportId) {
|
||||
removeById(reportId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProjectDailyReportResp myToday(String projectId) {
|
||||
ProjectDailyReportListReq req = new ProjectDailyReportListReq();
|
||||
req.setProjectId(projectId);
|
||||
req.setSubmitUser(StpUtil.getLoginIdAsString());
|
||||
req.setReportDate(LocalDate.now());
|
||||
List<ProjectDailyReportResp> list = selectList(req);
|
||||
if (CollUtil.isNotEmpty(list)){
|
||||
return CollUtil.getFirst(list);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
|
@ -5,20 +5,20 @@ import cn.hutool.core.util.StrUtil;
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.dite.znpt.constant.Message;
|
||||
import com.dite.znpt.converts.Converts;
|
||||
import com.dite.znpt.domain.entity.UserEntity;
|
||||
import com.dite.znpt.domain.entity.ProjectEntity;
|
||||
import com.dite.znpt.domain.entity.UserEntity;
|
||||
import com.dite.znpt.domain.vo.ProjectListReq;
|
||||
import com.dite.znpt.domain.vo.ProjectListResp;
|
||||
import com.dite.znpt.domain.vo.ProjectReq;
|
||||
import com.dite.znpt.domain.vo.ProjectResp;
|
||||
import com.dite.znpt.enums.ProjectStatusEnum;
|
||||
import com.dite.znpt.exception.ServiceException;
|
||||
import com.dite.znpt.service.UserService;
|
||||
import com.dite.znpt.service.ProjectService;
|
||||
import com.dite.znpt.mapper.ProjectMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import com.dite.znpt.service.ProjectService;
|
||||
import com.dite.znpt.service.UserService;
|
||||
import com.dite.znpt.util.PageUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
@ -59,6 +59,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, ProjectEntity
|
|||
List<ProjectListResp> list= this.baseMapper.queryBySelective(req);
|
||||
list.forEach(resp -> {
|
||||
resp.setStatusLabel(ProjectStatusEnum.getDescByCode(resp.getStatus()));
|
||||
// 判断人员类型
|
||||
});
|
||||
return list;
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@ import com.dite.znpt.mapper.ProjectTaskGroupMapper;
|
|||
import com.dite.znpt.mapper.ProjectTaskMapper;
|
||||
import com.dite.znpt.service.AttachInfoService;
|
||||
import com.dite.znpt.service.ProjectTaskService;
|
||||
import com.dite.znpt.util.PageUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
@ -55,7 +54,7 @@ public class ProjectTaskServiceImpl extends ServiceImpl<ProjectTaskMapper, Proje
|
|||
List<ProjectTaskResp> projectTaskList = this.baseMapper.queryBySelective(projectTaskReq);
|
||||
Map<String, List<AttachInfoEntity>> attachMap;
|
||||
if (!BooleanUtil.isTrue(projectTaskReq.getIsExport())) {
|
||||
attachMap = attachInfoService.listByBusinessIds(projectTaskList.stream().map(ProjectTaskResp::getTaskId).collect(Collectors.toList()), null)
|
||||
attachMap = attachInfoService.listByBusinessIds(projectTaskList.stream().map(ProjectTaskResp::getTaskId).collect(Collectors.toList()), AttachBusinessTypeEnum.PROJECT_TASK)
|
||||
.stream().collect(Collectors.groupingBy(AttachInfoEntity::getBusinessId));
|
||||
} else {
|
||||
attachMap = new HashMap<>();
|
||||
|
|
|
@ -5,10 +5,10 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.dite.znpt.domain.Result;
|
||||
import com.dite.znpt.domain.entity.RegulationTypeEntity;
|
||||
import com.dite.znpt.domain.entity.RegulationEntity;
|
||||
import com.dite.znpt.mapper.RegulationTypeMapper;
|
||||
import com.dite.znpt.domain.entity.RegulationTypeEntity;
|
||||
import com.dite.znpt.mapper.RegulationMapper;
|
||||
import com.dite.znpt.mapper.RegulationTypeMapper;
|
||||
import com.dite.znpt.service.RegulationTypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -29,7 +29,7 @@ public class RegulationTypeServiceImpl extends ServiceImpl<RegulationTypeMapper,
|
|||
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public Result getRegulationTypes(Integer page, Integer size, String typeName) {
|
||||
public Result getRegulationTypes(Integer page, Integer size, String typeName, String status, String remark) {
|
||||
try {
|
||||
Page<RegulationTypeEntity> pageParam = new Page<>(page, size);
|
||||
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
<?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="com.dite.znpt.mapper.ProjectDailyReportMapper">
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
a.report_id, a.project_id, a.report_date, a.submit_user,
|
||||
a.update_by, a.create_time, a.create_by, a.update_time
|
||||
</sql>
|
||||
|
||||
<select id="queryBySelective" resultType="com.dite.znpt.domain.vo.ProjectDailyReportResp">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from project_daily_report a
|
||||
<where>
|
||||
<if test="reportId != null and reportId != ''">
|
||||
and a.report_id like concat ('%', #{reportId}, '%')
|
||||
</if>
|
||||
<if test="projectId != null and projectId != ''">
|
||||
and a.project_id like concat ('%', #{projectId}, '%')
|
||||
</if>
|
||||
<if test="reportDate != null">
|
||||
and a.report_date = #{reportDate}
|
||||
</if>
|
||||
<if test="submitUser != null and submitUser != ''">
|
||||
and a.submit_user like concat ('%', #{submitUser}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
package com.dite.znpt.web.controller;
|
||||
|
||||
import com.dite.znpt.domain.PageResult;
|
||||
import com.dite.znpt.domain.Result;
|
||||
import com.dite.znpt.domain.vo.ProjectDailyReportListReq;
|
||||
import com.dite.znpt.domain.vo.ProjectDailyReportReq;
|
||||
import com.dite.znpt.domain.vo.ProjectDailyReportResp;
|
||||
import com.dite.znpt.service.ProjectDailyReportService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/07/27 19:51
|
||||
*/
|
||||
@Api(tags = "项目日报信息")
|
||||
@RestController
|
||||
@RequestMapping("/project-daily-report")
|
||||
public class ProjectDailyReportController {
|
||||
@Resource
|
||||
private ProjectDailyReportService projectDailyReportService;
|
||||
|
||||
@ApiOperation(value = "获取项目日报信息列表", httpMethod = "GET")
|
||||
@GetMapping("/list")
|
||||
public PageResult<ProjectDailyReportResp> list(ProjectDailyReportListReq projectDailyReportReq) {
|
||||
return PageResult.ok(projectDailyReportService.selectList(projectDailyReportReq));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据项目日报信息Id获取详细信息", httpMethod = "GET")
|
||||
@GetMapping("/{reportId}")
|
||||
public Result<ProjectDailyReportResp> getInfo(@PathVariable String reportId) {
|
||||
return Result.ok(projectDailyReportService.selectById(reportId));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取登录人当日日报", httpMethod = "GET")
|
||||
@GetMapping("/my-today/{projectId}")
|
||||
public Result<ProjectDailyReportResp> myToday(@PathVariable String projectId) {
|
||||
return Result.ok(projectDailyReportService.myToday(projectId));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增项目日报信息", httpMethod = "POST")
|
||||
@PostMapping
|
||||
public Result<Object> add(@Validated @RequestBody ProjectDailyReportReq projectDailyReportReq) {
|
||||
projectDailyReportService.saveData(projectDailyReportReq);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改项目日报信息", httpMethod = "PUT")
|
||||
@PutMapping
|
||||
public Result<Object> edit(@Validated @RequestBody ProjectDailyReportReq projectDailyReportReq) {
|
||||
projectDailyReportService.updateData(projectDailyReportReq);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除项目日报信息", httpMethod = "DELETE")
|
||||
@DeleteMapping("/{reportId}")
|
||||
public Result<Object> remove(@PathVariable String reportId) {
|
||||
projectDailyReportService.deleteById(reportId);
|
||||
return Result.ok();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue