lige
2023-11-21 690362d7b03064490850b738ef16c3e0eb2509e8
医生排班
7个文件已修改
7个文件已添加
895 ■■■■■ 已修改文件
ltkj-admin/src/main/java/com/ltkj/web/controller/mall/MallTimeConfigController.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-admin/src/main/java/com/ltkj/web/controller/system/StjSchedulingTimeController.java 365 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-common/src/main/java/com/ltkj/common/core/domain/entity/MallSchedulingTime.java 131 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-common/src/main/java/com/ltkj/common/utils/DateUtils.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-framework/src/main/java/com/ltkj/framework/config/MatchUtils.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-hosp/src/main/java/com/ltkj/hosp/dto/MallSchedulingTimeDto.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-hosp/src/main/java/com/ltkj/hosp/vodomain/DoctorUserVo.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-hosp/src/main/java/com/ltkj/mall/mapper/MallSchedulingTimeMapper.java 79 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-hosp/src/main/java/com/ltkj/mall/mapper/MallTimeConfigMapper.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-hosp/src/main/java/com/ltkj/mall/service/IMallSchedulingTimeService.java 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-hosp/src/main/java/com/ltkj/mall/service/impl/MallSchedulingTimeServiceImpl.java 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-system/src/main/java/com/ltkj/system/mapper/SysDeptMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-system/src/main/java/com/ltkj/system/service/ISysDeptService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-system/src/main/java/com/ltkj/system/service/impl/SysDeptServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-admin/src/main/java/com/ltkj/web/controller/mall/MallTimeConfigController.java
@@ -83,7 +83,7 @@
    /**
     * 查询预约时间列表
     */
    @PreAuthorize("@ss.hasPermi('mall:timeConfig:list')")
    //@PreAuthorize("@ss.hasPermi('mall:timeConfig:list')")
    @GetMapping("/list")
    public TableDataInfo list(MallTimeConfig mallTimeConfig) {
        startPage();
@@ -94,7 +94,7 @@
    /**
     * 导出预约时间列表
     */
    @PreAuthorize("@ss.hasPermi('mall:timeConfig:export')")
    //@PreAuthorize("@ss.hasPermi('mall:timeConfig:export')")
    @Log(title = "预约时间", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, MallTimeConfig mallTimeConfig) {
@@ -106,7 +106,7 @@
    /**
     * 获取预约时间详细信息
     */
    @PreAuthorize("@ss.hasPermi('mall:timeConfig:query')")
    //@PreAuthorize("@ss.hasPermi('mall:timeConfig:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return success(mallTimeConfigService.selectMallTimeConfigById(id));
@@ -168,7 +168,7 @@
    /**
     * 新增预约时间
     */
    @PreAuthorize("@ss.hasPermi('mall:timeConfig:add')")
    //@PreAuthorize("@ss.hasPermi('mall:timeConfig:add')")
    @Log(title = "预约时间", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody MallTimeConfig mallTimeConfig) {
ltkj-admin/src/main/java/com/ltkj/web/controller/system/StjSchedulingTimeController.java
New file
@@ -0,0 +1,365 @@
package com.ltkj.web.controller.system;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ltkj.common.annotation.Log;
import com.ltkj.common.core.controller.BaseController;
import com.ltkj.common.core.domain.AjaxResult;
import com.ltkj.common.core.domain.entity.*;
import com.ltkj.common.core.page.TableDataInfo;
import com.ltkj.common.enums.BusinessType;
import com.ltkj.common.utils.DateUtils;
import com.ltkj.common.utils.poi.ExcelUtil;
import com.ltkj.hosp.dto.MallSchedulingTimeDto;
import com.ltkj.hosp.service.IDictUserInfoService;
import com.ltkj.hosp.vodomain.DoctorUserVo;
import com.ltkj.mall.service.IMallSchedulingTimeService;
import com.ltkj.system.service.ISysDeptService;
import com.ltkj.system.service.ISysDictDataService;
import com.ltkj.system.service.ISysUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
/**
 * 排班时间Controller
 *
 * @author ltkj_赵佳豪&李格
 * @date 2023-07-18
 */
@RestController
@RequestMapping("/mall/schedulingTime")
@Api(tags = "PC端医生排班接口")
public class StjSchedulingTimeController extends BaseController {
    @Autowired
    private IMallSchedulingTimeService mallSchedulingTimeService;
    @Autowired
    private ISysUserService userService;
    @Resource
    private IDictUserInfoService userInfoService;
    @Autowired
    private ISysDeptService deptService;
    @Autowired
    private ISysDictDataService dictDataService;
    /**
     * 查询排班时间是否存在
     */
    @GetMapping("/isExist")
    public AjaxResult isExist(@RequestParam String time) {
        if (time != null) {
            LambdaQueryWrapper<MallSchedulingTime> wq=new LambdaQueryWrapper<>();
            wq.eq(MallSchedulingTime::getTime,time);
            List<MallSchedulingTime> list = mallSchedulingTimeService.list(wq);
            if (list!=null&&list.size()>0){
                return AjaxResult.success(1);
            }else {
                return AjaxResult.success(0);
            }
        }
        return AjaxResult.error("出错了,请联系工作人员!");
    }
    /**
     * 查询排班时间列表
     */
    @GetMapping("/list")
    @ApiOperation(value = "查询排班时间列表")
    public TableDataInfo list(MallSchedulingTime mallTimeConfig) {
        startPage();
        List<MallSchedulingTime> list = mallSchedulingTimeService.selectMallTimeConfigList(mallTimeConfig);
        return getDataTable(list);
    }
    /**
     * 导出排班时间列表
     */
//    @PreAuthorize("@ss.hasPermi('mall:timeConfig:export')")
    @Log(title = "排班时间", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, MallSchedulingTime mallTimeConfig) {
        List<MallSchedulingTime> list = mallSchedulingTimeService.selectMallTimeConfigList(mallTimeConfig);
        ExcelUtil<MallSchedulingTime> util = new ExcelUtil<MallSchedulingTime>(MallSchedulingTime.class);
        util.exportExcel(response, list, "排班时间数据");
    }
    /**
     * 获取排班时间详细信息
     */
//    @PreAuthorize("@ss.hasPermi('mall:timeConfig:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return success(mallSchedulingTimeService.getById(id));
    }
    /**
     * 返回当前表中最大时间
     */
    @GetMapping("/returnLastTime")
    public AjaxResult returnLastTime() {
        final MallSchedulingTime one = mallSchedulingTimeService.getOne(new LambdaQueryWrapper<MallSchedulingTime>().orderByDesc(MallSchedulingTime::getTime).last("limit 1"));
        if (one!=null&&one.getTime().getTime()>new Date().getTime()){
            Calendar calendar = Calendar.getInstance();
            calendar.setTime(one.getTime());
            calendar.add(Calendar.DATE, 1);
            Date nextDate = calendar.getTime();
            return AjaxResult.success(nextDate);
        }else if (one!=null&&one.getTime().getTime()<new Date().getTime()){
            Calendar calendar = Calendar.getInstance();
            Date currentDate = new Date();
            calendar.setTime(currentDate);
            calendar.add(Calendar.DATE, 1);
            Date nextDate = calendar.getTime();
            return AjaxResult.success(nextDate);
        }else {
            Calendar calendar = Calendar.getInstance();
            Date currentDate = new Date();
            calendar.setTime(currentDate);
            calendar.add(Calendar.DATE, 1);
            Date nextDate = calendar.getTime();
            return AjaxResult.success(nextDate);
        }
    }
    /**
     * 新增排班时间
     */
    @PostMapping
    @ApiOperation(value = "新增医生排班信息数据接口")
    public AjaxResult add(@RequestBody List<MallSchedulingTime> schedulingTimeList) {
      if(null !=schedulingTimeList && schedulingTimeList.size()>0){
          for (MallSchedulingTime schedulingTime : schedulingTimeList) {
              LambdaQueryWrapper<MallSchedulingTime> wq = new LambdaQueryWrapper<>();
              wq.eq(MallSchedulingTime::getDeptId,schedulingTime.getDeptId());
              wq.eq(MallSchedulingTime::getTime,schedulingTime.getTime());
              wq.eq(MallSchedulingTime::getTimeSlot,schedulingTime.getTimeSlot());
              wq.eq(MallSchedulingTime::getUserId,schedulingTime.getUserId());
              wq.eq(MallSchedulingTime::getMOrA,schedulingTime.getMOrA());
              MallSchedulingTime mallSchedulingTime = mallSchedulingTimeService.getOne(wq);
              if(null !=mallSchedulingTime){
                  continue;
              }
              SysDept dept = deptService.getById(schedulingTime.getDeptId());
              schedulingTime.setHospId(dept.getHospId());
              schedulingTime.setHospName(dept.getHospName());
              mallSchedulingTimeService.save(schedulingTime);
          }
          return AjaxResult.success("操作成功!");
      }
        return AjaxResult.error("操作失败!");
    }
    /**
     * 修改排班时间
     */
    @PutMapping
    @ApiOperation(value = "修改医生排班信息数据接口")
    public AjaxResult edit(@RequestBody MallSchedulingTime mallTimeConfig) {
        return toAjax(mallSchedulingTimeService.updateById(mallTimeConfig));
    }
    /**
     * 修改医生是否停诊状态接口
     */
    @PostMapping("/updateIsClose")
    @ApiOperation(value = "修改医生是否停诊状态接口")
    public AjaxResult updateIsClose(@RequestBody MallSchedulingTime mallTimeConfig) {
        MallSchedulingTime schedulingTime = mallSchedulingTimeService.getById(mallTimeConfig.getId());
        if(null !=schedulingTime){
            schedulingTime.setIsClose(mallTimeConfig.getIsClose());
             if (mallSchedulingTimeService.updateById(schedulingTime)) {
                if(schedulingTime.getIsClose().equals("Y")){
                    //停诊后取消所有停诊当天的挂号记录
//                    LambdaQueryWrapper<GhCusRegisterInfo> wq=new LambdaQueryWrapper<>();
//                    wq.eq(GhCusRegisterInfo::getUserId,schedulingTime.getUserId());
//                    wq.between(GhCusRegisterInfo::getRegisterTime,DateUtil.beginOfDay(schedulingTime.getTime()),DateUtil.endOfDay(schedulingTime.getTime()));
//                    List<GhCusRegisterInfo> infoList = cusRegisterInfoService.list(wq);
//                    if(null !=infoList && infoList.size()>0){
//                        for (GhCusRegisterInfo registerInfo : infoList) {
//                            registerInfo.setIsExpiration("Y");
//                            registerInfo.setIsVisit("Y");
//                            cusRegisterInfoService.updateById(registerInfo);
//                            //若收费还将退费
//                            //短信或邮箱告知客户
//                        }
//                    }
                }
                return AjaxResult.success();
            }
        }
        return AjaxResult.error();
    }
    /**
     * 删除排班时间
     */
    @DeleteMapping("/{ids}")
    @ApiOperation(value = "删除医生排班时间接口")
    public AjaxResult remove(@PathVariable Long[] ids) {
        return toAjax(mallSchedulingTimeService.removeByIds(Arrays.asList(ids)));
    }
    /**
     * 获取排班信息临时数据接口
     */
    @PostMapping("/getSchedulingInformation")
    @ApiOperation(value = "获取排班信息临时数据接口")
    public AjaxResult getSchedulingInformation(@RequestBody MallSchedulingTimeDto dto) {
        List<MallSchedulingTime> list=new ArrayList<>();
        if(null !=dto){
            if(null !=dto.getStartTime() && null !=dto.getEndTime()){
                List<Date> dateList = mallSchedulingTimeService.getDateListByBetweenTime(dto.getStartTime(), dto.getEndTime());
                if(null !=dateList && dateList.size()>0){
                    if (dto.getMOrA()==1){
                        for (Date date : dateList) {
                            MallSchedulingTime schedulingTime =new MallSchedulingTime();
                            schedulingTime.setTime(DateUtil.parse(DateUtil.format(date,"yyyy-MM-dd")));
                            schedulingTime.setAllNum(Long.valueOf(dto.getAllNum()));
                            schedulingTime.setNowNum(Long.valueOf(dto.getAllNum()));
                            schedulingTime.setWeek(DateUtils.dateToWeek(date));
                            schedulingTime.setMOrA("上午");
                            schedulingTime.setUserId(dto.getUserId());
                            schedulingTime.setUserName(dto.getUserName());
                            schedulingTime.setIsClose("N");
//                              schedulingTime.setTimeSlot(s);
                            schedulingTime.setNumType(dto.getNumType());
                            schedulingTime.setDeptId(dto.getDeptId());
                            schedulingTime.setDeptName(dto.getDeptName());
                            list.add(schedulingTime);
                        }
                    }else if (dto.getMOrA()==2){
                        for (Date date : dateList) {
                            MallSchedulingTime schedulingTime =new MallSchedulingTime();
                            schedulingTime.setTime(DateUtil.parse(DateUtil.format(date,"yyyy-MM-dd")));
                            schedulingTime.setAllNum(Long.valueOf(dto.getAllNum()));
                            schedulingTime.setNowNum(Long.valueOf(dto.getAllNum()));
                            schedulingTime.setWeek(DateUtils.dateToWeek(date));
                            schedulingTime.setMOrA("下午");
                            schedulingTime.setUserId(dto.getUserId());
                            schedulingTime.setUserName(dto.getUserName());
                            schedulingTime.setIsClose("N");
//                              schedulingTime.setTimeSlot(s);
                            schedulingTime.setNumType(dto.getNumType());
                            schedulingTime.setDeptId(dto.getDeptId());
                            schedulingTime.setDeptName(dto.getDeptName());
                            list.add(schedulingTime);
                        }
                    }else if (dto.getMOrA()==3){
                        for (Date date : dateList) {
                            MallSchedulingTime schedulingTime =new MallSchedulingTime();
                            schedulingTime.setTime(DateUtil.parse(DateUtil.format(date,"yyyy-MM-dd")));
                            schedulingTime.setAllNum(Long.valueOf(dto.getAllNum()));
                            schedulingTime.setNowNum(Long.valueOf(dto.getAllNum()));
                            schedulingTime.setWeek(DateUtils.dateToWeek(date));
                            schedulingTime.setMOrA("上午");
                            schedulingTime.setUserId(dto.getUserId());
                            schedulingTime.setUserName(dto.getUserName());
                            schedulingTime.setIsClose("N");
//                              schedulingTime.setTimeSlot(s);
                            schedulingTime.setNumType(dto.getNumType());
                            schedulingTime.setDeptId(dto.getDeptId());
                            schedulingTime.setDeptName(dto.getDeptName());
                            list.add(schedulingTime);
                            MallSchedulingTime schedulingTime1 =new MallSchedulingTime();
                            schedulingTime1.setTime(DateUtil.parse(DateUtil.format(date,"yyyy-MM-dd")));
                            schedulingTime1.setAllNum(Long.valueOf(dto.getAllNum()));
                            schedulingTime1.setNowNum(Long.valueOf(dto.getAllNum()));
                            schedulingTime1.setWeek(DateUtils.dateToWeek(date));
                            schedulingTime1.setMOrA("下午");
                            schedulingTime1.setUserId(dto.getUserId());
                            schedulingTime1.setUserName(dto.getUserName());
                            schedulingTime1.setIsClose("N");
//                              schedulingTime.setTimeSlot(s);
                            schedulingTime1.setNumType(dto.getNumType());
                            schedulingTime1.setDeptId(dto.getDeptId());
                            schedulingTime1.setDeptName(dto.getDeptName());
                            list.add(schedulingTime1);
                        }
                    }
                }
            }
        }
        return AjaxResult.success(list);
    }
    /**
     * 获取所有医生信息数据列表接口
     */
    @GetMapping("/getUserListBySchedulingTimt")
    @ApiOperation(value = "获取所有医生信息数据列表接口")
    public AjaxResult getUserListBySchedulingTimt(@RequestParam(required = false) @ApiParam(value = "医生姓名") String userName,
                                                  @RequestParam(required = false) @ApiParam(value = "科室") String deptName,
                                                  @RequestParam(defaultValue = "1") @ApiParam(value = "分页") Integer pageNum,
                                                  @RequestParam(defaultValue = "10") @ApiParam(value = "一页展示条数") Integer pageSize) {
        Page<SysUser> page=new Page<>(pageNum,pageSize);
        LambdaQueryWrapper<SysUser> wq=new LambdaQueryWrapper<>();
        if(null !=userName){
            wq.like(SysUser::getNickName,userName);
        }
        if(null !=deptName && !"".equals(deptName)){
            wq.in(SysUser::getDeptId,deptService.getSysDeptId(deptName));
        }
        Page<SysUser> userPage = userService.page(page, wq);
        List<SysUser> list = userPage.getRecords();
        List<DoctorUserVo> voList = new ArrayList<>();
        if(null !=list && list.size()>0){
            for (SysUser user : list) {
                DoctorUserVo vo=new DoctorUserVo();
                vo.setUserId(String.valueOf(user.getUserId()));
                vo.setUserName(user.getNickName());
                vo.setDeptId(String.valueOf(user.getDeptId()));
                vo.setDeptName(deptService.getById(user.getDeptId()).getDeptName());
                DictUserInfo info = userInfoService.getOne(new LambdaQueryWrapper<DictUserInfo>().eq(DictUserInfo::getUserId,user.getUserId()));
                if(null !=info){
                    vo.setCftitle(info.getCftitle());
                }
                List<MallSchedulingTime> timeList = mallSchedulingTimeService.list(new LambdaQueryWrapper<MallSchedulingTime>()
                        .eq(MallSchedulingTime::getUserId, user.getUserId()).orderByDesc(MallSchedulingTime::getTime));
                if(null !=timeList && timeList.size()>0){
                    if(null !=timeList.get(0)){
                        vo.setTime(timeList.get(0).getTime());
                    }
                }
                voList.add(vo);
            }
        }
        Map<String,Object> map=new HashMap<>();
        map.put("total",page.getTotal());
        map.put("voList",voList);
        return AjaxResult.success(map);
    }
    /**
     * 获取预约时间段字典列表
     */
//    @GetMapping("/getTimeList")
//    @ApiOperation(value = "获取预约时间段字典列表")
//    public AjaxResult getTimeList() {
//        LambdaQueryWrapper<SysDictData> wq22 = new LambdaQueryWrapper<>();
//        wq22.eq(SysDictData::getDictType, "yuyue_time_slot");
//        final List<SysDictData> list = dictDataService.list(wq22);
//        return success(list);
//    }
}
ltkj-common/src/main/java/com/ltkj/common/core/domain/entity/MallSchedulingTime.java
New file
@@ -0,0 +1,131 @@
package com.ltkj.common.core.domain.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.ltkj.common.annotation.Excel;
import com.ltkj.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
 * 预约时间对象 mall_time_config
 *
 * @author ltkj_赵佳豪&李格
 * @date 2023-07-18
 */
@Data
@ApiModel
public class MallSchedulingTime extends BaseEntity {
    private static final long serialVersionUID = 1L;
    /**
     * id
     */
    @TableId(type = IdType.AUTO)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;
    /**
     * 日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "日期")
    private Date time;
    /**
     * 预约限号
     */
    @Excel(name = "预约限号")
    @ApiModelProperty(value = "预约限号")
    private Long allNum;
    /**
     * 余数
     */
    @Excel(name = "余数")
    @ApiModelProperty(value = "余数")
    private Long nowNum;
    @ApiModelProperty(value = "星期")
    private String week;
    @ApiModelProperty(value = "上午或下午")
    private String mOrA;
    @ApiModelProperty(value = "医生id")
    private String userId;
    @ApiModelProperty(value = "医生姓名")
    private String userName;
    @ApiModelProperty(value = "院区id")
    private String hospId;
    @ApiModelProperty(value = "院区名字")
    private String hospName;
    @ApiModelProperty(value = "是否停诊")
    private String isClose;
    @ApiModelProperty(value = "时间段")
    private String timeSlot;
    @ApiModelProperty(value = "号类")
    private String numType;
    @ApiModelProperty(value = "科室id")
    private String deptId;
    @ApiModelProperty(value = "科室名")
    private String deptName;
    @ApiModelProperty(value = "角色名称")
    @TableField(exist = false)
    private String roleName;
    @ApiModelProperty(value = "医生头像")
    @TableField(exist = false)
    private String avatar;
    /**
     * 处方职称(PT10.01.029)
     */
    @ApiModelProperty(value = "处方职称")
    @TableField(exist = false)
    private String cftitle;
    /**
     * 简介
     */
    @ApiModelProperty(value = "简介")
    @TableField(exist = false)
    private String profile;
    /**
     * 擅长领域
     */
    @ApiModelProperty(value = "擅长领域")
    @TableField(exist = false)
    private String expGoodArea;
    @TableField(exist = false)
    private String startTime;
    @TableField(exist = false)
    private String endTime;
}
ltkj-common/src/main/java/com/ltkj/common/utils/DateUtils.java
@@ -8,6 +8,7 @@
import java.time.LocalTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.Calendar;
import java.util.Date;
import org.apache.commons.lang3.time.DateFormatUtils;
@@ -162,4 +163,21 @@
        ZonedDateTime zdt = localDateTime.atZone(ZoneId.systemDefault());
        return Date.from(zdt.toInstant());
    }
    /**
     * 根据日期获取 星期
     * @param
     * @return
     */
    public static String dateToWeek(Date date) {
        SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd");
        String[] weekDays = {"星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"};
        Calendar cal = Calendar.getInstance();
        cal.setTime(date);
        //一周的第几天
        int w = cal.get(Calendar.DAY_OF_WEEK) - 1;
        if (w < 0)
            w = 0;
        return weekDays[w];
    }
}
ltkj-framework/src/main/java/com/ltkj/framework/config/MatchUtils.java
@@ -7489,4 +7489,32 @@
        }
        return realname;
    }
    /**
     * 根据时间段判断上午还是下午
     *
     * @param timeSlot
     * @return
     */
//    public static String getMorA(String timeSlot){
//        String reg="";
//        switch (timeSlot){
//            case "1":
//            case "2":
//            case "3":
//            case "4":
//                reg="上午";
//                break;
//
//            case "5":
//            case "6":
//            case "7":
//                reg="下午";
//                break;
//
//            default:break;
//        }
//
//        return reg;
//    }
}
ltkj-hosp/src/main/java/com/ltkj/hosp/dto/MallSchedulingTimeDto.java
New file
@@ -0,0 +1,50 @@
package com.ltkj.hosp.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
 * @Company: 西安路泰科技有限公司
 * @Author: zjh
 * @Date: 2023/8/23 11:33
 */
@Data
@ApiModel
public class MallSchedulingTimeDto {
    @ApiModelProperty(value = "医生id")
    private String userId;
    @ApiModelProperty(value = "医生姓名")
    private String userName;
    @ApiModelProperty(value = "科室id")
    private String deptId;
    @ApiModelProperty(value = "科室名")
    private String deptName;
    @ApiModelProperty(value = "上午/下午")
    private Integer mOrA;
    @ApiModelProperty(value = "号类")
    private String numType;
    @ApiModelProperty(value = "总数")
    private Integer allNum;
    @ApiModelProperty(value = "开始时间")
    private String startTime;
    @ApiModelProperty(value = "结束时间")
    private String endTime;
}
ltkj-hosp/src/main/java/com/ltkj/hosp/vodomain/DoctorUserVo.java
New file
@@ -0,0 +1,39 @@
package com.ltkj.hosp.vodomain;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
 * @Company: 西安路泰科技有限公司
 * @Author: zjh
 * @Date: 2023/8/23 13:39
 */
@Data
@ApiModel
public class DoctorUserVo {
    @ApiModelProperty(value = "医生id")
    private String userId;
    @ApiModelProperty(value = "医生名字")
    private String userName;
    @ApiModelProperty(value = "部门ID")
    private String deptId;
    @ApiModelProperty(value = "部门名")
    private String deptName;
    @ApiModelProperty(value = "处方职称")
    private String cftitle;
    @ApiModelProperty(value = "日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date time;
}
ltkj-hosp/src/main/java/com/ltkj/mall/mapper/MallSchedulingTimeMapper.java
New file
@@ -0,0 +1,79 @@
package com.ltkj.mall.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ltkj.common.core.domain.entity.MallSchedulingTime;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.Date;
import java.util.List;
/**
 * 预约时间Mapper接口
 *
 * @author ltkj_赵佳豪&李格
 * @date 2023-07-18
 */
@Mapper
public interface MallSchedulingTimeMapper extends BaseMapper<MallSchedulingTime> {
    /**
     * 查询预约时间
     *
     * @param id 预约时间主键
     * @return 预约时间
     */
    public MallSchedulingTime selectMallSchedulingTimeById(Long id);
    /**
     * 查询预约时间列表
     *
     * @param mallTimeConfig 预约时间
     * @return 预约时间集合
     */
    public List<MallSchedulingTime> selectMallSchedulingTimeList(MallSchedulingTime mallTimeConfig);
    /**
     * 新增预约时间
     *
     * @param mallTimeConfig 预约时间
     * @return 结果
     */
    public int insertMallSchedulingTime(MallSchedulingTime mallTimeConfig);
    /**
     * 修改预约时间
     *
     * @param mallTimeConfig 预约时间
     * @return 结果
     */
    public int updateMallSchedulingTime(MallSchedulingTime mallTimeConfig);
    /**
     * 删除预约时间
     *
     * @param id 预约时间主键
     * @return 结果
     */
    public int deleteMallSchedulingTimeById(Long id);
    /**
     * 批量删除预约时间
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteMallSchedulingTimeByIds(Long[] ids);
    @Select("SELECT\n" +
            " date_add( date_sub(#{startTime},interval 1 day), INTERVAL ( cast( help_topic_id AS signed INTEGER ) + 1 ) day ) day \n" +
            "FROM\n" +
            " mysql.help_topic \n" +
            "WHERE\n" +
            " help_topic_id < DATEDIFF(#{endTime},date_sub(#{startTime},interval 1 day))\n" +
            "ORDER BY\n" +
            " help_topic_id")
    List<Date> getDateListByBetweenTime(@Param("startTime") String startTime,@Param("endTime") String endTime);
}
ltkj-hosp/src/main/java/com/ltkj/mall/mapper/MallTimeConfigMapper.java
@@ -3,7 +3,6 @@
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ltkj.mall.domain.MallSearchHistory;
import com.ltkj.mall.domain.MallTimeConfig;
import org.apache.ibatis.annotations.Mapper;
ltkj-hosp/src/main/java/com/ltkj/mall/service/IMallSchedulingTimeService.java
New file
@@ -0,0 +1,65 @@
package com.ltkj.mall.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ltkj.common.core.domain.entity.MallSchedulingTime;
import java.util.Date;
import java.util.List;
/**
 * 预约时间Service接口
 *
 * @author ltkj_赵佳豪&李格
 * @date 2023-07-18
 */
public interface IMallSchedulingTimeService extends IService<MallSchedulingTime> {
    /**
     * 查询预约时间
     *
     * @param id 预约时间主键
     * @return 预约时间
     */
    public MallSchedulingTime selectMallTimeConfigById(Long id);
    /**
     * 查询预约时间列表
     *
     * @param mallTimeConfig 预约时间
     * @return 预约时间集合
     */
    public List<MallSchedulingTime> selectMallTimeConfigList(MallSchedulingTime mallTimeConfig);
    /**
     * 新增预约时间
     *
     * @param mallTimeConfig 预约时间
     * @return 结果
     */
    public int insertMallTimeConfig(MallSchedulingTime mallTimeConfig);
    /**
     * 修改预约时间
     *
     * @param mallTimeConfig 预约时间
     * @return 结果
     */
    public int updateMallTimeConfig(MallSchedulingTime mallTimeConfig);
    /**
     * 批量删除预约时间
     *
     * @param ids 需要删除的预约时间主键集合
     * @return 结果
     */
    public int deleteMallTimeConfigByIds(Long[] ids);
    /**
     * 删除预约时间信息
     *
     * @param id 预约时间主键
     * @return 结果
     */
    public int deleteMallTimeConfigById(Long id);
    List<Date> getDateListByBetweenTime(String startTime,String endTime);
}
ltkj-hosp/src/main/java/com/ltkj/mall/service/impl/MallSchedulingTimeServiceImpl.java
New file
@@ -0,0 +1,98 @@
package com.ltkj.mall.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ltkj.common.core.domain.entity.MallSchedulingTime;
import com.ltkj.common.utils.DateUtils;
import com.ltkj.mall.mapper.MallSchedulingTimeMapper;
import com.ltkj.mall.mapper.MallTimeConfigMapper;
import com.ltkj.mall.service.IMallSchedulingTimeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
 * 预约时间Service业务层处理
 *
 * @author ltkj_赵佳豪&李格
 * @date 2023-07-18
 */
@Service
public class MallSchedulingTimeServiceImpl extends ServiceImpl<MallSchedulingTimeMapper, MallSchedulingTime>  implements IMallSchedulingTimeService {
    @Autowired
    private MallSchedulingTimeMapper mallTimeConfigMapper;
    /**
     * 查询预约时间
     *
     * @param id 预约时间主键
     * @return 预约时间
     */
    @Override
    public MallSchedulingTime selectMallTimeConfigById(Long id) {
        return mallTimeConfigMapper.selectMallSchedulingTimeById(id);
    }
    /**
     * 查询预约时间列表
     *
     * @param mallTimeConfig 预约时间
     * @return 预约时间
     */
    @Override
    public List<MallSchedulingTime> selectMallTimeConfigList(MallSchedulingTime mallTimeConfig) {
        return mallTimeConfigMapper.selectMallSchedulingTimeList(mallTimeConfig);
    }
    /**
     * 新增预约时间
     *
     * @param mallTimeConfig 预约时间
     * @return 结果
     */
    @Override
    public int insertMallTimeConfig(MallSchedulingTime mallTimeConfig) {
                mallTimeConfig.setCreateTime(DateUtils.getNowDate());
            return mallTimeConfigMapper.insertMallSchedulingTime(mallTimeConfig);
    }
    /**
     * 修改预约时间
     *
     * @param mallTimeConfig 预约时间
     * @return 结果
     */
    @Override
    public int updateMallTimeConfig(MallSchedulingTime mallTimeConfig) {
                mallTimeConfig.setUpdateTime(DateUtils.getNowDate());
        return mallTimeConfigMapper.updateMallSchedulingTime(mallTimeConfig);
    }
    /**
     * 批量删除预约时间
     *
     * @param ids 需要删除的预约时间主键
     * @return 结果
     */
    @Override
    public int deleteMallTimeConfigByIds(Long[] ids) {
        return mallTimeConfigMapper.deleteMallSchedulingTimeByIds(ids);
    }
    /**
     * 删除预约时间信息
     *
     * @param id 预约时间主键
     * @return 结果
     */
    @Override
    public int deleteMallTimeConfigById(Long id) {
        return mallTimeConfigMapper.deleteMallSchedulingTimeById(id);
    }
    @Override
    public List<Date> getDateListByBetweenTime(String startTime, String endTime) {
        return mallTimeConfigMapper.getDateListByBetweenTime(startTime,endTime);
    }
}
ltkj-system/src/main/java/com/ltkj/system/mapper/SysDeptMapper.java
@@ -6,6 +6,7 @@
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import com.ltkj.common.core.domain.entity.SysDept;
import org.apache.ibatis.annotations.Select;
/**
 * 部门管理 数据层
@@ -118,4 +119,7 @@
     * @return 结果
     */
    public int deleteDeptById(Long deptId);
    @Select(" SELECT a.dept_id FROM sys_dept a WHERE a.deleted=0  AND a.dept_name like concat('%',#{deptName},'%')")
    List<String> getSysDeptId(String deptName);
}
ltkj-system/src/main/java/com/ltkj/system/service/ISysDeptService.java
@@ -131,4 +131,7 @@
     * @return 结果
     */
    public int updateDeptStatus(SysDept dept);
    List<String> getSysDeptId(String deptName);
}
ltkj-system/src/main/java/com/ltkj/system/service/impl/SysDeptServiceImpl.java
@@ -321,4 +321,10 @@
    private boolean hasChild(List<SysDept> list, SysDept t) {
        return getChildList(list, t).size() > 0;
    }
    @Override
    public List<String> getSysDeptId(String deptName) {
        return deptMapper.getSysDeptId(deptName);
    }
}