| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.sinata.common.entity.PageDTO; |
| | | import com.sinata.common.utils.BeanUtils; |
| | | import com.sinata.common.utils.StringUtils; |
| | | import com.sinata.system.domain.MwMicroEquipment; |
| | | import com.sinata.system.domain.SysDepartment; |
| | | import com.sinata.system.domain.dto.MwMicroEquipmentDTO; |
| | |
| | | import com.sinata.system.domain.query.StorageRecordQuery; |
| | | import com.sinata.system.domain.vo.MwMedicalWasteBoxVO; |
| | | import com.sinata.system.domain.vo.MwMicroEquipmentVO; |
| | | import com.sinata.system.enums.MicroEquipmentStatusEnum; |
| | | import com.sinata.system.mapper.MwMicroEquipmentMapper; |
| | | import com.sinata.system.service.MwMicroEquipmentService; |
| | | import com.sinata.system.service.SysDepartmentService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public PageDTO<MwMicroEquipmentVO> pageList(MwMicroEquipmentQuery query) { |
| | | String treeCode = ""; |
| | | if (Objects.isNull(query.getDepartmentId())) { |
| | | SysDepartment myDepartment = sysDepartmentService.getMyDepartment(); |
| | | if (Objects.isNull(myDepartment)) { |
| | | return PageDTO.empty(0L, 0L); |
| | | } |
| | | treeCode = myDepartment.getTreeCode(); |
| | | } else { |
| | | treeCode = sysDepartmentService.getById(query.getDepartmentId()).getTreeCode(); |
| | | String treeCode = sysDepartmentService.getTreeCodeByDepartmentId(query.getDepartmentId()); |
| | | if (StringUtils.isBlank(treeCode)) { |
| | | return PageDTO.empty(0L, 0L); |
| | | } |
| | | Page<MwMicroEquipmentVO> page = baseMapper.pageList(new Page<>(query.getPageCurr(), query.getPageSize()), query.getEquipmentName(), query.getStatus(), treeCode); |
| | | Page<MwMicroEquipmentVO> page = baseMapper.pageList(new Page<>(query.getPageCurr(), query.getPageSize()), query.getEquipmentName(), query.getStatus(), query.getEquipmentNumber(), treeCode); |
| | | return PageDTO.of(page); |
| | | } |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public PageDTO<MwMedicalWasteBoxVO> storedMedicalWastePage(StorageRecordQuery query) { |
| | | String treeCode = ""; |
| | | if (Objects.isNull(query.getDepartmentId())) { |
| | | SysDepartment myDepartment = sysDepartmentService.getMyDepartment(); |
| | | if (Objects.isNull(myDepartment)) { |
| | | return PageDTO.empty(0L, 0L); |
| | | } |
| | | treeCode = myDepartment.getTreeCode(); |
| | | } else { |
| | | treeCode = sysDepartmentService.getById(query.getDepartmentId()).getTreeCode(); |
| | | String treeCode = sysDepartmentService.getTreeCodeByDepartmentId(query.getDepartmentId()); |
| | | if (StringUtils.isBlank(treeCode)) { |
| | | return PageDTO.empty(0L, 0L); |
| | | } |
| | | Page<MwMedicalWasteBoxVO> page = baseMapper.storedMedicalWastePage(new Page<>(query.getPageCurr(), query.getPageSize()), query, treeCode); |
| | | return PageDTO.of(page); |
| | | } |
| | | |
| | | /** |
| | | * 微型设备列表 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<MwMicroEquipmentVO> getList() { |
| | | SysDepartment myDepartment = sysDepartmentService.getMyDepartment(); |
| | | //TODO 待完善 |
| | | List<MwMicroEquipment> list = this.lambdaQuery() |
| | | .eq(MwMicroEquipment::getStatus, MicroEquipmentStatusEnum.NORMAL.getCode()).list(); |
| | | return BeanUtils.copyList(list, MwMicroEquipmentVO.class); |
| | | /*if (Objects.nonNull(myDepartment)) { |
| | | if (myDepartment.getOrgType().equals(DepartmentEnum.MEDICAL_INSTITUTION.getCode())) { |
| | | List<MwMicroEquipment> list = this.lambdaQuery() |
| | | .eq(MwMicroEquipment::getStatus, MicroEquipmentStatusEnum.NORMAL.getCode()) |
| | | .eq(MwMicroEquipment::getDepartmentId, myDepartment.getId()).list(); |
| | | return BeanUtils.copyList(list, MwMicroEquipmentVO.class); |
| | | } |
| | | } |
| | | return CollUtils.emptyList();*/ |
| | | |
| | | } |
| | | } |