| | |
| | | |
| | | import cn.hutool.core.lang.Snowflake; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | |
| | | return "保存成功!"; |
| | | } |
| | | |
| | | @Override |
| | | public boolean chooseEquipment(Integer id, Integer equipmentId) { |
| | | UpdateWrapper<InspectionProduct>inspectionProductUpdateWrapper=new UpdateWrapper<>(); |
| | | inspectionProductUpdateWrapper.lambda().set(InspectionProduct::getInstrumentId,equipmentId) |
| | | .eq(InspectionProduct::getId,id); |
| | | return inspectionProductMapper.update(null,inspectionProductUpdateWrapper)>0; |
| | | } |
| | | |
| | | /*根据样品名称,样品编号,型号规格获取型号id*/ |
| | | private Integer getSpecificationId(String name, String mcode, String specification) { |
| | | //获取物料id |
| | | Material material = materialMapper.selectOne(Wrappers.<Material>query() |
| | | .eq("name", name) |
| | | .eq("code", mcode)); |
| | | if (Objects.isNull(material)){ |
| | | return null; |
| | | } |
| | | //获取规格名称和型号名称 |
| | | String[] split = specification.split("-"); |
| | | String stName = split[0]; |