基于javaweb+mysql的springboot超市进销存系统(java+springboot+maven+mybaits+vue+elementui+mysql)
私信源码获取及调试交流
运行环境
Java≥8、MySQL≥5.7、Node.js≥10
开发工具
后端:eclipse/idea/myeclipse/sts等均可配置运行
前端:WebStorm/VSCode/HBuilderX等均可
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的SpringBoot超市进销存系统(java+springboot+maven+mybaits+vue+elementui+mysql)
角色:管理员、员工
管理员:管理员登录进入超市进销存系统可以查看首页、个人中心、员工管理、客户管理、供应商管理、承运商管理、仓库信息管理、商品类别管理、 商品信息管理、采购信息管理、入库信息管理、出库信息管理、销售订单管理、部门管理、岗位管理等功能
员工:员工登录进入超市进销存系统可以查看首页、个人中心、仓库信息管理、 商品信息管理、采购信息管理、入库信息管理、出库信息管理、销售订单管理等功能
技术栈
后端:SpringBoot+Mybaits
前端:Vue+ElementUI
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = gongyingshangService.selectCount(wrapper);
return R.ok().put("count", count);
}
}
public class ChengyunshangController {
@Autowired
private ChengyunshangService chengyunshangService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,ChengyunshangEntity chengyunshang,
HttpServletRequest request){
EntityWrapper<ChengyunshangEntity> ew = new EntityWrapper<ChengyunshangEntity>();
PageUtils page = chengyunshangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, chengyunshang), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,ChengyunshangEntity chengyunshang,
HttpServletRequest request){
EntityWrapper<ChengyunshangEntity> ew = new EntityWrapper<ChengyunshangEntity>();
PageUtils page = chengyunshangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, chengyunshang), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( ChengyunshangEntity chengyunshang){
EntityWrapper<ChengyunshangEntity> ew = new EntityWrapper<ChengyunshangEntity>();
ew.allEq(MPUtil.allEQMapPre( chengyunshang, "chengyunshang"));
return R.ok().put("data", chengyunshangService.selectListView(ew));
}
}
int count = gangweiService.selectCount(wrapper);
return R.ok().put("count", count);
}
}
EntityWrapper<XiaoshoudingdanEntity> ew = new EntityWrapper<XiaoshoudingdanEntity>();
ew.allEq(MPUtil.allEQMapPre( xiaoshoudingdan, "xiaoshoudingdan"));
return R.ok().put("data", xiaoshoudingdanService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(XiaoshoudingdanEntity xiaoshoudingdan){
EntityWrapper< XiaoshoudingdanEntity> ew = new EntityWrapper< XiaoshoudingdanEntity>();
ew.allEq(MPUtil.allEQMapPre( xiaoshoudingdan, "xiaoshoudingdan"));
XiaoshoudingdanView xiaoshoudingdanView = xiaoshoudingdanService.selectView(ew);
return R.ok("查询销售订单成功").put("data", xiaoshoudingdanView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
XiaoshoudingdanEntity xiaoshoudingdan = xiaoshoudingdanService.selectById(id);
return R.ok().put("data", xiaoshoudingdan);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
XiaoshoudingdanEntity xiaoshoudingdan = xiaoshoudingdanService.selectById(id);
return R.ok().put("data", xiaoshoudingdan);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody XiaoshoudingdanEntity xiaoshoudingdan, HttpServletRequest request){
xiaoshoudingdan.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
/**
* 获取需要提醒的记录数
* @param tableName
* @param columnName
* @param type 1:数字 2:日期
* @param map
* @return
*/
@IgnoreAuth
@RequestMapping("/remind/{tableName}/{columnName}/{type}")
public R remindCount(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("table", tableName);
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));
}
}
int count = commonService.remindCount(map);
return R.ok().put("count", count);
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody CaigouxinxiEntity caigouxinxi, HttpServletRequest request){
//ValidatorUtils.validateEntity(caigouxinxi);
caigouxinxiService.updateById(caigouxinxi);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
caigouxinxiService.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));
}
}
}
/**
* 提醒接口
*/
@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<CaigouxinxiEntity> wrapper = new EntityWrapper<CaigouxinxiEntity>();
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("yuangong")) {
wrapper.eq("yuangongzhanghao", (String)request.getSession().getAttribute("username"));
}
int count = caigouxinxiService.selectCount(wrapper);
return R.ok().put("count", count);
}
return R.ok().put("data", bumenService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(BumenEntity bumen){
EntityWrapper< BumenEntity> ew = new EntityWrapper< BumenEntity>();
ew.allEq(MPUtil.allEQMapPre( bumen, "bumen"));
BumenView bumenView = bumenService.selectView(ew);
return R.ok("查询部门成功").put("data", bumenView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
BumenEntity bumen = bumenService.selectById(id);
return R.ok().put("data", bumen);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
BumenEntity bumen = bumenService.selectById(id);
return R.ok().put("data", bumen);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody BumenEntity bumen, HttpServletRequest request){
bumen.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(bumen);
bumenService.insert(bumen);
return R.ok();
}
request.getSession().invalidate();
return R.ok("退出成功");
}
/**
* 密码重置
*/
@IgnoreAuth
@RequestMapping(value = "/resetPass")
public R resetPass(String username, HttpServletRequest request){
UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
if(user==null) {
return R.error("账号不存在");
}
user.setPassword("123456");
userService.update(user,null);
return R.ok("密码已重置为:123456");
}
/**
* 列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,UserEntity user){
EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/list")
public R list( UserEntity user){
EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
ew.allEq(MPUtil.allEQMapPre( user, "user"));
return R.ok().put("data", userService.selectListView(ew));
}
/**
* 信息
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") String id){
UserEntity user = userService.selectById(id);
return R.ok().put("data", user);
}
/**
* 获取用户的session用户信息
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody RukuxinxiEntity rukuxinxi, HttpServletRequest request){
rukuxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(rukuxinxi);
rukuxinxiService.insert(rukuxinxi);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody RukuxinxiEntity rukuxinxi, HttpServletRequest request){
rukuxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(rukuxinxi);
rukuxinxiService.insert(rukuxinxi);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody RukuxinxiEntity rukuxinxi, HttpServletRequest request){
//ValidatorUtils.validateEntity(rukuxinxi);
rukuxinxiService.updateById(rukuxinxi);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
rukuxinxiService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
return R.ok("退出成功");
}
/**
* 获取用户的session用户信息
*/
@RequestMapping("/session")
public R getCurrUser(HttpServletRequest request){
Long id = (Long)request.getSession().getAttribute("userId");
YuangongEntity user = yuangongService.selectById(id);
return R.ok().put("data", user);
}
/**
* 密码重置
*/
@IgnoreAuth
@RequestMapping(value = "/resetPass")
public R resetPass(String username, HttpServletRequest request){
YuangongEntity user = yuangongService.selectOne(new EntityWrapper<YuangongEntity>().eq("yuangongzhanghao", username));
if(user==null) {
return R.error("账号不存在");
}
user.setMima("123456");
yuangongService.updateById(user);
return R.ok("密码已重置为:123456");
}
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,YuangongEntity yuangong,
HttpServletRequest request){
EntityWrapper<YuangongEntity> ew = new EntityWrapper<YuangongEntity>();
PageUtils page = yuangongService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yuangong), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
return R.ok().put("data", caigouxinxi);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody CaigouxinxiEntity caigouxinxi, HttpServletRequest request){
caigouxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(caigouxinxi);
caigouxinxiService.insert(caigouxinxi);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody CaigouxinxiEntity caigouxinxi, HttpServletRequest request){
caigouxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(caigouxinxi);
caigouxinxiService.insert(caigouxinxi);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody CaigouxinxiEntity caigouxinxi, HttpServletRequest request){
//ValidatorUtils.validateEntity(caigouxinxi);
caigouxinxiService.updateById(caigouxinxi);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
caigouxinxiService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 提醒接口
}
/**
* 登录相关
*/
@RequestMapping("users")
@RestController
public class UserController{
//ValidatorUtils.validateEntity(caigouxinxi);
caigouxinxiService.updateById(caigouxinxi);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
caigouxinxiService.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<CaigouxinxiEntity> wrapper = new EntityWrapper<CaigouxinxiEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
/**
* 提醒接口
*/
@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<ShangpinleibieEntity> wrapper = new EntityWrapper<ShangpinleibieEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = shangpinleibieService.selectCount(wrapper);
return R.ok().put("count", count);
}
}
EntityWrapper<ChengyunshangEntity> ew = new EntityWrapper<ChengyunshangEntity>();
PageUtils page = chengyunshangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, chengyunshang), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( ChengyunshangEntity chengyunshang){
EntityWrapper<ChengyunshangEntity> ew = new EntityWrapper<ChengyunshangEntity>();
ew.allEq(MPUtil.allEQMapPre( chengyunshang, "chengyunshang"));
return R.ok().put("data", chengyunshangService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(ChengyunshangEntity chengyunshang){
EntityWrapper< ChengyunshangEntity> ew = new EntityWrapper< ChengyunshangEntity>();
ew.allEq(MPUtil.allEQMapPre( chengyunshang, "chengyunshang"));
ChengyunshangView chengyunshangView = chengyunshangService.selectView(ew);
return R.ok("查询承运商成功").put("data", chengyunshangView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
ChengyunshangEntity chengyunshang = chengyunshangService.selectById(id);
return R.ok().put("data", chengyunshang);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
ChengyunshangEntity chengyunshang = chengyunshangService.selectById(id);
return R.ok().put("data", chengyunshang);
}
/**
* 后端保存
*/
/**
* 入库信息
* 后端接口
* @email
*/
@RestController
@RequestMapping("/rukuxinxi")
public class RukuxinxiController {
@Autowired
private RukuxinxiService rukuxinxiService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,RukuxinxiEntity rukuxinxi,
HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();