| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.MaterialMapper; |
| | | import com.whyc.pojo.Material; |
| | | import com.whyc.pojo.ProductBom; |
| | | import com.whyc.util.CommonUtil; |
| | | import com.whyc.util.FileUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | List<Material> list=mapper.selectList(wrapper);*//* |
| | | List<Material> list=mapper.getAllMaterial(category,subCode,subName,subModel); |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | return new Response().setII(1,list.size()>0?true:false,pageInfo,"返回所有的散装件"); |
| | | return new Response().setII(1,list.size()>0,pageInfo,"返回所有的散装件"); |
| | | }*/ |
| | | //查询所有的散装件信息不分页 |
| | | /*public Response getMaterialWithoutSub(String parentModel, String subName,int version) { |
| | | List<Material> list=mapper.getMaterialWithoutSub(parentModel,subName,version); |
| | | return new Response().setII(1,list.size()>0?true:false,list,"返回子件没有添加过联系的散装件"); |
| | | return new Response().setII(1,list.size()>0,list,"返回子件没有添加过联系的散装件"); |
| | | }*/ |
| | | //删除散装件(将散装件标识为不可用) |
| | | /*public Response deleteMaterial(int id) { |
| | |
| | | wrapper.set("status",0); |
| | | wrapper.eq("id",id); |
| | | int bl=mapper.update(null,wrapper); |
| | | return new Response().setII(1,bl>0?true:false,bl,"将散装件标识为不可用"); |
| | | return new Response().setII(1,bl>0,bl,"将散装件标识为不可用"); |
| | | }*/ |
| | | |
| | | public List<Material> getList() { |
| | |
| | | PageHelper.startPage(pageCurr,pageSize); |
| | | List<Material> list=mapper.getMaterialLimit(subCode,subName,subModel); |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | return new Response().setII(1,list.size()>0?true:false,pageInfo,"查询所有物料(分页,模糊查询)"); |
| | | return new Response().setII(1,list.size()>0,pageInfo,"查询所有物料(分页,模糊查询)"); |
| | | } |
| | | //建立关联时查询所有的物料(不分页) |
| | | public Response getAllMaterialNoLimit() { |
| | |
| | | wrapper.ne("status",0); |
| | | wrapper.orderByAsc("id"); |
| | | List<Material> list=mapper.selectList(wrapper); |
| | | return new Response().setII(1,list.size()>0?true:false,list,"查询所有物料(不分页)"); |
| | | return new Response().setII(1,list.size()>0,list,"查询所有物料(不分页)"); |
| | | } |
| | | |
| | | public List<String> getListByCodeList(List<String> codeList) { |
| | |
| | | private List<Material> getListByCodeAndModelList(List<Material> materialList) { |
| | | return mapper.getListByCodeAndModelList(materialList); |
| | | } |
| | | |
| | | public List<Material> getListByCodeAndModelList2(List<ProductBom> bomList) { |
| | | return mapper.getListByCodeAndModelList2(bomList); |
| | | } |
| | | |
| | | public Material getByCodeAndModel(String subCode, String subModel) { |
| | | QueryWrapper<Material> query = Wrappers.query(); |
| | | query.eq("sub_code",subCode).eq("sub_model",subModel).last(" limit 1"); |
| | | return mapper.selectOne(query); |
| | | } |
| | | } |