AI工单
This commit is contained in:
@ -28,9 +28,12 @@ import org.dromara.contractor.service.ISubContractorService;
|
||||
import org.dromara.project.domain.BusProject;
|
||||
import org.dromara.project.domain.enums.SubConstructionUserRoleEnum;
|
||||
import org.dromara.project.service.IBusProjectService;
|
||||
import org.dromara.system.domain.SysUser;
|
||||
import org.dromara.system.service.ISysUserService;
|
||||
import org.dromara.tender.domain.TenderSupplierInput;
|
||||
import org.dromara.tender.service.ITenderSupplierInputService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -56,6 +59,10 @@ public class SubContractorServiceImpl extends ServiceImpl<SubContractorMapper, S
|
||||
@Resource
|
||||
private ITenderSupplierInputService supplierInputService;
|
||||
|
||||
@Resource
|
||||
@Lazy
|
||||
private ISysUserService userService;
|
||||
|
||||
/**
|
||||
* 查询分包单位
|
||||
*
|
||||
@ -360,21 +367,11 @@ public class SubContractorServiceImpl extends ServiceImpl<SubContractorMapper, S
|
||||
*/
|
||||
@Override
|
||||
public List<SubManagerVo> queryManagerListById(Long id) {
|
||||
SubContractor contractor = this.getById(id);
|
||||
if (contractor == null) {
|
||||
throw new ServiceException("分包方不存在", HttpStatus.NOT_FOUND);
|
||||
}
|
||||
List<SubConstructionUser> adminUserList = constructionUserService.lambdaQuery()
|
||||
.eq(SubConstructionUser::getContractorId, id)
|
||||
.eq(SubConstructionUser::getUserRole, SubConstructionUserRoleEnum.ADMIN.getValue())
|
||||
.list();
|
||||
if (CollUtil.isEmpty(adminUserList)) {
|
||||
return List.of();
|
||||
}
|
||||
return adminUserList.stream().map(user -> {
|
||||
List<SysUser> sysUsers = userService.selectUserListByContractorId(id);
|
||||
return sysUsers.stream().map(user -> {
|
||||
SubManagerVo managerVo = new SubManagerVo();
|
||||
managerVo.setManagerId(user.getSysUserId());
|
||||
managerVo.setManagerName(user.getUserName());
|
||||
managerVo.setManagerId(user.getUserId());
|
||||
managerVo.setManagerName(user.getNickName());
|
||||
return managerVo;
|
||||
}).distinct().toList();
|
||||
}
|
||||
|
||||
@ -0,0 +1,105 @@
|
||||
package org.dromara.progress.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.progress.domain.vo.PgsProcessDailyReportVo;
|
||||
import org.dromara.progress.domain.bo.PgsProcessDailyReportBo;
|
||||
import org.dromara.progress.service.IPgsProcessDailyReportService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 进度日报
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-18
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/progress/processDailyReport")
|
||||
public class PgsProcessDailyReportController extends BaseController {
|
||||
|
||||
private final IPgsProcessDailyReportService pgsProcessDailyReportService;
|
||||
|
||||
/**
|
||||
* 查询进度日报列表
|
||||
*/
|
||||
@SaCheckPermission("progress:processDailyReport:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<PgsProcessDailyReportVo> list(PgsProcessDailyReportBo bo, PageQuery pageQuery) {
|
||||
return pgsProcessDailyReportService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出进度日报列表
|
||||
*/
|
||||
@SaCheckPermission("progress:processDailyReport:export")
|
||||
@Log(title = "进度日报", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(PgsProcessDailyReportBo bo, HttpServletResponse response) {
|
||||
List<PgsProcessDailyReportVo> list = pgsProcessDailyReportService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "进度日报", PgsProcessDailyReportVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取进度日报详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("progress:processDailyReport:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<PgsProcessDailyReportVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(pgsProcessDailyReportService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增进度日报
|
||||
*/
|
||||
@SaCheckPermission("progress:processDailyReport:add")
|
||||
@Log(title = "进度日报", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody PgsProcessDailyReportBo bo) {
|
||||
return toAjax(pgsProcessDailyReportService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改进度日报
|
||||
*/
|
||||
@SaCheckPermission("progress:processDailyReport:edit")
|
||||
@Log(title = "进度日报", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody PgsProcessDailyReportBo bo) {
|
||||
return toAjax(pgsProcessDailyReportService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除进度日报
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("progress:processDailyReport:remove")
|
||||
@Log(title = "进度日报", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(pgsProcessDailyReportService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
@ -12,6 +12,7 @@ import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
import org.apache.poi.ss.util.RegionUtil;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.enums.FormatsType;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.DateUtils;
|
||||
@ -22,11 +23,13 @@ import org.dromara.manager.weathermanager.WeatherManager;
|
||||
import org.dromara.manager.weathermanager.vo.WeatherVo;
|
||||
import org.dromara.mechanical.domain.BusMechanicalrewriting;
|
||||
import org.dromara.mechanical.service.IBusMechanicalrewritingService;
|
||||
import org.dromara.progress.domain.PgsProcessDailyReport;
|
||||
import org.dromara.progress.domain.dto.export.ReportExportDto;
|
||||
import org.dromara.progress.domain.vo.export.*;
|
||||
import org.dromara.progress.domain.vo.progresscategory.PgsProgressCategoryByDayVo;
|
||||
import org.dromara.progress.domain.vo.progresscategory.PgsProgressCategoryDayTotalVo;
|
||||
import org.dromara.progress.domain.vo.progresscategory.PgsProgressCategoryDetailByDayVo;
|
||||
import org.dromara.progress.service.IPgsProcessDailyReportService;
|
||||
import org.dromara.progress.service.IPgsProgressCategoryService;
|
||||
import org.dromara.progress.service.IPgsProgressPlanService;
|
||||
import org.dromara.project.domain.BusProject;
|
||||
@ -44,10 +47,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody;
|
||||
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.*;
|
||||
import java.net.URL;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
@ -73,6 +73,8 @@ public class PgsReportExportController extends BaseController {
|
||||
private ISysOssService ossService;
|
||||
@Resource
|
||||
private IBusMechanicalrewritingService busMechanicalrewritingService;
|
||||
@Resource
|
||||
private IPgsProcessDailyReportService dailyReportService;
|
||||
|
||||
@Resource
|
||||
private WeatherManager weatherManager;
|
||||
@ -82,12 +84,18 @@ public class PgsReportExportController extends BaseController {
|
||||
|
||||
@SaIgnore
|
||||
@GetMapping("/dayReport")
|
||||
public void getStreamData(ReportExportDto dto, HttpServletResponse response) {
|
||||
public R<String> getStreamData(ReportExportDto dto) {
|
||||
String url = "";
|
||||
LocalDate localDate = DateUtils.parseLocalDateTime(FormatsType.YYYY_MM_DD, dto.getDate());
|
||||
PgsProcessDailyReport one = dailyReportService.lambdaQuery()
|
||||
.eq(PgsProcessDailyReport::getReportDate, localDate)
|
||||
.eq(PgsProcessDailyReport::getProjectId, dto.getProjectId())
|
||||
.last("limit 1")
|
||||
.one();
|
||||
if (one != null) {
|
||||
url = one.getUrl();
|
||||
} else {
|
||||
try {
|
||||
// 设置响应头,指定文件类型和下载文件名
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-Disposition", "attachment; filename=project-report.xlsx");
|
||||
|
||||
// 获取数据并导出Excel
|
||||
PgsProgressCategoryDayTotalVo progressCategoryByDay = pgsProgressCategoryService.getProgressCategoryByDay(dto.getProjectId(), DateUtils.parseLocalDateTime(FormatsType.YYYY_MM_DD, dto.getDate()));
|
||||
|
||||
@ -95,15 +103,35 @@ public class PgsReportExportController extends BaseController {
|
||||
List<List<ProjectData>> projectDataList = getProjectDataListAsRows(progressCategoryByDay);
|
||||
|
||||
ParamData paramData = getParamData(dto);
|
||||
// 导出Excel到响应输出流
|
||||
exportProjectExcel(response.getOutputStream(), projectDataList, paramData);
|
||||
|
||||
response.getOutputStream().flush();
|
||||
// 使用ByteArrayOutputStream先生成文件输入流
|
||||
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) {
|
||||
// 导出Excel到字节数组输出流
|
||||
exportProjectExcel(byteArrayOutputStream, projectDataList, paramData);
|
||||
|
||||
// 将字节数组转换为输入流
|
||||
byte[] bytes = byteArrayOutputStream.toByteArray();
|
||||
try (InputStream inputStream = new ByteArrayInputStream(bytes)) {
|
||||
// 上传文件到OSS系统
|
||||
SysOssVo upload = ossService.upload(inputStream, dto.getDate() + "日报.xlsx",
|
||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", -1);
|
||||
PgsProcessDailyReport pgsProcessDailyReport = new PgsProcessDailyReport();
|
||||
pgsProcessDailyReport.setReportDate(localDate);
|
||||
pgsProcessDailyReport.setPerson(dto.getPerson());
|
||||
pgsProcessDailyReport.setOssId(upload.getOssId());
|
||||
pgsProcessDailyReport.setUrl(upload.getUrl());
|
||||
pgsProcessDailyReport.setProjectId(dto.getProjectId());
|
||||
dailyReportService.save(pgsProcessDailyReport);
|
||||
url = upload.getUrl();
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException("导出Excel失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
return R.ok(url);
|
||||
}
|
||||
|
||||
|
||||
// public static void main(String[] args) {
|
||||
@ -121,8 +149,7 @@ public class PgsReportExportController extends BaseController {
|
||||
// }
|
||||
|
||||
|
||||
|
||||
public static void exportProjectExcel(OutputStream outputStream, List<List<ProjectData>> projectDataList, ParamData paramData) throws IOException {
|
||||
public static void exportProjectExcel(ByteArrayOutputStream outputStream, List<List<ProjectData>> projectDataList, ParamData paramData) throws IOException {
|
||||
try (Workbook workbook = new XSSFWorkbook()) {
|
||||
Sheet sheet = workbook.createSheet("项目日志");
|
||||
|
||||
@ -1393,7 +1420,6 @@ public class PgsReportExportController extends BaseController {
|
||||
photoNameRow2.setHeightInPoints(25); // 设置行高
|
||||
|
||||
|
||||
|
||||
// ==============================================
|
||||
// 49. 明天工作计划
|
||||
// ==============================================
|
||||
@ -1604,8 +1630,6 @@ public class PgsReportExportController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//数据组装
|
||||
public static List<ProjectData> getProjectDataList(PgsProgressCategoryDayTotalVo totalVo) {
|
||||
|
||||
@ -1693,7 +1717,6 @@ public class PgsReportExportController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
public ParamData getParamData(ReportExportDto dto) {
|
||||
ParamData paramData = new ParamData();
|
||||
String originalDate = dto.getDate();
|
||||
@ -1789,7 +1812,6 @@ public class PgsReportExportController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 新的数据组装方法,将数据按行组织
|
||||
public static List<List<ProjectData>> getProjectDataListAsRows(PgsProgressCategoryDayTotalVo totalVo) {
|
||||
List<List<ProjectData>> result = new ArrayList<>();
|
||||
@ -2034,5 +2056,4 @@ public class PgsReportExportController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,57 @@
|
||||
package org.dromara.progress.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 进度日报对象 pgs_process_daily_report
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-18
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("pgs_process_daily_report")
|
||||
public class PgsProcessDailyReport extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 报告日期
|
||||
*/
|
||||
private LocalDate reportDate;
|
||||
|
||||
/**
|
||||
* 操作人
|
||||
*/
|
||||
private String person;
|
||||
|
||||
/**
|
||||
* 文件id
|
||||
*/
|
||||
private Long ossId;
|
||||
|
||||
/**
|
||||
* 下载路径
|
||||
*/
|
||||
private String url;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
package org.dromara.progress.domain.bo;
|
||||
|
||||
import org.dromara.progress.domain.PgsProcessDailyReport;
|
||||
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.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 进度日报业务对象 pgs_process_daily_report
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-18
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = PgsProcessDailyReport.class, reverseConvertGenerate = false)
|
||||
public class PgsProcessDailyReportBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@NotNull(message = "不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 报告日期
|
||||
*/
|
||||
@NotNull(message = "报告日期不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private LocalDate reportDate;
|
||||
|
||||
/**
|
||||
* 操作人
|
||||
*/
|
||||
private String person;
|
||||
|
||||
/**
|
||||
* 文件id
|
||||
*/
|
||||
private Long ossId;
|
||||
|
||||
/**
|
||||
* 下载路径
|
||||
*/
|
||||
private String url;
|
||||
|
||||
private Long projectId;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,67 @@
|
||||
package org.dromara.progress.domain.vo;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.dromara.progress.domain.PgsProcessDailyReport;
|
||||
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;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 进度日报视图对象 pgs_process_daily_report
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-18
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = PgsProcessDailyReport.class)
|
||||
public class PgsProcessDailyReportVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private Long id;
|
||||
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 报告日期
|
||||
*/
|
||||
@ExcelProperty(value = "报告日期")
|
||||
private LocalDate reportDate;
|
||||
|
||||
/**
|
||||
* 操作人
|
||||
*/
|
||||
@ExcelProperty(value = "操作人")
|
||||
private String person;
|
||||
|
||||
/**
|
||||
* 文件id
|
||||
*/
|
||||
@ExcelProperty(value = "文件id")
|
||||
private Long ossId;
|
||||
|
||||
/**
|
||||
* 下载路径
|
||||
*/
|
||||
@ExcelProperty(value = "下载路径")
|
||||
private String url;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package org.dromara.progress.mapper;
|
||||
|
||||
import org.dromara.progress.domain.PgsProcessDailyReport;
|
||||
import org.dromara.progress.domain.vo.PgsProcessDailyReportVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 进度日报Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-18
|
||||
*/
|
||||
public interface PgsProcessDailyReportMapper extends BaseMapperPlus<PgsProcessDailyReport, PgsProcessDailyReportVo> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
package org.dromara.progress.service;
|
||||
|
||||
import org.dromara.progress.domain.vo.PgsProcessDailyReportVo;
|
||||
import org.dromara.progress.domain.bo.PgsProcessDailyReportBo;
|
||||
import org.dromara.progress.domain.PgsProcessDailyReport;
|
||||
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-11-18
|
||||
*/
|
||||
public interface IPgsProcessDailyReportService extends IService<PgsProcessDailyReport>{
|
||||
|
||||
/**
|
||||
* 查询进度日报
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 进度日报
|
||||
*/
|
||||
PgsProcessDailyReportVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询进度日报列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 进度日报分页列表
|
||||
*/
|
||||
TableDataInfo<PgsProcessDailyReportVo> queryPageList(PgsProcessDailyReportBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的进度日报列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 进度日报列表
|
||||
*/
|
||||
List<PgsProcessDailyReportVo> queryList(PgsProcessDailyReportBo bo);
|
||||
|
||||
/**
|
||||
* 新增进度日报
|
||||
*
|
||||
* @param bo 进度日报
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(PgsProcessDailyReportBo bo);
|
||||
|
||||
/**
|
||||
* 修改进度日报
|
||||
*
|
||||
* @param bo 进度日报
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(PgsProcessDailyReportBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除进度日报信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@ -0,0 +1,135 @@
|
||||
package org.dromara.progress.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.progress.domain.bo.PgsProcessDailyReportBo;
|
||||
import org.dromara.progress.domain.vo.PgsProcessDailyReportVo;
|
||||
import org.dromara.progress.domain.PgsProcessDailyReport;
|
||||
import org.dromara.progress.mapper.PgsProcessDailyReportMapper;
|
||||
import org.dromara.progress.service.IPgsProcessDailyReportService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 进度日报Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-18
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class PgsProcessDailyReportServiceImpl extends ServiceImpl<PgsProcessDailyReportMapper, PgsProcessDailyReport> implements IPgsProcessDailyReportService {
|
||||
|
||||
private final PgsProcessDailyReportMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询进度日报
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 进度日报
|
||||
*/
|
||||
@Override
|
||||
public PgsProcessDailyReportVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询进度日报列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 进度日报分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<PgsProcessDailyReportVo> queryPageList(PgsProcessDailyReportBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<PgsProcessDailyReport> lqw = buildQueryWrapper(bo);
|
||||
Page<PgsProcessDailyReportVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的进度日报列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 进度日报列表
|
||||
*/
|
||||
@Override
|
||||
public List<PgsProcessDailyReportVo> queryList(PgsProcessDailyReportBo bo) {
|
||||
LambdaQueryWrapper<PgsProcessDailyReport> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<PgsProcessDailyReport> buildQueryWrapper(PgsProcessDailyReportBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<PgsProcessDailyReport> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(PgsProcessDailyReport::getId);
|
||||
lqw.eq(bo.getReportDate() != null, PgsProcessDailyReport::getReportDate, bo.getReportDate());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPerson()), PgsProcessDailyReport::getPerson, bo.getPerson());
|
||||
lqw.eq(bo.getOssId() != null, PgsProcessDailyReport::getOssId, bo.getOssId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getUrl()), PgsProcessDailyReport::getUrl, bo.getUrl());
|
||||
lqw.eq(bo.getProjectId() != null, PgsProcessDailyReport::getProjectId, bo.getProjectId());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增进度日报
|
||||
*
|
||||
* @param bo 进度日报
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(PgsProcessDailyReportBo bo) {
|
||||
PgsProcessDailyReport add = MapstructUtils.convert(bo, PgsProcessDailyReport.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改进度日报
|
||||
*
|
||||
* @param bo 进度日报
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(PgsProcessDailyReportBo bo) {
|
||||
PgsProcessDailyReport update = MapstructUtils.convert(bo, PgsProcessDailyReport.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(PgsProcessDailyReport entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除进度日报信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@ -13,10 +13,16 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.contractor.domain.SubContractor;
|
||||
import org.dromara.contractor.service.ISubContractorService;
|
||||
import org.dromara.project.domain.BusProjectTeam;
|
||||
import org.dromara.project.domain.dto.projectteammember.BusProjectTeamMemberQueryReq;
|
||||
import org.dromara.project.domain.vo.projectteammember.BusProjectTeamMemberVo;
|
||||
import org.dromara.project.service.IBusProjectTeamMemberService;
|
||||
import org.dromara.project.service.IBusProjectTeamService;
|
||||
import org.dromara.safety.domain.dto.violationrecord.HseViolationRecordCreateHandlerReq;
|
||||
import org.dromara.safety.domain.dto.violationrecord.HseViolationRecordQueryReq;
|
||||
import org.dromara.safety.domain.dto.violationrecord.HseViolationRecordRectificationReq;
|
||||
import org.dromara.safety.domain.dto.violationrecord.HseViolationRecordReviewReq;
|
||||
import org.dromara.safety.domain.vo.violationrecord.HseViolationRecordVersionVo;
|
||||
import org.dromara.safety.domain.vo.violationrecord.HseViolationRecordVo;
|
||||
import org.dromara.safety.service.IHseViolationRecordService;
|
||||
import org.dromara.system.domain.SysUser;
|
||||
@ -43,6 +49,11 @@ public class HseViolationRecordController extends BaseController {
|
||||
private ISubContractorService contractorService;
|
||||
@Resource
|
||||
private ISysUserService userService;
|
||||
@Resource
|
||||
private IBusProjectTeamService projectTeamService;
|
||||
@Resource
|
||||
private IBusProjectTeamMemberService projectTeamMemberService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询违规记录列表
|
||||
@ -100,7 +111,6 @@ public class HseViolationRecordController extends BaseController {
|
||||
|
||||
/**
|
||||
* 删除违规记录
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("safety:violationRecord:remove")
|
||||
@ -111,7 +121,10 @@ public class HseViolationRecordController extends BaseController {
|
||||
return toAjax(hseViolationRecordService.deleteWithValidByIds(List.of(ids)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分包单位列表
|
||||
* @param projectId 项目ID
|
||||
*/
|
||||
@GetMapping("/contractorList")
|
||||
public R<List<SubContractor>> contractorList(Long projectId) {
|
||||
List<SubContractor> list = contractorService.lambdaQuery()
|
||||
@ -121,10 +134,48 @@ public class HseViolationRecordController extends BaseController {
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分包人员列表
|
||||
* @param contractorId 分包ID
|
||||
*/
|
||||
@GetMapping("/contractorUserList")
|
||||
public R<List<SysUser>> contractorUserList(Long contractorId) {
|
||||
List<SysUser> sysUsers = userService.selectUserListByContractorId(contractorId);
|
||||
return R.ok(sysUsers);
|
||||
}
|
||||
|
||||
/**
|
||||
* 班组列表
|
||||
* @param projectId 项目ID
|
||||
*/
|
||||
@GetMapping("/teamList")
|
||||
public R<List<BusProjectTeam>> teamList(Long projectId) {
|
||||
List<BusProjectTeam> list = projectTeamService.lambdaQuery()
|
||||
.select(BusProjectTeam::getId, BusProjectTeam::getTeamName)
|
||||
.eq(BusProjectTeam::getProjectId, projectId)
|
||||
.list();
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 班组列表
|
||||
* @param teamId 班组ID
|
||||
*/
|
||||
@GetMapping("/teamUserList")
|
||||
public R<List<BusProjectTeamMemberVo>> teamUserList(Long teamId) {
|
||||
BusProjectTeamMemberQueryReq req = new BusProjectTeamMemberQueryReq();
|
||||
req.setTeamId(teamId);
|
||||
req.setPostId("1");
|
||||
List<BusProjectTeamMemberVo> busProjectTeamMemberVos = projectTeamMemberService.queryList(req);
|
||||
return R.ok(busProjectTeamMemberVos);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取版本列表
|
||||
*/
|
||||
@GetMapping("/versionList")
|
||||
public R<List<HseViolationRecordVersionVo>> getVersionList(String jobKey, Long projectId) {
|
||||
return R.ok(hseViolationRecordService.getVersionList(jobKey,projectId));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -15,6 +15,7 @@ import org.dromara.safety.domain.dto.violationrecord.HseViolationRecordCreateHan
|
||||
import org.dromara.safety.domain.dto.violationrecord.HseViolationRecordQueryReq;
|
||||
import org.dromara.safety.domain.dto.violationrecord.HseViolationRecordRectificationReq;
|
||||
import org.dromara.safety.domain.dto.violationrecord.HseViolationRecordReviewReq;
|
||||
import org.dromara.safety.domain.vo.violationrecord.HseViolationRecordVersionVo;
|
||||
import org.dromara.safety.domain.vo.violationrecord.HseViolationRecordVo;
|
||||
import org.dromara.safety.service.IHseViolationRecordService;
|
||||
import org.dromara.system.domain.SysUser;
|
||||
@ -117,4 +118,12 @@ public class HseViolationRecordAppController extends BaseController {
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取版本列表
|
||||
*/
|
||||
@GetMapping("/versionList")
|
||||
public R<List<HseViolationRecordVersionVo>> getVersionList(String jobKey, Long projectId) {
|
||||
return R.ok(violationRecordService.getVersionList(jobKey,projectId));
|
||||
}
|
||||
}
|
||||
|
||||
@ -132,7 +132,7 @@ public class HseViolationRecord extends BaseEntity {
|
||||
private String jobKey;
|
||||
|
||||
/**
|
||||
* 任务批号
|
||||
* 版本号
|
||||
*/
|
||||
private Integer version;
|
||||
|
||||
|
||||
@ -0,0 +1,11 @@
|
||||
package org.dromara.safety.domain.vo.violationrecord;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HseViolationRecordVersionVo {
|
||||
|
||||
private Long id;
|
||||
|
||||
private Integer version;
|
||||
}
|
||||
@ -10,6 +10,7 @@ import org.dromara.safety.domain.vo.violationlevel.HseViolationLevelVo;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@ -89,7 +90,7 @@ public class HseViolationRecordVo implements Serializable {
|
||||
/**
|
||||
* 处理期限
|
||||
*/
|
||||
private Date disposeDeadline;
|
||||
private LocalDate disposeDeadline;
|
||||
|
||||
/**
|
||||
* 处理时间
|
||||
@ -163,4 +164,25 @@ public class HseViolationRecordVo implements Serializable {
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
/**
|
||||
* 任务批号
|
||||
*/
|
||||
private String jobKey;
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
private Integer version;
|
||||
|
||||
/**
|
||||
* 验证人id
|
||||
*/
|
||||
private Long validatorId;
|
||||
|
||||
/**
|
||||
* 验证人名字
|
||||
*/
|
||||
private String validatorName;
|
||||
|
||||
}
|
||||
|
||||
@ -1,8 +1,13 @@
|
||||
package org.dromara.safety.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.dromara.safety.domain.HseViolationRecord;
|
||||
import org.dromara.safety.domain.vo.violationrecord.HseViolationRecordVo;
|
||||
import org.dromara.system.domain.SysUser;
|
||||
|
||||
/**
|
||||
* 违规记录Mapper接口
|
||||
@ -12,4 +17,5 @@ import org.dromara.safety.domain.vo.violationrecord.HseViolationRecordVo;
|
||||
*/
|
||||
public interface HseViolationRecordMapper extends BaseMapperPlus<HseViolationRecord, HseViolationRecordVo> {
|
||||
|
||||
Page<HseViolationRecord> selectPageList(@Param("page") Page<HseViolationRecord> page, @Param(Constants.WRAPPER) Wrapper<HseViolationRecord> queryWrapper);
|
||||
}
|
||||
|
||||
@ -7,6 +7,7 @@ import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.safety.domain.HseViolationRecord;
|
||||
import org.dromara.safety.domain.dto.violationrecord.*;
|
||||
import org.dromara.safety.domain.vo.violationrecord.HseViolationRecordVersionVo;
|
||||
import org.dromara.safety.domain.vo.violationrecord.HseViolationRecordVo;
|
||||
|
||||
import java.util.Collection;
|
||||
@ -107,4 +108,15 @@ public interface IHseViolationRecordService extends IService<HseViolationRecord>
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertReview(HseViolationRecordReviewReq req);
|
||||
|
||||
|
||||
/**
|
||||
* 获取过往版本
|
||||
*/
|
||||
HseViolationRecordVo getHistory(String jobKey,Integer version);
|
||||
|
||||
/**
|
||||
* 获取版本列表
|
||||
*/
|
||||
List<HseViolationRecordVersionVo> getVersionList(String jobKey, Long projectId);
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package org.dromara.safety.service.impl;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jakarta.annotation.Resource;
|
||||
@ -19,6 +20,7 @@ import org.dromara.common.sse.config.SseProperties;
|
||||
import org.dromara.common.sse.dto.SeeMessageContentDto;
|
||||
import org.dromara.common.sse.dto.SseMessageDto;
|
||||
import org.dromara.common.sse.utils.SseMessageUtils;
|
||||
import org.dromara.gps.domain.GpsEquipmentSonToGpsEquipmentSonVoMapperImpl;
|
||||
import org.dromara.project.domain.BusProjectTeamMember;
|
||||
import org.dromara.project.service.IBusProjectTeamMemberService;
|
||||
import org.dromara.safety.domain.HseRecognizeRecord;
|
||||
@ -28,6 +30,7 @@ import org.dromara.safety.domain.HseViolationRecord;
|
||||
import org.dromara.safety.domain.dto.violationrecord.*;
|
||||
import org.dromara.safety.domain.enums.HseSafetyInspectionReviewTypeEnum;
|
||||
import org.dromara.safety.domain.enums.HseSafetyInspectionStatusEnum;
|
||||
import org.dromara.safety.domain.vo.violationrecord.HseViolationRecordVersionVo;
|
||||
import org.dromara.safety.domain.vo.violationrecord.HseViolationRecordVo;
|
||||
import org.dromara.safety.mapper.HseViolationRecordMapper;
|
||||
import org.dromara.safety.service.IHseRecognizeRecordService;
|
||||
@ -116,8 +119,8 @@ public class HseViolationRecordServiceImpl extends ServiceImpl<HseViolationRecor
|
||||
lqw.eq(HseViolationRecord::getCorrectorId, userId);
|
||||
}
|
||||
}
|
||||
Page<HseViolationRecord> violationRecordPage = this.page(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(this.getVoPage(violationRecordPage));
|
||||
Page<HseViolationRecord> hseViolationRecordPage = this.getBaseMapper().selectPageList(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(this.getVoPage(hseViolationRecordPage));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -195,6 +198,8 @@ public class HseViolationRecordServiceImpl extends ServiceImpl<HseViolationRecor
|
||||
record.setViolationTime(dtoItem.getViolationTime());
|
||||
record.setRemark(dtoItem.getRemark());
|
||||
record.setLevelId(levelId); // 设置分组的LevelId
|
||||
record.setJobKey(UUID.randomUUID().toString().replace("-", "").substring(0, 16).toUpperCase());
|
||||
record.setVersion(1);
|
||||
// 将分组后的types用逗号拼接,设置为合并后的ViolationType
|
||||
record.setViolationType(String.join(",", groupedTypesList));
|
||||
violationRecordList.add(record);
|
||||
@ -269,6 +274,8 @@ public class HseViolationRecordServiceImpl extends ServiceImpl<HseViolationRecor
|
||||
}
|
||||
violationRecord.setStatus(HseSafetyInspectionStatusEnum.INFORM.getValue());
|
||||
violationRecord.setReviewType(HseSafetyInspectionReviewTypeEnum.NOT_REVIEW.getValue());
|
||||
violationRecord.setValidatorId(LoginHelper.getUserId());
|
||||
violationRecord.setValidatorName(Objects.requireNonNull(LoginHelper.getLoginUser()).getNickname());
|
||||
boolean result = this.updateById(violationRecord);
|
||||
if (!result) {
|
||||
throw new ServiceException("更新处理人操作失败", HttpStatus.ERROR);
|
||||
@ -439,6 +446,7 @@ public class HseViolationRecordServiceImpl extends ServiceImpl<HseViolationRecor
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean insertReview(HseViolationRecordReviewReq req) {
|
||||
Long id = req.getId();
|
||||
HseViolationRecord violationRecord = this.getById(id);
|
||||
@ -455,13 +463,40 @@ public class HseViolationRecordServiceImpl extends ServiceImpl<HseViolationRecor
|
||||
updateRecord.setId(id);
|
||||
updateRecord.setReviewTime(new Date());
|
||||
updateRecord.setStatus(HseSafetyInspectionStatusEnum.REVIEW.getValue());
|
||||
if(req.getReviewType().equals(HseSafetyInspectionReviewTypeEnum.UNPASS.getValue())){
|
||||
violationRecord.setId(null);
|
||||
violationRecord.setStatus(HseSafetyInspectionStatusEnum.INFORM.getValue());
|
||||
violationRecord.setVersion(violationRecord.getVersion()+1);
|
||||
violationRecord.setMeasure(null);
|
||||
violationRecord.setRectificationTime(null);
|
||||
violationRecord.setRectificationFile(null);
|
||||
violationRecord.setReview(null);
|
||||
violationRecord.setReviewType(null);
|
||||
violationRecord.setReviewTime(null);
|
||||
save(violationRecord);
|
||||
}
|
||||
// 操作数据库
|
||||
return this.updateById(updateRecord);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public HseViolationRecordVo getHistory(String jobKey, Integer version) {
|
||||
LambdaQueryWrapper<HseViolationRecord> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(HseViolationRecord::getJobKey,jobKey).eq(HseViolationRecord::getVersion,version).last("limit 1");
|
||||
HseViolationRecord one = getOne(wrapper);
|
||||
return getVo(one);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HseViolationRecordVersionVo> getVersionList(String jobKey, Long projectId) {
|
||||
List<HseViolationRecord> list = list(new LambdaQueryWrapper<HseViolationRecord>()
|
||||
.eq(HseViolationRecord::getJobKey, jobKey)
|
||||
.eq(HseViolationRecord::getProjectId, projectId));
|
||||
|
||||
return list.stream().map(record -> {
|
||||
HseViolationRecordVersionVo vo = new HseViolationRecordVersionVo();
|
||||
BeanUtils.copyProperties(record, vo);
|
||||
return vo;
|
||||
}).toList();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1526,6 +1526,9 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
|
||||
public List<SysUser> selectUserListByContractorId(Long contractorId) {
|
||||
|
||||
return baseMapper.selectList(Wrappers.<SysUser>lambdaQuery()
|
||||
.select(SysUser::getUserId, SysUser::getNickName));
|
||||
.select(SysUser::getUserId, SysUser::getNickName)
|
||||
.eq(SysUser::getContractorId, contractorId)
|
||||
.eq(SysUser::getAppUserType, "2")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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.progress.mapper.PgsProcessDailyReportMapper">
|
||||
|
||||
</mapper>
|
||||
@ -3,5 +3,19 @@
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.safety.mapper.HseViolationRecordMapper">
|
||||
<select id="selectPageList" resultType="org.dromara.safety.domain.HseViolationRecord">
|
||||
SELECT t.*
|
||||
FROM hse_violation_record t
|
||||
INNER JOIN (
|
||||
SELECT
|
||||
job_key,
|
||||
MAX(version) AS latest_version
|
||||
FROM hse_violation_record
|
||||
WHERE job_key IS NOT NULL
|
||||
AND version IS NOT NULL
|
||||
GROUP BY job_key
|
||||
) sub ON t.job_key = sub.job_key AND t.version = sub.latest_version
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user