基于微信小程序的高校餐厅食品留样管理系统设计与实现-计算机毕业设计源码+LW文档
发布时间:2023-12-04 08:51:33 322
相关标签:
开发语言:Java 框架:ssm JDK版本:JDK1.8 服务器:tomcat7 数据库:mysql 5.7(一定要5.7版本) 数据库工具:Navicat11 开发软件:eclipse/myeclipse/idea Maven包:Maven3.3.9 浏览器:谷歌浏览器
小程序框架:uniapp 小程序开发软件:HBuilder X 小程序运行软件:微信开发者
后台逻辑代码: /**
- 留样食品
- 后端接口
- @author
- @date 2022-04-26 22:52:55
*/
@RestController
@RequestMapping("/liuyangshipin")
public class LiuyangshipinController {
@Autowired
private LiuyangshipinService liuyangshipinService;
/**
- 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map
params,LiuyangshipinEntity liuyangshipin, HttpServletRequest request){ String tableName = request.getSession().getAttribute("tableName").toString(); if(tableName.equals("chuangkouyuangong")) { liuyangshipin.setYuangonggonghao((String)request.getSession().getAttribute("username")); } if(tableName.equals("chuangkoufuzeren")) { liuyangshipin.setChuangkoubianhao((String)request.getSession().getAttribute("username")); } EntityWrapper(); PageUtils page = liuyangshipinService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, liuyangshipin), params), params));
return R.ok().put("data", page); }
/**
- 前端列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map
params,LiuyangshipinEntity liuyangshipin, HttpServletRequest request){ EntityWrapper(); PageUtils page = liuyangshipinService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, liuyangshipin), params), params)); return R.ok().put("data", page); }
/**
- 列表 */ @RequestMapping("/lists") public R list( LiuyangshipinEntity liuyangshipin){ EntityWrapper(); ew.allEq(MPUtil.allEQMapPre( liuyangshipin, "liuyangshipin")); return R.ok().put("data", liuyangshipinService.selectListView(ew)); }
/**
- 查询 */ @RequestMapping("/query") public R query(LiuyangshipinEntity liuyangshipin){ EntityWrapper< LiuyangshipinEntity> ew = new EntityWrapper< LiuyangshipinEntity>(); ew.allEq(MPUtil.allEQMapPre( liuyangshipin, "liuyangshipin")); LiuyangshipinView liuyangshipinView = liuyangshipinService.selectView(ew); return R.ok("查询留样食品成功").put("data", liuyangshipinView); }
/**
- 后端详情 */ @RequestMapping("/info/{id}") public R info(@PathVariable("id") Long id){ LiuyangshipinEntity liuyangshipin = liuyangshipinService.selectById(id); return R.ok().put("data", liuyangshipin); }
/**
- 前端详情 */ @RequestMapping("/detail/{id}") public R detail(@PathVariable("id") Long id){ LiuyangshipinEntity liuyangshipin = liuyangshipinService.selectById(id); return R.ok().put("data", liuyangshipin); }
/**
- 后端保存 */ @RequestMapping("/save") public R save(@RequestBody LiuyangshipinEntity liuyangshipin, HttpServletRequest request){ liuyangshipin.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue()); //ValidatorUtils.validateEntity(liuyangshipin); liuyangshipinService.insert(liuyangshipin); return R.ok(); }
/**
- 前端保存 */ @RequestMapping("/add") public R add(@RequestBody LiuyangshipinEntity liuyangshipin, HttpServletRequest request){ liuyangshipin.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue()); //ValidatorUtils.validateEntity(liuyangshipin); liuyangshipinService.insert(liuyangshipin); return R.ok(); }
/**
- 修改 */ @RequestMapping("/update") @Transactional public R update(@RequestBody LiuyangshipinEntity liuyangshipin, HttpServletRequest request){ //ValidatorUtils.validateEntity(liuyangshipin); liuyangshipinService.updateById(liuyangshipin);//全部更新 return R.ok(); }
/**
- 删除 */ @RequestMapping("/delete") public R delete(@RequestBody Long[] ids){ liuyangshipinService.deleteBatchIds(Arrays.asList(ids)); return R.ok(); }
文章来源: https://blog.51cto.com/u_15745565/5854146
特别声明:以上内容(图片及文字)均为互联网收集或者用户上传发布,本站仅提供信息存储服务!如有侵权或有涉及法律问题请联系我们。
举报