| | |
| | | package cc.mrbird.febs.mall.controller; |
| | | |
| | | import cc.mrbird.febs.common.annotation.ControllerEndpoint; |
| | | 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.*; |
| | | import cc.mrbird.febs.mall.entity.MallMember; |
| | | import cc.mrbird.febs.mall.service.IMallMemberService; |
| | | import cc.mrbird.febs.mall.service.Impl.MallMemberService; |
| | | import cc.mrbird.febs.mall.entity.MallOrderRefund; |
| | | import cc.mrbird.febs.mall.service.IAdminMallMemberService; |
| | | import cc.mrbird.febs.mall.vo.AdminAgentLevelOptionTreeVo; |
| | | import cc.mrbird.febs.mall.vo.AdminMallGoodsCategoryTreeVo; |
| | | 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.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; |
| | | |
| | | @Slf4j |
| | |
| | | @RequestMapping(value = "/admin/mallMember") |
| | | public class AdminMallMemberController extends BaseController { |
| | | |
| | | private final IMallMemberService mallMemberService; |
| | | private final IAdminMallMemberService mallMemberService; |
| | | |
| | | /** |
| | | * 会员列表 |
| | |
| | | Map<String, Object> data = getDataTable(mallMemberService.getMallMemberList(mallMember, request)); |
| | | return new FebsResponse().success().data(data); |
| | | } |
| | | |
| | | /** |
| | | * 会员列表---禁止 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("closeAccount/{id}") |
| | | @ControllerEndpoint(operation = "会员列表---禁止", exceptionMessage = "禁止失败") |
| | | public FebsResponse closeAccount(@NotNull(message = "{required}") @PathVariable Long id) { |
| | | return mallMemberService.closeAccount(id); |
| | | } |
| | | |
| | | /** |
| | | * 会员列表---开启 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("openAccount/{id}") |
| | | @ControllerEndpoint(operation = "会员列表---开启", exceptionMessage = "开启失败") |
| | | public FebsResponse openAccount(@NotNull(message = "{required}") @PathVariable Long id) { |
| | | return mallMemberService.openAccount(id); |
| | | } |
| | | |
| | | /** |
| | | * 会员列表-资金流水 |
| | | */ |
| | | @GetMapping("/moneyFlow") |
| | | public FebsResponse moneyFlow(QueryRequest request, MallMember mallMember, Integer parentId) { |
| | | if(parentId==null){ |
| | | ViewMallMemberController.idFromMoneyFlow=0; |
| | | } |
| | | mallMember.setId(ViewMallMemberController.idFromMoneyFlow); |
| | | Map<String, Object> dataTable = getDataTable(mallMemberService.moneyFlow(request, mallMember)); |
| | | return new FebsResponse().success().data(dataTable); |
| | | } |
| | | |
| | | /** |
| | | * 资金流水-列表 |
| | | * @param moneyFlowListDto |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @GetMapping("getMoneyFlowList") |
| | | public FebsResponse getMoneyFlowList(MoneyFlowListDto moneyFlowListDto, QueryRequest request) { |
| | | Map<String, Object> data = getDataTable(mallMemberService.getMoneyFlowListInPage(moneyFlowListDto, request)); |
| | | return new FebsResponse().success().data(data); |
| | | } |
| | | |
| | | /** |
| | | * 会员提现-列表 |
| | | * @param moneyChargeListDto |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @GetMapping("getMoneyChargeList") |
| | | public FebsResponse getMoneyChargeList(MoneyChargeListDto moneyChargeListDto, QueryRequest request) { |
| | | Map<String, Object> data = getDataTable(mallMemberService.getMoneyChargeListInPage(moneyChargeListDto, request)); |
| | | return new FebsResponse().success().data(data); |
| | | } |
| | | |
| | | /** |
| | | * 会员提现-同意 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("chargeAgree/{id}") |
| | | @ControllerEndpoint(operation = "会员提现-同意", exceptionMessage = "操作失败") |
| | | public FebsResponse chargeAgree(@NotNull(message = "{required}") @PathVariable Long id) { |
| | | return mallMemberService.chargeAgree(id); |
| | | } |
| | | |
| | | /** |
| | | * 会员提现-拒绝 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("chargeDisagree/{id}") |
| | | @ControllerEndpoint(operation = "会员提现-拒绝", exceptionMessage = "操作失败") |
| | | public FebsResponse chargeDisagree(@NotNull(message = "{required}") @PathVariable Long id) { |
| | | return mallMemberService.chargeDisagree(id); |
| | | } |
| | | |
| | | /** |
| | | * 代理列表 |
| | | * @param agentDto |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @GetMapping("getAgentList") |
| | | public FebsResponse getAgentList(AgentDto agentDto, QueryRequest request) { |
| | | Map<String, Object> data = getDataTable(mallMemberService.getAgentList(agentDto, request)); |
| | | return new FebsResponse().success().data(data); |
| | | } |
| | | |
| | | /** |
| | | * 代理级别-列表 |
| | | * @param agentLevelDto |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @GetMapping("getAgentLevelList") |
| | | public FebsResponse getAgentLevelList(AgentLevelDto agentLevelDto, QueryRequest request) { |
| | | Map<String, Object> data = getDataTable(mallMemberService.getAgentLevelList(agentLevelDto, request)); |
| | | return new FebsResponse().success().data(data); |
| | | } |
| | | |
| | | /** |
| | | * 代理级别-更新 |
| | | */ |
| | | @PostMapping("agentLevelUpdate") |
| | | @ControllerEndpoint(operation = "商家支付方式-更新", exceptionMessage = "操作失败") |
| | | public FebsResponse agentLevelUpdate(@Valid AgentLevelUpdateDto agentLevelUpdateDto) { |
| | | return mallMemberService.agentLevelUpdate(agentLevelUpdateDto); |
| | | } |
| | | |
| | | /** |
| | | * 代理-等级选择Option |
| | | */ |
| | | @GetMapping("getAgentLevelOption/tree") |
| | | @ControllerEndpoint(exceptionMessage = "获取等级失败") |
| | | public List<AdminAgentLevelOptionTreeVo> getAgentLevelOption(){ |
| | | return mallMemberService.getAgentLevelOption(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 代理列表-全部成员 |
| | | */ |
| | | @GetMapping("/agentChild") |
| | | public FebsResponse agentChild(QueryRequest request, MallMember mallMember, Integer parentId) { |
| | | if(parentId==null){ |
| | | ViewMallMemberController.idFromAgentAllMember=0; |
| | | } |
| | | mallMember.setId(ViewMallMemberController.idFromAgentAllMember); |
| | | Map<String, Object> dataTable = getDataTable(mallMemberService.agentChild(request, mallMember)); |
| | | return new FebsResponse().success().data(dataTable); |
| | | } |
| | | |
| | | |
| | | } |