[add] 物料接收领料单,明细模块增删改查、按模版导出接口
This commit is contained in:
		@ -62,6 +62,12 @@
 | 
			
		||||
            <version>2.0.29</version>
 | 
			
		||||
        </dependency>
 | 
			
		||||
 | 
			
		||||
        <dependency>
 | 
			
		||||
            <groupId>com.deepoove</groupId>
 | 
			
		||||
            <artifactId>poi-tl</artifactId>
 | 
			
		||||
            <version>1.12.2</version> <!-- 建议使用最新版本 -->
 | 
			
		||||
        </dependency>
 | 
			
		||||
 | 
			
		||||
        <!-- 通用工具-->
 | 
			
		||||
        <dependency>
 | 
			
		||||
            <groupId>org.dromara</groupId>
 | 
			
		||||
 | 
			
		||||
@ -246,6 +246,9 @@ public class JSTUtil {
 | 
			
		||||
        FacFeatureByPlane nearestPolygon = null;
 | 
			
		||||
        double minDistance = Double.MAX_VALUE;
 | 
			
		||||
        for (FacFeatureByPlane polygonFeature : polygons) {
 | 
			
		||||
            if (polygonFeature == null || polygonFeature.getGeometry() == null) {
 | 
			
		||||
                continue; // 跳过空对象
 | 
			
		||||
            }
 | 
			
		||||
            List<List<Double>> polyCoords = polygonFeature.getGeometry().getCoordinates().getFirst();
 | 
			
		||||
            Coordinate[] polygonCoords = polyCoords.stream()
 | 
			
		||||
                .map(c -> new Coordinate(c.getFirst(), c.get(1)))
 | 
			
		||||
 | 
			
		||||
@ -1,17 +1,13 @@
 | 
			
		||||
package org.dromara.common.utils.documentOperations;
 | 
			
		||||
 | 
			
		||||
import io.swagger.v3.oas.annotations.security.OAuthFlow;
 | 
			
		||||
import jakarta.annotation.Resource;
 | 
			
		||||
import org.apache.pdfbox.pdmodel.PDDocument;
 | 
			
		||||
import org.apache.pdfbox.rendering.PDFRenderer;
 | 
			
		||||
import org.docx4j.Docx4J;
 | 
			
		||||
import org.docx4j.openpackaging.exceptions.Docx4JException;
 | 
			
		||||
import org.docx4j.openpackaging.packages.WordprocessingMLPackage;
 | 
			
		||||
 | 
			
		||||
import org.apache.pdfbox.pdmodel.PDDocument;
 | 
			
		||||
import org.apache.pdfbox.rendering.PDFRenderer;
 | 
			
		||||
import org.dromara.common.oss.core.OssClient;
 | 
			
		||||
import org.dromara.system.domain.vo.SysOssUploadVo;
 | 
			
		||||
import org.dromara.system.service.ISysOssService;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
import org.springframework.mock.web.MockMultipartFile;
 | 
			
		||||
import org.springframework.stereotype.Component;
 | 
			
		||||
import org.springframework.web.multipart.MultipartFile;
 | 
			
		||||
@ -19,19 +15,24 @@ import org.springframework.web.multipart.MultipartFile;
 | 
			
		||||
import javax.imageio.ImageIO;
 | 
			
		||||
import java.awt.*;
 | 
			
		||||
import java.awt.image.BufferedImage;
 | 
			
		||||
import java.io.*;
 | 
			
		||||
import java.util.*;
 | 
			
		||||
import java.io.ByteArrayInputStream;
 | 
			
		||||
import java.io.ByteArrayOutputStream;
 | 
			
		||||
import java.io.File;
 | 
			
		||||
import java.io.IOException;
 | 
			
		||||
import java.util.ArrayList;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
import static org.dromara.common.constant.MinioPathConstant.ContactNotice;
 | 
			
		||||
 | 
			
		||||
@Component
 | 
			
		||||
public class WordToPdfToImg {
 | 
			
		||||
    @Autowired
 | 
			
		||||
 | 
			
		||||
    @Resource
 | 
			
		||||
    private ISysOssService ossService;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * wordToImg 根据file生成缩略图(路径)
 | 
			
		||||
     *
 | 
			
		||||
     * @param file 文件
 | 
			
		||||
     */
 | 
			
		||||
    public String wordToImg(MultipartFile file) throws Docx4JException, IOException {
 | 
			
		||||
@ -75,6 +76,7 @@ public class WordToPdfToImg {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * convertWordToImage 根据MultipartFile转成缩略图 并上传至minio
 | 
			
		||||
     *
 | 
			
		||||
     * @param wordFile 文件
 | 
			
		||||
     */
 | 
			
		||||
    public SysOssUploadVo convertWordToImage(MultipartFile wordFile) throws Exception {
 | 
			
		||||
@ -119,7 +121,7 @@ public class WordToPdfToImg {
 | 
			
		||||
            "image/png",                              // ContentType
 | 
			
		||||
            new ByteArrayInputStream(imageOut.toByteArray()) // 文件内容
 | 
			
		||||
        );
 | 
			
		||||
        return ossService.uploadWithNoSave(image,ossService.minioFileName(ContactNotice,image));
 | 
			
		||||
        return ossService.uploadWithNoSave(image, ossService.minioFileName(ContactNotice, image));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
//    public static void main(String[] args) throws Exception {
 | 
			
		||||
 | 
			
		||||
@ -1,23 +1,23 @@
 | 
			
		||||
package org.dromara.cory.service.impl;
 | 
			
		||||
 | 
			
		||||
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 com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 | 
			
		||||
import lombok.RequiredArgsConstructor;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
import org.dromara.common.core.utils.MapstructUtils;
 | 
			
		||||
import org.dromara.common.core.utils.ObjectUtils;
 | 
			
		||||
import org.dromara.common.mybatis.core.page.PageQuery;
 | 
			
		||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
 | 
			
		||||
import org.dromara.cory.domain.BusContactnotice;
 | 
			
		||||
import org.dromara.cory.domain.bo.BusContactnoticeBo;
 | 
			
		||||
import org.dromara.cory.domain.vo.BusContactnoticeVo;
 | 
			
		||||
import org.dromara.cory.domain.BusContactnotice;
 | 
			
		||||
import org.dromara.cory.mapper.BusContactnoticeMapper;
 | 
			
		||||
import org.dromara.cory.service.IBusContactnoticeService;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
 | 
			
		||||
import java.util.Collection;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
import java.util.Map;
 | 
			
		||||
import java.util.Collection;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 联系单Service业务层处理
 | 
			
		||||
@ -38,7 +38,7 @@ public class BusContactnoticeServiceImpl implements IBusContactnoticeService {
 | 
			
		||||
     * @return 联系单
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public BusContactnoticeVo queryById(Long id){
 | 
			
		||||
    public BusContactnoticeVo queryById(Long id) {
 | 
			
		||||
        return baseMapper.selectVoById(id);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -73,6 +73,7 @@ public class BusContactnoticeServiceImpl implements IBusContactnoticeService {
 | 
			
		||||
        LambdaQueryWrapper<BusContactnotice> lqw = Wrappers.lambdaQuery();
 | 
			
		||||
        lqw.orderByAsc(BusContactnotice::getId);
 | 
			
		||||
        lqw.eq(bo.getProjectId() != null, BusContactnotice::getProjectId, bo.getProjectId());
 | 
			
		||||
        lqw.eq(ObjectUtils.isNotEmpty(bo.getType()), BusContactnotice::getType, bo.getType());
 | 
			
		||||
        lqw.in(bo.getTypes() != null, BusContactnotice::getType, bo.getTypes());
 | 
			
		||||
        return lqw;
 | 
			
		||||
    }
 | 
			
		||||
@ -87,7 +88,7 @@ public class BusContactnoticeServiceImpl implements IBusContactnoticeService {
 | 
			
		||||
    public Boolean insertByBo(BusContactnoticeBo bo) {
 | 
			
		||||
        BusContactnotice add = MapstructUtils.convert(bo, BusContactnotice.class);
 | 
			
		||||
        validEntityBeforeSave(add);
 | 
			
		||||
        return  baseMapper.insert(add) > 0;
 | 
			
		||||
        return baseMapper.insert(add) > 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@ -106,7 +107,7 @@ public class BusContactnoticeServiceImpl implements IBusContactnoticeService {
 | 
			
		||||
    /**
 | 
			
		||||
     * 保存前的数据校验
 | 
			
		||||
     */
 | 
			
		||||
    private void validEntityBeforeSave(BusContactnotice entity){
 | 
			
		||||
    private void validEntityBeforeSave(BusContactnotice entity) {
 | 
			
		||||
        //TODO 做一些数据校验,如唯一约束
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -119,7 +120,7 @@ public class BusContactnoticeServiceImpl implements IBusContactnoticeService {
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
 | 
			
		||||
        if(isValid){
 | 
			
		||||
        if (isValid) {
 | 
			
		||||
            //TODO 做一些业务上的校验,判断是否需要校验
 | 
			
		||||
        }
 | 
			
		||||
        return baseMapper.deleteByIds(ids) > 0;
 | 
			
		||||
 | 
			
		||||
@ -1,23 +0,0 @@
 | 
			
		||||
package org.dromara.design.constant;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025/7/2 19:59
 | 
			
		||||
 */
 | 
			
		||||
public interface DesDrawingConstant {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 对象存储前缀
 | 
			
		||||
     */
 | 
			
		||||
    String OSS_PREFIX = "doc/design/drawing/";
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取项目对象存储前缀
 | 
			
		||||
     *
 | 
			
		||||
     * @param projectId 项目id
 | 
			
		||||
     * @return 项目对象存储前缀
 | 
			
		||||
     */
 | 
			
		||||
    static String getProjectOssPrefix(Long projectId) {
 | 
			
		||||
        return String.format("%s%s/", OSS_PREFIX, projectId);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -1,24 +0,0 @@
 | 
			
		||||
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);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -48,7 +48,7 @@ public class DesDesignChangeController extends BaseController {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据主键设计变更单
 | 
			
		||||
     * 根据主键导出设计变更单
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("design:designChange:export")
 | 
			
		||||
    @Log(title = "设计变更管理", businessType = BusinessType.EXPORT)
 | 
			
		||||
 | 
			
		||||
@ -364,8 +364,19 @@ public class DesDesignChangeServiceImpl extends ServiceImpl<DesDesignChangeMappe
 | 
			
		||||
        if (CollUtil.isEmpty(designChangeList)) {
 | 
			
		||||
            return designChangeVoPage;
 | 
			
		||||
        }
 | 
			
		||||
        // todo 待优化
 | 
			
		||||
        List<DesDesignChangeVo> designChangeVoList = designChangeList.stream().map(this::getVo).toList();
 | 
			
		||||
        Set<Long> ossIdList = designChangeList.stream().map(DesDesignChange::getFileId).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);
 | 
			
		||||
            }
 | 
			
		||||
            return designChangeVo;
 | 
			
		||||
        }).toList();
 | 
			
		||||
        designChangeVoPage.setRecords(designChangeVoList);
 | 
			
		||||
        return designChangeVoPage;
 | 
			
		||||
    }
 | 
			
		||||
@ -394,7 +405,7 @@ public class DesDesignChangeServiceImpl extends ServiceImpl<DesDesignChangeMappe
 | 
			
		||||
            if (reasonSet.contains(String.valueOf(i))) {
 | 
			
		||||
                replacementMap.put("${changeReason" + i + "}", "√");
 | 
			
		||||
            } else {
 | 
			
		||||
                replacementMap.put("${changeReason" + i + "}", "  ");
 | 
			
		||||
                replacementMap.put("${changeReason" + i + "}", " ");
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        replacementMap.put("${changeContent}", designChange.getChangeContent());
 | 
			
		||||
 | 
			
		||||
@ -16,13 +16,11 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
 | 
			
		||||
import org.dromara.common.satoken.utils.LoginHelper;
 | 
			
		||||
import org.dromara.common.sse.dto.SseMessageDto;
 | 
			
		||||
import org.dromara.common.sse.utils.SseMessageUtils;
 | 
			
		||||
import org.dromara.common.utils.JSTUtil;
 | 
			
		||||
import org.dromara.facility.constant.FacRedisKeyConstant;
 | 
			
		||||
import org.dromara.facility.domain.FacMatrix;
 | 
			
		||||
import org.dromara.facility.domain.FacPhotovoltaicPanel;
 | 
			
		||||
import org.dromara.facility.domain.dto.geojson.FacFeatureByPlane;
 | 
			
		||||
import org.dromara.facility.domain.dto.geojson.FacFeatureByPoint;
 | 
			
		||||
import org.dromara.facility.domain.dto.geojson.FacGeoJsonByPlane;
 | 
			
		||||
import org.dromara.facility.domain.dto.geojson.FacGeoJsonByPoint;
 | 
			
		||||
import org.dromara.facility.domain.dto.geojson.*;
 | 
			
		||||
import org.dromara.facility.domain.dto.photovoltaicpanel.FacPhotovoltaicPanelCreateByGeoJsonReq;
 | 
			
		||||
import org.dromara.facility.domain.dto.photovoltaicpanel.FacPhotovoltaicPanelCreateReq;
 | 
			
		||||
import org.dromara.facility.domain.dto.photovoltaicpanel.FacPhotovoltaicPanelQueryReq;
 | 
			
		||||
@ -37,7 +35,6 @@ import org.dromara.progress.constant.PgsProgressCategoryConstant;
 | 
			
		||||
import org.dromara.progress.domain.PgsProgressCategory;
 | 
			
		||||
import org.dromara.progress.service.IPgsProgressCategoryService;
 | 
			
		||||
import org.dromara.project.service.IBusProjectService;
 | 
			
		||||
import org.dromara.common.utils.JSTUtil;
 | 
			
		||||
import org.springframework.beans.BeanUtils;
 | 
			
		||||
import org.springframework.context.annotation.Lazy;
 | 
			
		||||
import org.springframework.dao.DataAccessException;
 | 
			
		||||
@ -265,22 +262,25 @@ public class FacPhotovoltaicPanelServiceImpl extends ServiceImpl<FacPhotovoltaic
 | 
			
		||||
                    try (ExecutorService executorService = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors())) {
 | 
			
		||||
                        for (FacFeatureByPoint nameFeature : nameFeatures) {
 | 
			
		||||
                            Future<List<FacPhotovoltaicPanel>> future = executorService.submit(() -> {
 | 
			
		||||
                                FacProperties nameProperties = nameFeature.getProperties();
 | 
			
		||||
                                String name = nameProperties.getText();
 | 
			
		||||
                                // ① 获取名称
 | 
			
		||||
                                if (StringUtils.isBlank(name)) return Collections.emptyList();
 | 
			
		||||
                                if (!name.startsWith("G")) return Collections.emptyList();
 | 
			
		||||
                                List<FacPhotovoltaicPanel> panelList = new ArrayList<>();
 | 
			
		||||
                                // ① 找到该点对应的 polygon(优先包含,否则最近)
 | 
			
		||||
                                // ② 找到该点对应的 polygon(优先包含,否则最近)
 | 
			
		||||
                                FacFeatureByPlane matchedPolygon = JSTUtil.findNearestOrContainingPolygon(nameFeature, locationFeatures);
 | 
			
		||||
                                if (matchedPolygon == null) return Collections.emptyList();
 | 
			
		||||
                                // ② 获取 geometry 坐标
 | 
			
		||||
                                // ③ 获取 geometry 坐标
 | 
			
		||||
                                List<List<Double>> coordinates = matchedPolygon.getGeometry().getCoordinates().getFirst();
 | 
			
		||||
                                // ③ 判断所属方阵
 | 
			
		||||
                                // ④ 判断所属方阵
 | 
			
		||||
                                FacMatrix matrix = matrixService.getMatrixIdBy2Coordinates(matrixList, coordinates);
 | 
			
		||||
                                if (matrix == null) return Collections.emptyList();
 | 
			
		||||
                                Long matrixId = matrix.getId();
 | 
			
		||||
                                // ④ 获取进度类别
 | 
			
		||||
                                // ⑤ 获取进度类别
 | 
			
		||||
                                List<PgsProgressCategory> progressCategoryListByMatrix = progressCategoryMap.get(matrixId);
 | 
			
		||||
                                if (CollUtil.isEmpty(progressCategoryListByMatrix)) return Collections.emptyList();
 | 
			
		||||
                                // ⑤ 获取名称
 | 
			
		||||
                                String name = nameFeature.getProperties() != null ? nameFeature.getProperties().getText() : null;
 | 
			
		||||
                                if (StringUtils.isBlank(name)) return Collections.emptyList();
 | 
			
		||||
 | 
			
		||||
                                // ⑥ 构建面板数据
 | 
			
		||||
                                for (PgsProgressCategory progressCategory : progressCategoryListByMatrix) {
 | 
			
		||||
                                    FacPhotovoltaicPanel panel = new FacPhotovoltaicPanel();
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,67 @@
 | 
			
		||||
package org.dromara.materials.constants;
 | 
			
		||||
 | 
			
		||||
import org.dromara.common.core.utils.DateUtils;
 | 
			
		||||
import org.dromara.materials.domain.MatMaterialIssue;
 | 
			
		||||
import org.dromara.materials.domain.MatMaterialReceive;
 | 
			
		||||
 | 
			
		||||
import java.text.SimpleDateFormat;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025/7/4 18:26
 | 
			
		||||
 */
 | 
			
		||||
public interface MatMaterialsConstant {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 物料领料单文件路径
 | 
			
		||||
     */
 | 
			
		||||
    String MATERIALS_ISSUE_FILE_URL = "docs/materials/issue/";
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 物料接收单文件路径
 | 
			
		||||
     */
 | 
			
		||||
    String MATERIALS_RECEIVE_FILE_URL = "docs/materials/receive/";
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 物料领料单模版路径
 | 
			
		||||
     */
 | 
			
		||||
    String MATERIALS_ISSUE_TEMPLATE_PATH = "template/物料领料单模版.docx";
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 物料接收单模版路径
 | 
			
		||||
     */
 | 
			
		||||
    String MATERIALS_RECEIVE_TEMPLATE_PATH = "template/物料接收单模版.docx";
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取物料领料单文件名
 | 
			
		||||
     */
 | 
			
		||||
    static String getMatMaterialIssueFileUrl(MatMaterialIssue materialIssue) {
 | 
			
		||||
        String timestamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(materialIssue.getUpdateTime());
 | 
			
		||||
        return String.format("%s%s/%s", MATERIALS_ISSUE_FILE_URL, materialIssue.getId(), timestamp);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取物料领料单文件名
 | 
			
		||||
     */
 | 
			
		||||
    static String getMatMaterialIssueFileName(MatMaterialIssue materialIssue) {
 | 
			
		||||
        String createDate = DateUtils.formatDate(materialIssue.getCreateTime());
 | 
			
		||||
        return String.format("物料领料单(%s).docx", createDate);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取物料接收单文件名
 | 
			
		||||
     */
 | 
			
		||||
    static String getMatMaterialReceiveFileUrl(MatMaterialReceive materialReceive) {
 | 
			
		||||
        String timestamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(materialReceive.getUpdateTime());
 | 
			
		||||
        return String.format("%s%s/%s", MATERIALS_ISSUE_FILE_URL, materialReceive.getId(), timestamp);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取物料接收单文件名
 | 
			
		||||
     */
 | 
			
		||||
    static String getMatMaterialReceiveFileName(MatMaterialReceive materialReceive) {
 | 
			
		||||
        String createDate = DateUtils.formatDate(materialReceive.getCreateTime());
 | 
			
		||||
        return String.format("物料接收单(%s).docx", createDate);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,105 @@
 | 
			
		||||
package org.dromara.materials.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.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.materials.domain.dto.materialissue.MatMaterialIssueCreateReq;
 | 
			
		||||
import org.dromara.materials.domain.dto.materialissue.MatMaterialIssueQueryReq;
 | 
			
		||||
import org.dromara.materials.domain.dto.materialissue.MatMaterialIssueUpdateReq;
 | 
			
		||||
import org.dromara.materials.domain.vo.materialissue.MatMaterialIssueVo;
 | 
			
		||||
import org.dromara.materials.service.IMatMaterialIssueService;
 | 
			
		||||
import org.springframework.validation.annotation.Validated;
 | 
			
		||||
import org.springframework.web.bind.annotation.*;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 物料领料单
 | 
			
		||||
 *
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025-07-04
 | 
			
		||||
 */
 | 
			
		||||
@Validated
 | 
			
		||||
@RestController
 | 
			
		||||
@RequestMapping("/materials/materialIssue")
 | 
			
		||||
public class MatMaterialIssueController extends BaseController {
 | 
			
		||||
 | 
			
		||||
    @Resource
 | 
			
		||||
    private IMatMaterialIssueService matMaterialIssueService;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询物料领料单列表
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("materials:materialIssue:list")
 | 
			
		||||
    @GetMapping("/list")
 | 
			
		||||
    public TableDataInfo<MatMaterialIssueVo> list(MatMaterialIssueQueryReq req, PageQuery pageQuery) {
 | 
			
		||||
        return matMaterialIssueService.queryPageList(req, pageQuery);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据主键导出物料领料单详细信息
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("materials:materialIssue:export")
 | 
			
		||||
    @Log(title = "物料领料单", businessType = BusinessType.EXPORT)
 | 
			
		||||
    @PostMapping("/export/word")
 | 
			
		||||
    public void exportWordById(@NotNull(message = "主键不能为空") Long id,
 | 
			
		||||
                               HttpServletResponse response) {
 | 
			
		||||
        matMaterialIssueService.exportWordById(id, response);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取物料领料单详细信息
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 主键
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("materials:materialIssue:query")
 | 
			
		||||
    @GetMapping("/{id}")
 | 
			
		||||
    public R<MatMaterialIssueVo> getInfo(@NotNull(message = "主键不能为空")
 | 
			
		||||
                                         @PathVariable Long id) {
 | 
			
		||||
        return R.ok(matMaterialIssueService.queryById(id));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 新增物料领料单
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("materials:materialIssue:add")
 | 
			
		||||
    @Log(title = "物料领料单", businessType = BusinessType.INSERT)
 | 
			
		||||
    @RepeatSubmit()
 | 
			
		||||
    @PostMapping()
 | 
			
		||||
    public R<Void> add(@Validated @RequestBody MatMaterialIssueCreateReq req) {
 | 
			
		||||
        return toAjax(matMaterialIssueService.insertByBo(req));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 修改物料领料单
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("materials:materialIssue:edit")
 | 
			
		||||
    @Log(title = "物料领料单", businessType = BusinessType.UPDATE)
 | 
			
		||||
    @RepeatSubmit()
 | 
			
		||||
    @PutMapping()
 | 
			
		||||
    public R<Void> edit(@Validated @RequestBody MatMaterialIssueUpdateReq req) {
 | 
			
		||||
        return toAjax(matMaterialIssueService.updateByBo(req));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 删除物料领料单
 | 
			
		||||
     *
 | 
			
		||||
     * @param ids 主键串
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("materials:materialIssue:remove")
 | 
			
		||||
    @Log(title = "物料领料单", businessType = BusinessType.DELETE)
 | 
			
		||||
    @DeleteMapping("/{ids}")
 | 
			
		||||
    public R<Void> remove(@NotEmpty(message = "主键不能为空")
 | 
			
		||||
                          @PathVariable Long[] ids) {
 | 
			
		||||
        return toAjax(matMaterialIssueService.deleteByIds(List.of(ids)));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,105 @@
 | 
			
		||||
package org.dromara.materials.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.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.materials.domain.dto.materialreceive.MatMaterialReceiveCreateReq;
 | 
			
		||||
import org.dromara.materials.domain.dto.materialreceive.MatMaterialReceiveQueryReq;
 | 
			
		||||
import org.dromara.materials.domain.dto.materialreceive.MatMaterialReceiveUpdateReq;
 | 
			
		||||
import org.dromara.materials.domain.vo.materialreceive.MatMaterialReceiveVo;
 | 
			
		||||
import org.dromara.materials.service.IMatMaterialReceiveService;
 | 
			
		||||
import org.springframework.validation.annotation.Validated;
 | 
			
		||||
import org.springframework.web.bind.annotation.*;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 物料接收单
 | 
			
		||||
 *
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025-07-04
 | 
			
		||||
 */
 | 
			
		||||
@Validated
 | 
			
		||||
@RestController
 | 
			
		||||
@RequestMapping("/materials/materialReceive")
 | 
			
		||||
public class MatMaterialReceiveController extends BaseController {
 | 
			
		||||
 | 
			
		||||
    @Resource
 | 
			
		||||
    private IMatMaterialReceiveService matMaterialReceiveService;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询物料接收单列表
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("materials:materialReceive:list")
 | 
			
		||||
    @GetMapping("/list")
 | 
			
		||||
    public TableDataInfo<MatMaterialReceiveVo> list(MatMaterialReceiveQueryReq req, PageQuery pageQuery) {
 | 
			
		||||
        return matMaterialReceiveService.queryPageList(req, pageQuery);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据主键导出物料接收单详细信息
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("materials:materialReceive:export")
 | 
			
		||||
    @Log(title = "物料接收单", businessType = BusinessType.EXPORT)
 | 
			
		||||
    @PostMapping("/export/word")
 | 
			
		||||
    public void exportWordById(@NotNull(message = "主键不能为空") Long id,
 | 
			
		||||
                               HttpServletResponse response) {
 | 
			
		||||
        matMaterialReceiveService.exportWordById(id, response);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取物料接收单详细信息
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 主键
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("materials:materialReceive:query")
 | 
			
		||||
    @GetMapping("/{id}")
 | 
			
		||||
    public R<MatMaterialReceiveVo> getInfo(@NotNull(message = "主键不能为空")
 | 
			
		||||
                                           @PathVariable Long id) {
 | 
			
		||||
        return R.ok(matMaterialReceiveService.queryById(id));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 新增物料接收单
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("materials:materialReceive:add")
 | 
			
		||||
    @Log(title = "物料接收单", businessType = BusinessType.INSERT)
 | 
			
		||||
    @RepeatSubmit()
 | 
			
		||||
    @PostMapping()
 | 
			
		||||
    public R<Void> add(@Validated @RequestBody MatMaterialReceiveCreateReq req) {
 | 
			
		||||
        return toAjax(matMaterialReceiveService.insertByBo(req));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 修改物料接收单
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("materials:materialReceive:edit")
 | 
			
		||||
    @Log(title = "物料接收单", businessType = BusinessType.UPDATE)
 | 
			
		||||
    @RepeatSubmit()
 | 
			
		||||
    @PutMapping()
 | 
			
		||||
    public R<Void> edit(@Validated @RequestBody MatMaterialReceiveUpdateReq req) {
 | 
			
		||||
        return toAjax(matMaterialReceiveService.updateByBo(req));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 删除物料接收单
 | 
			
		||||
     *
 | 
			
		||||
     * @param ids 主键串
 | 
			
		||||
     */
 | 
			
		||||
    @SaCheckPermission("materials:materialReceive:remove")
 | 
			
		||||
    @Log(title = "物料接收单", businessType = BusinessType.DELETE)
 | 
			
		||||
    @DeleteMapping("/{ids}")
 | 
			
		||||
    public R<Void> remove(@NotEmpty(message = "主键不能为空")
 | 
			
		||||
                          @PathVariable Long[] ids) {
 | 
			
		||||
        return toAjax(matMaterialReceiveService.deleteByIds(List.of(ids)));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,126 @@
 | 
			
		||||
package org.dromara.materials.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;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 物料领料单对象 mat_material_issue
 | 
			
		||||
 *
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025-07-04
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
@EqualsAndHashCode(callSuper = true)
 | 
			
		||||
@TableName("mat_material_issue")
 | 
			
		||||
public class MatMaterialIssue extends BaseEntity {
 | 
			
		||||
 | 
			
		||||
    @Serial
 | 
			
		||||
    private static final long serialVersionUID = 1L;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 主键id
 | 
			
		||||
     */
 | 
			
		||||
    @TableId(value = "id")
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 项目id
 | 
			
		||||
     */
 | 
			
		||||
    private Long projectId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 材料来源(1甲供 2乙供)
 | 
			
		||||
     */
 | 
			
		||||
    private String materialSource;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 表单编号
 | 
			
		||||
     */
 | 
			
		||||
    private String formCode;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 工程名称
 | 
			
		||||
     */
 | 
			
		||||
    private String projectName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 设备材料名称
 | 
			
		||||
     */
 | 
			
		||||
    private String materialName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 订货单位
 | 
			
		||||
     */
 | 
			
		||||
    private String orderingUnit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 供货单位
 | 
			
		||||
     */
 | 
			
		||||
    private String supplierUnit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 领料单位
 | 
			
		||||
     */
 | 
			
		||||
    private String issueUnit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 保管单位
 | 
			
		||||
     */
 | 
			
		||||
    private String storageUnit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 缺陷情况(承包单位填写)
 | 
			
		||||
     */
 | 
			
		||||
    private String defectDescription;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 合格证份数
 | 
			
		||||
     */
 | 
			
		||||
    private Integer certCount;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 合格证文件
 | 
			
		||||
     */
 | 
			
		||||
    private String certCountFileId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 出厂报告份数
 | 
			
		||||
     */
 | 
			
		||||
    private Integer reportCount;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 出厂报告文件
 | 
			
		||||
     */
 | 
			
		||||
    private String reportCountFileId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 技术资料份数
 | 
			
		||||
     */
 | 
			
		||||
    private Integer techDocCount;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 技术资料文件
 | 
			
		||||
     */
 | 
			
		||||
    private String techDocCountFileId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 厂家资质文件份数
 | 
			
		||||
     */
 | 
			
		||||
    private Integer licenseCount;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 厂家资质文件
 | 
			
		||||
     */
 | 
			
		||||
    private String licenseCountFileId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 备注
 | 
			
		||||
     */
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,77 @@
 | 
			
		||||
package org.dromara.materials.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.math.BigDecimal;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 物料领料单明细项对象 mat_material_issue_item
 | 
			
		||||
 *
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025-07-04
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
@EqualsAndHashCode(callSuper = true)
 | 
			
		||||
@TableName("mat_material_issue_item")
 | 
			
		||||
public class MatMaterialIssueItem extends BaseEntity {
 | 
			
		||||
 | 
			
		||||
    @Serial
 | 
			
		||||
    private static final long serialVersionUID = 1L;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 主键id
 | 
			
		||||
     */
 | 
			
		||||
    @TableId(value = "id")
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 项目id
 | 
			
		||||
     */
 | 
			
		||||
    private Long projectId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 领料单id
 | 
			
		||||
     */
 | 
			
		||||
    private Long issueId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 名称
 | 
			
		||||
     */
 | 
			
		||||
    private String name;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 规格
 | 
			
		||||
     */
 | 
			
		||||
    private String specification;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 单位
 | 
			
		||||
     */
 | 
			
		||||
    private String unit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 库存
 | 
			
		||||
     */
 | 
			
		||||
    private BigDecimal stockQuantity;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 领取
 | 
			
		||||
     */
 | 
			
		||||
    private BigDecimal issuedQuantity;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 剩余
 | 
			
		||||
     */
 | 
			
		||||
    private BigDecimal remainingQuantity;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 备注
 | 
			
		||||
     */
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,126 @@
 | 
			
		||||
package org.dromara.materials.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;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 物料接收单对象 mat_material_receive
 | 
			
		||||
 *
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025-07-04
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
@EqualsAndHashCode(callSuper = true)
 | 
			
		||||
@TableName("mat_material_receive")
 | 
			
		||||
public class MatMaterialReceive extends BaseEntity {
 | 
			
		||||
 | 
			
		||||
    @Serial
 | 
			
		||||
    private static final long serialVersionUID = 1L;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 主键id
 | 
			
		||||
     */
 | 
			
		||||
    @TableId(value = "id")
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 项目id
 | 
			
		||||
     */
 | 
			
		||||
    private Long projectId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 材料来源(1甲供 2乙供)
 | 
			
		||||
     */
 | 
			
		||||
    private String materialSource;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 表单编号
 | 
			
		||||
     */
 | 
			
		||||
    private String formCode;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 工程名称
 | 
			
		||||
     */
 | 
			
		||||
    private String projectName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 设备材料名称
 | 
			
		||||
     */
 | 
			
		||||
    private String materialName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 合同名称
 | 
			
		||||
     */
 | 
			
		||||
    private String contractName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 订货单位
 | 
			
		||||
     */
 | 
			
		||||
    private String orderingUnit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 供货单位
 | 
			
		||||
     */
 | 
			
		||||
    private String supplierUnit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 缺陷情况(承包单位填写)
 | 
			
		||||
     */
 | 
			
		||||
    private String defectDescription;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 合格证份数
 | 
			
		||||
     */
 | 
			
		||||
    private Integer certCount;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 合格证文件
 | 
			
		||||
     */
 | 
			
		||||
    private String certCountFileId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 出厂报告份数
 | 
			
		||||
     */
 | 
			
		||||
    private Integer reportCount;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 出厂报告文件
 | 
			
		||||
     */
 | 
			
		||||
    private String reportCountFileId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 技术资料份数
 | 
			
		||||
     */
 | 
			
		||||
    private Integer techDocCount;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 技术资料文件
 | 
			
		||||
     */
 | 
			
		||||
    private String techDocCountFileId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 厂家资质文件份数
 | 
			
		||||
     */
 | 
			
		||||
    private Integer licenseCount;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 厂家资质文件
 | 
			
		||||
     */
 | 
			
		||||
    private String licenseCountFileId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 设备材料入库/移交
 | 
			
		||||
     */
 | 
			
		||||
    private String storageType;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 备注
 | 
			
		||||
     */
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,77 @@
 | 
			
		||||
package org.dromara.materials.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.math.BigDecimal;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 物料接收单明细项对象 mat_material_receive_item
 | 
			
		||||
 *
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025-07-04
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
@EqualsAndHashCode(callSuper = true)
 | 
			
		||||
@TableName("mat_material_receive_item")
 | 
			
		||||
public class MatMaterialReceiveItem extends BaseEntity {
 | 
			
		||||
 | 
			
		||||
    @Serial
 | 
			
		||||
    private static final long serialVersionUID = 1L;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 主键id
 | 
			
		||||
     */
 | 
			
		||||
    @TableId(value = "id")
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 项目id
 | 
			
		||||
     */
 | 
			
		||||
    private Long projectId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 接收单id
 | 
			
		||||
     */
 | 
			
		||||
    private Long receiveId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 名称
 | 
			
		||||
     */
 | 
			
		||||
    private String name;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 规格
 | 
			
		||||
     */
 | 
			
		||||
    private String specification;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 单位
 | 
			
		||||
     */
 | 
			
		||||
    private String unit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 数量
 | 
			
		||||
     */
 | 
			
		||||
    private BigDecimal quantity;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 验收
 | 
			
		||||
     */
 | 
			
		||||
    private BigDecimal acceptedQuantity;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 缺件
 | 
			
		||||
     */
 | 
			
		||||
    private BigDecimal shortageQuantity;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 备注
 | 
			
		||||
     */
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,105 @@
 | 
			
		||||
package org.dromara.materials.domain.dto.materialissue;
 | 
			
		||||
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import org.dromara.materials.domain.dto.materialissueitem.MatMaterialIssueItemDto;
 | 
			
		||||
 | 
			
		||||
import java.io.Serial;
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025/7/4 15:02
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
public class MatMaterialIssueCreateReq implements Serializable {
 | 
			
		||||
 | 
			
		||||
    @Serial
 | 
			
		||||
    private static final long serialVersionUID = 2742974667799153892L;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 主键id
 | 
			
		||||
     */
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 项目id
 | 
			
		||||
     */
 | 
			
		||||
    private Long projectId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 材料来源(1甲供 2乙供)
 | 
			
		||||
     */
 | 
			
		||||
    private String materialSource;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 表单编号
 | 
			
		||||
     */
 | 
			
		||||
    private String formCode;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 工程名称
 | 
			
		||||
     */
 | 
			
		||||
    private String projectName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 设备材料名称
 | 
			
		||||
     */
 | 
			
		||||
    private String materialName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 订货单位
 | 
			
		||||
     */
 | 
			
		||||
    private String orderingUnit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 供货单位
 | 
			
		||||
     */
 | 
			
		||||
    private String supplierUnit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 领料单位
 | 
			
		||||
     */
 | 
			
		||||
    private String issueUnit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 保管单位
 | 
			
		||||
     */
 | 
			
		||||
    private String storageUnit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 缺陷情况(承包单位填写)
 | 
			
		||||
     */
 | 
			
		||||
    private String defectDescription;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 明细项
 | 
			
		||||
     */
 | 
			
		||||
    private List<MatMaterialIssueItemDto> itemList;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 合格证文件
 | 
			
		||||
     */
 | 
			
		||||
    private String certCountFileId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 出厂报告文件
 | 
			
		||||
     */
 | 
			
		||||
    private String reportCountFileId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 技术资料文件
 | 
			
		||||
     */
 | 
			
		||||
    private String techDocCountFileId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 厂家资质文件
 | 
			
		||||
     */
 | 
			
		||||
    private String licenseCountFileId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 备注
 | 
			
		||||
     */
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,63 @@
 | 
			
		||||
package org.dromara.materials.domain.dto.materialissue;
 | 
			
		||||
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import java.io.Serial;
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025/7/4 15:02
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
public class MatMaterialIssueQueryReq implements Serializable {
 | 
			
		||||
 | 
			
		||||
    @Serial
 | 
			
		||||
    private static final long serialVersionUID = -4011015750160760763L;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 项目id
 | 
			
		||||
     */
 | 
			
		||||
    private Long projectId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 材料来源(1甲供 2乙供)
 | 
			
		||||
     */
 | 
			
		||||
    private String materialSource;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 表单编号
 | 
			
		||||
     */
 | 
			
		||||
    private String formCode;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 工程名称
 | 
			
		||||
     */
 | 
			
		||||
    private String projectName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 设备材料名称
 | 
			
		||||
     */
 | 
			
		||||
    private String materialName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 订货单位
 | 
			
		||||
     */
 | 
			
		||||
    private String orderingUnit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 供货单位
 | 
			
		||||
     */
 | 
			
		||||
    private String supplierUnit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 领料单位
 | 
			
		||||
     */
 | 
			
		||||
    private String issueUnit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 保管单位
 | 
			
		||||
     */
 | 
			
		||||
    private String storageUnit;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,100 @@
 | 
			
		||||
package org.dromara.materials.domain.dto.materialissue;
 | 
			
		||||
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import org.dromara.materials.domain.dto.materialissueitem.MatMaterialIssueItemDto;
 | 
			
		||||
 | 
			
		||||
import java.io.Serial;
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025/7/4 15:02
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
public class MatMaterialIssueUpdateReq implements Serializable {
 | 
			
		||||
 | 
			
		||||
    @Serial
 | 
			
		||||
    private static final long serialVersionUID = 2053113999402012882L;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 主键id
 | 
			
		||||
     */
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 项目id
 | 
			
		||||
     */
 | 
			
		||||
    private Long projectId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 表单编号
 | 
			
		||||
     */
 | 
			
		||||
    private String formCode;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 工程名称
 | 
			
		||||
     */
 | 
			
		||||
    private String projectName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 设备材料名称
 | 
			
		||||
     */
 | 
			
		||||
    private String materialName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 订货单位
 | 
			
		||||
     */
 | 
			
		||||
    private String orderingUnit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 供货单位
 | 
			
		||||
     */
 | 
			
		||||
    private String supplierUnit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 领料单位
 | 
			
		||||
     */
 | 
			
		||||
    private String issueUnit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 保管单位
 | 
			
		||||
     */
 | 
			
		||||
    private String storageUnit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 缺陷情况(承包单位填写)
 | 
			
		||||
     */
 | 
			
		||||
    private String defectDescription;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 明细项
 | 
			
		||||
     */
 | 
			
		||||
    private List<MatMaterialIssueItemDto> itemList;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 合格证文件
 | 
			
		||||
     */
 | 
			
		||||
    private String certCountFileId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 出厂报告文件
 | 
			
		||||
     */
 | 
			
		||||
    private String reportCountFileId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 技术资料文件
 | 
			
		||||
     */
 | 
			
		||||
    private String techDocCountFileId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 厂家资质文件
 | 
			
		||||
     */
 | 
			
		||||
    private String licenseCountFileId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 备注
 | 
			
		||||
     */
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,39 @@
 | 
			
		||||
package org.dromara.materials.domain.dto.materialissue;
 | 
			
		||||
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import org.dromara.materials.domain.dto.materialissueitem.MatMaterialIssueItemWordDto;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
public class MatMaterialIssueWordDto {
 | 
			
		||||
 | 
			
		||||
    // 顶部信息
 | 
			
		||||
    private String projectName;
 | 
			
		||||
    private String formCode;
 | 
			
		||||
    private String materialName;
 | 
			
		||||
    private String supplierUnit;
 | 
			
		||||
    private String orderingUnit;
 | 
			
		||||
    private String issueUnit;
 | 
			
		||||
    private String storageUnit;
 | 
			
		||||
 | 
			
		||||
    // 表格数据 - 这是一个列表!
 | 
			
		||||
    private List<MatMaterialIssueItemWordDto> items;
 | 
			
		||||
 | 
			
		||||
    // 合计行数据
 | 
			
		||||
    private Integer totalStockQuantity;
 | 
			
		||||
    private Integer totalIssuedQuantity;
 | 
			
		||||
    private Integer totalRemainingQuantity;
 | 
			
		||||
 | 
			
		||||
    // 缺陷情况及附件
 | 
			
		||||
    private String defectDescription;
 | 
			
		||||
    private String isCertCount;
 | 
			
		||||
    private Integer certCount;
 | 
			
		||||
    private String isReportCount;
 | 
			
		||||
    private Integer reportCount;
 | 
			
		||||
    private String isTechDocCount;
 | 
			
		||||
    private Integer techDocCount;
 | 
			
		||||
    private String isLicenseCount;
 | 
			
		||||
    private Integer licenseCount;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,58 @@
 | 
			
		||||
package org.dromara.materials.domain.dto.materialissueitem;
 | 
			
		||||
 | 
			
		||||
import lombok.AllArgsConstructor;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
 | 
			
		||||
import java.math.BigDecimal;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025/7/4 15:21
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
@NoArgsConstructor
 | 
			
		||||
@AllArgsConstructor
 | 
			
		||||
public class MatMaterialIssueItemDto {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 主键id
 | 
			
		||||
     */
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 名称
 | 
			
		||||
     */
 | 
			
		||||
    private String name;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 规格
 | 
			
		||||
     */
 | 
			
		||||
    private String specification;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 单位
 | 
			
		||||
     */
 | 
			
		||||
    private String unit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 库存
 | 
			
		||||
     */
 | 
			
		||||
    private BigDecimal stockQuantity;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 领取
 | 
			
		||||
     */
 | 
			
		||||
    private BigDecimal issuedQuantity;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 剩余
 | 
			
		||||
     */
 | 
			
		||||
    private BigDecimal remainingQuantity;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 备注
 | 
			
		||||
     */
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,21 @@
 | 
			
		||||
package org.dromara.materials.domain.dto.materialissueitem;
 | 
			
		||||
 | 
			
		||||
import lombok.AllArgsConstructor;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
@NoArgsConstructor
 | 
			
		||||
@AllArgsConstructor
 | 
			
		||||
public class MatMaterialIssueItemWordDto {
 | 
			
		||||
 | 
			
		||||
    private Integer no;                // 序号
 | 
			
		||||
    private String name;              // 名称
 | 
			
		||||
    private String specification;     // 规格
 | 
			
		||||
    private String unit;              // 单位
 | 
			
		||||
    private Integer stockQuantity;    // 库存数量
 | 
			
		||||
    private Integer issuedQuantity;   // 领取数量
 | 
			
		||||
    private Integer remainingQuantity;// 剩余数量
 | 
			
		||||
    private String remark;            // 备注
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,100 @@
 | 
			
		||||
package org.dromara.materials.domain.dto.materialreceive;
 | 
			
		||||
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import org.dromara.materials.domain.dto.materialreceiveitem.MatMaterialReceiveItemDto;
 | 
			
		||||
 | 
			
		||||
import java.io.Serial;
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025/7/4 15:03
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
public class MatMaterialReceiveCreateReq implements Serializable {
 | 
			
		||||
 | 
			
		||||
    @Serial
 | 
			
		||||
    private static final long serialVersionUID = 1826521942178676812L;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 项目id
 | 
			
		||||
     */
 | 
			
		||||
    private Long projectId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 材料来源(1甲供 2乙供)
 | 
			
		||||
     */
 | 
			
		||||
    private String materialSource;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 表单编号
 | 
			
		||||
     */
 | 
			
		||||
    private String formCode;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 工程名称
 | 
			
		||||
     */
 | 
			
		||||
    private String projectName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 设备材料名称
 | 
			
		||||
     */
 | 
			
		||||
    private String materialName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 合同名称
 | 
			
		||||
     */
 | 
			
		||||
    private String contractName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 订货单位
 | 
			
		||||
     */
 | 
			
		||||
    private String orderingUnit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 供货单位
 | 
			
		||||
     */
 | 
			
		||||
    private String supplierUnit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 缺陷情况(承包单位填写)
 | 
			
		||||
     */
 | 
			
		||||
    private String defectDescription;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 明细项
 | 
			
		||||
     */
 | 
			
		||||
    private List<MatMaterialReceiveItemDto> itemList;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 合格证文件
 | 
			
		||||
     */
 | 
			
		||||
    private String certCountFileId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 出厂报告文件
 | 
			
		||||
     */
 | 
			
		||||
    private String reportCountFileId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 技术资料文件
 | 
			
		||||
     */
 | 
			
		||||
    private String techDocCountFileId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 厂家资质文件
 | 
			
		||||
     */
 | 
			
		||||
    private String licenseCountFileId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 设备材料入库/移交
 | 
			
		||||
     */
 | 
			
		||||
    private String storageType;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 备注
 | 
			
		||||
     */
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,63 @@
 | 
			
		||||
package org.dromara.materials.domain.dto.materialreceive;
 | 
			
		||||
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import java.io.Serial;
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025/7/4 15:03
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
public class MatMaterialReceiveQueryReq implements Serializable {
 | 
			
		||||
 | 
			
		||||
    @Serial
 | 
			
		||||
    private static final long serialVersionUID = 5772774919127572167L;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 项目id
 | 
			
		||||
     */
 | 
			
		||||
    private Long projectId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 材料来源(1甲供 2乙供)
 | 
			
		||||
     */
 | 
			
		||||
    private String materialSource;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 表单编号
 | 
			
		||||
     */
 | 
			
		||||
    private String formCode;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 工程名称
 | 
			
		||||
     */
 | 
			
		||||
    private String projectName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 设备材料名称
 | 
			
		||||
     */
 | 
			
		||||
    private String materialName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 合同名称
 | 
			
		||||
     */
 | 
			
		||||
    private String contractName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 订货单位
 | 
			
		||||
     */
 | 
			
		||||
    private String orderingUnit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 供货单位
 | 
			
		||||
     */
 | 
			
		||||
    private String supplierUnit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 设备材料入库/移交
 | 
			
		||||
     */
 | 
			
		||||
    private String storageType;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,100 @@
 | 
			
		||||
package org.dromara.materials.domain.dto.materialreceive;
 | 
			
		||||
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import org.dromara.materials.domain.dto.materialreceiveitem.MatMaterialReceiveItemDto;
 | 
			
		||||
 | 
			
		||||
import java.io.Serial;
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025/7/4 15:03
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
public class MatMaterialReceiveUpdateReq implements Serializable {
 | 
			
		||||
 | 
			
		||||
    @Serial
 | 
			
		||||
    private static final long serialVersionUID = 5686357336524453994L;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 主键id
 | 
			
		||||
     */
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 项目id
 | 
			
		||||
     */
 | 
			
		||||
    private Long projectId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 表单编号
 | 
			
		||||
     */
 | 
			
		||||
    private String formCode;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 工程名称
 | 
			
		||||
     */
 | 
			
		||||
    private String projectName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 设备材料名称
 | 
			
		||||
     */
 | 
			
		||||
    private String materialName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 合同名称
 | 
			
		||||
     */
 | 
			
		||||
    private String contractName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 订货单位
 | 
			
		||||
     */
 | 
			
		||||
    private String orderingUnit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 供货单位
 | 
			
		||||
     */
 | 
			
		||||
    private String supplierUnit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 缺陷情况(承包单位填写)
 | 
			
		||||
     */
 | 
			
		||||
    private String defectDescription;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 明细项
 | 
			
		||||
     */
 | 
			
		||||
    private List<MatMaterialReceiveItemDto> itemList;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 合格证文件
 | 
			
		||||
     */
 | 
			
		||||
    private String certCountFileId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 出厂报告文件
 | 
			
		||||
     */
 | 
			
		||||
    private String reportCountFileId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 技术资料文件
 | 
			
		||||
     */
 | 
			
		||||
    private String techDocCountFileId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 厂家资质文件
 | 
			
		||||
     */
 | 
			
		||||
    private String licenseCountFileId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 设备材料入库/移交
 | 
			
		||||
     */
 | 
			
		||||
    private String storageType;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 备注
 | 
			
		||||
     */
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,48 @@
 | 
			
		||||
package org.dromara.materials.domain.dto.materialreceive;
 | 
			
		||||
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import org.dromara.materials.domain.dto.materialreceiveitem.MatMaterialReceiveItemWordDto;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025/7/6 13:56
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
public class MatMaterialReceiveWordDto {
 | 
			
		||||
 | 
			
		||||
    // 顶部信息
 | 
			
		||||
    private String formCode;
 | 
			
		||||
    private String projectName;
 | 
			
		||||
    private String materialName;
 | 
			
		||||
    private String contractName;
 | 
			
		||||
    private String orderingUnit;
 | 
			
		||||
    private String supplierUnit;
 | 
			
		||||
 | 
			
		||||
    // 表格数据 - 这是一个列表!
 | 
			
		||||
    private List<MatMaterialReceiveItemWordDto> items;
 | 
			
		||||
 | 
			
		||||
    // 合计行数据
 | 
			
		||||
    private Integer totalQuantity;
 | 
			
		||||
    private Integer totalAcceptedQuantity;
 | 
			
		||||
    private Integer totalShortageQuantity;
 | 
			
		||||
 | 
			
		||||
    // 缺陷情况及附件
 | 
			
		||||
    private String defectDescription;
 | 
			
		||||
    private String isCertCount;
 | 
			
		||||
    private Integer certCount;
 | 
			
		||||
    private String isReportCount;
 | 
			
		||||
    private Integer reportCount;
 | 
			
		||||
    private String isTechDocCount;
 | 
			
		||||
    private Integer techDocCount;
 | 
			
		||||
    private String isLicenseCount;
 | 
			
		||||
    private Integer licenseCount;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    // 设备材料入库/移交
 | 
			
		||||
    private String storageType1;
 | 
			
		||||
    private String storageType2;
 | 
			
		||||
    private String storageType3;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,58 @@
 | 
			
		||||
package org.dromara.materials.domain.dto.materialreceiveitem;
 | 
			
		||||
 | 
			
		||||
import lombok.AllArgsConstructor;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
 | 
			
		||||
import java.math.BigDecimal;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025/7/4 15:24
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
@NoArgsConstructor
 | 
			
		||||
@AllArgsConstructor
 | 
			
		||||
public class MatMaterialReceiveItemDto {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 主键id
 | 
			
		||||
     */
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 名称
 | 
			
		||||
     */
 | 
			
		||||
    private String name;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 规格
 | 
			
		||||
     */
 | 
			
		||||
    private String specification;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 单位
 | 
			
		||||
     */
 | 
			
		||||
    private String unit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 数量
 | 
			
		||||
     */
 | 
			
		||||
    private BigDecimal quantity;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 验收
 | 
			
		||||
     */
 | 
			
		||||
    private BigDecimal acceptedQuantity;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 缺件
 | 
			
		||||
     */
 | 
			
		||||
    private BigDecimal shortageQuantity;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 备注
 | 
			
		||||
     */
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,56 @@
 | 
			
		||||
package org.dromara.materials.domain.dto.materialreceiveitem;
 | 
			
		||||
 | 
			
		||||
import lombok.AllArgsConstructor;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025/7/6 14:04
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
@NoArgsConstructor
 | 
			
		||||
@AllArgsConstructor
 | 
			
		||||
public class MatMaterialReceiveItemWordDto {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 序号
 | 
			
		||||
     */
 | 
			
		||||
    private Integer no;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 名称
 | 
			
		||||
     */
 | 
			
		||||
    private String name;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 规格
 | 
			
		||||
     */
 | 
			
		||||
    private String specification;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 单位
 | 
			
		||||
     */
 | 
			
		||||
    private String unit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 数量
 | 
			
		||||
     */
 | 
			
		||||
    private Integer quantity;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 验收
 | 
			
		||||
     */
 | 
			
		||||
    private Integer acceptedQuantity;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 缺件
 | 
			
		||||
     */
 | 
			
		||||
    private Integer shortageQuantity;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 备注
 | 
			
		||||
     */
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,152 @@
 | 
			
		||||
package org.dromara.materials.domain.vo.materialissue;
 | 
			
		||||
 | 
			
		||||
import io.github.linpeilie.annotations.AutoMapper;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import org.dromara.materials.domain.MatMaterialIssue;
 | 
			
		||||
import org.dromara.materials.domain.vo.materialissueitem.MatMaterialIssueItemVo;
 | 
			
		||||
import org.dromara.system.domain.vo.SysOssVo;
 | 
			
		||||
 | 
			
		||||
import java.io.Serial;
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 物料领料单视图对象 mat_material_issue
 | 
			
		||||
 *
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025-07-04
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
@AutoMapper(target = MatMaterialIssue.class)
 | 
			
		||||
public class MatMaterialIssueVo implements Serializable {
 | 
			
		||||
 | 
			
		||||
    @Serial
 | 
			
		||||
    private static final long serialVersionUID = 1L;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 主键id
 | 
			
		||||
     */
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 项目id
 | 
			
		||||
     */
 | 
			
		||||
    private Long projectId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 材料来源(1甲供 2乙供)
 | 
			
		||||
     */
 | 
			
		||||
    private String materialSource;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 表单编号
 | 
			
		||||
     */
 | 
			
		||||
    private String formCode;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 工程名称
 | 
			
		||||
     */
 | 
			
		||||
    private String projectName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 设备材料名称
 | 
			
		||||
     */
 | 
			
		||||
    private String materialName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 订货单位
 | 
			
		||||
     */
 | 
			
		||||
    private String orderingUnit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 供货单位
 | 
			
		||||
     */
 | 
			
		||||
    private String supplierUnit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 领料单位
 | 
			
		||||
     */
 | 
			
		||||
    private String issueUnit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 保管单位
 | 
			
		||||
     */
 | 
			
		||||
    private String storageUnit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 缺陷情况(承包单位填写)
 | 
			
		||||
     */
 | 
			
		||||
    private String defectDescription;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 合格证份数
 | 
			
		||||
     */
 | 
			
		||||
    private Integer certCount;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 合格证文件
 | 
			
		||||
     */
 | 
			
		||||
    private String certCountFileId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 合格证文件
 | 
			
		||||
     */
 | 
			
		||||
    private List<SysOssVo> certCountFile;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 出厂报告份数
 | 
			
		||||
     */
 | 
			
		||||
    private Integer reportCount;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 出厂报告文件
 | 
			
		||||
     */
 | 
			
		||||
    private String reportCountFileId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 出厂报告文件
 | 
			
		||||
     */
 | 
			
		||||
    private List<SysOssVo> reportCountFile;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 技术资料份数
 | 
			
		||||
     */
 | 
			
		||||
    private Integer techDocCount;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 技术资料文件
 | 
			
		||||
     */
 | 
			
		||||
    private String techDocCountFileId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 技术资料文件
 | 
			
		||||
     */
 | 
			
		||||
    private List<SysOssVo> techDocCountFile;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 厂家资质文件份数
 | 
			
		||||
     */
 | 
			
		||||
    private Integer licenseCount;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 厂家资质文件
 | 
			
		||||
     */
 | 
			
		||||
    private String licenseCountFileId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 厂家资质文件
 | 
			
		||||
     */
 | 
			
		||||
    private List<SysOssVo> licenseCountFile;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 备注
 | 
			
		||||
     */
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 明细项列表
 | 
			
		||||
     */
 | 
			
		||||
    private List<MatMaterialIssueItemVo> itemList;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,75 @@
 | 
			
		||||
package org.dromara.materials.domain.vo.materialissueitem;
 | 
			
		||||
 | 
			
		||||
import io.github.linpeilie.annotations.AutoMapper;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import org.dromara.materials.domain.MatMaterialIssueItem;
 | 
			
		||||
 | 
			
		||||
import java.io.Serial;
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.math.BigDecimal;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 物料领料单明细项视图对象 mat_material_issue_item
 | 
			
		||||
 *
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025-07-04
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
@AutoMapper(target = MatMaterialIssueItem.class)
 | 
			
		||||
public class MatMaterialIssueItemVo implements Serializable {
 | 
			
		||||
 | 
			
		||||
    @Serial
 | 
			
		||||
    private static final long serialVersionUID = 1L;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 主键id
 | 
			
		||||
     */
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 项目id
 | 
			
		||||
     */
 | 
			
		||||
    private Long projectId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 领料单id
 | 
			
		||||
     */
 | 
			
		||||
    private Long issueId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 名称
 | 
			
		||||
     */
 | 
			
		||||
    private String name;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 规格
 | 
			
		||||
     */
 | 
			
		||||
    private String specification;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 单位
 | 
			
		||||
     */
 | 
			
		||||
    private String unit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 库存
 | 
			
		||||
     */
 | 
			
		||||
    private BigDecimal stockQuantity;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 领取
 | 
			
		||||
     */
 | 
			
		||||
    private BigDecimal issuedQuantity;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 剩余
 | 
			
		||||
     */
 | 
			
		||||
    private BigDecimal remainingQuantity;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 备注
 | 
			
		||||
     */
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,152 @@
 | 
			
		||||
package org.dromara.materials.domain.vo.materialreceive;
 | 
			
		||||
 | 
			
		||||
import io.github.linpeilie.annotations.AutoMapper;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import org.dromara.materials.domain.MatMaterialReceive;
 | 
			
		||||
import org.dromara.materials.domain.vo.materialreceiveitem.MatMaterialReceiveItemVo;
 | 
			
		||||
import org.dromara.system.domain.vo.SysOssVo;
 | 
			
		||||
 | 
			
		||||
import java.io.Serial;
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 物料接收单视图对象 mat_material_receive
 | 
			
		||||
 *
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025-07-04
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
@AutoMapper(target = MatMaterialReceive.class)
 | 
			
		||||
public class MatMaterialReceiveVo implements Serializable {
 | 
			
		||||
 | 
			
		||||
    @Serial
 | 
			
		||||
    private static final long serialVersionUID = 1L;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 主键id
 | 
			
		||||
     */
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 项目id
 | 
			
		||||
     */
 | 
			
		||||
    private Long projectId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 材料来源(1甲供 2乙供)
 | 
			
		||||
     */
 | 
			
		||||
    private String materialSource;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 表单编号
 | 
			
		||||
     */
 | 
			
		||||
    private String formCode;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 工程名称
 | 
			
		||||
     */
 | 
			
		||||
    private String projectName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 设备材料名称
 | 
			
		||||
     */
 | 
			
		||||
    private String materialName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 合同名称
 | 
			
		||||
     */
 | 
			
		||||
    private String contractName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 订货单位
 | 
			
		||||
     */
 | 
			
		||||
    private String orderingUnit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 供货单位
 | 
			
		||||
     */
 | 
			
		||||
    private String supplierUnit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 缺陷情况(承包单位填写)
 | 
			
		||||
     */
 | 
			
		||||
    private String defectDescription;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 合格证份数
 | 
			
		||||
     */
 | 
			
		||||
    private Integer certCount;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 合格证文件
 | 
			
		||||
     */
 | 
			
		||||
    private String certCountFileId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 合格证文件
 | 
			
		||||
     */
 | 
			
		||||
    private List<SysOssVo> certCountFile;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 出厂报告份数
 | 
			
		||||
     */
 | 
			
		||||
    private Integer reportCount;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 出厂报告文件
 | 
			
		||||
     */
 | 
			
		||||
    private String reportCountFileId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 出厂报告文件
 | 
			
		||||
     */
 | 
			
		||||
    private List<SysOssVo> reportCountFile;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 技术资料份数
 | 
			
		||||
     */
 | 
			
		||||
    private Integer techDocCount;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 技术资料文件
 | 
			
		||||
     */
 | 
			
		||||
    private String techDocCountFileId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 技术资料文件
 | 
			
		||||
     */
 | 
			
		||||
    private List<SysOssVo> techDocCountFile;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 厂家资质文件份数
 | 
			
		||||
     */
 | 
			
		||||
    private Integer licenseCount;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 厂家资质文件
 | 
			
		||||
     */
 | 
			
		||||
    private String licenseCountFileId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 厂家资质文件
 | 
			
		||||
     */
 | 
			
		||||
    private List<SysOssVo> licenseCountFile;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 设备材料入库/移交
 | 
			
		||||
     */
 | 
			
		||||
    private String storageType;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 备注
 | 
			
		||||
     */
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 明细项列表
 | 
			
		||||
     */
 | 
			
		||||
    private List<MatMaterialReceiveItemVo> itemList;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,75 @@
 | 
			
		||||
package org.dromara.materials.domain.vo.materialreceiveitem;
 | 
			
		||||
 | 
			
		||||
import io.github.linpeilie.annotations.AutoMapper;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import org.dromara.materials.domain.MatMaterialReceiveItem;
 | 
			
		||||
 | 
			
		||||
import java.io.Serial;
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.math.BigDecimal;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 物料接收单明细项视图对象 mat_material_receive_item
 | 
			
		||||
 *
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025-07-04
 | 
			
		||||
 */
 | 
			
		||||
@Data
 | 
			
		||||
@AutoMapper(target = MatMaterialReceiveItem.class)
 | 
			
		||||
public class MatMaterialReceiveItemVo implements Serializable {
 | 
			
		||||
 | 
			
		||||
    @Serial
 | 
			
		||||
    private static final long serialVersionUID = 1L;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 主键id
 | 
			
		||||
     */
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 项目id
 | 
			
		||||
     */
 | 
			
		||||
    private Long projectId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 接收单id
 | 
			
		||||
     */
 | 
			
		||||
    private Long receiveId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 名称
 | 
			
		||||
     */
 | 
			
		||||
    private String name;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 规格
 | 
			
		||||
     */
 | 
			
		||||
    private String specification;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 单位
 | 
			
		||||
     */
 | 
			
		||||
    private String unit;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 数量
 | 
			
		||||
     */
 | 
			
		||||
    private BigDecimal quantity;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 验收
 | 
			
		||||
     */
 | 
			
		||||
    private BigDecimal acceptedQuantity;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 缺件
 | 
			
		||||
     */
 | 
			
		||||
    private BigDecimal shortageQuantity;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 备注
 | 
			
		||||
     */
 | 
			
		||||
    private String remark;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,15 @@
 | 
			
		||||
package org.dromara.materials.mapper;
 | 
			
		||||
 | 
			
		||||
import org.dromara.materials.domain.MatMaterialIssueItem;
 | 
			
		||||
import org.dromara.materials.domain.vo.materialissueitem.MatMaterialIssueItemVo;
 | 
			
		||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 物料领料单明细项Mapper接口
 | 
			
		||||
 *
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025-07-04
 | 
			
		||||
 */
 | 
			
		||||
public interface MatMaterialIssueItemMapper extends BaseMapperPlus<MatMaterialIssueItem, MatMaterialIssueItemVo> {
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,15 @@
 | 
			
		||||
package org.dromara.materials.mapper;
 | 
			
		||||
 | 
			
		||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
 | 
			
		||||
import org.dromara.materials.domain.MatMaterialIssue;
 | 
			
		||||
import org.dromara.materials.domain.vo.materialissue.MatMaterialIssueVo;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 物料领料单Mapper接口
 | 
			
		||||
 *
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025-07-04
 | 
			
		||||
 */
 | 
			
		||||
public interface MatMaterialIssueMapper extends BaseMapperPlus<MatMaterialIssue, MatMaterialIssueVo> {
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,15 @@
 | 
			
		||||
package org.dromara.materials.mapper;
 | 
			
		||||
 | 
			
		||||
import org.dromara.materials.domain.MatMaterialReceiveItem;
 | 
			
		||||
import org.dromara.materials.domain.vo.materialreceiveitem.MatMaterialReceiveItemVo;
 | 
			
		||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 物料接收单明细项Mapper接口
 | 
			
		||||
 *
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025-07-04
 | 
			
		||||
 */
 | 
			
		||||
public interface MatMaterialReceiveItemMapper extends BaseMapperPlus<MatMaterialReceiveItem, MatMaterialReceiveItemVo> {
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,15 @@
 | 
			
		||||
package org.dromara.materials.mapper;
 | 
			
		||||
 | 
			
		||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
 | 
			
		||||
import org.dromara.materials.domain.MatMaterialReceive;
 | 
			
		||||
import org.dromara.materials.domain.vo.materialreceive.MatMaterialReceiveVo;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 物料接收单Mapper接口
 | 
			
		||||
 *
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025-07-04
 | 
			
		||||
 */
 | 
			
		||||
public interface MatMaterialReceiveMapper extends BaseMapperPlus<MatMaterialReceive, MatMaterialReceiveVo> {
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,41 @@
 | 
			
		||||
package org.dromara.materials.service;
 | 
			
		||||
 | 
			
		||||
import com.baomidou.mybatisplus.extension.service.IService;
 | 
			
		||||
import org.dromara.materials.domain.MatMaterialIssueItem;
 | 
			
		||||
import org.dromara.materials.domain.vo.materialissueitem.MatMaterialIssueItemVo;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 物料领料单明细项Service接口
 | 
			
		||||
 *
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025-07-04
 | 
			
		||||
 */
 | 
			
		||||
public interface IMatMaterialIssueItemService extends IService<MatMaterialIssueItem> {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询物料领料单明细项列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param issueId 领料单id
 | 
			
		||||
     * @return 物料领料单明细项列表
 | 
			
		||||
     */
 | 
			
		||||
    List<MatMaterialIssueItem> queryListByIssueId(Long issueId);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取物料领料单明细项视图对象
 | 
			
		||||
     *
 | 
			
		||||
     * @param matMaterialIssueItem 物料领料单明细项对象
 | 
			
		||||
     * @return 物料领料单明细项视图对象
 | 
			
		||||
     */
 | 
			
		||||
    MatMaterialIssueItemVo getVo(MatMaterialIssueItem matMaterialIssueItem);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取物料领料单明细项视图对象列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param matMaterialIssueItemList 物料领料单明细项对象列表
 | 
			
		||||
     * @return 物料领料单明细项视图对象列表
 | 
			
		||||
     */
 | 
			
		||||
    List<MatMaterialIssueItemVo> getVoList(List<MatMaterialIssueItem> matMaterialIssueItemList);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,106 @@
 | 
			
		||||
package org.dromara.materials.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.materials.domain.MatMaterialIssue;
 | 
			
		||||
import org.dromara.materials.domain.dto.materialissue.MatMaterialIssueCreateReq;
 | 
			
		||||
import org.dromara.materials.domain.dto.materialissue.MatMaterialIssueQueryReq;
 | 
			
		||||
import org.dromara.materials.domain.dto.materialissue.MatMaterialIssueUpdateReq;
 | 
			
		||||
import org.dromara.materials.domain.vo.materialissue.MatMaterialIssueVo;
 | 
			
		||||
 | 
			
		||||
import java.util.Collection;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 物料领料单Service接口
 | 
			
		||||
 *
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025-07-04
 | 
			
		||||
 */
 | 
			
		||||
public interface IMatMaterialIssueService extends IService<MatMaterialIssue> {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询物料领料单
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 主键
 | 
			
		||||
     * @return 物料领料单
 | 
			
		||||
     */
 | 
			
		||||
    MatMaterialIssueVo queryById(Long id);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 分页查询物料领料单列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param req       查询条件
 | 
			
		||||
     * @param pageQuery 分页参数
 | 
			
		||||
     * @return 物料领料单分页列表
 | 
			
		||||
     */
 | 
			
		||||
    TableDataInfo<MatMaterialIssueVo> queryPageList(MatMaterialIssueQueryReq req, PageQuery pageQuery);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询符合条件的物料领料单列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param req 查询条件
 | 
			
		||||
     * @return 物料领料单列表
 | 
			
		||||
     */
 | 
			
		||||
    List<MatMaterialIssueVo> queryList(MatMaterialIssueQueryReq req);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据id导出word
 | 
			
		||||
     *
 | 
			
		||||
     * @param id       主键
 | 
			
		||||
     * @param response 响应
 | 
			
		||||
     */
 | 
			
		||||
    void exportWordById(Long id, HttpServletResponse response);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 新增物料领料单
 | 
			
		||||
     *
 | 
			
		||||
     * @param req 物料领料单
 | 
			
		||||
     * @return 是否新增成功
 | 
			
		||||
     */
 | 
			
		||||
    Boolean insertByBo(MatMaterialIssueCreateReq req);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 修改物料领料单
 | 
			
		||||
     *
 | 
			
		||||
     * @param req 物料领料单
 | 
			
		||||
     * @return 是否修改成功
 | 
			
		||||
     */
 | 
			
		||||
    Boolean updateByBo(MatMaterialIssueUpdateReq req);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 批量删除物料领料单信息
 | 
			
		||||
     *
 | 
			
		||||
     * @param ids 待删除的主键集合
 | 
			
		||||
     * @return 是否删除成功
 | 
			
		||||
     */
 | 
			
		||||
    Boolean deleteByIds(Collection<Long> ids);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取物料领料单视图对象
 | 
			
		||||
     *
 | 
			
		||||
     * @param materialIssue 物料领料单对象
 | 
			
		||||
     * @return 物料领料单视图对象
 | 
			
		||||
     */
 | 
			
		||||
    MatMaterialIssueVo getVo(MatMaterialIssue materialIssue);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 构建查询条件封装
 | 
			
		||||
     *
 | 
			
		||||
     * @param req 查询条件
 | 
			
		||||
     * @return 查询条件封装
 | 
			
		||||
     */
 | 
			
		||||
    LambdaQueryWrapper<MatMaterialIssue> buildQueryWrapper(MatMaterialIssueQueryReq req);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取物料领料单分页对象视图
 | 
			
		||||
     *
 | 
			
		||||
     * @param materialIssuePage 物料领料单分页对象
 | 
			
		||||
     * @return 物料领料单分页对象视图
 | 
			
		||||
     */
 | 
			
		||||
    Page<MatMaterialIssueVo> getVoPage(Page<MatMaterialIssue> materialIssuePage);
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,41 @@
 | 
			
		||||
package org.dromara.materials.service;
 | 
			
		||||
 | 
			
		||||
import com.baomidou.mybatisplus.extension.service.IService;
 | 
			
		||||
import org.dromara.materials.domain.MatMaterialReceiveItem;
 | 
			
		||||
import org.dromara.materials.domain.vo.materialreceiveitem.MatMaterialReceiveItemVo;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 物料接收单明细项Service接口
 | 
			
		||||
 *
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025-07-04
 | 
			
		||||
 */
 | 
			
		||||
public interface IMatMaterialReceiveItemService extends IService<MatMaterialReceiveItem> {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询物料接收单明细项列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param issueId 接收单id
 | 
			
		||||
     * @return 物料接收单明细项列表
 | 
			
		||||
     */
 | 
			
		||||
    List<MatMaterialReceiveItem> queryListByReceiveId(Long issueId);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取物料接收单明细项视图对象
 | 
			
		||||
     *
 | 
			
		||||
     * @param matMaterialReceiveItem 物料接收单明细项对象
 | 
			
		||||
     * @return 物料接收单明细项视图对象
 | 
			
		||||
     */
 | 
			
		||||
    MatMaterialReceiveItemVo getVo(MatMaterialReceiveItem matMaterialReceiveItem);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取物料接收单明细项视图对象列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param matMaterialReceiveItemList 物料接收单明细项对象列表
 | 
			
		||||
     * @return 物料接收单明细项视图对象列表
 | 
			
		||||
     */
 | 
			
		||||
    List<MatMaterialReceiveItemVo> getVoList(List<MatMaterialReceiveItem> matMaterialReceiveItemList);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,106 @@
 | 
			
		||||
package org.dromara.materials.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.materials.domain.MatMaterialReceive;
 | 
			
		||||
import org.dromara.materials.domain.dto.materialreceive.MatMaterialReceiveCreateReq;
 | 
			
		||||
import org.dromara.materials.domain.dto.materialreceive.MatMaterialReceiveQueryReq;
 | 
			
		||||
import org.dromara.materials.domain.dto.materialreceive.MatMaterialReceiveUpdateReq;
 | 
			
		||||
import org.dromara.materials.domain.vo.materialreceive.MatMaterialReceiveVo;
 | 
			
		||||
 | 
			
		||||
import java.util.Collection;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 物料接收单Service接口
 | 
			
		||||
 *
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025-07-04
 | 
			
		||||
 */
 | 
			
		||||
public interface IMatMaterialReceiveService extends IService<MatMaterialReceive> {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询物料接收单
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 主键
 | 
			
		||||
     * @return 物料接收单
 | 
			
		||||
     */
 | 
			
		||||
    MatMaterialReceiveVo queryById(Long id);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 分页查询物料接收单列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param req       查询条件
 | 
			
		||||
     * @param pageQuery 分页参数
 | 
			
		||||
     * @return 物料接收单分页列表
 | 
			
		||||
     */
 | 
			
		||||
    TableDataInfo<MatMaterialReceiveVo> queryPageList(MatMaterialReceiveQueryReq req, PageQuery pageQuery);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询符合条件的物料接收单列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param req 查询条件
 | 
			
		||||
     * @return 物料接收单列表
 | 
			
		||||
     */
 | 
			
		||||
    List<MatMaterialReceiveVo> queryList(MatMaterialReceiveQueryReq req);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据id导出word
 | 
			
		||||
     *
 | 
			
		||||
     * @param id       主键
 | 
			
		||||
     * @param response 响应
 | 
			
		||||
     */
 | 
			
		||||
    void exportWordById(Long id, HttpServletResponse response);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 新增物料接收单
 | 
			
		||||
     *
 | 
			
		||||
     * @param req 物料接收单
 | 
			
		||||
     * @return 是否新增成功
 | 
			
		||||
     */
 | 
			
		||||
    Boolean insertByBo(MatMaterialReceiveCreateReq req);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 修改物料接收单
 | 
			
		||||
     *
 | 
			
		||||
     * @param req 物料接收单
 | 
			
		||||
     * @return 是否修改成功
 | 
			
		||||
     */
 | 
			
		||||
    Boolean updateByBo(MatMaterialReceiveUpdateReq req);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 批量删除物料接收单信息
 | 
			
		||||
     *
 | 
			
		||||
     * @param ids 待删除的主键集合
 | 
			
		||||
     * @return 是否删除成功
 | 
			
		||||
     */
 | 
			
		||||
    Boolean deleteByIds(Collection<Long> ids);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取物料接收单视图对象
 | 
			
		||||
     *
 | 
			
		||||
     * @param materialReceive 物料接收单对象
 | 
			
		||||
     * @return 物料接收单视图对象
 | 
			
		||||
     */
 | 
			
		||||
    MatMaterialReceiveVo getVo(MatMaterialReceive materialReceive);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 构建查询条件封装
 | 
			
		||||
     *
 | 
			
		||||
     * @param req 查询条件
 | 
			
		||||
     * @return 查询条件封装
 | 
			
		||||
     */
 | 
			
		||||
    LambdaQueryWrapper<MatMaterialReceive> buildQueryWrapper(MatMaterialReceiveQueryReq req);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取物料接收单分页对象视图
 | 
			
		||||
     *
 | 
			
		||||
     * @param materialReceivePage 物料接收单分页对象
 | 
			
		||||
     * @return 物料接收单分页对象视图
 | 
			
		||||
     */
 | 
			
		||||
    Page<MatMaterialReceiveVo> getVoPage(Page<MatMaterialReceive> materialReceivePage);
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,59 @@
 | 
			
		||||
package org.dromara.materials.service.impl;
 | 
			
		||||
 | 
			
		||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 | 
			
		||||
import org.dromara.materials.domain.MatMaterialIssueItem;
 | 
			
		||||
import org.dromara.materials.domain.vo.materialissueitem.MatMaterialIssueItemVo;
 | 
			
		||||
import org.dromara.materials.mapper.MatMaterialIssueItemMapper;
 | 
			
		||||
import org.dromara.materials.service.IMatMaterialIssueItemService;
 | 
			
		||||
import org.springframework.beans.BeanUtils;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 物料领料单明细项Service业务层处理
 | 
			
		||||
 *
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025-07-04
 | 
			
		||||
 */
 | 
			
		||||
@Service
 | 
			
		||||
public class MatMaterialIssueItemServiceImpl extends ServiceImpl<MatMaterialIssueItemMapper, MatMaterialIssueItem>
 | 
			
		||||
    implements IMatMaterialIssueItemService {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询物料领料单明细项列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param issueId 领料单id
 | 
			
		||||
     * @return 物料领料单明细项列表
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<MatMaterialIssueItem> queryListByIssueId(Long issueId) {
 | 
			
		||||
        return this.lambdaQuery()
 | 
			
		||||
            .eq(MatMaterialIssueItem::getIssueId, issueId)
 | 
			
		||||
            .list();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取物料领料单明细项视图对象
 | 
			
		||||
     *
 | 
			
		||||
     * @param matMaterialIssueItem 物料领料单明细项对象
 | 
			
		||||
     * @return 物料领料单明细项视图对象
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public MatMaterialIssueItemVo getVo(MatMaterialIssueItem matMaterialIssueItem) {
 | 
			
		||||
        MatMaterialIssueItemVo vo = new MatMaterialIssueItemVo();
 | 
			
		||||
        BeanUtils.copyProperties(matMaterialIssueItem, vo);
 | 
			
		||||
        return vo;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取物料领料单明细项视图对象列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param matMaterialIssueItemList 物料领料单明细项对象列表
 | 
			
		||||
     * @return 物料领料单明细项视图对象列表
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<MatMaterialIssueItemVo> getVoList(List<MatMaterialIssueItem> matMaterialIssueItemList) {
 | 
			
		||||
        return matMaterialIssueItemList.stream().map(this::getVo).toList();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,529 @@
 | 
			
		||||
package org.dromara.materials.service.impl;
 | 
			
		||||
 | 
			
		||||
import cn.hutool.core.collection.CollUtil;
 | 
			
		||||
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.deepoove.poi.XWPFTemplate;
 | 
			
		||||
import com.deepoove.poi.config.Configure;
 | 
			
		||||
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
 | 
			
		||||
import jakarta.annotation.Resource;
 | 
			
		||||
import jakarta.servlet.http.HttpServletResponse;
 | 
			
		||||
import lombok.extern.slf4j.Slf4j;
 | 
			
		||||
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.materials.constants.MatMaterialsConstant;
 | 
			
		||||
import org.dromara.materials.domain.MatMaterialIssue;
 | 
			
		||||
import org.dromara.materials.domain.MatMaterialIssueItem;
 | 
			
		||||
import org.dromara.materials.domain.dto.materialissue.MatMaterialIssueCreateReq;
 | 
			
		||||
import org.dromara.materials.domain.dto.materialissue.MatMaterialIssueQueryReq;
 | 
			
		||||
import org.dromara.materials.domain.dto.materialissue.MatMaterialIssueUpdateReq;
 | 
			
		||||
import org.dromara.materials.domain.dto.materialissue.MatMaterialIssueWordDto;
 | 
			
		||||
import org.dromara.materials.domain.dto.materialissueitem.MatMaterialIssueItemDto;
 | 
			
		||||
import org.dromara.materials.domain.dto.materialissueitem.MatMaterialIssueItemWordDto;
 | 
			
		||||
import org.dromara.materials.domain.vo.materialissue.MatMaterialIssueVo;
 | 
			
		||||
import org.dromara.materials.mapper.MatMaterialIssueMapper;
 | 
			
		||||
import org.dromara.materials.service.IMatMaterialIssueItemService;
 | 
			
		||||
import org.dromara.materials.service.IMatMaterialIssueService;
 | 
			
		||||
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.math.BigDecimal;
 | 
			
		||||
import java.nio.file.Files;
 | 
			
		||||
import java.nio.file.Path;
 | 
			
		||||
import java.nio.file.Paths;
 | 
			
		||||
import java.util.*;
 | 
			
		||||
import java.util.zip.ZipOutputStream;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 物料领料单Service业务层处理
 | 
			
		||||
 *
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025-07-04
 | 
			
		||||
 */
 | 
			
		||||
@Slf4j
 | 
			
		||||
@Service
 | 
			
		||||
public class MatMaterialIssueServiceImpl extends ServiceImpl<MatMaterialIssueMapper, MatMaterialIssue>
 | 
			
		||||
    implements IMatMaterialIssueService {
 | 
			
		||||
 | 
			
		||||
    @Resource
 | 
			
		||||
    private ISysOssService ossService;
 | 
			
		||||
 | 
			
		||||
    @Resource
 | 
			
		||||
    private IBusProjectService projectService;
 | 
			
		||||
 | 
			
		||||
    @Resource
 | 
			
		||||
    private IMatMaterialIssueItemService materialIssueItemService;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询物料领料单
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 主键
 | 
			
		||||
     * @return 物料领料单
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public MatMaterialIssueVo queryById(Long id) {
 | 
			
		||||
        MatMaterialIssue materialIssue = this.getById(id);
 | 
			
		||||
        if (materialIssue == null) {
 | 
			
		||||
            throw new ServiceException("物料领料单信息不存在", HttpStatus.NOT_FOUND);
 | 
			
		||||
        }
 | 
			
		||||
        return this.getVo(materialIssue);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 分页查询物料领料单列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param req       查询条件
 | 
			
		||||
     * @param pageQuery 分页参数
 | 
			
		||||
     * @return 物料领料单分页列表
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public TableDataInfo<MatMaterialIssueVo> queryPageList(MatMaterialIssueQueryReq req, PageQuery pageQuery) {
 | 
			
		||||
        Page<MatMaterialIssue> issuePage = this.page(pageQuery.build(), this.buildQueryWrapper(req));
 | 
			
		||||
        return TableDataInfo.build(this.getVoPage(issuePage));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询符合条件的物料领料单列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param req 查询条件
 | 
			
		||||
     * @return 物料领料单列表
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<MatMaterialIssueVo> queryList(MatMaterialIssueQueryReq req) {
 | 
			
		||||
        return this.list(this.buildQueryWrapper(req)).stream().map(this::getVo).toList();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据id导出word
 | 
			
		||||
     *
 | 
			
		||||
     * @param id       主键
 | 
			
		||||
     * @param response 响应
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public void exportWordById(Long id, HttpServletResponse response) {
 | 
			
		||||
        MatMaterialIssue materialIssue = this.getById(id);
 | 
			
		||||
        if (materialIssue == null) {
 | 
			
		||||
            throw new ServiceException("物料领料单不存在");
 | 
			
		||||
        }
 | 
			
		||||
        Path targetDir = Paths.get(MatMaterialsConstant.getMatMaterialIssueFileUrl(materialIssue));
 | 
			
		||||
        // 如果存在目录则直接返回,不存在则生成文件并返回
 | 
			
		||||
        if (!Files.exists(targetDir)) {
 | 
			
		||||
            // 清理旧文件
 | 
			
		||||
            String baseUrl = MatMaterialsConstant.MATERIALS_ISSUE_FILE_URL + materialIssue.getId();
 | 
			
		||||
            try {
 | 
			
		||||
                Path dirPath = Paths.get(baseUrl);
 | 
			
		||||
                if (Files.exists(dirPath)) {
 | 
			
		||||
                    FileUtils.deleteDirectory(dirPath);
 | 
			
		||||
                }
 | 
			
		||||
            } catch (IOException e) {
 | 
			
		||||
                log.error("文件目录:{},清理失败", baseUrl, e);
 | 
			
		||||
            }
 | 
			
		||||
            // 准备数据
 | 
			
		||||
            List<MatMaterialIssueItem> itemList = materialIssueItemService.queryListByIssueId(id);
 | 
			
		||||
            MatMaterialIssueWordDto data = this.getReplacementDto(materialIssue, itemList);
 | 
			
		||||
            // 生成文件
 | 
			
		||||
            try (InputStream is = getClass().getClassLoader().getResourceAsStream(MatMaterialsConstant.MATERIALS_ISSUE_TEMPLATE_PATH)) {
 | 
			
		||||
                if (is == null) {
 | 
			
		||||
                    throw new ServiceException("模板文件不存在");
 | 
			
		||||
                }
 | 
			
		||||
                LoopRowTableRenderPolicy hackLoopTableRenderPolicy = new LoopRowTableRenderPolicy();
 | 
			
		||||
                Configure config = Configure.builder().bind("items", hackLoopTableRenderPolicy).build();
 | 
			
		||||
                XWPFTemplate template = XWPFTemplate.compile(is, config);
 | 
			
		||||
                template.render(data);
 | 
			
		||||
                // 创建目标目录
 | 
			
		||||
                if (!Files.exists(targetDir)) {
 | 
			
		||||
                    Files.createDirectories(targetDir);
 | 
			
		||||
                }
 | 
			
		||||
                // 组合目标文件名
 | 
			
		||||
                String fileName = MatMaterialsConstant.getMatMaterialIssueFileName(materialIssue);
 | 
			
		||||
                // 保存修改后的文件
 | 
			
		||||
                try (FileOutputStream fos = new FileOutputStream(targetDir.resolve(fileName).toFile())) {
 | 
			
		||||
                    template.write(fos);
 | 
			
		||||
                }
 | 
			
		||||
                template.close();
 | 
			
		||||
                // 获取附件
 | 
			
		||||
                String certCountFileId = materialIssue.getCertCountFileId();
 | 
			
		||||
                String reportCountFileId = materialIssue.getReportCountFileId();
 | 
			
		||||
                String techDocCountFileId = materialIssue.getTechDocCountFileId();
 | 
			
		||||
                String licenseCountFileId = materialIssue.getLicenseCountFileId();
 | 
			
		||||
                if (StringUtils.isNotBlank(certCountFileId)) {
 | 
			
		||||
                    List<Long> ossIdList = Arrays.stream(certCountFileId.split(",")).map(Long::parseLong).toList();
 | 
			
		||||
                    List<SysOssVo> ossVoList = ossService.listByIds(ossIdList);
 | 
			
		||||
                    String baseFile = MatMaterialsConstant.getMatMaterialIssueFileUrl(materialIssue) + "/合格证";
 | 
			
		||||
                    for (SysOssVo ossVo : ossVoList) {
 | 
			
		||||
                        OssClient storage = OssFactory.instance(ossVo.getService());
 | 
			
		||||
                        storage.fileDownload(ossVo.getUrl(), ossVo.getOriginalName(), baseFile);
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
                if (StringUtils.isNotBlank(reportCountFileId)) {
 | 
			
		||||
                    List<Long> ossIdList = Arrays.stream(reportCountFileId.split(",")).map(Long::parseLong).toList();
 | 
			
		||||
                    List<SysOssVo> ossVoList = ossService.listByIds(ossIdList);
 | 
			
		||||
                    String baseFile = MatMaterialsConstant.getMatMaterialIssueFileUrl(materialIssue) + "/出厂报告";
 | 
			
		||||
                    for (SysOssVo ossVo : ossVoList) {
 | 
			
		||||
                        OssClient storage = OssFactory.instance(ossVo.getService());
 | 
			
		||||
                        storage.fileDownload(ossVo.getUrl(), ossVo.getOriginalName(), baseFile);
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
                if (StringUtils.isNotBlank(techDocCountFileId)) {
 | 
			
		||||
                    List<Long> ossIdList = Arrays.stream(techDocCountFileId.split(",")).map(Long::parseLong).toList();
 | 
			
		||||
                    List<SysOssVo> ossVoList = ossService.listByIds(ossIdList);
 | 
			
		||||
                    String baseFile = MatMaterialsConstant.getMatMaterialIssueFileUrl(materialIssue) + "/技术资料";
 | 
			
		||||
                    for (SysOssVo ossVo : ossVoList) {
 | 
			
		||||
                        OssClient storage = OssFactory.instance(ossVo.getService());
 | 
			
		||||
                        storage.fileDownload(ossVo.getUrl(), ossVo.getOriginalName(), baseFile);
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
                if (StringUtils.isNotBlank(licenseCountFileId)) {
 | 
			
		||||
                    List<Long> ossIdList = Arrays.stream(licenseCountFileId.split(",")).map(Long::parseLong).toList();
 | 
			
		||||
                    List<SysOssVo> ossVoList = ossService.listByIds(ossIdList);
 | 
			
		||||
                    String baseFile = MatMaterialsConstant.getMatMaterialIssueFileUrl(materialIssue) + "/厂家资质文件";
 | 
			
		||||
                    for (SysOssVo ossVo : ossVoList) {
 | 
			
		||||
                        OssClient storage = OssFactory.instance(ossVo.getService());
 | 
			
		||||
                        storage.fileDownload(ossVo.getUrl(), ossVo.getOriginalName(), baseFile);
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
            } catch (IOException 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 是否新增成功
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    @Transactional(rollbackFor = Exception.class)
 | 
			
		||||
    public Boolean insertByBo(MatMaterialIssueCreateReq req) {
 | 
			
		||||
        MatMaterialIssue materialIssue = new MatMaterialIssue();
 | 
			
		||||
        BeanUtils.copyProperties(req, materialIssue);
 | 
			
		||||
        validEntityBeforeSave(materialIssue, true);
 | 
			
		||||
        getFileSize(materialIssue,
 | 
			
		||||
            req.getLicenseCountFileId(),
 | 
			
		||||
            req.getReportCountFileId(),
 | 
			
		||||
            req.getTechDocCountFileId(),
 | 
			
		||||
            req.getCertCountFileId());
 | 
			
		||||
        boolean save = this.save(materialIssue);
 | 
			
		||||
        if (!save) {
 | 
			
		||||
            throw new ServiceException("物料领料单新增失败", HttpStatus.ERROR);
 | 
			
		||||
        }
 | 
			
		||||
        List<MatMaterialIssueItemDto> itemList = req.getItemList();
 | 
			
		||||
        if (CollUtil.isNotEmpty(itemList)) {
 | 
			
		||||
            List<MatMaterialIssueItem> materialIssueItemList = itemList.stream().map(item -> {
 | 
			
		||||
                MatMaterialIssueItem materialIssueItem = new MatMaterialIssueItem();
 | 
			
		||||
                BeanUtils.copyProperties(item, materialIssueItem);
 | 
			
		||||
                materialIssueItem.setIssueId(materialIssue.getId());
 | 
			
		||||
                materialIssueItem.setProjectId(materialIssue.getProjectId());
 | 
			
		||||
                return materialIssueItem;
 | 
			
		||||
            }).toList();
 | 
			
		||||
            boolean result = materialIssueItemService.saveBatch(materialIssueItemList);
 | 
			
		||||
            if (!result) {
 | 
			
		||||
                throw new ServiceException("物料领料单明细项新增失败", HttpStatus.ERROR);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 修改物料领料单
 | 
			
		||||
     *
 | 
			
		||||
     * @param req 物料领料单
 | 
			
		||||
     * @return 是否修改成功
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    @Transactional(rollbackFor = Exception.class)
 | 
			
		||||
    public Boolean updateByBo(MatMaterialIssueUpdateReq req) {
 | 
			
		||||
        Long id = req.getId();
 | 
			
		||||
        MatMaterialIssue oldMaterialIssue = this.getById(id);
 | 
			
		||||
        if (oldMaterialIssue == null) {
 | 
			
		||||
            throw new ServiceException("修改物料收货单失败,数据不存在", HttpStatus.NOT_FOUND);
 | 
			
		||||
        }
 | 
			
		||||
        MatMaterialIssue materialIssue = new MatMaterialIssue();
 | 
			
		||||
        BeanUtils.copyProperties(req, materialIssue);
 | 
			
		||||
        validEntityBeforeSave(materialIssue, false);
 | 
			
		||||
        getFileSize(materialIssue,
 | 
			
		||||
            req.getLicenseCountFileId(),
 | 
			
		||||
            req.getReportCountFileId(),
 | 
			
		||||
            req.getTechDocCountFileId(),
 | 
			
		||||
            req.getCertCountFileId());
 | 
			
		||||
        boolean update = this.updateById(materialIssue);
 | 
			
		||||
        if (!update) {
 | 
			
		||||
            throw new ServiceException("物料领料单修改失败", HttpStatus.ERROR);
 | 
			
		||||
        }
 | 
			
		||||
        // 删除旧的
 | 
			
		||||
        List<MatMaterialIssueItem> oldMaterialIssueItemList = materialIssueItemService.queryListByIssueId(id);
 | 
			
		||||
        if (CollUtil.isNotEmpty(oldMaterialIssueItemList)) {
 | 
			
		||||
            boolean result = materialIssueItemService.removeBatchByIds(oldMaterialIssueItemList);
 | 
			
		||||
            if (!result) {
 | 
			
		||||
                throw new ServiceException("物料领料单明细项删除失败", HttpStatus.ERROR);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        // 重新添加
 | 
			
		||||
        List<MatMaterialIssueItemDto> itemList = req.getItemList();
 | 
			
		||||
        if (CollUtil.isNotEmpty(itemList)) {
 | 
			
		||||
            List<MatMaterialIssueItem> materialIssueItemList = itemList.stream().map(item -> {
 | 
			
		||||
                MatMaterialIssueItem materialIssueItem = new MatMaterialIssueItem();
 | 
			
		||||
                BeanUtils.copyProperties(item, materialIssueItem);
 | 
			
		||||
                materialIssueItem.setIssueId(id);
 | 
			
		||||
                materialIssueItem.setProjectId(materialIssue.getProjectId());
 | 
			
		||||
                return materialIssueItem;
 | 
			
		||||
            }).toList();
 | 
			
		||||
            boolean result = materialIssueItemService.saveBatch(materialIssueItemList);
 | 
			
		||||
            if (!result) {
 | 
			
		||||
                throw new ServiceException("物料领料单明细项新增失败", HttpStatus.ERROR);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 保存前的数据校验
 | 
			
		||||
     */
 | 
			
		||||
    private void validEntityBeforeSave(MatMaterialIssue entity, Boolean create) {
 | 
			
		||||
        // 做一些数据校验,如唯一约束
 | 
			
		||||
        Long projectId = entity.getProjectId();
 | 
			
		||||
        String materialSource = entity.getMaterialSource();
 | 
			
		||||
        if (create) {
 | 
			
		||||
            if (projectId == null) {
 | 
			
		||||
                throw new ServiceException("项目 id 不能为空", HttpStatus.BAD_REQUEST);
 | 
			
		||||
            }
 | 
			
		||||
            if (StringUtils.isEmpty(materialSource)) {
 | 
			
		||||
                throw new ServiceException("物料来源不能为空", 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) {
 | 
			
		||||
        List<MatMaterialIssueItem> itemList = materialIssueItemService.lambdaQuery()
 | 
			
		||||
            .in(MatMaterialIssueItem::getIssueId, ids)
 | 
			
		||||
            .list();
 | 
			
		||||
        if (CollUtil.isNotEmpty(itemList)) {
 | 
			
		||||
            materialIssueItemService.removeBatchByIds(itemList);
 | 
			
		||||
        }
 | 
			
		||||
        return this.removeBatchByIds(ids);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取物料领料单视图对象
 | 
			
		||||
     *
 | 
			
		||||
     * @param materialIssue 物料领料单对象
 | 
			
		||||
     * @return 物料领料单视图对象
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public MatMaterialIssueVo getVo(MatMaterialIssue materialIssue) {
 | 
			
		||||
        MatMaterialIssueVo vo = new MatMaterialIssueVo();
 | 
			
		||||
        BeanUtils.copyProperties(materialIssue, vo);
 | 
			
		||||
        List<MatMaterialIssueItem> itemList = materialIssueItemService.queryListByIssueId(materialIssue.getId());
 | 
			
		||||
        if (CollUtil.isNotEmpty(itemList)) {
 | 
			
		||||
            vo.setItemList(materialIssueItemService.getVoList(itemList));
 | 
			
		||||
        }
 | 
			
		||||
        String licenseCountFileId = materialIssue.getLicenseCountFileId();
 | 
			
		||||
        if (StringUtils.isNotBlank(licenseCountFileId)) {
 | 
			
		||||
            List<Long> ossIdList = Arrays.stream(licenseCountFileId.split(",")).map(Long::parseLong).toList();
 | 
			
		||||
            List<SysOssVo> ossVoList = ossService.listByIds(ossIdList);
 | 
			
		||||
            vo.setLicenseCountFile(ossVoList);
 | 
			
		||||
        }
 | 
			
		||||
        String reportCountFileId = materialIssue.getReportCountFileId();
 | 
			
		||||
        if (StringUtils.isNotBlank(reportCountFileId)) {
 | 
			
		||||
            List<Long> ossIdList = Arrays.stream(reportCountFileId.split(",")).map(Long::parseLong).toList();
 | 
			
		||||
            List<SysOssVo> ossVoList = ossService.listByIds(ossIdList);
 | 
			
		||||
            vo.setReportCountFile(ossVoList);
 | 
			
		||||
        }
 | 
			
		||||
        String techDocCountFileId = materialIssue.getTechDocCountFileId();
 | 
			
		||||
        if (StringUtils.isNotBlank(techDocCountFileId)) {
 | 
			
		||||
            List<Long> ossIdList = Arrays.stream(techDocCountFileId.split(",")).map(Long::parseLong).toList();
 | 
			
		||||
            List<SysOssVo> ossVoList = ossService.listByIds(ossIdList);
 | 
			
		||||
            vo.setTechDocCountFile(ossVoList);
 | 
			
		||||
        }
 | 
			
		||||
        String certCountFileId = materialIssue.getCertCountFileId();
 | 
			
		||||
        if (StringUtils.isNotBlank(certCountFileId)) {
 | 
			
		||||
            List<Long> ossIdList = Arrays.stream(certCountFileId.split(",")).map(Long::parseLong).toList();
 | 
			
		||||
            List<SysOssVo> ossVoList = ossService.listByIds(ossIdList);
 | 
			
		||||
            vo.setCertCountFile(ossVoList);
 | 
			
		||||
        }
 | 
			
		||||
        return vo;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 构建查询条件封装
 | 
			
		||||
     *
 | 
			
		||||
     * @param req 查询条件
 | 
			
		||||
     * @return 查询条件封装
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public LambdaQueryWrapper<MatMaterialIssue> buildQueryWrapper(MatMaterialIssueQueryReq req) {
 | 
			
		||||
        LambdaQueryWrapper<MatMaterialIssue> lqw = new LambdaQueryWrapper<>();
 | 
			
		||||
        if (req == null) {
 | 
			
		||||
            return lqw;
 | 
			
		||||
        }
 | 
			
		||||
        Long projectId = req.getProjectId();
 | 
			
		||||
        String materialSource = req.getMaterialSource();
 | 
			
		||||
        String formCode = req.getFormCode();
 | 
			
		||||
        String projectName = req.getProjectName();
 | 
			
		||||
        String materialName = req.getMaterialName();
 | 
			
		||||
        String orderingUnit = req.getOrderingUnit();
 | 
			
		||||
        String supplierUnit = req.getSupplierUnit();
 | 
			
		||||
        String issueUnit = req.getIssueUnit();
 | 
			
		||||
        String storageUnit = req.getStorageUnit();
 | 
			
		||||
        lqw.like(StringUtils.isNotBlank(projectName), MatMaterialIssue::getProjectName, projectName);
 | 
			
		||||
        lqw.like(StringUtils.isNotBlank(materialName), MatMaterialIssue::getMaterialName, materialName);
 | 
			
		||||
        lqw.like(StringUtils.isNotBlank(orderingUnit), MatMaterialIssue::getOrderingUnit, orderingUnit);
 | 
			
		||||
        lqw.like(StringUtils.isNotBlank(supplierUnit), MatMaterialIssue::getSupplierUnit, supplierUnit);
 | 
			
		||||
        lqw.like(StringUtils.isNotBlank(issueUnit), MatMaterialIssue::getIssueUnit, issueUnit);
 | 
			
		||||
        lqw.like(StringUtils.isNotBlank(storageUnit), MatMaterialIssue::getStorageUnit, storageUnit);
 | 
			
		||||
        lqw.like(StringUtils.isNotBlank(formCode), MatMaterialIssue::getFormCode, formCode);
 | 
			
		||||
        lqw.eq(ObjectUtils.isNotEmpty(projectId), MatMaterialIssue::getProjectId, projectId);
 | 
			
		||||
        lqw.eq(StringUtils.isNotBlank(materialSource), MatMaterialIssue::getMaterialSource, materialSource);
 | 
			
		||||
        return lqw;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取物料领料单分页对象视图
 | 
			
		||||
     *
 | 
			
		||||
     * @param materialIssuePage 物料领料单分页对象
 | 
			
		||||
     * @return 物料领料单分页对象视图
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public Page<MatMaterialIssueVo> getVoPage(Page<MatMaterialIssue> materialIssuePage) {
 | 
			
		||||
        List<MatMaterialIssue> materialIssueList = materialIssuePage.getRecords();
 | 
			
		||||
        Page<MatMaterialIssueVo> materialIssueVoPage = new Page<>(
 | 
			
		||||
            materialIssuePage.getCurrent(),
 | 
			
		||||
            materialIssuePage.getSize(),
 | 
			
		||||
            materialIssuePage.getTotal());
 | 
			
		||||
        if (CollUtil.isEmpty(materialIssueList)) {
 | 
			
		||||
            return materialIssueVoPage;
 | 
			
		||||
        }
 | 
			
		||||
        // 对象列表 => 封装对象列表
 | 
			
		||||
        List<MatMaterialIssueVo> materialIssueVoList = materialIssueList.stream().map(materialIssue -> {
 | 
			
		||||
            MatMaterialIssueVo materialIssueVo = new MatMaterialIssueVo();
 | 
			
		||||
            BeanUtils.copyProperties(materialIssue, materialIssueVo);
 | 
			
		||||
            return materialIssueVo;
 | 
			
		||||
        }).toList();
 | 
			
		||||
        materialIssueVoPage.setRecords(materialIssueVoList);
 | 
			
		||||
        return materialIssueVoPage;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取文件数量
 | 
			
		||||
     *
 | 
			
		||||
     * @param materialIssue      物料领料单对象
 | 
			
		||||
     * @param licenseCountFileId 证书文件id
 | 
			
		||||
     * @param reportCountFileId  报表文件id
 | 
			
		||||
     * @param techDocCountFileId 技术文档文件id
 | 
			
		||||
     * @param certCountFileId    证书文件id
 | 
			
		||||
     */
 | 
			
		||||
    private void getFileSize(MatMaterialIssue materialIssue, String licenseCountFileId,
 | 
			
		||||
                             String reportCountFileId, String techDocCountFileId, String certCountFileId) {
 | 
			
		||||
        if (StringUtils.isNotBlank(licenseCountFileId)) {
 | 
			
		||||
            int size = Arrays.stream(licenseCountFileId.split(",")).map(Long::parseLong).toList().size();
 | 
			
		||||
            materialIssue.setLicenseCount(size);
 | 
			
		||||
        }
 | 
			
		||||
        if (StringUtils.isNotBlank(reportCountFileId)) {
 | 
			
		||||
            int size = Arrays.stream(reportCountFileId.split(",")).map(Long::parseLong).toList().size();
 | 
			
		||||
            materialIssue.setReportCount(size);
 | 
			
		||||
        }
 | 
			
		||||
        if (StringUtils.isNotBlank(techDocCountFileId)) {
 | 
			
		||||
            int size = Arrays.stream(techDocCountFileId.split(",")).map(Long::parseLong).toList().size();
 | 
			
		||||
            materialIssue.setTechDocCount(size);
 | 
			
		||||
        }
 | 
			
		||||
        if (StringUtils.isNotBlank(certCountFileId)) {
 | 
			
		||||
            int size = Arrays.stream(certCountFileId.split(",")).map(Long::parseLong).toList().size();
 | 
			
		||||
            materialIssue.setLicenseCount(size);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据实体获取替换数据
 | 
			
		||||
     *
 | 
			
		||||
     * @param materialIssue 物料领料单对象
 | 
			
		||||
     * @param items         物料领料单明细列表
 | 
			
		||||
     * @return 替换 Word 数据
 | 
			
		||||
     */
 | 
			
		||||
    private MatMaterialIssueWordDto getReplacementDto(MatMaterialIssue materialIssue, List<MatMaterialIssueItem> items) {
 | 
			
		||||
        MatMaterialIssueWordDto dto = new MatMaterialIssueWordDto();
 | 
			
		||||
        BeanUtils.copyProperties(materialIssue, dto);
 | 
			
		||||
        // 领料总数量
 | 
			
		||||
        int issuedQuantity = items.stream()
 | 
			
		||||
            .map(MatMaterialIssueItem::getIssuedQuantity)
 | 
			
		||||
            .filter(Objects::nonNull)
 | 
			
		||||
            .reduce(BigDecimal.ZERO, BigDecimal::add)
 | 
			
		||||
            .intValue();
 | 
			
		||||
        dto.setTotalIssuedQuantity(issuedQuantity);
 | 
			
		||||
        int stockQuantity = items.stream()
 | 
			
		||||
            .map(MatMaterialIssueItem::getStockQuantity)
 | 
			
		||||
            .filter(Objects::nonNull)
 | 
			
		||||
            .reduce(BigDecimal.ZERO, BigDecimal::add)
 | 
			
		||||
            .intValue();
 | 
			
		||||
        dto.setTotalStockQuantity(stockQuantity);
 | 
			
		||||
        int remainingQuantity = items.stream()
 | 
			
		||||
            .map(MatMaterialIssueItem::getRemainingQuantity)
 | 
			
		||||
            .filter(Objects::nonNull)
 | 
			
		||||
            .reduce(BigDecimal.ZERO, BigDecimal::add)
 | 
			
		||||
            .intValue();
 | 
			
		||||
        dto.setTotalRemainingQuantity(remainingQuantity);
 | 
			
		||||
        Integer certCount = materialIssue.getCertCount();
 | 
			
		||||
        dto.setIsCertCount(certCount > 0 ? "☑" : "□");
 | 
			
		||||
        Integer licenseCount = materialIssue.getLicenseCount();
 | 
			
		||||
        dto.setIsLicenseCount(licenseCount > 0 ? "☑" : "□");
 | 
			
		||||
        Integer reportCount = materialIssue.getReportCount();
 | 
			
		||||
        dto.setIsReportCount(reportCount > 0 ? "☑" : "□");
 | 
			
		||||
        Integer techDocCount = materialIssue.getTechDocCount();
 | 
			
		||||
        dto.setIsTechDocCount(techDocCount > 0 ? "☑" : "□");
 | 
			
		||||
        // 明细项信息
 | 
			
		||||
        List<MatMaterialIssueItemWordDto> dtoItems = new ArrayList<>();
 | 
			
		||||
        for (int i = 1; i <= items.size(); i++) {
 | 
			
		||||
            MatMaterialIssueItem item = items.get(i - 1);
 | 
			
		||||
            MatMaterialIssueItemWordDto itemDto = new MatMaterialIssueItemWordDto();
 | 
			
		||||
            BeanUtils.copyProperties(item, itemDto);
 | 
			
		||||
            itemDto.setNo(i);
 | 
			
		||||
            itemDto.setIssuedQuantity(item.getIssuedQuantity().intValue());
 | 
			
		||||
            itemDto.setRemainingQuantity(item.getRemainingQuantity().intValue());
 | 
			
		||||
            itemDto.setStockQuantity(item.getStockQuantity().intValue());
 | 
			
		||||
            dtoItems.add(itemDto);
 | 
			
		||||
        }
 | 
			
		||||
        dto.setItems(dtoItems);
 | 
			
		||||
        return dto;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,59 @@
 | 
			
		||||
package org.dromara.materials.service.impl;
 | 
			
		||||
 | 
			
		||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 | 
			
		||||
import org.dromara.materials.domain.MatMaterialReceiveItem;
 | 
			
		||||
import org.dromara.materials.domain.vo.materialreceiveitem.MatMaterialReceiveItemVo;
 | 
			
		||||
import org.dromara.materials.mapper.MatMaterialReceiveItemMapper;
 | 
			
		||||
import org.dromara.materials.service.IMatMaterialReceiveItemService;
 | 
			
		||||
import org.springframework.beans.BeanUtils;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 物料接收单明细项Service业务层处理
 | 
			
		||||
 *
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025-07-04
 | 
			
		||||
 */
 | 
			
		||||
@Service
 | 
			
		||||
public class MatMaterialReceiveItemServiceImpl extends ServiceImpl<MatMaterialReceiveItemMapper, MatMaterialReceiveItem>
 | 
			
		||||
    implements IMatMaterialReceiveItemService {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询物料接收单明细项列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param issueId 接收单id
 | 
			
		||||
     * @return 物料接收单明细项列表
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<MatMaterialReceiveItem> queryListByReceiveId(Long issueId) {
 | 
			
		||||
        return this.lambdaQuery()
 | 
			
		||||
            .eq(MatMaterialReceiveItem::getReceiveId, issueId)
 | 
			
		||||
            .list();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取物料接收单明细项视图对象
 | 
			
		||||
     *
 | 
			
		||||
     * @param matMaterialReceiveItem 物料接收单明细项对象
 | 
			
		||||
     * @return 物料接收单明细项视图对象
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public MatMaterialReceiveItemVo getVo(MatMaterialReceiveItem matMaterialReceiveItem) {
 | 
			
		||||
        MatMaterialReceiveItemVo vo = new MatMaterialReceiveItemVo();
 | 
			
		||||
        BeanUtils.copyProperties(matMaterialReceiveItem, vo);
 | 
			
		||||
        return vo;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取物料接收单明细项视图对象列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param matMaterialReceiveItemList 物料接收单明细项对象列表
 | 
			
		||||
     * @return 物料接收单明细项视图对象列表
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<MatMaterialReceiveItemVo> getVoList(List<MatMaterialReceiveItem> matMaterialReceiveItemList) {
 | 
			
		||||
        return matMaterialReceiveItemList.stream().map(this::getVo).toList();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,546 @@
 | 
			
		||||
package org.dromara.materials.service.impl;
 | 
			
		||||
 | 
			
		||||
import cn.hutool.core.collection.CollUtil;
 | 
			
		||||
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.deepoove.poi.XWPFTemplate;
 | 
			
		||||
import com.deepoove.poi.config.Configure;
 | 
			
		||||
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
 | 
			
		||||
import jakarta.annotation.Resource;
 | 
			
		||||
import jakarta.servlet.http.HttpServletResponse;
 | 
			
		||||
import lombok.extern.slf4j.Slf4j;
 | 
			
		||||
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.materials.constants.MatMaterialsConstant;
 | 
			
		||||
import org.dromara.materials.domain.MatMaterialReceive;
 | 
			
		||||
import org.dromara.materials.domain.MatMaterialReceiveItem;
 | 
			
		||||
import org.dromara.materials.domain.dto.materialreceive.MatMaterialReceiveCreateReq;
 | 
			
		||||
import org.dromara.materials.domain.dto.materialreceive.MatMaterialReceiveQueryReq;
 | 
			
		||||
import org.dromara.materials.domain.dto.materialreceive.MatMaterialReceiveUpdateReq;
 | 
			
		||||
import org.dromara.materials.domain.dto.materialreceive.MatMaterialReceiveWordDto;
 | 
			
		||||
import org.dromara.materials.domain.dto.materialreceiveitem.MatMaterialReceiveItemDto;
 | 
			
		||||
import org.dromara.materials.domain.dto.materialreceiveitem.MatMaterialReceiveItemWordDto;
 | 
			
		||||
import org.dromara.materials.domain.vo.materialreceive.MatMaterialReceiveVo;
 | 
			
		||||
import org.dromara.materials.mapper.MatMaterialReceiveMapper;
 | 
			
		||||
import org.dromara.materials.service.IMatMaterialReceiveItemService;
 | 
			
		||||
import org.dromara.materials.service.IMatMaterialReceiveService;
 | 
			
		||||
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.math.BigDecimal;
 | 
			
		||||
import java.nio.file.Files;
 | 
			
		||||
import java.nio.file.Path;
 | 
			
		||||
import java.nio.file.Paths;
 | 
			
		||||
import java.util.*;
 | 
			
		||||
import java.util.zip.ZipOutputStream;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 物料接收单Service业务层处理
 | 
			
		||||
 *
 | 
			
		||||
 * @author lcj
 | 
			
		||||
 * @date 2025-07-04
 | 
			
		||||
 */
 | 
			
		||||
@Slf4j
 | 
			
		||||
@Service
 | 
			
		||||
public class MatMaterialReceiveServiceImpl extends ServiceImpl<MatMaterialReceiveMapper, MatMaterialReceive>
 | 
			
		||||
    implements IMatMaterialReceiveService {
 | 
			
		||||
 | 
			
		||||
    @Resource
 | 
			
		||||
    private ISysOssService ossService;
 | 
			
		||||
 | 
			
		||||
    @Resource
 | 
			
		||||
    private IBusProjectService projectService;
 | 
			
		||||
 | 
			
		||||
    @Resource
 | 
			
		||||
    private IMatMaterialReceiveItemService materialReceiveItemService;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询物料接收单
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 主键
 | 
			
		||||
     * @return 物料接收单
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public MatMaterialReceiveVo queryById(Long id) {
 | 
			
		||||
        MatMaterialReceive materialReceive = this.getById(id);
 | 
			
		||||
        if (materialReceive == null) {
 | 
			
		||||
            throw new ServiceException("物料接收单信息不存在", HttpStatus.NOT_FOUND);
 | 
			
		||||
        }
 | 
			
		||||
        return this.getVo(materialReceive);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 分页查询物料接收单列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param req       查询条件
 | 
			
		||||
     * @param pageQuery 分页参数
 | 
			
		||||
     * @return 物料接收单分页列表
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public TableDataInfo<MatMaterialReceiveVo> queryPageList(MatMaterialReceiveQueryReq req, PageQuery pageQuery) {
 | 
			
		||||
        Page<MatMaterialReceive> receivePage = this.page(pageQuery.build(), this.buildQueryWrapper(req));
 | 
			
		||||
        return TableDataInfo.build(this.getVoPage(receivePage));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询符合条件的物料接收单列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param req 查询条件
 | 
			
		||||
     * @return 物料接收单列表
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<MatMaterialReceiveVo> queryList(MatMaterialReceiveQueryReq req) {
 | 
			
		||||
        return this.list(this.buildQueryWrapper(req)).stream().map(this::getVo).toList();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据id导出word
 | 
			
		||||
     *
 | 
			
		||||
     * @param id       主键
 | 
			
		||||
     * @param response 响应
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public void exportWordById(Long id, HttpServletResponse response) {
 | 
			
		||||
        MatMaterialReceive materialReceive = this.getById(id);
 | 
			
		||||
        if (materialReceive == null) {
 | 
			
		||||
            throw new ServiceException("物料接收单不存在");
 | 
			
		||||
        }
 | 
			
		||||
        Path targetDir = Paths.get(MatMaterialsConstant.getMatMaterialReceiveFileUrl(materialReceive));
 | 
			
		||||
        // 如果存在目录则直接返回,不存在则生成文件并返回
 | 
			
		||||
        if (!Files.exists(targetDir)) {
 | 
			
		||||
            // 清理旧文件
 | 
			
		||||
            String baseUrl = MatMaterialsConstant.MATERIALS_RECEIVE_FILE_URL + materialReceive.getId();
 | 
			
		||||
            try {
 | 
			
		||||
                Path dirPath = Paths.get(baseUrl);
 | 
			
		||||
                if (Files.exists(dirPath)) {
 | 
			
		||||
                    FileUtils.deleteDirectory(dirPath);
 | 
			
		||||
                }
 | 
			
		||||
            } catch (IOException e) {
 | 
			
		||||
                log.error("文件目录:{},清理失败", baseUrl, e);
 | 
			
		||||
            }
 | 
			
		||||
            // 准备数据
 | 
			
		||||
            List<MatMaterialReceiveItem> itemList = materialReceiveItemService.queryListByReceiveId(id);
 | 
			
		||||
            MatMaterialReceiveWordDto data = this.getReplacementDto(materialReceive, itemList);
 | 
			
		||||
            // 生成文件
 | 
			
		||||
            try (InputStream is = getClass().getClassLoader().getResourceAsStream(MatMaterialsConstant.MATERIALS_RECEIVE_TEMPLATE_PATH)) {
 | 
			
		||||
                if (is == null) {
 | 
			
		||||
                    throw new ServiceException("模板文件不存在");
 | 
			
		||||
                }
 | 
			
		||||
                LoopRowTableRenderPolicy hackLoopTableRenderPolicy = new LoopRowTableRenderPolicy();
 | 
			
		||||
                Configure config = Configure.builder().bind("items", hackLoopTableRenderPolicy).build();
 | 
			
		||||
                XWPFTemplate template = XWPFTemplate.compile(is, config);
 | 
			
		||||
                template.render(data);
 | 
			
		||||
                // 创建目标目录
 | 
			
		||||
                if (!Files.exists(targetDir)) {
 | 
			
		||||
                    Files.createDirectories(targetDir);
 | 
			
		||||
                }
 | 
			
		||||
                // 组合目标文件名
 | 
			
		||||
                String fileName = MatMaterialsConstant.getMatMaterialReceiveFileName(materialReceive);
 | 
			
		||||
                // 保存修改后的文件
 | 
			
		||||
                try (FileOutputStream fos = new FileOutputStream(targetDir.resolve(fileName).toFile())) {
 | 
			
		||||
                    template.write(fos);
 | 
			
		||||
                }
 | 
			
		||||
                template.close();
 | 
			
		||||
                // 获取附件
 | 
			
		||||
                String certCountFileId = materialReceive.getCertCountFileId();
 | 
			
		||||
                String reportCountFileId = materialReceive.getReportCountFileId();
 | 
			
		||||
                String techDocCountFileId = materialReceive.getTechDocCountFileId();
 | 
			
		||||
                String licenseCountFileId = materialReceive.getLicenseCountFileId();
 | 
			
		||||
                if (StringUtils.isNotBlank(certCountFileId)) {
 | 
			
		||||
                    List<Long> ossIdList = Arrays.stream(certCountFileId.split(",")).map(Long::parseLong).toList();
 | 
			
		||||
                    List<SysOssVo> ossVoList = ossService.listByIds(ossIdList);
 | 
			
		||||
                    String baseFile = MatMaterialsConstant.getMatMaterialReceiveFileUrl(materialReceive) + "/合格证";
 | 
			
		||||
                    for (SysOssVo ossVo : ossVoList) {
 | 
			
		||||
                        OssClient storage = OssFactory.instance(ossVo.getService());
 | 
			
		||||
                        storage.fileDownload(ossVo.getUrl(), ossVo.getOriginalName(), baseFile);
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
                if (StringUtils.isNotBlank(reportCountFileId)) {
 | 
			
		||||
                    List<Long> ossIdList = Arrays.stream(reportCountFileId.split(",")).map(Long::parseLong).toList();
 | 
			
		||||
                    List<SysOssVo> ossVoList = ossService.listByIds(ossIdList);
 | 
			
		||||
                    String baseFile = MatMaterialsConstant.getMatMaterialReceiveFileUrl(materialReceive) + "/出厂报告";
 | 
			
		||||
                    for (SysOssVo ossVo : ossVoList) {
 | 
			
		||||
                        OssClient storage = OssFactory.instance(ossVo.getService());
 | 
			
		||||
                        storage.fileDownload(ossVo.getUrl(), ossVo.getOriginalName(), baseFile);
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
                if (StringUtils.isNotBlank(techDocCountFileId)) {
 | 
			
		||||
                    List<Long> ossIdList = Arrays.stream(techDocCountFileId.split(",")).map(Long::parseLong).toList();
 | 
			
		||||
                    List<SysOssVo> ossVoList = ossService.listByIds(ossIdList);
 | 
			
		||||
                    String baseFile = MatMaterialsConstant.getMatMaterialReceiveFileUrl(materialReceive) + "/技术资料";
 | 
			
		||||
                    for (SysOssVo ossVo : ossVoList) {
 | 
			
		||||
                        OssClient storage = OssFactory.instance(ossVo.getService());
 | 
			
		||||
                        storage.fileDownload(ossVo.getUrl(), ossVo.getOriginalName(), baseFile);
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
                if (StringUtils.isNotBlank(licenseCountFileId)) {
 | 
			
		||||
                    List<Long> ossIdList = Arrays.stream(licenseCountFileId.split(",")).map(Long::parseLong).toList();
 | 
			
		||||
                    List<SysOssVo> ossVoList = ossService.listByIds(ossIdList);
 | 
			
		||||
                    String baseFile = MatMaterialsConstant.getMatMaterialReceiveFileUrl(materialReceive) + "/厂家资质文件";
 | 
			
		||||
                    for (SysOssVo ossVo : ossVoList) {
 | 
			
		||||
                        OssClient storage = OssFactory.instance(ossVo.getService());
 | 
			
		||||
                        storage.fileDownload(ossVo.getUrl(), ossVo.getOriginalName(), baseFile);
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
            } catch (IOException 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 是否新增成功
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    @Transactional(rollbackFor = Exception.class)
 | 
			
		||||
    public Boolean insertByBo(MatMaterialReceiveCreateReq req) {
 | 
			
		||||
        MatMaterialReceive materialReceive = new MatMaterialReceive();
 | 
			
		||||
        BeanUtils.copyProperties(req, materialReceive);
 | 
			
		||||
        validEntityBeforeSave(materialReceive, true);
 | 
			
		||||
        getFileSize(materialReceive,
 | 
			
		||||
            req.getLicenseCountFileId(),
 | 
			
		||||
            req.getReportCountFileId(),
 | 
			
		||||
            req.getTechDocCountFileId(),
 | 
			
		||||
            req.getCertCountFileId());
 | 
			
		||||
        boolean save = this.save(materialReceive);
 | 
			
		||||
        if (!save) {
 | 
			
		||||
            throw new ServiceException("物料接收单新增失败", HttpStatus.ERROR);
 | 
			
		||||
        }
 | 
			
		||||
        List<MatMaterialReceiveItemDto> itemList = req.getItemList();
 | 
			
		||||
        if (CollUtil.isNotEmpty(itemList)) {
 | 
			
		||||
            List<MatMaterialReceiveItem> materialReceiveItemList = itemList.stream().map(item -> {
 | 
			
		||||
                MatMaterialReceiveItem materialReceiveItem = new MatMaterialReceiveItem();
 | 
			
		||||
                BeanUtils.copyProperties(item, materialReceiveItem);
 | 
			
		||||
                materialReceiveItem.setReceiveId(materialReceive.getId());
 | 
			
		||||
                materialReceiveItem.setProjectId(materialReceive.getProjectId());
 | 
			
		||||
                return materialReceiveItem;
 | 
			
		||||
            }).toList();
 | 
			
		||||
            boolean result = materialReceiveItemService.saveBatch(materialReceiveItemList);
 | 
			
		||||
            if (!result) {
 | 
			
		||||
                throw new RuntimeException("物料接收单明细项新增失败");
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 修改物料接收单
 | 
			
		||||
     *
 | 
			
		||||
     * @param req 物料接收单
 | 
			
		||||
     * @return 是否修改成功
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    @Transactional(rollbackFor = Exception.class)
 | 
			
		||||
    public Boolean updateByBo(MatMaterialReceiveUpdateReq req) {
 | 
			
		||||
        Long id = req.getId();
 | 
			
		||||
        MatMaterialReceive oldMaterialReceive = this.getById(id);
 | 
			
		||||
        if (oldMaterialReceive == null) {
 | 
			
		||||
            throw new ServiceException("修改物料收货单失败,数据不存在", HttpStatus.NOT_FOUND);
 | 
			
		||||
        }
 | 
			
		||||
        MatMaterialReceive materialReceive = new MatMaterialReceive();
 | 
			
		||||
        BeanUtils.copyProperties(req, materialReceive);
 | 
			
		||||
        validEntityBeforeSave(materialReceive, false);
 | 
			
		||||
        getFileSize(materialReceive,
 | 
			
		||||
            req.getLicenseCountFileId(),
 | 
			
		||||
            req.getReportCountFileId(),
 | 
			
		||||
            req.getTechDocCountFileId(),
 | 
			
		||||
            req.getCertCountFileId());
 | 
			
		||||
        boolean update = this.updateById(materialReceive);
 | 
			
		||||
        if (!update) {
 | 
			
		||||
            throw new ServiceException("物料接收单修改失败", HttpStatus.ERROR);
 | 
			
		||||
        }
 | 
			
		||||
        List<MatMaterialReceiveItem> oldMaterialReceiveItemList = materialReceiveItemService.queryListByReceiveId(id);
 | 
			
		||||
        if (CollUtil.isNotEmpty(oldMaterialReceiveItemList)) {
 | 
			
		||||
            boolean result = materialReceiveItemService.removeByIds(oldMaterialReceiveItemList);
 | 
			
		||||
            if (!result) {
 | 
			
		||||
                throw new ServiceException("物料接收单明细项删除失败", HttpStatus.ERROR);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        List<MatMaterialReceiveItemDto> itemList = req.getItemList();
 | 
			
		||||
        if (CollUtil.isNotEmpty(itemList)) {
 | 
			
		||||
            List<MatMaterialReceiveItem> materialReceiveItemList = itemList.stream().map(item -> {
 | 
			
		||||
                MatMaterialReceiveItem materialReceiveItem = new MatMaterialReceiveItem();
 | 
			
		||||
                BeanUtils.copyProperties(item, materialReceiveItem);
 | 
			
		||||
                materialReceiveItem.setReceiveId(materialReceive.getId());
 | 
			
		||||
                materialReceiveItem.setProjectId(materialReceive.getProjectId());
 | 
			
		||||
                return materialReceiveItem;
 | 
			
		||||
            }).toList();
 | 
			
		||||
            boolean result = materialReceiveItemService.saveOrUpdateBatch(materialReceiveItemList);
 | 
			
		||||
            if (!result) {
 | 
			
		||||
                throw new ServiceException("物料接收单明细项新增失败", HttpStatus.ERROR);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 保存前的数据校验
 | 
			
		||||
     */
 | 
			
		||||
    private void validEntityBeforeSave(MatMaterialReceive entity, Boolean create) {
 | 
			
		||||
        // 做一些数据校验,如唯一约束
 | 
			
		||||
        Long projectId = entity.getProjectId();
 | 
			
		||||
        String materialSource = entity.getMaterialSource();
 | 
			
		||||
        if (create) {
 | 
			
		||||
            if (projectId == null) {
 | 
			
		||||
                throw new ServiceException("项目 id 不能为空", HttpStatus.BAD_REQUEST);
 | 
			
		||||
            }
 | 
			
		||||
            if (StringUtils.isEmpty(materialSource)) {
 | 
			
		||||
                throw new ServiceException("物料来源不能为空", 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) {
 | 
			
		||||
        List<MatMaterialReceiveItem> itemList = materialReceiveItemService.lambdaQuery()
 | 
			
		||||
            .in(MatMaterialReceiveItem::getReceiveId, ids)
 | 
			
		||||
            .list();
 | 
			
		||||
        if (CollUtil.isNotEmpty(itemList)) {
 | 
			
		||||
            materialReceiveItemService.removeBatchByIds(itemList);
 | 
			
		||||
        }
 | 
			
		||||
        return this.removeBatchByIds(ids);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取物料接收单视图对象
 | 
			
		||||
     *
 | 
			
		||||
     * @param materialReceive 物料接收单对象
 | 
			
		||||
     * @return 物料接收单视图对象
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public MatMaterialReceiveVo getVo(MatMaterialReceive materialReceive) {
 | 
			
		||||
        MatMaterialReceiveVo vo = new MatMaterialReceiveVo();
 | 
			
		||||
        BeanUtils.copyProperties(materialReceive, vo);
 | 
			
		||||
        List<MatMaterialReceiveItem> itemList = materialReceiveItemService.queryListByReceiveId(materialReceive.getId());
 | 
			
		||||
        if (CollUtil.isNotEmpty(itemList)) {
 | 
			
		||||
            vo.setItemList(materialReceiveItemService.getVoList(itemList));
 | 
			
		||||
        }
 | 
			
		||||
        String certCountFileId = materialReceive.getCertCountFileId();
 | 
			
		||||
        if (StringUtils.isNotBlank(certCountFileId)) {
 | 
			
		||||
            List<Long> ossIdList = Arrays.stream(certCountFileId.split(",")).map(Long::parseLong).toList();
 | 
			
		||||
            List<SysOssVo> ossVoList = ossService.listByIds(ossIdList);
 | 
			
		||||
            vo.setCertCountFile(ossVoList);
 | 
			
		||||
        }
 | 
			
		||||
        String reportCountFileId = materialReceive.getReportCountFileId();
 | 
			
		||||
        if (StringUtils.isNotBlank(reportCountFileId)) {
 | 
			
		||||
            List<Long> ossIdList = Arrays.stream(reportCountFileId.split(",")).map(Long::parseLong).toList();
 | 
			
		||||
            List<SysOssVo> ossVoList = ossService.listByIds(ossIdList);
 | 
			
		||||
            vo.setReportCountFile(ossVoList);
 | 
			
		||||
        }
 | 
			
		||||
        String techDocCountFileId = materialReceive.getTechDocCountFileId();
 | 
			
		||||
        if (StringUtils.isNotBlank(techDocCountFileId)) {
 | 
			
		||||
            List<Long> ossIdList = Arrays.stream(techDocCountFileId.split(",")).map(Long::parseLong).toList();
 | 
			
		||||
            List<SysOssVo> ossVoList = ossService.listByIds(ossIdList);
 | 
			
		||||
            vo.setTechDocCountFile(ossVoList);
 | 
			
		||||
        }
 | 
			
		||||
        String licenseCountFileId = materialReceive.getLicenseCountFileId();
 | 
			
		||||
        if (StringUtils.isNotBlank(licenseCountFileId)) {
 | 
			
		||||
            List<Long> ossIdList = Arrays.stream(licenseCountFileId.split(",")).map(Long::parseLong).toList();
 | 
			
		||||
            List<SysOssVo> ossVoList = ossService.listByIds(ossIdList);
 | 
			
		||||
            vo.setLicenseCountFile(ossVoList);
 | 
			
		||||
        }
 | 
			
		||||
        return vo;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 构建查询条件封装
 | 
			
		||||
     *
 | 
			
		||||
     * @param req 查询条件
 | 
			
		||||
     * @return 查询条件封装
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public LambdaQueryWrapper<MatMaterialReceive> buildQueryWrapper(MatMaterialReceiveQueryReq req) {
 | 
			
		||||
        LambdaQueryWrapper<MatMaterialReceive> lqw = new LambdaQueryWrapper<>();
 | 
			
		||||
        if (req == null) {
 | 
			
		||||
            return lqw;
 | 
			
		||||
        }
 | 
			
		||||
        Long projectId = req.getProjectId();
 | 
			
		||||
        String materialSource = req.getMaterialSource();
 | 
			
		||||
        String formCode = req.getFormCode();
 | 
			
		||||
        String projectName = req.getProjectName();
 | 
			
		||||
        String materialName = req.getMaterialName();
 | 
			
		||||
        String contractName = req.getContractName();
 | 
			
		||||
        String orderingUnit = req.getOrderingUnit();
 | 
			
		||||
        String supplierUnit = req.getSupplierUnit();
 | 
			
		||||
        String storageType = req.getStorageType();
 | 
			
		||||
        lqw.like(StringUtils.isNotBlank(projectName), MatMaterialReceive::getProjectName, projectName);
 | 
			
		||||
        lqw.like(StringUtils.isNotBlank(materialName), MatMaterialReceive::getMaterialName, materialName);
 | 
			
		||||
        lqw.like(StringUtils.isNotBlank(contractName), MatMaterialReceive::getContractName, contractName);
 | 
			
		||||
        lqw.like(StringUtils.isNotBlank(orderingUnit), MatMaterialReceive::getOrderingUnit, orderingUnit);
 | 
			
		||||
        lqw.like(StringUtils.isNotBlank(supplierUnit), MatMaterialReceive::getSupplierUnit, supplierUnit);
 | 
			
		||||
        lqw.like(StringUtils.isNotBlank(formCode), MatMaterialReceive::getFormCode, formCode);
 | 
			
		||||
        lqw.like(StringUtils.isNotBlank(storageType), MatMaterialReceive::getStorageType, storageType);
 | 
			
		||||
        lqw.eq(ObjectUtils.isNotEmpty(projectId), MatMaterialReceive::getProjectId, projectId);
 | 
			
		||||
        lqw.eq(StringUtils.isNotBlank(materialSource), MatMaterialReceive::getMaterialSource, materialSource);
 | 
			
		||||
        return lqw;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取物料接收单分页对象视图
 | 
			
		||||
     *
 | 
			
		||||
     * @param materialReceivePage 物料接收单分页对象
 | 
			
		||||
     * @return 物料接收单分页对象视图
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public Page<MatMaterialReceiveVo> getVoPage(Page<MatMaterialReceive> materialReceivePage) {
 | 
			
		||||
        List<MatMaterialReceive> materialReceiveList = materialReceivePage.getRecords();
 | 
			
		||||
        Page<MatMaterialReceiveVo> materialReceiveVoPage = new Page<>(
 | 
			
		||||
            materialReceivePage.getCurrent(),
 | 
			
		||||
            materialReceivePage.getSize(),
 | 
			
		||||
            materialReceivePage.getTotal());
 | 
			
		||||
        if (CollUtil.isEmpty(materialReceiveList)) {
 | 
			
		||||
            return materialReceiveVoPage;
 | 
			
		||||
        }
 | 
			
		||||
        // 对象列表 => 封装对象列表
 | 
			
		||||
        List<MatMaterialReceiveVo> materialReceiveVoList = materialReceiveList.stream().map(materialReceive -> {
 | 
			
		||||
            MatMaterialReceiveVo materialReceiveVo = new MatMaterialReceiveVo();
 | 
			
		||||
            BeanUtils.copyProperties(materialReceive, materialReceiveVo);
 | 
			
		||||
            return materialReceiveVo;
 | 
			
		||||
        }).toList();
 | 
			
		||||
        materialReceiveVoPage.setRecords(materialReceiveVoList);
 | 
			
		||||
        return materialReceiveVoPage;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取文件数量
 | 
			
		||||
     *
 | 
			
		||||
     * @param materialReceive    物料接收单对象
 | 
			
		||||
     * @param licenseCountFileId 证书文件id
 | 
			
		||||
     * @param reportCountFileId  报表文件id
 | 
			
		||||
     * @param techDocCountFileId 技术文档文件id
 | 
			
		||||
     * @param certCountFileId    证书文件id
 | 
			
		||||
     */
 | 
			
		||||
    private void getFileSize(MatMaterialReceive materialReceive, String licenseCountFileId,
 | 
			
		||||
                             String reportCountFileId, String techDocCountFileId, String certCountFileId) {
 | 
			
		||||
        if (StringUtils.isNotBlank(licenseCountFileId)) {
 | 
			
		||||
            int size = Arrays.stream(licenseCountFileId.split(",")).map(Long::parseLong).toList().size();
 | 
			
		||||
            materialReceive.setLicenseCount(size);
 | 
			
		||||
        }
 | 
			
		||||
        if (StringUtils.isNotBlank(reportCountFileId)) {
 | 
			
		||||
            int size = Arrays.stream(reportCountFileId.split(",")).map(Long::parseLong).toList().size();
 | 
			
		||||
            materialReceive.setReportCount(size);
 | 
			
		||||
        }
 | 
			
		||||
        if (StringUtils.isNotBlank(techDocCountFileId)) {
 | 
			
		||||
            int size = Arrays.stream(techDocCountFileId.split(",")).map(Long::parseLong).toList().size();
 | 
			
		||||
            materialReceive.setTechDocCount(size);
 | 
			
		||||
        }
 | 
			
		||||
        if (StringUtils.isNotBlank(certCountFileId)) {
 | 
			
		||||
            int size = Arrays.stream(certCountFileId.split(",")).map(Long::parseLong).toList().size();
 | 
			
		||||
            materialReceive.setLicenseCount(size);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据实体获取替换数据
 | 
			
		||||
     *
 | 
			
		||||
     * @param materialReceive 物料接收单对象
 | 
			
		||||
     * @param items           物料接收单明细列表
 | 
			
		||||
     * @return 替换 Word 数据
 | 
			
		||||
     */
 | 
			
		||||
    private MatMaterialReceiveWordDto getReplacementDto(MatMaterialReceive materialReceive, List<MatMaterialReceiveItem> items) {
 | 
			
		||||
        MatMaterialReceiveWordDto dto = new MatMaterialReceiveWordDto();
 | 
			
		||||
        BeanUtils.copyProperties(materialReceive, dto);
 | 
			
		||||
        // 接收总数量
 | 
			
		||||
        int quantity = items.stream()
 | 
			
		||||
            .map(MatMaterialReceiveItem::getQuantity)
 | 
			
		||||
            .filter(Objects::nonNull)
 | 
			
		||||
            .reduce(BigDecimal.ZERO, BigDecimal::add)
 | 
			
		||||
            .intValue();
 | 
			
		||||
        dto.setTotalQuantity(quantity);
 | 
			
		||||
        int shortageQuantity = items.stream()
 | 
			
		||||
            .map(MatMaterialReceiveItem::getShortageQuantity)
 | 
			
		||||
            .filter(Objects::nonNull)
 | 
			
		||||
            .reduce(BigDecimal.ZERO, BigDecimal::add)
 | 
			
		||||
            .intValue();
 | 
			
		||||
        dto.setTotalShortageQuantity(shortageQuantity);
 | 
			
		||||
        int acceptedQuantity = items.stream()
 | 
			
		||||
            .map(MatMaterialReceiveItem::getAcceptedQuantity)
 | 
			
		||||
            .filter(Objects::nonNull)
 | 
			
		||||
            .reduce(BigDecimal.ZERO, BigDecimal::add)
 | 
			
		||||
            .intValue();
 | 
			
		||||
        dto.setTotalAcceptedQuantity(acceptedQuantity);
 | 
			
		||||
        Integer certCount = materialReceive.getCertCount();
 | 
			
		||||
        dto.setIsCertCount(certCount > 0 ? "☑" : "□");
 | 
			
		||||
        Integer licenseCount = materialReceive.getLicenseCount();
 | 
			
		||||
        dto.setIsLicenseCount(licenseCount > 0 ? "☑" : "□");
 | 
			
		||||
        Integer reportCount = materialReceive.getReportCount();
 | 
			
		||||
        dto.setIsReportCount(reportCount > 0 ? "☑" : "□");
 | 
			
		||||
        Integer techDocCount = materialReceive.getTechDocCount();
 | 
			
		||||
        dto.setIsTechDocCount(techDocCount > 0 ? "☑" : "□");
 | 
			
		||||
        // 明细项信息
 | 
			
		||||
        List<MatMaterialReceiveItemWordDto> dtoItems = new ArrayList<>();
 | 
			
		||||
        for (int i = 1; i <= items.size(); i++) {
 | 
			
		||||
            MatMaterialReceiveItem item = items.get(i - 1);
 | 
			
		||||
            MatMaterialReceiveItemWordDto itemDto = new MatMaterialReceiveItemWordDto();
 | 
			
		||||
            BeanUtils.copyProperties(item, itemDto);
 | 
			
		||||
            itemDto.setNo(i);
 | 
			
		||||
            itemDto.setQuantity(item.getQuantity().intValue());
 | 
			
		||||
            itemDto.setShortageQuantity(item.getShortageQuantity().intValue());
 | 
			
		||||
            itemDto.setAcceptedQuantity(item.getAcceptedQuantity().intValue());
 | 
			
		||||
            dtoItems.add(itemDto);
 | 
			
		||||
        }
 | 
			
		||||
        dto.setItems(dtoItems);
 | 
			
		||||
        // 设备材料入库/移交
 | 
			
		||||
        String storageType = materialReceive.getStorageType();
 | 
			
		||||
        dto.setStorageType1("□");
 | 
			
		||||
        dto.setStorageType2("□");
 | 
			
		||||
        dto.setStorageType3("□");
 | 
			
		||||
        if (StringUtils.isNotBlank(storageType)) {
 | 
			
		||||
            List<Integer> storageTypeList = Arrays.stream(storageType.split(",")).map(Integer::parseInt).toList();
 | 
			
		||||
            for (Integer type : storageTypeList) {
 | 
			
		||||
                if (type == 1) {
 | 
			
		||||
                    dto.setStorageType1("☑");
 | 
			
		||||
                }
 | 
			
		||||
                if (type == 2) {
 | 
			
		||||
                    dto.setStorageType2("☑");
 | 
			
		||||
                }
 | 
			
		||||
                if (type == 3) {
 | 
			
		||||
                    dto.setStorageType3("☑");
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        // 封装数据
 | 
			
		||||
        return dto;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -12,6 +12,8 @@ import org.dromara.common.core.exception.ServiceException;
 | 
			
		||||
import org.dromara.common.core.utils.DateUtils;
 | 
			
		||||
import org.dromara.common.core.utils.ObjectUtils;
 | 
			
		||||
import org.dromara.common.core.utils.StringUtils;
 | 
			
		||||
import org.dromara.common.utils.BigDecimalUtil;
 | 
			
		||||
import org.dromara.common.utils.JsonDimensionUtil;
 | 
			
		||||
import org.dromara.facility.domain.*;
 | 
			
		||||
import org.dromara.facility.service.*;
 | 
			
		||||
import org.dromara.progress.constant.PgsProgressCategoryConstant;
 | 
			
		||||
@ -35,8 +37,6 @@ import org.dromara.progress.service.IPgsProgressPlanDetailService;
 | 
			
		||||
import org.dromara.progress.service.IPgsProgressPlanService;
 | 
			
		||||
import org.dromara.project.domain.BusProject;
 | 
			
		||||
import org.dromara.project.service.IBusProjectService;
 | 
			
		||||
import org.dromara.common.utils.BigDecimalUtil;
 | 
			
		||||
import org.dromara.common.utils.JsonDimensionUtil;
 | 
			
		||||
import org.springframework.beans.BeanUtils;
 | 
			
		||||
import org.springframework.context.annotation.Lazy;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
@ -338,7 +338,6 @@ public class PgsProgressCategoryServiceImpl extends ServiceImpl<PgsProgressCateg
 | 
			
		||||
    @Override
 | 
			
		||||
    @Transactional(rollbackFor = Exception.class)
 | 
			
		||||
    public Boolean insertByTemplate(Long projectId, List<FacMatrix> matrixList, List<FacMatrix> oldMatrixList) {
 | 
			
		||||
        List<Long> oldMatrixIdList = oldMatrixList.stream().map(FacMatrix::getId).toList();
 | 
			
		||||
        // 获取模板进度类别
 | 
			
		||||
        List<PgsProgressCategoryTemplate> categoryTemplateList = pgsProgressCategoryTemplateService.lambdaQuery()
 | 
			
		||||
            .in(PgsProgressCategoryTemplate::getProjectId, projectId, PgsProgressCategoryConstant.PUBLIC_PROJECT_ID)
 | 
			
		||||
@ -351,7 +350,9 @@ public class PgsProgressCategoryServiceImpl extends ServiceImpl<PgsProgressCateg
 | 
			
		||||
        Map<String, List<PgsProgressCategory>> oldPercentageCategoryMap = new HashMap<>();
 | 
			
		||||
        Map<Long, List<PgsProgressPlan>> oldPlanMap = new HashMap<>();
 | 
			
		||||
        Map<Long, List<PgsProgressPlanDetail>> oldPlanDetailMap = new HashMap<>();
 | 
			
		||||
        List<Long> oldMatrixIdList = new ArrayList<>();
 | 
			
		||||
        if (CollUtil.isNotEmpty(oldMatrixList)) {
 | 
			
		||||
            oldMatrixIdList = oldMatrixList.stream().map(FacMatrix::getId).toList();
 | 
			
		||||
            List<PgsProgressCategory> oldPercentageCategoryList = this.lambdaQuery()
 | 
			
		||||
                .in(PgsProgressCategory::getMatrixId, oldMatrixIdList)
 | 
			
		||||
                .ne(PgsProgressCategory::getPid, PgsProgressCategoryConstant.TOP_PARENT_ID)
 | 
			
		||||
@ -473,7 +474,9 @@ public class PgsProgressCategoryServiceImpl extends ServiceImpl<PgsProgressCateg
 | 
			
		||||
        }
 | 
			
		||||
        // 删除旧数据
 | 
			
		||||
        LambdaQueryWrapper<FacPercentageFacility> percentageFacilityLqw = new LambdaQueryWrapper<>();
 | 
			
		||||
        percentageFacilityLqw.eq(FacPercentageFacility::getMatrixId, oldMatrixIdList);
 | 
			
		||||
        if (CollUtil.isNotEmpty(oldMatrixIdList)) {
 | 
			
		||||
            percentageFacilityLqw.eq(FacPercentageFacility::getMatrixId, oldMatrixIdList);
 | 
			
		||||
        }
 | 
			
		||||
        long count = percentageFacilityService.count(percentageFacilityLqw);
 | 
			
		||||
        if (count > 0) {
 | 
			
		||||
            boolean remove = percentageFacilityService.remove(percentageFacilityLqw);
 | 
			
		||||
 | 
			
		||||
@ -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.materials.mapper.MatMaterialIssueItemMapper">
 | 
			
		||||
 | 
			
		||||
</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.materials.mapper.MatMaterialIssueMapper">
 | 
			
		||||
 | 
			
		||||
</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.materials.mapper.MatMaterialReceiveItemMapper">
 | 
			
		||||
 | 
			
		||||
</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.materials.mapper.MatMaterialReceiveMapper">
 | 
			
		||||
 | 
			
		||||
</mapper>
 | 
			
		||||
		Reference in New Issue
	
	Block a user