ezhizao_zx 1 jaar geleden
bovenliggende
commit
b88103319f

+ 77 - 14
src/main/java/cn/ezhizao/project/business/controller/OutsourceBalanceController.java

@@ -6,6 +6,7 @@ import cn.ezhizao.project.business.domain.*;
 import cn.ezhizao.project.business.domain.vo.OutsourceOrderDetailBalance;
 import cn.ezhizao.project.business.service.*;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
@@ -59,7 +60,9 @@ public class OutsourceBalanceController extends BaseController {
     @Resource
     private IBizOutsourcedOrderDetailProcessService bizOutsourcedOrderDetailProcessService;
     @Resource
-    private IBizMaterialBaseService bizMaterialBaseInfoService;
+    private IBizMaterialBaseService bizMaterialBaseService;
+    @Resource
+    private IBizMaterialBaseInfoService bizMaterialBaseInfoService;
 
     /**
      * 拉取 Sfc10100 表数据到 machine_center表
@@ -118,7 +121,7 @@ public class OutsourceBalanceController extends BaseController {
     private boolean pullP2Inv10100() {
         BizPullP2Time pullDetail = new BizPullP2Time();
         // 加工中心
-        pullDetail.setType("material_base_info");
+        pullDetail.setType("material_base");
         List<BizPullP2Time> pullDetails = pullP2TimeService.getList(pullDetail);
         BizPullP2Time lastPullDetail = null;
         if (pullDetails.size() > 0) {
@@ -135,7 +138,7 @@ public class OutsourceBalanceController extends BaseController {
             queryWrapper.apply("modate IS NOT NULL AND modate > {0}", newCondition);
         }
         List<Inv10100> inv10100List = inv10100Service.getList(queryWrapper);
-        List<BizMaterialBase> machineCenters = bizMaterialBaseInfoService.query().list();
+        List<BizMaterialBase> machineCenters = bizMaterialBaseService.query().list();
         List<BizMaterialBase> insertMachineCenter = new ArrayList<>();
         List<BizMaterialBase> updateMachineCenter = new ArrayList<>();
 
@@ -152,6 +155,55 @@ public class OutsourceBalanceController extends BaseController {
             }
         });
 
+        if ((insertMachineCenter.isEmpty() || bizMaterialBaseService.saveBatch(insertMachineCenter)) && (updateMachineCenter.isEmpty() || bizMaterialBaseService.updateBatchById(updateMachineCenter))) {
+            BizPullP2Time bizPullP2Time = new BizPullP2Time();
+            // 将当前时间赋值给 pullTime 属性
+            bizPullP2Time.setPullTime(new Date());
+            bizPullP2Time.setType("material_base");
+            // 保存数据
+            pullP2TimeService.saveOrUpdate(bizPullP2Time);
+            return true;
+        }
+        return false;
+    }
+
+    private boolean pullP2Bom30101() {
+        BizPullP2Time pullDetail = new BizPullP2Time();
+        // 加工中心
+        pullDetail.setType("material_base_info");
+        List<BizPullP2Time> pullDetails = pullP2TimeService.getList(pullDetail);
+        BizPullP2Time lastPullDetail = null;
+        if (pullDetails.size() > 0) {
+            int lastIndex = pullDetails.size() - 1;
+            lastPullDetail = pullDetails.get(lastIndex);
+        }
+        QueryWrapper<Bom30101> queryWrapper = new QueryWrapper<>();
+        if (lastPullDetail != null) {
+            Date newCondition = lastPullDetail.getPullTime();
+            /*
+             * 这里应该根据新系统中记录的最大的拉取日期
+             * modate:P2中的修改日期,为了避免重复拉取,需要做条件判断。modate必须大于上一次拉取时间
+             */
+            queryWrapper.apply("modate IS NOT NULL AND modate > {0}", newCondition);
+        }
+        List<Bom30101> bom30101List = bom30101Service.getList(queryWrapper);
+        List<BizMaterialBaseInfo> machineCenters = bizMaterialBaseInfoService.query().list();
+        List<BizMaterialBaseInfo> insertMachineCenter = new ArrayList<>();
+        List<BizMaterialBaseInfo> updateMachineCenter = new ArrayList<>();
+
+        bom30101List.forEach(l -> {
+            // 判断之前是否有这个材料
+            if (machineCenters.stream().anyMatch(v -> v.getMaterialCode().equals(l.getPart().trim()) && v.getProductCode().equals(l.getCpart().trim()))) {
+                // 已插入材料
+                BizMaterialBaseInfo oldItem = machineCenters.stream().filter(v -> v.getMaterialCode().equals(l.getPart().trim()) && v.getProductCode().equals(l.getCpart().trim())).findFirst().orElse(null);
+                oldItem.setByBom30101(l);
+                updateMachineCenter.add(oldItem);
+            } else {
+                BizMaterialBaseInfo newItem = new BizMaterialBaseInfo(l);
+                insertMachineCenter.add(newItem);
+            }
+        });
+
         if ((insertMachineCenter.isEmpty() || bizMaterialBaseInfoService.saveBatch(insertMachineCenter)) && (updateMachineCenter.isEmpty() || bizMaterialBaseInfoService.updateBatchById(updateMachineCenter))) {
             BizPullP2Time bizPullP2Time = new BizPullP2Time();
             // 将当前时间赋值给 pullTime 属性
@@ -177,16 +229,19 @@ public class OutsourceBalanceController extends BaseController {
 
         boolean pullResult = pullP2Sfc10100();
         boolean pullMaterialResult = pullP2Inv10100();
+        boolean pullMaterialInfoResult = pullP2Bom30101();
         // 获取产品材料信息
-        QueryWrapper<Inv10100> queryWrapper = new QueryWrapper<>();
-        queryWrapper.in("rtrim(part)", furnaceNoInfos.isEmpty() ? Collections.singletonList("0") : furnaceNoInfos.stream().map(BizFurnaceNoInfo::getRawMaterialCode).collect(Collectors.toList()));
-        List<Inv10100> inv10100s = inv10100Service.getList(queryWrapper);
-        List<BizProduct> products = bizProductService.query().in("id", orderDetails.stream().map(BizOutsourcedOrderDetail::getProductId).collect(Collectors.toList())).list();
-        QueryWrapper<Bom30101> bom30101QueryWrapper = new QueryWrapper<>();
-        bom30101QueryWrapper.in("rtrim(cpart)", products.isEmpty() ? Collections.singletonList("0") : products.stream().map(BizProduct::getProductCode).collect(Collectors.toList()));
-        List<Bom30101> bom30101s = bom30101Service.getList(bom30101QueryWrapper);
+//        QueryWrapper<Inv10100> queryWrapper = new QueryWrapper<>();
+//        queryWrapper.in("rtrim(part)", furnaceNoInfos.isEmpty() ? Collections.singletonList("0") : furnaceNoInfos.stream().map(BizFurnaceNoInfo::getRawMaterialCode).collect(Collectors.toList()));
+//        List<Inv10100> inv10100s = inv10100Service.getList(queryWrapper);
+        List<BizMaterialBase> materialBases = bizMaterialBaseService.query().in("material_code", furnaceNoInfos.isEmpty() ? Collections.singletonList("0") : furnaceNoInfos.stream().map(BizFurnaceNoInfo::getRawMaterialCode).collect(Collectors.toList())).list();
+        List<BizProduct> products = bizProductService.query().in("id", orderDetails.isEmpty() ? Collections.singletonList(0L) : orderDetails.stream().map(BizOutsourcedOrderDetail::getProductId).collect(Collectors.toList())).list();
+//        QueryWrapper<Bom30101> bom30101QueryWrapper = new QueryWrapper<>();
+//        bom30101QueryWrapper.in("rtrim(cpart)", products.isEmpty() ? Collections.singletonList("0") : products.stream().map(BizProduct::getProductCode).collect(Collectors.toList()));
+//        List<Bom30101> bom30101s = bom30101Service.getList(bom30101QueryWrapper);
+        List<BizMaterialBaseInfo> materialBaseInfos = bizMaterialBaseInfoService.query().in("product_code", products.isEmpty() ? Collections.singletonList("0") : products.stream().map(BizProduct::getProductCode).collect(Collectors.toList())).list();
         QueryWrapper<Inc10100> inc10100QueryWrapper = new QueryWrapper<>();
-        inc10100QueryWrapper.in("rtrim(cpart)", products.isEmpty() ? Collections.singletonList("0") : products.stream().map(BizProduct::getProductCode).collect(Collectors.toList()));
+        inc10100QueryWrapper.in("rtrim(part)", products.isEmpty() ? Collections.singletonList("0") : products.stream().map(BizProduct::getProductCode).collect(Collectors.toList()));
         List<Inc10100> inc10100List = inc10100Service.getList(inc10100QueryWrapper);
         List<BizOutsourcedOrderDetailProcess> processes = bizOutsourcedOrderDetailProcessService.query().in("detail_id", orderDetails.isEmpty() ? Collections.singletonList(0L) : orderDetails.stream().map(BizOutsourcedOrderDetail::getId).collect(Collectors.toList())).list();
 
@@ -202,10 +257,18 @@ public class OutsourceBalanceController extends BaseController {
             BizSupplier supplier = suppliers.stream().filter(v -> v.getId().equals(l.getSupplierId())).findFirst().orElse(null);
             List<BizReturnReceiptDetail> currentReturn = returnReceiptDetails.stream().filter(v -> v.getOutsourceDetailId().equals(l.getId())).collect(Collectors.toList());
             BizFurnaceNoInfo furnaceNoInfo = furnaceNoInfos.stream().filter(v -> v.getDayworkId().equals(l.getDayworkId())).findFirst().orElse(new BizFurnaceNoInfo());
-            Inv10100 itemInv10100 = inv10100s.stream().filter(v -> v.getPart().trim().equals(furnaceNoInfo.getRawMaterialCode())).findFirst().orElse(null);
+            BizMaterialBase itemInv10100 = materialBases.stream().filter(v -> v.getMaterialCode().trim().equals(furnaceNoInfo.getRawMaterialCode())).findFirst().orElse(null);
             BizProduct product = products.stream().filter(v -> v.getId().equals(l.getProductId())).findFirst().orElse(new BizProduct());
-            Bom30101 itemBom30101 = bom30101s.stream().filter(v -> v.getCpart().trim().equals(product.getProductCode())).findFirst().orElse(new Bom30101());
+            BizMaterialBaseInfo itemBom30101 = materialBaseInfos.stream().filter(v -> v.getProductCode().trim().equals(product.getProductCode())).findFirst().orElse(new BizMaterialBaseInfo());
             Inc10100 itemInc10100 = inc10100List.stream().filter(v -> v.getPart().trim().equals(product.getProductCode())).findFirst().orElse(new Inc10100());
+            balance.setProductCode(product.getProductCode());
+            balance.setProductDescription(product.getDescription());
+            balance.setProcessName(processes.stream().map(BizOutsourcedOrderDetailProcess::getProcessAlias).collect(Collectors.joining()));
+            balance.setProductName(product.getDrawingNumber());
+            balance.setProductNum(l.getProductNum());
+            balance.setLotCode(l.getLotCode());
+            balance.setSupplierCode(supplier != null ? supplier.getCode() : "");
+            balance.setTaxRatio(supplier != null ? supplier.getTaxRatio() : null);
             // 料损数量
             // 99984与99024无料损数量 【不扣料损】
             // 其他外协厂[料损数量]计算公式=发出数量 * (1 - 料损率 / 1000) - 合格数量,结果取整 【料损率从外协厂基础配置表中读】
@@ -336,7 +399,7 @@ public class OutsourceBalanceController extends BaseController {
                     // 按炉结算
                 }
             }
-            balance.setFreightPrice(supplier.getFreightDeductUnitPrice().multiply(BigDecimal.valueOf(l.getNewCarrierCount())).setScale(4, RoundingMode.HALF_UP));
+            balance.setFreightPrice(supplier != null ? supplier.getFreightDeductUnitPrice().multiply(BigDecimal.valueOf(l.getNewCarrierCount())).setScale(4, RoundingMode.HALF_UP) : null);
             balances.add(balance);
         });
         return success(balances);

+ 9 - 9
src/main/java/cn/ezhizao/project/business/domain/BizMaterialBase.java

@@ -17,7 +17,7 @@ import io.swagger.annotations.ApiModelProperty;
  * @date 2024-06-17
  */
 @Data
-@TableName(value = "biz_material_base_info")
+@TableName(value = "biz_material_base")
 public class BizMaterialBase extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
@@ -792,11 +792,11 @@ public class BizMaterialBase extends BaseEntity
     public BizMaterialBase(Inv10100 l) {
         this.materialCode = l.getPart().trim();
         this.type = l.getType().trim();
-        this.mnemonicCode = l.getFindkey().trim();
+        this.mnemonicCode = l.getFindkey() == null ? null : l.getFindkey().trim();
         this.itemtype = l.getItemtype();
         this.steelClass = l.getIClass();
-        this.repCode = l.getRepcode().trim();
-        this.barcode = l.getBarcode().trim();
+        this.repCode = l.getRepcode() == null ? null : l.getRepcode().trim();
+        this.barcode = l.getBarcode() == null ? null : l.getBarcode().trim();
         this.prloc = l.getPrloc();
         this.dept = l.getDept();
         this.description = l.getDescription();
@@ -946,13 +946,13 @@ public class BizMaterialBase extends BaseEntity
     }
 
     public void setByInv10100(Inv10100 l) {
-        this.materialCode = l.getPart();
-        this.type = l.getType();
-        this.mnemonicCode = l.getFindkey();
+        this.materialCode = l.getPart().trim();
+        this.type = l.getType().trim();
+        this.mnemonicCode = l.getFindkey() == null ? null : l.getFindkey().trim();
         this.itemtype = l.getItemtype();
         this.steelClass = l.getIClass();
-        this.repCode = l.getRepcode();
-        this.barcode = l.getBarcode();
+        this.repCode = l.getRepcode() == null ? null : l.getRepcode().trim();
+        this.barcode = l.getBarcode() == null ? null : l.getBarcode().trim();
         this.prloc = l.getPrloc();
         this.dept = l.getDept();
         this.description = l.getDescription();

+ 131 - 0
src/main/java/cn/ezhizao/project/business/domain/BizMaterialBaseInfo.java

@@ -0,0 +1,131 @@
+package cn.ezhizao.project.business.domain;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+import cn.ezhizao.framework.aspectj.lang.annotation.Excel;
+import cn.ezhizao.framework.web.domain.BaseEntity;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 材料基础信息对象 biz_material_base_info
+ *
+ * @author ezhizao
+ * @date 2024-06-18
+ */
+@Data
+@TableName(value = "biz_material_base_info")
+public class BizMaterialBaseInfo extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    @ApiModelProperty(value = "${comment}")
+    private String productCode;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    @ApiModelProperty(value = "${comment}")
+    private String materialCode;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    @ApiModelProperty(value = "${comment}")
+    private String prloc;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    @ApiModelProperty(value = "${comment}")
+    private BigDecimal gccd;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    @ApiModelProperty(value = "${comment}")
+    private String ltcd;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    @ApiModelProperty(value = "${comment}")
+    private String zlcd;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    @ApiModelProperty(value = "${comment}")
+    private BigDecimal utrate;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    @ApiModelProperty(value = "${comment}")
+    private BigDecimal dxqty;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    @ApiModelProperty(value = "${comment}")
+    private BigDecimal yzj;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    @ApiModelProperty(value = "${comment}")
+    private BigDecimal base;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    @ApiModelProperty(value = "${comment}")
+    private String description;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    @ApiModelProperty(value = "${comment}")
+    private String bomsta;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    @ApiModelProperty(value = "${comment}")
+    private String writeruser;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    @ApiModelProperty(value = "${comment}")
+    private Date writedate;
+
+    public BizMaterialBaseInfo() {
+        super();
+    }
+
+    public BizMaterialBaseInfo(Bom30101 l) {
+        this.materialCode = l.getPart().trim();
+        this.productCode = l.getCpart().trim();
+        this.prloc = l.getPrloc();
+        this.gccd = l.getGccd();
+        this.ltcd = l.getLtcd();
+        this.zlcd = l.getZlcd();
+        this.utrate = l.getUtrate();
+        this.dxqty = l.getDxqty();
+        this.yzj = l.getYzj();
+        this.base = l.getBase();
+        this.description = l.getDescription();
+        this.bomsta = l.getBomsta();
+        this.writedate = l.getWritedate();
+        this.writeruser = l.getWriteruser();
+    }
+
+    public void setByBom30101(Bom30101 l) {
+        this.materialCode = l.getPart().trim();
+        this.productCode = l.getCpart().trim();
+        this.prloc = l.getPrloc();
+        this.gccd = l.getGccd();
+        this.ltcd = l.getLtcd();
+        this.zlcd = l.getZlcd();
+        this.utrate = l.getUtrate();
+        this.dxqty = l.getDxqty();
+        this.yzj = l.getYzj();
+        this.base = l.getBase();
+        this.description = l.getDescription();
+        this.bomsta = l.getBomsta();
+        this.writedate = l.getWritedate();
+        this.writeruser = l.getWriteruser();
+    }
+}

+ 15 - 3
src/main/java/cn/ezhizao/project/business/domain/BizSupplier.java

@@ -88,20 +88,30 @@ public class BizSupplier extends BaseEntity {
     @ApiModelProperty(value = "税率")
     private Integer taxRatio;
 
+    @ApiModelProperty("外协加工类别:11:热处理12:机加工13:表面处理14:电镀15:三方选别")
+    private String outsourceType;
+
+    @ApiModelProperty("是否免检 免检为N 质检为Y")
+    private String isQualityChecking;
+
     public BizSupplier(Sfc10100 l) {
         this.code = l.getMccode().trim();
         this.name = l.getMcname().trim();
         this.mnemonicCode = l.getFinkey().trim();
         this.lossLimit = l.getLsl();
         this.settlementType = l.getJsfs().trim().equals("N") ? "1": l.getJsfs().trim().equals("Y") ? "2" : "0" ;
-        this.status = l.getStatus().trim();
+        this.status = l.getStatus() != null ? l.getStatus().trim() : null;
         this.freightDeductUnitPrice = l.getYfprc();
         this.surfaceTreatment = l.getBmcl().trim();
         this.wastePriceCategory = l.getFptype();
         this.taxRatio = l.getTaxsl();
+        this.outsourceType = l.getWxtype();
+        this.isQualityChecking = l.getMjtype();
     }
 
-    public BizSupplier() {}
+    public BizSupplier() {
+        super();
+    }
 
     public void setBySfc10100(Sfc10100 l) {
         this.code = l.getMccode().trim();
@@ -109,10 +119,12 @@ public class BizSupplier extends BaseEntity {
         this.mnemonicCode = l.getFinkey().trim();
         this.lossLimit = l.getLsl();
         this.settlementType = l.getJsfs().trim().equals("N") ? "1": l.getJsfs().trim().equals("Y") ? "2" : "0" ;
-        this.status = l.getStatus().trim();
+        this.status = l.getStatus() != null ? l.getStatus().trim() : null;
         this.freightDeductUnitPrice = l.getYfprc();
         this.surfaceTreatment = l.getBmcl().trim();
         this.wastePriceCategory = l.getFptype();
         this.taxRatio = l.getTaxsl();
+        this.outsourceType = l.getWxtype();
+        this.isQualityChecking = l.getMjtype();
     }
 }

+ 23 - 0
src/main/java/cn/ezhizao/project/business/domain/Bom30101.java

@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.math.BigDecimal;
+import java.util.Date;
 
 @Data
 @TableName("bom30101")
@@ -17,4 +18,26 @@ public class Bom30101 {
     private BigDecimal gccd;
     @ApiModelProperty("原材料利用率")
     private BigDecimal utrate;
+    @ApiModelProperty("账号")
+    private String prloc;
+    @ApiModelProperty("料头长度")
+    private String ltcd;
+    @ApiModelProperty("直料长度")
+    private String zlcd;
+    @ApiModelProperty("单箱支数")
+    private BigDecimal dxqty;
+    @ApiModelProperty("备注")
+    private String remark;
+    @ApiModelProperty("实际投料直径")
+    private BigDecimal yzj;
+    @ApiModelProperty("基本用量")
+    private BigDecimal base;
+    @ApiModelProperty("子件描述")
+    private String description;
+    @ApiModelProperty("Y组装件有bom/N子件是材料或外购件")
+    private String bomsta;
+    @ApiModelProperty("操作者")
+    private String writeruser;
+    @ApiModelProperty("更新日期")
+    private Date writedate;
 }

+ 29 - 0
src/main/java/cn/ezhizao/project/business/mapper/BizMaterialBaseInfoMapper.java

@@ -0,0 +1,29 @@
+package cn.ezhizao.project.business.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import cn.ezhizao.project.business.domain.BizMaterialBaseInfo;
+
+/**
+ * 材料基础信息Mapper接口
+ *
+ * @author ezhizao
+ * @date 2024-06-18
+ */
+public interface BizMaterialBaseInfoMapper extends BaseMapper<BizMaterialBaseInfo>
+{
+    /**
+     * 查询材料基础信息列表
+     *
+     * @param bizMaterialBaseInfo 材料基础信息
+     * @return 材料基础信息集合
+     */
+    public List<BizMaterialBaseInfo> getList(BizMaterialBaseInfo bizMaterialBaseInfo);
+
+    /**
+     * 物理删除
+     * @param bizMaterialBaseInfo
+     * @return 删除结果
+    */
+    public int physicalDelete(BizMaterialBaseInfo bizMaterialBaseInfo);
+}

+ 30 - 0
src/main/java/cn/ezhizao/project/business/service/IBizMaterialBaseInfoService.java

@@ -0,0 +1,30 @@
+package cn.ezhizao.project.business.service;
+
+import java.util.List;
+import com.baomidou.mybatisplus.extension.service.IService;
+import cn.ezhizao.project.business.domain.BizMaterialBaseInfo;
+
+/**
+ * 材料基础信息Service接口
+ *
+ * @author ezhizao
+ * @date 2024-06-18
+ */
+public interface IBizMaterialBaseInfoService extends IService<BizMaterialBaseInfo>
+{
+    /**
+     * 查询材料基础信息列表
+     *
+     * @param bizMaterialBaseInfo 材料基础信息
+     * @return 材料基础信息集合
+     */
+    public List<BizMaterialBaseInfo> getList(BizMaterialBaseInfo bizMaterialBaseInfo);
+
+    /**
+     * 物理删除
+     * @param bizMaterialBaseInfo
+     * @return 删除结果
+     */
+    public int physicalDelete(BizMaterialBaseInfo bizMaterialBaseInfo);
+
+}

+ 43 - 0
src/main/java/cn/ezhizao/project/business/service/impl/BizMaterialBaseInfoServiceImpl.java

@@ -0,0 +1,43 @@
+package cn.ezhizao.project.business.service.impl;
+
+import java.util.List;
+import javax.annotation.Resource;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import cn.ezhizao.project.business.mapper.BizMaterialBaseInfoMapper;
+import cn.ezhizao.project.business.domain.BizMaterialBaseInfo;
+import cn.ezhizao.project.business.service.IBizMaterialBaseInfoService;
+
+/**
+ * 材料基础信息Service业务层处理
+ *
+ * @author ezhizao
+ * @date 2024-06-18
+ */
+@Service
+public class BizMaterialBaseInfoServiceImpl  extends ServiceImpl<BizMaterialBaseInfoMapper, BizMaterialBaseInfo> implements IBizMaterialBaseInfoService
+{
+    @Resource
+    private BizMaterialBaseInfoMapper bizMaterialBaseInfoMapper;
+
+    /**
+     * 查询材料基础信息列表
+     *
+     * @param bizMaterialBaseInfo 材料基础信息
+     * @return 材料基础信息
+     */
+    @Override
+    public List<BizMaterialBaseInfo> getList(BizMaterialBaseInfo bizMaterialBaseInfo)
+    {
+        return bizMaterialBaseInfoMapper.getList(bizMaterialBaseInfo);
+    }
+
+    /**
+     * 物理删除
+     * @param bizMaterialBaseInfo
+     * @return 删除结果
+     */
+    @Override
+    public int physicalDelete(BizMaterialBaseInfo bizMaterialBaseInfo){ return bizMaterialBaseInfoMapper.physicalDelete(bizMaterialBaseInfo); };
+
+}

+ 42 - 0
src/main/resources/mybatis/business/BizMaterialBaseInfoMapper.xml

@@ -0,0 +1,42 @@
+<?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="cn.ezhizao.project.business.mapper.BizMaterialBaseInfoMapper">
+
+    <resultMap type="cn.ezhizao.project.business.domain.BizMaterialBaseInfo" id="BizMaterialBaseInfoResult">
+        <id column="id" property="id"/>
+    </resultMap>
+
+
+    <select id="getList" parameterType="BizMaterialBaseInfo" resultMap="BizMaterialBaseInfoResult">
+        SELECT * FROM biz_material_base_info
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            deleted = 0
+            <if test="cpart != null  and cpart != ''">AND cpart = #{productCode}</if>
+            <if test="part != null  and part != ''">AND part = #{materialCode}</if>
+            <if test="prloc != null  and prloc != ''"> AND prloc = #{prloc}</if>
+            <if test="gccd != null "> AND gccd = #{gccd}</if>
+            <if test="ltcd != null  and ltcd != ''"> AND ltcd = #{ltcd}</if>
+            <if test="zlcd != null  and zlcd != ''"> AND zlcd = #{zlcd}</if>
+            <if test="utrate != null "> AND utrate = #{utrate}</if>
+            <if test="dxqty != null "> AND dxqty = #{dxqty}</if>
+            <if test="yzj != null "> AND yzj = #{yzj}</if>
+            <if test="base != null "> AND base = #{base}</if>
+            <if test="description != null  and description != ''"> AND description = #{description}</if>
+            <if test="bomsta != null  and bomsta != ''"> AND bomsta = #{bomsta}</if>
+            <if test="writeruser != null  and writeruser != ''"> AND writeruser = #{writeruser}</if>
+            <if test="writedate != null "> AND writedate = #{writedate}</if>
+        </trim>
+    </select>
+
+    <delete id="physicalDelete">
+        DELETE FROM biz_material_base_info
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            <if test="id != null">
+                id = #{id} AND
+            </if>
+       <!-- 删除条件为其他外键可以在这里加 -->
+        </trim>
+    </delete>
+</mapper>