图纸评审
This commit is contained in:
		@ -9,7 +9,8 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
 | 
			
		||||
import org.dromara.design.domain.bo.AnewDrawingReviewUploadReq;
 | 
			
		||||
import org.dromara.design.domain.bo.DrawingReviewUploadReq;
 | 
			
		||||
import org.dromara.design.domain.bo.FillOutTheDesignVerificationFormReq;
 | 
			
		||||
import org.dromara.design.domain.vo.ListOfDesignDrawingsReviewRes;
 | 
			
		||||
import org.dromara.design.domain.vo.*;
 | 
			
		||||
import org.dromara.design.service.IBusDrawingreviewReceiptsService;
 | 
			
		||||
import org.springframework.web.bind.annotation.*;
 | 
			
		||||
import org.springframework.validation.annotation.Validated;
 | 
			
		||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
 | 
			
		||||
@ -21,10 +22,10 @@ import org.dromara.common.core.validate.AddGroup;
 | 
			
		||||
import org.dromara.common.core.validate.EditGroup;
 | 
			
		||||
import org.dromara.common.log.enums.BusinessType;
 | 
			
		||||
import org.dromara.common.excel.utils.ExcelUtil;
 | 
			
		||||
import org.dromara.design.domain.vo.BusDrawingreviewVo;
 | 
			
		||||
import org.dromara.design.domain.bo.BusDrawingreviewBo;
 | 
			
		||||
import org.dromara.design.service.IBusDrawingreviewService;
 | 
			
		||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
 | 
			
		||||
import org.springframework.web.multipart.MultipartFile;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 设计-图纸评审
 | 
			
		||||
@ -40,6 +41,8 @@ public class BusDrawingreviewController extends BaseController {
 | 
			
		||||
 | 
			
		||||
    private final IBusDrawingreviewService busDrawingreviewService;
 | 
			
		||||
 | 
			
		||||
    private final IBusDrawingreviewReceiptsService busDrawingreviewReceiptsService;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 新增设计图纸评审
 | 
			
		||||
     */
 | 
			
		||||
@ -47,13 +50,12 @@ public class BusDrawingreviewController extends BaseController {
 | 
			
		||||
    @Log(title = "新增设计图纸评审", businessType = BusinessType.INSERT)
 | 
			
		||||
    @RepeatSubmit()
 | 
			
		||||
    @PostMapping("/drawingReviewUpload")
 | 
			
		||||
    public R<Void> drawingReviewUpload(@RequestBody DrawingReviewUploadReq bo) {
 | 
			
		||||
        return toAjax(busDrawingreviewService.drawingReviewUpload(bo));
 | 
			
		||||
    public R<Void> drawingReviewUpload(DrawingReviewUploadReq bo, @RequestPart("file") MultipartFile file) {
 | 
			
		||||
        return toAjax(busDrawingreviewService.drawingReviewUpload(bo, file));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 设计图纸评审列表
 | 
			
		||||
     * listOfDesignDrawingsReview
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("design:drawingreview:listOfDesignDrawingsReview")
 | 
			
		||||
    @GetMapping("/listOfDesignDrawingsReview")
 | 
			
		||||
@ -61,6 +63,41 @@ public class BusDrawingreviewController extends BaseController {
 | 
			
		||||
        return busDrawingreviewService.listOfDesignDrawingsReview(bo, pageQuery);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取历史设计图纸评审
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("design:drawingreview:ObtainHistoricalDesignDrawingsForReview")
 | 
			
		||||
    @GetMapping("/ObtainHistoricalDesignDrawingsForReview/{id}")
 | 
			
		||||
    public List<ObtainHistoricalDesignDrawingsForReviewRes> ObtainHistoricalDesignDrawingsForReview(@NotNull(message = "主键不能为空")@PathVariable Long id) {
 | 
			
		||||
        return busDrawingreviewService.ObtainHistoricalDesignDrawingsForReview(id);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取设计-主图纸评审详细信息
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 主键
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("design:drawingreview:zQuery")
 | 
			
		||||
    @GetMapping("/zQuery/{id}")
 | 
			
		||||
    public R<BusDrawingreviewVo> zQuery(@NotNull(message = "主键不能为空")
 | 
			
		||||
                                     @PathVariable Long id) {
 | 
			
		||||
        return R.ok(busDrawingreviewService.queryById(id));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据历史设计图纸评审查询详情
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 主键
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("design:drawingreview:query")
 | 
			
		||||
    @GetMapping("/{id}")
 | 
			
		||||
    public R<BusDrawingreviewReceiptsVo> getInfo(@NotNull(message = "主键不能为空")
 | 
			
		||||
                                     @PathVariable Long id) {
 | 
			
		||||
        return R.ok(busDrawingreviewReceiptsService.queryById(id));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 重新上传设计图纸评审
 | 
			
		||||
     */
 | 
			
		||||
@ -68,8 +105,8 @@ public class BusDrawingreviewController extends BaseController {
 | 
			
		||||
    @Log(title = "重新上传设计图纸评审", businessType = BusinessType.INSERT)
 | 
			
		||||
    @RepeatSubmit()
 | 
			
		||||
    @PutMapping("/anewDrawingReviewUpload")
 | 
			
		||||
    public R<Void> anewDrawingReviewUpload(@RequestBody AnewDrawingReviewUploadReq bo) {
 | 
			
		||||
        return toAjax(busDrawingreviewService.anewDrawingReviewUpload(bo));
 | 
			
		||||
    public R<Void> anewDrawingReviewUpload(AnewDrawingReviewUploadReq bo,@RequestPart("file") MultipartFile file) {
 | 
			
		||||
        return toAjax(busDrawingreviewService.anewDrawingReviewUpload(bo,file));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 | 
			
		||||
@ -1,9 +1,14 @@
 | 
			
		||||
package org.dromara.design.controller;
 | 
			
		||||
 | 
			
		||||
import cn.dev33.satoken.annotation.SaCheckPermission;
 | 
			
		||||
import cn.hutool.core.bean.BeanUtil;
 | 
			
		||||
import jakarta.annotation.Resource;
 | 
			
		||||
import jakarta.validation.constraints.NotEmpty;
 | 
			
		||||
import jakarta.validation.constraints.NotNull;
 | 
			
		||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 | 
			
		||||
import org.apache.poi.ss.usermodel.*;
 | 
			
		||||
import org.apache.poi.xssf.usermodel.XSSFSheet;
 | 
			
		||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 | 
			
		||||
import org.dromara.common.core.domain.R;
 | 
			
		||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
 | 
			
		||||
import org.dromara.common.log.annotation.Log;
 | 
			
		||||
@ -12,6 +17,7 @@ import org.dromara.common.mybatis.core.page.PageQuery;
 | 
			
		||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
 | 
			
		||||
import org.dromara.common.web.core.BaseController;
 | 
			
		||||
import org.dromara.design.domain.DesVolumeFile;
 | 
			
		||||
import org.dromara.design.domain.dto.ExcelData;
 | 
			
		||||
import org.dromara.design.domain.dto.volumecatalog.DesVolumeCatalogCreateReq;
 | 
			
		||||
import org.dromara.design.domain.dto.volumecatalog.DesVolumeCatalogQueryReq;
 | 
			
		||||
import org.dromara.design.domain.dto.volumecatalog.DesVolumeCatalogUpdateReq;
 | 
			
		||||
@ -21,7 +27,16 @@ import org.dromara.design.service.IDesVolumeCatalogService;
 | 
			
		||||
import org.dromara.design.service.IDesVolumeFileService;
 | 
			
		||||
import org.springframework.validation.annotation.Validated;
 | 
			
		||||
import org.springframework.web.bind.annotation.*;
 | 
			
		||||
import org.springframework.web.multipart.MultipartFile;
 | 
			
		||||
 | 
			
		||||
import java.io.File;
 | 
			
		||||
import java.io.FileInputStream;
 | 
			
		||||
import java.io.IOException;
 | 
			
		||||
import java.io.InputStream;
 | 
			
		||||
import java.time.LocalDate;
 | 
			
		||||
import java.time.ZoneId;
 | 
			
		||||
import java.util.ArrayList;
 | 
			
		||||
import java.util.Date;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
@ -41,6 +56,8 @@ public class DesVolumeCatalogController extends BaseController {
 | 
			
		||||
    @Resource
 | 
			
		||||
    private IDesVolumeFileService volumeFileService;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询卷册目录列表
 | 
			
		||||
     */
 | 
			
		||||
@ -120,4 +137,111 @@ public class DesVolumeCatalogController extends BaseController {
 | 
			
		||||
                          @PathVariable Long[] ids) {
 | 
			
		||||
        return toAjax(desVolumeCatalogService.deleteByIds(List.of(ids)));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 导入卷册目录
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("design:volumeCatalog:importData")
 | 
			
		||||
    @Log(title = "导入卷册目录", businessType = BusinessType.IMPORT)
 | 
			
		||||
    @PostMapping("/importData")
 | 
			
		||||
    public R<Void> importData(@RequestParam("file") MultipartFile file,Long projectId) throws IOException {
 | 
			
		||||
        if (projectId == null) {
 | 
			
		||||
            return R.fail("项目ID不能为空");
 | 
			
		||||
        }
 | 
			
		||||
        List<ExcelData> dataList = readExcel(file);
 | 
			
		||||
        List<DesVolumeCatalogCreateReq> desVolumeCatalogCreateReqs = BeanUtil.copyToList(dataList, DesVolumeCatalogCreateReq.class);
 | 
			
		||||
        for (DesVolumeCatalogCreateReq desVolumeCatalogCreateReq : desVolumeCatalogCreateReqs) {
 | 
			
		||||
            desVolumeCatalogCreateReq.setProjectId(projectId);
 | 
			
		||||
            desVolumeCatalogService.insertByBo(desVolumeCatalogCreateReq);
 | 
			
		||||
        }
 | 
			
		||||
        return toAjax(true);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    public static List<ExcelData> readExcel(MultipartFile file) throws IOException {
 | 
			
		||||
        List<ExcelData> dataList = new ArrayList<>();
 | 
			
		||||
 | 
			
		||||
        try (InputStream inputStream = file.getInputStream();
 | 
			
		||||
             XSSFWorkbook workbook = new XSSFWorkbook(inputStream)) {
 | 
			
		||||
 | 
			
		||||
            XSSFSheet sheet = workbook.getSheetAt(0);
 | 
			
		||||
 | 
			
		||||
            // 从第二行(index=1)开始读取数据,跳过表头
 | 
			
		||||
            for (int rowIndex = 1; rowIndex <= sheet.getLastRowNum(); rowIndex++) {
 | 
			
		||||
                Row row = sheet.getRow(rowIndex);
 | 
			
		||||
                if (row != null) {
 | 
			
		||||
                    String designSubitem = getCellValue(row.getCell(0));
 | 
			
		||||
                    String designState = getCellValue(row.getCell(1));
 | 
			
		||||
                    String specialty = getCellValue(row.getCell(2));
 | 
			
		||||
                    String principal = getCellValue(row.getCell(3));
 | 
			
		||||
                    String volumeNumber = getCellValue(row.getCell(4));
 | 
			
		||||
                    String documentName = getCellValue(row.getCell(5));
 | 
			
		||||
                    LocalDate plannedCompletion = getLocalDateValue(row.getCell(6));
 | 
			
		||||
 | 
			
		||||
                    ExcelData excelData = new ExcelData(
 | 
			
		||||
                        designSubitem, designState, specialty,
 | 
			
		||||
                        principal, volumeNumber, documentName,
 | 
			
		||||
                        plannedCompletion
 | 
			
		||||
                    );
 | 
			
		||||
                    dataList.add(excelData);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return dataList;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private static String getCellValue(Cell cell) {
 | 
			
		||||
        if (cell == null) {
 | 
			
		||||
            return "";
 | 
			
		||||
        }
 | 
			
		||||
        // 使用CellType枚举判断单元格类型(POI 4.0+版本推荐方式)
 | 
			
		||||
        CellType cellType = cell.getCellType();
 | 
			
		||||
        // 对于公式单元格,获取其计算结果的类型
 | 
			
		||||
        if (cellType == CellType.FORMULA) {
 | 
			
		||||
            cellType = cell.getCachedFormulaResultType();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        switch (cellType) {
 | 
			
		||||
            case STRING:
 | 
			
		||||
                return cell.getStringCellValue().trim();
 | 
			
		||||
            case NUMERIC:
 | 
			
		||||
                if (DateUtil.isCellDateFormatted(cell)) {
 | 
			
		||||
                    Date date = cell.getDateCellValue();
 | 
			
		||||
                    return date.toString();
 | 
			
		||||
                } else {
 | 
			
		||||
                    // 处理数字类型,避免科学计数法
 | 
			
		||||
                    return String.valueOf((long) cell.getNumericCellValue());
 | 
			
		||||
                }
 | 
			
		||||
            case BOOLEAN:
 | 
			
		||||
                return String.valueOf(cell.getBooleanCellValue());
 | 
			
		||||
            default:
 | 
			
		||||
                return "";
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private static LocalDate getLocalDateValue(Cell cell) {
 | 
			
		||||
        if (cell != null) {
 | 
			
		||||
            CellType cellType = cell.getCellType();
 | 
			
		||||
            if (cellType == CellType.FORMULA) {
 | 
			
		||||
                cellType = cell.getCachedFormulaResultType();
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (DateUtil.isCellDateFormatted(cell)) {
 | 
			
		||||
                Date date = cell.getDateCellValue();
 | 
			
		||||
                return date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
 | 
			
		||||
            } else if (cellType == CellType.STRING) {
 | 
			
		||||
                // 处理字符串格式的日期
 | 
			
		||||
                try {
 | 
			
		||||
                    return LocalDate.parse(cell.getStringCellValue());
 | 
			
		||||
                } catch (Exception e) {
 | 
			
		||||
                    // 日期格式不正确时返回null
 | 
			
		||||
                    return null;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return null;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -74,6 +74,11 @@ public class DesVolumeCatalog extends BaseEntity {
 | 
			
		||||
     */
 | 
			
		||||
    private String designState;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 审核状态
 | 
			
		||||
     */
 | 
			
		||||
    private String auditStatus;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 备注
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
@ -26,11 +26,6 @@ public class AnewDrawingReviewUploadReq implements Serializable {
 | 
			
		||||
     */
 | 
			
		||||
    @NotNull(message = "图纸评审id不能为空")
 | 
			
		||||
    private Long drawingreviewId;
 | 
			
		||||
    /**
 | 
			
		||||
     * 图纸评审文件
 | 
			
		||||
     */
 | 
			
		||||
    @NotNull(message = "图纸评审文件不能为空")
 | 
			
		||||
    private MultipartFile file;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -22,10 +22,10 @@ public class DrawingReviewUploadReq implements Serializable {
 | 
			
		||||
     */
 | 
			
		||||
    private Long projectId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 图纸评审文件
 | 
			
		||||
     */
 | 
			
		||||
    private MultipartFile file;
 | 
			
		||||
//    /**
 | 
			
		||||
//     * 图纸评审文件
 | 
			
		||||
//     */
 | 
			
		||||
//    private MultipartFile file;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,86 @@
 | 
			
		||||
package org.dromara.design.domain.dto;
 | 
			
		||||
 | 
			
		||||
import java.time.LocalDate;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @Author 铁憨憨
 | 
			
		||||
 * @Date 2025/8/12 22:53
 | 
			
		||||
 * @Version 1.0
 | 
			
		||||
 */
 | 
			
		||||
public class ExcelData {
 | 
			
		||||
    private String designSubitem;
 | 
			
		||||
    private String designState;
 | 
			
		||||
    private String specialty;
 | 
			
		||||
    private String principal;
 | 
			
		||||
    private String volumeNumber;
 | 
			
		||||
    private String documentName;
 | 
			
		||||
    private LocalDate plannedCompletion;
 | 
			
		||||
 | 
			
		||||
    // 构造函数
 | 
			
		||||
    public ExcelData(String designSubitem, String designState, String specialty, String principal, String volumeNumber, String documentName, LocalDate plannedCompletion) {
 | 
			
		||||
        this.designSubitem = designSubitem;
 | 
			
		||||
        this.designState = designState;
 | 
			
		||||
        this.specialty = specialty;
 | 
			
		||||
        this.principal = principal;
 | 
			
		||||
        this.volumeNumber = volumeNumber;
 | 
			
		||||
        this.documentName = documentName;
 | 
			
		||||
        this.plannedCompletion = plannedCompletion;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Getter和Setter方法
 | 
			
		||||
    public String getDesignSubitem() {
 | 
			
		||||
        return designSubitem;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setDesignSubitem(String designSubitem) {
 | 
			
		||||
        this.designSubitem = designSubitem;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public String getDesignState() {
 | 
			
		||||
        return designState;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setDesignState(String designState) {
 | 
			
		||||
        this.designState = designState;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public String getSpecialty() {
 | 
			
		||||
        return specialty;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setSpecialty(String specialty) {
 | 
			
		||||
        this.specialty = specialty;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public String getPrincipal() {
 | 
			
		||||
        return principal;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setPrincipal(String principal) {
 | 
			
		||||
        this.principal = principal;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public String getVolumeNumber() {
 | 
			
		||||
        return volumeNumber;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setVolumeNumber(String volumeNumber) {
 | 
			
		||||
        this.volumeNumber = volumeNumber;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public String getDocumentName() {
 | 
			
		||||
        return documentName;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setDocumentName(String documentName) {
 | 
			
		||||
        this.documentName = documentName;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public LocalDate getPlannedCompletion() {
 | 
			
		||||
        return plannedCompletion;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setPlannedCompletion(LocalDate plannedCompletion) {
 | 
			
		||||
        this.plannedCompletion = plannedCompletion;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -18,7 +18,9 @@ import java.util.List;
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
@Accessors(chain = true)
 | 
			
		||||
public class ObtainTheListRes implements Serializable {
 | 
			
		||||
public class
 | 
			
		||||
 | 
			
		||||
ObtainTheListRes implements Serializable {
 | 
			
		||||
    /**
 | 
			
		||||
     * 主键ID
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
@ -52,5 +52,11 @@ public class BusDrawingreviewVo implements Serializable {
 | 
			
		||||
    @ExcelProperty(value = "备注")
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 文件路径
 | 
			
		||||
     */
 | 
			
		||||
    @ExcelProperty(value = "文件路径")
 | 
			
		||||
    private String path;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -4,6 +4,7 @@ import com.alibaba.excel.annotation.ExcelProperty;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.time.LocalDateTime;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @Author 铁憨憨
 | 
			
		||||
@ -42,4 +43,10 @@ public class ListOfDesignDrawingsReviewRes implements Serializable {
 | 
			
		||||
     */
 | 
			
		||||
    @ExcelProperty(value = "备注")
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 创建时间
 | 
			
		||||
     */
 | 
			
		||||
    @ExcelProperty(value = "创建时间")
 | 
			
		||||
    private LocalDateTime createTime;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,27 @@
 | 
			
		||||
package org.dromara.design.domain.vo;
 | 
			
		||||
 | 
			
		||||
import com.alibaba.excel.annotation.ExcelProperty;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @Author 铁憨憨
 | 
			
		||||
 * @Date 2025/8/12 20:16
 | 
			
		||||
 * @Version 1.0
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
 | 
			
		||||
public class ListOfDesignDrawingsReviewSonRes implements Serializable {
 | 
			
		||||
    /**
 | 
			
		||||
     * 主键ID
 | 
			
		||||
     */
 | 
			
		||||
    @ExcelProperty(value = "主键ID")
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 最终审核状态
 | 
			
		||||
     */
 | 
			
		||||
    private String finalState;
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,164 @@
 | 
			
		||||
package org.dromara.design.domain.vo;
 | 
			
		||||
 | 
			
		||||
import com.alibaba.excel.annotation.ExcelProperty;
 | 
			
		||||
import com.baomidou.mybatisplus.annotation.TableId;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.util.Date;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @Author 铁憨憨
 | 
			
		||||
 * @Date 2025/8/12 20:16
 | 
			
		||||
 * @Version 1.0
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
 | 
			
		||||
public class ObtainHistoricalDesignDrawingsForReviewRes implements Serializable {
 | 
			
		||||
//    /**
 | 
			
		||||
//     * 主键ID
 | 
			
		||||
//     */
 | 
			
		||||
//    @ExcelProperty(value = "主键ID")
 | 
			
		||||
//    private Long id;
 | 
			
		||||
//
 | 
			
		||||
//    /**
 | 
			
		||||
//     * 最终审核状态
 | 
			
		||||
//     */
 | 
			
		||||
//    private String finalState;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 主键ID
 | 
			
		||||
     */
 | 
			
		||||
    @TableId(value = "id")
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 设计评审ID
 | 
			
		||||
     */
 | 
			
		||||
    private Long drawingreviewId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 编号
 | 
			
		||||
     */
 | 
			
		||||
    private String num;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 项目ID
 | 
			
		||||
     */
 | 
			
		||||
    private Long projectId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 子项目ID
 | 
			
		||||
     */
 | 
			
		||||
    private Long subprojectId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 项目名称
 | 
			
		||||
     */
 | 
			
		||||
    private String projectName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 子项目名称
 | 
			
		||||
     */
 | 
			
		||||
    private String subprojectName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 设计阶段
 | 
			
		||||
     */
 | 
			
		||||
    private String stage;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 专业
 | 
			
		||||
     */
 | 
			
		||||
    private String professional;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 卷册
 | 
			
		||||
     */
 | 
			
		||||
    private String volume;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 设计人
 | 
			
		||||
     */
 | 
			
		||||
    private String designer;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 验证内容
 | 
			
		||||
     */
 | 
			
		||||
    private String verificationContent;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 验证意见
 | 
			
		||||
     */
 | 
			
		||||
    private String verificationOpinion;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 执行意见
 | 
			
		||||
     */
 | 
			
		||||
    private String executionOpinion;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 校审人员ID
 | 
			
		||||
     */
 | 
			
		||||
    private Long proofreadingId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 审核人员ID
 | 
			
		||||
     */
 | 
			
		||||
    private Long auditId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 执行人员ID
 | 
			
		||||
     */
 | 
			
		||||
    private Long executorId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 校审人员
 | 
			
		||||
     */
 | 
			
		||||
    private String proofreading;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 审核人员
 | 
			
		||||
     */
 | 
			
		||||
    private String audit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 执行人员
 | 
			
		||||
     */
 | 
			
		||||
    private String executor;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 校审时间
 | 
			
		||||
     */
 | 
			
		||||
    private Date proofreadingDate;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 审核时间
 | 
			
		||||
     */
 | 
			
		||||
    private Date auditDate;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 执行时间
 | 
			
		||||
     */
 | 
			
		||||
    private Date executorDate;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 文件名
 | 
			
		||||
     */
 | 
			
		||||
    private String fileName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 图纸
 | 
			
		||||
     */
 | 
			
		||||
    private String path;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 最终审核状态
 | 
			
		||||
     */
 | 
			
		||||
    private String finalState;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -9,6 +9,7 @@ import org.dromara.system.domain.vo.SysUserVo;
 | 
			
		||||
import java.io.Serial;
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.time.LocalDate;
 | 
			
		||||
import java.time.LocalDateTime;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -75,11 +76,21 @@ public class DesVolumeCatalogVo implements Serializable {
 | 
			
		||||
     */
 | 
			
		||||
    private String designState;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 审核状态
 | 
			
		||||
     */
 | 
			
		||||
    private String auditStatus;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 备注
 | 
			
		||||
     */
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 创建时间
 | 
			
		||||
     */
 | 
			
		||||
    private LocalDate createTime;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 文件列表
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,6 @@
 | 
			
		||||
package org.dromara.design.service;
 | 
			
		||||
 | 
			
		||||
import jakarta.validation.constraints.NotNull;
 | 
			
		||||
import org.dromara.design.domain.bo.AnewDrawingReviewUploadReq;
 | 
			
		||||
import org.dromara.design.domain.bo.DrawingReviewUploadReq;
 | 
			
		||||
import org.dromara.design.domain.bo.FillOutTheDesignVerificationFormReq;
 | 
			
		||||
@ -11,7 +12,9 @@ import org.dromara.common.mybatis.core.page.PageQuery;
 | 
			
		||||
 | 
			
		||||
import com.baomidou.mybatisplus.extension.service.IService;
 | 
			
		||||
import org.dromara.design.domain.vo.ListOfDesignDrawingsReviewRes;
 | 
			
		||||
import org.dromara.design.domain.vo.ObtainHistoricalDesignDrawingsForReviewRes;
 | 
			
		||||
import org.springframework.web.bind.annotation.RequestBody;
 | 
			
		||||
import org.springframework.web.multipart.MultipartFile;
 | 
			
		||||
 | 
			
		||||
import java.util.Collection;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
@ -79,7 +82,7 @@ public interface IBusDrawingreviewService extends IService<BusDrawingreview>{
 | 
			
		||||
     * @param bo
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    Boolean drawingReviewUpload(DrawingReviewUploadReq bo);
 | 
			
		||||
    Boolean drawingReviewUpload(DrawingReviewUploadReq bo, MultipartFile file);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 设计图纸评审列表
 | 
			
		||||
@ -87,13 +90,18 @@ public interface IBusDrawingreviewService extends IService<BusDrawingreview>{
 | 
			
		||||
     */
 | 
			
		||||
    TableDataInfo<ListOfDesignDrawingsReviewRes> listOfDesignDrawingsReview(DrawingReviewUploadReq bo, PageQuery pageQuery);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取历史设计图纸评审
 | 
			
		||||
     * listOfDesignDrawingsReviewSon
 | 
			
		||||
     */
 | 
			
		||||
    List<ObtainHistoricalDesignDrawingsForReviewRes> ObtainHistoricalDesignDrawingsForReview(Long id);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 重新图纸评审上传
 | 
			
		||||
     * @param bo
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    Boolean anewDrawingReviewUpload(AnewDrawingReviewUploadReq bo);
 | 
			
		||||
 | 
			
		||||
    Boolean anewDrawingReviewUpload(AnewDrawingReviewUploadReq bo,MultipartFile file);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 填写设计验证表单
 | 
			
		||||
 | 
			
		||||
@ -194,7 +194,11 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl<BusBillo
 | 
			
		||||
        for (BusBillofquantities allMaterial : allMaterials) {
 | 
			
		||||
            allMaterial.setProjectId(bo.getProjectId());
 | 
			
		||||
        }
 | 
			
		||||
        return busBillofquantitiesService.saveBatch(allMaterials);
 | 
			
		||||
        boolean b = busBillofquantitiesService.saveBatch(allMaterials);
 | 
			
		||||
        if(!b){
 | 
			
		||||
            throw new ServiceException("导入失败");
 | 
			
		||||
        }
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -23,6 +23,8 @@ import org.dromara.design.domain.bo.AnewDrawingReviewUploadReq;
 | 
			
		||||
import org.dromara.design.domain.bo.DrawingReviewUploadReq;
 | 
			
		||||
import org.dromara.design.domain.bo.FillOutTheDesignVerificationFormReq;
 | 
			
		||||
import org.dromara.design.domain.vo.ListOfDesignDrawingsReviewRes;
 | 
			
		||||
import org.dromara.design.domain.vo.ListOfDesignDrawingsReviewSonRes;
 | 
			
		||||
import org.dromara.design.domain.vo.ObtainHistoricalDesignDrawingsForReviewRes;
 | 
			
		||||
import org.dromara.design.service.IBusDrawingreviewReceiptsService;
 | 
			
		||||
import org.dromara.system.domain.vo.SysOssUploadVo;
 | 
			
		||||
import org.dromara.system.service.ISysOssService;
 | 
			
		||||
@ -69,7 +71,17 @@ public class BusDrawingreviewServiceImpl extends ServiceImpl<BusDrawingreviewMap
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public BusDrawingreviewVo queryById(Long id){
 | 
			
		||||
        return baseMapper.selectVoById(id);
 | 
			
		||||
        //1、获取主数据
 | 
			
		||||
        BusDrawingreviewVo busDrawingreviewVo = baseMapper.selectVoById(id);
 | 
			
		||||
        //2、获取主数据下的最新的一条数据
 | 
			
		||||
        BusDrawingreviewReceipts sss = new BusDrawingreviewReceipts();
 | 
			
		||||
        LambdaQueryWrapper<BusDrawingreviewReceipts> last = new LambdaQueryWrapper<BusDrawingreviewReceipts>().
 | 
			
		||||
                eq(BusDrawingreviewReceipts::getDrawingreviewId, id)
 | 
			
		||||
                .orderByDesc(BusDrawingreviewReceipts::getCreateTime)
 | 
			
		||||
                .last("limit 1");
 | 
			
		||||
        BusDrawingreviewReceipts busDrawingreviewReceipts = busDrawingreviewReceiptsService.getBaseMapper().selectOne(last);
 | 
			
		||||
        busDrawingreviewVo.setPath(busDrawingreviewReceipts.getPath());
 | 
			
		||||
        return busDrawingreviewVo;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@ -166,7 +178,7 @@ public class BusDrawingreviewServiceImpl extends ServiceImpl<BusDrawingreviewMap
 | 
			
		||||
     * @return 是否上传成功
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public Boolean drawingReviewUpload(DrawingReviewUploadReq bo) {
 | 
			
		||||
    public Boolean drawingReviewUpload(DrawingReviewUploadReq bo, MultipartFile file) {
 | 
			
		||||
        //1、主数据新增
 | 
			
		||||
        BusDrawingreview busDrawingreview = new BusDrawingreview();
 | 
			
		||||
        busDrawingreview.setProjectId(bo.getProjectId());
 | 
			
		||||
@ -176,13 +188,9 @@ public class BusDrawingreviewServiceImpl extends ServiceImpl<BusDrawingreviewMap
 | 
			
		||||
            throw new RuntimeException("新增设计图纸评审失败");
 | 
			
		||||
        }
 | 
			
		||||
        //2、文件上传
 | 
			
		||||
        MultipartFile file = bo.getFile();
 | 
			
		||||
        if(bo.getFile() == null){
 | 
			
		||||
            throw new RuntimeException("文件不能为空");
 | 
			
		||||
        }
 | 
			
		||||
        SysOssUploadVo wordEntity = ossService.uploadWithNoSave(file, ossService.minioFileName(BillOfQuantities,file));
 | 
			
		||||
        BusDrawingreviewReceipts entity = new BusDrawingreviewReceipts().
 | 
			
		||||
            setFileName(bo.getFile().getName()).
 | 
			
		||||
            setFileName(file.getOriginalFilename()).
 | 
			
		||||
            setDrawingreviewId(busDrawingreview.getId()).
 | 
			
		||||
            setPath(wordEntity.getUrl());
 | 
			
		||||
        return busDrawingreviewReceiptsService.save(entity);
 | 
			
		||||
@ -198,15 +206,24 @@ public class BusDrawingreviewServiceImpl extends ServiceImpl<BusDrawingreviewMap
 | 
			
		||||
        return TableDataInfo.build(page);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取历史设计图纸评审
 | 
			
		||||
     * listOfDesignDrawingsReviewSon
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public Boolean anewDrawingReviewUpload(AnewDrawingReviewUploadReq bo) {
 | 
			
		||||
        MultipartFile file = bo.getFile();
 | 
			
		||||
        if(bo.getFile() == null){
 | 
			
		||||
            throw new RuntimeException("文件不能为空");
 | 
			
		||||
        }
 | 
			
		||||
    public List<ObtainHistoricalDesignDrawingsForReviewRes> ObtainHistoricalDesignDrawingsForReview(Long id) {
 | 
			
		||||
        LambdaQueryWrapper<BusDrawingreviewReceipts> lqw = Wrappers.lambdaQuery();
 | 
			
		||||
        lqw.eq(BusDrawingreviewReceipts::getDrawingreviewId, id);
 | 
			
		||||
        lqw.orderByDesc(BusDrawingreviewReceipts::getCreateTime);
 | 
			
		||||
        List<BusDrawingreviewReceipts> list = busDrawingreviewReceiptsService.list(lqw);
 | 
			
		||||
        return BeanUtil.copyToList(list, ObtainHistoricalDesignDrawingsForReviewRes.class);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public Boolean anewDrawingReviewUpload(AnewDrawingReviewUploadReq bo,MultipartFile file) {
 | 
			
		||||
        SysOssUploadVo wordEntity = ossService.uploadWithNoSave(file, ossService.minioFileName(BillOfQuantities,file));
 | 
			
		||||
        BusDrawingreviewReceipts entity = new BusDrawingreviewReceipts().
 | 
			
		||||
            setFileName(bo.getFile().getName()).
 | 
			
		||||
            setFileName(file.getName()).
 | 
			
		||||
            setDrawingreviewId(bo.getDrawingreviewId()).
 | 
			
		||||
            setPath(wordEntity.getUrl());
 | 
			
		||||
        return busDrawingreviewReceiptsService.save(entity);
 | 
			
		||||
@ -228,27 +245,32 @@ public class BusDrawingreviewServiceImpl extends ServiceImpl<BusDrawingreviewMap
 | 
			
		||||
     *
 | 
			
		||||
     * @param processEvent 参数
 | 
			
		||||
     */
 | 
			
		||||
    @org.springframework.context.event.EventListener(condition = "#processEvent.flowCode.endsWith('drawingReview')")
 | 
			
		||||
    @org.springframework.context.event.EventListener(condition = "#processEvent.flowCode.endsWith('desDrawingReview')")
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void processPlansHandler(ProcessEvent processEvent) {
 | 
			
		||||
        log.info("图纸评审审核任务执行了{}", processEvent.toString());
 | 
			
		||||
        String id = processEvent.getBusinessId();
 | 
			
		||||
        System.out.println("???????????? "+id);
 | 
			
		||||
        //1、根据id查询到子数据
 | 
			
		||||
        LambdaQueryWrapper<BusDrawingreviewReceipts> lqw = Wrappers.lambdaQuery();
 | 
			
		||||
        lqw.eq(BusDrawingreviewReceipts::getDrawingreviewId, id);
 | 
			
		||||
        lqw.orderByDesc(BusDrawingreviewReceipts::getCreateTime);
 | 
			
		||||
        lqw.last("limit 1");
 | 
			
		||||
        BusDrawingreviewReceipts one = busDrawingreviewReceiptsService.getOne(lqw);
 | 
			
		||||
        if (one == null) {
 | 
			
		||||
            throw new RuntimeException("查询失败");
 | 
			
		||||
        }
 | 
			
		||||
        //1、根据id修改
 | 
			
		||||
        BusDrawingreviewReceipts busDrawingreviewReceipts = new BusDrawingreviewReceipts();
 | 
			
		||||
        busDrawingreviewReceipts.setId(Long.valueOf(id));
 | 
			
		||||
        busDrawingreviewReceipts.setId(one.getId());
 | 
			
		||||
            busDrawingreviewReceipts.setStage(processEvent.getStatus());
 | 
			
		||||
        boolean b = busDrawingreviewReceiptsService.updateById(busDrawingreviewReceipts);
 | 
			
		||||
        if (!b) {
 | 
			
		||||
            throw new RuntimeException("更新失败");
 | 
			
		||||
        }
 | 
			
		||||
        //2、查询详情,修改上一级的状态
 | 
			
		||||
        BusDrawingreviewReceipts busDrawingreviewReceipts1 = busDrawingreviewReceiptsService.getById(id);
 | 
			
		||||
        if (busDrawingreviewReceipts1 == null) {
 | 
			
		||||
            throw new RuntimeException("查询失败");
 | 
			
		||||
        }
 | 
			
		||||
        //3、根据drawingreviewId查询主表
 | 
			
		||||
        BusDrawingreview busDrawingreview = new BusDrawingreview();
 | 
			
		||||
        busDrawingreview.setId(busDrawingreviewReceipts1.getDrawingreviewId());
 | 
			
		||||
        busDrawingreview.setId(Long.valueOf(id));
 | 
			
		||||
        busDrawingreview.setAuditType(processEvent.getStatus());
 | 
			
		||||
        baseMapper.updateById(busDrawingreview);
 | 
			
		||||
    }
 | 
			
		||||
@ -263,7 +285,7 @@ public class BusDrawingreviewServiceImpl extends ServiceImpl<BusDrawingreviewMap
 | 
			
		||||
     *
 | 
			
		||||
     * @param processTaskEvent 参数
 | 
			
		||||
     */
 | 
			
		||||
    @org.springframework.context.event.EventListener(condition = "#processTaskEvent.flowCode.endsWith('drawingReview')")
 | 
			
		||||
    @org.springframework.context.event.EventListener(condition = "#processTaskEvent.flowCode.endsWith('desDrawingReview')")
 | 
			
		||||
    public void processTaskPlansHandler(ProcessTaskEvent processTaskEvent) {
 | 
			
		||||
        log.info("图纸评审审核任务创建了{}", processTaskEvent.toString());
 | 
			
		||||
    }
 | 
			
		||||
@ -275,7 +297,7 @@ public class BusDrawingreviewServiceImpl extends ServiceImpl<BusDrawingreviewMap
 | 
			
		||||
     *
 | 
			
		||||
     * @param processDeleteEvent 参数
 | 
			
		||||
     */
 | 
			
		||||
    @EventListener(condition = "#processDeleteEvent.flowCode.endsWith('drawingReview')")
 | 
			
		||||
    @EventListener(condition = "#processDeleteEvent.flowCode.endsWith('desDrawingReview')")
 | 
			
		||||
    public void processDeletePlansHandler(ProcessDeleteEvent processDeleteEvent) {
 | 
			
		||||
        log.info("图纸评审计划删除流程事件,技术标准文件审核任务执行了{}", processDeleteEvent.toString());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -5,16 +5,19 @@ 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 jakarta.annotation.Resource;
 | 
			
		||||
import lombok.extern.slf4j.Slf4j;
 | 
			
		||||
import org.dromara.cailiaoshebei.domain.BusCailiaoshebeiPici;
 | 
			
		||||
import org.dromara.common.core.constant.HttpStatus;
 | 
			
		||||
import org.dromara.common.core.domain.event.ProcessDeleteEvent;
 | 
			
		||||
import org.dromara.common.core.domain.event.ProcessEvent;
 | 
			
		||||
import org.dromara.common.core.domain.event.ProcessTaskEvent;
 | 
			
		||||
import org.dromara.common.core.exception.ServiceException;
 | 
			
		||||
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.design.domain.DesVolumeCatalog;
 | 
			
		||||
import org.dromara.design.domain.DesVolumeFile;
 | 
			
		||||
import org.dromara.design.domain.DesVolumeFileViewer;
 | 
			
		||||
import org.dromara.design.domain.*;
 | 
			
		||||
import org.dromara.design.domain.dto.volumecatalog.DesVolumeCatalogCreateReq;
 | 
			
		||||
import org.dromara.design.domain.dto.volumecatalog.DesVolumeCatalogQueryReq;
 | 
			
		||||
import org.dromara.design.domain.dto.volumecatalog.DesVolumeCatalogUpdateReq;
 | 
			
		||||
@ -28,6 +31,7 @@ import org.dromara.system.domain.vo.SysUserVo;
 | 
			
		||||
import org.dromara.system.service.ISysUserService;
 | 
			
		||||
import org.springframework.beans.BeanUtils;
 | 
			
		||||
import org.springframework.context.annotation.Lazy;
 | 
			
		||||
import org.springframework.context.event.EventListener;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
import org.springframework.transaction.annotation.Transactional;
 | 
			
		||||
 | 
			
		||||
@ -45,6 +49,7 @@ import java.util.stream.Collectors;
 | 
			
		||||
 * @date 2025-07-30
 | 
			
		||||
 */
 | 
			
		||||
@Service
 | 
			
		||||
@Slf4j
 | 
			
		||||
public class DesVolumeCatalogServiceImpl extends ServiceImpl<DesVolumeCatalogMapper, DesVolumeCatalog>
 | 
			
		||||
    implements IDesVolumeCatalogService {
 | 
			
		||||
 | 
			
		||||
@ -313,4 +318,57 @@ public class DesVolumeCatalogServiceImpl extends ServiceImpl<DesVolumeCatalogMap
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等)
 | 
			
		||||
     * 正常使用只需#processEvent.flowCode=='leave1'
 | 
			
		||||
     * 示例为了方便则使用startsWith匹配了全部示例key
 | 
			
		||||
     *
 | 
			
		||||
     * @param processEvent 参数
 | 
			
		||||
     */
 | 
			
		||||
    @org.springframework.context.event.EventListener(condition = "#processEvent.flowCode.endsWith('designTheDiagram')")
 | 
			
		||||
    @Transactional
 | 
			
		||||
    public void processPlansHandler(ProcessEvent processEvent) {
 | 
			
		||||
        log.info("图纸评审审核任务执行了{}", processEvent.toString());
 | 
			
		||||
        String id = processEvent.getBusinessId();
 | 
			
		||||
        DesVolumeCatalog desVolumeCatalog = this.getById(Long.valueOf(id));
 | 
			
		||||
        if (desVolumeCatalog == null) {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
        desVolumeCatalog.setAuditStatus(processEvent.getStatus());
 | 
			
		||||
        //如果完成,变更状态为已完成
 | 
			
		||||
        if (processEvent.getStatus().equals("finish")){
 | 
			
		||||
            desVolumeCatalog.setDesignState("1");
 | 
			
		||||
        }
 | 
			
		||||
        this.updateById(desVolumeCatalog);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 执行任务创建监听
 | 
			
		||||
     * 示例:也可通过  @EventListener(condition = "#processTaskEvent.flowCode=='leave1'")进行判断
 | 
			
		||||
     * 在方法中判断流程节点key
 | 
			
		||||
     * if ("xxx".equals(processTaskEvent.getNodeCode())) {
 | 
			
		||||
     * //执行业务逻辑
 | 
			
		||||
     * }
 | 
			
		||||
     *
 | 
			
		||||
     * @param processTaskEvent 参数
 | 
			
		||||
     */
 | 
			
		||||
    @org.springframework.context.event.EventListener(condition = "#processTaskEvent.flowCode.endsWith('designTheDiagram')")
 | 
			
		||||
    public void processTaskPlansHandler(ProcessTaskEvent processTaskEvent) {
 | 
			
		||||
        log.info("图纸评审审核任务创建了{}", processTaskEvent.toString());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 监听删除流程事件
 | 
			
		||||
     * 正常使用只需#processDeleteEvent.flowCode=='leave1'
 | 
			
		||||
     * 示例为了方便则使用startsWith匹配了全部示例key
 | 
			
		||||
     *
 | 
			
		||||
     * @param processDeleteEvent 参数
 | 
			
		||||
     */
 | 
			
		||||
    @EventListener(condition = "#processDeleteEvent.flowCode.endsWith('designTheDiagram')")
 | 
			
		||||
    public void processDeletePlansHandler(ProcessDeleteEvent processDeleteEvent) {
 | 
			
		||||
        log.info("图纸评审计划删除流程事件,技术标准文件审核任务执行了{}", processDeleteEvent.toString());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -11,7 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
			
		||||
            bdr.audit_type,
 | 
			
		||||
            bdr.remark,
 | 
			
		||||
            bdr.create_time,
 | 
			
		||||
            bdr.file_name,
 | 
			
		||||
            bdrr.file_name
 | 
			
		||||
        from
 | 
			
		||||
            bus_drawingreview bdr
 | 
			
		||||
            left join bus_drawingreview_receipts bdrr on bdr.id = bdrr.drawingreview_id
 | 
			
		||||
 | 
			
		||||
@ -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.design.mapper.DesPrintingPlanMapper">
 | 
			
		||||
 | 
			
		||||
</mapper>
 | 
			
		||||
		Reference in New Issue
	
	Block a user