| | |
| | | package cc.mrbird.febs.mall.service.impl; |
| | | |
| | | import cc.mrbird.febs.common.exception.FebsException; |
| | | import cc.mrbird.febs.common.utils.LoginUserUtil; |
| | | import cc.mrbird.febs.mall.dto.AddCollectionDto; |
| | | import cc.mrbird.febs.mall.dto.MemberCollectionListDto; |
| | | import cc.mrbird.febs.mall.entity.MallGoods; |
| | | import cc.mrbird.febs.mall.entity.MallMember; |
| | | import cc.mrbird.febs.mall.entity.MallMemberCollection; |
| | | import cc.mrbird.febs.mall.mapper.MallMemberCollectionMapper; |
| | | import cc.mrbird.febs.mall.service.IApiMallGoodsService; |
| | | import cc.mrbird.febs.mall.service.IMallMemberCollectionService; |
| | | import cc.mrbird.febs.mall.vo.AddCollectionVo; |
| | | import cc.mrbird.febs.mall.vo.CollectionListVo; |
| | |
| | | @RequiredArgsConstructor |
| | | public class MallMemberCollectionServiceImpl extends ServiceImpl<MallMemberCollectionMapper, MallMemberCollection> implements IMallMemberCollectionService { |
| | | |
| | | private final IApiMallGoodsService apiMallGoodsService; |
| | | |
| | | @Override |
| | | public void add(AddCollectionDto addCollectionDto) { |
| | | MallMember member = LoginUserUtil.getLoginUser(); |
| | | |
| | | MallGoods mallgoods = apiMallGoodsService.getById(addCollectionDto.getGoodsId()); |
| | | if (mallgoods == null) { |
| | | throw new FebsException("商品不存在"); |
| | | } |
| | | |
| | | LambdaQueryWrapper<MallMemberCollection> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(MallMemberCollection::getMemberId, member.getId()); |
| | | queryWrapper.eq(MallMemberCollection::getGoodsId, addCollectionDto.getGoodsId()); |
| | | List<MallMemberCollection> mallMemberCollections = this.baseMapper.selectList(queryWrapper); |
| | | if (CollUtil.isNotEmpty(mallMemberCollections)) { |
| | | throw new FebsException("商品已收藏"); |
| | | } |
| | | |
| | | MallMemberCollection collection = new MallMemberCollection(); |
| | | collection.setMemberId(member.getId()); |
| | | collection.setGoodsId(addCollectionDto.getGoodsId()); |
| | |
| | | package cc.mrbird.febs.mall.service.impl; |
| | | |
| | | import cc.mrbird.febs.common.exception.FebsException; |
| | | import cc.mrbird.febs.common.utils.LoginUserUtil; |
| | | import cc.mrbird.febs.mall.dto.MemberFootprintListDto; |
| | | import cc.mrbird.febs.mall.entity.MallGoods; |
| | | import cc.mrbird.febs.mall.entity.MallMember; |
| | | import cc.mrbird.febs.mall.entity.MallMemberCollection; |
| | | import cc.mrbird.febs.mall.entity.MallMemberFootprint; |
| | | import cc.mrbird.febs.mall.mapper.MallMemberFootprintMapper; |
| | | import cc.mrbird.febs.mall.service.IApiMallGoodsService; |
| | | import cc.mrbird.febs.mall.service.IMallMemberFootprintService; |
| | | import cc.mrbird.febs.mall.vo.CollectionListVo; |
| | | import cc.mrbird.febs.mall.vo.FootprintListVo; |
| | |
| | | @RequiredArgsConstructor |
| | | public class MallMemberFootprintServiceImpl extends ServiceImpl<MallMemberFootprintMapper, MallMemberFootprint> implements IMallMemberFootprintService { |
| | | |
| | | private final IApiMallGoodsService apiMallGoodsService; |
| | | |
| | | @Override |
| | | public void add(Long goodsId, Long memberId) { |
| | | MallGoods mallgoods = apiMallGoodsService.getById(goodsId); |
| | | if (mallgoods == null) { |
| | | throw new FebsException("商品不存在"); |
| | | } |
| | | |
| | | LambdaQueryWrapper<MallMemberFootprint> query = new LambdaQueryWrapper<>(); |
| | | query.eq(MallMemberFootprint::getGoodsId, goodsId); |
| | | query.eq(MallMemberFootprint::getMemberId, memberId); |
| | |
| | | @ApiModel(value = "CollectionListVo", description = "会员收藏列表返回参数类") |
| | | public class CollectionListVo { |
| | | |
| | | @ApiModelProperty(value = "id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "商品ID") |
| | | private Long goodsId; |
| | | |
| | |
| | | @ApiModel(value = "FootprintListVo", description = "浏览记录列表返回参数类") |
| | | public class FootprintListVo { |
| | | |
| | | @ApiModelProperty(value = "足迹ID") |
| | | private Long id; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "浏览时间") |
| | | private Date updatedTime; |
| | |
| | | serviceName: yiyuanshucai |
| | | |
| | | system: |
| | | job: false |
| | | job: true |
| | |
| | | |
| | | spring: |
| | | profiles: |
| | | active: dev |
| | | active: test |
| | | |
| | | servlet: |
| | | multipart: |
| | |
| | | <where> |
| | | <if test="record != null"> |
| | | <if test="record.memberId != null"> |
| | | and collection.member_id = #{record.memberId} |
| | | and footprint.member_id = #{record.memberId} |
| | | </if> |
| | | </if> |
| | | </where> |
| | |
| | | <input type="text" name="originalPrice" lay-verify="required" placeholder="" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">现价:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="presentPrice" lay-verify="required" placeholder="" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- <blockquote class="layui-elem-quote blue-border">代理价格</blockquote>--> |
| | | <!-- <div class="layui-row layui-col-space10 layui-form-item">--> |
| | | <!-- <div class="layui-col-lg6">--> |
| | | <!-- <label class="layui-form-label febs-form-item-require">折扣价:</label>--> |
| | | <!-- <label class="layui-form-label febs-form-item-require">一级价格:</label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input type="text" name="presentPrice" lay-verify="required" placeholder="" autocomplete="off" class="layui-input">--> |
| | | <!-- <input type="text" name="levelOnePrice" lay-verify="required" placeholder="" autocomplete="off" class="layui-input">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | </div> |
| | | <blockquote class="layui-elem-quote blue-border">代理价格</blockquote> |
| | | <div class="layui-row layui-col-space10 layui-form-item"> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">一级价格:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="levelOnePrice" lay-verify="required" placeholder="" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">二级价格:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="levelTwoPrice" lay-verify="required" placeholder="" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-row layui-col-space10 layui-form-item"> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">三级价格:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="levelThreePrice" lay-verify="required" placeholder="" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label febs-form-item-require">成本价:</label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input type="text" name="costPrice" lay-verify="required" placeholder="" autocomplete="off" class="layui-input">--> |
| | | <!-- <div class="layui-col-lg6">--> |
| | | <!-- <label class="layui-form-label febs-form-item-require">二级价格:</label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input type="text" name="levelTwoPrice" lay-verify="required" placeholder="" autocomplete="off" class="layui-input">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-row layui-col-space10 layui-form-item">--> |
| | | <!-- <div class="layui-col-lg6">--> |
| | | <!-- <label class="layui-form-label febs-form-item-require">三级价格:</label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input type="text" name="levelThreePrice" lay-verify="required" placeholder="" autocomplete="off" class="layui-input">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | |
| | | <div class="layui-form-item"> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">成本价:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="costPrice" lay-verify="required" placeholder="" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <blockquote class="layui-elem-quote blue-border">运费设置</blockquote> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">运费:</label> |
| | |
| | | 添加 |
| | | </button> |
| | | </div> |
| | | <div class="layui-col-lg1"> |
| | | <button type="button" |
| | | class="layui-btn layui-btn-normal layui-btn" id="test4"> |
| | | 新增样品 |
| | | </button> |
| | | </div> |
| | | <!-- <div class="layui-col-lg1">--> |
| | | <!-- <button type="button"--> |
| | | <!-- class="layui-btn layui-btn-normal layui-btn" id="test4">--> |
| | | <!-- 新增样品--> |
| | | <!-- </button>--> |
| | | <!-- </div>--> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | |
| | | ,{field: 'index', title: '序号', width:70} |
| | | ,{field: 'styleName', title: '样式', edit:'text', width:200} |
| | | ,{field: 'skuName', title: '规格', edit:'text', width:200} |
| | | ,{field: 'sample', title:'样品', width:100} |
| | | // ,{field: 'sample', title:'样品', width:100} |
| | | ,{field: 'goodsWeight', title: '重量', edit:'text', width:100} |
| | | // ,{field: 'presentPrice', title: '折扣价', edit:'text', width:100} |
| | | ,{field: 'levelOnePrice', title: '一级价格', edit:'text', width:100} |
| | | ,{field: 'levelTwoPrice', title: '二级价格', edit:'text', width:100} |
| | | ,{field: 'levelThreePrice', title: '三级价格', edit:'text', width:100} |
| | | // ,{field: 'levelOnePrice', title: '一级价格', edit:'text', width:100} |
| | | // ,{field: 'levelTwoPrice', title: '二级价格', edit:'text', width:100} |
| | | // ,{field: 'levelThreePrice', title: '三级价格', edit:'text', width:100} |
| | | ,{field: 'originalPrice', title: '原价', edit:'text', width:100} |
| | | // ,{field: 'costPrice', title: '成本价', edit:'text', width:100} |
| | | ,{field: 'presentPrice', title: '现价', edit:'text', width:100} |
| | | ,{field: 'costPrice', title: '成本价', edit:'text', width:100} |
| | | ,{templet: '#tableImgUpload', title: '缩略图', width:150} |
| | | ,{field: 'stock', title: '库存', edit:'text', width:100} |
| | | ,{field: 'skuVolume', title: '销量', edit:'text', width:100} |
| | |
| | | placeholder="" autoComplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-col-lg6">--> |
| | | <!-- <label class="layui-form-label febs-form-item-require">折扣价:</label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input type="text" name="presentPrice" lay-verify="required"--> |
| | | <!-- placeholder="" autoComplete="off" class="layui-input">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | </div> |
| | | <blockquote class="layui-elem-quote blue-border">代理价格</blockquote> |
| | | <div class="layui-row layui-col-space10 layui-form-item"> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">一级价格:</label> |
| | | <label class="layui-form-label febs-form-item-require">现价:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="levelOnePrice" lay-verify="required" placeholder="" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">二级价格:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="levelTwoPrice" lay-verify="required" placeholder="" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-row layui-col-space10 layui-form-item"> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">三级价格:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="levelThreePrice" lay-verify="required" placeholder="" autocomplete="off" class="layui-input"> |
| | | <input type="text" name="presentPrice" lay-verify="required" |
| | | placeholder="" autoComplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label febs-form-item-require">成本价:</label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input type="text" name="costPrice" lay-verify="required" placeholder=""--> |
| | | <!-- autoComplete="off" class="layui-input">--> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">成本价:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="costPrice" lay-verify="required" placeholder="" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- <blockquote class="layui-elem-quote blue-border">代理价格</blockquote>--> |
| | | <!-- <div class="layui-row layui-col-space10 layui-form-item">--> |
| | | <!-- <div class="layui-col-lg6">--> |
| | | <!-- <label class="layui-form-label febs-form-item-require">一级价格:</label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input type="text" name="levelOnePrice" lay-verify="required" placeholder="" autocomplete="off" class="layui-input">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-col-lg6">--> |
| | | <!-- <label class="layui-form-label febs-form-item-require">二级价格:</label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input type="text" name="levelTwoPrice" lay-verify="required" placeholder="" autocomplete="off" class="layui-input">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-row layui-col-space10 layui-form-item">--> |
| | | <!-- <div class="layui-col-lg6">--> |
| | | <!-- <label class="layui-form-label febs-form-item-require">三级价格:</label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input type="text" name="levelThreePrice" lay-verify="required" placeholder="" autocomplete="off" class="layui-input">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | |
| | |
| | | ,{field: 'index', title: '序号', width: 70} |
| | | ,{field: 'styleName', title: '样式', edit:'text', width:200} |
| | | ,{field: 'skuName', title: '规格', edit:'text', width:200} |
| | | ,{field: 'sample', title:'样品', width:100} |
| | | ,{field: 'goodsWeight', title: '重量', edit:'text', width:100} |
| | | // ,{field: 'presentPrice', title: '折扣价', edit:'text', width:100} |
| | | ,{field: 'originalPrice', title: '原价', edit:'text', width:100} |
| | | ,{field: 'levelOnePrice', title: '一级价格', edit:'text', width:100} |
| | | ,{field: 'levelTwoPrice', title: '二级价格', edit:'text', width:100} |
| | | ,{field: 'levelThreePrice', title: '三级价格', edit:'text', width:100} |
| | | // ,{field: 'costPrice', title: '成本价', edit:'text', width:100} |
| | | ,{field: 'presentPrice', title: '现价', edit:'text', width:100} |
| | | // ,{field: 'levelOnePrice', title: '一级价格', edit:'text', width:100} |
| | | // ,{field: 'levelTwoPrice', title: '二级价格', edit:'text', width:100} |
| | | // ,{field: 'levelThreePrice', title: '三级价格', edit:'text', width:100} |
| | | ,{field: 'costPrice', title: '成本价', edit:'text', width:100} |
| | | ,{templet: '#tableImgUpload', title: '缩略图', width:150} |
| | | ,{field: 'stock', title: '库存', edit:'text', width:100} |
| | | ,{field: 'skuVolume', title: '销量', edit:'text', width:100} |