基于微信小程序的高校餐廳食品留樣管理系統(tǒng)設(shè)計與實現(xiàn)-計算機畢業(yè)設(shè)計源碼+LW文檔
? ? ? ? ? ? ? ? ? ? ? ? ? ?小程序開發(fā)說明
開發(fā)語言:Java
框架:ssm
JDK版本:JDK1.8
服務(wù)器:tomcat7
數(shù)據(jù)庫:mysql 5.7(一定要5.7版本)
數(shù)據(jù)庫工具:Navicat11
開發(fā)軟件:eclipse/myeclipse/idea
Maven包:Maven3.3.9
瀏覽器:谷歌瀏覽器
小程序框架:uniapp
小程序開發(fā)軟件:HBuilder X
小程序運行軟件:微信開發(fā)者
后臺邏輯代碼:
/**
?* 留樣食品
?* 后端接口
?* @author?
?* @email?
?* @date 2022-04-26 22:52:55
?*/
@RestController
@RequestMapping("/liuyangshipin")
public class LiuyangshipinController {
? ? @Autowired
? ? private LiuyangshipinService liuyangshipinService;
? ??
? ? /**
? ? ?* 后端列表
? ? ?*/
? ? @RequestMapping("/page")
? ? public R page(@RequestParam Map<String, Object> 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<LiuyangshipinEntity> ew = new EntityWrapper<LiuyangshipinEntity>();
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<String, Object> params,LiuyangshipinEntity liuyangshipin,?
HttpServletRequest request){
? ? ? ? EntityWrapper<LiuyangshipinEntity> ew = new EntityWrapper<LiuyangshipinEntity>();
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<LiuyangshipinEntity> ew = new EntityWrapper<LiuyangshipinEntity>();
? ? ? 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();
? ? }
? ??



