医护人员排班系统2024(代码+论文+开题报告)
立即下载
资源介绍:
CSDN展示地址:
http://t.csdnimg.cn/YZ3z4
【项目资源】:包含前端、后端、移动开发、操作系统、人工智能、物联网、信息化管理、数据库、硬件开发、大数据、课程资源、音视频、网站开发等各种技术项目的源码。包括STM32、ESP8266、PHP、QT、Linux、iOS、C++、Java、python、web、C#、EDA、proteus、RTOS等项目的源码。
【项目质量】:所有源码都经过严格测试,可以直接运行。功能在确认正常工作后才上传。
【适用人群】:适用于希望学习不同技术领域的小白或进阶学习者。可作为毕设项目、课程设计、大作业、工程实训或初期项目立项。
【附加价值】:项目具有较高的学习借鉴价值,也可直接拿来修改复刻。对于有一定基础或热衷于研究的人来说,可以在这些基础代码上进行修改和扩展,实现其他功能。
【沟通交流】:有任何使用上的问题,欢迎随时与博主沟通,博主会及时解答。鼓励下载和使用,并欢迎大家互相学习,共同进步。
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.YihuEntity;
import com.entity.view.YihuView;
import com.service.YihuService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
* 医护
* 后端接口
* @author
* @email
* @date 2021-05-08 16:41:19
*/
@RestController
@RequestMapping("/yihu")
public class YihuController {
@Autowired
private YihuService yihuService;
@Autowired
private TokenService tokenService;
/**
* 登录
*/
@IgnoreAuth
@RequestMapping(value = "/login")
public R login(String username, String password, String captcha, HttpServletRequest request) {
YihuEntity user = yihuService.selectOne(new EntityWrapper().eq("gonghao", username));
if(user==null || !user.getMima().equals(password)) {
return R.error("账号或密码不正确");
}
String token = tokenService.generateToken(user.getId(), username,"yihu", "医护" );
return R.ok().put("token", token);
}
/**
* 注册
*/
@IgnoreAuth
@RequestMapping("/register")
public R register(@RequestBody YihuEntity yihu){
//ValidatorUtils.validateEntity(yihu);
YihuEntity user = yihuService.selectOne(new EntityWrapper().eq("gonghao", yihu.getGonghao()));
if(user!=null) {
return R.error("注册用户已存在");
}
Long uId = new Date().getTime();
yihu.setId(uId);
yihuService.insert(yihu);
return R.ok();
}
/**
* 退出
*/
@RequestMapping("/logout")
public R logout(HttpServletRequest request) {
request.getSession().invalidate();
return R.ok("退出成功");
}
/**
* 获取用户的session用户信息
*/
@RequestMapping("/session")
public R getCurrUser(HttpServletRequest request){
Long id = (Long)request.getSession().getAttribute("userId");
YihuEntity user = yihuService.selectById(id);
return R.ok().put("data", user);
}
/**
* 密码重置
*/
@IgnoreAuth
@RequestMapping(value = "/resetPass")
public R resetPass(String username, HttpServletRequest request){
YihuEntity user = yihuService.selectOne(new EntityWrapper().eq("gonghao", username));
if(user==null) {
return R.error("账号不存在");
}
user.setMima("123456");
yihuService.updateById(user);
return R.ok("密码已重置为:123456");
}
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map params,YihuEntity yihu,
HttpServletRequest request){
EntityWrapper ew = new EntityWrapper();
PageUtils page = yihuService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yihu), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map params,YihuEntity yihu,
HttpServletRequest request){
EntityWrapper ew = new EntityWrapper();
PageUtils page = yihuService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yihu), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( YihuEntity yihu){
EntityWrapper ew = new EntityWrapper();
ew.allEq(MPUtil.allEQMapPre( yihu, "yihu"));
return R.ok().put("data", yihuService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(YihuEntity yihu){
EntityWrapper< YihuEntity> ew = new EntityWrapper< YihuEntity>();
ew.allEq(MPUtil.allEQMapPre( yihu, "yihu"));
YihuView yihuView = yihuService.selectView(ew);
return R.ok("查询医护成功").put("data", yihuView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
YihuEntity yihu = yihuService.selectById(id);
return R.ok().put("data", yihu);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
YihuEntity yihu = yihuService.selectById(id);
return R.ok().put("data", yihu);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody YihuEntity yihu, HttpServletRequest request){
yihu.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(yihu);
YihuEntity user = yihuService.selectOne(new EntityWrapper().eq("gonghao", yihu.getGonghao()));
if(user!=null) {
return R.error("用户已存在");
}
yihu.setId(new Date().getTime());
yihuService.insert(yihu);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody YihuEntity yihu, HttpServletRequest request){
yihu.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(yihu);
YihuEntity user = yihuService.selectOne(new EntityWrapper().eq("gonghao", yihu.getGonghao()));
if(user!=null) {
return R.error("用户已存在");
}
yihu.setId(new Date().getTime());
yihuService.insert(yihu);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody YihuEntity yihu, HttpServletRequest request){
//ValidatorUtils.validateEntity(yihu);
yihuService.updateById(yihu);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
yihuService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 提醒接口
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer rem
资源文件列表:
java.zip 大约有150个文件