|  |  |  | 
|---|
|  |  |  | 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.MoneyChargeListDto; | 
|---|
|  |  |  | import cc.mrbird.febs.mall.dto.MoneyFlowListDto; | 
|---|
|  |  |  | import cc.mrbird.febs.mall.dto.*; | 
|---|
|  |  |  | import cc.mrbird.febs.mall.entity.AppVersion; | 
|---|
|  |  |  | import cc.mrbird.febs.mall.entity.MallMember; | 
|---|
|  |  |  | import cc.mrbird.febs.mall.entity.MallOrderRefund; | 
|---|
|  |  |  | import cc.mrbird.febs.mall.entity.MallNewsInfo; | 
|---|
|  |  |  | import cc.mrbird.febs.mall.entity.MallShopApply; | 
|---|
|  |  |  | import cc.mrbird.febs.mall.service.IAdminMallMemberService; | 
|---|
|  |  |  | import cc.mrbird.febs.mall.vo.AdminAgentLevelOptionTreeVo; | 
|---|
|  |  |  | 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.PathVariable; | 
|---|
|  |  |  | 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 | 
|---|
|  |  |  | 
|---|
|  |  |  | public class AdminMallMemberController extends BaseController { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private final IAdminMallMemberService mallMemberService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 平台账单 | 
|---|
|  |  |  | * @param mallMember | 
|---|
|  |  |  | * @param request | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @GetMapping("getMallDataList") | 
|---|
|  |  |  | public FebsResponse getMallDataList(MallMember mallMember, QueryRequest request) { | 
|---|
|  |  |  | Map<String, Object> data = getDataTable(mallMemberService.getMallDataList(mallMember, request)); | 
|---|
|  |  |  | return new FebsResponse().success().data(data); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 会员列表 | 
|---|
|  |  |  | 
|---|
|  |  |  | if(parentId==null){ | 
|---|
|  |  |  | ViewMallMemberController.idFromMoneyFlow=0; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | mallMember.setId(ViewMallOrderController.idFromRefund); | 
|---|
|  |  |  | mallMember.setId(ViewMallMemberController.idFromMoneyFlow); | 
|---|
|  |  |  | Map<String, Object> dataTable = getDataTable(mallMemberService.moneyFlow(request, mallMember)); | 
|---|
|  |  |  | return new FebsResponse().success().data(dataTable); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 会员列表-系统拨付 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping("updateSystemPay") | 
|---|
|  |  |  | @ControllerEndpoint(operation = "会员列表-系统拨付", exceptionMessage = "操作失败") | 
|---|
|  |  |  | public FebsResponse updateSystemPay(@Valid MallSystemPayDto mallSystemPayDto) { | 
|---|
|  |  |  | return mallMemberService.updateSystemPay(mallSystemPayDto); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | 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); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 代理列表---激活 | 
|---|
|  |  |  | * @param id | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @GetMapping("activateAccount/{id}") | 
|---|
|  |  |  | @ControllerEndpoint(operation = "代理列表---激活", exceptionMessage = "操作失败") | 
|---|
|  |  |  | public FebsResponse activateAccount(@NotNull(message = "{required}") @PathVariable Long id) { | 
|---|
|  |  |  | return mallMemberService.activateAccount(id); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 代理列表-设置代理级别 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping("agentLevelSetUpdate") | 
|---|
|  |  |  | @ControllerEndpoint(operation = "代理列表-设置代理级别", exceptionMessage = "操作失败") | 
|---|
|  |  |  | public FebsResponse agentLevelSetUpdate(@Valid AgentLevelSetUpdateDto agentLevelSetUpdateDto) { | 
|---|
|  |  |  | return mallMemberService.agentLevelSetUpdate(agentLevelSetUpdateDto); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 奖励设置-列表 | 
|---|
|  |  |  | * @param rankAwardDto | 
|---|
|  |  |  | * @param request | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @GetMapping("getRankAwardList") | 
|---|
|  |  |  | public FebsResponse getRankAwardList(RankAwardDto rankAwardDto, QueryRequest request) { | 
|---|
|  |  |  | Map<String, Object> data = getDataTable(mallMemberService.getRankAwardList(rankAwardDto, request)); | 
|---|
|  |  |  | return new FebsResponse().success().data(data); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 奖励设置-更新 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping("rankAwardUpdate") | 
|---|
|  |  |  | @ControllerEndpoint(operation = "奖励设置-更新", exceptionMessage = "操作失败") | 
|---|
|  |  |  | public FebsResponse rankAwardUpdate(@Valid RankAwardUpdateDto rankAwardUpdateDto) { | 
|---|
|  |  |  | return mallMemberService.rankAwardUpdate(rankAwardUpdateDto); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * App版本-列表 | 
|---|
|  |  |  | * @param appVersion | 
|---|
|  |  |  | * @param request | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @GetMapping("getAppVersionList") | 
|---|
|  |  |  | public FebsResponse getAppVersionList(AppVersion appVersion, QueryRequest request) { | 
|---|
|  |  |  | Map<String, Object> data = getDataTable(mallMemberService.getAppVersionList(appVersion, request)); | 
|---|
|  |  |  | return new FebsResponse().success().data(data); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * App版本-删除 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @GetMapping("delAppVersion/{id}") | 
|---|
|  |  |  | @ControllerEndpoint(operation = " App版本-删除", exceptionMessage = "操作失败") | 
|---|
|  |  |  | public FebsResponse delAppVersion(@NotNull(message = "{required}") @PathVariable Long id) { | 
|---|
|  |  |  | return mallMemberService.delCategary(id); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * App版本-新增 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping("addAppVersion") | 
|---|
|  |  |  | @ControllerEndpoint(operation = " App版本-新增", exceptionMessage = "操作失败") | 
|---|
|  |  |  | public FebsResponse addAppVersion(@Valid AppVersion appVersion) { | 
|---|
|  |  |  | return mallMemberService.addAppVersion(appVersion); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * App版本-更新 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping("updateAppVersion") | 
|---|
|  |  |  | @ControllerEndpoint(operation = "App版本-更新", exceptionMessage = "操作失败") | 
|---|
|  |  |  | public FebsResponse updateAppVersion(@Valid AppVersion appVersion) { | 
|---|
|  |  |  | return mallMemberService.updateAppVersion(appVersion); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PostMapping("resetPwd/{id}") | 
|---|
|  |  |  | @ControllerEndpoint(operation = "会员列表---重置密码", exceptionMessage = "重置密码失败") | 
|---|
|  |  |  | public FebsResponse resetPwd(@PathVariable("id") Long id) { | 
|---|
|  |  |  | return mallMemberService.resetPwd(id); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @GetMapping("shopApplyList") | 
|---|
|  |  |  | @ControllerEndpoint(operation = "申请通道列表", exceptionMessage = "获取失败") | 
|---|
|  |  |  | public FebsResponse shopApplyList(MallShopApply mallShopApply, QueryRequest request) { | 
|---|
|  |  |  | return new FebsResponse().success().data(getDataTable(mallMemberService.findShopApplyListInPage(mallShopApply, request))); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PostMapping("applyCheckAgree/{id}") | 
|---|
|  |  |  | public FebsResponse applyCheckAgree(@PathVariable Long id) { | 
|---|
|  |  |  | mallMemberService.applyCheckAgree(id); | 
|---|
|  |  |  | return new FebsResponse().success().message("操作成功"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PostMapping(value = "applyCheckDisAgree/{id}") | 
|---|
|  |  |  | public FebsResponse applyCheckDisAgree(@PathVariable Long id) { | 
|---|
|  |  |  | mallMemberService.applyCheckDisAgree(id); | 
|---|
|  |  |  | return new FebsResponse().success().message("操作成功"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|