新火炬后端单体项目初始化代码
Lius
10 天以前 904727f59b7e10a291ce7d1576e33192a619f2f2
src/main/java/org/jeecg/modules/pms/service/impl/PmsProcessBillMaterialsDetailServiceImpl.java
@@ -1,5 +1,7 @@
package org.jeecg.modules.pms.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -7,16 +9,20 @@
import org.jeecg.modules.pms.entity.PmsProcessBillMaterialsDetail;
import org.jeecg.modules.pms.mapper.PmsProcessBillMaterialsDetailMapper;
import org.jeecg.modules.pms.service.IPmsProcessBillMaterialsDetailService;
import org.jeecg.modules.sap.dto.OrderBomDTO;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
 * @Description: 物料清单
 * @Author: jeecg-boot
 * @Date:   2025-07-01
 * @Date: 2025-07-01
 * @Version: V1.0
 */
@Service
@@ -45,4 +51,22 @@
        }
        return super.getBaseMapper().getpmsProcessBillMaterialsDetailListData(pageData, paramMap);
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void removeByMaterialsId(String materialsId) {
        LambdaQueryWrapper<PmsProcessBillMaterialsDetail> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(PmsProcessBillMaterialsDetail::getMaterialId, materialsId);
        this.getBaseMapper().delete(queryWrapper);
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void saveBatchDetail(String materialsId, List<OrderBomDTO> collect) {
        if (CollectionUtil.isEmpty(collect)) {
            return;
        }
        List<PmsProcessBillMaterialsDetail> list = collect.stream().map(orderBomDTO -> new PmsProcessBillMaterialsDetail(materialsId, orderBomDTO)).collect(Collectors.toList());
        super.saveBatch(list);
    }
}