|
@@ -3,6 +3,7 @@ package com.izouma.nineth.web;
|
|
|
import com.izouma.nineth.TokenHistory;
|
|
import com.izouma.nineth.TokenHistory;
|
|
|
import com.izouma.nineth.domain.Asset;
|
|
import com.izouma.nineth.domain.Asset;
|
|
|
import com.izouma.nineth.domain.GiftOrder;
|
|
import com.izouma.nineth.domain.GiftOrder;
|
|
|
|
|
+import com.izouma.nineth.domain.User;
|
|
|
import com.izouma.nineth.dto.PageQuery;
|
|
import com.izouma.nineth.dto.PageQuery;
|
|
|
import com.izouma.nineth.dto.UserHistory;
|
|
import com.izouma.nineth.dto.UserHistory;
|
|
|
import com.izouma.nineth.exception.BusinessException;
|
|
import com.izouma.nineth.exception.BusinessException;
|
|
@@ -22,7 +23,9 @@ import org.springframework.web.bind.annotation.*;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
|
|
+import java.time.LocalDateTime;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
+import java.util.Map;
|
|
|
|
|
|
|
|
@RestController
|
|
@RestController
|
|
|
@RequestMapping("/asset")
|
|
@RequestMapping("/asset")
|
|
@@ -115,6 +118,17 @@ public class AssetController extends BaseController {
|
|
|
public Page<UserHistory> userHistory(Pageable pageable) {
|
|
public Page<UserHistory> userHistory(Pageable pageable) {
|
|
|
return assetService.userHistory(SecurityUtils.getAuthenticatedUser().getId(), pageable);
|
|
return assetService.userHistory(SecurityUtils.getAuthenticatedUser().getId(), pageable);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ @PostMapping("/holdQuery")
|
|
|
|
|
+ public String holdQuery(@RequestParam List<String> names, @RequestParam LocalDateTime start, @RequestParam LocalDateTime end) {
|
|
|
|
|
+ Map<User, Integer> match = assetService.holdQuery(names, start, end);
|
|
|
|
|
+ StringBuilder builder = new StringBuilder("用户ID,昵称,手机,持有套数\n");
|
|
|
|
|
+ for (Map.Entry<User, Integer> e : match.entrySet()) {
|
|
|
|
|
+ User user = e.getKey();
|
|
|
|
|
+ builder.append(String.format("%d,%s,%s,%d%n", user.getId(), user.getNickname(), user.getPhone(), e.getValue()));
|
|
|
|
|
+ }
|
|
|
|
|
+ return builder.toString();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|