zoukankan      html  css  js  c++  java
  • 第四篇 Scrum冲刺博客

    第四篇 Scrum冲刺博客

    Part one 作业地址

    这个作业属于哪个课程 软件工程
    作业要求 第四篇 Scrum冲刺博客
    作业目标 团队集体协作完成项目开发,促进彼此间的交流

    Part two 站立式会议

    1.1 微信会议照片

    注:这次开会采用线上微信开会,主要还是讨论昨天个人的进度问题以及做任务时候遇到的困难,然后大家一起解决。

    1.2成员工作情况

    成员 昨天已完成的工作 今天计划完成的工作 工作中遇到的困难
    张天 做好接下来三天的计划 继续实现水平方向和竖直方向的商城管理器,对项目当中存在的问题进行总结归纳 商城管理器当中出现了运行问题
    黄炜恒 商家入驻模拟环境仍然没有搭建好 上架入驻模式的规则尝试并实现 商家入驻有些规则难以在实现
    黄浩捷 基本完成商城按钮轮转界面 优化主界面的设置,继续添加图片 能够熟练运行windowsbuilder
    陈伟升 商城跳转支付界面 优化支付模块 跳转已经基本设计要求
    曾广宁 整理商城架构 基本完成设计购物车的整体架构 一些具体细节还未完成
    曾春华 整理商城架构并查阅了相关资料 构思商品的整体架构 一些具体细节如商品名,以及商品模块等需要与其他同学进行协商

    Part three 项目燃尽图

    注:进度中一些比较耗费时间的任务已基本完成,接下来的任务主要是对模块当中的一些细节进行优化。

    Part four 代码/文档签入记录

    3.1 代码签入

    说明:第四天git操作明显进步了不少

    3.2 Issue链接

    成员 Issue链接
    张天 实现一些工具组件类1
    黄炜恒 商家入驻模块
    黄浩捷 商城主界面
    陈伟升 支付模块
    曾广宁 商品的整体架构
    曾春华 商品的整体架构

    Part five 最新程序/模块

    4.1 程序代码

    package com.nanrailgun.order_service_provider.service;//商城提供的商品服务
    
    
    import com.nanrailgun.config.common.Constants;
    import com.nanrailgun.config.common.ServiceResultEnum;
    import com.nanrailgun.goods_api.api.MallGoodsService;
    import com.nanrailgun.goods_api.entity.MallGoods;
    import com.nanrailgun.order_api.api.MallShoppingCartItemService;
    import com.nanrailgun.order_api.api.dto.MallShoppingCartItemDTO;
    import com.nanrailgun.order_api.api.dto.MallShoppingCartItemSaveParamDTO;
    import com.nanrailgun.order_api.api.dto.MallShoppingCartItemUpdateParamDTO;
    import com.nanrailgun.order_api.entity.MallShoppingCartItem;
    import com.nanrailgun.order_service_provider.dao.MallShoppingCartItemMapper;
    import org.apache.dubbo.config.annotation.Reference;
    import org.apache.dubbo.config.annotation.Service;
    import org.springframework.beans.BeanUtils;
    import org.springframework.util.CollectionUtils;
    
    import javax.annotation.Resource;
    import java.util.ArrayList;
    import java.util.Date;
    import java.util.List;
    import java.util.Map;
    import java.util.stream.Collectors;
    
    import static java.util.function.Function.identity;
    
    @Service
    @org.springframework.stereotype.Service
    public class MallShoppingCartItemServiceImpl implements MallShoppingCartItemService { //商品区域模块
    
        @Resource
        MallShoppingCartItemMapper mallShoppingCartItemMapper;
    
        @Reference
        private MallGoodsService mallGoodsService;
    
        @Override
        public String saveShoppingCartItem(Long userId, MallShoppingCartItemSaveParamDTO param) {
            MallShoppingCartItem cartItem = mallShoppingCartItemMapper.selectByUserIdAndGoodsId(userId, param.getGoodsId());
            if (cartItem != null) {
                return ServiceResultEnum.SHOPPING_CART_ITEM_EXIST_ERROR.getResult();
            }
            MallGoods goods = mallGoodsService.selectByPrimaryKey(param.getGoodsId());
            if (goods == null) return ServiceResultEnum.GOODS_NOT_EXIST.getResult();
            int totalCount = mallShoppingCartItemMapper.selectCountByUserId(userId);
            if (param.getGoodsCount() < 1) {
                return ServiceResultEnum.SHOPPING_CART_ITEM_NUMBER_ERROR.getResult();
            }
            if (param.getGoodsCount() > Constants.SHOPPING_CART_PAGE_LIMIT) {
                return ServiceResultEnum.SHOPPING_CART_ITEM_LIMIT_NUMBER_ERROR.getResult();
            }
            if (totalCount > Constants.SHOPPING_CART_ITEM_TOTAL_NUMBER) {
                return ServiceResultEnum.SHOPPING_CART_ITEM_TOTAL_NUMBER_ERROR.getResult();
            }
            MallShoppingCartItem item = new MallShoppingCartItem();
            BeanUtils.copyProperties(param, item);
            item.setUserId(userId);
            if (mallShoppingCartItemMapper.insert(item) > 0) {
                return ServiceResultEnum.SUCCESS.getResult();
            }
            return ServiceResultEnum.DB_ERROR.getResult();
        }
    
        @Override
        public String updateShoppingCartItem(Long userId, MallShoppingCartItemUpdateParamDTO param) {
            MallShoppingCartItem item = mallShoppingCartItemMapper.selectByPrimaryKey(param.getCartItemId());
            if (item == null) {
                return ServiceResultEnum.DATA_NOT_EXIST.getResult();
            }
            if (!item.getUserId().equals(userId)) {
                return ServiceResultEnum.REQUEST_FORBIDEN_ERROR.getResult();
            }
            if (param.getGoodsCount() > Constants.SHOPPING_CART_PAGE_LIMIT) {
                return ServiceResultEnum.SHOPPING_CART_ITEM_LIMIT_NUMBER_ERROR.getResult();
            }
            item.setGoodsCount(param.getGoodsCount());
            item.setUpdateTime(new Date());
            if (mallShoppingCartItemMapper.updateByPrimaryKey(item) > 0) {
                return ServiceResultEnum.SUCCESS.getResult();
            }
            return ServiceResultEnum.DB_ERROR.getResult();
        }
    
        @Override
        public String deleteShoppingCartItem(Long userId, Long cartItemId) {
            MallShoppingCartItem item = mallShoppingCartItemMapper.selectByPrimaryKey(cartItemId);
            if (item == null) {
                return ServiceResultEnum.DATA_NOT_EXIST.getResult();
            }
            if (!item.getUserId().equals(userId)) {
                return ServiceResultEnum.REQUEST_FORBIDEN_ERROR.getResult();
            }
            if (mallShoppingCartItemMapper.deleteByPrimary(cartItemId) > 0) {
                return ServiceResultEnum.SUCCESS.getResult();
            }
            return ServiceResultEnum.DB_ERROR.getResult();
        }
    
        @Override
        public List<MallShoppingCartItemDTO> getAllShoppingCartItem(Long userId) {
            return getMallShoppingCartItemVOList(mallShoppingCartItemMapper.selectByUserId(userId));
        }
    
        @Override
        public List<MallShoppingCartItemDTO> getShoppingCartItemByCartItemIds(Long userId, List<Long> cartItemIds) {
            List<MallShoppingCartItem> list = mallShoppingCartItemMapper.selectByPrimaryKeys(cartItemIds);
            list.removeIf(item -> !item.getUserId().equals(userId));
            return getMallShoppingCartItemVOList(list);
        }
    
        private List<MallShoppingCartItemDTO> getMallShoppingCartItemVOList(List<MallShoppingCartItem> mallShoppingCartItems) { //商品条目清单模块
            List<MallShoppingCartItemDTO> list = new ArrayList<>();
            List<Long> goodsIds = mallShoppingCartItems.stream().map(MallShoppingCartItem::getGoodsId).collect(Collectors.toList());
            if (!CollectionUtils.isEmpty(goodsIds)) {
                List<MallGoods> mallGoodsList = mallGoodsService.selectByPrimaryKeys(goodsIds);
                Map<Long, MallGoods> mallGoodsMap;
                if (!CollectionUtils.isEmpty(mallGoodsList)) {
                    mallGoodsMap = mallGoodsList.stream().collect(Collectors.toMap(MallGoods::getGoodsId, identity()));
                    mallShoppingCartItems.forEach((item) -> {
                        if (mallGoodsMap.containsKey(item.getGoodsId())) {
                            MallShoppingCartItemDTO vo = new MallShoppingCartItemDTO();
                            BeanUtils.copyProperties(item, vo);
                            BeanUtils.copyProperties(mallGoodsMap.get(vo.getGoodsId()), vo);
                            if (vo.getGoodsName().length() > 28) {
                                vo.setGoodsName(vo.getGoodsName().substring(0, 28) + "...");
                            }
                            list.add(vo);
                        }
                    });
                }
            }
            return list;
        }
    }
    
    
    

    4.2 运行截图

    商城支付模块跳转到支付宝截图:
    图片名称

    Part six 每人每日总结

    成员 小结
    张天 项目开发到这里,感觉越来越吃力
    黄炜恒 任务越来越难,剩下的路还很长
    黄浩捷 对于使用windowsbuilder,已经有了明显的提升
    陈伟升 java的支付模块已经基本实现
    曾广宁 需要多学习,不然真的跟不上团队的速度
    曾春华 继续与同学保持良好的沟通
  • 相关阅读:
    复制构造函数与重载=操作符
    size_t
    模板
    理解函数对象的函数适配器
    抽象基类
    派生类的一些知识
    了解protected 以及公用、私有和受保护的继承
    第四章 分治策略 最大子数组问题
    第二章 归并排序 分治法
    第二章 插入排序
  • 原文地址:https://www.cnblogs.com/happyzhangtian/p/13956619.html
Copyright © 2011-2022 走看看