|
@@ -117,34 +117,4 @@ public class MedicalEquipmentController {
|
|
|
return R.ok(equipmentPage);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 查询当前企业对应的医疗器械
|
|
|
- *
|
|
|
- * @return
|
|
|
- */
|
|
|
- @GetMapping("/list-current")
|
|
|
- public R<?> listByDrugId() {
|
|
|
- Integer deptId = SecurityUtils.getUser().getDeptId();
|
|
|
- // 查询父级企业id
|
|
|
- SysDeptRelation deptRelation = sysDeptRelationService.getOne(Wrappers.<SysDeptRelation>lambdaQuery()
|
|
|
- .eq(SysDeptRelation::getDescendant, deptId)
|
|
|
- .ne(SysDeptRelation::getAncestor, deptId));
|
|
|
- if (deptRelation == null) {
|
|
|
- return R.ok(Collections.emptyList());
|
|
|
- }
|
|
|
- // 查询是否存在父级的父级
|
|
|
- SysDeptRelation pDeptRelation = sysDeptRelationService.getOne(Wrappers.<SysDeptRelation>lambdaQuery()
|
|
|
- .eq(SysDeptRelation::getDescendant, deptRelation.getAncestor())
|
|
|
- .ne(SysDeptRelation::getAncestor, deptRelation.getAncestor()));
|
|
|
- if (pDeptRelation != null && pDeptRelation.getAncestor() != 1) {
|
|
|
- deptRelation = pDeptRelation;
|
|
|
- }
|
|
|
-
|
|
|
- // 查询企业对应药企id
|
|
|
- WmDaDrugEnt wmDaDrugEnt = wmDaDrugEntService.selectByDeptId(deptRelation.getAncestor());
|
|
|
-
|
|
|
- List<MedicalEquipment> medicalEquipmentList = medicalEquipmentService.list(Wrappers.<MedicalEquipment>lambdaQuery()
|
|
|
- .eq(MedicalEquipment::getDrugEntId, wmDaDrugEnt.getId()));
|
|
|
- return R.ok(medicalEquipmentList);
|
|
|
- }
|
|
|
}
|