Fancy
2025-01-09 e54a03e1c3fefef7ec84df6168ff5cf26e53f8cb
pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/product/ProductSv.java
@@ -76,9 +76,9 @@
    @Transactional
    public int save(PltProduct p) {
        //判断产品不能重名
        if (dao.exists(p.name, p.id)) {
            throw new RuntimeException("产品名称重复");
        //判断产品 名称和型号 不能重名
        if (dao.exists(p.name.trim(), p.type.trim() ,p.id)) {
            throw new RuntimeException("已经存在相同的产品名称&型号");
        }
        int flag=0;
        do {
@@ -114,8 +114,8 @@
    @Transactional
    public int update(PltProduct p) {
        if (dao.exists(p.name, p.id)) {
            throw new RuntimeException("产品名称重复");
        if (dao.exists(p.name.trim(), p.type.trim(),p.id)) {
            throw new RuntimeException("已经存在相同的产品名称&型号");
        }
        int count = dao.updateByPrimaryKeySelective(p);
        //删除旧数据,重新插入
@@ -248,7 +248,7 @@
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo);
        return dao.selectAll(params);
    }
    public List<PltProduct> selectByOrderId(Long orderId) {
    public List<PltProduct> getProduct(Long orderId) {
        return dao.selectByOrderId(orderId);
    }