| | |
| | | return service.deleteComponent(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询所有物料(分页,模糊查询)",notes = "2.0使用") |
| | | @ApiOperation(value = "查询所有物料(分页,模糊查询)",notes = "8.17修改后使用") |
| | | @GetMapping("getMaterialLimit") |
| | | public Response getMaterialLimit(@RequestParam(required = false) String subCode,@RequestParam(required = false) String subName, @RequestParam(required = false) String subModel,@RequestParam int pageCurr, @RequestParam int pageSize){ |
| | | return service.getMaterialLimit(subCode,subName,subModel,pageCurr,pageSize); |
New file |
| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.service.ProductService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | @Api(tags = "产品管理") |
| | | public class ProductController { |
| | | @Autowired |
| | | private ProductService service; |
| | | |
| | | @ApiOperation(tags = "物料管理",value = "根据物料编码查询所有包含该物料的产品信息",notes = "8.17修改后使用") |
| | | @GetMapping() |
| | | public Response getProductByMaterial(@RequestParam String subCode){ |
| | | return service.getProductByMaterial(subCode); |
| | | } |
| | | } |
New file |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.pojo.Product; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface ProductMapper extends CustomMapper<Product>{ |
| | | //根据物料编码查询所有包含该物料的产品信息 |
| | | List getProductByMaterial(String subCode); |
| | | } |
New file |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.ProductMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class ProductService { |
| | | @Autowired(required = false) |
| | | private ProductMapper mapper; |
| | | //根据物料编码查询所有包含该物料的产品信息 |
| | | public Response getProductByMaterial(String subCode) { |
| | | List list=mapper.getProductByMaterial(subCode); |
| | | return new Response().setII(1,list.size()>0?true:false,list,""); |
| | | } |
| | | } |
New file |
| | |
| | | <?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="com.whyc.mapper.ProductMapper"> |
| | | |
| | | |
| | | <select id="getProductByMaterial" resultType="product"> |
| | | select * from db_doc.tb_product,db_doc.tb_product_bom |
| | | where tb_product.id=tb_product_bom.product_id |
| | | tb_product_bom.sub_code=#{subCode} |
| | | </select> |
| | | </mapper> |