ltkj-admin/src/main/java/com/ltkj/web/controller/system/StjMemoController.java
@@ -1,18 +1,18 @@ package com.ltkj.web.controller.system; import java.util.List; import java.text.ParseException; import java.util.*; import javax.servlet.http.HttpServletResponse; import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ltkj.common.utils.DateUtils; import com.ltkj.mall.service.IMallSchedulingTimeService; import io.swagger.annotations.ApiParam; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.*; import com.ltkj.common.annotation.Log; import com.ltkj.common.core.controller.BaseController; import com.ltkj.common.core.domain.AjaxResult; @@ -33,6 +33,9 @@ public class StjMemoController extends BaseController { @Autowired private IStjMemoService stjMemoService; @Autowired private IMallSchedulingTimeService mallSchedulingTimeService; /** * 查询备忘录列表 @@ -73,7 +76,8 @@ @Log(title = "备忘录", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody StjMemo stjMemo) { return toAjax(stjMemoService.insertStjMemo(stjMemo)); stjMemo.setMFlag("0"); return toAjax(stjMemoService.save(stjMemo)); } /** @@ -83,7 +87,7 @@ @Log(title = "备忘录", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody StjMemo stjMemo) { return toAjax(stjMemoService.updateStjMemo(stjMemo)); return toAjax(stjMemoService.saveOrUpdate(stjMemo)); } /** @@ -93,6 +97,47 @@ @Log(title = "备忘录", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(stjMemoService.deleteStjMemoByIds(ids)); return toAjax(stjMemoService.removeByIds(Arrays.asList(ids))); } /** * 根据userid和日期查看当日所有事件 */ @GetMapping("/listByUserAndDate") public AjaxResult listByUserAndDate(@RequestParam String userId, @RequestParam Date mDate) { LambdaQueryWrapper<StjMemo> wq=new LambdaQueryWrapper<>(); wq.eq(StjMemo::getUserId,userId); wq.eq(StjMemo::getMDate,mDate); List<StjMemo> list = stjMemoService.list(wq); return AjaxResult.success(list); } /** * 根据userid和日期查看当月所有事件 */ @GetMapping("/listByDate") public AjaxResult listByDate(@RequestParam String userId, @RequestParam Date mDate) { Map<String,List<StjMemo>> res=new HashMap<>(); List<Date> dateList = mallSchedulingTimeService.getDateListByBetweenTime(DateUtil.format(DateUtil.beginOfMonth(mDate),"yyyy-MM-dd HH:mm:ss"), DateUtil.format(DateUtil.endOfMonth(mDate),"yyyy-MM-dd HH:mm:ss")); for (Date date : dateList) { LambdaQueryWrapper<StjMemo> wq=new LambdaQueryWrapper<>(); wq.eq(StjMemo::getUserId,userId); wq.eq(StjMemo::getMDate,date); List<StjMemo> list = stjMemoService.list(wq); String format = DateUtil.format(date, "yyyy-MM-dd"); if (list.size()==0){ StjMemo stjMemo=new StjMemo(); stjMemo.setTitle("无"); stjMemo.setMFlag("0"); list.add(stjMemo); } res.put(format,list); } return AjaxResult.success(res); } } ltkj-admin/src/main/java/com/ltkj/web/controller/system/StjSchedulingTimeController.java
@@ -15,9 +15,8 @@ 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 com.ltkj.system.domain.SysUserRole; import com.ltkj.system.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; @@ -27,6 +26,7 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import java.util.*; import java.util.stream.Collectors; /** * 排班时间Controller @@ -49,6 +49,10 @@ @Autowired private ISysDictDataService dictDataService; @Autowired private ISysRoleService roleService; @Autowired private SysUserRoleService userRoleService; /** @@ -221,8 +225,10 @@ */ @PostMapping("/getSchedulingInformation") @ApiOperation(value = "获取排班信息临时数据接口") public AjaxResult getSchedulingInformation(@RequestBody MallSchedulingTimeDto dto) { public AjaxResult getSchedulingInformation(@RequestBody List<MallSchedulingTimeDto> dtos) { List<MallSchedulingTime> list=new ArrayList<>(); if (dtos!=null){ for (MallSchedulingTimeDto dto : dtos) { if(null !=dto){ if(null !=dto.getStartTime() && null !=dto.getEndTime()){ List<Date> dateList = mallSchedulingTimeService.getDateListByBetweenTime(dto.getStartTime(), dto.getEndTime()); @@ -298,6 +304,9 @@ } } } } } return AjaxResult.success(list); } @@ -311,9 +320,17 @@ 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) { @RequestParam(defaultValue = "10") @ApiParam(value = "一页展示条数") Integer pageSize, @RequestParam(required = false) @ApiParam(value = "角色id") Long roleId) { Page<SysUser> page=new Page<>(pageNum,pageSize); LambdaQueryWrapper<SysUser> wq=new LambdaQueryWrapper<>(); if (roleId!=null){ LambdaQueryWrapper<SysUserRole> wq111=new LambdaQueryWrapper<>(); wq111.eq(SysUserRole::getRoleId,roleId); final List<SysUserRole> list1 = userRoleService.list(wq111); final List<Long> collect = list1.stream().map(SysUserRole::getUserId).collect(Collectors.toList()); wq.in(SysUser::getUserId,collect); } if(null !=userName){ wq.like(SysUser::getNickName,userName); } @@ -341,6 +358,7 @@ vo.setTime(timeList.get(0).getTime()); } } voList.add(vo); } } ltkj-hosp/src/main/java/com/ltkj/mall/domain/StjMemo.java
@@ -3,6 +3,7 @@ import java.util.Date; 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; @@ -58,8 +59,8 @@ /** * 时间点 */ @JsonFormat(pattern = "yyyy-MM-dd") @Excel(name = "时间点", width = 30, dateFormat = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @Excel(name = "时间点", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date mTime; /** @@ -98,7 +99,8 @@ @Excel(name = "紧急状态(0低/1中/2高)") private String stateLevel; @TableField(exist = false) private String format; @Override