物资和设计
This commit is contained in:
		@ -0,0 +1,117 @@
 | 
			
		||||
package org.dromara.cailiaoshebei.controller;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
import lombok.RequiredArgsConstructor;
 | 
			
		||||
import jakarta.servlet.http.HttpServletResponse;
 | 
			
		||||
import jakarta.validation.constraints.*;
 | 
			
		||||
import cn.dev33.satoken.annotation.SaCheckPermission;
 | 
			
		||||
import org.dromara.cailiaoshebei.domain.dto.BusLtnDto;
 | 
			
		||||
import org.springframework.web.bind.annotation.*;
 | 
			
		||||
import org.springframework.validation.annotation.Validated;
 | 
			
		||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
 | 
			
		||||
import org.dromara.common.log.annotation.Log;
 | 
			
		||||
import org.dromara.common.web.core.BaseController;
 | 
			
		||||
import org.dromara.common.mybatis.core.page.PageQuery;
 | 
			
		||||
import org.dromara.common.core.domain.R;
 | 
			
		||||
import org.dromara.common.core.validate.AddGroup;
 | 
			
		||||
import org.dromara.common.core.validate.EditGroup;
 | 
			
		||||
import org.dromara.common.log.enums.BusinessType;
 | 
			
		||||
import org.dromara.common.excel.utils.ExcelUtil;
 | 
			
		||||
import org.dromara.cailiaoshebei.domain.vo.BusLtnVo;
 | 
			
		||||
import org.dromara.cailiaoshebei.domain.bo.BusLtnBo;
 | 
			
		||||
import org.dromara.cailiaoshebei.service.IBusLtnService;
 | 
			
		||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 物资-物流单号
 | 
			
		||||
 *
 | 
			
		||||
 * @author Lion Li
 | 
			
		||||
 * @date 2025-08-14
 | 
			
		||||
 */
 | 
			
		||||
@Validated
 | 
			
		||||
@RequiredArgsConstructor
 | 
			
		||||
@RestController
 | 
			
		||||
@RequestMapping("/cailiaoshebei/ltn")
 | 
			
		||||
public class BusLtnController extends BaseController {
 | 
			
		||||
 | 
			
		||||
    private final IBusLtnService busLtnService;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询物资-物流单号列表
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("cailiaoshebei:ltn:list")
 | 
			
		||||
    @GetMapping("/list")
 | 
			
		||||
    public TableDataInfo<BusLtnVo> list(BusLtnBo bo, PageQuery pageQuery) {
 | 
			
		||||
        return busLtnService.queryPageList(bo, pageQuery);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 导出物资-物流单号列表
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("cailiaoshebei:ltn:export")
 | 
			
		||||
    @Log(title = "物资-物流单号", businessType = BusinessType.EXPORT)
 | 
			
		||||
    @PostMapping("/export")
 | 
			
		||||
    public void export(BusLtnBo bo, HttpServletResponse response) {
 | 
			
		||||
        List<BusLtnVo> list = busLtnService.queryList(bo);
 | 
			
		||||
        ExcelUtil.exportExcel(list, "物资-物流单号", BusLtnVo.class, response);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取物资-物流单号详细信息
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 主键
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("cailiaoshebei:ltn:query")
 | 
			
		||||
    @GetMapping("/{id}")
 | 
			
		||||
    public R<BusLtnVo> getInfo(@NotNull(message = "主键不能为空")
 | 
			
		||||
                                     @PathVariable Long id) {
 | 
			
		||||
        return R.ok(busLtnService.queryById(id));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 新增物资-物流单号
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("cailiaoshebei:ltn:add")
 | 
			
		||||
    @Log(title = "物资-物流单号", businessType = BusinessType.INSERT)
 | 
			
		||||
    @RepeatSubmit()
 | 
			
		||||
    @PostMapping()
 | 
			
		||||
    public R<Void> add(@Validated(AddGroup.class) @RequestBody BusLtnBo bo) {
 | 
			
		||||
        return toAjax(busLtnService.insertByBo(bo));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 修改物资-物流单号
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("cailiaoshebei:ltn:edit")
 | 
			
		||||
    @Log(title = "物资-物流单号", businessType = BusinessType.UPDATE)
 | 
			
		||||
    @RepeatSubmit()
 | 
			
		||||
    @PutMapping()
 | 
			
		||||
    public R<Void> edit(@Validated(EditGroup.class) @RequestBody BusLtnBo bo) {
 | 
			
		||||
        return toAjax(busLtnService.updateByBo(bo));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 删除物资-物流单号
 | 
			
		||||
     *
 | 
			
		||||
     * @param ids 主键串
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("cailiaoshebei:ltn:remove")
 | 
			
		||||
    @Log(title = "物资-物流单号", businessType = BusinessType.DELETE)
 | 
			
		||||
    @DeleteMapping("/{ids}")
 | 
			
		||||
    public R<Void> remove(@NotEmpty(message = "主键不能为空")
 | 
			
		||||
                          @PathVariable Long[] ids) {
 | 
			
		||||
        return toAjax(busLtnService.deleteWithValidByIds(List.of(ids), true));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 新增物资-物流单号
 | 
			
		||||
     */
 | 
			
		||||
    @Log(title = "物资-物流单号", businessType = BusinessType.INSERT)
 | 
			
		||||
    @RepeatSubmit()
 | 
			
		||||
    @PostMapping("/link")
 | 
			
		||||
    public R<Void> linkAdd(@RequestBody BusLtnDto dto) {
 | 
			
		||||
        return toAjax(busLtnService.linkAdd(dto));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,56 @@
 | 
			
		||||
package org.dromara.cailiaoshebei.domain;
 | 
			
		||||
 | 
			
		||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
 | 
			
		||||
import com.baomidou.mybatisplus.annotation.*;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.EqualsAndHashCode;
 | 
			
		||||
 | 
			
		||||
import java.io.Serial;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 物资-物流单号对象 bus_ltn
 | 
			
		||||
 *
 | 
			
		||||
 * @author Lion Li
 | 
			
		||||
 * @date 2025-08-14
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
@EqualsAndHashCode(callSuper = true)
 | 
			
		||||
@TableName("bus_ltn")
 | 
			
		||||
public class BusLtn extends BaseEntity {
 | 
			
		||||
 | 
			
		||||
    @Serial
 | 
			
		||||
    private static final long serialVersionUID = 1L;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 主键ID
 | 
			
		||||
     */
 | 
			
		||||
    @TableId(value = "id")
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 项目ID
 | 
			
		||||
     */
 | 
			
		||||
    private Long projectId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 采购联系单id
 | 
			
		||||
     */
 | 
			
		||||
    private Long docId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 计划id
 | 
			
		||||
     */
 | 
			
		||||
    private Long planId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 数量
 | 
			
		||||
     */
 | 
			
		||||
    private Long num;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 物流单号
 | 
			
		||||
     */
 | 
			
		||||
    private String ltn;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -38,6 +38,11 @@ public class BusPurchaseDoc extends BaseEntity {
 | 
			
		||||
     */
 | 
			
		||||
    private String docCode;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 供应商id
 | 
			
		||||
     */
 | 
			
		||||
    private Long supplierId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 供应商
 | 
			
		||||
     */
 | 
			
		||||
@ -118,5 +123,8 @@ public class BusPurchaseDoc extends BaseEntity {
 | 
			
		||||
     */
 | 
			
		||||
    private String status;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 计划基础ID
 | 
			
		||||
     */
 | 
			
		||||
    private  Long mrpBaseId;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,58 @@
 | 
			
		||||
package org.dromara.cailiaoshebei.domain.bo;
 | 
			
		||||
 | 
			
		||||
import org.dromara.cailiaoshebei.domain.BusLtn;
 | 
			
		||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
 | 
			
		||||
import org.dromara.common.core.validate.AddGroup;
 | 
			
		||||
import org.dromara.common.core.validate.EditGroup;
 | 
			
		||||
import io.github.linpeilie.annotations.AutoMapper;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.EqualsAndHashCode;
 | 
			
		||||
import jakarta.validation.constraints.*;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 物资-物流单号业务对象 bus_ltn
 | 
			
		||||
 *
 | 
			
		||||
 * @author Lion Li
 | 
			
		||||
 * @date 2025-08-14
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
@EqualsAndHashCode(callSuper = true)
 | 
			
		||||
@AutoMapper(target = BusLtn.class, reverseConvertGenerate = false)
 | 
			
		||||
public class BusLtnBo extends BaseEntity {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 主键ID
 | 
			
		||||
     */
 | 
			
		||||
    @NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 项目ID
 | 
			
		||||
     */
 | 
			
		||||
    private Long projectId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 采购联系单id
 | 
			
		||||
     */
 | 
			
		||||
    @NotNull(message = "采购联系单id不能为空", groups = { AddGroup.class, EditGroup.class })
 | 
			
		||||
    private Long docId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 计划id
 | 
			
		||||
     */
 | 
			
		||||
    @NotNull(message = "计划id不能为空", groups = { AddGroup.class, EditGroup.class })
 | 
			
		||||
    private Long planId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 数量
 | 
			
		||||
     */
 | 
			
		||||
    private Long num;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 物流单号
 | 
			
		||||
     */
 | 
			
		||||
    @NotBlank(message = "物流单号不能为空", groups = { AddGroup.class, EditGroup.class })
 | 
			
		||||
    private String ltn;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -39,6 +39,11 @@ public class BusPurchaseDocBo extends BaseEntity {
 | 
			
		||||
     */
 | 
			
		||||
    private String docCode;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 供应商id
 | 
			
		||||
     */
 | 
			
		||||
    private Long supplierId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 供应商
 | 
			
		||||
     */
 | 
			
		||||
@ -119,6 +124,11 @@ public class BusPurchaseDocBo extends BaseEntity {
 | 
			
		||||
     */
 | 
			
		||||
    private String status;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 计划基础ID
 | 
			
		||||
     */
 | 
			
		||||
    private  Long mrpBaseId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 关联计划
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,44 @@
 | 
			
		||||
package org.dromara.cailiaoshebei.domain.dto;
 | 
			
		||||
 | 
			
		||||
import io.github.linpeilie.annotations.AutoMapper;
 | 
			
		||||
import jakarta.validation.constraints.NotBlank;
 | 
			
		||||
import jakarta.validation.constraints.NotNull;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.EqualsAndHashCode;
 | 
			
		||||
import org.dromara.cailiaoshebei.domain.BusLtn;
 | 
			
		||||
import org.dromara.common.core.validate.AddGroup;
 | 
			
		||||
import org.dromara.common.core.validate.EditGroup;
 | 
			
		||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 物资-物流单号业务对象 bus_ltn
 | 
			
		||||
 *
 | 
			
		||||
 * @author Lion Li
 | 
			
		||||
 * @date 2025-08-14
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
 | 
			
		||||
public class BusLtnDto  {
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 采购联系单id
 | 
			
		||||
     */
 | 
			
		||||
    private Long docId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 供应商
 | 
			
		||||
     */
 | 
			
		||||
    private String supplier;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 物流信息
 | 
			
		||||
     */
 | 
			
		||||
    private List<BusLtnListDto> list;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,40 @@
 | 
			
		||||
package org.dromara.cailiaoshebei.domain.dto;
 | 
			
		||||
 | 
			
		||||
import io.github.linpeilie.annotations.AutoMapper;
 | 
			
		||||
import jakarta.validation.constraints.NotBlank;
 | 
			
		||||
import jakarta.validation.constraints.NotNull;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.EqualsAndHashCode;
 | 
			
		||||
import org.dromara.cailiaoshebei.domain.BusLtn;
 | 
			
		||||
import org.dromara.common.core.validate.AddGroup;
 | 
			
		||||
import org.dromara.common.core.validate.EditGroup;
 | 
			
		||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 物资-物流单号业务对象 bus_ltn
 | 
			
		||||
 *
 | 
			
		||||
 * @author Lion Li
 | 
			
		||||
 * @date 2025-08-14
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
public class BusLtnListDto{
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 计划id不
 | 
			
		||||
     */
 | 
			
		||||
    @NotNull(message = "计划id不能为空")
 | 
			
		||||
    private Long planId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 数量
 | 
			
		||||
     */
 | 
			
		||||
    private Long num;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 物流单号
 | 
			
		||||
     */
 | 
			
		||||
    @NotBlank(message = "物流单号不能为空")
 | 
			
		||||
    private String ltn;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,68 @@
 | 
			
		||||
package org.dromara.cailiaoshebei.domain.vo;
 | 
			
		||||
 | 
			
		||||
import org.dromara.cailiaoshebei.domain.BusLtn;
 | 
			
		||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
 | 
			
		||||
import com.alibaba.excel.annotation.ExcelProperty;
 | 
			
		||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
 | 
			
		||||
import org.dromara.common.excel.convert.ExcelDictConvert;
 | 
			
		||||
import io.github.linpeilie.annotations.AutoMapper;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import java.io.Serial;
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.util.Date;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 物资-物流单号视图对象 bus_ltn
 | 
			
		||||
 *
 | 
			
		||||
 * @author Lion Li
 | 
			
		||||
 * @date 2025-08-14
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
@ExcelIgnoreUnannotated
 | 
			
		||||
@AutoMapper(target = BusLtn.class)
 | 
			
		||||
public class BusLtnVo implements Serializable {
 | 
			
		||||
 | 
			
		||||
    @Serial
 | 
			
		||||
    private static final long serialVersionUID = 1L;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 主键ID
 | 
			
		||||
     */
 | 
			
		||||
    @ExcelProperty(value = "主键ID")
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 项目ID
 | 
			
		||||
     */
 | 
			
		||||
    @ExcelProperty(value = "项目ID")
 | 
			
		||||
    private Long projectId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 采购联系单id
 | 
			
		||||
     */
 | 
			
		||||
    @ExcelProperty(value = "采购联系单id")
 | 
			
		||||
    private Long docId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 计划id
 | 
			
		||||
     */
 | 
			
		||||
    @ExcelProperty(value = "计划id")
 | 
			
		||||
    private Long planId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 数量
 | 
			
		||||
     */
 | 
			
		||||
    @ExcelProperty(value = "数量")
 | 
			
		||||
    private Long num;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 物流单号
 | 
			
		||||
     */
 | 
			
		||||
    @ExcelProperty(value = "物流单号")
 | 
			
		||||
    private String ltn;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -3,6 +3,7 @@ package org.dromara.cailiaoshebei.domain.vo;
 | 
			
		||||
import org.dromara.cailiaoshebei.domain.BusPurchaseDoc;
 | 
			
		||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
 | 
			
		||||
import com.alibaba.excel.annotation.ExcelProperty;
 | 
			
		||||
import org.dromara.cailiaoshebei.domain.bo.BusPlanDocAssociationBo;
 | 
			
		||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
 | 
			
		||||
import org.dromara.common.excel.convert.ExcelDictConvert;
 | 
			
		||||
import io.github.linpeilie.annotations.AutoMapper;
 | 
			
		||||
@ -12,7 +13,7 @@ import java.io.Serial;
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.time.LocalDate;
 | 
			
		||||
import java.util.Date;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
@ -47,6 +48,11 @@ public class BusPurchaseDocVo implements Serializable {
 | 
			
		||||
    @ExcelProperty(value = "采购单编号")
 | 
			
		||||
    private String docCode;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 供应商id
 | 
			
		||||
     */
 | 
			
		||||
    private Long supplierId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 供应商
 | 
			
		||||
     */
 | 
			
		||||
@ -143,5 +149,13 @@ public class BusPurchaseDocVo implements Serializable {
 | 
			
		||||
    @ExcelProperty(value = "审核状态")
 | 
			
		||||
    private String status;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 计划基础ID
 | 
			
		||||
     */
 | 
			
		||||
    private  Long mrpBaseId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 关联计划
 | 
			
		||||
     */
 | 
			
		||||
    private List<BusPlanDocAssociationVo> associationList;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,15 @@
 | 
			
		||||
package org.dromara.cailiaoshebei.mapper;
 | 
			
		||||
 | 
			
		||||
import org.dromara.cailiaoshebei.domain.BusLtn;
 | 
			
		||||
import org.dromara.cailiaoshebei.domain.vo.BusLtnVo;
 | 
			
		||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 物资-物流单号Mapper接口
 | 
			
		||||
 *
 | 
			
		||||
 * @author Lion Li
 | 
			
		||||
 * @date 2025-08-14
 | 
			
		||||
 */
 | 
			
		||||
public interface BusLtnMapper extends BaseMapperPlus<BusLtn, BusLtnVo> {
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,79 @@
 | 
			
		||||
package org.dromara.cailiaoshebei.service;
 | 
			
		||||
 | 
			
		||||
import org.dromara.cailiaoshebei.domain.dto.BusLtnDto;
 | 
			
		||||
import org.dromara.cailiaoshebei.domain.vo.BusLtnVo;
 | 
			
		||||
import org.dromara.cailiaoshebei.domain.bo.BusLtnBo;
 | 
			
		||||
import org.dromara.cailiaoshebei.domain.BusLtn;
 | 
			
		||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
 | 
			
		||||
import org.dromara.common.mybatis.core.page.PageQuery;
 | 
			
		||||
 | 
			
		||||
import com.baomidou.mybatisplus.extension.service.IService;
 | 
			
		||||
import org.springframework.web.bind.annotation.RequestBody;
 | 
			
		||||
 | 
			
		||||
import java.util.Collection;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 物资-物流单号Service接口
 | 
			
		||||
 *
 | 
			
		||||
 * @author Lion Li
 | 
			
		||||
 * @date 2025-08-14
 | 
			
		||||
 */
 | 
			
		||||
public interface IBusLtnService extends IService<BusLtn>{
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询物资-物流单号
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 主键
 | 
			
		||||
     * @return 物资-物流单号
 | 
			
		||||
     */
 | 
			
		||||
    BusLtnVo queryById(Long id);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 分页查询物资-物流单号列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param bo        查询条件
 | 
			
		||||
     * @param pageQuery 分页参数
 | 
			
		||||
     * @return 物资-物流单号分页列表
 | 
			
		||||
     */
 | 
			
		||||
    TableDataInfo<BusLtnVo> queryPageList(BusLtnBo bo, PageQuery pageQuery);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询符合条件的物资-物流单号列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param bo 查询条件
 | 
			
		||||
     * @return 物资-物流单号列表
 | 
			
		||||
     */
 | 
			
		||||
    List<BusLtnVo> queryList(BusLtnBo bo);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 新增物资-物流单号
 | 
			
		||||
     *
 | 
			
		||||
     * @param bo 物资-物流单号
 | 
			
		||||
     * @return 是否新增成功
 | 
			
		||||
     */
 | 
			
		||||
    Boolean insertByBo(BusLtnBo bo);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 修改物资-物流单号
 | 
			
		||||
     *
 | 
			
		||||
     * @param bo 物资-物流单号
 | 
			
		||||
     * @return 是否修改成功
 | 
			
		||||
     */
 | 
			
		||||
    Boolean updateByBo(BusLtnBo bo);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 校验并批量删除物资-物流单号信息
 | 
			
		||||
     *
 | 
			
		||||
     * @param ids     待删除的主键集合
 | 
			
		||||
     * @param isValid 是否进行有效性校验
 | 
			
		||||
     * @return 是否删除成功
 | 
			
		||||
     */
 | 
			
		||||
    Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 添加物流单号
 | 
			
		||||
     */
 | 
			
		||||
    Boolean linkAdd(BusLtnDto dto);
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,155 @@
 | 
			
		||||
package org.dromara.cailiaoshebei.service.impl;
 | 
			
		||||
 | 
			
		||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 | 
			
		||||
import org.dromara.cailiaoshebei.domain.dto.BusLtnDto;
 | 
			
		||||
import org.dromara.cailiaoshebei.domain.vo.BusPurchaseDocVo;
 | 
			
		||||
import org.dromara.cailiaoshebei.service.IBusPurchaseDocService;
 | 
			
		||||
import org.dromara.common.core.exception.ServiceException;
 | 
			
		||||
import org.dromara.common.core.utils.MapstructUtils;
 | 
			
		||||
import org.dromara.common.core.utils.StringUtils;
 | 
			
		||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
 | 
			
		||||
import org.dromara.common.mybatis.core.page.PageQuery;
 | 
			
		||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 | 
			
		||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 | 
			
		||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 | 
			
		||||
import lombok.RequiredArgsConstructor;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
import org.dromara.cailiaoshebei.domain.bo.BusLtnBo;
 | 
			
		||||
import org.dromara.cailiaoshebei.domain.vo.BusLtnVo;
 | 
			
		||||
import org.dromara.cailiaoshebei.domain.BusLtn;
 | 
			
		||||
import org.dromara.cailiaoshebei.mapper.BusLtnMapper;
 | 
			
		||||
import org.dromara.cailiaoshebei.service.IBusLtnService;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
import java.util.Map;
 | 
			
		||||
import java.util.Collection;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 物资-物流单号Service业务层处理
 | 
			
		||||
 *
 | 
			
		||||
 * @author Lion Li
 | 
			
		||||
 * @date 2025-08-14
 | 
			
		||||
 */
 | 
			
		||||
@RequiredArgsConstructor
 | 
			
		||||
@Service
 | 
			
		||||
public class BusLtnServiceImpl extends ServiceImpl<BusLtnMapper, BusLtn> implements IBusLtnService {
 | 
			
		||||
 | 
			
		||||
    private final BusLtnMapper baseMapper;
 | 
			
		||||
 | 
			
		||||
    private final IBusPurchaseDocService purchaseDocService;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询物资-物流单号
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 主键
 | 
			
		||||
     * @return 物资-物流单号
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public BusLtnVo queryById(Long id){
 | 
			
		||||
        return baseMapper.selectVoById(id);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 分页查询物资-物流单号列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param bo        查询条件
 | 
			
		||||
     * @param pageQuery 分页参数
 | 
			
		||||
     * @return 物资-物流单号分页列表
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public TableDataInfo<BusLtnVo> queryPageList(BusLtnBo bo, PageQuery pageQuery) {
 | 
			
		||||
        LambdaQueryWrapper<BusLtn> lqw = buildQueryWrapper(bo);
 | 
			
		||||
        Page<BusLtnVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
 | 
			
		||||
        return TableDataInfo.build(result);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询符合条件的物资-物流单号列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param bo 查询条件
 | 
			
		||||
     * @return 物资-物流单号列表
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<BusLtnVo> queryList(BusLtnBo bo) {
 | 
			
		||||
        LambdaQueryWrapper<BusLtn> lqw = buildQueryWrapper(bo);
 | 
			
		||||
        return baseMapper.selectVoList(lqw);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private LambdaQueryWrapper<BusLtn> buildQueryWrapper(BusLtnBo bo) {
 | 
			
		||||
        Map<String, Object> params = bo.getParams();
 | 
			
		||||
        LambdaQueryWrapper<BusLtn> lqw = Wrappers.lambdaQuery();
 | 
			
		||||
        lqw.orderByDesc(BusLtn::getId);
 | 
			
		||||
        lqw.eq(bo.getProjectId() != null, BusLtn::getProjectId, bo.getProjectId());
 | 
			
		||||
        lqw.eq(bo.getDocId() != null, BusLtn::getDocId, bo.getDocId());
 | 
			
		||||
        lqw.eq(bo.getPlanId() != null, BusLtn::getPlanId, bo.getPlanId());
 | 
			
		||||
        lqw.eq(bo.getNum() != null, BusLtn::getNum, bo.getNum());
 | 
			
		||||
        lqw.eq(StringUtils.isNotBlank(bo.getLtn()), BusLtn::getLtn, bo.getLtn());
 | 
			
		||||
        return lqw;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 新增物资-物流单号
 | 
			
		||||
     *
 | 
			
		||||
     * @param bo 物资-物流单号
 | 
			
		||||
     * @return 是否新增成功
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public Boolean insertByBo(BusLtnBo bo) {
 | 
			
		||||
        BusLtn add = MapstructUtils.convert(bo, BusLtn.class);
 | 
			
		||||
        validEntityBeforeSave(add);
 | 
			
		||||
        boolean flag = baseMapper.insert(add) > 0;
 | 
			
		||||
        if (flag) {
 | 
			
		||||
            bo.setId(add.getId());
 | 
			
		||||
        }
 | 
			
		||||
        return flag;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 修改物资-物流单号
 | 
			
		||||
     *
 | 
			
		||||
     * @param bo 物资-物流单号
 | 
			
		||||
     * @return 是否修改成功
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public Boolean updateByBo(BusLtnBo bo) {
 | 
			
		||||
        BusLtn update = MapstructUtils.convert(bo, BusLtn.class);
 | 
			
		||||
        validEntityBeforeSave(update);
 | 
			
		||||
        return baseMapper.updateById(update) > 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 保存前的数据校验
 | 
			
		||||
     */
 | 
			
		||||
    private void validEntityBeforeSave(BusLtn entity){
 | 
			
		||||
        //TODO 做一些数据校验,如唯一约束
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 校验并批量删除物资-物流单号信息
 | 
			
		||||
     *
 | 
			
		||||
     * @param ids     待删除的主键集合
 | 
			
		||||
     * @param isValid 是否进行有效性校验
 | 
			
		||||
     * @return 是否删除成功
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
 | 
			
		||||
        if(isValid){
 | 
			
		||||
            //TODO 做一些业务上的校验,判断是否需要校验
 | 
			
		||||
        }
 | 
			
		||||
        return baseMapper.deleteByIds(ids) > 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public Boolean linkAdd(BusLtnDto dto) {
 | 
			
		||||
 | 
			
		||||
        BusPurchaseDocVo busPurchaseDocVo = purchaseDocService.queryById(dto.getDocId());
 | 
			
		||||
        if (busPurchaseDocVo == null) {
 | 
			
		||||
            throw new ServiceException("采购单不存在");
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        return null;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -3,6 +3,8 @@ package org.dromara.cailiaoshebei.service.impl;
 | 
			
		||||
import cn.hutool.core.collection.CollectionUtil;
 | 
			
		||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 | 
			
		||||
import org.dromara.cailiaoshebei.domain.BusPlanDocAssociation;
 | 
			
		||||
import org.dromara.cailiaoshebei.domain.bo.BusPlanDocAssociationBo;
 | 
			
		||||
import org.dromara.cailiaoshebei.domain.vo.BusPlanDocAssociationVo;
 | 
			
		||||
import org.dromara.cailiaoshebei.service.IBusPlanDocAssociationService;
 | 
			
		||||
import org.dromara.common.core.utils.MapstructUtils;
 | 
			
		||||
import org.dromara.common.core.utils.StringUtils;
 | 
			
		||||
@ -46,7 +48,12 @@ public class BusPurchaseDocServiceImpl extends ServiceImpl<BusPurchaseDocMapper,
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public BusPurchaseDocVo queryById(Long id){
 | 
			
		||||
        return baseMapper.selectVoById(id);
 | 
			
		||||
        BusPurchaseDocVo busPurchaseDocVo = baseMapper.selectVoById(id);
 | 
			
		||||
        BusPlanDocAssociationBo busPlanDocAssociationBo = new BusPlanDocAssociationBo();
 | 
			
		||||
        busPlanDocAssociationBo.setDocId(id);
 | 
			
		||||
        List<BusPlanDocAssociationVo> busPlanDocAssociationVos = planDocAssociationService.queryList(busPlanDocAssociationBo);
 | 
			
		||||
        busPurchaseDocVo.setAssociationList(busPlanDocAssociationVos);
 | 
			
		||||
        return busPurchaseDocVo;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 | 
			
		||||
@ -203,4 +203,5 @@ public class BusDrawingreviewController extends BaseController {
 | 
			
		||||
//                          @PathVariable Long[] ids) {
 | 
			
		||||
//        return toAjax(busDrawingreviewService.deleteWithValidByIds(List.of(ids), true));
 | 
			
		||||
//    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -107,5 +107,4 @@ public class BusDrawingreviewReceiptsController extends BaseController {
 | 
			
		||||
        return toAjax(busDrawingreviewReceiptsService.deleteWithValidByIds(List.of(ids), true));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -19,10 +19,14 @@ 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.dromara.system.domain.vo.SysOssVo;
 | 
			
		||||
import org.dromara.system.service.ISysOssService;
 | 
			
		||||
import org.springframework.validation.annotation.Validated;
 | 
			
		||||
import org.springframework.web.bind.annotation.*;
 | 
			
		||||
 | 
			
		||||
import java.util.Arrays;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
import java.util.stream.Collectors;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 设计变更管理
 | 
			
		||||
 | 
			
		||||
@ -6,8 +6,10 @@ import lombok.RequiredArgsConstructor;
 | 
			
		||||
import jakarta.servlet.http.HttpServletResponse;
 | 
			
		||||
import jakarta.validation.constraints.*;
 | 
			
		||||
import cn.dev33.satoken.annotation.SaCheckPermission;
 | 
			
		||||
import org.dromara.design.domain.bo.DesCollectFileBo;
 | 
			
		||||
import org.dromara.design.domain.dto.desCollect.DesCollectBatchDto;
 | 
			
		||||
import org.dromara.design.domain.dto.desExtract.DesExtractBatchDto;
 | 
			
		||||
import org.dromara.design.domain.vo.DesCollectFileVo;
 | 
			
		||||
import org.springframework.web.bind.annotation.*;
 | 
			
		||||
import org.springframework.validation.annotation.Validated;
 | 
			
		||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
 | 
			
		||||
@ -114,8 +116,6 @@ public class DesExtractController extends BaseController {
 | 
			
		||||
        return R.ok(desExtractService.batchAddOrUpdate(dto));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 清单导出
 | 
			
		||||
     */
 | 
			
		||||
@ -125,4 +125,15 @@ public class DesExtractController extends BaseController {
 | 
			
		||||
    public void exportWordById(Long id, HttpServletResponse response){
 | 
			
		||||
        desExtractService.exportWordById(id, response);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询提取的资料文件
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("design:extract:query")
 | 
			
		||||
    @GetMapping("/fileList/{id}")
 | 
			
		||||
    public R<List<DesCollectFileVo>> fileList(@NotNull(message = "主键不能为空")
 | 
			
		||||
                                                        @PathVariable Long id) {
 | 
			
		||||
        return R.ok(desExtractService.fileList(id));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -114,4 +114,10 @@ public class DesDesignChange extends BaseEntity {
 | 
			
		||||
     */
 | 
			
		||||
    private String detail;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 文件
 | 
			
		||||
     */
 | 
			
		||||
    private String saveFile;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -94,4 +94,13 @@ public class DesDrawing extends BaseEntity {
 | 
			
		||||
     */
 | 
			
		||||
    private Date deletedAt;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 卷册目录ID
 | 
			
		||||
     */
 | 
			
		||||
    private Long volumeCatalogId;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    private Long  volumeFileId;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -52,5 +52,9 @@ public class DesExtractCatalogue extends BaseEntity {
 | 
			
		||||
     */
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 卷册目录Id
 | 
			
		||||
     */
 | 
			
		||||
    private Long volumeCatalogId;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -53,4 +53,8 @@ public class DesPrelimScheme extends BaseEntity {
 | 
			
		||||
    private String status;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 排序字段
 | 
			
		||||
     */
 | 
			
		||||
    private Integer orderNum;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -52,5 +52,8 @@ public class DesScheme extends BaseEntity {
 | 
			
		||||
     */
 | 
			
		||||
    private String status;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 排序字段
 | 
			
		||||
     */
 | 
			
		||||
    private Integer orderNum;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -57,4 +57,9 @@ public class DesVolumeFile extends BaseEntity {
 | 
			
		||||
     */
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 文件类型
 | 
			
		||||
     */
 | 
			
		||||
    private String type;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -8,6 +8,8 @@ import io.github.linpeilie.annotations.AutoMapper;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.EqualsAndHashCode;
 | 
			
		||||
import jakarta.validation.constraints.*;
 | 
			
		||||
 | 
			
		||||
import java.time.LocalDate;
 | 
			
		||||
import java.util.Date;
 | 
			
		||||
import com.fasterxml.jackson.annotation.JsonFormat;
 | 
			
		||||
 | 
			
		||||
@ -126,17 +128,17 @@ public class BusDrawingreviewReceiptsBo extends BaseEntity {
 | 
			
		||||
    /**
 | 
			
		||||
     * 校审时间
 | 
			
		||||
     */
 | 
			
		||||
    private Date proofreadingDate;
 | 
			
		||||
    private LocalDate proofreadingDate;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 审核时间
 | 
			
		||||
     */
 | 
			
		||||
    private Date auditDate;
 | 
			
		||||
    private LocalDate auditDate;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 执行时间
 | 
			
		||||
     */
 | 
			
		||||
    private Date executorDate;
 | 
			
		||||
    private LocalDate executorDate;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 图纸
 | 
			
		||||
 | 
			
		||||
@ -10,6 +10,8 @@ import lombok.EqualsAndHashCode;
 | 
			
		||||
import jakarta.validation.constraints.*;
 | 
			
		||||
import org.dromara.design.domain.DesCollectFile;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 收资文件业务对象 des_collect_file
 | 
			
		||||
 *
 | 
			
		||||
@ -60,5 +62,9 @@ public class DesCollectFileBo extends BaseEntity {
 | 
			
		||||
    @NotBlank(message = "审核状态不能为空", groups = { AddGroup.class, EditGroup.class })
 | 
			
		||||
    private String status;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 清单目录ID列表
 | 
			
		||||
     */
 | 
			
		||||
    private List<Long> catalogueIds;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -55,5 +55,9 @@ public class DesExtractCatalogueBo extends BaseEntity {
 | 
			
		||||
     */
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 卷册目录Id
 | 
			
		||||
     */
 | 
			
		||||
    private Long volumeCatalogId;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -129,5 +129,11 @@ public class FillOutTheDesignVerificationFormReq implements Serializable {
 | 
			
		||||
     */
 | 
			
		||||
    private LocalDate executorDate;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 关联数据ID
 | 
			
		||||
     */
 | 
			
		||||
    private Long drawingreviewId;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -103,4 +103,8 @@ public class DesDesignChangeCreateReq implements Serializable {
 | 
			
		||||
     */
 | 
			
		||||
    private DesDesignExtendDetailDto extendDetail;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 保存文件
 | 
			
		||||
     */
 | 
			
		||||
    private String saveFile;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -32,6 +32,11 @@ public class DesVolumeCatalogQueryReq implements Serializable {
 | 
			
		||||
     */
 | 
			
		||||
    private String documentName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 资料名称
 | 
			
		||||
     */
 | 
			
		||||
    private String auditStatus;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -24,7 +24,7 @@ public class DesVolumeFileCreateReq implements Serializable {
 | 
			
		||||
    /**
 | 
			
		||||
     * 文件ID
 | 
			
		||||
     */
 | 
			
		||||
    private Long fileId;
 | 
			
		||||
    private List<Long> fileIds;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 作废文件id列表
 | 
			
		||||
 | 
			
		||||
@ -64,5 +64,8 @@ public class DesExtractCatalogueVo implements Serializable {
 | 
			
		||||
    @ExcelProperty(value = "备注")
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 卷册目录Id
 | 
			
		||||
     */
 | 
			
		||||
    private Long volumeCatalogId;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -2,6 +2,8 @@ package org.dromara.design.domain.vo.designchange;
 | 
			
		||||
 | 
			
		||||
import io.github.linpeilie.annotations.AutoMapper;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import org.dromara.common.translation.annotation.Translation;
 | 
			
		||||
import org.dromara.common.translation.constant.TransConstant;
 | 
			
		||||
import org.dromara.design.domain.DesDesignChange;
 | 
			
		||||
import org.dromara.design.domain.dto.designchange.DesDesignExtendDetailDto;
 | 
			
		||||
import org.dromara.system.domain.vo.SysOssVo;
 | 
			
		||||
@ -55,6 +57,12 @@ public class DesDesignChangeVo implements Serializable {
 | 
			
		||||
     */
 | 
			
		||||
    private String specialty;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 专业
 | 
			
		||||
     */
 | 
			
		||||
    @Translation(type = TransConstant.DICT_TYPE_TO_LABEL, mapper = "specialty",other = "des_user_major")
 | 
			
		||||
    private String specialtyName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 提出日期
 | 
			
		||||
     */
 | 
			
		||||
@ -110,10 +118,10 @@ public class DesDesignChangeVo implements Serializable {
 | 
			
		||||
     */
 | 
			
		||||
    private String fileId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 变更文件
 | 
			
		||||
     */
 | 
			
		||||
    private SysOssVo file;
 | 
			
		||||
//    /**
 | 
			
		||||
//     * 变更文件
 | 
			
		||||
//     */
 | 
			
		||||
//    private SysOssVo file;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 审核状态
 | 
			
		||||
@ -135,4 +143,13 @@ public class DesDesignChangeVo implements Serializable {
 | 
			
		||||
     */
 | 
			
		||||
    private DesDesignExtendDetailDto extendDetail;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 保存文件
 | 
			
		||||
     */
 | 
			
		||||
    private String saveFile;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 文件列表
 | 
			
		||||
     */
 | 
			
		||||
    List<SysOssVo> ossVoList;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -43,6 +43,12 @@ public class DesDrawingVo implements Serializable {
 | 
			
		||||
     */
 | 
			
		||||
    private String fileName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 文件名称
 | 
			
		||||
     */
 | 
			
		||||
    private String url;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 文件访问路径
 | 
			
		||||
     */
 | 
			
		||||
@ -61,7 +67,7 @@ public class DesDrawingVo implements Serializable {
 | 
			
		||||
    /**
 | 
			
		||||
     * 文件
 | 
			
		||||
     */
 | 
			
		||||
    private SysOssVo file;
 | 
			
		||||
//    private SysOssVo file;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 原文件名
 | 
			
		||||
@ -88,4 +94,38 @@ public class DesDrawingVo implements Serializable {
 | 
			
		||||
     */
 | 
			
		||||
    private Date createTime;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 专业
 | 
			
		||||
     */
 | 
			
		||||
    private String specialty;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 卷册号
 | 
			
		||||
     */
 | 
			
		||||
    private String volumeNumber;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 负责人
 | 
			
		||||
     */
 | 
			
		||||
    private String principal;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 设计子项
 | 
			
		||||
     */
 | 
			
		||||
    private String designSubitem;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    private String type;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 卷册目录ID
 | 
			
		||||
     */
 | 
			
		||||
    private Long volumeCatalogId;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    private Long  volumeFileId;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -2,6 +2,8 @@ package org.dromara.design.domain.vo.volumecatalog;
 | 
			
		||||
 | 
			
		||||
import io.github.linpeilie.annotations.AutoMapper;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import org.dromara.common.translation.annotation.Translation;
 | 
			
		||||
import org.dromara.common.translation.constant.TransConstant;
 | 
			
		||||
import org.dromara.design.domain.DesVolumeCatalog;
 | 
			
		||||
import org.dromara.design.domain.vo.volumefile.DesVolumeFileVo;
 | 
			
		||||
import org.dromara.system.domain.vo.SysUserVo;
 | 
			
		||||
@ -51,6 +53,12 @@ public class DesVolumeCatalogVo implements Serializable {
 | 
			
		||||
     */
 | 
			
		||||
    private String specialty;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 专业
 | 
			
		||||
     */
 | 
			
		||||
    @Translation(type = TransConstant.DICT_TYPE_TO_LABEL, mapper = "specialty",other = "des_user_major")
 | 
			
		||||
    private String specialtyName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 卷册号
 | 
			
		||||
     */
 | 
			
		||||
@ -66,6 +74,10 @@ public class DesVolumeCatalogVo implements Serializable {
 | 
			
		||||
     */
 | 
			
		||||
    private String principal;
 | 
			
		||||
 | 
			
		||||
    @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "principal")
 | 
			
		||||
    private String principalName;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 计划完成时间
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
@ -61,4 +61,5 @@ public class DesVolumeFileVo implements Serializable {
 | 
			
		||||
     */
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
    private String type;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,9 @@
 | 
			
		||||
package org.dromara.design.service;
 | 
			
		||||
 | 
			
		||||
import jakarta.servlet.http.HttpServletResponse;
 | 
			
		||||
import jakarta.validation.constraints.NotNull;
 | 
			
		||||
import org.dromara.design.domain.dto.desExtract.DesExtractBatchDto;
 | 
			
		||||
import org.dromara.design.domain.vo.DesCollectFileVo;
 | 
			
		||||
import org.dromara.design.domain.vo.DesExtractVo;
 | 
			
		||||
import org.dromara.design.domain.bo.DesExtractBo;
 | 
			
		||||
import org.dromara.design.domain.DesExtract;
 | 
			
		||||
@ -9,6 +11,7 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
 | 
			
		||||
import org.dromara.common.mybatis.core.page.PageQuery;
 | 
			
		||||
 | 
			
		||||
import com.baomidou.mybatisplus.extension.service.IService;
 | 
			
		||||
import org.springframework.web.bind.annotation.PathVariable;
 | 
			
		||||
import org.springframework.web.bind.annotation.RequestBody;
 | 
			
		||||
 | 
			
		||||
import java.util.Collection;
 | 
			
		||||
@ -81,4 +84,9 @@ public interface IDesExtractService extends IService<DesExtract>{
 | 
			
		||||
     * 导出Word
 | 
			
		||||
     */
 | 
			
		||||
    void exportWordById(Long id, HttpServletResponse response);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询提取的资料文件
 | 
			
		||||
     */
 | 
			
		||||
    List<DesCollectFileVo> fileList(Long id);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -247,7 +247,6 @@ public class BusDrawingreviewServiceImpl extends ServiceImpl<BusDrawingreviewMap
 | 
			
		||||
        return busDrawingreviewReceiptsService.updateById(busDrawingreviewReceipts);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等)
 | 
			
		||||
     * 正常使用只需#processEvent.flowCode=='leave1'
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,6 @@
 | 
			
		||||
package org.dromara.design.service.impl;
 | 
			
		||||
 | 
			
		||||
import cn.hutool.core.collection.CollectionUtil;
 | 
			
		||||
import cn.hutool.core.convert.Convert;
 | 
			
		||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 | 
			
		||||
import lombok.extern.slf4j.Slf4j;
 | 
			
		||||
@ -99,6 +100,7 @@ public class DesCollectFileServiceImpl extends ServiceImpl<DesCollectFileMapper,
 | 
			
		||||
        lqw.like(StringUtils.isNotBlank(bo.getFileName()), DesCollectFile::getFileName, bo.getFileName());
 | 
			
		||||
        lqw.eq(StringUtils.isNotBlank(bo.getFileUrl()), DesCollectFile::getFileUrl, bo.getFileUrl());
 | 
			
		||||
        lqw.eq(StringUtils.isNotBlank(bo.getStatus()), DesCollectFile::getStatus, bo.getStatus());
 | 
			
		||||
        lqw.in(CollectionUtil.isNotEmpty(bo.getCatalogueIds()), DesCollectFile::getCatalogueId, bo.getCatalogueIds());
 | 
			
		||||
        return lqw;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -6,6 +6,8 @@ import cn.hutool.core.date.DateUtil;
 | 
			
		||||
import cn.hutool.core.util.ObjectUtil;
 | 
			
		||||
import cn.hutool.json.JSONUtil;
 | 
			
		||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 | 
			
		||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 | 
			
		||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 | 
			
		||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 | 
			
		||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 | 
			
		||||
import jakarta.annotation.Resource;
 | 
			
		||||
@ -30,6 +32,9 @@ 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.DesDrawing;
 | 
			
		||||
import org.dromara.design.domain.DesVolumeCatalog;
 | 
			
		||||
import org.dromara.design.domain.DesVolumeFile;
 | 
			
		||||
import org.dromara.design.domain.dto.designchange.DesDesignChangeCreateReq;
 | 
			
		||||
import org.dromara.design.domain.dto.designchange.DesDesignChangeQueryReq;
 | 
			
		||||
import org.dromara.design.domain.dto.designchange.DesDesignChangeUpdateReq;
 | 
			
		||||
@ -37,6 +42,9 @@ import org.dromara.design.domain.dto.designchange.DesDesignExtendDetailDto;
 | 
			
		||||
import org.dromara.design.domain.vo.designchange.DesDesignChangeVo;
 | 
			
		||||
import org.dromara.design.mapper.DesDesignChangeMapper;
 | 
			
		||||
import org.dromara.design.service.IDesDesignChangeService;
 | 
			
		||||
import org.dromara.design.service.IDesDrawingService;
 | 
			
		||||
import org.dromara.design.service.IDesVolumeCatalogService;
 | 
			
		||||
import org.dromara.design.service.IDesVolumeFileService;
 | 
			
		||||
import org.dromara.project.service.IBusProjectService;
 | 
			
		||||
import org.dromara.system.domain.vo.SysOssVo;
 | 
			
		||||
import org.dromara.system.service.ISysOssService;
 | 
			
		||||
@ -75,6 +83,16 @@ public class DesDesignChangeServiceImpl extends ServiceImpl<DesDesignChangeMappe
 | 
			
		||||
    @Resource
 | 
			
		||||
    private ISysOssService ossService;
 | 
			
		||||
 | 
			
		||||
    @Resource
 | 
			
		||||
    private IDesVolumeFileService volumeFileService;
 | 
			
		||||
 | 
			
		||||
    @Resource
 | 
			
		||||
    private IDesVolumeCatalogService volumeCatalogService;
 | 
			
		||||
 | 
			
		||||
    @Resource
 | 
			
		||||
    protected IDesDrawingService drawingService;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询设计变更管理
 | 
			
		||||
     *
 | 
			
		||||
@ -202,9 +220,6 @@ public class DesDesignChangeServiceImpl extends ServiceImpl<DesDesignChangeMappe
 | 
			
		||||
        BeanUtils.copyProperties(req, entity);
 | 
			
		||||
        validEntityBeforeSave(entity, true);
 | 
			
		||||
        entity.setDetail(JSONUtil.toJsonStr(req.getExtendDetail()));
 | 
			
		||||
        if("1".equals(req.getExtendDetail().getDesignDisposal())){
 | 
			
		||||
            //todo: 卷册号文件作废
 | 
			
		||||
        }
 | 
			
		||||
        boolean save = this.save(entity);
 | 
			
		||||
        if (!save) {
 | 
			
		||||
            throw new ServiceException("新增设计变更单失败", HttpStatus.ERROR);
 | 
			
		||||
@ -316,9 +331,9 @@ public class DesDesignChangeServiceImpl extends ServiceImpl<DesDesignChangeMappe
 | 
			
		||||
        List<Long> allFileIdList = new ArrayList<>();
 | 
			
		||||
        // 1. 添加单个 fileId(前提是非空)
 | 
			
		||||
        String fileId = designChange.getFileId();
 | 
			
		||||
        if (StringUtils.isNotBlank(fileId)) {
 | 
			
		||||
            allFileIdList.add(Long.valueOf(fileId));
 | 
			
		||||
        }
 | 
			
		||||
//        if (StringUtils.isNotBlank(fileId)) {
 | 
			
		||||
//            allFileIdList.add(Long.valueOf(fileId));
 | 
			
		||||
//        }
 | 
			
		||||
        // 2. 添加 attachmentPic 多个 ID
 | 
			
		||||
        String attachmentPic = designChange.getAttachmentPic();
 | 
			
		||||
        if (StringUtils.isNotBlank(attachmentPic)) {
 | 
			
		||||
@ -346,9 +361,12 @@ public class DesDesignChangeServiceImpl extends ServiceImpl<DesDesignChangeMappe
 | 
			
		||||
                .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);
 | 
			
		||||
                String[] split = fileId.split(",");
 | 
			
		||||
                List<Long> fileIds = Arrays.stream(split)
 | 
			
		||||
                    .map(Long::valueOf)
 | 
			
		||||
                    .collect(Collectors.toList());
 | 
			
		||||
                List<SysOssVo> ossVoList1 = ossService.listByIds(fileIds);
 | 
			
		||||
                vo.setOssVoList(ossVoList1);
 | 
			
		||||
            }
 | 
			
		||||
            // 2. 处理 attachmentPicList(多个)
 | 
			
		||||
            if (StringUtils.isNotBlank(attachmentPic)) {
 | 
			
		||||
@ -397,6 +415,7 @@ public class DesDesignChangeServiceImpl extends ServiceImpl<DesDesignChangeMappe
 | 
			
		||||
        String volumeName = req.getVolumeName();
 | 
			
		||||
        String volumeNo = req.getVolumeNo();
 | 
			
		||||
        String status = req.getStatus();
 | 
			
		||||
        lqw.orderByDesc(DesDesignChange::getId);
 | 
			
		||||
        lqw.eq(ObjectUtils.isNotEmpty(projectId), DesDesignChange::getProjectId, projectId);
 | 
			
		||||
        lqw.eq(ObjectUtils.isNotEmpty(formNo), DesDesignChange::getFormNo, formNo);
 | 
			
		||||
        lqw.eq(ObjectUtils.isNotEmpty(submitDate), DesDesignChange::getSubmitDate, submitDate);
 | 
			
		||||
@ -425,17 +444,18 @@ public class DesDesignChangeServiceImpl extends ServiceImpl<DesDesignChangeMappe
 | 
			
		||||
        if (CollUtil.isEmpty(designChangeList)) {
 | 
			
		||||
            return designChangeVoPage;
 | 
			
		||||
        }
 | 
			
		||||
        Set<Long> ossIdList = designChangeList.stream().map(DesDesignChange::getFileId).filter(Objects::nonNull).map(Long::parseLong).collect(Collectors.toSet());
 | 
			
		||||
        List<SysOssVo> ossVoList = ossService.listByIds(ossIdList);
 | 
			
		||||
        Map<Long, SysOssVo> ossVoMap = ossVoList.stream().collect(Collectors.toMap(SysOssVo::getOssId, Function.identity(), (a, b) -> a));
 | 
			
		||||
        List<DesDesignChangeVo> designChangeVoList = designChangeList.stream().map(designChange -> {
 | 
			
		||||
            DesDesignChangeVo designChangeVo = new DesDesignChangeVo();
 | 
			
		||||
            BeanUtils.copyProperties(designChange, designChangeVo);
 | 
			
		||||
            String fileId = designChange.getFileId();
 | 
			
		||||
            if (StringUtils.isNotBlank(fileId)) {
 | 
			
		||||
                SysOssVo file = ossVoMap.get(Long.valueOf(fileId));
 | 
			
		||||
                designChangeVo.setFile(file);
 | 
			
		||||
            }
 | 
			
		||||
                String fileId = designChangeVo.getFileId();
 | 
			
		||||
                if (fileId != null) {
 | 
			
		||||
                    String[] split = fileId.split(",");
 | 
			
		||||
                    List<Long> fileIds = Arrays.stream(split)
 | 
			
		||||
                        .map(Long::valueOf)
 | 
			
		||||
                        .collect(Collectors.toList());
 | 
			
		||||
                    List<SysOssVo> ossVoList1 = ossService.listByIds(fileIds);
 | 
			
		||||
                    designChangeVo.setOssVoList(ossVoList1);
 | 
			
		||||
                }
 | 
			
		||||
            return designChangeVo;
 | 
			
		||||
        }).toList();
 | 
			
		||||
        designChangeVoPage.setRecords(designChangeVoList);
 | 
			
		||||
@ -567,6 +587,58 @@ public class DesDesignChangeServiceImpl extends ServiceImpl<DesDesignChangeMappe
 | 
			
		||||
        if (processEvent.getSubmit()) {
 | 
			
		||||
            designChange.setStatus(BusinessStatusEnum.WAITING.getStatus());
 | 
			
		||||
        }
 | 
			
		||||
        if(BusinessStatusEnum.FINISH.getStatus().equals(processEvent.getStatus())){
 | 
			
		||||
            DesDesignExtendDetailDto bean = JSONUtil.toBean(designChange.getDetail(), DesDesignExtendDetailDto.class);
 | 
			
		||||
            DesVolumeCatalog volumeCatalog = volumeCatalogService.getOne(Wrappers.<DesVolumeCatalog>lambdaQuery()
 | 
			
		||||
                .eq(DesVolumeCatalog::getVolumeNumber, designChange.getVolumeNo())
 | 
			
		||||
                .eq(DesVolumeCatalog::getProjectId, designChange.getProjectId())
 | 
			
		||||
                .last("limit 1"));
 | 
			
		||||
 | 
			
		||||
            if("1".equals(bean.getDesignDisposal())){
 | 
			
		||||
                volumeFileService.lambdaUpdate()
 | 
			
		||||
                    .set(DesVolumeFile::getStatus, "2")
 | 
			
		||||
                    .eq(DesVolumeFile::getVolumeCatalogId, volumeCatalog.getDesign())
 | 
			
		||||
                    .update();
 | 
			
		||||
            }else if("2".equals(bean.getDesignDisposal())){
 | 
			
		||||
                LambdaUpdateWrapper<DesVolumeFile> wrapper =  new LambdaUpdateWrapper<>();
 | 
			
		||||
                wrapper.set(DesVolumeFile::getStatus, "2")
 | 
			
		||||
                    .eq(DesVolumeFile::getVolumeCatalogId, volumeCatalog.getDesign());
 | 
			
		||||
                String saveFile = designChange.getSaveFile();
 | 
			
		||||
                if(StringUtils.isNotBlank(saveFile)){
 | 
			
		||||
                    String[] split = saveFile.split(",");
 | 
			
		||||
                    List<Long> fileIds = Arrays.stream(split)
 | 
			
		||||
                        .map(Long::valueOf)
 | 
			
		||||
                        .collect(Collectors.toList());
 | 
			
		||||
                    wrapper.notIn(DesVolumeFile::getId, fileIds);
 | 
			
		||||
                }
 | 
			
		||||
                volumeFileService.update(wrapper);
 | 
			
		||||
            }
 | 
			
		||||
            String fileId = designChange.getFileId();
 | 
			
		||||
            if (fileId != null) {
 | 
			
		||||
                String[] split = fileId.split(",");
 | 
			
		||||
                List<Long> fileIds = Arrays.stream(split)
 | 
			
		||||
                    .map(Long::valueOf)
 | 
			
		||||
                    .collect(Collectors.toList());
 | 
			
		||||
                List<SysOssVo> ossVoList1 = ossService.listByIds(fileIds);
 | 
			
		||||
 | 
			
		||||
                for (SysOssVo ossVo : ossVoList1) {
 | 
			
		||||
                    DesVolumeFile desVolumeFile = new DesVolumeFile();
 | 
			
		||||
                    desVolumeFile.setVolumeCatalogId(volumeCatalog.getDesign());
 | 
			
		||||
                    desVolumeFile.setFileName(ossVo.getOriginalName());
 | 
			
		||||
                    desVolumeFile.setFileId(ossVo.getOssId());
 | 
			
		||||
                    desVolumeFile.setStatus("1");
 | 
			
		||||
                    desVolumeFile.setType("2");
 | 
			
		||||
 | 
			
		||||
                    volumeFileService.save(desVolumeFile);
 | 
			
		||||
 | 
			
		||||
                    DesDrawing desDrawing = new DesDrawing();
 | 
			
		||||
                    desDrawing.setProjectId(volumeCatalog.getProjectId());
 | 
			
		||||
                    desDrawing.setVolumeCatalogId(volumeCatalog.getDesign());
 | 
			
		||||
                    desDrawing.setVolumeFileId(desVolumeFile.getId());
 | 
			
		||||
                    drawingService.save(desDrawing);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        this.updateById(designChange);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -5,6 +5,7 @@ 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.core.toolkit.Wrappers;
 | 
			
		||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 | 
			
		||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 | 
			
		||||
import com.itextpdf.text.DocumentException;
 | 
			
		||||
@ -23,6 +24,8 @@ import org.dromara.common.mybatis.core.page.PageQuery;
 | 
			
		||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
 | 
			
		||||
import org.dromara.common.utils.PdfBoxQrCodeGenerator;
 | 
			
		||||
import org.dromara.design.domain.DesDrawing;
 | 
			
		||||
import org.dromara.design.domain.DesVolumeCatalog;
 | 
			
		||||
import org.dromara.design.domain.DesVolumeFile;
 | 
			
		||||
import org.dromara.design.domain.dto.drawing.DesDrawingCreateReq;
 | 
			
		||||
import org.dromara.design.domain.dto.drawing.DesDrawingQueryReq;
 | 
			
		||||
import org.dromara.design.domain.dto.drawing.DesDrawingUpdateReq;
 | 
			
		||||
@ -31,6 +34,8 @@ import org.dromara.design.enums.DesDrawingFileTypeEnum;
 | 
			
		||||
import org.dromara.design.enums.DesDrawingNewestEnum;
 | 
			
		||||
import org.dromara.design.mapper.DesDrawingMapper;
 | 
			
		||||
import org.dromara.design.service.IDesDrawingService;
 | 
			
		||||
import org.dromara.design.service.IDesVolumeCatalogService;
 | 
			
		||||
import org.dromara.design.service.IDesVolumeFileService;
 | 
			
		||||
import org.dromara.project.service.IBusProjectService;
 | 
			
		||||
import org.dromara.system.domain.vo.SysOssVo;
 | 
			
		||||
import org.dromara.system.service.ISysOssService;
 | 
			
		||||
@ -74,6 +79,14 @@ public class DesDrawingServiceImpl extends ServiceImpl<DesDrawingMapper, DesDraw
 | 
			
		||||
    @Resource
 | 
			
		||||
    private IDesDrawingService self;
 | 
			
		||||
 | 
			
		||||
    @Lazy
 | 
			
		||||
    @Resource
 | 
			
		||||
    private IDesVolumeCatalogService volumeCatalogService;
 | 
			
		||||
 | 
			
		||||
    @Lazy
 | 
			
		||||
    @Resource
 | 
			
		||||
    private IDesVolumeFileService volumeFilesService;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询图纸管理
 | 
			
		||||
     *
 | 
			
		||||
@ -241,9 +254,9 @@ public class DesDrawingServiceImpl extends ServiceImpl<DesDrawingMapper, DesDraw
 | 
			
		||||
        if (drawing == null) {
 | 
			
		||||
            return vo;
 | 
			
		||||
        }
 | 
			
		||||
        SysOssVo ossVo = ossService.getById(drawing.getFileUrl());
 | 
			
		||||
//        SysOssVo ossVo = ossService.getById(drawing.getFileUrl());
 | 
			
		||||
        BeanUtils.copyProperties(drawing, vo);
 | 
			
		||||
        vo.setFile(ossVo);
 | 
			
		||||
//        vo.setFile(ossVo);
 | 
			
		||||
        return vo;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -292,12 +305,28 @@ 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<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());
 | 
			
		||||
//            drawingVo.setFile(ossMap.get(entity.getFileUrl()).getFirst());
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            DesVolumeCatalog desVolumeCatalog =  volumeCatalogService.getById(drawingVo.getVolumeCatalogId());
 | 
			
		||||
            drawingVo.setSpecialty(desVolumeCatalog.getSpecialty());
 | 
			
		||||
            drawingVo.setVolumeNumber(desVolumeCatalog.getVolumeNumber());
 | 
			
		||||
            drawingVo.setDesignSubitem(desVolumeCatalog.getDesignSubitem());
 | 
			
		||||
            drawingVo.setPrincipal(desVolumeCatalog.getPrincipal());
 | 
			
		||||
 | 
			
		||||
            DesVolumeFile byId = volumeFilesService.getById(drawingVo.getVolumeFileId());
 | 
			
		||||
            SysOssVo byId1 = ossService.getById(byId.getFileId());
 | 
			
		||||
            drawingVo.setFileName(byId.getFileName());
 | 
			
		||||
            drawingVo.setType(byId.getType());
 | 
			
		||||
            drawingVo.setUrl(byId1.getUrl());
 | 
			
		||||
            drawingVo.setFileUrl(byId.getFileId());
 | 
			
		||||
            return drawingVo;
 | 
			
		||||
        }).toList();
 | 
			
		||||
        drawingVoPage.setRecords(drawingVoList);
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,6 @@
 | 
			
		||||
package org.dromara.design.service.impl;
 | 
			
		||||
 | 
			
		||||
import cn.hutool.core.bean.BeanUtil;
 | 
			
		||||
import cn.hutool.core.collection.CollectionUtil;
 | 
			
		||||
import cn.hutool.core.convert.Convert;
 | 
			
		||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 | 
			
		||||
@ -26,15 +27,17 @@ import lombok.RequiredArgsConstructor;
 | 
			
		||||
import org.dromara.common.oss.exception.OssException;
 | 
			
		||||
import org.dromara.common.utils.DocumentUtil;
 | 
			
		||||
import org.dromara.design.constant.DesDesignConstant;
 | 
			
		||||
import org.dromara.design.domain.DesCollect;
 | 
			
		||||
import org.dromara.design.domain.DesCollectCatalogue;
 | 
			
		||||
import org.dromara.design.domain.DesExtractCatalogue;
 | 
			
		||||
import org.dromara.design.domain.*;
 | 
			
		||||
import org.dromara.design.domain.bo.DesCollectFileBo;
 | 
			
		||||
import org.dromara.design.domain.bo.DesExtractCatalogueBo;
 | 
			
		||||
import org.dromara.design.domain.dto.desCollect.DesCollectCatalogueWordDto;
 | 
			
		||||
import org.dromara.design.domain.dto.desCollect.DesCollectWordDto;
 | 
			
		||||
import org.dromara.design.domain.dto.desExtract.DesExtractBatchDto;
 | 
			
		||||
import org.dromara.design.domain.vo.DesCollectFileVo;
 | 
			
		||||
import org.dromara.design.domain.vo.DesExtractCatalogueVo;
 | 
			
		||||
import org.dromara.design.service.IDesCollectFileService;
 | 
			
		||||
import org.dromara.design.service.IDesExtractCatalogueService;
 | 
			
		||||
import org.dromara.design.service.IDesVolumeFileService;
 | 
			
		||||
import org.dromara.project.service.IBusProjectService;
 | 
			
		||||
import org.springframework.beans.BeanUtils;
 | 
			
		||||
import org.springframework.context.event.EventListener;
 | 
			
		||||
@ -42,7 +45,6 @@ import org.springframework.http.MediaType;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
import org.dromara.design.domain.bo.DesExtractBo;
 | 
			
		||||
import org.dromara.design.domain.vo.DesExtractVo;
 | 
			
		||||
import org.dromara.design.domain.DesExtract;
 | 
			
		||||
import org.dromara.design.mapper.DesExtractMapper;
 | 
			
		||||
import org.dromara.design.service.IDesExtractService;
 | 
			
		||||
import org.springframework.transaction.annotation.Transactional;
 | 
			
		||||
@ -78,6 +80,8 @@ public class DesExtractServiceImpl extends ServiceImpl<DesExtractMapper, DesExtr
 | 
			
		||||
 | 
			
		||||
    private final DictService dictService;
 | 
			
		||||
 | 
			
		||||
    private final IDesVolumeFileService volumeFileService;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询提资清单
 | 
			
		||||
     *
 | 
			
		||||
@ -85,7 +89,7 @@ public class DesExtractServiceImpl extends ServiceImpl<DesExtractMapper, DesExtr
 | 
			
		||||
     * @return 提资清单
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public DesExtractVo queryById(Long id){
 | 
			
		||||
    public DesExtractVo queryById(Long id) {
 | 
			
		||||
        DesExtractVo desExtractVo = baseMapper.selectVoById(id);
 | 
			
		||||
        DesExtractCatalogueBo desExtractCatalogueBo = new DesExtractCatalogueBo();
 | 
			
		||||
        desExtractCatalogueBo.setExtractId(id);
 | 
			
		||||
@ -167,7 +171,7 @@ public class DesExtractServiceImpl extends ServiceImpl<DesExtractMapper, DesExtr
 | 
			
		||||
    /**
 | 
			
		||||
     * 保存前的数据校验
 | 
			
		||||
     */
 | 
			
		||||
    private void validEntityBeforeSave(DesExtract entity){
 | 
			
		||||
    private void validEntityBeforeSave(DesExtract entity) {
 | 
			
		||||
        //TODO 做一些数据校验,如唯一约束
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -180,7 +184,7 @@ public class DesExtractServiceImpl extends ServiceImpl<DesExtractMapper, DesExtr
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
 | 
			
		||||
        if(isValid){
 | 
			
		||||
        if (isValid) {
 | 
			
		||||
            //TODO 做一些业务上的校验,判断是否需要校验
 | 
			
		||||
        }
 | 
			
		||||
        return baseMapper.deleteByIds(ids) > 0;
 | 
			
		||||
@ -191,17 +195,20 @@ public class DesExtractServiceImpl extends ServiceImpl<DesExtractMapper, DesExtr
 | 
			
		||||
    public Long batchAddOrUpdate(DesExtractBatchDto dto) {
 | 
			
		||||
        DesExtract convert = MapstructUtils.convert(dto.getDesExtractBo(), DesExtract.class);
 | 
			
		||||
        super.saveOrUpdate(convert);
 | 
			
		||||
        if(CollectionUtil.isNotEmpty(dto.getCatalogueList())){
 | 
			
		||||
            extractCatalogueService.remove(Wrappers.<DesExtractCatalogue>lambdaQuery()
 | 
			
		||||
                .eq(DesExtractCatalogue::getExtractId,convert.getId()));
 | 
			
		||||
 | 
			
		||||
            dto.getCatalogueList().forEach(item -> {
 | 
			
		||||
                    item.setExtractId(convert.getId());
 | 
			
		||||
                    item.setProjectId(convert.getProjectId());
 | 
			
		||||
                }
 | 
			
		||||
            );
 | 
			
		||||
            extractCatalogueService.saveBatch(MapstructUtils.convert(dto.getCatalogueList(), DesExtractCatalogue.class));
 | 
			
		||||
        if (CollectionUtil.isEmpty(dto.getCatalogueList())) {
 | 
			
		||||
            throw new ServiceException("提资清单目录不能为空");
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        extractCatalogueService.remove(Wrappers.<DesExtractCatalogue>lambdaQuery()
 | 
			
		||||
            .eq(DesExtractCatalogue::getExtractId, convert.getId()));
 | 
			
		||||
        dto.getCatalogueList().forEach(item -> {
 | 
			
		||||
                item.setExtractId(convert.getId());
 | 
			
		||||
                item.setProjectId(convert.getProjectId());
 | 
			
		||||
            }
 | 
			
		||||
        );
 | 
			
		||||
        extractCatalogueService.saveBatch(MapstructUtils.convert(dto.getCatalogueList(), DesExtractCatalogue.class));
 | 
			
		||||
 | 
			
		||||
        return convert.getId();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -227,7 +234,7 @@ public class DesExtractServiceImpl extends ServiceImpl<DesExtractMapper, DesExtr
 | 
			
		||||
            // 准备数据
 | 
			
		||||
            List<DesExtractCatalogue> itemList = extractCatalogueService.list(Wrappers.
 | 
			
		||||
                <DesExtractCatalogue>lambdaQuery().eq(DesExtractCatalogue::getExtractId, id));
 | 
			
		||||
            DesCollectWordDto data =  this.getReplacementDto(desExtract, itemList);
 | 
			
		||||
            DesCollectWordDto data = this.getReplacementDto(desExtract, itemList);
 | 
			
		||||
            // 生成文件
 | 
			
		||||
            try (InputStream is = getClass().getClassLoader().getResourceAsStream(DesDesignConstant.DESIGN_EXTRACT_TEMPLATE_PATH)) {
 | 
			
		||||
                if (is == null) {
 | 
			
		||||
@ -282,7 +289,15 @@ public class DesExtractServiceImpl extends ServiceImpl<DesExtractMapper, DesExtr
 | 
			
		||||
        return dto;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<DesCollectFileVo> fileList(Long id) {
 | 
			
		||||
        List<Long> catalogIds = extractCatalogueService.list(Wrappers.<DesExtractCatalogue>lambdaQuery()
 | 
			
		||||
            .eq(DesExtractCatalogue::getExtractId, id)).stream().map(DesExtractCatalogue::getVolumeCatalogId).toList();
 | 
			
		||||
        DesCollectFileBo desCollectFileBo = new DesCollectFileBo();
 | 
			
		||||
        desCollectFileBo.setCatalogueIds(catalogIds);
 | 
			
		||||
        List<DesVolumeFile> list = volumeFileService.list(Wrappers.<DesVolumeFile>lambdaQuery().in(DesVolumeFile::getVolumeCatalogId, catalogIds));
 | 
			
		||||
        return BeanUtil.copyToList(list, DesCollectFileVo.class);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等)
 | 
			
		||||
@ -294,7 +309,7 @@ public class DesExtractServiceImpl extends ServiceImpl<DesExtractMapper, DesExtr
 | 
			
		||||
    @EventListener(condition = "#processEvent.flowCode.endsWith('extract')")
 | 
			
		||||
    public void processHandler(ProcessEvent processEvent) {
 | 
			
		||||
        log.info("收资清单审核任务执行了{}", processEvent.toString());
 | 
			
		||||
        DesExtract desExtract =  this.getById(Convert.toLong(processEvent.getBusinessId()));
 | 
			
		||||
        DesExtract desExtract = this.getById(Convert.toLong(processEvent.getBusinessId()));
 | 
			
		||||
        desExtract.setStatus(processEvent.getStatus());
 | 
			
		||||
        if (processEvent.getSubmit()) {
 | 
			
		||||
            desExtract.setStatus(BusinessStatusEnum.WAITING.getStatus());
 | 
			
		||||
@ -331,9 +346,4 @@ public class DesExtractServiceImpl extends ServiceImpl<DesExtractMapper, DesExtr
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -89,6 +89,7 @@ public class DesPrelimSchemeServiceImpl extends ServiceImpl<DesPrelimSchemeMappe
 | 
			
		||||
    private LambdaQueryWrapper<DesPrelimScheme> buildQueryWrapper(DesPrelimSchemeBo bo) {
 | 
			
		||||
        Map<String, Object> params = bo.getParams();
 | 
			
		||||
        LambdaQueryWrapper<DesPrelimScheme> lqw = Wrappers.lambdaQuery();
 | 
			
		||||
        lqw.orderByAsc(DesPrelimScheme::getOrderNum);
 | 
			
		||||
        lqw.orderByDesc(DesPrelimScheme::getId);
 | 
			
		||||
        lqw.eq(bo.getProjectId() != null, DesPrelimScheme::getProjectId, bo.getProjectId());
 | 
			
		||||
        lqw.eq(bo.getOssId()!= null, DesPrelimScheme::getOssId, bo.getOssId());
 | 
			
		||||
@ -172,7 +173,7 @@ public class DesPrelimSchemeServiceImpl extends ServiceImpl<DesPrelimSchemeMappe
 | 
			
		||||
            SysOssVo upload = ossService.upload(file, ossService.minioFileName(ContactNoticeTemplate, file));
 | 
			
		||||
 | 
			
		||||
            desPrelimScheme.setOssId(upload.getOssId());
 | 
			
		||||
            desPrelimScheme.setFileName(upload.getFileName());
 | 
			
		||||
            desPrelimScheme.setFileName(upload.getOriginalName());
 | 
			
		||||
            desPrelimScheme.setFileUrl(upload.getUrl());
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -191,6 +192,7 @@ public class DesPrelimSchemeServiceImpl extends ServiceImpl<DesPrelimSchemeMappe
 | 
			
		||||
        log.info("初步设计方案审核任务执行了{}", processEvent.toString());
 | 
			
		||||
        DesPrelimScheme prelimScheme = this.getById(Convert.toLong(processEvent.getBusinessId()));
 | 
			
		||||
        prelimScheme.setStatus(processEvent.getStatus());
 | 
			
		||||
        prelimScheme.setOrderNum(BusinessStatusEnum.getByStatus(processEvent.getStatus()).getOrder());
 | 
			
		||||
        if (processEvent.getSubmit()) {
 | 
			
		||||
            prelimScheme.setStatus(BusinessStatusEnum.WAITING.getStatus());
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -93,6 +93,7 @@ public class DesSchemeServiceImpl extends ServiceImpl<DesSchemeMapper, DesScheme
 | 
			
		||||
    private LambdaQueryWrapper<DesScheme> buildQueryWrapper(DesSchemeBo bo) {
 | 
			
		||||
        Map<String, Object> params = bo.getParams();
 | 
			
		||||
        LambdaQueryWrapper<DesScheme> lqw = Wrappers.lambdaQuery();
 | 
			
		||||
        lqw.orderByAsc(DesScheme::getOrderNum);
 | 
			
		||||
        lqw.orderByDesc(DesScheme::getId);
 | 
			
		||||
        lqw.eq(bo.getProjectId() != null, DesScheme::getProjectId, bo.getProjectId());
 | 
			
		||||
        lqw.eq(bo.getOssId()!= null, DesScheme::getOssId, bo.getOssId());
 | 
			
		||||
@ -194,6 +195,7 @@ public class DesSchemeServiceImpl extends ServiceImpl<DesSchemeMapper, DesScheme
 | 
			
		||||
        log.info("设计方案审核任务执行了{}", processEvent.toString());
 | 
			
		||||
        DesScheme descScheme =  this.getById(Convert.toLong(processEvent.getBusinessId()));
 | 
			
		||||
        descScheme.setStatus(processEvent.getStatus());
 | 
			
		||||
        descScheme.setOrderNum(BusinessStatusEnum.getByStatus(processEvent.getStatus()).getOrder());
 | 
			
		||||
        if (processEvent.getSubmit()) {
 | 
			
		||||
            descScheme.setStatus(BusinessStatusEnum.WAITING.getStatus());
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -11,6 +11,7 @@ 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.utils.ObjectUtils;
 | 
			
		||||
import org.dromara.common.core.utils.StringUtils;
 | 
			
		||||
@ -23,6 +24,7 @@ import org.dromara.design.domain.dto.volumecatalog.DesVolumeCatalogQueryReq;
 | 
			
		||||
import org.dromara.design.domain.dto.volumecatalog.DesVolumeCatalogUpdateReq;
 | 
			
		||||
import org.dromara.design.domain.vo.volumecatalog.DesVolumeCatalogVo;
 | 
			
		||||
import org.dromara.design.mapper.DesVolumeCatalogMapper;
 | 
			
		||||
import org.dromara.design.service.IDesDrawingService;
 | 
			
		||||
import org.dromara.design.service.IDesVolumeCatalogService;
 | 
			
		||||
import org.dromara.design.service.IDesVolumeFileService;
 | 
			
		||||
import org.dromara.design.service.IDesVolumeFileViewerService;
 | 
			
		||||
@ -66,6 +68,8 @@ public class DesVolumeCatalogServiceImpl extends ServiceImpl<DesVolumeCatalogMap
 | 
			
		||||
    @Resource
 | 
			
		||||
    private IDesVolumeFileViewerService volumeFileViewerService;
 | 
			
		||||
 | 
			
		||||
    @Resource
 | 
			
		||||
    protected IDesDrawingService drawingService;
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询卷册目录
 | 
			
		||||
     *
 | 
			
		||||
@ -265,9 +269,11 @@ public class DesVolumeCatalogServiceImpl extends ServiceImpl<DesVolumeCatalogMap
 | 
			
		||||
        Long projectId = req.getProjectId();
 | 
			
		||||
        String volumeNumber = req.getVolumeNumber();
 | 
			
		||||
        String documentName = req.getDocumentName();
 | 
			
		||||
        String auditStatus = req.getAuditStatus();
 | 
			
		||||
        lqw.like(StringUtils.isNotBlank(documentName), DesVolumeCatalog::getDocumentName, documentName);
 | 
			
		||||
        lqw.eq(StringUtils.isNotBlank(volumeNumber), DesVolumeCatalog::getVolumeNumber, volumeNumber);
 | 
			
		||||
        lqw.eq(ObjectUtils.isNotEmpty(projectId), DesVolumeCatalog::getProjectId, projectId);
 | 
			
		||||
        lqw.eq(StringUtils.isNotBlank(auditStatus),DesVolumeCatalog::getAuditStatus, auditStatus);
 | 
			
		||||
        return lqw;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -341,6 +347,22 @@ public class DesVolumeCatalogServiceImpl extends ServiceImpl<DesVolumeCatalogMap
 | 
			
		||||
        if (processEvent.getStatus().equals("finish")){
 | 
			
		||||
            desVolumeCatalog.setDesignState("1");
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if(BusinessStatusEnum.FINISH.getStatus().equals(processEvent.getStatus())){
 | 
			
		||||
            ArrayList<DesDrawing> desDrawings = new ArrayList<>();
 | 
			
		||||
 | 
			
		||||
            List<DesVolumeFile> list = volumeFileService.lambdaQuery().eq(DesVolumeFile::getVolumeCatalogId, id).list();
 | 
			
		||||
 | 
			
		||||
            for (DesVolumeFile desVolumeFile : list) {
 | 
			
		||||
                DesDrawing desDrawing = new DesDrawing();
 | 
			
		||||
                desDrawing.setProjectId(desVolumeCatalog.getProjectId());
 | 
			
		||||
                desDrawing.setVolumeCatalogId(desVolumeCatalog.getDesign());
 | 
			
		||||
                desDrawing.setVolumeFileId(desVolumeFile.getId());
 | 
			
		||||
                desDrawings.add(desDrawing);
 | 
			
		||||
            }
 | 
			
		||||
            drawingService.saveBatch(desDrawings);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        this.updateById(desVolumeCatalog);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,9 +1,11 @@
 | 
			
		||||
package org.dromara.design.service.impl;
 | 
			
		||||
 | 
			
		||||
import cn.hutool.core.collection.CollUtil;
 | 
			
		||||
import cn.hutool.core.collection.CollectionUtil;
 | 
			
		||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 | 
			
		||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 | 
			
		||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 | 
			
		||||
import com.esotericsoftware.kryo.serializers.DefaultSerializers;
 | 
			
		||||
import jakarta.annotation.Resource;
 | 
			
		||||
import org.dromara.common.core.constant.HttpStatus;
 | 
			
		||||
import org.dromara.common.core.exception.ServiceException;
 | 
			
		||||
@ -24,6 +26,7 @@ import org.springframework.transaction.annotation.Transactional;
 | 
			
		||||
 | 
			
		||||
import java.time.LocalDate;
 | 
			
		||||
import java.time.format.DateTimeFormatter;
 | 
			
		||||
import java.util.ArrayList;
 | 
			
		||||
import java.util.Collection;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
@ -77,61 +80,68 @@ public class DesVolumeFileServiceImpl extends ServiceImpl<DesVolumeFileMapper, D
 | 
			
		||||
            throw new ServiceException("对应卷册目录不存在", HttpStatus.NOT_FOUND);
 | 
			
		||||
        }
 | 
			
		||||
        // 判断是否需要废除其他文件
 | 
			
		||||
        List<Long> cancellationIds = req.getCancellationIds();
 | 
			
		||||
        if (CollUtil.isNotEmpty(cancellationIds)) {
 | 
			
		||||
            List<DesVolumeFile> list = this.listByIds(cancellationIds);
 | 
			
		||||
            list.forEach(item -> {
 | 
			
		||||
                if (item.getStatus().equals("2")) {
 | 
			
		||||
                    return;
 | 
			
		||||
                }
 | 
			
		||||
                String name = item.getFileName();
 | 
			
		||||
                String modified = name.replaceAll("((\\d{8}))", "($1-已作废)");
 | 
			
		||||
                item.setFileName(modified);
 | 
			
		||||
                item.setStatus("2");
 | 
			
		||||
            });
 | 
			
		||||
            if (CollUtil.isNotEmpty(list)) {
 | 
			
		||||
                boolean update = this.updateBatchById(list);
 | 
			
		||||
                if (!update) {
 | 
			
		||||
                    throw new ServiceException("更新卷册文件信息异常", HttpStatus.ERROR);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
//        List<Long> cancellationIds = req.getCancellationIds();
 | 
			
		||||
//        if (CollUtil.isNotEmpty(cancellationIds)) {
 | 
			
		||||
//            List<DesVolumeFile> list = this.listByIds(cancellationIds);
 | 
			
		||||
//            list.forEach(item -> {
 | 
			
		||||
//                if (item.getStatus().equals("2")) {
 | 
			
		||||
//                    return;
 | 
			
		||||
//                }
 | 
			
		||||
//                String name = item.getFileName();
 | 
			
		||||
//                String modified = name.replaceAll("((\\d{8}))", "($1-已作废)");
 | 
			
		||||
//                item.setFileName(modified);
 | 
			
		||||
//                item.setStatus("2");
 | 
			
		||||
//            });
 | 
			
		||||
//            if (CollUtil.isNotEmpty(list)) {
 | 
			
		||||
//                boolean update = this.updateBatchById(list);
 | 
			
		||||
//                if (!update) {
 | 
			
		||||
//                    throw new ServiceException("更新卷册文件信息异常", HttpStatus.ERROR);
 | 
			
		||||
//                }
 | 
			
		||||
//            }
 | 
			
		||||
//        }
 | 
			
		||||
        // 新增审阅人
 | 
			
		||||
        List<Long> userIds = req.getUserIds();
 | 
			
		||||
        if (CollUtil.isNotEmpty(userIds)) {
 | 
			
		||||
            List<DesVolumeFileViewer> viewerList = userIds.stream().map(userId -> {
 | 
			
		||||
                DesVolumeFileViewer viewer = new DesVolumeFileViewer();
 | 
			
		||||
                viewer.setVolumeCatalogId(volumeCatalogId);
 | 
			
		||||
                viewer.setUserId(userId);
 | 
			
		||||
                return viewer;
 | 
			
		||||
            }).toList();
 | 
			
		||||
            // 删除以前的审阅人
 | 
			
		||||
            Long count = volumeFileViewerService.lambdaQuery()
 | 
			
		||||
                .eq(DesVolumeFileViewer::getVolumeCatalogId, volumeCatalogId)
 | 
			
		||||
                .count();
 | 
			
		||||
            if (count > 0) {
 | 
			
		||||
                boolean remove = volumeFileViewerService.remove(new LambdaQueryWrapper<DesVolumeFileViewer>()
 | 
			
		||||
                    .eq(DesVolumeFileViewer::getVolumeCatalogId, volumeCatalogId));
 | 
			
		||||
                if (!remove) {
 | 
			
		||||
                    throw new ServiceException("修改审阅人失败", HttpStatus.ERROR);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            boolean result = volumeFileViewerService.saveBatch(viewerList);
 | 
			
		||||
            if (!result) {
 | 
			
		||||
                throw new ServiceException("修改审阅人失败", HttpStatus.ERROR);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
//        List<Long> userIds = req.getUserIds();
 | 
			
		||||
//        if (CollUtil.isNotEmpty(userIds)) {
 | 
			
		||||
//            List<DesVolumeFileViewer> viewerList = userIds.stream().map(userId -> {
 | 
			
		||||
//                DesVolumeFileViewer viewer = new DesVolumeFileViewer();
 | 
			
		||||
//                viewer.setVolumeCatalogId(volumeCatalogId);
 | 
			
		||||
//                viewer.setUserId(userId);
 | 
			
		||||
//                return viewer;
 | 
			
		||||
//            }).toList();
 | 
			
		||||
//            // 删除以前的审阅人
 | 
			
		||||
//            Long count = volumeFileViewerService.lambdaQuery()
 | 
			
		||||
//                .eq(DesVolumeFileViewer::getVolumeCatalogId, volumeCatalogId)
 | 
			
		||||
//                .count();
 | 
			
		||||
//            if (count > 0) {
 | 
			
		||||
//                boolean remove = volumeFileViewerService.remove(new LambdaQueryWrapper<DesVolumeFileViewer>()
 | 
			
		||||
//                    .eq(DesVolumeFileViewer::getVolumeCatalogId, volumeCatalogId));
 | 
			
		||||
//                if (!remove) {
 | 
			
		||||
//                    throw new ServiceException("修改审阅人失败", HttpStatus.ERROR);
 | 
			
		||||
//                }
 | 
			
		||||
//            }
 | 
			
		||||
//            boolean result = volumeFileViewerService.saveBatch(viewerList);
 | 
			
		||||
//            if (!result) {
 | 
			
		||||
//                throw new ServiceException("修改审阅人失败", HttpStatus.ERROR);
 | 
			
		||||
//            }
 | 
			
		||||
//        }
 | 
			
		||||
        // 查看文件是否存在
 | 
			
		||||
        if (req.getFileId() != null) {
 | 
			
		||||
            SysOssVo ossVo = ossService.getById(req.getFileId());
 | 
			
		||||
            if (ossVo == null) {
 | 
			
		||||
                throw new ServiceException("对应文件不存在", HttpStatus.NOT_FOUND);
 | 
			
		||||
        if (CollectionUtil.isNotEmpty(req.getFileIds())) {
 | 
			
		||||
 | 
			
		||||
            ArrayList<DesVolumeFile> desVolumeFiles = new ArrayList<>();
 | 
			
		||||
 | 
			
		||||
            for (Long fileId : req.getFileIds()){
 | 
			
		||||
                SysOssVo ossVo = ossService.getById(fileId);
 | 
			
		||||
                if (ossVo == null) {
 | 
			
		||||
                    throw new ServiceException("对应文件不存在", HttpStatus.NOT_FOUND);
 | 
			
		||||
                }
 | 
			
		||||
                DesVolumeFile file = new DesVolumeFile();
 | 
			
		||||
                BeanUtils.copyProperties(req, file);
 | 
			
		||||
                file.setFileId(fileId);
 | 
			
		||||
                String today = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd"));
 | 
			
		||||
                file.setFileName(ossVo.getOriginalName() + "(" + today + ")");
 | 
			
		||||
                desVolumeFiles.add(file);
 | 
			
		||||
            }
 | 
			
		||||
            DesVolumeFile file = new DesVolumeFile();
 | 
			
		||||
            BeanUtils.copyProperties(req, file);
 | 
			
		||||
            String today = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd"));
 | 
			
		||||
            file.setFileName(ossVo.getOriginalName() + "(" + today + ")");
 | 
			
		||||
            boolean save = this.save(file);
 | 
			
		||||
            boolean save = saveBatch(desVolumeFiles);
 | 
			
		||||
            if (!save) {
 | 
			
		||||
                throw new ServiceException("新增卷册文件信息异常", HttpStatus.ERROR);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
@ -28,6 +28,16 @@ public class MatMaterialReceive extends BaseEntity {
 | 
			
		||||
    @TableId(value = "id")
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 采购单编号
 | 
			
		||||
     */
 | 
			
		||||
    private String docCode;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 采购单id
 | 
			
		||||
     */
 | 
			
		||||
    private Long docId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 项目id
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
@ -97,4 +97,14 @@ public class MatMaterialReceiveCreateReq implements Serializable {
 | 
			
		||||
     */
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 采购单编号
 | 
			
		||||
     */
 | 
			
		||||
    private String docCode;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 采购单id
 | 
			
		||||
     */
 | 
			
		||||
    private Long docId;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -107,4 +107,15 @@ public class MatMaterialsVo implements Serializable {
 | 
			
		||||
    @ExcelProperty(value = "创建时间")
 | 
			
		||||
    private Date createTime;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 采购单编号
 | 
			
		||||
     */
 | 
			
		||||
    private String docCode;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 采购单id
 | 
			
		||||
     */
 | 
			
		||||
    private Long docId;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -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.cailiaoshebei.mapper.BusLtnMapper">
 | 
			
		||||
 | 
			
		||||
</mapper>
 | 
			
		||||
		Reference in New Issue
	
	Block a user