推广部分大改
This commit is contained in:
@@ -4,13 +4,17 @@ import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.app.MainPageService;
|
||||
import cn.pluss.platform.entity.UserApp;
|
||||
import cn.pluss.platform.merchantProfit.MerchantProfitService;
|
||||
import cn.pluss.platform.userApp.UserAppService;
|
||||
import cn.pluss.platform.vo.MerchantProfitVO;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@@ -25,6 +29,8 @@ public class MainPageController {
|
||||
|
||||
@Autowired
|
||||
private MainPageService agentStaffMainPageService;
|
||||
@Resource
|
||||
private MerchantProfitService merchantProfitService;
|
||||
|
||||
/**
|
||||
* @page 商户推广
|
||||
@@ -37,12 +43,35 @@ public class MainPageController {
|
||||
UserApp userApp = userAppService.queryUserAppByToken();
|
||||
Map<String, Object> resultMap;
|
||||
|
||||
if ("agent_staff".equals(userApp.getUserType())) {
|
||||
resultMap = agentStaffMainPageService.getSpreadData(userApp.getUserId() + "");
|
||||
} else {
|
||||
resultMap = promoterMainPageService.getSpreadData(userApp.getUserId() + "");
|
||||
}
|
||||
resultMap = promoterMainPageService.getSpreadData(userApp.getUserId() + "");
|
||||
|
||||
return ResultGenerator.genSuccessResult(resultMap);
|
||||
}
|
||||
|
||||
@GetMapping("/userApp/modifyFee")
|
||||
public Result<Object> modifyFee(@RequestParam("id") Integer id, @RequestParam("fee") BigDecimal fee){
|
||||
UserApp result = userAppService.queryUserBaseInfoByToken();
|
||||
promoterMainPageService.modifyFee(result.getUserId(), id, fee);
|
||||
return ResultGenerator.genSuccessResult();
|
||||
}
|
||||
|
||||
/**
|
||||
* 团队管理
|
||||
* @param name
|
||||
* @param page
|
||||
* @param size
|
||||
* @param typeCode
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/userApp/teamControl")
|
||||
public Result<Object> teamControl(String name,
|
||||
@RequestParam(defaultValue = "1") Integer page,
|
||||
@RequestParam(defaultValue = "10") Integer size,
|
||||
@RequestParam("typeCode") String typeCode){
|
||||
UserApp result = userAppService.queryUserBaseInfoByToken();
|
||||
Map<String, Object> merchantProfitVOS = merchantProfitService.teamList(typeCode, result.getUserId(),
|
||||
page,size,name);
|
||||
return ResultGenerator.genSuccessResult(merchantProfitVOS);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -383,14 +383,16 @@ public class UserAppController {
|
||||
QueryWrapper<UserPromotion> QueryWrapper = new QueryWrapper<>();
|
||||
QueryWrapper.eq("user_id", result.getUserId());
|
||||
UserPromotion userPromotion = userPromotionService.getOne(QueryWrapper);
|
||||
if (userPromotion== null) {
|
||||
MsgException.checkBlank("", "用户状态异常");
|
||||
}
|
||||
result.setTypeCode(userPromotion == null?"null":userPromotion.getTypeCode());
|
||||
result.setMinFee(userPromotion == null?"null":userPromotion.getCurrentFee());
|
||||
if("promoter".equals(result.getUserType())) {
|
||||
if (userPromotion == null) {
|
||||
MsgException.checkBlank("", "用户状态异常");
|
||||
}
|
||||
result.setTypeCode(userPromotion == null ? "null" : userPromotion.getTypeCode());
|
||||
result.setMinFee(userPromotion == null ? "null" : userPromotion.getCurrentFee());
|
||||
|
||||
result.setMaxFee("0.32");
|
||||
result.setIsExtend(userPromotion.getIsExtend());
|
||||
result.setMaxFee("0.32");
|
||||
result.setIsExtend(userPromotion.getIsExtend());
|
||||
}
|
||||
return ResultGenerator.genSuccessResult(result);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user