基于javaweb+mysql的springboot生鲜商城系统(java+springboot+maven+vue+elementui+layui+mysql)
私信源码获取及调试交流
运行环境
Java≥8、MySQL≥5.7、Node.js≥10
开发工具
后端:eclipse/idea/myeclipse/sts等均可配置运行
前端:WebStorm/VSCode/HBuilderX等均可
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的SpringBoot生鲜商城系统(java+springboot+maven+vue+elementui+layui+mysql)
项目介绍
基于SpringBoot Vue的生鲜交易系统
角色:管理员、用户、商家
用户:用户系统,在系统首页可以查看首页,生鲜信息,公告信息,个人中心,后台管理,购物车等内容
商家:商家登录系统后,可以对首页,个人中心,生鲜信息管理,广告信息管理,生鲜仓库管理,生鲜出库管理,订单管理等
管理员:管理员登录进入系统可以对首页,个人中心,用户管理,商家管理,生鲜信息管理,生鲜分类管理,广告信息管理,生鲜仓库管理,生鲜出库管理,系统管理等进行相应操作
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 4.数据库:MySql 5.7/8.0版本均可; 5.是否Maven项目:是;
技术栈
后端:SpringBoot+Mybaits
前端:Vue+ElementUI+Layui+HTML+CSS+JS
使用说明
项目运行: 1. 使用Navicat或者其它工具,在mysql中创建对应sql文件名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中application.yml配置文件中的数据库配置改为自己的配置;
文档介绍(课题背景与意义、系统实现功能、课题研究现状、系统相关技术、java技术、B/S架构、Mysql介绍、Mysql环境配置、Springboot框架、系统需求分析、系统功能、可行性研究、经济可行性、技术可行性、运行可行性、事件可行性、系统业务过程分析、系统业务过程分析、系统用例图、系统设计、数据库设计、系统整体设计、系统设计思想、系统流程图、系统详情设计、系统功能模块、系统功能模块、管理员功能模块):
生鲜首页展示:
生鲜列表展示页面:
生鲜详情展示页:
购物车详情信息:
后台登录管理页面:
后台管理功能:
* 查询
*/
@RequestMapping("/query")
public R query(StoreupEntity storeup){
EntityWrapper< StoreupEntity> ew = new EntityWrapper< StoreupEntity>();
ew.allEq(MPUtil.allEQMapPre( storeup, "storeup"));
StoreupView storeupView = storeupService.selectView(ew);
return R.ok("查询收藏表成功").put("data", storeupView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
StoreupEntity storeup = storeupService.selectById(id);
return R.ok().put("data", storeup);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
StoreupEntity storeup = storeupService.selectById(id);
return R.ok().put("data", storeup);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody StoreupEntity storeup, HttpServletRequest request){
storeup.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(storeup);
storeup.setUserid((Long)request.getSession().getAttribute("userId"));
storeupService.insert(storeup);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
/**
* 购物车表
* 后端接口
* @email
*/
@RestController
@RequestMapping("/cart")
public class CartController {
@Autowired
private CartService cartService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,CartEntity cart,
HttpServletRequest request){
if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
cart.setUserid((Long)request.getSession().getAttribute("userId"));
}
EntityWrapper<CartEntity> ew = new EntityWrapper<CartEntity>();
PageUtils page = cartService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, cart), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,CartEntity cart,
HttpServletRequest request){
EntityWrapper<CartEntity> ew = new EntityWrapper<CartEntity>();
PageUtils page = cartService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, cart), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
* @email
*/
@RestController
@RequestMapping("/shengxianchuku")
public class ShengxianchukuController {
@Autowired
private ShengxianchukuService shengxianchukuService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,ShengxianchukuEntity shengxianchuku,
HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("shangjia")) {
shengxianchuku.setShangdianbianhao((String)request.getSession().getAttribute("username"));
}
EntityWrapper<ShengxianchukuEntity> ew = new EntityWrapper<ShengxianchukuEntity>();
PageUtils page = shengxianchukuService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, shengxianchuku), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,ShengxianchukuEntity shengxianchuku,
HttpServletRequest request){
EntityWrapper<ShengxianchukuEntity> ew = new EntityWrapper<ShengxianchukuEntity>();
PageUtils page = shengxianchukuService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, shengxianchuku), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( ShengxianchukuEntity shengxianchuku){
EntityWrapper<ShengxianchukuEntity> ew = new EntityWrapper<ShengxianchukuEntity>();
ew.allEq(MPUtil.allEQMapPre( shengxianchuku, "shengxianchuku"));
return R.ok().put("data", shengxianchukuService.selectListView(ew));
}
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<ShangjiajinggaoEntity> wrapper = new EntityWrapper<ShangjiajinggaoEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("shangjia")) {
wrapper.eq("shangdianbianhao", (String)request.getSession().getAttribute("username"));
}
int count = shangjiajinggaoService.selectCount(wrapper);
return R.ok().put("count", count);
}
}
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,CartEntity cart,
HttpServletRequest request){
if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
cart.setUserid((Long)request.getSession().getAttribute("userId"));
}
EntityWrapper<CartEntity> ew = new EntityWrapper<CartEntity>();
PageUtils page = cartService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, cart), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,CartEntity cart,
HttpServletRequest request){
EntityWrapper<CartEntity> ew = new EntityWrapper<CartEntity>();
PageUtils page = cartService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, cart), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( CartEntity cart){
EntityWrapper<CartEntity> ew = new EntityWrapper<CartEntity>();
ew.allEq(MPUtil.allEQMapPre( cart, "cart"));
return R.ok().put("data", cartService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(CartEntity cart){
EntityWrapper< CartEntity> ew = new EntityWrapper< CartEntity>();
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody ShangjiajinggaoEntity shangjiajinggao, HttpServletRequest request){
shangjiajinggao.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(shangjiajinggao);
shangjiajinggaoService.insert(shangjiajinggao);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody ShangjiajinggaoEntity shangjiajinggao, HttpServletRequest request){
shangjiajinggao.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(shangjiajinggao);
shangjiajinggaoService.insert(shangjiajinggao);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody ShangjiajinggaoEntity shangjiajinggao, HttpServletRequest request){
//ValidatorUtils.validateEntity(shangjiajinggao);
shangjiajinggaoService.updateById(shangjiajinggao);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
shangjiajinggaoService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
*/
@RequestMapping("/lists")
public R list( GuanggaoxinxiEntity guanggaoxinxi){
EntityWrapper<GuanggaoxinxiEntity> ew = new EntityWrapper<GuanggaoxinxiEntity>();
ew.allEq(MPUtil.allEQMapPre( guanggaoxinxi, "guanggaoxinxi"));
return R.ok().put("data", guanggaoxinxiService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(GuanggaoxinxiEntity guanggaoxinxi){
EntityWrapper< GuanggaoxinxiEntity> ew = new EntityWrapper< GuanggaoxinxiEntity>();
ew.allEq(MPUtil.allEQMapPre( guanggaoxinxi, "guanggaoxinxi"));
GuanggaoxinxiView guanggaoxinxiView = guanggaoxinxiService.selectView(ew);
return R.ok("查询广告信息成功").put("data", guanggaoxinxiView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
GuanggaoxinxiEntity guanggaoxinxi = guanggaoxinxiService.selectById(id);
return R.ok().put("data", guanggaoxinxi);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
GuanggaoxinxiEntity guanggaoxinxi = guanggaoxinxiService.selectById(id);
return R.ok().put("data", guanggaoxinxi);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody GuanggaoxinxiEntity guanggaoxinxi, HttpServletRequest request){
guanggaoxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(guanggaoxinxi);
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody ShangjiajinggaoEntity shangjiajinggao, HttpServletRequest request){
shangjiajinggao.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(shangjiajinggao);
shangjiajinggaoService.insert(shangjiajinggao);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody ShangjiajinggaoEntity shangjiajinggao, HttpServletRequest request){
//ValidatorUtils.validateEntity(shangjiajinggao);
shangjiajinggaoService.updateById(shangjiajinggao);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
shangjiajinggaoService.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<String, Object> 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) {
}
/**
* 生鲜仓库
* 后端接口
ew.allEq(MPUtil.allEQMapPre( news, "news"));
NewsView newsView = newsService.selectView(ew);
return R.ok("查询公告信息成功").put("data", newsView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
NewsEntity news = newsService.selectById(id);
return R.ok().put("data", news);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
NewsEntity news = newsService.selectById(id);
return R.ok().put("data", news);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody NewsEntity news, HttpServletRequest request){
news.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(news);
newsService.insert(news);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
@RequestMapping("/update")
public R update(@RequestBody ShengxianchukuEntity shengxianchuku, HttpServletRequest request){
//ValidatorUtils.validateEntity(shengxianchuku);
shengxianchukuService.updateById(shengxianchuku);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
shengxianchukuService.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<String, Object> 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 remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<ShengxianchukuEntity> wrapper = new EntityWrapper<ShengxianchukuEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
shengxianchukuService.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<String, Object> 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 remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<ShengxianchukuEntity> wrapper = new EntityWrapper<ShengxianchukuEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
@RequestMapping("/update")
public R update(@RequestBody ShengxianxinxiEntity shengxianxinxi, HttpServletRequest request){
//ValidatorUtils.validateEntity(shengxianxinxi);
shengxianxinxiService.updateById(shengxianxinxi);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
shengxianxinxiService.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<String, Object> 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 remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
/**
* 收藏表
* 后端接口
* @email
*/
@RestController
@RequestMapping("/storeup")
public class StoreupController {
@Autowired
private StoreupService storeupService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,StoreupEntity storeup,
HttpServletRequest request){
if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
storeup.setUserid((Long)request.getSession().getAttribute("userId"));
}
EntityWrapper<StoreupEntity> ew = new EntityWrapper<StoreupEntity>();
PageUtils page = storeupService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, storeup), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,StoreupEntity storeup,
HttpServletRequest request){
if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
storeup.setUserid((Long)request.getSession().getAttribute("userId"));
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
YonghujinggaoEntity yonghujinggao = yonghujinggaoService.selectById(id);
return R.ok().put("data", yonghujinggao);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody YonghujinggaoEntity yonghujinggao, HttpServletRequest request){
yonghujinggao.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(yonghujinggao);
yonghujinggaoService.insert(yonghujinggao);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody YonghujinggaoEntity yonghujinggao, HttpServletRequest request){
yonghujinggao.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(yonghujinggao);
yonghujinggaoService.insert(yonghujinggao);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody YonghujinggaoEntity yonghujinggao, HttpServletRequest request){
//ValidatorUtils.validateEntity(yonghujinggao);
yonghujinggaoService.updateById(yonghujinggao);//全部更新
return R.ok();
}
address.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(address);
address.setUserid((Long)request.getSession().getAttribute("userId"));
Long userId = (Long)request.getSession().getAttribute("userId");
if(address.getIsdefault().equals("是")) {
addressService.updateForSet("isdefault='否'", new EntityWrapper<AddressEntity>().eq("userid", userId));
}
address.setUserid(userId);
addressService.insert(address);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody AddressEntity address, HttpServletRequest request){
address.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(address);
address.setUserid((Long)request.getSession().getAttribute("userId"));
Long userId = (Long)request.getSession().getAttribute("userId");
if(address.getIsdefault().equals("是")) {
addressService.updateForSet("isdefault='否'", new EntityWrapper<AddressEntity>().eq("userid", userId));
}
address.setUserid(userId);
addressService.insert(address);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody AddressEntity address, HttpServletRequest request){
//ValidatorUtils.validateEntity(address);
if(address.getIsdefault().equals("是")) {
addressService.updateForSet("isdefault='否'", new EntityWrapper<AddressEntity>().eq("userid", request.getSession().getAttribute("userId")));
}
addressService.updateById(address);//全部更新
return R.ok();
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
YonghujinggaoEntity yonghujinggao = yonghujinggaoService.selectById(id);
return R.ok().put("data", yonghujinggao);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
YonghujinggaoEntity yonghujinggao = yonghujinggaoService.selectById(id);
return R.ok().put("data", yonghujinggao);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody YonghujinggaoEntity yonghujinggao, HttpServletRequest request){
yonghujinggao.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(yonghujinggao);
yonghujinggaoService.insert(yonghujinggao);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody YonghujinggaoEntity yonghujinggao, HttpServletRequest request){
yonghujinggao.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(yonghujinggao);
yonghujinggaoService.insert(yonghujinggao);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody YonghujinggaoEntity yonghujinggao, HttpServletRequest request){
//ValidatorUtils.validateEntity(yonghujinggao);
yonghujinggaoService.updateById(yonghujinggao);//全部更新
return R.ok();
}
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<ShengxianfenleiEntity> wrapper = new EntityWrapper<ShengxianfenleiEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = shengxianfenleiService.selectCount(wrapper);
return R.ok().put("count", count);
}
}