Fancy
2024-09-24 d6760886b7d9c671629b1f0321365fa4efc7df4a
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,9 @@
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo);
        return dao.selectAll(params);
    }
    public List<PltProduct> getProduct(Long orderId) {
        return dao.selectByOrderId(orderId);
    }
//    public void downloadDoc(HttpServletResponse response) {
//        PltProduct pro=dao.selectByPrimaryKey(Long.valueOf(1));