喝不起奶茶,咱就为奶茶店开发个会员积分收银系统

简介: 本系统基于SSM框架开发实现,前端使用easyui开发实现,功能强大,界面美观,数据库使用mysql数据库,开发工具采用idea。系统部分功能展示如下:系统管理员登陆: admin /admin

 作者主页:编程指南针

简介:Java领域优质创作者、CSDN博客专家  Java项目、简历模板、学习资料、面试题库、技术互助

文末获取源码

项目编号:BS-XX-011

本系统基于SSM框架开发实现,前端使用easyui开发实现,功能强大,界面美观,数据库使用mysql数据库,开发工具采用idea。

系统部分功能展示如下:

系统管理员登陆: admin /admin

http://localhost/login

image.gif编辑

登陆后主界面:

image.gif编辑

用户管理

image.gif编辑

角色管理

image.gif编辑

资源管理

image.gif编辑

地区管理

image.gif编辑

奶茶管理==类目管理

image.gif编辑

点击购买==输入会员卡进行购买

image.gif编辑

消费积分管理

image.gif编辑

image.gif编辑

日志管理

image.gif编辑

以上是奶茶店会员管理系统的部分功能展示,本项目功能完整,运行无误,适合做毕业设计使用。

package SystemManage.ConsumeManage.service;
import SystemManage.Common.until.PageInfo;
import SystemManage.ConsumeManage.dao.ConsumeMapper;
import SystemManage.ConsumeManage.entity.Consume;
import SystemManage.ConsumeManage.entity.ConsumeVo;
import SystemManage.IntegralDetialManage.service.IntegralDetialService;
import SystemManage.IntegralManage.service.IntegralService;
import SystemManage.MilkManage.entity.MilkConsumeVo;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.Map;
/**
 * 消费奶茶记录
 */
@Service
@Transactional
public class ConsumeService {
    @Autowired
    private ConsumeMapper consumeMapper;
    @Autowired
    private IntegralService integralService;
    @Autowired
    private IntegralDetialService integralDetialService;
    /**
     * 更新消费记录
     *
     * @param vo
     * @return
     */
    public int add(MilkConsumeVo vo) {
        Consume record = new Consume();
        record.setConsumeDate(new Date());
        record.setConsumeMilkId(vo.getMilkId());
        record.setConsumeUserId(vo.getUserId());
        int insert = consumeMapper.insert(record);
        // 消费记录成功,进行积分的更细和积分详细表的更新,否则都不更细
        if (insert > 0) {
            //先更新总积分
            int add = integralService.add(vo);
            //再更新积分详情表
            if (add > 0) {
                return integralDetialService.add(vo, record.getId());
            }
        }
        return 0;
    }
    @SuppressWarnings("all")
    public PageInfo list(String milkName,Long userId, PageInfo info) {
        PageHelper.startPage(info.getNowpage(), info.getPagesize());
        Page<ConsumeVo> milks = consumeMapper.list(userId,milkName);
        info.setRows(milks.getResult());
        info.setTotal((int) milks.getTotal());
        return info;
    }
}

image.gif

package SystemManage.IntegralManage.service;
import SystemManage.IntegralManage.dao.IntegralMapper;
import SystemManage.IntegralManage.entity.Integral;
import SystemManage.IntegralManage.entity.IntegralExample;
import SystemManage.MilkManage.entity.MilkConsumeVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
/**
 * 用户消费总积分
 */
@Service
@Transactional
@SuppressWarnings("all")
public class IntegralService {
    @Autowired
    private IntegralMapper integralMapper;
    /**
     * 根据用户ID查询用户积分
     *
     * @param userId
     * @return
     */
    public Double findIntegralInfoByUserId(Long userId) {
        if (userId == null) {
            throw new RuntimeException("用户ID不能为空");
        }
        IntegralExample example = new IntegralExample();
        IntegralExample.Criteria criteria = example.createCriteria();
        criteria.andIntegralUserIdEqualTo(Integer.parseInt(String.valueOf(userId)));
        List<Integral> integrals = integralMapper.selectByExample(example);
        if (integrals != null && integrals.size() > 0) {
            Integral integral = integrals.get(0);
            return integral.getIntegralSum();
        }
        return 0d;
    }
    /**
     * 更新总积分系统
     *
     * @param vo
     * @return
     */
    public int add(MilkConsumeVo vo) {
        // 判断是否有总积分,没有就直接添加即可
        Integral integral = integralMapper.selectByUserId(vo.getUserId());
        // 证明是第一次添加
        if (integral == null || integral.getIntegralConsume() == 0.0) {
            Integral record = new Integral();
            record.setIntegralTieme(new Date());
            record.setIntegralUserId(vo.getUserId());
            // 价格就是积分,1元钱1积分
            record.setIntegralConsume(vo.getMilkPrice());
            record.setIntegralSum(vo.getMilkPrice());
            int insert = integralMapper.insert(record);
            return insert;
        } else {
            // 积分很多,需要加上价格减去抵扣的积分进行累计增加
            integral.setIntegralSum(integral.getIntegralSum() + vo.getMilkPrice() - vo.getIntegralCount());
            integral.setIntegralConsume((vo.getMilkPrice() - vo.getIntegralCount()) + integral.getIntegralConsume());
            int insert = integralMapper.updateByPrimaryKey(integral);
            return insert;
        }
    }
}

image.gif

package SystemManage.LogManage.service;
import SystemManage.Common.until.PageInfo;
import SystemManage.LogManage.dao.LogDao;
import SystemManage.LogManage.entity.Log;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class LogService {
    @Autowired
    private LogDao logDao;
    public void insertLog(Log sysLog) {
        logDao.insert(sysLog);
    }
    public void findDataGrid(PageInfo pageInfo) {
        pageInfo.setRows(logDao.findDataGrid(pageInfo));
        pageInfo.setTotal(logDao.findDataGridCount(pageInfo));
    }
    public void batchDelete(List ids){
        logDao.batchDelete(ids) ;
    }
    public Log selectById(Long id){
        return logDao.selectById(id) ;
    }
    public int delByDate(String date){
        int count = logDao.delLogCount(date);
        logDao.delByDate(date);
        return count ;
    }
}
image.gif
package SystemManage.MilkManage.service;
import SystemManage.Common.until.PageInfo;
import SystemManage.MilkManage.dao.MilkMapper;
import SystemManage.MilkManage.entity.Milk;
import SystemManage.MilkManage.entity.MilkExample;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
/**
 * 奶茶管理业务层
 *
 */
@Service
@Transactional
public class MilkService {
    @Autowired
    private MilkMapper milkMapper;
    public PageInfo list(PageInfo info,Milk milk) {
        MilkExample milkExample = new MilkExample();
        MilkExample.Criteria criteria = milkExample.createCriteria();
        // 条件查询
        if(milk != null && milk.getMilkCode() != null && milk.getMilkCode() != ""){
            criteria.andMilkCodeEqualTo(milk.getMilkCode());
        }
        if(milk != null && milk.getMilkName() != null && milk.getMilkName() != ""){
            criteria.andMilkNameLike("%" + milk.getMilkName() + "%");
        }
        PageHelper.startPage(info.getNowpage(),info.getPagesize());
        Page<Milk> milks = (Page<Milk>) milkMapper.selectByExample(milkExample);
        info.setRows(milks.getResult());
        info.setTotal((int)milks.getTotal());
        return info;
    }
    public int add(Milk milk) {
        int insert = milkMapper.insert(milk);
        return insert;
    }
    public int delete(Integer id) {
       return milkMapper.deleteByPrimaryKey(id);
    }
    public Milk findOne(Integer id) {
        return milkMapper.selectByPrimaryKey(id);
    }
    public int update(Milk milk) {
        milk.setMilkDate(new Date());
        return milkMapper.updateByPrimaryKey(milk);
    }
}

image.gif

package SystemManage.OrganizationManage.service;
import SystemManage.Common.entity.Tree;
import SystemManage.Common.until.PageInfo;
import SystemManage.OrganizationManage.dao.OrganizationDao;
import SystemManage.OrganizationManage.entity.Organization;
import com.google.common.collect.Lists;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
@Service
public class OrganizationService {
    @Autowired
    private OrganizationDao organizationDao ;
    /**
     * @description
     * 查找用户管理中组织机构的资源树
     * 第一步: 先加载父资源
     * 第二步: 通过父资源的 id 查询子资源
     * 加入到 实体层中
     * @return
     */
    public List<Tree> findTree(){
        List<Tree> trees = new ArrayList<Tree>();
        // 查找父资源的信息 ;
        List<Organization> organizationFather = organizationDao.findOrganizationAllByPidNull();
        if (organizationFather != null){
            for (Organization organizationOne : organizationFather){
                Tree treeOne = new Tree();
                treeOne.setId(organizationOne.getId());
                treeOne.setText(organizationOne.getName());
                treeOne.setIconCls(organizationOne.getIcon());
                List<Organization> organizationSon = organizationDao.findOrganizationAllByPid(organizationOne.getId());
                if (organizationSon != null){
                    List<Tree> tree = new ArrayList<Tree>();
                    for (Organization organizationTwo : organizationSon ){
                        Tree treeTwo = new Tree();
                        treeTwo.setId(organizationTwo.getId());
                        treeTwo.setText(organizationTwo.getName());
                        treeTwo.setIconCls(organizationTwo.getIcon());
                        tree.add(treeTwo);
                    }
                    treeOne.setChildren(tree);
                } else {
                    treeOne.setState("closed");
                }
                trees.add(treeOne);
            }
        }
        return trees ;
    }
    public List<Organization> findTreeGrid() {
        return organizationDao.findOrganizationAll();
    }
    public void addOrganization(Organization organization) {
        organizationDao.insert(organization);
    }
    public Organization findOrganizationById(Long id) {
        return organizationDao.findOrganizationById(id);
    }
    public void updateOrganization(Organization organization) {
        organizationDao.updateOrganization(organization);
    }
    public void deleteOrganizationById(Long id) {
        organizationDao.deleteOrganizationById(id);
    }
}

image.gif


相关文章
|
5月前
|
Java 关系型数据库 MySQL
餐厅收银系统|基于SSM实现餐厅收银系统
餐厅收银系统|基于SSM实现餐厅收银系统
|
8月前
|
Python
项目商场储物柜
用python语言编写项目商场储物柜。
55 0
|
11月前
|
Python
超市打折
超市打折
122 0
|
设计模式 数据可视化 Java
肯德基点餐系统
肯德基点餐系统
肯德基点餐系统
|
新零售 传感器 人工智能
美团开店首秀:全自动拣货,95%订单全无人配送
敢为人先的美团,也开始学起亚马逊开店了,不过这是第一家由骑手经营的智慧门店。以无人微仓和无人配送发展「前置仓 + 即时配送」的新型零售门店,首次落地首钢园,为 3km 半径内智慧园区的生活服务提供新的机会。
234 0
美团开店首秀:全自动拣货,95%订单全无人配送
【氚云】线上订单需要付款怎么破?在线支付用起来!
线上订单需要付款怎么破?在线支付用起来!
395 0
【氚云】线上订单需要付款怎么破?在线支付用起来!
|
新零售 小程序
10平米小店如何通过阿里云小程序做到0到5000的裂变效果?
作为一家美式快餐连锁加盟店,乐可斯通过阿里云小程序,短短一年时间发展至2家直营+3家加盟的店铺规模。
1809 0
10平米小店如何通过阿里云小程序做到0到5000的裂变效果?
|
新零售 分布式计算 MaxCompute
【转载】为什么只有好超市,才敢卖熟牛油果?
本文授权转载自“硅谷洞察”(微信公众号ID: Guigudiyixian) 版权归“硅谷洞察”所有,未经许可不得二次转载 在很多人的印象里,去市场或超市买水产海鲜,谈不上是一件多么享受的事情。但这两年突然爆红的盒马鲜生,则颠覆了人们的这种印象。
1951 0
|
黑灰产治理 安全
6秒售空168套房?房产生活号新玩法
生活号服务商“筑家易”,借助生活号平台及支付宝能力,开启“云选房”时代:实现新房小区线上开盘、线上预约、线上交付! 7月28日“北岸江山”开盘 首次采用“生活号+筑家易云选房” 开盘6秒瞬间售房168套! 支付宝缴纳保证金192万元,房产总成交近2亿元! 9月19日晚“北岸江山”二期开盘 23 秒售完 115套房源 平均每秒成交5套,最终成交额破2亿元 这样的案例还有很多…… 01.生活号+支付宝实名认证、蚁盾   在线售房,交易更安全    整个“云选房”系统依托于支付宝系统:每个参与开盘用户都经过支付宝实名认证;“蚁盾”风险评分可有效识别存在机器注册、恶意刷单、黄牛抢购等问题的手机号等。
624 0