| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.common.GetLook; |
| | | import com.yuanchu.mom.common.PrintChina; |
| | | import com.yuanchu.mom.mapper.DeviceMapper; |
| | | import com.yuanchu.mom.mapper.StructureItemParameterMapper; |
| | | import com.yuanchu.mom.pojo.Device; |
| | | import com.yuanchu.mom.pojo.StructureItemParameter; |
| | | import com.yuanchu.mom.service.DeviceService; |
| | | import com.yuanchu.mom.utils.QueryWrappers; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | private GetLook getLook; |
| | | |
| | | private DeviceMapper deviceMapper; |
| | | |
| | | private StructureItemParameterMapper structureItemParameterMapper; |
| | | |
| | | @Override |
| | | public Map<String, Object> selectDeviceParameter(Page page, Device itemParameter) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<Device> selectDeviceByCategory(String category) { |
| | | return deviceMapper.selectList(Wrappers.<Device>lambdaQuery().eq(Device::getLargeCategory, category).eq(Device::getDeviceStatus, 0)); |
| | | public List<Device> selectDeviceByCategory(String inspectionItem, String inspectionItemSubclass) { |
| | | Integer id; |
| | | try { |
| | | id = structureItemParameterMapper.selectOne(Wrappers.<StructureItemParameter>lambdaQuery().eq(StructureItemParameter::getInspectionItem, inspectionItem).eq(StructureItemParameter::getInspectionItemSubclass, inspectionItemSubclass).last("limit 1").select(StructureItemParameter::getId)).getId(); |
| | | } catch (Exception e) { |
| | | return null; |
| | | } |
| | | List<Device> devices = deviceMapper.selectList(Wrappers.<Device>lambdaQuery().eq(Device::getDeviceStatus, 0).isNotNull(Device::getInsProductIds)); |
| | | List<Device> devices2 = new ArrayList<>(); |
| | | for (Device device : devices) { |
| | | List<Integer> ids = JSON.parseArray(device.getInsProductIds(), Integer.class); |
| | | for (Integer i : ids) { |
| | | if (i == id) { |
| | | devices2.add(device); |
| | | } |
| | | } |
| | | } |
| | | return devices2; |
| | | } |
| | | |
| | | @Override |
| | | public Device selectDeviceByCode(String code) { |
| | | return deviceMapper.selectOne(Wrappers.<Device>lambdaQuery().eq(Device::getFactoryNo, code).last("limit 1")); |
| | | } |
| | | } |
| | | |