diff --git a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/dal/device/Mapper/DeviceMapper.java b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/dal/device/Mapper/DeviceMapper.java index 5e892ccc2..ac8625ba2 100644 --- a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/dal/device/Mapper/DeviceMapper.java +++ b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/dal/device/Mapper/DeviceMapper.java @@ -28,10 +28,18 @@ public interface DeviceMapper extends BaseMapperX { @Update(" UPDATE tb_device t1 SET t1.isDelete=#{isdelete},t1.deletePerson=#{deletePerson},t1.deleteDate=#{deleteDate} WHERE t1.ID=#{ID} ") int deleteDataById(DeviceDO device); - //分页查询 + //查询 + default List selectList(String orgId) { + return selectList(new LambdaQueryWrapperX() + .neIfPresent(DeviceDO::getIsdelete, '1') + .eqIfPresent(DeviceDO::getOrgId, orgId) + .orderByAsc(DeviceDO::getDeviceName)); + } + default PageResult selectPage(DevicePageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX() .neIfPresent(DeviceDO::getIsdelete, '1') + .eqIfPresent(DeviceDO::getOrgId, reqVO.getOrgId()) .likeIfPresent(DeviceDO::getDeviceName, reqVO.getDeviceName()) .likeIfPresent(DeviceDO::getDeviceModel, reqVO.getDeviceModel()) .eqIfPresent(DeviceDO::getDeviceType, reqVO.getDeviceType()) diff --git a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/device/DeviceService.java b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/device/DeviceService.java index aeaed6c20..313de7d36 100644 --- a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/device/DeviceService.java +++ b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/device/DeviceService.java @@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.applyregistration.service.applyform.device; import cn.iocoder.yudao.module.applyregistration.dal.device.DeviceDO; import cn.iocoder.yudao.module.applyregistration.controller.admin.device.vo.*; import cn.iocoder.yudao.framework.common.pojo.PageResult; + import javax.validation.*; import java.util.*; @@ -27,7 +28,6 @@ public interface DeviceService { PageResult getDevicePage(DevicePageReqVO pageReqVO); - //临时方法 List getDevicelist(); } diff --git a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/device/DeviceServiceImpl.java b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/device/DeviceServiceImpl.java index 67c8cbd39..684ecd4e2 100644 --- a/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/device/DeviceServiceImpl.java +++ b/yudao-module-applyregistration/yudao-module-applyregistration-biz/src/main/java/cn/iocoder/yudao/module/applyregistration/service/applyform/device/DeviceServiceImpl.java @@ -103,6 +103,14 @@ public class DeviceServiceImpl implements DeviceService { @Override public PageResult getDevicePage(DevicePageReqVO pageReqVO) { + + //当前登陆用户 + AdminUserDO user = userService.getUser(getLoginUserId()); + + if (pageReqVO != null) { + pageReqVO.setOrgId(user.getOrgId()); + } + return DeviceMapper.selectPage(pageReqVO); } @@ -113,11 +121,13 @@ public class DeviceServiceImpl implements DeviceService { } } - - //临时方法 @Override public List getDevicelist() { - return DeviceMapper.selectList(); + + //当前登陆用户 + AdminUserDO user = userService.getUser(getLoginUserId()); + + return DeviceMapper.selectList(user.getOrgId()); } } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/department/DepartmentController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/department/DepartmentController.java index bd39272c7..45850b446 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/department/DepartmentController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/department/DepartmentController.java @@ -106,7 +106,6 @@ public class DepartmentController { @PreAuthorize("@ss.hasPermission('system:department:query')") public CommonResult> getDepartmentListr() { List department = departmentService.getgetDepartmentList(); - return success(BeanUtils.toBean(department, DepartmentRespVO.class)); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/doctor/DoctorController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/doctor/DoctorController.java index 92c4b8d8b..dce0f8b23 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/doctor/DoctorController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/doctor/DoctorController.java @@ -1,5 +1,7 @@ package cn.iocoder.yudao.module.system.controller.admin.doctor; +import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; +import cn.iocoder.yudao.module.system.service.user.*; import com.mzt.logapi.starter.annotation.LogRecord; import org.springframework.web.bind.annotation.*; @@ -24,10 +26,11 @@ import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*; +import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; import cn.iocoder.yudao.module.system.controller.admin.doctor.vo.*; import cn.iocoder.yudao.module.system.dal.dataobject.doctor.DoctorDO; -import cn.iocoder.yudao.module.system.service.doctor.DoctorService; +import cn.iocoder.yudao.module.system.service.doctor.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; @@ -39,9 +42,14 @@ import javax.validation.Valid; @Validated public class DoctorController { + //属性 @Resource private DoctorService Service; + @Resource + private AdminUserService userService; + + //接口方法 @PostMapping("/create") @Operation(summary = "创建医生管理") @PreAuthorize("@ss.hasPermission('doctor::create')") @@ -119,13 +127,23 @@ public class DoctorController { return success(true); } + @GetMapping("/getAlllist") + @Operation(summary = "获得医生全部list") + @PreAuthorize("@ss.hasPermission('doctor::query')") + public CommonResult> getAlllist() { + List doctorDOs= Service.getDoctorList(null); + return success(doctorDOs); + } - //临时接口 @GetMapping("/getlist") - @Operation(summary = "获得医生管理list") + @Operation(summary = "获得医生list") @PreAuthorize("@ss.hasPermission('doctor::query')") public CommonResult> getlist() { - List doctorDOs= Service.getDoctorList(); + + //当前登陆用户 + AdminUserDO user = userService.getUser(getLoginUserId()); + + List doctorDOs= Service.getDoctorList(user.getOrgId()); return success(doctorDOs); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/department/DepartmentMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/department/DepartmentMapper.java index b7129b149..10112bdf8 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/department/DepartmentMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/department/DepartmentMapper.java @@ -20,14 +20,21 @@ import cn.iocoder.yudao.module.system.controller.admin.department.vo.*; @Mapper public interface DepartmentMapper extends BaseMapperX { + //查询 default PageResult selectPage(DepartmentPageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX() .likeIfPresent(DepartmentDO::getDepartmentName, reqVO.getDepartmentName()) .eqIfPresent(DepartmentDO::getOrgId, reqVO.getOrgId()) .eq(DepartmentDO::getIsDelete, '0') - .orderByDesc(DepartmentDO::getId)); + .orderByAsc(DepartmentDO::getDepartmentName)); } + default List selectList(String orgId) { + return selectList(new LambdaQueryWrapperX() + .neIfPresent(DepartmentDO::getIsDelete, '1') + .eqIfPresent(DepartmentDO::getOrgId, orgId) + .orderByAsc(DepartmentDO::getDepartmentName)); + } List getDepartmentList(); } \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/doctor/DoctorMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/doctor/DoctorMapper.java index 2c42482f3..fce825ec2 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/doctor/DoctorMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/doctor/DoctorMapper.java @@ -21,12 +21,20 @@ import cn.iocoder.yudao.module.system.controller.admin.doctor.vo.*; @Mapper public interface DoctorMapper extends BaseMapperX { + //查询 + default List selectList(String orgId) { + return selectList(new LambdaQueryWrapperX() + .neIfPresent(DoctorDO::getIsdelete, '1') + .eqIfPresent(DoctorDO::getOrgId, orgId) + .orderByAsc(DoctorDO::getDoctorName)); + } + default PageResult selectPage(DoctorPageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX() .likeIfPresent(DoctorDO::getDoctorName, reqVO.getDoctorName()) .likeIfPresent(DoctorDO::getDepartmentName, reqVO.getDepartmentName()) .eq(DoctorDO::getIsdelete, '0') - .orderByDesc(DoctorDO::getDoctorID)); + .orderByAsc(DoctorDO::getDoctorName)); } } \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/examitems/examitemsMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/examitems/examitemsMapper.java index 2cca9220e..6ee1ccae7 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/examitems/examitemsMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/examitems/examitemsMapper.java @@ -21,17 +21,25 @@ import java.util.List; @Mapper public interface examitemsMapper extends BaseMapperX { + //查询 + default List selectList(String orgId) { + return selectList(new LambdaQueryWrapperX() + .neIfPresent(examitemsDO::getIsdelete, '1') + .eqIfPresent(examitemsDO::getOrgId, orgId) + .orderByAsc(examitemsDO::getExamItemName)); + } + default PageResult selectPage(examitemsPageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX() .likeIfPresent(examitemsDO::getExamItemName, reqVO.getExamItemName()) .likeIfPresent(examitemsDO::getExamItemCode, reqVO.getExamItemCode()) .likeIfPresent(examitemsDO::getExamPartCode, reqVO.getExamPartCode()) .eq(examitemsDO::getIsdelete, '0') - .eqIfPresent(examitemsDO::getOrgId,reqVO.getOrgId()) - .orderByDesc(examitemsDO::getId)); + .eqIfPresent(examitemsDO::getOrgId, reqVO.getOrgId()) + .orderByAsc(examitemsDO::getExamItemName)); } - int selectItemCount(@Param("examItemCode") String examItemCode); - //返回检查项目字典 List getexamitemsList(); + + int selectItemCount(@Param("examItemCode") String examItemCode); } \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/exampart/ExampartMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/exampart/ExampartMapper.java index d86808639..d2926300c 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/exampart/ExampartMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/exampart/ExampartMapper.java @@ -32,6 +32,7 @@ public interface ExampartMapper extends BaseMapperX { default PageResult selectPage(ExampartPageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX() .neIfPresent(ExampartDO::getIsDelete, '1') + .eqIfPresent(ExampartDO::getOrgId, reqVO.getOrgId()) .likeIfPresent(ExampartDO::getExamPartName, reqVO.getExamPartName()) .likeIfPresent(ExampartDO::getExamPartCode, reqVO.getExamPartCode()) .orderByAsc(ExampartDO::getExamPartName)); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/department/DepartmentServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/department/DepartmentServiceImpl.java index 06568d4b9..ec16bb6e6 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/department/DepartmentServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/department/DepartmentServiceImpl.java @@ -1,6 +1,8 @@ package cn.iocoder.yudao.module.system.service.department; import cn.iocoder.yudao.framework.common.exception.ErrorCode; +import cn.iocoder.yudao.module.system.dal.dataobject.user.*; +import cn.iocoder.yudao.module.system.service.user.*; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; import org.springframework.transaction.annotation.Transactional; @@ -17,6 +19,7 @@ import cn.iocoder.yudao.module.system.dal.mysql.department.DepartmentMapper; import javax.annotation.Resource; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; /** @@ -28,9 +31,14 @@ import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; @Validated public class DepartmentServiceImpl implements DepartmentService { + //属性 @Resource private DepartmentMapper departmentMapper; + @Resource + private AdminUserService userService; + + //接口方法 @Override public String createDepartment(DepartmentSaveReqVO createReqVO) { // 插入 @@ -75,7 +83,11 @@ public class DepartmentServiceImpl implements DepartmentService { @Override public List getgetDepartmentList() { - return departmentMapper.getDepartmentList(); + + //当前登陆用户 + AdminUserDO user = userService.getUser(getLoginUserId()); + + return departmentMapper.selectList(user.getOrgId()); } } \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/doctor/DoctorService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/doctor/DoctorService.java index 6d7fffd77..6b6c7d96c 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/doctor/DoctorService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/doctor/DoctorService.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.system.service.doctor; import java.util.*; + import cn.iocoder.yudao.module.system.controller.admin.doctor.vo.*; import cn.iocoder.yudao.module.system.dal.dataobject.doctor.DoctorDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; @@ -53,7 +54,12 @@ public interface DoctorService { */ PageResult getPage(DoctorPageReqVO pageReqVO); - //临时方法 - List getDoctorList(); + /** + * 获得医生数据 + * + * @param orgId + * @return 医生数据列表 + */ + List getDoctorList(String orgId); } \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/doctor/DoctorServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/doctor/DoctorServiceImpl.java index 477931287..f5cc8ba76 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/doctor/DoctorServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/doctor/DoctorServiceImpl.java @@ -6,6 +6,7 @@ import org.springframework.validation.annotation.Validated; import org.springframework.transaction.annotation.Transactional; import java.util.*; + import cn.iocoder.yudao.module.system.controller.admin.doctor.vo.*; import cn.iocoder.yudao.module.system.dal.dataobject.doctor.DoctorDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; @@ -34,7 +35,7 @@ public class DoctorServiceImpl implements DoctorService { @Override public String create(DoctorSaveReqVO createReqVO) { // 插入 - DoctorDO doctorDO = BeanUtils.toBean(createReqVO, DoctorDO.class); + DoctorDO doctorDO = BeanUtils.toBean(createReqVO, DoctorDO.class); Mapper.insert(doctorDO); // 返回 return doctorDO.getDoctorID(); @@ -59,7 +60,7 @@ public class DoctorServiceImpl implements DoctorService { private void validateExists(String id) { if (Mapper.selectById(id) == null) { - throw exception(new ErrorCode(1,"用户ID为空")); + throw exception(new ErrorCode(1, "用户ID为空")); } } @@ -73,10 +74,15 @@ public class DoctorServiceImpl implements DoctorService { return Mapper.selectPage(pageReqVO); } - //临时方法 + /** + * 获得医生数据 + * + * @param orgId + * @return 医生数据列表 + */ @Override - public List getDoctorList() { - return Mapper.selectList(); + public List getDoctorList(String orgId) { + return Mapper.selectList(orgId); } } \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/examitems/examitemsServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/examitems/examitemsServiceImpl.java index 8fa52694c..8e82c7c1f 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/examitems/examitemsServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/examitems/examitemsServiceImpl.java @@ -1,12 +1,15 @@ package cn.iocoder.yudao.module.system.service.examitems; import cn.iocoder.yudao.framework.common.exception.ErrorCode; +import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; +import cn.iocoder.yudao.module.system.service.user.*; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; import org.springframework.transaction.annotation.Transactional; import java.util.*; + import cn.iocoder.yudao.module.system.controller.admin.examitems.vo.*; import cn.iocoder.yudao.module.system.dal.dataobject.examitems.examitemsDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; @@ -18,6 +21,7 @@ import cn.iocoder.yudao.module.system.dal.mysql.examitems.examitemsMapper; import javax.annotation.Resource; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; /** @@ -29,9 +33,14 @@ import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; @Validated public class examitemsServiceImpl implements examitemsService { + //属性 @Resource private examitemsMapper examitemsMapper; + @Resource + private AdminUserService userService; + + //接口方法 @Override public String createexamitems(examitemsSaveReqVO createReqVO) { // 插入 @@ -60,7 +69,7 @@ public class examitemsServiceImpl implements examitemsService { private void validateexamitemsExists(String id) { if (examitemsMapper.selectById(id) == null) { - throw exception(new ErrorCode(1,"ID不存在")); + throw exception(new ErrorCode(1, "ID不存在")); } } @@ -76,23 +85,23 @@ public class examitemsServiceImpl implements examitemsService { @Override public boolean getexamItemcodexist(String examItemCode) { - boolean bol=false; + boolean bol = false; int count = examitemsMapper.selectItemCount(examItemCode); - if(count>0) - { - bol=true; + if (count > 0) { + bol = true; + } else { + bol = false; } - else - { - bol=false; - } - return bol; } @Override public List getexamitemsList() { - return examitemsMapper.getexamitemsList(); + + //当前登陆用户 + AdminUserDO user = userService.getUser(getLoginUserId()); + + return examitemsMapper.selectList(user.getOrgId()); } } \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/exampart/ExampartServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/exampart/ExampartServiceImpl.java index 789eb7063..7b9301704 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/exampart/ExampartServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/exampart/ExampartServiceImpl.java @@ -104,6 +104,13 @@ public class ExampartServiceImpl implements ExampartService { @Override public PageResult getExampartPage(ExampartPageReqVO pageReqVO) { + //当前登陆用户 + AdminUserDO user = userService.getUser(getLoginUserId()); + + if (pageReqVO != null) { + pageReqVO.setOrgId(user.getOrgId()); + } + return exampartMapper.selectPage(pageReqVO); } diff --git a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/PatientexamlistController.java b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/PatientexamlistController.java index acb99919f..36ade8b21 100644 --- a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/PatientexamlistController.java +++ b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/PatientexamlistController.java @@ -154,9 +154,18 @@ public class PatientexamlistController { @GetMapping("/dicomDataSync") @Operation(summary = "dicom数据同步") @PreAuthorize("@ss.hasPermission('tblist:patientexamlist:query')") - public CommonResult dicomDataSync() { - patientexamlistService.dicomDataSync(); - return success(true); + public CommonResult> dicomDataSync() { + Map _out = new HashMap<>(); + List ids = null; + try { + ids = patientexamlistService.dicomDataSync(); + _out.put("code", "success"); + } catch (Exception ex) { + ids = null; + _out.put("code", "error"); + } + _out.put("syncItems", ids == null ? 0 : ids.size()); + return success(_out); } @GetMapping("/dicomDataRefresh") diff --git a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/dal/mysql/patientexamlist/PatientexamlistMapper.java b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/dal/mysql/patientexamlist/PatientexamlistMapper.java index 2ee6978d6..842f6938d 100644 --- a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/dal/mysql/patientexamlist/PatientexamlistMapper.java +++ b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/dal/mysql/patientexamlist/PatientexamlistMapper.java @@ -23,6 +23,7 @@ public interface PatientexamlistMapper extends BaseMapperX { //IllnessCasePageReqVO分页 default PageResult selectPage(IllnessCasePageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(PatientexamlistDO::getOrgId, reqVO.getOrgId()) .likeIfPresent(PatientexamlistDO::getRegId, reqVO.getRegId()) .likeIfPresent(PatientexamlistDO::getExamId, reqVO.getExamId()) .geIfPresent(PatientexamlistDO::getExamDate, reqVO.getExamDate_ge()) @@ -40,6 +41,7 @@ public interface PatientexamlistMapper extends BaseMapperX { //ReportPrintPageReqVO分页 default PageResult selectPage(ReportPrintPageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(PatientexamlistDO::getOrgId, reqVO.getOrgId()) .likeIfPresent(PatientexamlistDO::getRegId, reqVO.getRegId()) .likeIfPresent(PatientexamlistDO::getExamId, reqVO.getExamId()) .geIfPresent(PatientexamlistDO::getExamDate, reqVO.getExamDate_ge()) @@ -74,27 +76,29 @@ public interface PatientexamlistMapper extends BaseMapperX { .orderByDesc(PatientexamlistDO::getId)); } + // 查询需要刷新的数据 @Select("select * from tb_patientexamlist where reportstatus='已分检' and examDate is null and orgId=#{orgId}") List GetSortingDataList(@Param("orgId") String orgId); -// 查询已检查数据的阴性阳性重大阳性统计 + + //查询已检查数据的阴性阳性重大阳性统计 @Select(" SELECT COUNT(*) AS totalcount, SUM(CASE WHEN diagFlag = '0' THEN 1 ELSE 0 END) AS yx, SUM(CASE WHEN diagFlag = '1' THEN 1 ELSE 0 END) AS y, SUM(CASE WHEN diagFlag = '2' THEN 1 ELSE 0 END) AS zdyx " + " ,SUM( CASE WHEN gender = '男' THEN 1 ELSE 0 END ) AS F,SUM( CASE WHEN gender = '女' THEN 1 ELSE 0 END ) AS M FROM tb_patientexamlist WHERE examDate IS NOT NULL and orgId=#{orgId}") PatientexamlistCountVO GetWholeDiagFlagCount(@Param("orgId") String orgId); -// 统计一周内的数据已检查数据的阴性阳性重大阳性 -@Select("SELECT " - + "DATE_FORMAT(examDate, '%Y-%m-%d') AS date, " - + "COUNT(*) AS totalcount, " - + "SUM(CASE WHEN diagFlag = '0' THEN 1 ELSE 0 END) AS yx, " - + "SUM(CASE WHEN diagFlag = '1' THEN 1 ELSE 0 END) AS y, " - + "SUM(CASE WHEN diagFlag = '2' THEN 1 ELSE 0 END) AS zdyx " - + "FROM tb_patientexamlist " - + "WHERE examDate IS NOT NULL " - + "AND examDate >= CURDATE() - INTERVAL 7 DAY " - + "AND orgId = #{orgId} " - + "GROUP BY date " - + " ORDER BY date") + //统计一周内的数据已检查数据的阴性阳性重大阳性 + @Select("SELECT " + + "DATE_FORMAT(examDate, '%Y-%m-%d') AS date, " + + "COUNT(*) AS totalcount, " + + "SUM(CASE WHEN diagFlag = '0' THEN 1 ELSE 0 END) AS yx, " + + "SUM(CASE WHEN diagFlag = '1' THEN 1 ELSE 0 END) AS y, " + + "SUM(CASE WHEN diagFlag = '2' THEN 1 ELSE 0 END) AS zdyx " + + "FROM tb_patientexamlist " + + "WHERE examDate IS NOT NULL " + + "AND examDate >= CURDATE() - INTERVAL 7 DAY " + + "AND orgId = #{orgId} " + + "GROUP BY date " + + " ORDER BY date") List GetDateYYZDCount(@Param("orgId") String orgId); diff --git a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/service/patientexamlist/PatientexamlistService.java b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/service/patientexamlist/PatientexamlistService.java index 6c8940cd5..c7efd9918 100644 --- a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/service/patientexamlist/PatientexamlistService.java +++ b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/service/patientexamlist/PatientexamlistService.java @@ -76,7 +76,7 @@ public interface PatientexamlistService extends IService { * @param * @return */ - void dicomDataSync(); + List dicomDataSync(); /** * 更新examItemName diff --git a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/service/patientexamlist/PatientexamlistServiceImpl.java b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/service/patientexamlist/PatientexamlistServiceImpl.java index 98138ffdf..1e5cf060d 100644 --- a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/service/patientexamlist/PatientexamlistServiceImpl.java +++ b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/service/patientexamlist/PatientexamlistServiceImpl.java @@ -90,16 +90,34 @@ public class PatientexamlistServiceImpl extends ServiceImpl getIllnessCasePage(IllnessCasePageReqVO pageReqVO) { + + //当前登陆用户 + AdminUserDO user = userService.getUser(getLoginUserId()); + + if (pageReqVO != null) { + pageReqVO.setOrgId(user.getOrgId()); + } + return patientexamlistMapper.selectPage(pageReqVO); } @Override public PageResult getReportPrintStatisticsPage(ReportPrintPageReqVO pageReqVO) { + + //当前登陆用户 + AdminUserDO user = userService.getUser(getLoginUserId()); + + if (pageReqVO != null) { + pageReqVO.setOrgId(user.getOrgId()); + } + return patientexamlistMapper.selectPage(pageReqVO); } @Override - public void dicomDataSync() { + public List dicomDataSync() { + + List _out = new ArrayList(); //当前登陆用户 AdminUserDO user = userService.getUser(getLoginUserId()); @@ -156,11 +174,15 @@ public class PatientexamlistServiceImpl extends ServiceImpl 0)) + _out = Collections.emptyList(); + return _out; } @Override @@ -240,7 +262,7 @@ public class PatientexamlistServiceImpl extends ServiceImpl