From 9ba3a31af1bfd7d003c6f4d3495c67a6d868b9a6 Mon Sep 17 00:00:00 2001 From: haown <454902499@qq.com> Date: Mon, 9 Oct 2023 14:35:08 +0800 Subject: [PATCH 1/3] =?UTF-8?q?update=3D=3D=3D>:=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=AD=9B=E6=9F=A5=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-dev.yml | 2 +- .../src/main/resources/application.yml | 2 +- .../common/core/domain/entity/SysUser.java | 15 ++++- .../AppletSchedulePlanController.java | 16 ------ .../AppletHospitalInfoController.java | 36 ++++++++++++ .../AppletSchedulePlanController.java | 35 ++++++++++++ .../ScreeningProjectController.java | 18 ++++-- .../ScreeningRecordController.java | 6 +- .../HospitalPersonInfo.java | 10 ++++ .../screeningproject/ScreeningProject.java | 4 +- .../screeningrecord/ScreeningRecord.java | 6 +- .../screeningrecord/ScreeningApplyDTO.java | 4 +- .../ScreeningRecordApplyDTO.java | 6 +- .../screeningrecord/ScreeningRecordDTO.java | 4 +- .../ScreeningProjectMapper.java | 2 +- .../impl/HospitalPersonInfoServiceImpl.java | 14 +++++ .../IScreeningProjectService.java | 2 +- .../impl/ScreeningProjectServiceImpl.java | 32 ++++++++--- .../IScreeningRecordService.java | 2 +- .../impl/ScreeningRecordServiceImpl.java | 55 +++++++++++++------ .../ScreeningProjectMapper.xml | 42 +++++++------- .../screeningrecord/ScreeningRecordMapper.xml | 40 +++++++------- .../resources/mapper/system/SysUserMapper.xml | 6 +- 23 files changed, 255 insertions(+), 104 deletions(-) delete mode 100644 xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/appletSchedulePlan/AppletSchedulePlanController.java create mode 100644 xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/applethospitalinfo/AppletHospitalInfoController.java create mode 100644 xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/appletscheduleplandetail/AppletSchedulePlanController.java diff --git a/xinelu-admin/src/main/resources/application-dev.yml b/xinelu-admin/src/main/resources/application-dev.yml index 7692824..d8b9065 100644 --- a/xinelu-admin/src/main/resources/application-dev.yml +++ b/xinelu-admin/src/main/resources/application-dev.yml @@ -6,7 +6,7 @@ spring: druid: # 主库数据源 master: - url: jdbc:mysql://101.200.89.70:8000/xinelu-database?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + url: jdbc:mysql://182.92.166.109:8000/xinelu-database?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 username: root password: 1qaz!@#$ # 从库数据源 diff --git a/xinelu-admin/src/main/resources/application.yml b/xinelu-admin/src/main/resources/application.yml index d5bd514..87ae67b 100644 --- a/xinelu-admin/src/main/resources/application.yml +++ b/xinelu-admin/src/main/resources/application.yml @@ -217,7 +217,7 @@ swagger: # 是否开启swagger enabled: true # 请求前缀 - pathMapping: /dev-api + pathMapping: # 防止XSS攻击 xss: diff --git a/xinelu-common/src/main/java/com/xinelu/common/core/domain/entity/SysUser.java b/xinelu-common/src/main/java/com/xinelu/common/core/domain/entity/SysUser.java index 6619c30..277d2ce 100644 --- a/xinelu-common/src/main/java/com/xinelu/common/core/domain/entity/SysUser.java +++ b/xinelu-common/src/main/java/com/xinelu/common/core/domain/entity/SysUser.java @@ -113,6 +113,11 @@ public class SysUser extends BaseEntity { */ private String stationPersonPassword; + /** + * 医生主键 + */ + private Long hospitalPersonId; + /** * 部门对象 */ @@ -334,7 +339,15 @@ public class SysUser extends BaseEntity { this.roleId = roleId; } - @Override + public Long getHospitalPersonId() { + return hospitalPersonId; + } + + public void setHospitalPersonId(Long hospitalPersonId) { + this.hospitalPersonId = hospitalPersonId; + } + + @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) .append("userId", getUserId()) diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/appletSchedulePlan/AppletSchedulePlanController.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/appletSchedulePlan/AppletSchedulePlanController.java deleted file mode 100644 index bfd2b25..0000000 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/appletSchedulePlan/AppletSchedulePlanController.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.xinelu.applet.controller.appletSchedulePlan; - -import io.swagger.annotations.Api; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * @description: 小程序医生排班计划控制器 - * @author: haown - * @create: 2023-09-22 10:28 - **/ -@Api(tags = "小程序医生排班计划控制器") -@RestController -@RequestMapping("/nurseApplet/schedule/plan") -public class AppletSchedulePlanController { -} diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/applethospitalinfo/AppletHospitalInfoController.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/applethospitalinfo/AppletHospitalInfoController.java new file mode 100644 index 0000000..676f190 --- /dev/null +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/applethospitalinfo/AppletHospitalInfoController.java @@ -0,0 +1,36 @@ +package com.xinelu.applet.controller.applethospitalinfo; + +import com.xinelu.common.core.controller.BaseController; +import com.xinelu.common.core.domain.AjaxResult; +import com.xinelu.manage.domain.hospitalinfo.HospitalInfo; +import com.xinelu.manage.service.hospitalinfo.IHospitalInfoService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import java.util.List; +import javax.annotation.Resource; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @description: 小程序医院信息管理控制器 + * @author: haown + * @create: 2023-10-09 11:06 + **/ +@Api(tags = "小程序医院信息管理控制器") +@RestController +@RequestMapping("/nurseApplet/hospital") +public class AppletHospitalInfoController extends BaseController { + @Resource + private IHospitalInfoService hospitalInfoService; + + /** + * 查询医院信息管理列表 + */ + @ApiOperation("查询医院信息管理列表") + @GetMapping("/getList") + public AjaxResult getList(HospitalInfo hospitalInfo) { + List list = hospitalInfoService.selectHospitalInfoList(hospitalInfo); + return AjaxResult.success(list); + } +} diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/appletscheduleplandetail/AppletSchedulePlanController.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/appletscheduleplandetail/AppletSchedulePlanController.java new file mode 100644 index 0000000..6454333 --- /dev/null +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/appletscheduleplandetail/AppletSchedulePlanController.java @@ -0,0 +1,35 @@ +package com.xinelu.applet.controller.appletscheduleplandetail; + +import com.xinelu.common.core.controller.BaseController; +import com.xinelu.common.core.domain.R; +import com.xinelu.manage.domain.scheduleplandetail.SchedulePlanDetail; +import com.xinelu.manage.service.scheduleplandetail.ISchedulePlanDetailService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import java.util.List; +import javax.annotation.Resource; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @description: 小程序医生排班计划控制器 + * @author: haown + * @create: 2023-09-22 10:28 + **/ +@Api(tags = "小程序医生排班计划控制器") +@RestController +@RequestMapping("/nurseApplet/schedule/plandetail") +public class AppletSchedulePlanController extends BaseController { + + @Resource + private ISchedulePlanDetailService planDetailService; + + @ApiOperation("通过排班计划查询明细") + @GetMapping("/getList") + public R> getList(SchedulePlanDetail planDetail) { + List list = planDetailService.getList(planDetail); + return R.ok(list); + } + +} diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/controller/screeningproject/ScreeningProjectController.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/controller/screeningproject/ScreeningProjectController.java index 8b522b4..281fe82 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/controller/screeningproject/ScreeningProjectController.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/controller/screeningproject/ScreeningProjectController.java @@ -3,8 +3,11 @@ package com.xinelu.manage.controller.screeningproject; import com.xinelu.common.core.controller.BaseController; import com.xinelu.common.core.domain.R; import com.xinelu.common.core.page.TableDataInfo; +import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.uuid.IdUtils; +import com.xinelu.manage.domain.hospitalpersoninfo.HospitalPersonInfo; import com.xinelu.manage.domain.screeningproject.ScreeningProject; +import com.xinelu.manage.service.hospitalpersoninfo.IHospitalPersonInfoService; import com.xinelu.manage.service.screeningproject.IScreeningProjectService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -35,6 +38,9 @@ public class ScreeningProjectController extends BaseController { @Resource private IScreeningProjectService projectService; + @Resource + private IHospitalPersonInfoService personInfoService; + @ApiOperation("服务项目分页列表") @GetMapping("list") public TableDataInfo list(ScreeningProject project) { @@ -53,8 +59,12 @@ public class ScreeningProjectController extends BaseController { @ApiOperation("新增服务项目") @PostMapping("add") public R add(@RequestBody ScreeningProject project) { - if (projectService.checkSameProjectName(project.getProjectName(), project.getDeptId(), null)) { - return R.fail("【" + project.getDeptName() + "】已存在服务项目【" + project.getProjectName() + "】,不能重复添加"); + // 根据当前登录用户获取医生主键 + HospitalPersonInfo hospitalPersonInfo = personInfoService.selectHospitalPersonInfoById(SecurityUtils.getLoginUser().getUser().getHospitalPersonId()); + project.setHospitalId(hospitalPersonInfo.getHospitalId()); + project.setHospitalName(hospitalPersonInfo.getPersonName()); + if (projectService.checkSameProjectName(project.getProjectName(), project.getHospitalId(), null)) { + return R.fail("【" + project.getHospitalName() + "】已存在服务项目【" + project.getProjectName() + "】,不能重复添加"); } //价格校验 if (Objects.isNull(project.getDiscount())) { @@ -83,8 +93,8 @@ public class ScreeningProjectController extends BaseController { @ApiOperation("修改服务项目") @PostMapping("update") public R update(@RequestBody ScreeningProject project) { - if (projectService.checkSameProjectName(project.getProjectName(), project.getDeptId(), project.getProjectId())) { - return R.fail("【" + project.getDeptName() + "】已存在服务项目【" + project.getProjectName() + "】,不能重复添加"); + if (projectService.checkSameProjectName(project.getProjectName(), project.getHospitalId(), project.getProjectId())) { + return R.fail("【" + project.getHospitalName() + "】已存在服务项目【" + project.getProjectName() + "】,不能重复添加"); } //价格校验 if (Objects.isNull(project.getDiscount())) { diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/controller/screeningrecord/ScreeningRecordController.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/controller/screeningrecord/ScreeningRecordController.java index 9f557d8..b2998e3 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/controller/screeningrecord/ScreeningRecordController.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/controller/screeningrecord/ScreeningRecordController.java @@ -44,7 +44,11 @@ public class ScreeningRecordController extends BaseController { @ApiOperation(value = "居民预约筛查列表") public TableDataInfo screeningList(ScreeningRecordDTO query) { startPage(); - return getDataTable(screeningRecordService.screeningList(query)); + try { + return getDataTable(screeningRecordService.screeningList(query)); + } catch (Exception e) { + throw new RuntimeException(e); + } } @GetMapping("/list") diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/hospitalpersoninfo/HospitalPersonInfo.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/hospitalpersoninfo/HospitalPersonInfo.java index 4464765..10058c9 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/hospitalpersoninfo/HospitalPersonInfo.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/hospitalpersoninfo/HospitalPersonInfo.java @@ -128,6 +128,16 @@ public class HospitalPersonInfo extends BaseDomain implements Serializable { */ private String personPictureUrl; + /** + * 科室人员账号 + */ + private String personAccount; + + /** + * 科室人员密码 + */ + private String personPassword; + @Override public String toString() { diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/screeningproject/ScreeningProject.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/screeningproject/ScreeningProject.java index 3ace40c..4aa2fe8 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/screeningproject/ScreeningProject.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/screeningproject/ScreeningProject.java @@ -60,13 +60,13 @@ public class ScreeningProject extends BaseEntity { * 医院编号 */ @ApiModelProperty("医院编号") - private String deptId; + private Long hospitalId; /** * 医院名称 */ @ApiModelProperty("医院名称") - private String deptName; + private String hospitalName; /** * 删除标识(0:存在,1:已删除) diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/screeningrecord/ScreeningRecord.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/screeningrecord/ScreeningRecord.java index d1e9a1f..f15bc77 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/screeningrecord/ScreeningRecord.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/screeningrecord/ScreeningRecord.java @@ -49,12 +49,12 @@ public class ScreeningRecord implements Serializable { /** * 医院编号 */ - private String deptId; + private Long hospitalId; /** * 医院名称 */ - private String deptName; + private String hospitalName; /** * 预约项目业务主键 @@ -108,7 +108,7 @@ public class ScreeningRecord implements Serializable { * 医生编号 */ @ApiModelProperty("医生编号") - private String doctorId; + private Long doctorId; /** * 医生名称 diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/dto/screeningrecord/ScreeningApplyDTO.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/dto/screeningrecord/ScreeningApplyDTO.java index 2da296b..96a4cbe 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/dto/screeningrecord/ScreeningApplyDTO.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/dto/screeningrecord/ScreeningApplyDTO.java @@ -43,10 +43,10 @@ public class ScreeningApplyDTO implements Serializable { private Date applyEndTime; @ApiModelProperty(value = "预约机构业务主键", required = true) - private String deptId; + private Long hospitalId; @ApiModelProperty(value = "预约机构名称", required = true) - private String deptName; + private String hospitalName; @ApiModelProperty(value = "预约项目业务主键", required = true) private String projectId; diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/dto/screeningrecord/ScreeningRecordApplyDTO.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/dto/screeningrecord/ScreeningRecordApplyDTO.java index 9cd1d32..863c4ab 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/dto/screeningrecord/ScreeningRecordApplyDTO.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/dto/screeningrecord/ScreeningRecordApplyDTO.java @@ -52,13 +52,13 @@ public class ScreeningRecordApplyDTO implements Serializable { * 医院编号 */ @ApiModelProperty("医院编号") - private String deptId; + private Long hospitalId; /** * 医院名称 */ @ApiModelProperty("医院名称") - private String deptName; + private String hospitalName; @ApiModelProperty("项目业务主键") private String projectId; @@ -87,7 +87,7 @@ public class ScreeningRecordApplyDTO implements Serializable { * 医生编号 */ @ApiModelProperty("医生编号") - private String doctorId; + private Long doctorId; /** * 医生名称 diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/dto/screeningrecord/ScreeningRecordDTO.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/dto/screeningrecord/ScreeningRecordDTO.java index 0bb08eb..e863494 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/dto/screeningrecord/ScreeningRecordDTO.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/dto/screeningrecord/ScreeningRecordDTO.java @@ -52,13 +52,13 @@ public class ScreeningRecordDTO extends BaseEntity { * 医院编号 */ @ApiModelProperty("医院编号") - private String deptId; + private Long hospitalId; /** * 医院名称 */ @ApiModelProperty("医院名称") - private String deptName; + private String hospitalName; @ApiModelProperty("预约项目业务主键") private String projectId; diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/mapper/screeningproject/ScreeningProjectMapper.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/mapper/screeningproject/ScreeningProjectMapper.java index 59a5e26..d751d01 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/mapper/screeningproject/ScreeningProjectMapper.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/mapper/screeningproject/ScreeningProjectMapper.java @@ -26,6 +26,6 @@ public interface ScreeningProjectMapper { int updateByPrimaryKey(ScreeningProject record); - Integer checkSameName(@Param("projectName") String projectName, @Param("deptId") String deptId, @Param("projectId") String projectId); + Integer checkSameName(@Param("projectName") String projectName, @Param("deptId") Long deptId, @Param("projectId") String projectId); } diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/hospitalpersoninfo/impl/HospitalPersonInfoServiceImpl.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/hospitalpersoninfo/impl/HospitalPersonInfoServiceImpl.java index 61937c4..c55a4fe 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/hospitalpersoninfo/impl/HospitalPersonInfoServiceImpl.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/hospitalpersoninfo/impl/HospitalPersonInfoServiceImpl.java @@ -3,6 +3,7 @@ package com.xinelu.manage.service.hospitalpersoninfo.impl; import com.xinelu.common.config.XinELuConfig; import com.xinelu.common.constant.Constants; import com.xinelu.common.core.domain.AjaxResult; +import com.xinelu.common.core.domain.entity.SysUser; import com.xinelu.common.exception.ServiceException; import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.codes.GenerateSystemCodeUtil; @@ -14,6 +15,7 @@ import com.xinelu.manage.mapper.hospitalpersoncertificate.HospitalPersonCertific import com.xinelu.manage.mapper.hospitalpersoninfo.HospitalPersonInfoMapper; import com.xinelu.manage.service.hospitalpersoninfo.IHospitalPersonInfoService; import com.xinelu.manage.vo.hospitalpersoninfo.HospitalPersonInfoVO; +import com.xinelu.system.mapper.SysUserMapper; import java.io.File; import java.math.BigDecimal; import java.time.LocalDateTime; @@ -48,6 +50,9 @@ public class HospitalPersonInfoServiceImpl implements IHospitalPersonInfoService @Resource private HospitalPersonCertificateMapper hospitalPersonCertificateMapper; + @Resource + private SysUserMapper userMapper; + /** * 查询健康咨询-科室人员信息 * @@ -126,6 +131,15 @@ public class HospitalPersonInfoServiceImpl implements IHospitalPersonInfoService throw new ServiceException("新增科室人员资质证书信息失败,请联系管理员!"); } } + // 保存到sys_user表 + SysUser sysUser = new SysUser(); + sysUser.setUserName(hospitalPersonInfo.getPersonAccount()); + sysUser.setPassword(SecurityUtils.encryptPassword(hospitalPersonInfo.getPersonPassword())); + sysUser.setNickName(hospitalPersonInfo.getPersonName()); + sysUser.setHospitalPersonId(hospitalPersonInfo.getId()); + sysUser.setStatus("0"); + sysUser.setDelFlag("0"); + userMapper.insertUser(sysUser); return AjaxResult.success(); } diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/screeningproject/IScreeningProjectService.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/screeningproject/IScreeningProjectService.java index 74f2491..67d0106 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/screeningproject/IScreeningProjectService.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/screeningproject/IScreeningProjectService.java @@ -27,5 +27,5 @@ public interface IScreeningProjectService { * @author gaoyu * @date 2022-11-23 10:20 */ - boolean checkSameProjectName(String projectName, String deptId, String projectId); + boolean checkSameProjectName(String projectName, Long deptId, String projectId); } diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/screeningproject/impl/ScreeningProjectServiceImpl.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/screeningproject/impl/ScreeningProjectServiceImpl.java index 727f5a3..7920898 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/screeningproject/impl/ScreeningProjectServiceImpl.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/screeningproject/impl/ScreeningProjectServiceImpl.java @@ -1,9 +1,13 @@ package com.xinelu.manage.service.screeningproject.impl; +import com.xinelu.common.utils.SecurityUtils; +import com.xinelu.manage.domain.hospitalinfo.HospitalInfo; +import com.xinelu.manage.domain.hospitalpersoninfo.HospitalPersonInfo; import com.xinelu.manage.domain.screeningproject.ScreeningProject; +import com.xinelu.manage.mapper.hospitalinfo.HospitalInfoMapper; +import com.xinelu.manage.mapper.hospitalpersoninfo.HospitalPersonInfoMapper; import com.xinelu.manage.mapper.screeningproject.ScreeningProjectMapper; import com.xinelu.manage.service.screeningproject.IScreeningProjectService; -import com.xinelu.system.mapper.SysDeptMapper; import java.util.List; import javax.annotation.Resource; import org.springframework.stereotype.Service; @@ -19,22 +23,36 @@ public class ScreeningProjectServiceImpl implements IScreeningProjectService { @Resource private ScreeningProjectMapper projectMapper; @Resource - private SysDeptMapper deptMapper; + private HospitalPersonInfoMapper hospitalPersonInfoMapper; + @Resource + private HospitalInfoMapper hospitalInfoMapper; @Override public List findList(ScreeningProject project) { return projectMapper.findList(project); } @Override public int insert(ScreeningProject project) { - // TODO 设置机构 - // project.setDeptName(deptMapper.selectDeptById(project.getDeptId()).getDeptName()); + HospitalPersonInfo hospitalPersonInfo = hospitalPersonInfoMapper.selectHospitalPersonInfoById(SecurityUtils.getLoginUser().getUser().getHospitalPersonId()); + if (hospitalPersonInfo != null) { + project.setHospitalId(hospitalPersonInfo.getHospitalId()); + HospitalInfo hospital = hospitalInfoMapper.selectHospitalInfoById(hospitalPersonInfo.getHospitalId()); + if (hospital != null) { + project.setHospitalName(hospital.getHospitalName()); + } + } return projectMapper.insertSelective(project); } @Override public int update(ScreeningProject project) { - // TODO 设置机构 - // project.setDeptName(deptMapper.selectDeptById(project.getDeptId()).getDeptName()); + HospitalPersonInfo hospitalPersonInfo = hospitalPersonInfoMapper.selectHospitalPersonInfoById(SecurityUtils.getLoginUser().getUser().getHospitalPersonId()); + if (hospitalPersonInfo != null) { + project.setHospitalId(hospitalPersonInfo.getHospitalId()); + HospitalInfo hospital = hospitalInfoMapper.selectHospitalInfoById(hospitalPersonInfo.getHospitalId()); + if (hospital != null) { + project.setHospitalName(hospital.getHospitalName()); + } + } return projectMapper.updateByPrimaryKey(project); } @@ -42,7 +60,7 @@ public class ScreeningProjectServiceImpl implements IScreeningProjectService { projectMapper.updateByPrimaryKeySelective(project); } - @Override public boolean checkSameProjectName(String projectName, String deptId, String projectId) { + @Override public boolean checkSameProjectName(String projectName, Long deptId, String projectId) { return projectMapper.checkSameName(projectName, deptId, projectId) != null; } } diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/screeningrecord/IScreeningRecordService.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/screeningrecord/IScreeningRecordService.java index 1af4a80..a5184ec 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/screeningrecord/IScreeningRecordService.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/screeningrecord/IScreeningRecordService.java @@ -16,7 +16,7 @@ import java.util.List; */ public interface IScreeningRecordService { - List screeningList(ScreeningRecordDTO query); + List screeningList(ScreeningRecordDTO query) throws Exception; /** * @Author mengkuiliang diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/screeningrecord/impl/ScreeningRecordServiceImpl.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/screeningrecord/impl/ScreeningRecordServiceImpl.java index 9d47249..88e5817 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/screeningrecord/impl/ScreeningRecordServiceImpl.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/screeningrecord/impl/ScreeningRecordServiceImpl.java @@ -10,12 +10,16 @@ import com.xinelu.common.utils.DateUtils; import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.bean.BeanUtils; import com.xinelu.common.utils.uuid.IdUtils; +import com.xinelu.manage.domain.hospitalinfo.HospitalInfo; +import com.xinelu.manage.domain.hospitalpersoninfo.HospitalPersonInfo; import com.xinelu.manage.domain.screeningproject.ScreeningProject; import com.xinelu.manage.domain.screeningrecord.ScreeningRecord; import com.xinelu.manage.dto.screeningrecord.ScreeningApplyDTO; import com.xinelu.manage.dto.screeningrecord.ScreeningRecordApplyDTO; import com.xinelu.manage.dto.screeningrecord.ScreeningRecordDTO; import com.xinelu.manage.dto.screeningrecord.ScreeningRecordSaveDTO; +import com.xinelu.manage.mapper.hospitalinfo.HospitalInfoMapper; +import com.xinelu.manage.mapper.hospitalpersoninfo.HospitalPersonInfoMapper; import com.xinelu.manage.mapper.screeningrecord.ScreeningRecordMapper; import com.xinelu.manage.service.patientinfo.IPatientInfoService; import com.xinelu.manage.service.screeningrecord.IScreeningRecordService; @@ -45,13 +49,19 @@ public class ScreeningRecordServiceImpl implements IScreeningRecordService { private ScreeningRecordMapper screeningRecordMapper; @Resource private IPatientInfoService patientService; - //@Resource - //private IScreeningProjectRecordService projectRecordService; + @Resource + private HospitalPersonInfoMapper hospitalPersonInfoMapper; + @Resource + private HospitalInfoMapper hospitalInfoMapper; @Override - public List screeningList(ScreeningRecordDTO query) { - // TODO 通过机构查询 - // query.setDeptId(SecurityUtils.getDeptId()); + public List screeningList(ScreeningRecordDTO query) throws Exception { + HospitalPersonInfo hospitalPersonInfo = hospitalPersonInfoMapper.selectHospitalPersonInfoById(SecurityUtils.getLoginUser().getUser().getHospitalPersonId()); + if (hospitalPersonInfo != null) { + query.setHospitalId(hospitalPersonInfo.getHospitalId()); + } else { + throw new Exception("该账号未关联医生"); + } return screeningRecordMapper.screeningList(query); } @@ -97,7 +107,7 @@ public class ScreeningRecordServiceImpl implements IScreeningRecordService { // 查询 同一机构的同一筛查项目在同一天是否有预约 ScreeningRecordDTO query = new ScreeningRecordDTO(); query.setPatientId(body.getPatientId()); - query.setDeptId(body.getDeptId()); + query.setHospitalId(body.getHospitalId()); query.setProjectId(body.getProjectId()); query.setApplyStartDate(body.getApplyStartTime()); query.setApplyEndDate(body.getApplyEndTime()); @@ -136,9 +146,17 @@ public class ScreeningRecordServiceImpl implements IScreeningRecordService { @Override public Integer update(ScreeningRecord body) { - // TODO 用户id - //body.setDoctorId(SecurityUtils.getUserId()); - body.setDeptName(SecurityUtils.getLoginUser().getUser().getDept().getDeptName()); + HospitalPersonInfo hospitalPersonInfo = hospitalPersonInfoMapper.selectHospitalPersonInfoById(SecurityUtils.getLoginUser().getUser().getHospitalPersonId()); + if (hospitalPersonInfo != null) { + body.setDoctorId(hospitalPersonInfo.getId()); + body.setDoctorName(hospitalPersonInfo.getPersonName()); + HospitalInfo hospitalInfo = hospitalInfoMapper.selectHospitalInfoById(hospitalPersonInfo.getHospitalId()); + if (hospitalInfo != null) { + body.setHospitalId(hospitalInfo.getId()); + body.setHospitalName(hospitalInfo.getHospitalName()); + } + } + body.setScreeningStatus("4"); body.setScreeningDate(new Date()); int flag = screeningRecordMapper.update(body); @@ -192,8 +210,7 @@ public class ScreeningRecordServiceImpl implements IScreeningRecordService { if (StringUtils.equals("3", screeningRecord.getScreeningStatus()) || StringUtils.equals("4", screeningRecord.getScreeningStatus())) { throw new Exception("该预约已登记,请勿重复登记。"); } - // TODO 当前登录用户id - //screeningRecord.setDoctorId(loginUser.getUserId()); + screeningRecord.setDoctorId(loginUser.getUser().getHospitalPersonId()); screeningRecord.setDoctorName(loginUser.getUser().getNickName()); screeningRecord.setRegistrationDate(new Date()); screeningRecord.setScreeningStatus("3"); @@ -320,12 +337,18 @@ public class ScreeningRecordServiceImpl implements IScreeningRecordService { screeningRecord.setProjectId(project.getProjectId()); screeningRecord.setProjectName(project.getProjectName()); screeningRecord.setPatientId(body.getPatientId()); - // TODO 用户id - //screeningRecord.setDoctorId(SecurityUtils.getUserId()); + screeningRecord.setDoctorId(SecurityUtils.getLoginUser().getUser().getHospitalPersonId()); screeningRecord.setDoctorName(SecurityUtils.getLoginUser().getUser().getNickName()); - // TODO 机构id - //screeningRecord.setDeptId(SecurityUtils.getDeptId()); - screeningRecord.setDeptName(SecurityUtils.getLoginUser().getUser().getDept().getDeptName()); + HospitalPersonInfo hospitalPersonInfo = hospitalPersonInfoMapper.selectHospitalPersonInfoById(SecurityUtils.getLoginUser().getUser().getHospitalPersonId()); + if (hospitalPersonInfo == null) { + throw new Exception("当前用户未绑定医生账号"); + } else { + HospitalInfo hospitalInfo = hospitalInfoMapper.selectHospitalInfoById(hospitalPersonInfo.getHospitalId()); + if (hospitalInfo != null) { + screeningRecord.setHospitalId(hospitalInfo.getId()); + screeningRecord.setHospitalName(hospitalInfo.getHospitalName()); + } + } screeningRecord.setScreeningStatus("1"); screeningRecord.setScreeningType("2"); screeningRecord.setApplyStartTime(new Date()); diff --git a/xinelu-nurse-manage/src/main/resources/mapper/manage/screeningproject/ScreeningProjectMapper.xml b/xinelu-nurse-manage/src/main/resources/mapper/manage/screeningproject/ScreeningProjectMapper.xml index a792e38..ea8b668 100644 --- a/xinelu-nurse-manage/src/main/resources/mapper/manage/screeningproject/ScreeningProjectMapper.xml +++ b/xinelu-nurse-manage/src/main/resources/mapper/manage/screeningproject/ScreeningProjectMapper.xml @@ -13,8 +13,8 @@ - - + + @@ -26,8 +26,8 @@ id,project_id,project_name, project_type,price,discount, - discount_price,status,dept_id, - dept_name,create_by,create_time, + discount_price,status,hospital_id, + hospital_name,create_by,create_time, update_by,update_time,del_flag, remark @@ -39,8 +39,8 @@ and project_name like concat( '%' ,#{projectName}, '%') - - and dept_id = #{deptId} + + and hospital_id = #{hospitalId} and project_type = #{projectType} @@ -69,14 +69,14 @@ insert into screening_project ( id,project_id,project_name ,project_type,price,discount - ,discount_price,status,dept_id - ,dept_name,create_by,create_time + ,discount_price,status,hospital_id + ,hospital_name,create_by,create_time ,update_by,update_time,del_flag ,remark) values (#{id,jdbcType=BIGINT},#{projectId,jdbcType=VARCHAR},#{projectName,jdbcType=VARCHAR} ,#{projectType,jdbcType=CHAR},#{price,jdbcType=DECIMAL},#{discount,jdbcType=INTEGER} - ,#{discountPrice,jdbcType=VARCHAR},#{status,jdbcType=CHAR},#{deptId,jdbcType=VARCHAR} - ,#{deptName,jdbcType=VARCHAR},#{createBy,jdbcType=VARCHAR},#{createTime,jdbcType=DATE} + ,#{discountPrice,jdbcType=VARCHAR},#{status,jdbcType=CHAR},#{hospitalId,jdbcType=BIGINT} + ,#{hospitalName,jdbcType=VARCHAR},#{createBy,jdbcType=VARCHAR},#{createTime,jdbcType=DATE} ,#{updateBy,jdbcType=VARCHAR},#{updateTime,jdbcType=DATE},#{delFlag,jdbcType=CHAR} ,#{remark,jdbcType=VARCHAR}) @@ -91,8 +91,8 @@ discount, discount_price, status, - dept_id, - dept_name, + hospital_id, + hospital_name, create_by, create_time, update_by, @@ -109,8 +109,8 @@ #{discount,jdbcType=INTEGER}, #{discountPrice,jdbcType=DECIMAL}, #{status,jdbcType=CHAR}, - #{deptId,jdbcType=VARCHAR}, - #{deptName,jdbcType=VARCHAR}, + #{hospitalId,jdbcType=BIGINT}, + #{hospitalName,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=DATE}, #{updateBy,jdbcType=VARCHAR}, @@ -140,11 +140,11 @@ status = #{status,jdbcType=CHAR}, - - dept_id = #{deptId,jdbcType=VARCHAR}, + + hospital_id = #{hospitalId,jdbcType=BIGINT}, - - dept_name = #{deptName,jdbcType=VARCHAR}, + + hospital_name = #{hospitalName,jdbcType=VARCHAR}, create_by = #{createBy,jdbcType=VARCHAR}, @@ -176,8 +176,8 @@ discount = #{discount,jdbcType=INTEGER}, discount_price = #{discountPrice,jdbcType=VARCHAR}, status = #{status,jdbcType=CHAR}, - dept_id = #{deptId,jdbcType=VARCHAR}, - dept_name = #{deptName,jdbcType=VARCHAR}, + hospital_id = #{hospitalId,jdbcType=BIGINT}, + hospital_name = #{hospitalName,jdbcType=VARCHAR}, create_by = #{createBy,jdbcType=VARCHAR}, create_time = #{createTime,jdbcType=DATE}, update_by = #{updateBy,jdbcType=VARCHAR}, @@ -187,7 +187,7 @@ where project_id = #{projectId,jdbcType=VARCHAR} select r.resident_name,r.gender,r.birthday,r.phone,r.`identity` ,r.manage_status,r.manage_time,d.screening_id,d.patient_id,d.project_id,d.project_name - ,d.dept_id,d.dept_name,d.apply_start_time,d.apply_end_time, + ,d.hospital_id,d.hospita_name,d.apply_start_time,d.apply_end_time, d.diagnostic_result,d.attachment,d.attachment_two, d.registration_date,d.registration_code, d.registration_barcode,d.screening_type,d.push_date, case when date_format(apply_end_time, '%y%m%d%H%i') < date_format(now(), '%y%m%d%H%i') then '1' @@ -240,11 +240,11 @@ and r.address like concat('%', #{address}, '%') - - and d.dept_id = #{deptId} + + and d.hospital_id = #{hospitalId} - - and d.dept_name = #{deptName} + + and d.hospita_name = #{hospitalName} and d.project_id = #{projectId} @@ -318,7 +318,7 @@ select r.resident_name,r.gender,r.birthday,r.phone,r.`identity` ,r.manage_status,r.manage_time,d.screening_id,d.patient_id,d.project_id,d.project_name - ,d.hospital_id,d.hospita_name,d.apply_start_time,d.apply_end_time, + ,d.hospital_id,d.hospital_name,d.apply_start_time,d.apply_end_time, d.diagnostic_result,d.attachment,d.attachment_two, d.registration_date,d.registration_code, d.registration_barcode,d.screening_type,d.push_date, case when date_format(apply_end_time, '%y%m%d%H%i') < date_format(now(), '%y%m%d%H%i') then '1' @@ -244,7 +244,7 @@ and d.hospital_id = #{hospitalId} - and d.hospita_name = #{hospitalName} + and d.hospital_name = #{hospitalName} and d.project_id = #{projectId} @@ -318,7 +318,7 @@