xiaoyong931011
2022-09-13 290da793c35d43b3b32be97643cf0b66f694ae84
20220902
4 files modified
34 ■■■■ changed files
src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallOrderInfoServiceImpl.java 5 ●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallTeamLeaderServiceImpl.java 23 ●●●●● patch | view | raw | blame | history
src/main/resources/mapper/modules/MallMoneyFlowMapper.xml 2 ●●● patch | view | raw | blame | history
src/test/java/cc/mrbird/febs/ProfitTest.java 4 ●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallOrderInfoServiceImpl.java
@@ -148,7 +148,6 @@
                }
                MallGoods mallGoods = mallGoodsMapper.selectById(sku.getGoodsId());
                // 零撸专区购买
                if (new BigDecimal(mallGoods.getPresentPrice()).compareTo(BigDecimal.ZERO) == 0) {
                    List<MallOrderItem> items = mallOrderItemMapper.selectItemByGoodsIdUnCancel(mallGoods.getId(), member.getId());
@@ -161,6 +160,10 @@
                    throw new FebsException(mallGoods.getGoodsName() + "已下架");
                }
                mallGoods.setStock(mallGoods.getStock() - item.getCnt());
                mallGoods.setVolume(mallGoods.getVolume() + item.getCnt());
                mallGoodsMapper.updateById(mallGoods);
                BigDecimal amount = sku.getPresentPrice().multiply(BigDecimal.valueOf(item.getCnt()));
                orderItem.setAmount(amount);
                orderItem.setCnt(item.getCnt());
src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallTeamLeaderServiceImpl.java
@@ -62,6 +62,8 @@
    private final IApiMallMemberWalletService memberWalletService;
    private final MallLeaderAchieveMapper mallLeaderAchieveMapper;
    private final MallMoneyFlowMapper mallMoneyFlowMapper;
    private final MallGoodsMapper mallGoodsMapper;
    private final MallGoodsSkuMapper mallGoodsSkuMapper;
    @Override
    @Transactional
@@ -328,6 +330,16 @@
                //更新订单详情
                mallOrderItem.setState(3);
                mallOrderItemMapper.updateById(mallOrderItem);
                //更新库存信息
                MallGoods mallGoods = mallGoodsMapper.selectById(mallOrderItem.getGoodsId());
                mallGoods.setStock(mallGoods.getStock() + mallOrderItem.getCnt());
                mallGoods.setVolume(mallGoods.getVolume() - mallOrderItem.getCnt());
                mallGoodsMapper.updateById(mallGoods);
                MallGoodsSku mallGoodsSku = mallGoodsSkuMapper.selectById(mallOrderItem.getSkuId());
                mallGoodsSku.setStock(mallGoodsSku.getStock() + mallOrderItem.getCnt());
                mallGoodsSku.setSkuVolume(mallGoodsSku.getSkuVolume() - mallOrderItem.getCnt());
                mallGoodsSkuMapper.updateById(mallGoodsSku);
                //更新退款订单
                mallRefundEntity.setState(1);
                mallRefundEntity.setUpdatedTime(DateUtil.date());
@@ -359,6 +371,17 @@
                //更新订单详情
                mallOrderItem.setState(3);
                mallOrderItemMapper.updateById(mallOrderItem);
                //更新库存信息
                MallGoods mallGoods = mallGoodsMapper.selectById(mallOrderItem.getGoodsId());
                mallGoods.setStock(mallGoods.getStock() + mallOrderItem.getCnt());
                mallGoods.setVolume(mallGoods.getVolume() - mallOrderItem.getCnt());
                mallGoodsMapper.updateById(mallGoods);
                MallGoodsSku mallGoodsSku = mallGoodsSkuMapper.selectById(mallOrderItem.getSkuId());
                mallGoodsSku.setStock(mallGoodsSku.getStock() + mallOrderItem.getCnt());
                mallGoodsSku.setSkuVolume(mallGoodsSku.getSkuVolume() - mallOrderItem.getCnt());
                mallGoodsSkuMapper.updateById(mallGoodsSku);
                //更新退款订单
                mallRefundEntity.setState(1);
                mallRefundEntity.setUpdatedTime(DateUtil.date());
src/main/resources/mapper/modules/MallMoneyFlowMapper.xml
@@ -154,7 +154,7 @@
                and date_format(a.created_time, '%Y-%m-%d') = date_format(#{dateDay}, '%Y-%m-%d')
            </if>
            <if test="dateMonth!=null">
                and date_format(a.created_time, '%Y-%m-%d') = date_format(#{dateMonth}, '%Y-%m-%d')
                and date_format(a.created_time, '%Y-%m') = date_format(#{dateMonth}, '%Y-%m')
            </if>
        </where>
    </select>
src/test/java/cc/mrbird/febs/ProfitTest.java
@@ -202,8 +202,8 @@
    @Test
    public void qrcodeBase64(){
        WxGenerateQrCodeDto wxGenerateQrCodeDto = new WxGenerateQrCodeDto();
        wxGenerateQrCodeDto.setPage("pages/index/index");
        wxGenerateQrCodeDto.setScene("15");
        wxGenerateQrCodeDto.setPage("pages/product/details");
        wxGenerateQrCodeDto.setScene("35");
        FebsResponse febsResponse = iXcxPayService.generateQrCode(wxGenerateQrCodeDto);
        String data = febsResponse.get("data").toString();
        System.out.println(data);