| | |
| | | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.ProductHistory; |
| | | import com.whyc.service.MaterialService; |
| | | import com.whyc.service.ProductBomService; |
| | | import com.whyc.service.ProductHistoryService; |
| | | import com.whyc.service.ProductService; |
| | |
| | | @Autowired |
| | | private ProductBomService bomService; |
| | | |
| | | @ApiOperation(tags = "物料管理",value = "根据物料编码查询所有包含该物料的产品信息",notes = "8.17修改后使用") |
| | | @GetMapping("getProductByMaterial") |
| | | public Response getProductByMaterial(@RequestParam String subCode){ |
| | | return service.getProductByMaterial(subCode); |
| | | @Autowired |
| | | private MaterialService meterService; |
| | | |
| | | @ApiOperation(value = "建立关联时查询所有的物料(不分页)",notes = "8.17修改后使用") |
| | | @GetMapping("getAllMaterialNoLimit") |
| | | public Response getAllMaterialNoLimit(){ |
| | | return meterService.getAllMaterialNoLimit(); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询出所有的产品信息(分页加模糊查询<产品的编码,型号,名字,定制表编号>)",notes = "8.17修改后使用") |
| | |
| | | import java.util.List; |
| | | |
| | | public interface ProductMapper extends CustomMapper<Product>{ |
| | | //根据物料编码查询所有包含该物料的产品信息 |
| | | List getProductByMaterial(String subCode); |
| | | |
| | | } |
| | |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | return new Response().setII(1,list.size()>0?true:false,pageInfo,"查询所有物料(分页,模糊查询)"); |
| | | } |
| | | //建立关联时查询所有的物料(不分页) |
| | | public Response getAllMaterialNoLimit() { |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.ne("status",0); |
| | | wrapper.orderByAsc("id"); |
| | | List<Material> list=mapper.selectList(wrapper); |
| | | return new Response().setII(1,list.size()>0?true:false,list,"查询所有物料(不分页)"); |
| | | } |
| | | } |
| | |
| | | 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,""); |
| | | } |
| | | |
| | | //查询出所有的产品信息(分页加模糊查询<产品的编码,型号,名字,定制表编号> |
| | | public Response getAllProduct(String parentCode, String parentName, String parentModel, String customCode, int pageCurr, int pageSize) { |
| | | PageHelper.startPage(pageCurr,pageSize); |
| | |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | return new Response().setII(1,list.size()>0?true:false,pageInfo,"返回产品信息"); |
| | | } |
| | | |
| | | } |
| | |
| | | <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> |