xiaoyong931011
2022-08-29 832c911439b27f96596aff9d0e67ddc1e0ce2cf3
src/main/java/cc/mrbird/febs/mall/controller/AdminMallTeamLeaderController.java
@@ -4,20 +4,22 @@
import cc.mrbird.febs.common.controller.BaseController;
import cc.mrbird.febs.common.entity.FebsResponse;
import cc.mrbird.febs.common.entity.QueryRequest;
import cc.mrbird.febs.mall.dto.AdminLeaderAddDto;
import cc.mrbird.febs.mall.dto.AdminLeaderUpdateDto;
import cc.mrbird.febs.mall.dto.ApiApplayLeaderDto;
import cc.mrbird.febs.mall.entity.MallGoodsCategory;
import cc.mrbird.febs.mall.entity.MallLeaderStock;
import cc.mrbird.febs.mall.entity.MallMember;
import cc.mrbird.febs.mall.entity.MallTeamLeader;
import cc.mrbird.febs.mall.service.IAdminMallTeamLeaderService;
import cc.mrbird.febs.mall.vo.AdminSelectListLeaderVo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.Map;
@@ -49,6 +51,16 @@
        return iAdminMallTeamLeaderService.leaderUpdate(adminLeaderUpdateDto);
    }
    /**
     * 团长信息--新增
     */
    @PostMapping("addLeader")
    @ControllerEndpoint(operation = "团长信息--新增", exceptionMessage = "新增失败")
    public FebsResponse addLeader(@Valid AdminLeaderAddDto adminLeaderAddDto) {
        return iAdminMallTeamLeaderService.addLeader(adminLeaderAddDto);
    }
    /**
     * 团长信息--下拉列表
     */
@@ -57,4 +69,26 @@
        return iAdminMallTeamLeaderService.selectList(mallTeamLeader);
    }
    /**
     * 团长信息--取消团长
     */
    @GetMapping("leaderCancel/{id}")
    @ControllerEndpoint(operation = "团长信息--取消团长", exceptionMessage = "取消团长失败")
    public FebsResponse leaderCancel(@NotNull(message = "{required}") @PathVariable Long id) {
        return iAdminMallTeamLeaderService.leaderCancel(id);
    }
    /**
     * 团长信息-商品库存编辑
     */
    @GetMapping("/leaderGoodsUpdate")
    public FebsResponse leaderGoodsUpdate(QueryRequest request, MallLeaderStock mallLeaderStock, Integer parentId) {
        if (parentId == null) {
            ViewMallTeamLeaderController.idLeaderGoodsUpdate = 0;
        }
        mallLeaderStock.setTeamLeaderId(ViewMallTeamLeaderController.idLeaderGoodsUpdate);
        Map<String, Object> dataTable = getDataTable(iAdminMallTeamLeaderService.leaderGoodsUpdate(request, mallLeaderStock));
        return new FebsResponse().success().data(dataTable);
    }
}