查询出所有的产品信息(分页加模糊查询<产品的编码,型号,名字,定制表编号>)
| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | |
| | | return new Response().set(1,true,"记录下载日志"); |
| | | } |
| | | |
| | | @ApiOperation(tags = "产品管理",value = "获取所有产品信息") |
| | | /* @ApiOperation(tags = "产品管理",value = "获取所有产品信息") |
| | | @GetMapping("getAllBom") |
| | | public Response getAllBom( @RequestParam(required = false) String parentCode,@RequestParam(required = false) String parentName, @RequestParam(required = false) String parentModel, @RequestParam int pageCurr, @RequestParam int pageSize){ |
| | | return service.getAllBom(parentCode,parentName,parentModel,pageCurr,pageSize); |
| | | } |
| | | }*/ |
| | | |
| | | @ApiOperation(tags = "产品管理",value = "根据母料型号查询子件信息及有最新版本关联的散装件信息") |
| | | @GetMapping("getSubByMaterialProduct") |
| | |
| | | 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.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | @Api(tags = "产品管理") |
| | | @RestController |
| | | @RequestMapping("product") |
| | | public class ProductController { |
| | | @Autowired |
| | | private ProductService service; |
| | |
| | | public Response getProductByMaterial(@RequestParam String subCode){ |
| | | return service.getProductByMaterial(subCode); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询出所有的产品信息(分页加模糊查询<产品的编码,型号,名字,定制表编号>)",notes = "8.17修改后使用") |
| | | @GetMapping("getAllProduct") |
| | | public Response getAllProduct(@RequestParam(required = false) String parentCode,@RequestParam(required = false) String parentName, @RequestParam(required = false) String parentModel |
| | | , @RequestParam(required = false) String customCode, @RequestParam int pageCurr, @RequestParam int pageSize){ |
| | | return service.getAllProduct(parentCode,parentName,parentModel,customCode,pageCurr,pageSize); |
| | | } |
| | | } |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.ProductMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | 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); |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | if(parentCode!=null&&!parentCode.isEmpty()){ |
| | | wrapper.like("parent_code",parentCode); |
| | | } |
| | | if(parentName!=null&&!parentName.isEmpty()){ |
| | | wrapper.like("parent_name",parentName); |
| | | } |
| | | if(parentModel!=null&&!parentModel.isEmpty()){ |
| | | wrapper.like("parent_model",parentModel); |
| | | } |
| | | if(customCode!=null&&!customCode.isEmpty()){ |
| | | wrapper.like("custom_code",customCode); |
| | | } |
| | | wrapper.orderByAsc("id"); |
| | | List list=mapper.selectList(wrapper); |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | return new Response().setII(1,list.size()>0?true:false,pageInfo,"返回产品信息"); |
| | | } |
| | | } |