lxw
2023-10-18 edcd13d82c5e7a3c2dce8175b9253951630976c0
验证母料编码是否存在产品
4个文件已修改
18 ■■■■■ 已修改文件
src/main/java/com/whyc/controller/ProductController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/mapper/ProductMapper.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/ProductService.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ProductMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/controller/ProductController.java
@@ -153,4 +153,10 @@
    public Response getCompareProduct(){
        return service.getCompareProduct();
    }
    @ApiOperation(value = "验证母料编码是否存在产品中")
    @GetMapping("judgeParentCode")
    public Response judgeParentCode(@RequestParam String parentCode){
        return service.judgeParentCode(parentCode);
    }
}
src/main/java/com/whyc/mapper/ProductMapper.java
@@ -3,6 +3,7 @@
import com.whyc.pojo.AttachLock;
import com.whyc.pojo.Material;
import com.whyc.pojo.Product;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -17,4 +18,6 @@
    List<AttachLock> selectListProduct(int productId);
    //查询产品是否存在物料时钣金件的产品
    List<Material> selectMaterial_0120(String parentCode, String customCode);
    //验证母料编码是否存在产品中
    int judgeParentCode(@Param("parentCode") String parentCode);
}
src/main/java/com/whyc/service/ProductService.java
@@ -1039,5 +1039,9 @@
        Map<Object, Boolean> seen = new ConcurrentHashMap<>();
        return object -> seen.putIfAbsent(keyExtractor.apply(object), Boolean.TRUE) == null;
    }
    //验证母料编码是否存在产品中
    public Response judgeParentCode(String parentCode) {
        int count = mapper.judgeParentCode(parentCode);
        return  new Response().set(1,count>0,"验证母料编码是否存在产品中");
    }
}
src/main/resources/mapper/ProductMapper.xml
@@ -106,4 +106,7 @@
            </if>
       </where>
    </select>
    <select id="judgeParentCode" resultType="java.lang.Integer">
        select count(*) from tb_product where parent_code like '%${parentCode}%'
    </select>
</mapper>