xiaoyong931011
2022-08-10 fa4b399a1cfa43720b1f0a14fb3ca692a5ed1ea7
src/main/java/cc/mrbird/febs/mall/service/impl/AdminMallOrderService.java
@@ -4,6 +4,7 @@
import cc.mrbird.febs.common.entity.QueryRequest;
import cc.mrbird.febs.common.enumerates.FlowTypeEnum;
import cc.mrbird.febs.common.enumerates.MoneyFlowTypeEnum;
import cc.mrbird.febs.common.enumerates.OrderDeliveryStateEnum;
import cc.mrbird.febs.mall.dto.*;
import cc.mrbird.febs.mall.entity.*;
import cc.mrbird.febs.mall.mapper.*;
@@ -43,6 +44,8 @@
    private final MallOrderRefundAddressMapper mallOrderRefundAddressMapper;
    private final MallGoodsCommentMapper mallGoodsCommentMapper;
    private final MallMoneyFlowMapper mallMoneyFlowMapper;
    private final IApiMallMemberWalletService iApiMallMemberWalletService;
@@ -81,6 +84,10 @@
        if(2 != status){
            return new FebsResponse().fail().message("订单不是待发货状态");
        }
        Integer deliveryType = mallOrderInfo.getDeliveryType();
        if(2 != deliveryType){
            return new FebsResponse().fail().message("订单的配送方式不是快递");
        }
        String expressNo = deliverGoodsDto.getExpressNo();
        if(StrUtil.isEmpty(expressNo)){
            return new FebsResponse().fail().message("请输入物流单号");
@@ -97,6 +104,7 @@
        mallExpressInfoMapper.insert(mallExpressInfo);
        mallOrderInfo.setStatus(3);
        mallOrderInfo.setDeliveryState(OrderDeliveryStateEnum.DELIVERY_ING.getValue());
        mallOrderInfoMapper.updateById(mallOrderInfo);
        return new FebsResponse().success();
    }
@@ -363,6 +371,40 @@
    }
    @Override
    public IPage<AdminMallGoodsCommentVo> getCommentListInPage(AdminMallGoodsCommentDto adminMallGoodsCommentDto, QueryRequest request) {
        Page<AdminMallGoodsCommentVo> page = new Page<>(request.getPageNum(), request.getPageSize());
        IPage<AdminMallGoodsCommentVo> adminMallGoodsCommentVos = mallGoodsCommentMapper.getCommentListInPage(page, adminMallGoodsCommentDto);
        return adminMallGoodsCommentVos;
    }
    @Override
    public FebsResponse showStateSwitchOn(Long id) {
        MallGoodsComment mallGoodsComment = mallGoodsCommentMapper.selectById(id);
        if (ObjectUtil.isEmpty(mallGoodsComment)) {
            return new FebsResponse().fail().message("评论不存在,请刷新当前页面");
        }
        mallGoodsComment.setShowState(MallGoodsComment.SHOW_STATE_ENABLE);
        mallGoodsCommentMapper.updateById(mallGoodsComment);
        return new FebsResponse().success();
    }
    @Override
    public FebsResponse showStateSwitchOff(Long id) {
        MallGoodsComment mallGoodsComment = mallGoodsCommentMapper.selectById(id);
        if (ObjectUtil.isEmpty(mallGoodsComment)) {
            return new FebsResponse().fail().message("评论不存在,请刷新当前页面");
        }
        mallGoodsComment.setShowState(MallGoodsComment.SHOW_STATE_DISABLED);
        mallGoodsCommentMapper.updateById(mallGoodsComment);
        return new FebsResponse().success();
    }
    @Override
    public void updateOrderStateAndDeliveryState(Long id, int value, int value1) {
        mallOrderInfoMapper.updateOrderStateAndDeliveryState(id,value,value1);
    }
    @Override
    public void deliverGoodsByOrderNo(DeliverGoodsDto deliverGoodsDto) {
        MallOrderInfo mallOrderInfo = mallOrderInfoMapper.selectByOrderNo(deliverGoodsDto.getOrderNo());
        if (mallOrderInfo == null) {