[add] 工作流按项目分类,设计变更工单、专项方案模块
This commit is contained in:
		@ -0,0 +1,39 @@
 | 
			
		||||
package org.dromara.design.constant;
 | 
			
		||||
 | 
			
		||||
import org.dromara.common.core.utils.DateUtils;
 | 
			
		||||
import org.dromara.design.domain.DesDesignChange;
 | 
			
		||||
 | 
			
		||||
import java.text.SimpleDateFormat;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025/7/3 19:42
 | 
			
		||||
 */
 | 
			
		||||
public interface DesDesignConstant {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 设计变更申请单模版路径
 | 
			
		||||
     */
 | 
			
		||||
    String DESIGN_CHANGE_TEMPLATE_PATH = "template/设计变更申请单模版.docx";
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 设计变更申请单文件路径
 | 
			
		||||
     */
 | 
			
		||||
    String DESIGN_CHANGE_FILE_URL = "docs/design/change/";
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 设计变更申请单文件名
 | 
			
		||||
     */
 | 
			
		||||
    static String getDesignChangeFileUrl(DesDesignChange designChange) {
 | 
			
		||||
        String timestamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(designChange.getUpdateTime());
 | 
			
		||||
        return String.format("%s%s/%s", DESIGN_CHANGE_FILE_URL, designChange.getId(), timestamp);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 设计变更申请单文件名
 | 
			
		||||
     */
 | 
			
		||||
    static String getDesignChangeFileName(DesDesignChange designChange) {
 | 
			
		||||
        String createDate = DateUtils.formatDate(designChange.getCreateTime());
 | 
			
		||||
        return String.format("设计变更申请单(%s).docx", createDate);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,24 @@
 | 
			
		||||
package org.dromara.design.constant;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025/7/3 11:35
 | 
			
		||||
 */
 | 
			
		||||
public interface DesSpecialSchemeConstant {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 对象存储前缀
 | 
			
		||||
     */
 | 
			
		||||
    String OSS_PREFIX = "doc/design/special/scheme/";
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取项目对象存储前缀
 | 
			
		||||
     *
 | 
			
		||||
     * @param projectId 项目id
 | 
			
		||||
     * @return 项目对象存储前缀
 | 
			
		||||
     */
 | 
			
		||||
    static String getProjectOssPrefix(Long projectId) {
 | 
			
		||||
        return String.format("%s%s/", OSS_PREFIX, projectId);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,107 @@
 | 
			
		||||
package org.dromara.design.controller;
 | 
			
		||||
 | 
			
		||||
import cn.dev33.satoken.annotation.SaCheckPermission;
 | 
			
		||||
import jakarta.annotation.Resource;
 | 
			
		||||
import jakarta.servlet.http.HttpServletResponse;
 | 
			
		||||
import jakarta.validation.constraints.NotEmpty;
 | 
			
		||||
import jakarta.validation.constraints.NotNull;
 | 
			
		||||
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.idempotent.annotation.RepeatSubmit;
 | 
			
		||||
import org.dromara.common.log.annotation.Log;
 | 
			
		||||
import org.dromara.common.log.enums.BusinessType;
 | 
			
		||||
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.dto.designchange.DesDesignChangeCreateReq;
 | 
			
		||||
import org.dromara.design.domain.dto.designchange.DesDesignChangeQueryReq;
 | 
			
		||||
import org.dromara.design.domain.dto.designchange.DesDesignChangeUpdateReq;
 | 
			
		||||
import org.dromara.design.domain.vo.designchange.DesDesignChangeVo;
 | 
			
		||||
import org.dromara.design.service.IDesDesignChangeService;
 | 
			
		||||
import org.springframework.validation.annotation.Validated;
 | 
			
		||||
import org.springframework.web.bind.annotation.*;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 设计变更管理
 | 
			
		||||
 *
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025-07-03
 | 
			
		||||
 */
 | 
			
		||||
@Validated
 | 
			
		||||
@RestController
 | 
			
		||||
@RequestMapping("/design/designChange")
 | 
			
		||||
public class DesDesignChangeController extends BaseController {
 | 
			
		||||
 | 
			
		||||
    @Resource
 | 
			
		||||
    private IDesDesignChangeService desDesignChangeService;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询设计变更管理列表
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("design:designChange:list")
 | 
			
		||||
    @GetMapping("/list")
 | 
			
		||||
    public TableDataInfo<DesDesignChangeVo> list(DesDesignChangeQueryReq req, PageQuery pageQuery) {
 | 
			
		||||
        return desDesignChangeService.queryPageList(req, pageQuery);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据主键设计变更单
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("design:designChange:export")
 | 
			
		||||
    @Log(title = "设计变更管理", businessType = BusinessType.EXPORT)
 | 
			
		||||
    @PostMapping("/export/word")
 | 
			
		||||
    public void exportWordById(@NotNull(message = "主键不能为空") Long id,
 | 
			
		||||
                               HttpServletResponse response) {
 | 
			
		||||
        desDesignChangeService.exportWordById(id, response);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取设计变更管理详细信息
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 主键
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("design:designChange:query")
 | 
			
		||||
    @GetMapping("/{id}")
 | 
			
		||||
    public R<DesDesignChangeVo> getInfo(@NotNull(message = "主键不能为空")
 | 
			
		||||
                                        @PathVariable Long id) {
 | 
			
		||||
        return R.ok(desDesignChangeService.queryById(id));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 新增设计变更管理
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("design:designChange:add")
 | 
			
		||||
    @Log(title = "设计变更管理", businessType = BusinessType.INSERT)
 | 
			
		||||
    @RepeatSubmit()
 | 
			
		||||
    @PostMapping()
 | 
			
		||||
    public R<Long> add(@Validated(AddGroup.class) @RequestBody DesDesignChangeCreateReq req) {
 | 
			
		||||
        return R.ok(desDesignChangeService.insertByBo(req));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 修改设计变更管理
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("design:designChange:edit")
 | 
			
		||||
    @Log(title = "设计变更管理", businessType = BusinessType.UPDATE)
 | 
			
		||||
    @RepeatSubmit()
 | 
			
		||||
    @PutMapping()
 | 
			
		||||
    public R<Void> edit(@Validated(EditGroup.class) @RequestBody DesDesignChangeUpdateReq req) {
 | 
			
		||||
        return toAjax(desDesignChangeService.updateByBo(req));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 删除设计变更管理
 | 
			
		||||
     *
 | 
			
		||||
     * @param ids 主键串
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("design:designChange:remove")
 | 
			
		||||
    @Log(title = "设计变更管理", businessType = BusinessType.DELETE)
 | 
			
		||||
    @DeleteMapping("/{ids}")
 | 
			
		||||
    public R<Void> remove(@NotEmpty(message = "主键不能为空")
 | 
			
		||||
                          @PathVariable Long[] ids) {
 | 
			
		||||
        return toAjax(desDesignChangeService.deleteByIds(List.of(ids)));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -5,7 +5,6 @@ import jakarta.annotation.Resource;
 | 
			
		||||
import jakarta.validation.constraints.NotEmpty;
 | 
			
		||||
import jakarta.validation.constraints.NotNull;
 | 
			
		||||
import org.dromara.common.core.domain.R;
 | 
			
		||||
import org.dromara.common.core.validate.EditGroup;
 | 
			
		||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
 | 
			
		||||
import org.dromara.common.log.annotation.Log;
 | 
			
		||||
import org.dromara.common.log.enums.BusinessType;
 | 
			
		||||
@ -19,7 +18,6 @@ import org.dromara.design.domain.vo.drawing.DesDrawingVo;
 | 
			
		||||
import org.dromara.design.service.IDesDrawingService;
 | 
			
		||||
import org.springframework.validation.annotation.Validated;
 | 
			
		||||
import org.springframework.web.bind.annotation.*;
 | 
			
		||||
import org.springframework.web.multipart.MultipartFile;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
@ -65,8 +63,8 @@ public class DesDrawingController extends BaseController {
 | 
			
		||||
    @Log(title = "图纸管理", businessType = BusinessType.INSERT)
 | 
			
		||||
    @RepeatSubmit()
 | 
			
		||||
    @PostMapping()
 | 
			
		||||
    public R<DesDrawingVo> add(@RequestPart("file") MultipartFile file, DesDrawingCreateReq req) {
 | 
			
		||||
        return R.ok(desDrawingService.insertByBo(file, req));
 | 
			
		||||
    public R<DesDrawingVo> add(@RequestBody DesDrawingCreateReq req) {
 | 
			
		||||
        return R.ok(desDrawingService.insertByBo(req));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@ -76,8 +74,8 @@ public class DesDrawingController extends BaseController {
 | 
			
		||||
    @Log(title = "图纸管理", businessType = BusinessType.UPDATE)
 | 
			
		||||
    @RepeatSubmit()
 | 
			
		||||
    @PutMapping()
 | 
			
		||||
    public R<Void> edit(@Validated(EditGroup.class) @RequestBody DesDrawingUpdateReq req) {
 | 
			
		||||
        return toAjax(desDrawingService.updateByBo(req));
 | 
			
		||||
    public R<DesDrawingVo> edit(@RequestBody DesDrawingUpdateReq req) {
 | 
			
		||||
        return R.ok(desDrawingService.updateByBo(req));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,94 @@
 | 
			
		||||
package org.dromara.design.controller;
 | 
			
		||||
 | 
			
		||||
import cn.dev33.satoken.annotation.SaCheckPermission;
 | 
			
		||||
import jakarta.annotation.Resource;
 | 
			
		||||
import jakarta.validation.constraints.NotEmpty;
 | 
			
		||||
import jakarta.validation.constraints.NotNull;
 | 
			
		||||
import org.dromara.common.core.domain.R;
 | 
			
		||||
import org.dromara.common.core.validate.EditGroup;
 | 
			
		||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
 | 
			
		||||
import org.dromara.common.log.annotation.Log;
 | 
			
		||||
import org.dromara.common.log.enums.BusinessType;
 | 
			
		||||
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.dto.specialscheme.DesSpecialSchemeCreateReq;
 | 
			
		||||
import org.dromara.design.domain.dto.specialscheme.DesSpecialSchemeQueryReq;
 | 
			
		||||
import org.dromara.design.domain.dto.specialscheme.DesSpecialSchemeUpdateReq;
 | 
			
		||||
import org.dromara.design.domain.vo.specialscheme.DesSpecialSchemeVo;
 | 
			
		||||
import org.dromara.design.service.IDesSpecialSchemeService;
 | 
			
		||||
import org.springframework.validation.annotation.Validated;
 | 
			
		||||
import org.springframework.web.bind.annotation.*;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 专项方案管理
 | 
			
		||||
 *
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025-07-03
 | 
			
		||||
 */
 | 
			
		||||
@Validated
 | 
			
		||||
@RestController
 | 
			
		||||
@RequestMapping("/design/specialScheme")
 | 
			
		||||
public class DesSpecialSchemeController extends BaseController {
 | 
			
		||||
 | 
			
		||||
    @Resource
 | 
			
		||||
    private IDesSpecialSchemeService desSpecialSchemeService;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询专项方案管理列表
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("design:specialScheme:list")
 | 
			
		||||
    @GetMapping("/list")
 | 
			
		||||
    public TableDataInfo<DesSpecialSchemeVo> list(DesSpecialSchemeQueryReq req, PageQuery pageQuery) {
 | 
			
		||||
        return desSpecialSchemeService.queryPageList(req, pageQuery);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取专项方案管理详细信息
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 主键
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("design:specialScheme:query")
 | 
			
		||||
    @GetMapping("/{id}")
 | 
			
		||||
    public R<DesSpecialSchemeVo> getInfo(@NotNull(message = "主键不能为空")
 | 
			
		||||
                                         @PathVariable Long id) {
 | 
			
		||||
        return R.ok(desSpecialSchemeService.queryById(id));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 新增专项方案管理
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("design:specialScheme:add")
 | 
			
		||||
    @Log(title = "专项方案管理", businessType = BusinessType.INSERT)
 | 
			
		||||
    @RepeatSubmit()
 | 
			
		||||
    @PostMapping()
 | 
			
		||||
    public R<DesSpecialSchemeVo> add(@RequestBody DesSpecialSchemeCreateReq req) {
 | 
			
		||||
        return R.ok(desSpecialSchemeService.insertByBo(req));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 修改专项方案管理
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("design:specialScheme:edit")
 | 
			
		||||
    @Log(title = "专项方案管理", businessType = BusinessType.UPDATE)
 | 
			
		||||
    @RepeatSubmit()
 | 
			
		||||
    @PutMapping()
 | 
			
		||||
    public R<DesSpecialSchemeVo> edit(@Validated(EditGroup.class) @RequestBody DesSpecialSchemeUpdateReq req) {
 | 
			
		||||
        return R.ok(desSpecialSchemeService.updateByBo(req));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 删除专项方案管理
 | 
			
		||||
     *
 | 
			
		||||
     * @param ids 主键串
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("design:specialScheme:remove")
 | 
			
		||||
    @Log(title = "专项方案管理", businessType = BusinessType.DELETE)
 | 
			
		||||
    @DeleteMapping("/{ids}")
 | 
			
		||||
    public R<Void> remove(@NotEmpty(message = "主键不能为空")
 | 
			
		||||
                          @PathVariable Long[] ids) {
 | 
			
		||||
        return toAjax(desSpecialSchemeService.deleteByIds(List.of(ids)));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,112 @@
 | 
			
		||||
package org.dromara.design.domain;
 | 
			
		||||
 | 
			
		||||
import com.baomidou.mybatisplus.annotation.TableId;
 | 
			
		||||
import com.baomidou.mybatisplus.annotation.TableName;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.EqualsAndHashCode;
 | 
			
		||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
 | 
			
		||||
 | 
			
		||||
import java.io.Serial;
 | 
			
		||||
import java.util.Date;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 设计变更管理对象 des_design_change
 | 
			
		||||
 *
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025-07-03
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
@EqualsAndHashCode(callSuper = true)
 | 
			
		||||
@TableName("des_design_change")
 | 
			
		||||
public class DesDesignChange extends BaseEntity {
 | 
			
		||||
 | 
			
		||||
    @Serial
 | 
			
		||||
    private static final long serialVersionUID = 1L;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 主键id
 | 
			
		||||
     */
 | 
			
		||||
    @TableId(value = "id")
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 项目id
 | 
			
		||||
     */
 | 
			
		||||
    private Long projectId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 申请单编号
 | 
			
		||||
     */
 | 
			
		||||
    private String formNo;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 工程名称
 | 
			
		||||
     */
 | 
			
		||||
    private String projectName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 提出单位
 | 
			
		||||
     */
 | 
			
		||||
    private String submitUnit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 专业
 | 
			
		||||
     */
 | 
			
		||||
    private String specialty;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 提出日期
 | 
			
		||||
     */
 | 
			
		||||
    private Date submitDate;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 卷册名称
 | 
			
		||||
     */
 | 
			
		||||
    private String volumeName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 卷册号
 | 
			
		||||
     */
 | 
			
		||||
    private String volumeNo;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 附图
 | 
			
		||||
     */
 | 
			
		||||
    private String attachmentPic;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 变更原因
 | 
			
		||||
     */
 | 
			
		||||
    private String changeReason;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 变更内容
 | 
			
		||||
     */
 | 
			
		||||
    private String changeContent;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 变更费用估算
 | 
			
		||||
     */
 | 
			
		||||
    private String costEstimation;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 变更费用估算计算表
 | 
			
		||||
     */
 | 
			
		||||
    private String costEstimationFile;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 变更文件
 | 
			
		||||
     */
 | 
			
		||||
    private String fileId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 审核状态
 | 
			
		||||
     */
 | 
			
		||||
    private String status;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 备注
 | 
			
		||||
     */
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -47,7 +47,7 @@ public class DesDrawing extends BaseEntity {
 | 
			
		||||
    /**
 | 
			
		||||
     * 文件访问路径
 | 
			
		||||
     */
 | 
			
		||||
    private String fileUrl;
 | 
			
		||||
    private Long fileUrl;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 文件类型(1过程图纸 2蓝图 3变更图纸)
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,82 @@
 | 
			
		||||
package org.dromara.design.domain;
 | 
			
		||||
 | 
			
		||||
import com.baomidou.mybatisplus.annotation.TableId;
 | 
			
		||||
import com.baomidou.mybatisplus.annotation.TableName;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.EqualsAndHashCode;
 | 
			
		||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
 | 
			
		||||
 | 
			
		||||
import java.io.Serial;
 | 
			
		||||
import java.util.Date;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 专项方案管理对象 des_special_scheme
 | 
			
		||||
 *
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025-07-03
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
@EqualsAndHashCode(callSuper = true)
 | 
			
		||||
@TableName("des_special_scheme")
 | 
			
		||||
public class DesSpecialScheme extends BaseEntity {
 | 
			
		||||
 | 
			
		||||
    @Serial
 | 
			
		||||
    private static final long serialVersionUID = 1L;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 主键id
 | 
			
		||||
     */
 | 
			
		||||
    @TableId(value = "id")
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 项目id
 | 
			
		||||
     */
 | 
			
		||||
    private Long projectId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 版本号
 | 
			
		||||
     */
 | 
			
		||||
    private String versionNumber;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 文件名称
 | 
			
		||||
     */
 | 
			
		||||
    private String fileName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 文件访问路径
 | 
			
		||||
     */
 | 
			
		||||
    private Long fileUrl;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 文件后缀
 | 
			
		||||
     */
 | 
			
		||||
    private String fileSuffix;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 状态(0正常 1删除)
 | 
			
		||||
     */
 | 
			
		||||
    private String fileStatus;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 原文件名
 | 
			
		||||
     */
 | 
			
		||||
    private String originalName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 审核状态
 | 
			
		||||
     */
 | 
			
		||||
    private String status;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 备注
 | 
			
		||||
     */
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 删除时间
 | 
			
		||||
     */
 | 
			
		||||
    private Date deletedAt;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,101 @@
 | 
			
		||||
package org.dromara.design.domain.dto.designchange;
 | 
			
		||||
 | 
			
		||||
import com.fasterxml.jackson.annotation.JsonFormat;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import java.io.Serial;
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.util.Date;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025/7/3 18:48
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
public class DesDesignChangeCreateReq implements Serializable {
 | 
			
		||||
 | 
			
		||||
    @Serial
 | 
			
		||||
    private static final long serialVersionUID = -8811234168299834882L;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 主键id
 | 
			
		||||
     */
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 项目id
 | 
			
		||||
     */
 | 
			
		||||
    private Long projectId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 申请单编号
 | 
			
		||||
     */
 | 
			
		||||
    private String formNo;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 工程名称
 | 
			
		||||
     */
 | 
			
		||||
    private String projectName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 提出单位
 | 
			
		||||
     */
 | 
			
		||||
    private String submitUnit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 专业
 | 
			
		||||
     */
 | 
			
		||||
    private String specialty;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 提出日期
 | 
			
		||||
     */
 | 
			
		||||
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
 | 
			
		||||
    private Date submitDate;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 卷册名称
 | 
			
		||||
     */
 | 
			
		||||
    private String volumeName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 卷册号
 | 
			
		||||
     */
 | 
			
		||||
    private String volumeNo;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 附图
 | 
			
		||||
     */
 | 
			
		||||
    private String attachmentPic;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 变更原因
 | 
			
		||||
     */
 | 
			
		||||
    private String changeReason;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 变更内容
 | 
			
		||||
     */
 | 
			
		||||
    private String changeContent;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 变更费用估算
 | 
			
		||||
     */
 | 
			
		||||
    private String costEstimation;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 变更费用估算计算表
 | 
			
		||||
     */
 | 
			
		||||
    private String costEstimationFile;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 变更文件
 | 
			
		||||
     */
 | 
			
		||||
    private String fileId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 备注
 | 
			
		||||
     */
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,66 @@
 | 
			
		||||
package org.dromara.design.domain.dto.designchange;
 | 
			
		||||
 | 
			
		||||
import com.fasterxml.jackson.annotation.JsonFormat;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import java.io.Serial;
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.util.Date;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025/7/3 18:48
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
public class DesDesignChangeQueryReq implements Serializable {
 | 
			
		||||
 | 
			
		||||
    @Serial
 | 
			
		||||
    private static final long serialVersionUID = -270854871043405421L;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 项目id
 | 
			
		||||
     */
 | 
			
		||||
    private Long projectId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 申请单编号
 | 
			
		||||
     */
 | 
			
		||||
    private String formNo;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 工程名称
 | 
			
		||||
     */
 | 
			
		||||
    private String projectName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 提出单位
 | 
			
		||||
     */
 | 
			
		||||
    private String submitUnit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 专业
 | 
			
		||||
     */
 | 
			
		||||
    private String specialty;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 提出日期
 | 
			
		||||
     */
 | 
			
		||||
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
 | 
			
		||||
    private Date submitDate;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 卷册名称
 | 
			
		||||
     */
 | 
			
		||||
    private String volumeName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 卷册号
 | 
			
		||||
     */
 | 
			
		||||
    private String volumeNo;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 审核状态
 | 
			
		||||
     */
 | 
			
		||||
    private String status;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,101 @@
 | 
			
		||||
package org.dromara.design.domain.dto.designchange;
 | 
			
		||||
 | 
			
		||||
import com.fasterxml.jackson.annotation.JsonFormat;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import java.io.Serial;
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.util.Date;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025/7/3 18:49
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
public class DesDesignChangeUpdateReq implements Serializable {
 | 
			
		||||
 | 
			
		||||
    @Serial
 | 
			
		||||
    private static final long serialVersionUID = 1764866203240580206L;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 主键id
 | 
			
		||||
     */
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 项目id
 | 
			
		||||
     */
 | 
			
		||||
    private Long projectId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 申请单编号
 | 
			
		||||
     */
 | 
			
		||||
    private String formNo;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 工程名称
 | 
			
		||||
     */
 | 
			
		||||
    private String projectName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 提出单位
 | 
			
		||||
     */
 | 
			
		||||
    private String submitUnit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 专业
 | 
			
		||||
     */
 | 
			
		||||
    private String specialty;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 提出日期
 | 
			
		||||
     */
 | 
			
		||||
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
 | 
			
		||||
    private Date submitDate;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 卷册名称
 | 
			
		||||
     */
 | 
			
		||||
    private String volumeName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 卷册号
 | 
			
		||||
     */
 | 
			
		||||
    private String volumeNo;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 附图
 | 
			
		||||
     */
 | 
			
		||||
    private String attachmentPic;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 变更原因
 | 
			
		||||
     */
 | 
			
		||||
    private String changeReason;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 变更内容
 | 
			
		||||
     */
 | 
			
		||||
    private String changeContent;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 变更费用估算
 | 
			
		||||
     */
 | 
			
		||||
    private String costEstimation;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 变更费用估算计算表
 | 
			
		||||
     */
 | 
			
		||||
    private String costEstimationFile;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 变更文件
 | 
			
		||||
     */
 | 
			
		||||
    private String fileId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 备注
 | 
			
		||||
     */
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -35,6 +35,11 @@ public class DesDrawingCreateReq implements Serializable {
 | 
			
		||||
     */
 | 
			
		||||
    private String fileType;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 文件路径
 | 
			
		||||
     */
 | 
			
		||||
    private Long fileUrl;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 备注
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
@ -30,6 +30,11 @@ public class DesDrawingUpdateReq implements Serializable {
 | 
			
		||||
     */
 | 
			
		||||
    private String fileName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 文件路径
 | 
			
		||||
     */
 | 
			
		||||
    private Long fileUrl;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 备注
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,43 @@
 | 
			
		||||
package org.dromara.design.domain.dto.specialscheme;
 | 
			
		||||
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import java.io.Serial;
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025/7/3 11:27
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
public class DesSpecialSchemeCreateReq implements Serializable {
 | 
			
		||||
 | 
			
		||||
    @Serial
 | 
			
		||||
    private static final long serialVersionUID = 6963615629792446908L;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 项目id
 | 
			
		||||
     */
 | 
			
		||||
    private Long projectId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 版本号
 | 
			
		||||
     */
 | 
			
		||||
    private String versionNumber;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 文件名称
 | 
			
		||||
     */
 | 
			
		||||
    private String fileName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 文件id
 | 
			
		||||
     */
 | 
			
		||||
    private Long fileUrl;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 备注
 | 
			
		||||
     */
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,38 @@
 | 
			
		||||
package org.dromara.design.domain.dto.specialscheme;
 | 
			
		||||
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import java.io.Serial;
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025/7/3 11:28
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
public class DesSpecialSchemeQueryReq implements Serializable {
 | 
			
		||||
 | 
			
		||||
    @Serial
 | 
			
		||||
    private static final long serialVersionUID = -6490770086658766211L;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 项目id
 | 
			
		||||
     */
 | 
			
		||||
    private Long projectId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 文件名称
 | 
			
		||||
     */
 | 
			
		||||
    private String fileName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 状态(0正常 1删除)
 | 
			
		||||
     */
 | 
			
		||||
    private String fileStatus;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 原文件名
 | 
			
		||||
     */
 | 
			
		||||
    private String originalName;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,43 @@
 | 
			
		||||
package org.dromara.design.domain.dto.specialscheme;
 | 
			
		||||
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import java.io.Serial;
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025/7/3 11:29
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
public class DesSpecialSchemeUpdateReq implements Serializable {
 | 
			
		||||
 | 
			
		||||
    @Serial
 | 
			
		||||
    private static final long serialVersionUID = -6314226629118163829L;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 主键id
 | 
			
		||||
     */
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 版本号
 | 
			
		||||
     */
 | 
			
		||||
    private String versionNumber;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 文件名称
 | 
			
		||||
     */
 | 
			
		||||
    private String fileName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 文件路径
 | 
			
		||||
     */
 | 
			
		||||
    private Long fileUrl;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 备注
 | 
			
		||||
     */
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,132 @@
 | 
			
		||||
package org.dromara.design.domain.vo.designchange;
 | 
			
		||||
 | 
			
		||||
import io.github.linpeilie.annotations.AutoMapper;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import org.dromara.design.domain.DesDesignChange;
 | 
			
		||||
import org.dromara.system.domain.vo.SysOssVo;
 | 
			
		||||
 | 
			
		||||
import java.io.Serial;
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.util.Date;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 设计变更管理视图对象 des_design_change
 | 
			
		||||
 *
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025-07-03
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
@AutoMapper(target = DesDesignChange.class)
 | 
			
		||||
public class DesDesignChangeVo implements Serializable {
 | 
			
		||||
 | 
			
		||||
    @Serial
 | 
			
		||||
    private static final long serialVersionUID = 1L;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 主键id
 | 
			
		||||
     */
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 项目id
 | 
			
		||||
     */
 | 
			
		||||
    private Long projectId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 申请单编号
 | 
			
		||||
     */
 | 
			
		||||
    private String formNo;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 工程名称
 | 
			
		||||
     */
 | 
			
		||||
    private String projectName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 提出单位
 | 
			
		||||
     */
 | 
			
		||||
    private String submitUnit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 专业
 | 
			
		||||
     */
 | 
			
		||||
    private String specialty;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 提出日期
 | 
			
		||||
     */
 | 
			
		||||
    private Date submitDate;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 卷册名称
 | 
			
		||||
     */
 | 
			
		||||
    private String volumeName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 卷册号
 | 
			
		||||
     */
 | 
			
		||||
    private String volumeNo;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 附图
 | 
			
		||||
     */
 | 
			
		||||
    private String attachmentPic;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 附图列表
 | 
			
		||||
     */
 | 
			
		||||
    private List<SysOssVo> attachmentPicList;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 变更原因
 | 
			
		||||
     */
 | 
			
		||||
    private String changeReason;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 变更内容
 | 
			
		||||
     */
 | 
			
		||||
    private String changeContent;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 变更费用估算
 | 
			
		||||
     */
 | 
			
		||||
    private String costEstimation;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 变更费用估算计算表
 | 
			
		||||
     */
 | 
			
		||||
    private String costEstimationFile;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 变更费用估算计算表列表
 | 
			
		||||
     */
 | 
			
		||||
    private List<SysOssVo> costEstimationFileList;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 变更文件
 | 
			
		||||
     */
 | 
			
		||||
    private String fileId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 变更文件
 | 
			
		||||
     */
 | 
			
		||||
    private SysOssVo file;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 审核状态
 | 
			
		||||
     */
 | 
			
		||||
    private String status;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 备注
 | 
			
		||||
     */
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 创建时间
 | 
			
		||||
     */
 | 
			
		||||
    private Date createTime;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -3,9 +3,11 @@ package org.dromara.design.domain.vo.drawing;
 | 
			
		||||
import io.github.linpeilie.annotations.AutoMapper;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import org.dromara.design.domain.DesDrawing;
 | 
			
		||||
import org.dromara.system.domain.vo.SysOssVo;
 | 
			
		||||
 | 
			
		||||
import java.io.Serial;
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.util.Date;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
@ -44,7 +46,7 @@ public class DesDrawingVo implements Serializable {
 | 
			
		||||
    /**
 | 
			
		||||
     * 文件访问路径
 | 
			
		||||
     */
 | 
			
		||||
    private String fileUrl;
 | 
			
		||||
    private Long fileUrl;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 文件类型(1过程图纸 2蓝图 3变更图纸)
 | 
			
		||||
@ -56,6 +58,11 @@ public class DesDrawingVo implements Serializable {
 | 
			
		||||
     */
 | 
			
		||||
    private String fileSuffix;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 文件
 | 
			
		||||
     */
 | 
			
		||||
    private SysOssVo file;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 原文件名
 | 
			
		||||
     */
 | 
			
		||||
@ -76,4 +83,9 @@ public class DesDrawingVo implements Serializable {
 | 
			
		||||
     */
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 创建时间
 | 
			
		||||
     */
 | 
			
		||||
    private Date createTime;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,81 @@
 | 
			
		||||
package org.dromara.design.domain.vo.specialscheme;
 | 
			
		||||
 | 
			
		||||
import io.github.linpeilie.annotations.AutoMapper;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import org.dromara.design.domain.DesSpecialScheme;
 | 
			
		||||
import org.dromara.system.domain.vo.SysOssVo;
 | 
			
		||||
 | 
			
		||||
import java.io.Serial;
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.util.Date;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 专项方案管理视图对象 des_special_scheme
 | 
			
		||||
 *
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025-07-03
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
@AutoMapper(target = DesSpecialScheme.class)
 | 
			
		||||
public class DesSpecialSchemeVo implements Serializable {
 | 
			
		||||
 | 
			
		||||
    @Serial
 | 
			
		||||
    private static final long serialVersionUID = 1L;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 主键id
 | 
			
		||||
     */
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 项目id
 | 
			
		||||
     */
 | 
			
		||||
    private Long projectId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 版本号
 | 
			
		||||
     */
 | 
			
		||||
    private String versionNumber;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 文件名称
 | 
			
		||||
     */
 | 
			
		||||
    private String fileName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 文件访问路径
 | 
			
		||||
     */
 | 
			
		||||
    private Long fileUrl;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 文件后缀
 | 
			
		||||
     */
 | 
			
		||||
    private String fileSuffix;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 原文件名
 | 
			
		||||
     */
 | 
			
		||||
    private String originalName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 文件
 | 
			
		||||
     */
 | 
			
		||||
    private SysOssVo file;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 审核状态
 | 
			
		||||
     */
 | 
			
		||||
    private String status;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 备注
 | 
			
		||||
     */
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 创建时间
 | 
			
		||||
     */
 | 
			
		||||
    private Date createTime;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,42 @@
 | 
			
		||||
package org.dromara.design.enums;
 | 
			
		||||
 | 
			
		||||
import lombok.Getter;
 | 
			
		||||
 | 
			
		||||
import java.util.Objects;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025/7/3 19:46
 | 
			
		||||
 */
 | 
			
		||||
@Getter
 | 
			
		||||
public enum DesChangeReasonTypeEnum {
 | 
			
		||||
 | 
			
		||||
    LEAK("设计漏项", "1"),
 | 
			
		||||
    IMPROVE("设计改进", "2"),
 | 
			
		||||
    ERROR("设计差错", "3"),
 | 
			
		||||
    INTERFACE("接口差错", "4"),
 | 
			
		||||
    OWNER("业主要求", "5"),
 | 
			
		||||
    CONTRACTOR("施工承包商要求", "6"),
 | 
			
		||||
    CONFLICT("外部资料与最终情况不符", "7"),
 | 
			
		||||
    OTHER("材料代用或其他", "8");
 | 
			
		||||
 | 
			
		||||
    private final String text;
 | 
			
		||||
 | 
			
		||||
    private final String value;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    DesChangeReasonTypeEnum(String text, String value) {
 | 
			
		||||
        this.text = text;
 | 
			
		||||
        this.value = value;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // 根据 value 获取对应的 text
 | 
			
		||||
    public static String getTextByValue(String value) {
 | 
			
		||||
        for (DesChangeReasonTypeEnum type : values()) {
 | 
			
		||||
            if (Objects.equals(type.getValue(), value)) {
 | 
			
		||||
                return type.getText();
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return null;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,15 @@
 | 
			
		||||
package org.dromara.design.mapper;
 | 
			
		||||
 | 
			
		||||
import org.dromara.design.domain.DesDesignChange;
 | 
			
		||||
import org.dromara.design.domain.vo.designchange.DesDesignChangeVo;
 | 
			
		||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 设计变更管理Mapper接口
 | 
			
		||||
 *
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025-07-03
 | 
			
		||||
 */
 | 
			
		||||
public interface DesDesignChangeMapper extends BaseMapperPlus<DesDesignChange, DesDesignChangeVo> {
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,15 @@
 | 
			
		||||
package org.dromara.design.mapper;
 | 
			
		||||
 | 
			
		||||
import org.dromara.design.domain.DesSpecialScheme;
 | 
			
		||||
import org.dromara.design.domain.vo.specialscheme.DesSpecialSchemeVo;
 | 
			
		||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 专项方案管理Mapper接口
 | 
			
		||||
 *
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025-07-03
 | 
			
		||||
 */
 | 
			
		||||
public interface DesSpecialSchemeMapper extends BaseMapperPlus<DesSpecialScheme, DesSpecialSchemeVo> {
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,105 @@
 | 
			
		||||
package org.dromara.design.service;
 | 
			
		||||
 | 
			
		||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 | 
			
		||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 | 
			
		||||
import com.baomidou.mybatisplus.extension.service.IService;
 | 
			
		||||
import jakarta.servlet.http.HttpServletResponse;
 | 
			
		||||
import org.dromara.common.mybatis.core.page.PageQuery;
 | 
			
		||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
 | 
			
		||||
import org.dromara.design.domain.DesDesignChange;
 | 
			
		||||
import org.dromara.design.domain.dto.designchange.DesDesignChangeCreateReq;
 | 
			
		||||
import org.dromara.design.domain.dto.designchange.DesDesignChangeQueryReq;
 | 
			
		||||
import org.dromara.design.domain.dto.designchange.DesDesignChangeUpdateReq;
 | 
			
		||||
import org.dromara.design.domain.vo.designchange.DesDesignChangeVo;
 | 
			
		||||
 | 
			
		||||
import java.util.Collection;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 设计变更管理Service接口
 | 
			
		||||
 *
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025-07-03
 | 
			
		||||
 */
 | 
			
		||||
public interface IDesDesignChangeService extends IService<DesDesignChange> {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询设计变更管理
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 主键
 | 
			
		||||
     * @return 设计变更管理
 | 
			
		||||
     */
 | 
			
		||||
    DesDesignChangeVo queryById(Long id);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 分页查询设计变更管理列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param req       查询条件
 | 
			
		||||
     * @param pageQuery 分页参数
 | 
			
		||||
     * @return 设计变更管理分页列表
 | 
			
		||||
     */
 | 
			
		||||
    TableDataInfo<DesDesignChangeVo> queryPageList(DesDesignChangeQueryReq req, PageQuery pageQuery);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询符合条件的设计变更管理列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param req 查询条件
 | 
			
		||||
     * @return 设计变更管理列表
 | 
			
		||||
     */
 | 
			
		||||
    List<DesDesignChangeVo> queryList(DesDesignChangeQueryReq req);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据主键id导出设计变更单
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 设计变更主键id
 | 
			
		||||
     */
 | 
			
		||||
    void exportWordById(Long id, HttpServletResponse response);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 新增设计变更管理
 | 
			
		||||
     *
 | 
			
		||||
     * @param req 设计变更管理
 | 
			
		||||
     * @return 新增设计变更管理主键id
 | 
			
		||||
     */
 | 
			
		||||
    Long insertByBo(DesDesignChangeCreateReq req);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 修改设计变更管理
 | 
			
		||||
     *
 | 
			
		||||
     * @param req 设计变更管理
 | 
			
		||||
     * @return 是否修改成功
 | 
			
		||||
     */
 | 
			
		||||
    Boolean updateByBo(DesDesignChangeUpdateReq req);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 校验并批量删除设计变更管理信息
 | 
			
		||||
     *
 | 
			
		||||
     * @param ids 待删除的主键集合
 | 
			
		||||
     * @return 是否删除成功
 | 
			
		||||
     */
 | 
			
		||||
    Boolean deleteByIds(Collection<Long> ids);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 构建设计变更管理封装对象
 | 
			
		||||
     *
 | 
			
		||||
     * @param designChange 设计变更管理
 | 
			
		||||
     * @return 设计变更管理封装对象
 | 
			
		||||
     */
 | 
			
		||||
    DesDesignChangeVo getVo(DesDesignChange designChange);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 构建查询条件
 | 
			
		||||
     *
 | 
			
		||||
     * @param req 查询条件
 | 
			
		||||
     * @return 查询条件
 | 
			
		||||
     */
 | 
			
		||||
    LambdaQueryWrapper<DesDesignChange> buildQueryWrapper(DesDesignChangeQueryReq req);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取设计变更管理对象视图
 | 
			
		||||
     *
 | 
			
		||||
     * @param designChangePage 设计变更管理对象
 | 
			
		||||
     * @return 设计变更管理对象视图
 | 
			
		||||
     */
 | 
			
		||||
    Page<DesDesignChangeVo> getVoPage(Page<DesDesignChange> designChangePage);
 | 
			
		||||
}
 | 
			
		||||
@ -10,7 +10,6 @@ import org.dromara.design.domain.dto.drawing.DesDrawingCreateReq;
 | 
			
		||||
import org.dromara.design.domain.dto.drawing.DesDrawingQueryReq;
 | 
			
		||||
import org.dromara.design.domain.dto.drawing.DesDrawingUpdateReq;
 | 
			
		||||
import org.dromara.design.domain.vo.drawing.DesDrawingVo;
 | 
			
		||||
import org.springframework.web.multipart.MultipartFile;
 | 
			
		||||
 | 
			
		||||
import java.util.Collection;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
@ -51,19 +50,18 @@ public interface IDesDrawingService extends IService<DesDrawing> {
 | 
			
		||||
    /**
 | 
			
		||||
     * 新增图纸管理
 | 
			
		||||
     *
 | 
			
		||||
     * @param file 文件
 | 
			
		||||
     * @param req  图纸管理
 | 
			
		||||
     * @param req 图纸管理
 | 
			
		||||
     * @return 新增图纸管理主键id
 | 
			
		||||
     */
 | 
			
		||||
    DesDrawingVo insertByBo(MultipartFile file, DesDrawingCreateReq req);
 | 
			
		||||
    DesDrawingVo insertByBo(DesDrawingCreateReq req);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 修改图纸管理
 | 
			
		||||
     *
 | 
			
		||||
     * @param req 图纸管理
 | 
			
		||||
     * @return 是否修改成功
 | 
			
		||||
     * @return 图纸管理
 | 
			
		||||
     */
 | 
			
		||||
    Boolean updateByBo(DesDrawingUpdateReq req);
 | 
			
		||||
    DesDrawingVo updateByBo(DesDrawingUpdateReq req);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 校验并批量删除图纸管理信息
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,97 @@
 | 
			
		||||
package org.dromara.design.service;
 | 
			
		||||
 | 
			
		||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 | 
			
		||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 | 
			
		||||
import com.baomidou.mybatisplus.extension.service.IService;
 | 
			
		||||
import org.dromara.common.mybatis.core.page.PageQuery;
 | 
			
		||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
 | 
			
		||||
import org.dromara.design.domain.DesSpecialScheme;
 | 
			
		||||
import org.dromara.design.domain.dto.specialscheme.DesSpecialSchemeCreateReq;
 | 
			
		||||
import org.dromara.design.domain.dto.specialscheme.DesSpecialSchemeQueryReq;
 | 
			
		||||
import org.dromara.design.domain.dto.specialscheme.DesSpecialSchemeUpdateReq;
 | 
			
		||||
import org.dromara.design.domain.vo.specialscheme.DesSpecialSchemeVo;
 | 
			
		||||
 | 
			
		||||
import java.util.Collection;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 专项方案管理Service接口
 | 
			
		||||
 *
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025-07-03
 | 
			
		||||
 */
 | 
			
		||||
public interface IDesSpecialSchemeService extends IService<DesSpecialScheme> {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询图纸管理
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 主键
 | 
			
		||||
     * @return 图纸管理
 | 
			
		||||
     */
 | 
			
		||||
    DesSpecialSchemeVo queryById(Long id);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 分页查询图纸管理列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param req       查询条件
 | 
			
		||||
     * @param pageQuery 分页参数
 | 
			
		||||
     * @return 图纸管理分页列表
 | 
			
		||||
     */
 | 
			
		||||
    TableDataInfo<DesSpecialSchemeVo> queryPageList(DesSpecialSchemeQueryReq req, PageQuery pageQuery);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询符合条件的图纸管理列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param req 查询条件
 | 
			
		||||
     * @return 图纸管理列表
 | 
			
		||||
     */
 | 
			
		||||
    List<DesSpecialSchemeVo> queryList(DesSpecialSchemeQueryReq req);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 新增图纸管理
 | 
			
		||||
     *
 | 
			
		||||
     * @param req 图纸管理
 | 
			
		||||
     * @return 新增图纸管理
 | 
			
		||||
     */
 | 
			
		||||
    DesSpecialSchemeVo insertByBo(DesSpecialSchemeCreateReq req);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 修改图纸管理
 | 
			
		||||
     *
 | 
			
		||||
     * @param req 图纸管理
 | 
			
		||||
     * @return 图纸管理
 | 
			
		||||
     */
 | 
			
		||||
    DesSpecialSchemeVo updateByBo(DesSpecialSchemeUpdateReq req);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 校验并批量删除图纸管理信息
 | 
			
		||||
     *
 | 
			
		||||
     * @param ids 待删除的主键集合
 | 
			
		||||
     * @return 是否删除成功
 | 
			
		||||
     */
 | 
			
		||||
    Boolean deleteByIds(Collection<Long> ids);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 构建图纸管理封装对象
 | 
			
		||||
     *
 | 
			
		||||
     * @param specialScheme 图纸管理
 | 
			
		||||
     * @return 图纸管理封装对象
 | 
			
		||||
     */
 | 
			
		||||
    DesSpecialSchemeVo getVo(DesSpecialScheme specialScheme);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 构建查询条件
 | 
			
		||||
     *
 | 
			
		||||
     * @param req 查询条件
 | 
			
		||||
     * @return 查询条件
 | 
			
		||||
     */
 | 
			
		||||
    LambdaQueryWrapper<DesSpecialScheme> buildQueryWrapper(DesSpecialSchemeQueryReq req);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取图纸管理对象视图
 | 
			
		||||
     *
 | 
			
		||||
     * @param specialSchemePage 图纸管理对象
 | 
			
		||||
     * @return 图纸管理对象视图
 | 
			
		||||
     */
 | 
			
		||||
    Page<DesSpecialSchemeVo> getVoPage(Page<DesSpecialScheme> specialSchemePage);
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,482 @@
 | 
			
		||||
package org.dromara.design.service.impl;
 | 
			
		||||
 | 
			
		||||
import cn.hutool.core.collection.CollUtil;
 | 
			
		||||
import cn.hutool.core.date.DateUtil;
 | 
			
		||||
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 jakarta.servlet.http.HttpServletResponse;
 | 
			
		||||
import lombok.extern.slf4j.Slf4j;
 | 
			
		||||
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 | 
			
		||||
import org.apache.poi.xwpf.usermodel.*;
 | 
			
		||||
import org.dromara.common.core.constant.HttpStatus;
 | 
			
		||||
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.core.utils.file.FileUtils;
 | 
			
		||||
import org.dromara.common.mybatis.core.page.PageQuery;
 | 
			
		||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
 | 
			
		||||
import org.dromara.common.oss.core.OssClient;
 | 
			
		||||
import org.dromara.common.oss.exception.OssException;
 | 
			
		||||
import org.dromara.common.oss.factory.OssFactory;
 | 
			
		||||
import org.dromara.common.utils.DocumentUtil;
 | 
			
		||||
import org.dromara.design.constant.DesDesignConstant;
 | 
			
		||||
import org.dromara.design.domain.DesDesignChange;
 | 
			
		||||
import org.dromara.design.domain.dto.designchange.DesDesignChangeCreateReq;
 | 
			
		||||
import org.dromara.design.domain.dto.designchange.DesDesignChangeQueryReq;
 | 
			
		||||
import org.dromara.design.domain.dto.designchange.DesDesignChangeUpdateReq;
 | 
			
		||||
import org.dromara.design.domain.vo.designchange.DesDesignChangeVo;
 | 
			
		||||
import org.dromara.design.mapper.DesDesignChangeMapper;
 | 
			
		||||
import org.dromara.design.service.IDesDesignChangeService;
 | 
			
		||||
import org.dromara.project.service.IBusProjectService;
 | 
			
		||||
import org.dromara.system.domain.vo.SysOssVo;
 | 
			
		||||
import org.dromara.system.service.ISysOssService;
 | 
			
		||||
import org.springframework.beans.BeanUtils;
 | 
			
		||||
import org.springframework.http.MediaType;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
import org.springframework.transaction.annotation.Transactional;
 | 
			
		||||
 | 
			
		||||
import java.io.FileOutputStream;
 | 
			
		||||
import java.io.IOException;
 | 
			
		||||
import java.io.InputStream;
 | 
			
		||||
import java.nio.file.Files;
 | 
			
		||||
import java.nio.file.Path;
 | 
			
		||||
import java.nio.file.Paths;
 | 
			
		||||
import java.util.*;
 | 
			
		||||
import java.util.function.Function;
 | 
			
		||||
import java.util.stream.Collectors;
 | 
			
		||||
import java.util.zip.ZipOutputStream;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 设计变更管理Service业务层处理
 | 
			
		||||
 *
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025-07-03
 | 
			
		||||
 */
 | 
			
		||||
@Slf4j
 | 
			
		||||
@Service
 | 
			
		||||
public class DesDesignChangeServiceImpl extends ServiceImpl<DesDesignChangeMapper, DesDesignChange>
 | 
			
		||||
    implements IDesDesignChangeService {
 | 
			
		||||
 | 
			
		||||
    @Resource
 | 
			
		||||
    private IBusProjectService projectService;
 | 
			
		||||
 | 
			
		||||
    @Resource
 | 
			
		||||
    private ISysOssService ossService;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询设计变更管理
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 主键
 | 
			
		||||
     * @return 设计变更管理
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public DesDesignChangeVo queryById(Long id) {
 | 
			
		||||
        DesDesignChange designChange = this.getById(id);
 | 
			
		||||
        if (designChange == null) {
 | 
			
		||||
            throw new ServiceException("设计变更不存在", HttpStatus.NOT_FOUND);
 | 
			
		||||
        }
 | 
			
		||||
        return this.getVo(designChange);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 分页查询设计变更管理列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param req       查询条件
 | 
			
		||||
     * @param pageQuery 分页参数
 | 
			
		||||
     * @return 设计变更管理分页列表
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public TableDataInfo<DesDesignChangeVo> queryPageList(DesDesignChangeQueryReq req, PageQuery pageQuery) {
 | 
			
		||||
        Page<DesDesignChange> changePage = this.page(pageQuery.build(), this.buildQueryWrapper(req));
 | 
			
		||||
        return TableDataInfo.build(this.getVoPage(changePage));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询符合条件的设计变更管理列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param req 查询条件
 | 
			
		||||
     * @return 设计变更管理列表
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<DesDesignChangeVo> queryList(DesDesignChangeQueryReq req) {
 | 
			
		||||
        LambdaQueryWrapper<DesDesignChange> lqw = buildQueryWrapper(req);
 | 
			
		||||
        return this.list(lqw).stream().map(this::getVo).toList();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据主键id导出设计变更单
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 设计变更主键id
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public void exportWordById(Long id, HttpServletResponse response) {
 | 
			
		||||
        DesDesignChange designChange = this.getById(id);
 | 
			
		||||
        if (designChange == null) {
 | 
			
		||||
            throw new ServiceException("质量-检查工单不存在");
 | 
			
		||||
        }
 | 
			
		||||
        Map<String, String> replacementMap = getReplacementMap(designChange);
 | 
			
		||||
        Path targetDir = Paths.get(DesDesignConstant.getDesignChangeFileUrl(designChange));
 | 
			
		||||
        // 如果存在目录则直接返回,不存在则生成文件并返回
 | 
			
		||||
        if (!Files.exists(targetDir)) {
 | 
			
		||||
            // 清理旧文件
 | 
			
		||||
            String baseUrl = DesDesignConstant.DESIGN_CHANGE_FILE_URL + designChange.getId();
 | 
			
		||||
            try {
 | 
			
		||||
                Path dirPath = Paths.get(baseUrl);
 | 
			
		||||
                if (Files.exists(dirPath)) {
 | 
			
		||||
                    FileUtils.deleteDirectory(dirPath);
 | 
			
		||||
                }
 | 
			
		||||
            } catch (IOException e) {
 | 
			
		||||
                log.error("文件目录:{},清理失败", baseUrl, e);
 | 
			
		||||
            }
 | 
			
		||||
            // 生成文件
 | 
			
		||||
            try (InputStream is = getClass().getClassLoader().getResourceAsStream(DesDesignConstant.DESIGN_CHANGE_TEMPLATE_PATH)) {
 | 
			
		||||
                if (is == null) {
 | 
			
		||||
                    throw new ServiceException("模板文件不存在");
 | 
			
		||||
                }
 | 
			
		||||
                try (XWPFDocument document = new XWPFDocument(is)) {
 | 
			
		||||
                    // 替换段落中的文本
 | 
			
		||||
                    for (XWPFParagraph paragraph : document.getParagraphs()) {
 | 
			
		||||
                        replaceInParagraph(paragraph, replacementMap, document, designChange);
 | 
			
		||||
                    }
 | 
			
		||||
                    // 替换表格中的文本(如果模板中有表格)
 | 
			
		||||
                    for (XWPFTable table : document.getTables()) {
 | 
			
		||||
                        for (XWPFTableRow row : table.getRows()) {
 | 
			
		||||
                            for (XWPFTableCell cell : row.getTableCells()) {
 | 
			
		||||
                                for (XWPFParagraph paragraph : cell.getParagraphs()) {
 | 
			
		||||
                                    replaceInParagraph(paragraph, replacementMap, document, designChange);
 | 
			
		||||
                                }
 | 
			
		||||
                            }
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                    // 创建目标目录
 | 
			
		||||
                    if (!Files.exists(targetDir)) {
 | 
			
		||||
                        Files.createDirectories(targetDir);
 | 
			
		||||
                    }
 | 
			
		||||
                    // 组合目标文件名
 | 
			
		||||
                    String fileName = DesDesignConstant.getDesignChangeFileName(designChange);
 | 
			
		||||
                    // 保存修改后的文件
 | 
			
		||||
                    try (FileOutputStream fos = new FileOutputStream(targetDir.resolve(fileName).toFile())) {
 | 
			
		||||
                        document.write(fos);
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            } catch (IOException | InvalidFormatException e) {
 | 
			
		||||
                throw new OssException("生成Word文件失败,错误信息: " + e.getMessage());
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        // 设置响应头,返回ZIP文件
 | 
			
		||||
        response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE + "; charset=UTF-8");
 | 
			
		||||
        try (ZipOutputStream zos = new ZipOutputStream(response.getOutputStream())) {
 | 
			
		||||
            DocumentUtil.zipDirectory(targetDir, targetDir, zos);
 | 
			
		||||
            zos.flush();
 | 
			
		||||
        } catch (Exception e) {
 | 
			
		||||
            throw new OssException("生成ZIP文件失败,错误信息: " + e.getMessage());
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 新增设计变更管理
 | 
			
		||||
     *
 | 
			
		||||
     * @param req 设计变更管理
 | 
			
		||||
     * @return 新增设计变更管理主键id
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public Long insertByBo(DesDesignChangeCreateReq req) {
 | 
			
		||||
        DesDesignChange entity = new DesDesignChange();
 | 
			
		||||
        BeanUtils.copyProperties(req, entity);
 | 
			
		||||
        validEntityBeforeSave(entity, true);
 | 
			
		||||
        boolean save = this.save(entity);
 | 
			
		||||
        if (!save) {
 | 
			
		||||
            throw new ServiceException("新增设计变更失败", HttpStatus.ERROR);
 | 
			
		||||
        }
 | 
			
		||||
        return entity.getId();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 修改设计变更管理
 | 
			
		||||
     *
 | 
			
		||||
     * @param req 设计变更管理
 | 
			
		||||
     * @return 是否修改成功
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public Boolean updateByBo(DesDesignChangeUpdateReq req) {
 | 
			
		||||
        DesDesignChange entity = new DesDesignChange();
 | 
			
		||||
        BeanUtils.copyProperties(req, entity);
 | 
			
		||||
        validEntityBeforeSave(entity, false);
 | 
			
		||||
        boolean result = this.updateById(entity);
 | 
			
		||||
        if (!result) {
 | 
			
		||||
            throw new ServiceException("修改设计变更失败", HttpStatus.ERROR);
 | 
			
		||||
        }
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 保存前的数据校验
 | 
			
		||||
     */
 | 
			
		||||
    private void validEntityBeforeSave(DesDesignChange entity, Boolean create) {
 | 
			
		||||
        Long projectId = entity.getProjectId();
 | 
			
		||||
        if (create) {
 | 
			
		||||
            if (projectId == null) {
 | 
			
		||||
                throw new ServiceException("项目id不能为空", HttpStatus.BAD_REQUEST);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        if (projectId != null && projectService.getById(projectId) == null) {
 | 
			
		||||
            throw new ServiceException("对应项目不存在", HttpStatus.NOT_FOUND);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 校验并批量删除设计变更管理信息
 | 
			
		||||
     *
 | 
			
		||||
     * @param ids 待删除的主键集合
 | 
			
		||||
     * @return 是否删除成功
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    @Transactional(rollbackFor = Exception.class)
 | 
			
		||||
    public Boolean deleteByIds(Collection<Long> ids) {
 | 
			
		||||
        return removeBatchByIds(ids);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 构建设计变更管理封装对象
 | 
			
		||||
     *
 | 
			
		||||
     * @param designChange 设计变更管理
 | 
			
		||||
     * @return 设计变更管理封装对象
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public DesDesignChangeVo getVo(DesDesignChange designChange) {
 | 
			
		||||
        DesDesignChangeVo vo = new DesDesignChangeVo();
 | 
			
		||||
        if (designChange == null) {
 | 
			
		||||
            return vo;
 | 
			
		||||
        }
 | 
			
		||||
        BeanUtils.copyProperties(designChange, vo);
 | 
			
		||||
        List<Long> allFileIdList = new ArrayList<>();
 | 
			
		||||
        // 1. 添加单个 fileId(前提是非空)
 | 
			
		||||
        String fileId = designChange.getFileId();
 | 
			
		||||
        if (StringUtils.isNotBlank(fileId)) {
 | 
			
		||||
            allFileIdList.add(Long.valueOf(fileId));
 | 
			
		||||
        }
 | 
			
		||||
        // 2. 添加 attachmentPic 多个 ID
 | 
			
		||||
        String attachmentPic = designChange.getAttachmentPic();
 | 
			
		||||
        if (StringUtils.isNotBlank(attachmentPic)) {
 | 
			
		||||
            String[] attachmentPicStr = attachmentPic.split(",");
 | 
			
		||||
            for (String idStr : attachmentPicStr) {
 | 
			
		||||
                if (StringUtils.isNotBlank(idStr)) {
 | 
			
		||||
                    allFileIdList.add(Long.valueOf(idStr.trim()));
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        // 3. 添加 costEstimationFile 多个 ID
 | 
			
		||||
        String costEstimationFile = designChange.getCostEstimationFile();
 | 
			
		||||
        if (StringUtils.isNotBlank(costEstimationFile)) {
 | 
			
		||||
            String[] costEstimationFileStr = costEstimationFile.split(",");
 | 
			
		||||
            for (String idStr : costEstimationFileStr) {
 | 
			
		||||
                if (StringUtils.isNotBlank(idStr)) {
 | 
			
		||||
                    allFileIdList.add(Long.valueOf(idStr.trim()));
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        if (CollUtil.isNotEmpty(allFileIdList)) {
 | 
			
		||||
            // 获取文件对象
 | 
			
		||||
            List<SysOssVo> ossVoList = ossService.listByIds(allFileIdList);
 | 
			
		||||
            Map<Long, SysOssVo> ossMap = ossVoList.stream()
 | 
			
		||||
                .collect(Collectors.toMap(SysOssVo::getOssId, Function.identity(), (a, b) -> a));
 | 
			
		||||
            // 1. 处理 file(单个)
 | 
			
		||||
            if (StringUtils.isNotBlank(fileId)) {
 | 
			
		||||
                Long file = Long.valueOf(fileId);
 | 
			
		||||
                SysOssVo fileVo = ossMap.get(file);
 | 
			
		||||
                vo.setFile(fileVo);
 | 
			
		||||
            }
 | 
			
		||||
            // 2. 处理 attachmentPicList(多个)
 | 
			
		||||
            if (StringUtils.isNotBlank(attachmentPic)) {
 | 
			
		||||
                List<SysOssVo> attachmentList = Arrays.stream(attachmentPic.split(","))
 | 
			
		||||
                    .map(String::trim)
 | 
			
		||||
                    .filter(StringUtils::isNotBlank)
 | 
			
		||||
                    .map(Long::valueOf)
 | 
			
		||||
                    .map(ossMap::get)
 | 
			
		||||
                    .filter(Objects::nonNull)
 | 
			
		||||
                    .collect(Collectors.toList());
 | 
			
		||||
                vo.setAttachmentPicList(attachmentList);
 | 
			
		||||
            }
 | 
			
		||||
            // 3. 处理 costEstimationFileList(多个)
 | 
			
		||||
            if (StringUtils.isNotBlank(costEstimationFile)) {
 | 
			
		||||
                List<SysOssVo> costList = Arrays.stream(costEstimationFile.split(","))
 | 
			
		||||
                    .map(String::trim)
 | 
			
		||||
                    .filter(StringUtils::isNotBlank)
 | 
			
		||||
                    .map(Long::valueOf)
 | 
			
		||||
                    .map(ossMap::get)
 | 
			
		||||
                    .filter(Objects::nonNull)
 | 
			
		||||
                    .collect(Collectors.toList());
 | 
			
		||||
                vo.setCostEstimationFileList(costList);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return vo;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 构建查询条件
 | 
			
		||||
     *
 | 
			
		||||
     * @param req 查询条件
 | 
			
		||||
     * @return 查询条件
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public LambdaQueryWrapper<DesDesignChange> buildQueryWrapper(DesDesignChangeQueryReq req) {
 | 
			
		||||
        LambdaQueryWrapper<DesDesignChange> lqw = new LambdaQueryWrapper<>();
 | 
			
		||||
        if (req == null) {
 | 
			
		||||
            return lqw;
 | 
			
		||||
        }
 | 
			
		||||
        Long projectId = req.getProjectId();
 | 
			
		||||
        String formNo = req.getFormNo();
 | 
			
		||||
        String projectName = req.getProjectName();
 | 
			
		||||
        String submitUnit = req.getSubmitUnit();
 | 
			
		||||
        String specialty = req.getSpecialty();
 | 
			
		||||
        Date submitDate = req.getSubmitDate();
 | 
			
		||||
        String volumeName = req.getVolumeName();
 | 
			
		||||
        String volumeNo = req.getVolumeNo();
 | 
			
		||||
        String status = req.getStatus();
 | 
			
		||||
        lqw.eq(ObjectUtils.isNotEmpty(projectId), DesDesignChange::getProjectId, projectId);
 | 
			
		||||
        lqw.eq(ObjectUtils.isNotEmpty(formNo), DesDesignChange::getFormNo, formNo);
 | 
			
		||||
        lqw.eq(ObjectUtils.isNotEmpty(submitDate), DesDesignChange::getSubmitDate, submitDate);
 | 
			
		||||
        lqw.eq(StringUtils.isNotEmpty(status), DesDesignChange::getStatus, status);
 | 
			
		||||
        lqw.like(StringUtils.isNotEmpty(projectName), DesDesignChange::getProjectName, projectName);
 | 
			
		||||
        lqw.like(StringUtils.isNotEmpty(submitUnit), DesDesignChange::getSubmitUnit, submitUnit);
 | 
			
		||||
        lqw.like(StringUtils.isNotEmpty(specialty), DesDesignChange::getSpecialty, specialty);
 | 
			
		||||
        lqw.like(StringUtils.isNotEmpty(volumeName), DesDesignChange::getVolumeName, volumeName);
 | 
			
		||||
        lqw.like(StringUtils.isNotEmpty(volumeNo), DesDesignChange::getVolumeNo, volumeNo);
 | 
			
		||||
        return lqw;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取设计变更管理对象视图
 | 
			
		||||
     *
 | 
			
		||||
     * @param designChangePage 设计变更管理对象
 | 
			
		||||
     * @return 设计变更管理对象视图
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public Page<DesDesignChangeVo> getVoPage(Page<DesDesignChange> designChangePage) {
 | 
			
		||||
        List<DesDesignChange> designChangeList = designChangePage.getRecords();
 | 
			
		||||
        Page<DesDesignChangeVo> designChangeVoPage = new Page<>(
 | 
			
		||||
            designChangePage.getCurrent(),
 | 
			
		||||
            designChangePage.getSize(),
 | 
			
		||||
            designChangePage.getTotal());
 | 
			
		||||
        if (CollUtil.isEmpty(designChangeList)) {
 | 
			
		||||
            return designChangeVoPage;
 | 
			
		||||
        }
 | 
			
		||||
        // todo 待优化
 | 
			
		||||
        List<DesDesignChangeVo> designChangeVoList = designChangeList.stream().map(this::getVo).toList();
 | 
			
		||||
        designChangeVoPage.setRecords(designChangeVoList);
 | 
			
		||||
        return designChangeVoPage;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据实体获取Word的文本Map
 | 
			
		||||
     *
 | 
			
		||||
     * @param designChange 质量-检查工单对象
 | 
			
		||||
     * @return Map
 | 
			
		||||
     */
 | 
			
		||||
    private Map<String, String> getReplacementMap(DesDesignChange designChange) {
 | 
			
		||||
        Map<String, String> replacementMap = new HashMap<>();
 | 
			
		||||
        replacementMap.put("${formNo}", designChange.getFormNo());
 | 
			
		||||
        replacementMap.put("${projectName}", designChange.getProjectName());
 | 
			
		||||
        replacementMap.put("${submitUnit}", designChange.getSubmitUnit());
 | 
			
		||||
        replacementMap.put("${specialty}", designChange.getSpecialty());
 | 
			
		||||
        Date submitDate = designChange.getSubmitDate();
 | 
			
		||||
        String date = DateUtil.format(submitDate, "yyyy年MM月dd日");
 | 
			
		||||
        replacementMap.put("${submitDate}", date);
 | 
			
		||||
        replacementMap.put("${attachmentPic}", designChange.getAttachmentPic());
 | 
			
		||||
        replacementMap.put("${volumeName}", designChange.getVolumeName());
 | 
			
		||||
        replacementMap.put("${volumeNo}", designChange.getVolumeNo());
 | 
			
		||||
        String[] reasonList = designChange.getChangeReason().split(",");
 | 
			
		||||
        Set<String> reasonSet = new HashSet<>(Arrays.asList(reasonList));
 | 
			
		||||
        for (int i = 1; i <= 8; i++) {
 | 
			
		||||
            if (reasonSet.contains(String.valueOf(i))) {
 | 
			
		||||
                replacementMap.put("${changeReason" + i + "}", "√");
 | 
			
		||||
            } else {
 | 
			
		||||
                replacementMap.put("${changeReason" + i + "}", "  ");
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        replacementMap.put("${changeContent}", designChange.getChangeContent());
 | 
			
		||||
        replacementMap.put("${costEstimation}", designChange.getCostEstimation());
 | 
			
		||||
        replacementMap.put("${costEstimationFile}", designChange.getCostEstimationFile());
 | 
			
		||||
        return replacementMap;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 替换段落中所有文本运行的占位符内容,对于 checkFile 和 rectificationFile
 | 
			
		||||
     * 插入图片或超链接(附件)展示。
 | 
			
		||||
     *
 | 
			
		||||
     * @param paragraph    当前段落
 | 
			
		||||
     * @param replacements 占位符与替换内容的映射
 | 
			
		||||
     * @param document     当前文档,用于插入图片或创建超链接
 | 
			
		||||
     */
 | 
			
		||||
    private void replaceInParagraph(XWPFParagraph paragraph,
 | 
			
		||||
                                    Map<String, String> replacements,
 | 
			
		||||
                                    XWPFDocument document,
 | 
			
		||||
                                    DesDesignChange designChange)
 | 
			
		||||
        throws InvalidFormatException, IOException {
 | 
			
		||||
        // 先拷贝 paragraph 里所有的 run
 | 
			
		||||
        List<XWPFRun> runs = new ArrayList<>(paragraph.getRuns());
 | 
			
		||||
        // 在拷贝上遍历,修改原 paragraph(增删 run)都不会抛 CME
 | 
			
		||||
        for (XWPFRun run : runs) {
 | 
			
		||||
            String text = run.getText(0);
 | 
			
		||||
            if (text != null) {
 | 
			
		||||
                // 针对每个占位符进行检查
 | 
			
		||||
                for (Map.Entry<String, String> entry : replacements.entrySet()) {
 | 
			
		||||
                    String placeholder = entry.getKey();
 | 
			
		||||
                    String value = entry.getValue();
 | 
			
		||||
                    if (text.contains(placeholder)) {
 | 
			
		||||
                        // 针对 file 进行特殊处理
 | 
			
		||||
                        if (placeholder.equals("${costEstimationFile}") || placeholder.equals("${attachmentPic}")) {
 | 
			
		||||
                            // 判断该 run 中的文本是否仅包含该占位符(建议模板中独占一行)
 | 
			
		||||
                            if (text.trim().equals(placeholder)) {
 | 
			
		||||
                                // 清空原有文本
 | 
			
		||||
                                run.setText("", 0);
 | 
			
		||||
                                // 根据附件的后缀决定以图片或超链接展示
 | 
			
		||||
                                if (StringUtils.isBlank(value)) {
 | 
			
		||||
                                    continue;
 | 
			
		||||
                                }
 | 
			
		||||
                                // 获取附件的ossId
 | 
			
		||||
                                List<Long> ossIdList = Arrays.stream(value.split(",")).map(Long::parseLong).toList();
 | 
			
		||||
                                List<SysOssVo> ossVoList = ossService.listByIds(ossIdList);
 | 
			
		||||
                                String baseFile = DesDesignConstant.getDesignChangeFileUrl(designChange) + "/file";
 | 
			
		||||
                                for (SysOssVo ossVo : ossVoList) {
 | 
			
		||||
                                    String lowerVal = ossVo.getUrl().toLowerCase();
 | 
			
		||||
                                    OssClient storage = OssFactory.instance(ossVo.getService());
 | 
			
		||||
                                    String fileDownload = storage.fileDownload(ossVo.getUrl(), ossVo.getOriginalName(), baseFile);
 | 
			
		||||
                                    if (lowerVal.endsWith(".png") || lowerVal.endsWith(".jpg") || lowerVal.endsWith(".jpeg") || lowerVal.endsWith(".gif")) {
 | 
			
		||||
                                        try {
 | 
			
		||||
                                            DocumentUtil.insertImageDynamic(run, fileDownload, document, 50);
 | 
			
		||||
                                        } catch (Exception e) {
 | 
			
		||||
                                            throw new ServiceException("插入图片失败");
 | 
			
		||||
                                        }
 | 
			
		||||
                                    } else {
 | 
			
		||||
                                        // —— 非图片:插入超链接 ——
 | 
			
		||||
                                        XWPFHyperlinkRun link = paragraph.createHyperlinkRun(ossVo.getUrl());
 | 
			
		||||
                                        link.setText(ossVo.getOriginalName());
 | 
			
		||||
                                        link.setColor("0000FF");
 | 
			
		||||
                                        link.setUnderline(UnderlinePatterns.SINGLE);
 | 
			
		||||
                                    }
 | 
			
		||||
                                }
 | 
			
		||||
                            } else {
 | 
			
		||||
                                // 如果占位符与其它文本混合,可进行文本替换,提示附件展示请单独使用占位符
 | 
			
		||||
                                text = text.replace(placeholder, "[附件]");
 | 
			
		||||
                                run.setText(text, 0);
 | 
			
		||||
                            }
 | 
			
		||||
                        } else {
 | 
			
		||||
                            // 普通文本占位符直接替换
 | 
			
		||||
                            if (StringUtils.isBlank(value)) {
 | 
			
		||||
                                // 如果填入值为空,清空原有文本
 | 
			
		||||
                                run.setText("", 0);
 | 
			
		||||
                                continue;
 | 
			
		||||
                            }
 | 
			
		||||
                            text = text.replace(placeholder, value);
 | 
			
		||||
                            run.setText(text, 0);
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -3,7 +3,6 @@ package org.dromara.design.service.impl;
 | 
			
		||||
import cn.hutool.core.collection.CollUtil;
 | 
			
		||||
import cn.hutool.core.convert.Convert;
 | 
			
		||||
import cn.hutool.core.io.FileUtil;
 | 
			
		||||
import cn.hutool.core.util.IdUtil;
 | 
			
		||||
import cn.hutool.core.util.ObjectUtil;
 | 
			
		||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 | 
			
		||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 | 
			
		||||
@ -16,12 +15,11 @@ import org.dromara.common.core.domain.event.ProcessEvent;
 | 
			
		||||
import org.dromara.common.core.domain.event.ProcessTaskEvent;
 | 
			
		||||
import org.dromara.common.core.enums.BusinessStatusEnum;
 | 
			
		||||
import org.dromara.common.core.exception.ServiceException;
 | 
			
		||||
import org.dromara.common.core.utils.DateUtils;
 | 
			
		||||
import org.dromara.common.core.service.WorkflowService;
 | 
			
		||||
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.design.constant.DesDrawingConstant;
 | 
			
		||||
import org.dromara.design.domain.DesDrawing;
 | 
			
		||||
import org.dromara.design.domain.dto.drawing.DesDrawingCreateReq;
 | 
			
		||||
import org.dromara.design.domain.dto.drawing.DesDrawingQueryReq;
 | 
			
		||||
@ -32,16 +30,15 @@ import org.dromara.design.enums.DesDrawingNewestEnum;
 | 
			
		||||
import org.dromara.design.mapper.DesDrawingMapper;
 | 
			
		||||
import org.dromara.design.service.IDesDrawingService;
 | 
			
		||||
import org.dromara.project.service.IBusProjectService;
 | 
			
		||||
import org.dromara.system.domain.vo.SysOssUploadVo;
 | 
			
		||||
import org.dromara.system.domain.vo.SysOssVo;
 | 
			
		||||
import org.dromara.system.service.ISysOssService;
 | 
			
		||||
import org.springframework.beans.BeanUtils;
 | 
			
		||||
import org.springframework.context.event.EventListener;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
import org.springframework.transaction.annotation.Transactional;
 | 
			
		||||
import org.springframework.web.multipart.MultipartFile;
 | 
			
		||||
 | 
			
		||||
import java.util.Collection;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
import java.util.*;
 | 
			
		||||
import java.util.stream.Collectors;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 图纸管理Service业务层处理
 | 
			
		||||
@ -60,6 +57,9 @@ public class DesDrawingServiceImpl extends ServiceImpl<DesDrawingMapper, DesDraw
 | 
			
		||||
    @Resource
 | 
			
		||||
    private ISysOssService ossService;
 | 
			
		||||
 | 
			
		||||
    @Resource
 | 
			
		||||
    private WorkflowService workflowService;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询图纸管理
 | 
			
		||||
     *
 | 
			
		||||
@ -104,15 +104,16 @@ public class DesDrawingServiceImpl extends ServiceImpl<DesDrawingMapper, DesDraw
 | 
			
		||||
    /**
 | 
			
		||||
     * 新增图纸管理
 | 
			
		||||
     *
 | 
			
		||||
     * @param file 文件
 | 
			
		||||
     * @param req  图纸管理
 | 
			
		||||
     * @param req 图纸管理
 | 
			
		||||
     * @return 新增图纸管理主键id
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    @Transactional(rollbackFor = Exception.class)
 | 
			
		||||
    public DesDrawingVo insertByBo(MultipartFile file, DesDrawingCreateReq req) {
 | 
			
		||||
    public DesDrawingVo insertByBo(DesDrawingCreateReq req) {
 | 
			
		||||
        Long fileUrl = req.getFileUrl();
 | 
			
		||||
        SysOssVo ossVo = ossService.getById(fileUrl);
 | 
			
		||||
        // 数据校验
 | 
			
		||||
        if (ObjectUtils.isEmpty(file)) {
 | 
			
		||||
        if (ObjectUtils.isEmpty(ossVo)) {
 | 
			
		||||
            throw new ServiceException("图纸文件不能为空", HttpStatus.BAD_REQUEST);
 | 
			
		||||
        }
 | 
			
		||||
        Long projectId = req.getProjectId();
 | 
			
		||||
@ -124,30 +125,17 @@ public class DesDrawingServiceImpl extends ServiceImpl<DesDrawingMapper, DesDraw
 | 
			
		||||
        if (StringUtils.isBlank(enumText)) {
 | 
			
		||||
            throw new ServiceException("图纸文件类型错误", HttpStatus.BAD_REQUEST);
 | 
			
		||||
        }
 | 
			
		||||
        // 拼接文件名
 | 
			
		||||
        String originalFilename = file.getOriginalFilename();
 | 
			
		||||
        String suffix = FileUtil.getSuffix(originalFilename);
 | 
			
		||||
        if (StringUtils.isBlank(suffix)) {
 | 
			
		||||
            throw new ServiceException("图纸文件格式错误", HttpStatus.BAD_REQUEST);
 | 
			
		||||
        }
 | 
			
		||||
        String date = DateUtils.getDate();
 | 
			
		||||
        String uuid = IdUtil.fastSimpleUUID();
 | 
			
		||||
        String fileName = String.format("%s_%s.%s", date, uuid, suffix);
 | 
			
		||||
        // 拼接文件路径
 | 
			
		||||
        String filePath = DesDrawingConstant.getProjectOssPrefix(projectId) + fileName;
 | 
			
		||||
        // 上传文件
 | 
			
		||||
        SysOssUploadVo ossUploadVo = ossService.uploadWithNoSave(file, filePath);
 | 
			
		||||
        // 文件信息赋值
 | 
			
		||||
        DesDrawing desDrawing = new DesDrawing();
 | 
			
		||||
        desDrawing.setProjectId(projectId);
 | 
			
		||||
        desDrawing.setOriginalName(originalFilename);
 | 
			
		||||
        desDrawing.setOriginalName(ossVo.getOriginalName());
 | 
			
		||||
        String name = req.getFileName();
 | 
			
		||||
        if (StringUtils.isBlank(name)) {
 | 
			
		||||
            name = FileUtil.getPrefix(originalFilename);
 | 
			
		||||
            name = FileUtil.getPrefix(ossVo.getOriginalName());
 | 
			
		||||
        }
 | 
			
		||||
        desDrawing.setFileName(name);
 | 
			
		||||
        desDrawing.setFileUrl(ossUploadVo.getUrl());
 | 
			
		||||
        desDrawing.setFileSuffix(suffix);
 | 
			
		||||
        desDrawing.setFileUrl(fileUrl);
 | 
			
		||||
        desDrawing.setFileSuffix(ossVo.getFileSuffix());
 | 
			
		||||
        desDrawing.setVersionNumber(req.getVersionNumber());
 | 
			
		||||
        desDrawing.setFileType(fileType);
 | 
			
		||||
        desDrawing.setNewest(DesDrawingNewestEnum.YES.getCode());
 | 
			
		||||
@ -175,10 +163,10 @@ public class DesDrawingServiceImpl extends ServiceImpl<DesDrawingMapper, DesDraw
 | 
			
		||||
     * 修改图纸管理
 | 
			
		||||
     *
 | 
			
		||||
     * @param req 图纸管理
 | 
			
		||||
     * @return 是否修改成功
 | 
			
		||||
     * @return 图纸管理
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public Boolean updateByBo(DesDrawingUpdateReq req) {
 | 
			
		||||
    public DesDrawingVo updateByBo(DesDrawingUpdateReq req) {
 | 
			
		||||
        Long id = req.getId();
 | 
			
		||||
        DesDrawing oldDrawing = this.getById(id);
 | 
			
		||||
        if (oldDrawing == null) {
 | 
			
		||||
@ -190,7 +178,7 @@ public class DesDrawingServiceImpl extends ServiceImpl<DesDrawingMapper, DesDraw
 | 
			
		||||
        if (!result) {
 | 
			
		||||
            throw new ServiceException("修改图纸失败", HttpStatus.ERROR);
 | 
			
		||||
        }
 | 
			
		||||
        return true;
 | 
			
		||||
        return this.getVo(this.getById(id));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@ -200,8 +188,17 @@ public class DesDrawingServiceImpl extends ServiceImpl<DesDrawingMapper, DesDraw
 | 
			
		||||
     * @return 是否删除成功
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    @Transactional(rollbackFor = Exception.class)
 | 
			
		||||
    public Boolean deleteByIds(Collection<Long> ids) {
 | 
			
		||||
        return baseMapper.deleteByIds(ids) > 0;
 | 
			
		||||
        List<DesDrawing> drawingList = this.listByIds(ids);
 | 
			
		||||
        if (CollUtil.isEmpty(drawingList)) {
 | 
			
		||||
            throw new ServiceException("参数错误,请勿删除不存在的图纸", HttpStatus.BAD_REQUEST);
 | 
			
		||||
        }
 | 
			
		||||
        workflowService.deleteInstance((List<Long>) ids);
 | 
			
		||||
        // 删除oss文件
 | 
			
		||||
        Set<Long> fileIdList = drawingList.stream().map(DesDrawing::getFileUrl).collect(Collectors.toSet());
 | 
			
		||||
        ossService.deleteWithValidByIds(fileIdList, false);
 | 
			
		||||
        return removeBatchByIds(ids);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@ -216,7 +213,9 @@ public class DesDrawingServiceImpl extends ServiceImpl<DesDrawingMapper, DesDraw
 | 
			
		||||
        if (drawing == null) {
 | 
			
		||||
            return vo;
 | 
			
		||||
        }
 | 
			
		||||
        SysOssVo ossVo = ossService.getById(drawing.getFileUrl());
 | 
			
		||||
        BeanUtils.copyProperties(drawing, vo);
 | 
			
		||||
        vo.setFile(ossVo);
 | 
			
		||||
        return vo;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -244,6 +243,8 @@ public class DesDrawingServiceImpl extends ServiceImpl<DesDrawingMapper, DesDraw
 | 
			
		||||
        lqw.eq(StringUtils.isNotBlank(fileType), DesDrawing::getFileType, fileType);
 | 
			
		||||
        lqw.eq(StringUtils.isNotBlank(fileStatus), DesDrawing::getFileStatus, fileStatus);
 | 
			
		||||
        lqw.eq(StringUtils.isNotBlank(newest), DesDrawing::getNewest, newest);
 | 
			
		||||
        lqw.orderByDesc(DesDrawing::getNewest);
 | 
			
		||||
        lqw.orderByDesc(DesDrawing::getCreateTime);
 | 
			
		||||
        return lqw;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -263,9 +264,12 @@ public class DesDrawingServiceImpl extends ServiceImpl<DesDrawingMapper, DesDraw
 | 
			
		||||
        if (CollUtil.isEmpty(drawingList)) {
 | 
			
		||||
            return drawingVoPage;
 | 
			
		||||
        }
 | 
			
		||||
        List<SysOssVo> ossVoList = ossService.listByIds(drawingList.stream().map(DesDrawing::getFileUrl).toList());
 | 
			
		||||
        Map<Long, List<SysOssVo>> ossMap = ossVoList.stream().collect(Collectors.groupingBy(SysOssVo::getOssId));
 | 
			
		||||
        List<DesDrawingVo> drawingVoList = drawingList.stream().map(entity -> {
 | 
			
		||||
            DesDrawingVo drawingVo = new DesDrawingVo();
 | 
			
		||||
            BeanUtils.copyProperties(entity, drawingVo);
 | 
			
		||||
            drawingVo.setFile(ossMap.get(entity.getFileUrl()).getFirst());
 | 
			
		||||
            return drawingVo;
 | 
			
		||||
        }).toList();
 | 
			
		||||
        drawingVoPage.setRecords(drawingVoList);
 | 
			
		||||
@ -319,7 +323,9 @@ public class DesDrawingServiceImpl extends ServiceImpl<DesDrawingMapper, DesDraw
 | 
			
		||||
        if (ObjectUtil.isNull(drawing)) {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
        baseMapper.deleteById(drawing.getId());
 | 
			
		||||
        Long fileUrl = drawing.getFileUrl();
 | 
			
		||||
        ossService.deleteWithValidByIds(fileUrl == null ? Collections.emptyList() : Collections.singletonList(fileUrl), false);
 | 
			
		||||
        this.removeById(drawing.getId());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,303 @@
 | 
			
		||||
package org.dromara.design.service.impl;
 | 
			
		||||
 | 
			
		||||
import cn.hutool.core.collection.CollUtil;
 | 
			
		||||
import cn.hutool.core.convert.Convert;
 | 
			
		||||
import cn.hutool.core.io.FileUtil;
 | 
			
		||||
import cn.hutool.core.util.ObjectUtil;
 | 
			
		||||
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.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.enums.BusinessStatusEnum;
 | 
			
		||||
import org.dromara.common.core.exception.ServiceException;
 | 
			
		||||
import org.dromara.common.core.service.WorkflowService;
 | 
			
		||||
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.design.domain.DesSpecialScheme;
 | 
			
		||||
import org.dromara.design.domain.dto.specialscheme.DesSpecialSchemeCreateReq;
 | 
			
		||||
import org.dromara.design.domain.dto.specialscheme.DesSpecialSchemeQueryReq;
 | 
			
		||||
import org.dromara.design.domain.dto.specialscheme.DesSpecialSchemeUpdateReq;
 | 
			
		||||
import org.dromara.design.domain.vo.specialscheme.DesSpecialSchemeVo;
 | 
			
		||||
import org.dromara.design.mapper.DesSpecialSchemeMapper;
 | 
			
		||||
import org.dromara.design.service.IDesSpecialSchemeService;
 | 
			
		||||
import org.dromara.project.service.IBusProjectService;
 | 
			
		||||
import org.dromara.system.domain.vo.SysOssVo;
 | 
			
		||||
import org.dromara.system.service.ISysOssService;
 | 
			
		||||
import org.springframework.beans.BeanUtils;
 | 
			
		||||
import org.springframework.context.event.EventListener;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
import org.springframework.transaction.annotation.Transactional;
 | 
			
		||||
 | 
			
		||||
import java.util.Collection;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
import java.util.Map;
 | 
			
		||||
import java.util.Set;
 | 
			
		||||
import java.util.stream.Collectors;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 专项方案管理Service业务层处理
 | 
			
		||||
 *
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025-07-03
 | 
			
		||||
 */
 | 
			
		||||
@Slf4j
 | 
			
		||||
@Service
 | 
			
		||||
public class DesSpecialSchemeServiceImpl extends ServiceImpl<DesSpecialSchemeMapper, DesSpecialScheme>
 | 
			
		||||
    implements IDesSpecialSchemeService {
 | 
			
		||||
    @Resource
 | 
			
		||||
    private IBusProjectService projectService;
 | 
			
		||||
 | 
			
		||||
    @Resource
 | 
			
		||||
    private ISysOssService ossService;
 | 
			
		||||
 | 
			
		||||
    @Resource
 | 
			
		||||
    private WorkflowService workflowService;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询图纸管理
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 主键
 | 
			
		||||
     * @return 图纸管理
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public DesSpecialSchemeVo queryById(Long id) {
 | 
			
		||||
        DesSpecialScheme specialScheme = this.getById(id);
 | 
			
		||||
        if (specialScheme == null) {
 | 
			
		||||
            throw new ServiceException("图纸不存在", HttpStatus.NOT_FOUND);
 | 
			
		||||
        }
 | 
			
		||||
        return this.getVo(specialScheme);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 分页查询图纸管理列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param req       查询条件
 | 
			
		||||
     * @param pageQuery 分页参数
 | 
			
		||||
     * @return 图纸管理分页列表
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public TableDataInfo<DesSpecialSchemeVo> queryPageList(DesSpecialSchemeQueryReq req, PageQuery pageQuery) {
 | 
			
		||||
        LambdaQueryWrapper<DesSpecialScheme> lqw = buildQueryWrapper(req);
 | 
			
		||||
        Page<DesSpecialScheme> result = this.page(pageQuery.build(), lqw);
 | 
			
		||||
        return TableDataInfo.build(this.getVoPage(result));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询符合条件的图纸管理列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param req 查询条件
 | 
			
		||||
     * @return 图纸管理列表
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<DesSpecialSchemeVo> queryList(DesSpecialSchemeQueryReq req) {
 | 
			
		||||
        LambdaQueryWrapper<DesSpecialScheme> lqw = buildQueryWrapper(req);
 | 
			
		||||
        return this.list(lqw).stream().map(this::getVo).toList();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 新增图纸管理
 | 
			
		||||
     *
 | 
			
		||||
     * @param req 图纸管理
 | 
			
		||||
     * @return 新增图纸管理
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    @Transactional(rollbackFor = Exception.class)
 | 
			
		||||
    public DesSpecialSchemeVo insertByBo(DesSpecialSchemeCreateReq req) {
 | 
			
		||||
        Long fileUrl = req.getFileUrl();
 | 
			
		||||
        SysOssVo ossVo = ossService.getById(fileUrl);
 | 
			
		||||
        // 数据校验
 | 
			
		||||
        if (ObjectUtils.isEmpty(ossVo)) {
 | 
			
		||||
            throw new ServiceException("图纸文件不能为空", HttpStatus.BAD_REQUEST);
 | 
			
		||||
        }
 | 
			
		||||
        Long projectId = req.getProjectId();
 | 
			
		||||
        if (projectService.getById(projectId) == null) {
 | 
			
		||||
            throw new ServiceException("项目不存在", HttpStatus.BAD_REQUEST);
 | 
			
		||||
        }
 | 
			
		||||
        // 文件信息赋值
 | 
			
		||||
        DesSpecialScheme desSpecialScheme = new DesSpecialScheme();
 | 
			
		||||
        desSpecialScheme.setProjectId(projectId);
 | 
			
		||||
        desSpecialScheme.setOriginalName(ossVo.getOriginalName());
 | 
			
		||||
        String name = req.getFileName();
 | 
			
		||||
        if (StringUtils.isBlank(name)) {
 | 
			
		||||
            name = FileUtil.getPrefix(ossVo.getOriginalName());
 | 
			
		||||
        }
 | 
			
		||||
        desSpecialScheme.setFileName(name);
 | 
			
		||||
        desSpecialScheme.setFileUrl(fileUrl);
 | 
			
		||||
        desSpecialScheme.setFileSuffix(ossVo.getFileSuffix());
 | 
			
		||||
        desSpecialScheme.setVersionNumber(req.getVersionNumber());
 | 
			
		||||
        boolean result = this.save(desSpecialScheme);
 | 
			
		||||
        if (!result) {
 | 
			
		||||
            throw new ServiceException("保存新图纸失败");
 | 
			
		||||
        }
 | 
			
		||||
        return this.getVo(this.getById(desSpecialScheme.getId()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 修改图纸管理
 | 
			
		||||
     *
 | 
			
		||||
     * @param req 图纸管理
 | 
			
		||||
     * @return 是否修改成功
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public DesSpecialSchemeVo updateByBo(DesSpecialSchemeUpdateReq req) {
 | 
			
		||||
        Long id = req.getId();
 | 
			
		||||
        DesSpecialScheme oldSpecialScheme = this.getById(id);
 | 
			
		||||
        if (oldSpecialScheme == null) {
 | 
			
		||||
            throw new ServiceException("图纸不存在", HttpStatus.NOT_FOUND);
 | 
			
		||||
        }
 | 
			
		||||
        DesSpecialScheme desSpecialScheme = new DesSpecialScheme();
 | 
			
		||||
        BeanUtils.copyProperties(req, desSpecialScheme);
 | 
			
		||||
        boolean result = this.updateById(desSpecialScheme);
 | 
			
		||||
        if (!result) {
 | 
			
		||||
            throw new ServiceException("修改图纸失败", HttpStatus.ERROR);
 | 
			
		||||
        }
 | 
			
		||||
        return this.getVo(this.getById(id));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 校验并批量删除图纸管理信息
 | 
			
		||||
     *
 | 
			
		||||
     * @param ids 待删除的主键集合
 | 
			
		||||
     * @return 是否删除成功
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    @Transactional(rollbackFor = Exception.class)
 | 
			
		||||
    public Boolean deleteByIds(Collection<Long> ids) {
 | 
			
		||||
        List<DesSpecialScheme> specialSchemeList = this.listByIds(ids);
 | 
			
		||||
        if (CollUtil.isEmpty(specialSchemeList)) {
 | 
			
		||||
            throw new ServiceException("参数错误,请勿删除不存在的图纸", HttpStatus.BAD_REQUEST);
 | 
			
		||||
        }
 | 
			
		||||
        workflowService.deleteInstance((List<Long>) ids);
 | 
			
		||||
        // 删除oss文件
 | 
			
		||||
        Set<Long> fileIdList = specialSchemeList.stream().map(DesSpecialScheme::getFileUrl).collect(Collectors.toSet());
 | 
			
		||||
        ossService.deleteWithValidByIds(fileIdList, false);
 | 
			
		||||
        return removeBatchByIds(ids);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 构建图纸管理封装对象
 | 
			
		||||
     *
 | 
			
		||||
     * @param specialScheme 图纸管理
 | 
			
		||||
     * @return 图纸管理封装对象
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public DesSpecialSchemeVo getVo(DesSpecialScheme specialScheme) {
 | 
			
		||||
        DesSpecialSchemeVo vo = new DesSpecialSchemeVo();
 | 
			
		||||
        if (specialScheme == null) {
 | 
			
		||||
            return vo;
 | 
			
		||||
        }
 | 
			
		||||
        BeanUtils.copyProperties(specialScheme, vo);
 | 
			
		||||
        SysOssVo ossVo = ossService.getById(specialScheme.getFileUrl());
 | 
			
		||||
        vo.setFile(ossVo);
 | 
			
		||||
        return vo;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 构建查询条件
 | 
			
		||||
     *
 | 
			
		||||
     * @param req 查询条件
 | 
			
		||||
     * @return 查询条件
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public LambdaQueryWrapper<DesSpecialScheme> buildQueryWrapper(DesSpecialSchemeQueryReq req) {
 | 
			
		||||
        LambdaQueryWrapper<DesSpecialScheme> lqw = new LambdaQueryWrapper<>();
 | 
			
		||||
        if (req == null) {
 | 
			
		||||
            return lqw;
 | 
			
		||||
        }
 | 
			
		||||
        Long projectId = req.getProjectId();
 | 
			
		||||
        String fileName = req.getFileName();
 | 
			
		||||
        String fileStatus = req.getFileStatus();
 | 
			
		||||
        String originalName = req.getOriginalName();
 | 
			
		||||
        lqw.like(StringUtils.isNotBlank(fileName), DesSpecialScheme::getFileName, fileName);
 | 
			
		||||
        lqw.like(StringUtils.isNotBlank(originalName), DesSpecialScheme::getOriginalName, originalName);
 | 
			
		||||
        lqw.eq(ObjectUtils.isNotEmpty(projectId), DesSpecialScheme::getProjectId, projectId);
 | 
			
		||||
        lqw.eq(StringUtils.isNotBlank(fileStatus), DesSpecialScheme::getFileStatus, fileStatus);
 | 
			
		||||
        lqw.orderByDesc(DesSpecialScheme::getCreateTime);
 | 
			
		||||
        return lqw;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取图纸管理对象视图
 | 
			
		||||
     *
 | 
			
		||||
     * @param specialSchemePage 图纸管理对象
 | 
			
		||||
     * @return 图纸管理对象视图
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public Page<DesSpecialSchemeVo> getVoPage(Page<DesSpecialScheme> specialSchemePage) {
 | 
			
		||||
        List<DesSpecialScheme> specialSchemeList = specialSchemePage.getRecords();
 | 
			
		||||
        Page<DesSpecialSchemeVo> specialSchemeVoPage = new Page<>(
 | 
			
		||||
            specialSchemePage.getCurrent(),
 | 
			
		||||
            specialSchemePage.getSize(),
 | 
			
		||||
            specialSchemePage.getTotal());
 | 
			
		||||
        if (CollUtil.isEmpty(specialSchemeList)) {
 | 
			
		||||
            return specialSchemeVoPage;
 | 
			
		||||
        }
 | 
			
		||||
        List<SysOssVo> ossVoList = ossService.listByIds(specialSchemeList.stream().map(DesSpecialScheme::getFileUrl).toList());
 | 
			
		||||
        Map<Long, List<SysOssVo>> ossMap = ossVoList.stream().collect(Collectors.groupingBy(SysOssVo::getOssId));
 | 
			
		||||
        List<DesSpecialSchemeVo> specialSchemeVoList = specialSchemeList.stream().map(entity -> {
 | 
			
		||||
            DesSpecialSchemeVo specialSchemeVo = new DesSpecialSchemeVo();
 | 
			
		||||
            BeanUtils.copyProperties(entity, specialSchemeVo);
 | 
			
		||||
            specialSchemeVo.setFile(ossMap.get(entity.getFileUrl()).getFirst());
 | 
			
		||||
            return specialSchemeVo;
 | 
			
		||||
        }).toList();
 | 
			
		||||
        specialSchemeVoPage.setRecords(specialSchemeVoList);
 | 
			
		||||
        return specialSchemeVoPage;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等)
 | 
			
		||||
     * 正常使用只需#processEvent.flowCode=='leave1'
 | 
			
		||||
     * 示例为了方便则使用startsWith匹配了全部示例key
 | 
			
		||||
     *
 | 
			
		||||
     * @param processEvent 参数
 | 
			
		||||
     */
 | 
			
		||||
    @EventListener(condition = "#processEvent.flowCode == 'specialScheme'")
 | 
			
		||||
    public void processHandler(ProcessEvent processEvent) {
 | 
			
		||||
        log.info("图纸审核任务执行了{}", processEvent.toString());
 | 
			
		||||
        DesSpecialScheme specialScheme = this.getById(Convert.toLong(processEvent.getBusinessId()));
 | 
			
		||||
        specialScheme.setStatus(processEvent.getStatus());
 | 
			
		||||
        if (processEvent.getSubmit()) {
 | 
			
		||||
            specialScheme.setStatus(BusinessStatusEnum.WAITING.getStatus());
 | 
			
		||||
        }
 | 
			
		||||
        this.updateById(specialScheme);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 执行任务创建监听
 | 
			
		||||
     * 示例:也可通过  @EventListener(condition = "#processTaskEvent.flowCode=='leave1'")进行判断
 | 
			
		||||
     * 在方法中判断流程节点key
 | 
			
		||||
     * if ("xxx".equals(processTaskEvent.getNodeCode())) {
 | 
			
		||||
     * //执行业务逻辑
 | 
			
		||||
     * }
 | 
			
		||||
     *
 | 
			
		||||
     * @param processTaskEvent 参数
 | 
			
		||||
     */
 | 
			
		||||
    @EventListener(condition = "#processTaskEvent.flowCode == 'specialScheme'")
 | 
			
		||||
    public void processTaskHandler(ProcessTaskEvent processTaskEvent) {
 | 
			
		||||
        log.info("图纸审核任务创建了{}", processTaskEvent.toString());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 监听删除流程事件
 | 
			
		||||
     * 正常使用只需#processDeleteEvent.flowCode=='leave1'
 | 
			
		||||
     * 示例为了方便则使用startsWith匹配了全部示例key
 | 
			
		||||
     *
 | 
			
		||||
     * @param processDeleteEvent 参数
 | 
			
		||||
     */
 | 
			
		||||
    @EventListener(condition = "#processDeleteEvent.flowCode == 'specialScheme'")
 | 
			
		||||
    public void processDeleteHandler(ProcessDeleteEvent processDeleteEvent) {
 | 
			
		||||
        log.info("监听删除流程事件,图纸审核任务执行了{}", processDeleteEvent.toString());
 | 
			
		||||
        DesSpecialScheme specialScheme = this.getById(Convert.toLong(processDeleteEvent.getBusinessId()));
 | 
			
		||||
        if (ObjectUtil.isNull(specialScheme)) {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
        this.removeById(specialScheme.getId());
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -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.DesDesignChangeMapper">
 | 
			
		||||
 | 
			
		||||
</mapper>
 | 
			
		||||
@ -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.DesSpecialSchemeMapper">
 | 
			
		||||
 | 
			
		||||
</mapper>
 | 
			
		||||
		Reference in New Issue
	
	Block a user