Kaynağa Gözat

实现患者新增和患者列表查询功能

zhouzeyu 5 gün önce
ebeveyn
işleme
10a2bf25b5
35 değiştirilmiş dosya ile 446 ekleme ve 81 silme
  1. 1 2
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/oauth2/controller/AccountController.java
  2. 1 1
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/sms/service/impl/SmsSendServiceImpl.java
  3. 8 3
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/user/controller/SysRoleController.java
  4. 15 2
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/user/controller/SysUserController.java
  5. 2 2
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/user/dto/SysRoleAddDTO.java
  6. 2 2
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/user/dto/SysRoleEditDTO.java
  7. 1 0
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/user/dto/SysRoleQueryDTO.java
  8. 1 1
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/user/provider/SysUserNickNameProvider.java
  9. 2 0
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/user/service/ISysRoleService.java
  10. 3 1
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/user/service/ISysUserService.java
  11. 0 2
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/user/service/impl/SysMenuServiceImpl.java
  12. 8 0
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/user/service/impl/SysRoleServiceImpl.java
  13. 10 0
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/user/service/impl/SysUserServiceImpl.java
  14. 1 1
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/wx/controller/WxMaLoginController.java
  15. 8 4
      tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/controller/BusClinicController.java
  16. 8 0
      tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/controller/BusTherapyPlanController.java
  17. 35 25
      tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/dto/BusClinicAddDTO.java
  18. 0 4
      tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/dto/BusClinicDTO.java
  19. 57 0
      tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/dto/BusTherapyPlanAddDTO.java
  20. 5 0
      tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/dto/BusTherapyPlanDTO.java
  21. 19 0
      tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/enums/GroupTypeEnum.java
  22. 9 9
      tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/enums/PatientGenderEnum.java
  23. 66 0
      tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/enums/PhaseDayEnum.java
  24. 41 0
      tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/enums/TherapyPlanNameEnum.java
  25. 3 0
      tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/mapper/BusClinicMapper.java
  26. 0 4
      tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/po/BusClinicPO.java
  27. 10 0
      tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/po/BusTherapyPlanPO.java
  28. 3 4
      tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/service/IBusClinicService.java
  29. 10 0
      tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/service/IBusTherapyPlanService.java
  30. 60 4
      tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/service/impl/BusClinicServiceImpl.java
  31. 45 0
      tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/service/impl/BusTherapyPlanServiceImpl.java
  32. 8 7
      tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/vo/PatientTherapyRecordVO.java
  33. 2 2
      tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/web/auth/WebAccountOperator.java
  34. 1 1
      tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/web/auth/WebAuthGranter.java
  35. 1 0
      tr-modules/tr-modules-phototherapy/src/main/resources/mapper/phototherapy/BusClinicRepository.xml

+ 1 - 2
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/oauth2/controller/AccountController.java

@@ -1,7 +1,6 @@
 package cn.tr.module.sys.oauth2.controller;
 
-import cn.tr.core.exception.ServiceException;
-import cn.tr.core.exception.TRExcCode;
+
 import cn.tr.core.pojo.CommonResult;
 import cn.tr.core.pojo.LoginUser;
 import cn.tr.module.common.annotation.Log;

+ 1 - 1
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/sms/service/impl/SmsSendServiceImpl.java

@@ -15,7 +15,7 @@ import cn.tr.module.sys.sms.service.ISysSmsChannelService;
 import cn.tr.module.sys.sms.service.ISysSmsLogService;
 import cn.tr.module.sys.sms.service.ISysSmsTempService;
 import cn.tr.module.sys.user.dto.SysUserDTO;
-import cn.tr.module.sys.user.service.impl.ISysUserService;
+import cn.tr.module.sys.user.service.ISysUserService;
 import cn.tr.plugin.sms.bo.SmsCommonResult;
 import cn.tr.plugin.sms.bo.SmsReceiveRespBO;
 import cn.tr.plugin.sms.bo.SmsSendRespBO;

+ 8 - 3
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/user/controller/SysRoleController.java

@@ -1,7 +1,9 @@
 package cn.tr.module.sys.user.controller;
 
 import cn.dev33.satoken.annotation.SaCheckPermission;
+import cn.tr.core.context.BaseController;
 import cn.tr.core.pojo.CommonResult;
+import cn.tr.core.pojo.TableDataInfo;
 import cn.tr.module.common.utils.ExcelUtil;
 import cn.tr.module.sys.user.dto.SysRoleAddDTO;
 import cn.tr.module.sys.user.dto.SysRoleAssignMenuDTO;
@@ -13,11 +15,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import cn.tr.module.common.annotation.Log;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
+import net.sf.jsqlparser.schema.Table;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
 import jakarta.annotation.Resource;
 
+
 /**
  * <p>
  * 角色表 前端控制器
@@ -29,7 +33,7 @@ import jakarta.annotation.Resource;
 @Tag(name = "角色管理")
 @RestController
 @RequestMapping("/sys/role")
-public class SysRoleController {
+public class SysRoleController extends BaseController {
 
     @Resource
     private ISysRoleService sysRoleService;
@@ -40,8 +44,9 @@ public class SysRoleController {
     @Operation(summary = "角色管理分页查询")
     @GetMapping("/page")
     @SaCheckPermission("system:sysRole:page")
-    public CommonResult page(Page reqPage, SysRoleQueryDTO req) {
-        return CommonResult.success(sysRoleService.page(reqPage, req));
+    public TableDataInfo<SysRolePO> page( SysRoleQueryDTO req) {
+        startPage();
+        return getDataTable(sysRoleService.selectRoleList(req));
     }
 
     /**

+ 15 - 2
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/user/controller/SysUserController.java

@@ -2,6 +2,7 @@ package cn.tr.module.sys.user.controller;
 
 import cn.dev33.satoken.annotation.SaCheckPermission;
 import cn.tr.core.pojo.CommonResult;
+import cn.tr.module.common.annotation.Log;
 import cn.tr.module.common.utils.ExcelUtil;
 import cn.tr.module.sys.exception.CustomException;
 import cn.tr.module.sys.oauth2.utils.SecurityUtil;
@@ -10,16 +11,17 @@ import cn.tr.module.sys.user.dto.SysUserEditDTO;
 import cn.tr.module.sys.user.dto.SysUserQueryDTO;
 import cn.tr.module.sys.user.dto.SysUserResetPwdDTO;
 import cn.tr.module.sys.user.po.SysUserPO;
-import cn.tr.module.sys.user.service.impl.ISysUserService;
+import cn.tr.module.sys.user.service.ISysUserService;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
-import cn.tr.module.common.annotation.Log;
 
 import jakarta.annotation.Resource;
 
+import java.util.List;
+
 /**
  * <p>
  * 用户表 前端控制器
@@ -114,5 +116,16 @@ public class SysUserController {
         return CommonResult.success();
     }
 
+
+    @Log(title = "获取所有医生下拉列表")
+    @Operation(summary = "获取所有医生下拉列表")
+    @PostMapping("/getDoctorOptions")
+    public CommonResult<List<SysUserPO>> getDoctorOptions() {
+        List<SysUserPO> doctorOptions = sysUserService.listDoctorOptions();
+        return CommonResult.success(doctorOptions);
+    }
+
+
+
 }
 

+ 2 - 2
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/user/dto/SysRoleAddDTO.java

@@ -43,7 +43,7 @@ public class SysRoleAddDTO implements Serializable {
     /**
      * 数据范围 1全部数据权限;2自定数据权限;3本部门数据权限;4本部门及以下数据权限
      */
-    @NotBlank(message = "数据范围不能为空")
+//    @NotBlank(message = "数据范围不能为空")
     private String dataScope;
 
     /**
@@ -55,7 +55,7 @@ public class SysRoleAddDTO implements Serializable {
     /**
      * 排序
      */
-    @NotNull(message = "排序不能为空")
+//    @NotNull(message = "排序不能为空")
     private Integer sort;
 
     /**

+ 2 - 2
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/user/dto/SysRoleEditDTO.java

@@ -44,7 +44,7 @@ public class SysRoleEditDTO implements Serializable {
     /**
      * 数据范围 1全部数据权限;2自定数据权限;3本部门数据权限;4本部门及以下数据权限
      */
-    @NotBlank(message = "数据范围不能为空")
+//    @NotBlank(message = "数据范围不能为空")
     private String dataScope;
 
     /**
@@ -56,7 +56,7 @@ public class SysRoleEditDTO implements Serializable {
     /**
      * 排序
      */
-    @NotNull(message = "排序不能为空")
+//    @NotNull(message = "排序不能为空")
     private Integer sort;
 
     /**

+ 1 - 0
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/user/dto/SysRoleQueryDTO.java

@@ -1,6 +1,7 @@
 package cn.tr.module.sys.user.dto;
 
 import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.Min;
 import jakarta.validation.constraints.NotNull;
 import lombok.Data;
 

+ 1 - 1
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/user/provider/SysUserNickNameProvider.java

@@ -4,7 +4,7 @@
 //import cn.tr.core.utils.UserUtil;
 //import cn.tr.module.api.sys.user.SysUserApi;
 //import cn.tr.module.sys.oauth2.service.CurrentUserService;
-//import cn.tr.module.sys.user.service.impl.ISysUserService;
+//import cn.tr.module.sys.user.service.ISysUserService;
 //import jakarta.annotation.PostConstruct;
 //import lombok.AllArgsConstructor;
 //import org.springframework.stereotype.Component;

+ 2 - 0
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/user/service/ISysRoleService.java

@@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 
+import java.util.Collection;
 import java.util.List;
 
 /**
@@ -117,4 +118,5 @@ public interface ISysRoleService extends IService<SysRolePO> {
      */
     List<SysRolePO> selectOptions();
 
+    List<SysRolePO> selectRoleList(SysRoleQueryDTO req);
 }

+ 3 - 1
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/user/service/impl/ISysUserService.java → tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/user/service/ISysUserService.java

@@ -1,4 +1,4 @@
-package cn.tr.module.sys.user.service.impl;
+package cn.tr.module.sys.user.service;
 
 import cn.tr.module.sys.user.dto.*;
 import cn.tr.module.sys.user.po.SysUserPO;
@@ -71,4 +71,6 @@ public interface ISysUserService extends IService<SysUserPO> {
     void resetPwd(SysUserResetPwdDTO<Long> req);
 
     SysUserDTO selectSysUserById(String userId);
+
+    List<SysUserPO> listDoctorOptions();
 }

+ 0 - 2
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/user/service/impl/SysMenuServiceImpl.java

@@ -14,7 +14,6 @@ import cn.tr.module.sys.exception.CustomException;
 import cn.tr.module.sys.user.dto.SysMenuAddDTO;
 import cn.tr.module.sys.user.dto.SysMenuEditDTO;
 import cn.tr.module.sys.user.dto.SysMenuQueryDTO;
-import cn.tr.module.sys.user.dto.SysUserDTO;
 import cn.tr.module.sys.user.po.*;
 import cn.tr.module.sys.user.repository.SysMenuRepository;
 import cn.tr.module.sys.user.service.*;
@@ -33,7 +32,6 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 
-import jakarta.annotation.Resource;
 import java.util.*;
 import java.util.stream.Collectors;
 

+ 8 - 0
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/user/service/impl/SysRoleServiceImpl.java

@@ -284,4 +284,12 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleRepository, SysRolePO
         return Objects.isNull(entity) || entity.getId().longValue() == id.longValue();
     }
 
+    @Override
+    public List<SysRolePO> selectRoleList(SysRoleQueryDTO req) {
+        return this.list(Wrappers.lambdaQuery(SysRolePO.class)
+                .eq(SysRolePO::getStatus,String.valueOf(StatusEnum.YES.getValue()))
+                .like(StrUtil.isNotBlank(req.getRoleName()),SysRolePO::getRoleName, req.getRoleName())
+                .like(StrUtil.isNotBlank(req.getRoleCode()),SysRolePO::getRoleCode, req.getRoleCode())
+                .orderByAsc(SysRolePO::getSort));
+    }
 }

+ 10 - 0
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/user/service/impl/SysUserServiceImpl.java

@@ -278,6 +278,16 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserRepository, SysUserPO
         return BeanUtil.copyProperties(byId, SysUserDTO.class);
     }
 
+    @Override
+    public List<SysUserPO> listDoctorOptions() {
+        String status = String.valueOf(StatusEnum.YES.getValue());
+        return this.list(Wrappers.lambdaQuery(SysUserPO.class)
+                .eq(SysUserPO::getStatus,status)
+                .orderByAsc(SysUserPO::getSort));
+
+
+    }
+
     @SneakyThrows
     private Boolean checkUniqueAccount(String value, Long id){
         if (StrUtil.isBlank(value)) {

+ 1 - 1
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/wx/controller/WxMaLoginController.java

@@ -11,7 +11,7 @@
 //import cn.tr.module.sys.oauth2.psw.operator.LoginOAuth2PswUserOperator;
 //import cn.tr.module.sys.user.constant.UserType;
 //import cn.tr.module.sys.user.dto.SysUserDTO;
-//import cn.tr.module.sys.user.service.impl.ISysUserService;
+//import cn.tr.module.sys.user.service.ISysUserService;
 //import io.swagger.v3.oas.annotations.Operation;
 //import io.swagger.v3.oas.annotations.tags.Tag;
 //import jakarta.annotation.Resource;

+ 8 - 4
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/controller/BusClinicController.java

@@ -4,8 +4,7 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
 import cn.tr.core.validation.Insert;
 import cn.tr.core.validation.Update;
 import cn.tr.core.pojo.CommonResult;
-import cn.tr.module.phototherapy.common.dto.BusPatientListQueryDTO;
-import cn.tr.module.phototherapy.common.dto.PatientTherapyDetailDTO;
+import cn.tr.module.phototherapy.common.dto.*;
 import cn.tr.module.phototherapy.common.vo.PatientTherapyDetailVO;
 import cn.tr.module.phototherapy.common.vo.PatientTherapyRecordVO;
 import lombok.AllArgsConstructor;
@@ -16,9 +15,8 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RestController;
-import cn.tr.module.phototherapy.common.dto.BusClinicDTO;
 import cn.tr.module.phototherapy.common.service.IBusClinicService;
-import cn.tr.module.phototherapy.common.dto.BusClinicQueryDTO;
+
 import java.util.*;
 import cn.tr.core.context.BaseController;
 import org.springframework.web.bind.annotation.*;
@@ -78,4 +76,10 @@ public class BusClinicController extends BaseController{
     public CommonResult<PatientTherapyDetailVO> getPatientTherapyDetail(@PathVariable("patientUniqueId") String patientUniqueId){
         return CommonResult.success(busClinicService.getPatientTherapyDetailById(patientUniqueId));
     }
+
+    @Operation(summary = "新增患者")
+    @PostMapping("/addPatient")
+    public CommonResult<Boolean> addPatient(@RequestBody BusClinicAddDTO source) {
+        return CommonResult.success(busClinicService.insertBusPatient(source));
+    }
 }

+ 8 - 0
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/controller/BusTherapyPlanController.java

@@ -4,6 +4,8 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
 import cn.tr.core.validation.Insert;
 import cn.tr.core.validation.Update;
 import cn.tr.core.pojo.CommonResult;
+import cn.tr.module.phototherapy.common.dto.BusClinicAddDTO;
+import cn.tr.module.phototherapy.common.dto.BusTherapyPlanAddDTO;
 import lombok.AllArgsConstructor;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import io.swagger.v3.oas.annotations.Operation;
@@ -55,6 +57,12 @@ public class BusTherapyPlanController extends BaseController{
         return CommonResult.success(busTherapyPlanService.insertBusTherapyPlan(source));
     }
 
+    @Operation(summary = "批量添加治疗方案")
+    @PostMapping("/addBatch")
+    public CommonResult<List<BusTherapyPlanDTO>> addBatch(@RequestBody BusClinicAddDTO source) {
+        return CommonResult.success(busTherapyPlanService.addBatchBusTherapyPlanBatch(source));
+    }
+
     @Operation(summary = "通过主键id编辑设计方案", description = "权限: phototherapy:common:edit")
     @PostMapping("/edit")
     @SaCheckPermission("phototherapy:common:edit")

+ 35 - 25
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/dto/BusClinicAddDTO.java

@@ -1,8 +1,11 @@
 package cn.tr.module.phototherapy.common.dto;
 
+import cn.hutool.core.util.EnumUtil;
+import cn.hutool.core.util.ObjectUtil;
 import cn.tr.core.pojo.BaseDTO;
 import cn.tr.core.validation.Insert;
 import cn.tr.core.validation.Update;
+import cn.tr.module.common.menus.SexEnum;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.v3.oas.annotations.media.Schema;
 import jakarta.validation.constraints.NotBlank;
@@ -36,8 +39,8 @@ public class BusClinicAddDTO extends BaseDTO  {
     @Schema(description = "患者年龄")
     private Integer patientAge;
 
-    @Schema(description = "患者性别(0女 1男 2未知)")
-    private Integer patientGender;
+    @Schema(description = "患者性别文本(0女 1男 2未知)")
+    private String patientGenderText;
 
     @Schema(description = "患者联系电话")
     private String patientPhone;
@@ -49,39 +52,46 @@ public class BusClinicAddDTO extends BaseDTO  {
     @Schema(description = "阶段开始时间")
     private Date phaseStartTime;
 
-    @Schema(description = "阶段类型")
-    private Integer phaseType;
+    @Schema(description = "强化期阶段")
+    private String intensivePhaseType;
 
-    @Schema(description = "负责医生id")
-    @NotBlank(message = "负责医生id不能为空", groups = {Update.class, Insert.class})
-    private String userId;
+    @Schema(description = "强化期阶段频率")
+    private Integer intensivePhaseFreq;
+
+    @Schema(description = "强化期阶段建议时长")
+    private Integer intensivePhaseDurationMin;
+
+    @Schema(description = "次续期阶段")
+    private String continuousPhaseType;
+
+    @Schema(description = "次续期阶段频率")
+    private Integer continuousPhaseFreq;
+
+    @Schema(description = "次续期阶段建议时长")
+    private Integer continuousPhaseDurationMin;
+
+    @Schema(description = "强化期阶段日文本(每日/隔日)")
+    @NotBlank(message = "阶段日不能为空", groups = {Update.class, Insert.class})
+    private String intensivePhaseDayText;
+
+    @Schema(description = "次续期阶段日文本(每日/隔日)")
+    @NotBlank(message = "阶段日不能为空", groups = {Update.class, Insert.class})
+    private String continuousPhaseDayText;
+
+    @Schema(description = "所属分组(0治疗组 1对照组)")
+    private String groupTypeText;
+
+    @Schema(description = "负责医生")
+    private String planDoctor;
 
     @Schema(description = "设备id")
     @NotBlank(message = "设备id不能为空", groups = {Update.class, Insert.class})
     private String deviceId;
 
-    @Schema(description = "删除标志(0代表存在 1代表删除)")
-    @NotNull(message = "删除标志不能为空", groups = {Update.class, Insert.class})
-    private Integer isDelete;
-
-    @Schema(description = "医院id")
-    @NotBlank(message = "医院id不能为空", groups = {Update.class, Insert.class})
-    private String tenantId;
-
     @Schema(description = "设备与患者的绑定开始时间")
     @NotBlank(message = "设备与患者的绑定开始时间不能为空", groups = {Update.class, Insert.class})
     private Date bindStartTime;
 
-    @Schema(description = "设备与患者的绑定结束时间")
-    private Date bindEndTime;
-
-    @Schema(description = "是否当前绑定(1=当前绑定,0=历史绑定)")
-    @NotNull(message = "是否当前绑定不能为空", groups = {Update.class, Insert.class})
-    private Integer isCurrentBind;
-
-    @Schema(description = "所属分组(0治疗组 1对照组)")
-    @NotNull(message = "是否当前所属分组不能为空", groups = {Update.class, Insert.class})
-    private Integer groupType;
 
 
 }

+ 0 - 4
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/dto/BusClinicDTO.java

@@ -34,10 +34,6 @@ public class BusClinicDTO extends BaseDTO  {
     @NotBlank(message = "患者唯一标识不能为空", groups = {Update.class, Insert.class})
     private String patientUniqueId;
 
-    @Schema(description = "负责医生id")
-    @NotBlank(message = "负责医生id不能为空", groups = {Update.class, Insert.class})
-    private String userId;
-
     @Schema(description = "患者上次治疗时间")
     @NotNull(message = "患者上次治疗时间不能为空", groups = {Update.class, Insert.class})
     private Date lastTreatmentTime;

+ 57 - 0
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/dto/BusTherapyPlanAddDTO.java

@@ -0,0 +1,57 @@
+package cn.tr.module.phototherapy.common.dto;
+
+import cn.tr.core.pojo.BaseDTO;
+import cn.tr.core.validation.Insert;
+import cn.tr.core.validation.Update;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+import java.util.Date;
+
+/**
+ * 治疗方案表传输对象
+ *
+ * @author CodeGenerator
+ * @date 2026-01-13
+ **/
+@Data
+@Schema(description = "新增设计方案传输对象")
+@EqualsAndHashCode(callSuper = true)
+@ToString
+public class BusTherapyPlanAddDTO extends BaseDTO  {
+    private static final long serialVersionUID = 1L;
+
+    @Schema(description = "方案医生")
+    private String planDoctor;
+
+    @Schema(description = "阶段类型")
+    private String phaseType;
+
+    @Schema(description = "阶段目标次数")
+    private Integer phaseTargetTimes;
+
+    @Schema(description = "阶段频率")
+    private Integer phaseFreq;
+
+    @Schema(description = "阶段日")
+    private Integer phaseDay;
+
+    @Schema(description = "阶段建议时长")
+    private Integer phaseDurationMin;
+
+    @Schema(description = "方案状态(0启用 1等待启用 2终止)")
+    private Integer planStatus;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Schema(description = "阶段开始时间")
+    private Date phaseStartTime;
+
+    @Schema(description = "患者唯一标识")
+    private String patientUniqueId;
+
+}

+ 5 - 0
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/dto/BusTherapyPlanDTO.java

@@ -59,6 +59,11 @@ public class BusTherapyPlanDTO extends BaseDTO  {
     @Schema(description = "阶段结束时间")
     private Date phaseEndTime;
 
+    @Schema(description = "阶段日")
+    private Integer phaseDay;
+
+    @Schema(description = "患者唯一标识")
+    private String patientUniqueId;
 
     @Schema(description = "医院id")
     private String tenantId;

+ 19 - 0
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/enums/GroupTypeEnum.java

@@ -38,4 +38,23 @@ public enum GroupTypeEnum implements IEnum<Integer> {
         }
         return null;
     }
+
+    /**
+     * 根据汉字描述(text)获取枚举
+     * 前端传汉字时,通过此方法匹配枚举,进而获取value存入数据库
+     *
+     * @param text 汉字描述(如:治疗组/对照组)
+     * @return 枚举(匹配不到返回null)
+     */
+    public static GroupTypeEnum getByText(String text) {
+        if (text == null || text.trim().isEmpty()) {
+            return null;
+        }
+        for (GroupTypeEnum group : values()) {
+            if (group.text.equals(text.trim())) {
+                return group;
+            }
+        }
+        return null;
+    }
 }

+ 9 - 9
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/enums/PatientGenderEnum.java

@@ -25,18 +25,18 @@ public enum PatientGenderEnum implements IEnum<Integer> {
     @Schema(description = "性别描述")
     private String text;
 
-    /**
-     * 根据值获取枚举
-     *
-     * @param value 值
-     * @return 枚举
-     */
-    public static PatientGenderEnum getByValue(Integer value) {
-        for (PatientGenderEnum gender : values()) {
-            if (gender.value.equals(value)) {
+
+    public static PatientGenderEnum getByText(String text){
+        if (text == null || text.trim().isEmpty()){
+            return null;
+        }
+        for (PatientGenderEnum gender : values()){
+            if (gender.text.equals(text.trim())){
                 return gender;
             }
         }
         return null;
     }
+
+
 }

+ 66 - 0
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/enums/PhaseDayEnum.java

@@ -0,0 +1,66 @@
+package cn.tr.module.phototherapy.common.enums;
+
+import com.baomidou.mybatisplus.annotation.IEnum;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author lifang
+ * @version 1.0.0
+ * @ClassName AlarmEnum.java
+ * @Description
+ * @createTime 2022年03月27日 09:49:00
+ */
+@AllArgsConstructor
+@JsonFormat(shape = JsonFormat.Shape.OBJECT)
+public enum PhaseDayEnum implements IEnum<Integer> {
+
+    DAILY(0,"每日"),
+    NEXT_DAY(1,"隔日");
+
+
+    @Getter
+    @Schema(defaultValue = "报警编码")
+    private Integer value;
+    @Getter
+    @Schema(defaultValue = "报警内容")
+    private String text;
+
+    // 静态缓存:文本 -> 枚举实例(初始化时只加载一次,性能最优)
+    private static final Map<String, PhaseDayEnum> TEXT_TO_ENUM_MAP;
+
+    static {
+        TEXT_TO_ENUM_MAP = new HashMap<>();
+        for (PhaseDayEnum enumItem : PhaseDayEnum.values()) {
+            TEXT_TO_ENUM_MAP.put(enumItem.getText(), enumItem);
+        }
+    }
+
+    public static PhaseDayEnum getByText(String text) {
+        // 先做空值处理
+        if (text == null || text.trim().isEmpty()) {
+            throw new IllegalArgumentException("阶段日文本不能为空");
+        }
+        PhaseDayEnum enumItem = TEXT_TO_ENUM_MAP.get(text.trim());
+        if (enumItem == null) {
+            throw new IllegalArgumentException(
+                    "不支持的阶段日文本:" + text + ",仅支持:" + TEXT_TO_ENUM_MAP.keySet()
+            );
+        }
+        return enumItem;
+    }
+
+    public static PhaseDayEnum getByTextWithDefault(String text, PhaseDayEnum defaultValue) {
+        if (text == null || text.trim().isEmpty()) {
+            return defaultValue;
+        }
+        return TEXT_TO_ENUM_MAP.getOrDefault(text.trim(), defaultValue);
+    }
+}
+
+

+ 41 - 0
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/enums/TherapyPlanNameEnum.java

@@ -0,0 +1,41 @@
+package cn.tr.module.phototherapy.common.enums;
+
+import com.baomidou.mybatisplus.annotation.IEnum;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 治疗方案状态枚举
+ */
+@AllArgsConstructor
+@JsonFormat(shape = JsonFormat.Shape.OBJECT)
+public enum TherapyPlanNameEnum implements IEnum<Integer> {
+
+    INTENSIVE(0, "强化期"),
+    MAINTENANCE(1, "持续期");
+
+    @Getter
+    @Schema(description = "方案状态编码")
+    private Integer value;
+
+    @Getter
+    @Schema(description = "方案状态描述")
+    private String text;
+
+    /**
+     * 根据值获取枚举
+     *
+     * @param value 值
+     * @return 枚举
+     */
+    public static TherapyPlanNameEnum getByValue(Integer value) {
+        for (TherapyPlanNameEnum status : values()) {
+            if (status.value.equals(value)) {
+                return status;
+            }
+        }
+        return null;
+    }
+}

+ 3 - 0
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/mapper/BusClinicMapper.java

@@ -1,5 +1,6 @@
 package cn.tr.module.phototherapy.common.mapper;
 
+import cn.tr.module.phototherapy.common.dto.BusClinicAddDTO;
 import cn.tr.module.phototherapy.common.dto.PatientTherapyDetailDTO;
 import cn.tr.module.phototherapy.common.po.BusClinicPO;
 import cn.tr.module.phototherapy.common.dto.BusClinicDTO;
@@ -30,4 +31,6 @@ public interface BusClinicMapper {
     PatientTherapyDetailDTO convertPatientTherapyDetailDTO(PatientTherapyDetailVO source);
 
     PatientTherapyDetailVO convertPatientTherapyDetailVO(PatientTherapyDetailDTO source);
+
+    BusClinicPO convertPO(BusClinicAddDTO source);
 }

+ 0 - 4
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/po/BusClinicPO.java

@@ -34,10 +34,6 @@ public class BusClinicPO extends TenantPO {
     @Schema(description = "患者唯一标识")
     private String patientUniqueId;
 
-    /** 负责医生id */
-    @Schema(description = "负责医生id")
-    private String userId;
-
     /** 患者上次治疗时间 */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @Schema(description = "患者上次治疗时间")

+ 10 - 0
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/po/BusTherapyPlanPO.java

@@ -1,11 +1,14 @@
 package cn.tr.module.phototherapy.common.po;
 
 import cn.tr.core.pojo.TenantPO;
+import cn.tr.core.validation.Insert;
+import cn.tr.core.validation.Update;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotBlank;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.ToString;
@@ -57,6 +60,10 @@ public class BusTherapyPlanPO extends TenantPO {
     @Schema(description = "方案状态(0启用 1等待启用 2终止)")
     private Integer planStatus;
 
+    /** 阶段日 */
+    @Schema(description = "阶段日")
+    private Integer phaseDay;
+
     /** 阶段开始时间 */
     @Schema(description = "阶段开始时间")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@@ -67,6 +74,9 @@ public class BusTherapyPlanPO extends TenantPO {
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date phaseEndTime;
 
+    @Schema(description = "患者唯一标识")
+    private String patientUniqueId;
+
     /** 医院id */
     @Schema(description = "医院id")
     private String tenantId;

+ 3 - 4
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/service/IBusClinicService.java

@@ -1,9 +1,6 @@
 package cn.tr.module.phototherapy.common.service;
 
-import cn.tr.module.phototherapy.common.dto.BusClinicDTO;
-import cn.tr.module.phototherapy.common.dto.BusClinicQueryDTO;
-import cn.tr.module.phototherapy.common.dto.BusPatientListQueryDTO;
-import cn.tr.module.phototherapy.common.dto.PatientTherapyDetailDTO;
+import cn.tr.module.phototherapy.common.dto.*;
 import cn.tr.module.phototherapy.common.vo.PatientTherapyDetailVO;
 import cn.tr.module.phototherapy.common.vo.PatientTherapyRecordVO;
 
@@ -64,4 +61,6 @@ public interface IBusClinicService{
      * @date    2026-01-20
      */
     PatientTherapyDetailVO getPatientTherapyDetailById(String patientUniqueId);
+
+    Boolean insertBusPatient(BusClinicAddDTO source);
 }

+ 10 - 0
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/service/IBusTherapyPlanService.java

@@ -1,5 +1,7 @@
 package cn.tr.module.phototherapy.common.service;
 
+import cn.tr.module.phototherapy.common.dto.BusClinicAddDTO;
+import cn.tr.module.phototherapy.common.dto.BusTherapyPlanAddDTO;
 import cn.tr.module.phototherapy.common.dto.BusTherapyPlanDTO;
 import cn.tr.module.phototherapy.common.dto.BusTherapyPlanQueryDTO;
 import java.util.*;
@@ -52,4 +54,12 @@ public interface IBusTherapyPlanService{
      * @date   2026-01-13
      */
     boolean removeBusTherapyPlanByIds(Collection<String> ids);
+
+    /**
+     * 批量新增治疗方案
+     * @param  source 新增参数
+     * @author CodeGenerator
+     * @date   2026-01-13
+     */
+    List<BusTherapyPlanDTO> addBatchBusTherapyPlanBatch(BusClinicAddDTO source);
 }

+ 60 - 4
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/service/impl/BusClinicServiceImpl.java

@@ -1,8 +1,12 @@
 package cn.tr.module.phototherapy.common.service.impl;
 
-import cn.tr.module.phototherapy.common.dto.BusPatientListQueryDTO;
-import cn.tr.module.phototherapy.common.dto.PatientTherapyDetailDTO;
+import cn.tr.module.phototherapy.common.dto.*;
+import cn.tr.module.phototherapy.common.enums.GroupTypeEnum;
+import cn.tr.module.phototherapy.common.enums.PatientGenderEnum;
 import cn.tr.module.phototherapy.common.mapper.BusTherapyRecordMapper;
+import cn.tr.module.phototherapy.common.po.BusTherapyPlanPO;
+import cn.tr.module.phototherapy.common.repository.BusDeviceRepository;
+import cn.tr.module.phototherapy.common.repository.BusTherapyPlanRepository;
 import cn.tr.module.phototherapy.common.vo.PatientTherapyDetailVO;
 import cn.tr.module.phototherapy.common.vo.PatientTherapyRecordVO;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -15,8 +19,7 @@ import cn.tr.core.exception.ServiceException;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import cn.tr.module.phototherapy.common.repository.BusClinicRepository;
 import cn.tr.module.phototherapy.common.po.BusClinicPO;
-import cn.tr.module.phototherapy.common.dto.BusClinicDTO;
-import cn.tr.module.phototherapy.common.dto.BusClinicQueryDTO;
+
 import java.util.*;
 import cn.tr.module.phototherapy.common.service.IBusClinicService;
 import cn.tr.module.phototherapy.common.mapper.BusClinicMapper;
@@ -33,6 +36,13 @@ public class BusClinicServiceImpl extends ServiceImpl<BusClinicRepository, BusCl
 
     @Resource
     private BusClinicRepository busClinicRepository;
+    @Resource
+    private BusTherapyPlanServiceImpl busTherapyPlanServiceImpl;
+    @Resource
+    private BusTherapyPlanRepository busTherapyPlanRepository;
+    @Resource
+    private BusDeviceRepository busDeviceRepository;
+
 
 
     /**
@@ -127,4 +137,50 @@ public class BusClinicServiceImpl extends ServiceImpl<BusClinicRepository, BusCl
 
         return BusClinicMapper.INSTANCE.convertPatientTherapyDetailVO(detailDTO);
     }
+
+    /**
+     * 添加患者
+     * @param source
+     * @return
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class) // 捕获所有异常并回滚
+    public Boolean insertBusPatient(BusClinicAddDTO source) {
+        //判断患者是否存在,只查未删除的患者
+        BusClinicPO patient = this.getOne(new LambdaQueryWrapper<BusClinicPO>()
+                .eq(BusClinicPO::getPatientUniqueId, source.getPatientUniqueId())
+                .eq(BusClinicPO::getIsDelete, 0));
+        //患者存在
+        if (ObjectUtil.isNotNull(patient)) {
+            throw new ServiceException(TRExcCode.SYSTEM_ERROR_B0001, "患者已存在");
+        }
+        //生成并保存两个治疗计划,获取到强化期的id
+        List<BusTherapyPlanDTO> busTherapyPlanDTOS = busTherapyPlanServiceImpl.addBatchBusTherapyPlanBatch(source);
+        BusTherapyPlanDTO intensivePlan = busTherapyPlanDTOS.getFirst();
+        String intensivePlanId = intensivePlan.getId();
+
+        GroupTypeEnum groupTypeEnum = GroupTypeEnum.getByText(source.getGroupTypeText());
+        Integer groupTypeValue = groupTypeEnum.getValue();
+
+        PatientGenderEnum patientGenderEnum = PatientGenderEnum.getByText(source.getPatientGenderText());
+        Integer patientGenderValue = patientGenderEnum.getValue();
+
+        //保存临床表
+        BusClinicDTO clinicDTO = new BusClinicDTO();
+        clinicDTO.setPatientUniqueId(source.getPatientUniqueId());
+        clinicDTO.setTherapyPlanId(intensivePlanId);
+        clinicDTO.setPatientName(source.getPatientName());
+        clinicDTO.setPatientAge(source.getPatientAge());
+        clinicDTO.setPatientGender(patientGenderValue);
+        clinicDTO.setPatientPhone(source.getPatientPhone());
+        clinicDTO.setPatientAddress(source.getPatientAddress());
+        clinicDTO.setDeviceId(source.getDeviceId());
+        clinicDTO.setGroupType(groupTypeValue);
+        clinicDTO.setBindStartTime(new Date());
+        boolean save = this.save(BusClinicMapper.INSTANCE.convertPO(clinicDTO));
+        if (!save){
+            throw new ServiceException(TRExcCode.SYSTEM_ERROR_B0001, "保存患者失败");
+        }
+        return true;
+    }
 }

+ 45 - 0
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/service/impl/BusTherapyPlanServiceImpl.java

@@ -1,5 +1,10 @@
 package cn.tr.module.phototherapy.common.service.impl;
 
+import cn.tr.module.phototherapy.common.dto.BusClinicAddDTO;
+import cn.tr.module.phototherapy.common.dto.BusTherapyPlanAddDTO;
+import cn.tr.module.phototherapy.common.enums.PhaseDayEnum;
+import cn.tr.module.phototherapy.common.enums.TherapyPlanNameEnum;
+import cn.tr.module.phototherapy.common.enums.TherapyPlanStatusEnum;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import cn.tr.module.phototherapy.common.po.BusClinicPO;
@@ -103,4 +108,44 @@ public class BusTherapyPlanServiceImpl extends ServiceImpl<BusTherapyPlanReposit
         }
         return this.removeByIds(ids);
     };
+
+    @Override
+    public List<BusTherapyPlanDTO> addBatchBusTherapyPlanBatch(BusClinicAddDTO source) {
+        List<BusTherapyPlanDTO> planList = new ArrayList<>();
+
+        PhaseDayEnum phaseDayEnum = PhaseDayEnum.getByText(source.getIntensivePhaseDayText());
+        Integer intensivePhaseDayValue = phaseDayEnum.getValue();
+        //生成强化期计划
+        BusTherapyPlanDTO intensivePlan = new BusTherapyPlanDTO();
+        intensivePlan.setPatientUniqueId(source.getPatientUniqueId());
+        intensivePlan.setPlanDoctor(source.getPlanDoctor());
+        intensivePlan.setPhaseDay(intensivePhaseDayValue);
+        intensivePlan.setPlanName(source.getPatientName());
+        intensivePlan.setPhaseType(source.getIntensivePhaseType());
+        intensivePlan.setPhaseStartTime(source.getPhaseStartTime());
+        intensivePlan.setPhaseFreq(source.getIntensivePhaseFreq());
+        intensivePlan.setPhaseDurationMin(source.getIntensivePhaseDurationMin());
+        intensivePlan.setPlanStatus(TherapyPlanStatusEnum.ENABLED.getValue());
+        planList.add(intensivePlan);
+
+        Integer continuousPhaseDayValue = phaseDayEnum.getValue();
+
+        //生成持续期
+        BusTherapyPlanDTO continuousPlan = new BusTherapyPlanDTO();
+        continuousPlan.setPatientUniqueId(source.getPatientUniqueId());
+        continuousPlan.setPlanDoctor(source.getPlanDoctor());
+        continuousPlan.setPhaseDay(continuousPhaseDayValue);
+        continuousPlan.setPlanName(source.getPatientName());
+        continuousPlan.setPhaseType(source.getContinuousPhaseType());
+//        continuousPlan.setPhaseStartTime(source.getPhaseStartTime());
+        continuousPlan.setPhaseFreq(source.getContinuousPhaseFreq());
+        continuousPlan.setPhaseDurationMin(source.getContinuousPhaseDurationMin());
+        intensivePlan.setPlanStatus(TherapyPlanStatusEnum.WAITING.getValue());
+        planList.add(continuousPlan);
+        //把DTO转换成PO
+        List<BusTherapyPlanPO> planPOList = BusTherapyPlanMapper.INSTANCE.convertPOList(planList);
+        //把生成的数据插入到数据库
+        this.saveBatch(planPOList);
+        return BusTherapyPlanMapper.INSTANCE.convertDtoList(planPOList);
+    }
 }

+ 8 - 7
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/common/vo/PatientTherapyRecordVO.java

@@ -1,9 +1,6 @@
 package cn.tr.module.phototherapy.common.vo;
 
-import cn.tr.module.phototherapy.common.enums.DeviceAlarmEnum;
-import cn.tr.module.phototherapy.common.enums.GroupTypeEnum;
-import cn.tr.module.phototherapy.common.enums.IsCurrentBindEnum;
-import cn.tr.module.phototherapy.common.enums.TherapyPlanStatusEnum;
+import cn.tr.module.phototherapy.common.enums.*;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
@@ -42,9 +39,13 @@ public class PatientTherapyRecordVO {
     @Schema(description = "患者上次治疗时间")
     private Date lastTreatmentTime;
 
-    /** 阶段频率(如每日1次/隔日1次/每周3次) */
-    @Schema(description = "阶段频率(如每日1次/隔日1次/每周3次)")
-    private String phaseFreq;
+    /** 阶段频率 */
+    @Schema(description = "阶段频率")
+    private Integer phaseFreq;
+
+    /** 阶段日 */
+    @Schema(description = "阶段日")
+    private PhaseDayEnum phaseDay;
 
     /** 阶段建议时长 */
     @Schema(description = "阶段建议时长")

+ 2 - 2
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/web/auth/WebAccountOperator.java

@@ -18,7 +18,7 @@ import cn.tr.module.sys.user.po.SysRolePO;
 import cn.tr.module.sys.user.po.SysUserPO;
 import cn.tr.module.sys.user.service.ISysMenuService;
 import cn.tr.module.sys.user.service.ISysRoleService;
-import cn.tr.module.sys.user.service.impl.ISysUserService;
+import cn.tr.module.sys.user.service.ISysUserService;
 import cn.tr.module.sys.user.vo.RouteItemVO;
 import cn.tr.module.sys.user.vo.RouteMetoVO;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -184,7 +184,7 @@ public class WebAccountOperator implements IAccountOperator {
         routeMetoVO.setHideMenu(StrUtil.isNotBlank(item.getVisible()) && item.getVisible().equals(VisibleEnum.HIDE.getCode()));
         // 菜单
         if (Objects.equals(item.getMenuType(), MenuTypeEnum.MENU.getCode())) {
-            routeMetoVO.setIgnoreKeepAlive(item.getKeepalive().equals(KeepaliveEnum.YES.getCode()));
+            routeMetoVO.setIgnoreKeepAlive(Objects.equals(item.getKeepalive(), KeepaliveEnum.YES.getCode()));
         }
         // 外部链接
         if (Objects.equals(item.getMenuType(), MenuTypeEnum.MENU.getCode()) && Objects.equals(item.getLinkExternal(), LinkExternalEnum.YES.getCode())) {

+ 1 - 1
tr-modules/tr-modules-phototherapy/src/main/java/cn/tr/module/phototherapy/web/auth/WebAuthGranter.java

@@ -22,7 +22,7 @@ import cn.tr.module.sys.user.po.SysRolePO;
 import cn.tr.module.sys.user.po.SysUserPO;
 import cn.tr.module.sys.user.service.ISysMenuService;
 import cn.tr.module.sys.user.service.ISysRoleService;
-import cn.tr.module.sys.user.service.impl.ISysUserService;
+import cn.tr.module.sys.user.service.ISysUserService;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import jakarta.servlet.http.HttpServletRequest;
 import lombok.AllArgsConstructor;

+ 1 - 0
tr-modules/tr-modules-phototherapy/src/main/resources/mapper/phototherapy/BusClinicRepository.xml

@@ -52,6 +52,7 @@
                bc.last_treatment_time,
                bc.is_current_bind,
                btp.phase_type,
+               btp.phase_day,
                btp.phase_target_times,
                btp.phase_freq,
                btp.phase_duration_min,