| | |
| | | package com.yuanchu.limslaboratory.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.Standards; |
| | | import com.yuanchu.limslaboratory.mapper.StandardsMapper; |
| | | import com.yuanchu.limslaboratory.pojo.User; |
| | | import com.yuanchu.limslaboratory.service.SerialNumberService; |
| | | import com.yuanchu.limslaboratory.service.StandardsService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.limslaboratory.service.UserService; |
| | | import com.yuanchu.limslaboratory.utils.MyUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | |
| | | @Autowired |
| | | private UserService userService; |
| | | |
| | | @Lazy |
| | | @Autowired |
| | | private SerialNumberService serialNumberService; |
| | | |
| | | @Override |
| | | public Integer addStandardsInformation(Standards standards) { |
| | | Boolean userIsNull = userService.userIsNull(standards.getUserId()); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> listStandardsInformation(String IdOrNameOfStandards) { |
| | | return standardsMapper.listStandardsInformation(IdOrNameOfStandards); |
| | | public List<Map<String, Object>> listStandardsInformation() { |
| | | LambdaQueryWrapper<Standards> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.select(Standards::getId, Standards::getName); |
| | | List<Map<String, Object>> maps = standardsMapper.selectMaps(wrapper); |
| | | for (Map<String, Object> map : maps){ |
| | | String id = map.get("id").toString(); |
| | | List<Map<String, Object>> serialNumberList = serialNumberService.selectIdSerialNumberInformation(id); |
| | | if (ObjectUtils.isEmpty(serialNumberList)){ |
| | | map.put("serialNumber", null); |
| | | } else { |
| | | map.put("serialNumber", serialNumberList); |
| | | } |
| | | } |
| | | return maps; |
| | | } |
| | | |
| | | @Override |
| | |
| | | Standards standardsIsNull = standardsMapper.selectOne(wrapper); |
| | | return !ObjectUtils.isEmpty(standardsIsNull); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<Map<String, Object>> listPageStandardsInformation(Page<Object> page, String idOrNameOfStandards) { |
| | | return standardsMapper.listPageStandardsInformation(page, idOrNameOfStandards); |
| | | } |
| | | } |