| | |
| | | public enum AgentLevelEnum { |
| | | |
| | | ZERO_LEVEL("非会员"), |
| | | LEVEL_TWO("非会员"), |
| | | LEVEL_ONE("非会员"), |
| | | LEVEL_THREE("非会员"), |
| | | FIRST_LEVEL("普通会员"), |
| | | SECOND_LEVEL("区级代理"), |
| | | THIRD_LEVEL("市级代理"), |
| | |
| | | private BigDecimal goodsWeight; |
| | | //序号 |
| | | private Integer orderNumber; |
| | | private String levelOnePrice; |
| | | private String levelTwoPrice; |
| | | private String levelThreePrice; |
| | | |
| | | } |
| | |
| | | private BigDecimal goodsWeight; |
| | | |
| | | private String sample; |
| | | private String levelOnePrice; |
| | | private String levelTwoPrice; |
| | | private String levelThreePrice; |
| | | |
| | | } |
| | |
| | | private BigDecimal goodsWeight; |
| | | |
| | | private String sample; |
| | | private BigDecimal levelOnePrice; |
| | | private BigDecimal levelTwoPrice; |
| | | private BigDecimal levelThreePrice; |
| | | |
| | | } |
| | |
| | | private BigDecimal goodsWeight; |
| | | //序号 |
| | | private Integer orderNumber; |
| | | private BigDecimal levelOnePrice; |
| | | private BigDecimal levelTwoPrice; |
| | | private BigDecimal levelThreePrice; |
| | | } |
| | |
| | | private BigDecimal goodsWeight; |
| | | //序号 |
| | | private Integer orderNumber; |
| | | private BigDecimal levelOnePrice; |
| | | private BigDecimal levelTwoPrice; |
| | | private BigDecimal levelThreePrice; |
| | | |
| | | } |
| | |
| | | private Integer skuVolume; |
| | | |
| | | private BigDecimal originalPrice; |
| | | private BigDecimal levelOnePrice; |
| | | private BigDecimal levelTwoPrice; |
| | | private BigDecimal levelThreePrice; |
| | | |
| | | private BigDecimal presentPrice; |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface MallAgentRecordMapper extends BaseMapper<MallAgentRecord> { |
| | | |
| | | MallAgentRecord selectByMemberIdAndState(@Param("memberId")Long memberId, @Param("state")Integer applyIng); |
| | |
| | | void deleteByMemberIdAndState(@Param("memberId")Long memberId, @Param("state")Integer applyIng); |
| | | |
| | | ApiMallAgentRecordVo selectApiMallAgentRecordVoByMemberIdAndState(@Param("memberId")Long memberId, @Param("state")Integer applyIng); |
| | | |
| | | List<MallAgentRecord> selectByCity(@Param("city")String city); |
| | | } |
| | |
| | | if (StrUtil.isEmpty(presentPrice)) { |
| | | return new FebsResponse().fail().message("商品规格现价不能为空"); |
| | | } |
| | | if (StrUtil.isEmpty(addSku.getLevelOnePrice()) |
| | | || StrUtil.isEmpty(addSku.getLevelTwoPrice()) |
| | | || StrUtil.isEmpty(addSku.getLevelThreePrice())) { |
| | | return new FebsResponse().fail().message("商品规格级别价格不能为空"); |
| | | } |
| | | BigDecimal goodsWeight = addSku.getGoodsWeight(); |
| | | if(BigDecimal.ZERO.compareTo(goodsWeight) > 0){ |
| | | return new FebsResponse().fail().message("重量不能小于零"); |
| | |
| | | sku.setCostPrice(mallGoods.getCostPrice()); |
| | | sku.setPresentPrice(new BigDecimal(mallGoods.getPresentPrice())); |
| | | sku.setOriginalPrice(new BigDecimal(mallGoods.getOriginalPrice())); |
| | | sku.setLevelOnePrice(mallGoods.getLevelOnePrice()); |
| | | sku.setLevelTwoPrice(mallGoods.getLevelTwoPrice()); |
| | | sku.setLevelThreePrice(mallGoods.getLevelThreePrice()); |
| | | sku.setSkuVolume(mallGoods.getVolume()); |
| | | sku.setStock(mallGoods.getStock()); |
| | | sku.setStyleId(style.getId()); |
| | |
| | | mallGoodsSku.setSkuVolume(addMallGoodsSkuDto.getSkuVolume() == null ? 0 : addMallGoodsSkuDto.getSkuVolume()); |
| | | mallGoodsSku.setOriginalPrice(new BigDecimal(addMallGoodsSkuDto.getOriginalPrice())); |
| | | mallGoodsSku.setPresentPrice(new BigDecimal(addMallGoodsSkuDto.getPresentPrice())); |
| | | |
| | | mallGoodsSku.setLevelOnePrice(new BigDecimal(addMallGoodsSkuDto.getLevelOnePrice())); |
| | | mallGoodsSku.setLevelTwoPrice(new BigDecimal(addMallGoodsSkuDto.getLevelTwoPrice())); |
| | | mallGoodsSku.setLevelThreePrice(new BigDecimal(addMallGoodsSkuDto.getLevelThreePrice())); |
| | | mallGoodsSku.setStyleId(mallGoodsStyleSku.getId()); |
| | | mallGoodsSku.setCostPrice(addMallGoodsSkuDto.getCostPrice()); |
| | | mallGoodsSku.setGoodsId(mallGoods.getId()); |
| | |
| | | if (presentPrice.compareTo(BigDecimal.ZERO) < 0) { |
| | | return new FebsResponse().fail().message("商品规格现价不能小于0"); |
| | | } |
| | | if (addSku.getLevelOnePrice().compareTo(BigDecimal.ZERO) < 0) { |
| | | return new FebsResponse().fail().message("商品等级价格不能小于0"); |
| | | } |
| | | if (addSku.getLevelTwoPrice().compareTo(BigDecimal.ZERO) < 0) { |
| | | return new FebsResponse().fail().message("商品等级价格不能小于0"); |
| | | } |
| | | if (addSku.getLevelThreePrice().compareTo(BigDecimal.ZERO) < 0) { |
| | | return new FebsResponse().fail().message("商品等级价格不能小于0"); |
| | | } |
| | | BigDecimal goodsWeight = addSku.getGoodsWeight(); |
| | | if(BigDecimal.ZERO.compareTo(goodsWeight) > 0){ |
| | | return new FebsResponse().fail().message("重量不能小于零"); |
| | |
| | | sku.setCostPrice(mallGoods.getCostPrice()); |
| | | sku.setPresentPrice(new BigDecimal(mallGoods.getPresentPrice())); |
| | | sku.setOriginalPrice(new BigDecimal(mallGoods.getOriginalPrice())); |
| | | sku.setLevelOnePrice(mallGoods.getLevelOnePrice()); |
| | | sku.setLevelTwoPrice(mallGoods.getLevelTwoPrice()); |
| | | sku.setLevelThreePrice(mallGoods.getLevelThreePrice()); |
| | | sku.setSkuVolume(mallGoods.getVolume()); |
| | | sku.setStock(mallGoods.getStock()); |
| | | sku.setStyleId(style.getId()); |
| | |
| | | mallGoodsSkuMapper.insert(sku); |
| | | return new FebsResponse().success().message("添加成功"); |
| | | } |
| | | |
| | | |
| | | |
| | | // 删除已存在sku |
| | | List<Long> delSkuIds = mallGoodsUpdateDto.getDelSkuId(); |
| | |
| | | mallGoodsSku.setSkuVolume(addMallGoodsSkuDto.getSkuVolume() == null ? 0 : addMallGoodsSkuDto.getSkuVolume()); |
| | | mallGoodsSku.setOriginalPrice(addMallGoodsSkuDto.getOriginalPrice()); |
| | | mallGoodsSku.setPresentPrice(addMallGoodsSkuDto.getPresentPrice()); |
| | | mallGoodsSku.setLevelOnePrice(addMallGoodsSkuDto.getLevelOnePrice()); |
| | | mallGoodsSku.setLevelTwoPrice(addMallGoodsSkuDto.getLevelTwoPrice()); |
| | | mallGoodsSku.setLevelThreePrice(addMallGoodsSkuDto.getLevelThreePrice()); |
| | | mallGoodsSku.setStyleId(addMallGoodsSkuDto.getStyleId()); |
| | | mallGoodsSku.setGoodsId(mallGoods.getId()); |
| | | mallGoodsSku.setCostPrice(addMallGoodsSkuDto.getCostPrice()); |
| | |
| | | mallGoodsSku.setSkuVolume(addMallGoodsSkuDto.getSkuVolume() == null ? 0 : addMallGoodsSkuDto.getSkuVolume()); |
| | | mallGoodsSku.setOriginalPrice(addMallGoodsSkuDto.getOriginalPrice()); |
| | | mallGoodsSku.setPresentPrice(addMallGoodsSkuDto.getPresentPrice()); |
| | | mallGoodsSku.setLevelOnePrice(addMallGoodsSkuDto.getLevelOnePrice()); |
| | | mallGoodsSku.setLevelTwoPrice(addMallGoodsSkuDto.getLevelTwoPrice()); |
| | | mallGoodsSku.setLevelThreePrice(addMallGoodsSkuDto.getLevelThreePrice()); |
| | | mallGoodsSku.setStyleId(mallGoodsStyleSku.getId()); |
| | | mallGoodsSku.setCostPrice(addMallGoodsSkuDto.getCostPrice()); |
| | | mallGoodsSku.setGoodsId(mallGoods.getId()); |
| | |
| | | import cc.mrbird.febs.mall.mapper.MallAgentRecordMapper; |
| | | import cc.mrbird.febs.mall.mapper.MallMemberMapper; |
| | | import cc.mrbird.febs.mall.service.IApiMallAgentService; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Service |
| | |
| | | if(ObjectUtil.isNotEmpty(mallAgentRecord)){ |
| | | mallAgentRecordMapper.deleteByMemberIdAndState(memberId,MallAgentRecord.APPLY_ING); |
| | | } |
| | | // String city = apiAgentApplyDto.getCity(); |
| | | // List<MallAgentRecord> cityMallAgents = mallAgentRecordMapper.selectByCity(city); |
| | | // if(CollUtil.isEmpty(cityMallAgents)){ |
| | | // return new FebsResponse().fail().message("当前城市已经无法申请"); |
| | | // } |
| | | |
| | | MallAgentRecord mallAgentRecordNew = MallAgentRecordConversion.INSTANCE.dtoToEntity(apiAgentApplyDto); |
| | | mallAgentRecordNew.setMemberId(memberId); |
| | |
| | | DataDictionaryCustom dataDictionaryCustom = dataDictionaryCustomMapper.selectDicDataByTypeAndCode("AGENT_LEVEL_APPLY", mallAgentRecordAgree.getAgentLevel()); |
| | | mallMemberVo.setAgentLevelName(dataDictionaryCustom.getDescription()); |
| | | } |
| | | if(mallAgentRecordAgree.getAgentLevel().equals("LEVEL_ONE")){ |
| | | mallMemberVo.setAgentLevel(1); |
| | | } |
| | | if(mallAgentRecordAgree.getAgentLevel().equals("LEVEL_TWO")){ |
| | | mallMemberVo.setAgentLevel(2); |
| | | } |
| | | if(mallAgentRecordAgree.getAgentLevel().equals("LEVEL_THREE")){ |
| | | mallMemberVo.setAgentLevel(3); |
| | | } |
| | | }else if(ObjectUtil.isNotEmpty(mallAgentRecordDisagree)){ |
| | | mallMemberVo.setIsAgent(3); |
| | | } |
| | |
| | | //普通用户使用原价购买 |
| | | amount = sku.getOriginalPrice().multiply(BigDecimal.valueOf(item.getCnt())); |
| | | itemPrice = sku.getOriginalPrice(); |
| | | }else if(AgentLevelEnum.LEVEL_ONE.name().equals(member.getLevel())){ |
| | | //普通用户使用原价购买 |
| | | amount = sku.getLevelOnePrice().multiply(BigDecimal.valueOf(item.getCnt())); |
| | | itemPrice = sku.getLevelOnePrice(); |
| | | }else if(AgentLevelEnum.LEVEL_TWO.name().equals(member.getLevel())){ |
| | | //普通用户使用原价购买 |
| | | amount = sku.getLevelTwoPrice().multiply(BigDecimal.valueOf(item.getCnt())); |
| | | itemPrice = sku.getLevelTwoPrice(); |
| | | }else if(AgentLevelEnum.LEVEL_THREE.name().equals(member.getLevel())){ |
| | | //普通用户使用原价购买 |
| | | amount = sku.getLevelThreePrice().multiply(BigDecimal.valueOf(item.getCnt())); |
| | | itemPrice = sku.getLevelThreePrice(); |
| | | }else{ |
| | | //合伙人使用折扣价 |
| | | amount = sku.getPresentPrice().multiply(BigDecimal.valueOf(item.getCnt())); |
| | |
| | | |
| | | @ApiModelProperty(value = "重量") |
| | | private BigDecimal skuGoodsWeight; |
| | | |
| | | @ApiModelProperty(value = "1级代理价格") |
| | | private BigDecimal levelOnePrice; |
| | | |
| | | @ApiModelProperty(value = "2级代理价格") |
| | | private BigDecimal levelTwoPrice; |
| | | |
| | | @ApiModelProperty(value = "3级代理价格") |
| | | private BigDecimal levelThreePrice; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "单位") |
| | | private String unit; |
| | | |
| | | @ApiModelProperty(value = "1级代理价格") |
| | | private BigDecimal levelOnePrice; |
| | | |
| | | @ApiModelProperty(value = "2级代理价格") |
| | | private BigDecimal levelTwoPrice; |
| | | |
| | | @ApiModelProperty(value = "3级代理价格") |
| | | private BigDecimal levelThreePrice; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "单位") |
| | | private String unit; |
| | | |
| | | @ApiModelProperty(value = "1级代理价格") |
| | | private BigDecimal levelOnePrice; |
| | | |
| | | @ApiModelProperty(value = "2级代理价格") |
| | | private BigDecimal levelTwoPrice; |
| | | |
| | | @ApiModelProperty(value = "3级代理价格") |
| | | private BigDecimal levelThreePrice; |
| | | } |
| | |
| | | @ApiModelProperty(value = "代理名称") |
| | | private String agentLevelName; |
| | | |
| | | @ApiModelProperty(value = "代理等级数字 1:一级 2:二级 3:三级") |
| | | private Integer agentLevel; |
| | | |
| | | } |
| | |
| | | limit 1 |
| | | </select> |
| | | |
| | | <select id="selectByCity" resultType="cc.mrbird.febs.mall.entity.MallAgentRecord"> |
| | | select a.* from mall_agent_record a |
| | | where a.city = #{city} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <result property="carriageAmount" column="carriage_amount" /> |
| | | <result property="carriageRuleId" column="carriage_rule_id" /> |
| | | <result property="goodsWeight" column="goods_weight" /> |
| | | <result property="levelOnePrice" column="level_one_price" /> |
| | | <result property="levelTwoPrice" column="level_two_price" /> |
| | | <result property="levelThreePrice" column="level_three_price" /> |
| | | <collection property="styles" ofType="cc.mrbird.febs.mall.entity.MallGoodsStyle"> |
| | | <id property="id" column="style_id" /> |
| | | <result property="name" column="style_name" /> |
| | |
| | | <result property="goodsId" column="sku_goods_id" /> |
| | | <result property="skuGoodsWeight" column="sku_goods_weight" /> |
| | | <result property="sample" column="sample" /> |
| | | <result property="levelOnePrice" column="sku_level_one_price" /> |
| | | <result property="levelTwoPrice" column="sku_level_two_price" /> |
| | | <result property="levelThreePrice" column="sku_level_three_price" /> |
| | | </collection> |
| | | </collection> |
| | | </resultMap> |
| | |
| | | c.style_id sku_style_id, |
| | | c.goods_weight sku_goods_weight, |
| | | c.sample sample, |
| | | c.level_one_price sku_level_one_price, |
| | | c.level_two_price sku_level_two_price, |
| | | c.level_three_price sku_level_three_price, |
| | | c.goods_id sku_goods_id |
| | | from mall_goods a |
| | | left join mall_goods_style b on a.id = b.goods_id |
| | |
| | | a.unit, |
| | | a.original_price, |
| | | a.present_price, |
| | | a.level_one_price, |
| | | a.level_two_price, |
| | | a.level_three_price, |
| | | a.score, |
| | | a.is_hot, |
| | | a.carriage_type, |
| | |
| | | </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>--> |
| | |
| | | ,{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: 'originalPrice', title: '原价', edit:'text', width:100} |
| | | // ,{field: 'costPrice', title: '成本价', edit:'text', width:100} |
| | | ,{templet: '#tableImgUpload', title: '缩略图', width:150} |
| | |
| | | </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>--> |
| | |
| | | ,{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} |
| | | ,{templet: '#tableImgUpload', title: '缩略图', width:150} |
| | | ,{field: 'stock', title: '库存', edit:'text', width:100} |
| | |
| | | "staticProp": goodsInfo.staticProp, |
| | | "originalPrice": goodsInfo.originalPrice, |
| | | "presentPrice": goodsInfo.presentPrice, |
| | | "levelOnePrice": goodsInfo.levelOnePrice, |
| | | "levelTwoPrice": goodsInfo.levelTwoPrice, |
| | | "levelThreePrice": goodsInfo.levelThreePrice, |
| | | "costPrice": goodsInfo.costPrice, |
| | | "isSku": goodsInfo.isSku, |
| | | "thumb": goodsInfo.thumb, |