package com.pet.hospital.controller;
import com.github.pagehelper.PageInfo;
import com.pet.hospital.constants.SysConstant;
import com.pet.hospital.domain.Medicinal;
import com.pet.hospital.domain.MedicinalRelation;
import com.pet.hospital.service.MedicinalRelationService;
import com.pet.hospital.service.MedicinalService;
import com.pet.hospital.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpSession;
import java.util.List;
/**
* @author
* @Date 2021/03/30 18:18
*/
@Controller
@RequestMapping("/medicinal")
public class MedicinalController {
@Autowired
MedicinalService medicinalService;
@Autowired
MedicinalRelationService medicinalRelationService;
@RequestMapping("/add")
@ResponseBody
public R add(Medicinal medicinal) {
if (!medicinal.getMedicinalName().isEmpty()) {
Long res = medicinalService.add(medicinal);
if (res != null) {
return R.exeSuccess();
}
}
return R.exeFail(SysConstant.parameterMsg);
}
@RequestMapping("/list")
@ResponseBody
public R list(Medicinal medicinal, @RequestParam(required = false, defaultValue = "1") int page, @RequestParam(required = false, defaultValue = "10") int limit) {
PageInfo<Medicinal> pageInfo = medicinalService.list(medicinal, page, limit);
if (pageInfo.getList() != null && pageInfo.getList().size() != 0) {
return R.exeSuccess(pageInfo.getList(), pageInfo.getTotal());
}
return R.exeFail(SysConstant.queryFail);
}
@RequestMapping("/delete")
@ResponseBody
public R delete(String id) {
if (id != null) {
int res = medicinalService.delete(id);
if (res != 0) {
return R.exeSuccess();
}
}
return R.exeFail(SysConstant.parameterMsg);
}
@RequestMapping("/update")
public String update(String id, Model model) {
if (id != null) {
Medicinal medicinal = medicinalService.queryById(id);
model.addAttribute("medicinal", medicinal);
return "store/update";
}
return "store/list";
}
@RequestMapping("/receive_list")
@ResponseBody
public R receiveList(Medicinal medicinal, @RequestParam(required = false, defaultValue = "1") int page, @RequestParam(required = false, defaultValue = "10") int limit) {
PageInfo<Medicinal> pageInfo = medicinalService.receiveList(medicinal, page, limit);
if (pageInfo.getList() != null && pageInfo.getList().size() != 0) {
return R.exeSuccess(pageInfo.getList(), pageInfo.getTotal());
}
return R.exeFail(SysConstant.queryFail);
}
@RequestMapping("/medicinal_receive")
@ResponseBody
public R medicinalReceive(MedicinalRelation medicinalRelation, HttpSession session) {
Long doctorId = (Long) session.getAttribute("doctorId");
medicinalRelation.setDoctorId(doctorId);
int res = medicinalRelationService.medicinalReceive(medicinalRelation);
if (res != 0) {
return R.exeSuccess();
}
return R.exeFail();
}
@RequestMapping("/medicinal_record")
@ResponseBody
public R recordList(HttpSession session, Medicinal medicinal, @RequestParam(required = false, defaultValue = "1") int page, @RequestParam(required = false, defaultValue = "10") int limit) {
Long doctorId = (Long) session.getAttribute("doctorId");
medicinal.setDoctorId(doctorId);
PageInfo<Medicinal> pageInfo = medicinalService.recordList(medicinal, page, limit);
if (pageInfo.getList() != null && pageInfo.getList().size() != 0) {
return R.exeSuccess(pageInfo.getList(), pageInfo.getTotal());
}
return R.exeFail(SysConstant.queryFail);
}
@RequestMapping("/do_update")
@ResponseBody
public R doUpdate(Medicinal medicinal) {
int res = medicinalService.doUpdate(medicinal);
if (res != 0) {
return R.exeSuccess();
}
return R.exeFail();
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
毕业设计基于Javaweb的宠物医院管理系统源码.zip毕业设计基于Javaweb的宠物医院管理系统源码.zip毕业设计基于Javaweb的宠物医院管理系统源码.zip毕业设计基于Javaweb的宠物医院管理系统源码.zip毕业设计基于Javaweb的宠物医院管理系统源码.zip毕业设计基于Javaweb的宠物医院管理系统源码.zip毕业设计基于Javaweb的宠物医院管理系统源码.zip毕业设计基于Javaweb的宠物医院管理系统源码.zip毕业设计基于Javaweb的宠物医院管理系统源码.zip毕业设计基于Javaweb的宠物医院管理系统源码.zip毕业设计基于Javaweb的宠物医院管理系统源码.zip
资源推荐
资源详情
资源评论
收起资源包目录
毕业设计基于Javaweb的宠物医院管理系统源码.zip (145个子文件)
mvnw.cmd 7KB
layui.css 73KB
layer.css 14KB
layui.mobile.css 10KB
laydate.css 7KB
code.css 1KB
login.css 834B
iconfont.eot 46KB
loading-0.gif 6KB
loading-2.gif 2KB
loading-1.gif 701B
doc_index.html 4KB
add.html 4KB
admin_index.html 4KB
add.html 4KB
update.html 4KB
store_index.html 4KB
emp_index.html 4KB
pet_info.html 4KB
update_doctor.html 3KB
index.html 2KB
update.html 2KB
add.html 2KB
login.html 2KB
message_board.html 2KB
modify_status.html 1KB
list.html 1KB
modify_password.html 1KB
list.html 1KB
list.html 851B
doctor_list.html 842B
list.html 840B
medicinal_receive.html 770B
medicinal_record.html 653B
MedicinalController.java 4KB
Pet.java 4KB
DoctorController.java 4KB
AccountServiceImpl.java 4KB
DoctorServiceImpl.java 4KB
Account.java 3KB
MedicinalServiceImpl.java 3KB
PetServiceImpl.java 3KB
AccountController.java 3KB
RouteController.java 2KB
PetController.java 2KB
LoginController.java 2KB
R.java 2KB
Doctor.java 2KB
MessageBoardController.java 2KB
Medicinal.java 2KB
MessageBoardServiceImpl.java 2KB
UploadController.java 1KB
MessageBoard.java 1KB
SysConstant.java 1KB
MedicinalRelationServiceImpl.java 1KB
MyWebConfigurer.java 1015B
MedicinalRelation.java 945B
AccountRelation.java 785B
LoginInterceptor.java 750B
MedicinalMapper.java 747B
PetRelation.java 725B
AccountRelationServiceImpl.java 689B
MedicinalService.java 634B
DoctorService.java 625B
LoginServiceImpl.java 577B
AccountService.java 554B
HospitalApplication.java 541B
FileUpload.java 535B
DoctorMapper.java 503B
PetService.java 495B
PetMapper.java 422B
AccountMapper.java 420B
MedicinalRelationMapper.java 380B
AccountRelationMapper.java 378B
PetRelationMapper.java 355B
FileUtil.java 331B
MessageBoardService.java 326B
MessageBoardMapper.java 282B
AccountRelationService.java 265B
MedicinalRelationService.java 257B
HospitalApplicationTests.java 232B
LoginService.java 210B
LoginMapper.java 208B
bg.jpg 1.01MB
jquery-3.4.1.js 284KB
layui.all.js 272KB
jquery.js 95KB
table.js 31KB
mobile.js 31KB
laydate.js 27KB
layer.js 22KB
layedit.js 12KB
colorpicker.js 11KB
tree.js 11KB
layui.js 11KB
form.js 9KB
upload.js 7KB
element.js 7KB
slider.js 7KB
transfer.js 6KB
共 145 条
- 1
- 2
资源评论
FL1768317420
- 粉丝: 4635
- 资源: 4814
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功