刘小明
2024-10-10 50bcc73377d38017ee5c36655028f53a3c25c58b
物料清单保存 方法修改
3个文件已修改
11 ■■■■■ 已修改文件
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrBillOfMaterialMapper.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/resources/mapper/PrBillOfMaterialMapper.xml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/process/ProcessSv.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrBillOfMaterialMapper.java
@@ -2,6 +2,7 @@
import com.dy.pmsGlobal.pojoPr.PrBillOfMaterial;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -20,4 +21,6 @@
    int updateByPrimaryKey(PrBillOfMaterial record);
    int insertMany(List<PrBillOfMaterial> records);
    void deleteByNodeId(@Param("nodeIds")List<Long> nodeIds);
}
pms-parent/pms-global/src/main/resources/mapper/PrBillOfMaterialMapper.xml
@@ -89,4 +89,11 @@
      file_id = #{fileId,jdbcType=BIGINT}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <delete id="deleteByNodeId" >
    delete from pr_bill_of_material where node_id in
    <foreach collection="nodeIds" item="item" separator="," open="(" close=")">
      #{item}
    </foreach>
    </delete>
</mapper>
pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/process/ProcessSv.java
@@ -211,6 +211,7 @@
            return null;
        }).filter(bill -> bill != null).toList();
        if (CollectionUtils.isNotEmpty(billList)) {
            billDao.deleteByNodeId(billList.stream().map(PrBillOfMaterial::getNodeId).toList());
            billDao.insertMany(billList);
        }
    }