| | |
| | | import com.yuanchu.mom.common.PrintChina; |
| | | import com.yuanchu.mom.dto.DeviceDto; |
| | | 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, DeviceDto 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) { |
| | | String[] ids = device.getInsProductIds().split(","); |
| | | for (String i : ids) { |
| | | if (i.equals(id+"")) { |
| | | devices2.add(device); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | return devices2; |
| | | } |
| | | |
| | | @Override |
| | | public Device selectDeviceByCode(String code) { |
| | | return deviceMapper.selectOne(Wrappers.<Device>lambdaQuery().eq(Device::getFactoryNo, code).last("limit 1")); |
| | | } |
| | | } |
| | | |