| | |
| | | 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.common.enumerates.DataDictionaryEnum; |
| | | import cc.mrbird.febs.mall.dto.AdminLeaderAddDto; |
| | | import cc.mrbird.febs.mall.dto.AdminLeaderAddFenceDto; |
| | | import cc.mrbird.febs.mall.dto.AdminLeaderUpdateDto; |
| | | 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.dto.ApiApplayLeaderDto; |
| | | import cc.mrbird.febs.mall.entity.*; |
| | | import cc.mrbird.febs.mall.mapper.DataDictionaryCustomMapper; |
| | | import cc.mrbird.febs.mall.service.IAdminMallTeamLeaderService; |
| | | import cc.mrbird.febs.mall.vo.AdminLeaderBonusSettingVo; |
| | | import cc.mrbird.febs.mall.vo.AdminRangeSettingVo; |
| | | import cc.mrbird.febs.mall.vo.AdminSelectListLeaderVo; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | |
| | | |
| | | private final IAdminMallTeamLeaderService iAdminMallTeamLeaderService; |
| | | private final DataDictionaryCustomMapper dataDictionaryCustomMapper; |
| | | |
| | | /** |
| | | * 团长信息--列表 |
| | |
| | | */ |
| | | @PostMapping("leaderUpdate") |
| | | @ControllerEndpoint(operation = "团长信息--审核", exceptionMessage = "审核失败") |
| | | public FebsResponse leaderUpdate(@Valid AdminLeaderUpdateDto adminLeaderUpdateDto) { |
| | | return iAdminMallTeamLeaderService.leaderUpdate(adminLeaderUpdateDto); |
| | | public FebsResponse leaderUpdate(@Valid MallTeamLeader mallTeamLeader) { |
| | | return iAdminMallTeamLeaderService.leaderUpdate(mallTeamLeader); |
| | | } |
| | | |
| | | /** |
| | | * 团长-开启返利 |
| | | */ |
| | | @GetMapping("startProfit/{id}") |
| | | @ControllerEndpoint(operation = "团长-开启返利", exceptionMessage = "操作失败") |
| | | public FebsResponse startProfit(@NotNull(message = "{required}") @PathVariable Long id) { |
| | | return iAdminMallTeamLeaderService.startProfit(id); |
| | | } |
| | | |
| | | /** |
| | | * 团长-关闭返利 |
| | | */ |
| | | @GetMapping("closeProfit/{id}") |
| | | @ControllerEndpoint(operation = "团长-关闭返利", exceptionMessage = "操作失败") |
| | | public FebsResponse closeProfit(@NotNull(message = "{required}") @PathVariable Long id) { |
| | | return iAdminMallTeamLeaderService.closeProfit(id); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 团长信息--新增 |
| | | */ |
| | | @PostMapping("addLeader") |
| | | @ControllerEndpoint(operation = "团长信息--新增", exceptionMessage = "新增失败") |
| | | public FebsResponse addLeader(@Valid AdminLeaderAddDto adminLeaderAddDto) { |
| | | return iAdminMallTeamLeaderService.addLeader(adminLeaderAddDto); |
| | | } |
| | | |
| | | /** |
| | |
| | | return new FebsResponse().success().data(dataTable); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 团长每日分成设置 -- 更新 |
| | | */ |
| | | @PostMapping(value = "/leaderBonusSetUpdate") |
| | | public FebsResponse leaderBonusSetUpdate(AdminLeaderBonusSettingVo adminLeaderBonusSettingVo) { |
| | | Integer bonusSwitch = adminLeaderBonusSettingVo.getBonusSwitch(); |
| | | DataDictionaryCustom bonusSwitchDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.BONUS_SWITCH.getType(), DataDictionaryEnum.BONUS_SWITCH.getCode()); |
| | | bonusSwitchDic.setValue(bonusSwitch.toString()); |
| | | dataDictionaryCustomMapper.updateById(bonusSwitchDic); |
| | | |
| | | Double bonusPercent = Double.parseDouble(adminLeaderBonusSettingVo.getBonusPercent()); |
| | | if(1 <= bonusPercent || 0 >= bonusPercent){ |
| | | return new FebsResponse().fail().message("请输入合适的百分比小数"); |
| | | } |
| | | DataDictionaryCustom bonusPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.BONUS_PERCENT.getType(), DataDictionaryEnum.BONUS_PERCENT.getCode()); |
| | | bonusPercentDic.setValue(bonusPercent.toString()); |
| | | dataDictionaryCustomMapper.updateById(bonusPercentDic); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 团长--设置电子围栏 |
| | | */ |
| | | @PostMapping("addFence") |
| | | @ControllerEndpoint(operation = "团长信息--设置电子围栏", exceptionMessage = "设置失败") |
| | | public FebsResponse addFence(@Valid AdminLeaderAddFenceDto adminLeaderAddFenceDto) { |
| | | return iAdminMallTeamLeaderService.addFence(adminLeaderAddFenceDto); |
| | | } |
| | | |
| | | /** |
| | | * 团长--在线 |
| | | */ |
| | | @GetMapping("startOnline/{id}") |
| | | @ControllerEndpoint(operation = "团长--在线", exceptionMessage = "操作失败") |
| | | public FebsResponse startOnline(@NotNull(message = "{required}") @PathVariable Long id) { |
| | | return iAdminMallTeamLeaderService.startOnline(id); |
| | | } |
| | | |
| | | /** |
| | | * 团长--离线 |
| | | */ |
| | | @GetMapping("closeOnline/{id}") |
| | | @ControllerEndpoint(operation = "团长--离线", exceptionMessage = "操作失败") |
| | | public FebsResponse closeOnline(@NotNull(message = "{required}") @PathVariable Long id) { |
| | | return iAdminMallTeamLeaderService.closeOnline(id); |
| | | } |
| | | |
| | | } |