Commit f73bddee authored by Administrator's avatar Administrator

Merge branch 'staging' into 'master'

Staging

See merge request !171
parents fae5790e c9d2de37
...@@ -458,9 +458,58 @@ public class AdministratorController { ...@@ -458,9 +458,58 @@ public class AdministratorController {
@RequestParam(value = "username", required = false) String username, @RequestParam(value = "promotionCode", required = false) String promotionCode) { @RequestParam(value = "username", required = false) String username, @RequestParam(value = "promotionCode", required = false) String promotionCode) {
ResultDto resultDto = new ResultDto(); ResultDto resultDto = new ResultDto();
try { try {
long begin = System.currentTimeMillis();
Pageable pageable = PageRequest.of(page, size); Pageable pageable = PageRequest.of(page, size);
resultDto.setData(administratorService.queryPromotion(pageable, username, promotionCode, strDate1, strDate2)); resultDto.setData(administratorService.queryPromotion(pageable, username, promotionCode, strDate1, strDate2));
resultDto.setStatus(0); resultDto.setStatus(0);
long end = System.currentTimeMillis();
log.info("queryPromotion executed time: {} ms", (end - begin));
} catch (ClientRequestException e) {
resultDto.setStatus(-1);
Map<String, Object> statusInfo = new HashMap<>();
statusInfo.put("code", e.getErrorCode());
statusInfo.put("message", e.getMessage());
resultDto.setStatusInfo(statusInfo);
}
return resultDto;
}
//统计推广码下消费
@PreAuthorize(Securitys.ADMIN_EL)
@GetMapping("/0xadministrator/promotioncode/queryinfo")
public ResultDto queryCountPromotionInfo(@RequestParam(value = "strDate1") String strDate1, @RequestParam(value = "strDate2") String strDate2,
@RequestParam(value = "username", required = false) String username, @RequestParam(value = "promotionCode", required = false) String promotionCode) {
ResultDto resultDto = new ResultDto();
try {
long begin = System.currentTimeMillis();
resultDto.setData(administratorService.countPromotionInfos(username, promotionCode, strDate1, strDate2));
resultDto.setStatus(0);
long end = System.currentTimeMillis();
log.info("queryCountPromotionInfo executed time: {} ms", (end - begin));
} catch (ClientRequestException e) {
resultDto.setStatus(-1);
Map<String, Object> statusInfo = new HashMap<>();
statusInfo.put("code", e.getErrorCode());
statusInfo.put("message", e.getMessage());
resultDto.setStatusInfo(statusInfo);
}
return resultDto;
}
//统计推广码下消费
@PreAuthorize(Securitys.ADMIN_EL)
@GetMapping("/0xadministrator/promotioncode/querypage")
public ResultDto queryPagePromotionInfos(@RequestParam(value = "page") int page, @RequestParam(value = "size") int size,
@RequestParam(value = "strDate1") String strDate1, @RequestParam(value = "strDate2") String strDate2,
@RequestParam(value = "username", required = false) String username, @RequestParam(value = "promotionCode", required = false) String promotionCode) {
ResultDto resultDto = new ResultDto();
try {
long begin = System.currentTimeMillis();
Pageable pageable = PageRequest.of(page, size);
resultDto.setData(administratorService.pagePromotionInfos(pageable, username, promotionCode, strDate1, strDate2));
resultDto.setStatus(0);
long end = System.currentTimeMillis();
log.info("queryPagePromotionInfos executed time: {} ms", (end - begin));
} catch (ClientRequestException e) { } catch (ClientRequestException e) {
resultDto.setStatus(-1); resultDto.setStatus(-1);
Map<String, Object> statusInfo = new HashMap<>(); Map<String, Object> statusInfo = new HashMap<>();
......
package com.edgec.browserbackend.account.dto; package com.edgec.browserbackend.account.dto;
import com.edgec.browserbackend.account.domain.Account; import com.edgec.browserbackend.account.domain.Account;
import com.edgec.browserbackend.account.domain.Promotion;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.util.Date; import java.util.Date;
...@@ -10,7 +9,12 @@ import java.util.Date; ...@@ -10,7 +9,12 @@ import java.util.Date;
public class AccountPromotionDto { public class AccountPromotionDto {
private String username; private String username;
private Date signupDate; private Date signupDate;
private Promotion promotion; //private Promotion promotion;
private Integer firstLevelIps;
private Integer secondLevelIps;
private Integer firstLevelCommission;
private Integer secondLevelCommission;
public AccountPromotionDto() { public AccountPromotionDto() {
...@@ -19,7 +23,6 @@ public class AccountPromotionDto { ...@@ -19,7 +23,6 @@ public class AccountPromotionDto {
public AccountPromotionDto(Account account) { public AccountPromotionDto(Account account) {
this.username = account.getName(); this.username = account.getName();
this.signupDate = account.getSignupDate(); this.signupDate = account.getSignupDate();
this.promotion = account.getPromotion();
} }
public String getUsername() { public String getUsername() {
...@@ -37,4 +40,36 @@ public class AccountPromotionDto { ...@@ -37,4 +40,36 @@ public class AccountPromotionDto {
public void setSignupDate(Date signupDate) { public void setSignupDate(Date signupDate) {
this.signupDate = signupDate; this.signupDate = signupDate;
} }
public Integer getFirstLevelIps() {
return firstLevelIps;
}
public void setFirstLevelIps(Integer firstLevelIps) {
this.firstLevelIps = firstLevelIps;
}
public Integer getSecondLevelIps() {
return secondLevelIps;
}
public void setSecondLevelIps(Integer secondLevelIps) {
this.secondLevelIps = secondLevelIps;
}
public Integer getFirstLevelCommission() {
return firstLevelCommission;
}
public void setFirstLevelCommission(Integer firstLevelCommission) {
this.firstLevelCommission = firstLevelCommission;
}
public Integer getSecondLevelCommission() {
return secondLevelCommission;
}
public void setSecondLevelCommission(Integer secondLevelCommission) {
this.secondLevelCommission = secondLevelCommission;
}
} }
package com.edgec.browserbackend.account.dto;
/**
* @author xuxin
* @date 2020/9/15 17:22
* @description
*/
public class PromotionInfoDto {
private Integer firstLevelInvitedUsers;
private Integer firstLevelIps;
private Integer secondLevelIps;
private Integer allLevelIps;
/**
* 当前推荐码用户应当获取的礼金
*/
private Double gift;
private Integer firstLevelCommission;
private Integer secondLevelCommission;
public Integer getFirstLevelInvitedUsers() {
return firstLevelInvitedUsers;
}
public void setFirstLevelInvitedUsers(Integer firstLevelInvitedUsers) {
this.firstLevelInvitedUsers = firstLevelInvitedUsers;
}
public Integer getFirstLevelIps() {
return firstLevelIps;
}
public void setFirstLevelIps(Integer firstLevelIps) {
this.firstLevelIps = firstLevelIps;
}
public Integer getSecondLevelIps() {
return secondLevelIps;
}
public void setSecondLevelIps(Integer secondLevelIps) {
this.secondLevelIps = secondLevelIps;
}
public Integer getAllLevelIps() {
return allLevelIps;
}
public void setAllLevelIps(Integer allLevelIps) {
this.allLevelIps = allLevelIps;
}
public Double getGift() {
return gift;
}
public void setGift(Double gift) {
this.gift = gift;
}
public Integer getFirstLevelCommission() {
return firstLevelCommission;
}
public void setFirstLevelCommission(Integer firstLevelCommission) {
this.firstLevelCommission = firstLevelCommission;
}
public Integer getSecondLevelCommission() {
return secondLevelCommission;
}
public void setSecondLevelCommission(Integer secondLevelCommission) {
this.secondLevelCommission = secondLevelCommission;
}
}
...@@ -33,6 +33,8 @@ public interface AccountRepository extends MongoRepository<Account, String>, Acc ...@@ -33,6 +33,8 @@ public interface AccountRepository extends MongoRepository<Account, String>, Acc
List<Account> findAllByPromotionCodeAndParentIsNull(String code); List<Account> findAllByPromotionCodeAndParentIsNull(String code);
Page<Account> findAllByPromotionCodeAndParentIsNull(Pageable pageable, String code);
Page<Account> findAllBySignupDateBetweenAndPromotionCodeAndParentIsNull(Pageable pageable, Date startDate, Date endDate, String promotionCode); Page<Account> findAllBySignupDateBetweenAndPromotionCodeAndParentIsNull(Pageable pageable, Date startDate, Date endDate, String promotionCode);
Page<Account> findAllBySignupDateBetweenAndParentIsNull(Pageable pageable, Date startDate, Date endDate); Page<Account> findAllBySignupDateBetweenAndParentIsNull(Pageable pageable, Date startDate, Date endDate);
......
package com.edgec.browserbackend.account.service; package com.edgec.browserbackend.account.service;
import com.edgec.browserbackend.account.domain.*; import com.edgec.browserbackend.account.domain.*;
import com.edgec.browserbackend.account.dto.BillQueryResultDto; import com.edgec.browserbackend.account.dto.*;
import com.edgec.browserbackend.account.dto.IpCountQueryResultDto;
import com.edgec.browserbackend.account.dto.PromotionQueryResultDto;
import com.edgec.browserbackend.account.dto.UserUsedDto;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
...@@ -58,6 +55,10 @@ public interface AdministratorService { ...@@ -58,6 +55,10 @@ public interface AdministratorService {
PromotionQueryResultDto queryPromotion(Pageable pageable, String username, String promotionCode, String strDate1, String strDate2); PromotionQueryResultDto queryPromotion(Pageable pageable, String username, String promotionCode, String strDate1, String strDate2);
PromotionInfoDto countPromotionInfos(String username, String promotionCode, String beginDate, String endDate);
Page<AccountPromotionDto> pagePromotionInfos(Pageable pageable, String username, String promotionCode, String beginDate, String endDate);
void addWhiteList(String website); void addWhiteList(String website);
void addUserWhiteList(String username, String website); void addUserWhiteList(String username, String website);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment