|
|
|
@ -2,6 +2,7 @@ package me.mofun.controller;
|
|
|
|
|
|
|
|
|
|
|
|
import me.mofun.entity.*;
|
|
|
|
import me.mofun.entity.*;
|
|
|
|
import me.mofun.entity.dto.ProductSpellbuyproductDTO;
|
|
|
|
import me.mofun.entity.dto.ProductSpellbuyproductDTO;
|
|
|
|
|
|
|
|
import me.mofun.entity.dto.SpellbuyrecordDTO;
|
|
|
|
import me.mofun.entity.pojo.BuyHistoryJSON;
|
|
|
|
import me.mofun.entity.pojo.BuyHistoryJSON;
|
|
|
|
import me.mofun.entity.pojo.ProductJSON;
|
|
|
|
import me.mofun.entity.pojo.ProductJSON;
|
|
|
|
import me.mofun.entity.pojo.UserJSON;
|
|
|
|
import me.mofun.entity.pojo.UserJSON;
|
|
|
|
@ -10,7 +11,6 @@ import me.mofun.service.*;
|
|
|
|
import me.mofun.util.ApplicationListenerImpl;
|
|
|
|
import me.mofun.util.ApplicationListenerImpl;
|
|
|
|
import me.mofun.util.MemCachedClientHelp;
|
|
|
|
import me.mofun.util.MemCachedClientHelp;
|
|
|
|
import me.mofun.util.UserNameUtil;
|
|
|
|
import me.mofun.util.UserNameUtil;
|
|
|
|
import me.mofun.utils.ViewUtils;
|
|
|
|
|
|
|
|
import net.sf.json.JSONArray;
|
|
|
|
import net.sf.json.JSONArray;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
@ -90,30 +90,30 @@ public class IndexController {
|
|
|
|
this.userService = userService;
|
|
|
|
this.userService = userService;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private ViewUtils viewUtils;
|
|
|
|
|
|
|
|
private final String module = "index";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 首页
|
|
|
|
* 首页
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@GetMapping("/")
|
|
|
|
@GetMapping("/")
|
|
|
|
public String index(Model model) {
|
|
|
|
public ModelAndView index() {
|
|
|
|
|
|
|
|
ModelAndView mav = new ModelAndView();
|
|
|
|
|
|
|
|
|
|
|
|
// 检查系统授权
|
|
|
|
// 检查系统授权
|
|
|
|
if (!ApplicationListenerImpl.sysConfigureAuth) {
|
|
|
|
if (!ApplicationListenerImpl.sysConfigureAuth) {
|
|
|
|
model.addAttribute("errorMsg", "该系统授权已过期,请联系管理员重新授权!谢谢合作。");
|
|
|
|
mav.addObject("errorMsg", "该系统授权已过期,请联系管理员重新授权!谢谢合作。");
|
|
|
|
return "error/authorization";
|
|
|
|
mav.setViewName("/WEB-INF/template/error/authorization");
|
|
|
|
|
|
|
|
return mav;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 初始化首页数据
|
|
|
|
// 初始化首页数据
|
|
|
|
initNewProductList(model);
|
|
|
|
initNewProductList(mav);
|
|
|
|
initLatestLotteryList(model);
|
|
|
|
initLatestLotteryList(mav);
|
|
|
|
initRecommendProduct(model);
|
|
|
|
initRecommendProduct(mav);
|
|
|
|
initNewsList(model);
|
|
|
|
initNewsList(mav);
|
|
|
|
initIndexImgList(model);
|
|
|
|
initIndexImgList(mav);
|
|
|
|
// initUpcomingProducts(model);
|
|
|
|
// initUpcomingProducts(mav);
|
|
|
|
|
|
|
|
|
|
|
|
return "WEB-INF/template/my/index/index-new";
|
|
|
|
mav.setViewName("/WEB-INF/template/my/index/index-new");
|
|
|
|
|
|
|
|
return mav;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
@ -208,8 +208,8 @@ public class IndexController {
|
|
|
|
if (isCacheExpired(beginDateByNowBuyProduct, nowDateByNowBuyProduct)) {
|
|
|
|
if (isCacheExpired(beginDateByNowBuyProduct, nowDateByNowBuyProduct)) {
|
|
|
|
beginDateByNowBuyProduct = System.currentTimeMillis();
|
|
|
|
beginDateByNowBuyProduct = System.currentTimeMillis();
|
|
|
|
Pagination page = spellbuyrecordService.getNowBuyList(0, PAGE_SIZE_XXLARGE);
|
|
|
|
Pagination page = spellbuyrecordService.getNowBuyList(0, PAGE_SIZE_XXLARGE);
|
|
|
|
List<ProductSpellbuyproductDTO> nowBuyList = (List<ProductSpellbuyproductDTO>) page.getList();
|
|
|
|
List<SpellbuyrecordDTO> nowBuyList = (List<SpellbuyrecordDTO>) page.getList();
|
|
|
|
nowBuyProductList = convertToNowBuyProductList(nowBuyList);
|
|
|
|
nowBuyProductList = convertToNowBuyProductUserList(nowBuyList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nowBuyProductList;
|
|
|
|
return nowBuyProductList;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -227,26 +227,32 @@ public class IndexController {
|
|
|
|
* 邀请授权页
|
|
|
|
* 邀请授权页
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@GetMapping("/referAuth")
|
|
|
|
@GetMapping("/referAuth")
|
|
|
|
public String referAuth(HttpServletRequest request, Model model) {
|
|
|
|
public ModelAndView referAuth(HttpServletRequest request) {
|
|
|
|
|
|
|
|
ModelAndView mav = new ModelAndView();
|
|
|
|
String uid = getUidFromCookie(request.getCookies());
|
|
|
|
String uid = getUidFromCookie(request.getCookies());
|
|
|
|
model.addAttribute("uid", uid);
|
|
|
|
mav.addObject("uid", uid);
|
|
|
|
return "referAuthLogin";
|
|
|
|
mav.setViewName("/WEB-INF/template/my/referAuth/referAuthLogin");
|
|
|
|
|
|
|
|
return mav;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 地图模式页
|
|
|
|
* 地图模式页
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@GetMapping("/map")
|
|
|
|
@GetMapping("/map")
|
|
|
|
public String map() {
|
|
|
|
public ModelAndView map() {
|
|
|
|
return "map";
|
|
|
|
ModelAndView mav = new ModelAndView();
|
|
|
|
|
|
|
|
mav.setViewName("/WEB-INF/template/index/map");
|
|
|
|
|
|
|
|
return mav;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 诚信页
|
|
|
|
* 诚信页
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@GetMapping("/sincerity")
|
|
|
|
@GetMapping("/sincerity")
|
|
|
|
public String sincerity() {
|
|
|
|
public ModelAndView sincerity() {
|
|
|
|
return "sincerity";
|
|
|
|
ModelAndView mav = new ModelAndView();
|
|
|
|
|
|
|
|
mav.setViewName("/WEB-INF/template/index/sincerity");
|
|
|
|
|
|
|
|
return mav;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
@ -297,12 +303,14 @@ public class IndexController {
|
|
|
|
* 最新100条拍购记录页
|
|
|
|
* 最新100条拍购记录页
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@GetMapping("/getNewRecord")
|
|
|
|
@GetMapping("/getNewRecord")
|
|
|
|
public String getNewRecord(Model model) {
|
|
|
|
public ModelAndView getNewRecord() {
|
|
|
|
|
|
|
|
ModelAndView mav = new ModelAndView();
|
|
|
|
Pagination page = spellbuyrecordService.getNowBuyList(0, PAGE_SIZE_XXLARGE);
|
|
|
|
Pagination page = spellbuyrecordService.getNowBuyList(0, PAGE_SIZE_XXLARGE);
|
|
|
|
List<ProductSpellbuyproductDTO> nowBuyList = (List<ProductSpellbuyproductDTO>) page.getList();
|
|
|
|
List<SpellbuyrecordDTO> nowBuyList = (List<SpellbuyrecordDTO>) page.getList();
|
|
|
|
List<ProductJSON> productList = convertToNewRecordProductList(nowBuyList);
|
|
|
|
List<ProductJSON> productList = convertToNewRecordProductList(nowBuyList);
|
|
|
|
model.addAttribute("productList", productList);
|
|
|
|
mav.addObject("productList", productList);
|
|
|
|
return "newRecord";
|
|
|
|
mav.setViewName("/WEB-INF/template/index/newRecord");
|
|
|
|
|
|
|
|
return mav;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
@ -315,7 +323,7 @@ public class IndexController {
|
|
|
|
if (isCacheExpired(beginDateByNewRecord, nowDateByNewRecord)) {
|
|
|
|
if (isCacheExpired(beginDateByNewRecord, nowDateByNewRecord)) {
|
|
|
|
beginDateByNewRecord = System.currentTimeMillis();
|
|
|
|
beginDateByNewRecord = System.currentTimeMillis();
|
|
|
|
Pagination page = spellbuyrecordService.getNowBuyAjaxList(0, PAGE_SIZE_XXLARGE, Integer.parseInt(id));
|
|
|
|
Pagination page = spellbuyrecordService.getNowBuyAjaxList(0, PAGE_SIZE_XXLARGE, Integer.parseInt(id));
|
|
|
|
List<ProductSpellbuyproductDTO> nowBuyList = (List<ProductSpellbuyproductDTO>) page.getList();
|
|
|
|
List<SpellbuyrecordDTO> nowBuyList = (List<SpellbuyrecordDTO>) page.getList();
|
|
|
|
newRecordList = convertToNewRecordProductList(nowBuyList);
|
|
|
|
newRecordList = convertToNewRecordProductList(nowBuyList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return newRecordList;
|
|
|
|
return newRecordList;
|
|
|
|
@ -325,26 +333,27 @@ public class IndexController {
|
|
|
|
* 全站拍购记录查询(带时间筛选)
|
|
|
|
* 全站拍购记录查询(带时间筛选)
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@GetMapping("/getAllBuyRecord")
|
|
|
|
@GetMapping("/getAllBuyRecord")
|
|
|
|
public String getAllBuyRecord(Model model,
|
|
|
|
public ModelAndView getAllBuyRecord(@RequestParam(required = false) String startDate,
|
|
|
|
@RequestParam(required = false) String startDate,
|
|
|
|
@RequestParam(required = false) String endDate,
|
|
|
|
@RequestParam(required = false) String endDate,
|
|
|
|
@RequestParam(defaultValue = "0") int pageNo) {
|
|
|
|
@RequestParam(defaultValue = "0") int pageNo) {
|
|
|
|
ModelAndView mav = new ModelAndView();
|
|
|
|
Pagination datePage = spellbuyrecordService.getAllBuyRecord(startDate, endDate, pageNo, PAGE_SIZE_XXLARGE);
|
|
|
|
Pagination datePage = spellbuyrecordService.getAllBuyRecord(startDate, endDate, pageNo, PAGE_SIZE_XXLARGE);
|
|
|
|
List<ProductSpellbuyproductDTO> dataList = (List<ProductSpellbuyproductDTO>) datePage.getList();
|
|
|
|
List<SpellbuyrecordDTO> dataList = (List<SpellbuyrecordDTO>) datePage.getList();
|
|
|
|
List<BuyHistoryJSON> historyList = convertToBuyHistoryList(dataList);
|
|
|
|
List<BuyHistoryJSON> historyList = convertToBuyHistoryList(dataList);
|
|
|
|
model.addAttribute("buyHistoryJSONList", historyList);
|
|
|
|
mav.addObject("buyHistoryJSONList", historyList);
|
|
|
|
return "allBuyRecord";
|
|
|
|
mav.setViewName("/WEB-INF/template/index/allBuyRecord");
|
|
|
|
|
|
|
|
return mav;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/JPData")
|
|
|
|
@GetMapping("/JPData")
|
|
|
|
public String JPData(@RequestParam String action) {
|
|
|
|
public String JPData(@RequestParam String action) {
|
|
|
|
return "forward:/group/" + action + ".action";
|
|
|
|
return "forward:/group/" + action;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 初始化首页新品列表
|
|
|
|
* 初始化首页新品列表
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private void initNewProductList(Model model) {
|
|
|
|
private void initNewProductList(ModelAndView mav) {
|
|
|
|
Pagination page = spellbuyrecordService.indexNewProductList(0, PAGE_SIZE_SMALL);
|
|
|
|
Pagination page = spellbuyrecordService.indexNewProductList(0, PAGE_SIZE_SMALL);
|
|
|
|
List<ProductSpellbuyproductDTO> newList = (List<ProductSpellbuyproductDTO>) page.getList();
|
|
|
|
List<ProductSpellbuyproductDTO> newList = (List<ProductSpellbuyproductDTO>) page.getList();
|
|
|
|
List<ProductJSON> newProductList = new ArrayList<>();
|
|
|
|
List<ProductJSON> newProductList = new ArrayList<>();
|
|
|
|
@ -354,18 +363,18 @@ public class IndexController {
|
|
|
|
newProductList.add(productJSON);
|
|
|
|
newProductList.add(productJSON);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
model.addAttribute("newProductList", newProductList);
|
|
|
|
mav.addObject("newProductList", newProductList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 初始化最新揭晓列表
|
|
|
|
* 初始化最新揭晓列表
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private void initLatestLotteryList(Model model) {
|
|
|
|
private void initLatestLotteryList(ModelAndView mav) {
|
|
|
|
List<Latestlottery> objList = latestlotteryService.indexWinningScroll();
|
|
|
|
List<Latestlottery> objList = latestlotteryService.indexWinningScroll();
|
|
|
|
List<Latestlottery> latestlotteryList = new ArrayList<>();
|
|
|
|
List<Latestlottery> latestlotteryList = new ArrayList<>();
|
|
|
|
for (Latestlottery lottery : objList) {
|
|
|
|
for (Latestlottery lottery : objList) {
|
|
|
|
Latestlottery item = new Latestlottery();
|
|
|
|
Latestlottery item = new Latestlottery();
|
|
|
|
// 拷贝属性(实际项目建议用BeanUtils)
|
|
|
|
// 拷贝属性
|
|
|
|
item.setId(lottery.getId());
|
|
|
|
item.setId(lottery.getId());
|
|
|
|
item.setSpellbuyProductId(lottery.getSpellbuyProductId());
|
|
|
|
item.setSpellbuyProductId(lottery.getSpellbuyProductId());
|
|
|
|
item.setBuyUser(lottery.getBuyUser());
|
|
|
|
item.setBuyUser(lottery.getBuyUser());
|
|
|
|
@ -379,46 +388,45 @@ public class IndexController {
|
|
|
|
item.setBuyUser(userName);
|
|
|
|
item.setBuyUser(userName);
|
|
|
|
latestlotteryList.add(item);
|
|
|
|
latestlotteryList.add(item);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
model.addAttribute("latestlotteryList", latestlotteryList);
|
|
|
|
mav.addObject("latestlotteryList", latestlotteryList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 初始化每日推荐商品
|
|
|
|
* 初始化每日推荐商品
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private void initRecommendProduct(Model model) {
|
|
|
|
private void initRecommendProduct(ModelAndView mav) {
|
|
|
|
List<Object[]> objectList = recommendService.getRecommend();
|
|
|
|
List<Object[]> objectList = recommendService.getRecommend();
|
|
|
|
ProductJSON recommendJSON = null;
|
|
|
|
ProductJSON recommendJSON = null;
|
|
|
|
if (objectList != null && !objectList.isEmpty()) {
|
|
|
|
if (objectList != null && !objectList.isEmpty()) {
|
|
|
|
// 推荐服务返回的是Object[],不是DTO
|
|
|
|
|
|
|
|
Product product = (Product) objectList.get(0)[0];
|
|
|
|
Product product = (Product) objectList.get(0)[0];
|
|
|
|
Spellbuyproduct spellbuyproduct = (Spellbuyproduct) objectList.get(0)[1];
|
|
|
|
Spellbuyproduct spellbuyproduct = (Spellbuyproduct) objectList.get(0)[1];
|
|
|
|
recommendJSON = convertToProductJSON(product, spellbuyproduct, false);
|
|
|
|
recommendJSON = convertToProductJSON(product, spellbuyproduct, false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
model.addAttribute("recommendJSON", recommendJSON);
|
|
|
|
mav.addObject("recommendJSON", recommendJSON);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 初始化新闻列表(缓存)
|
|
|
|
* 初始化新闻列表(缓存)
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private void initNewsList(Model model) {
|
|
|
|
private void initNewsList(ModelAndView mav) {
|
|
|
|
if (newsList == null) {
|
|
|
|
if (newsList == null) {
|
|
|
|
newsList = newsService.indexNews(10, 3);
|
|
|
|
newsList = newsService.indexNews(10, 3);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
model.addAttribute("newsList", newsList);
|
|
|
|
mav.addObject("newsList", newsList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 初始化首页图片列表
|
|
|
|
* 初始化首页图片列表
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private void initIndexImgList(Model model) {
|
|
|
|
private void initIndexImgList(ModelAndView mav) {
|
|
|
|
List<IndexImg> indexImgList = JSONArray.fromObject(ApplicationListenerImpl.indexImgAll);
|
|
|
|
List<IndexImg> indexImgList = JSONArray.fromObject(ApplicationListenerImpl.indexImgAll);
|
|
|
|
model.addAttribute("indexImgList", indexImgList);
|
|
|
|
mav.addObject("indexImgList", indexImgList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 初始化即将揭晓商品
|
|
|
|
* 初始化即将揭晓商品
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private void initUpcomingProducts(Model model) {
|
|
|
|
private void initUpcomingProducts(ModelAndView mav) {
|
|
|
|
Pagination page = spellbuyproductService.upcomingAnnounced(0, PAGE_SIZE_MEDIUM);
|
|
|
|
Pagination page = spellbuyproductService.upcomingAnnounced(0, PAGE_SIZE_MEDIUM);
|
|
|
|
List<ProductSpellbuyproductDTO> upcomingList = (List<ProductSpellbuyproductDTO>) page.getList();
|
|
|
|
List<ProductSpellbuyproductDTO> upcomingList = (List<ProductSpellbuyproductDTO>) page.getList();
|
|
|
|
List<ProductJSON> productList = new ArrayList<>();
|
|
|
|
List<ProductJSON> productList = new ArrayList<>();
|
|
|
|
@ -428,7 +436,7 @@ public class IndexController {
|
|
|
|
productList.add(productJSON);
|
|
|
|
productList.add(productJSON);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
model.addAttribute("productList", productList);
|
|
|
|
mav.addObject("productList", productList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
@ -455,12 +463,12 @@ public class IndexController {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 转换为"正在拍购"商品列表
|
|
|
|
* 转换为"正在拍购"商品列表
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private List<ProductJSON> convertToNowBuyProductList(List<ProductSpellbuyproductDTO> dtoList) {
|
|
|
|
private List<ProductJSON> convertToNowBuyProductUserList(List<SpellbuyrecordDTO> dtoList) {
|
|
|
|
List<ProductJSON> result = new ArrayList<>();
|
|
|
|
List<ProductJSON> result = new ArrayList<>();
|
|
|
|
if (dtoList == null) {
|
|
|
|
if (dtoList == null) {
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (ProductSpellbuyproductDTO dto : dtoList) {
|
|
|
|
for (SpellbuyrecordDTO dto : dtoList) {
|
|
|
|
ProductJSON json = new ProductJSON();
|
|
|
|
ProductJSON json = new ProductJSON();
|
|
|
|
json.setBuyer(UserNameUtil.userName(dto.getUser()));
|
|
|
|
json.setBuyer(UserNameUtil.userName(dto.getUser()));
|
|
|
|
json.setUserId(String.valueOf(dto.getUser().getUserId()));
|
|
|
|
json.setUserId(String.valueOf(dto.getUser().getUserId()));
|
|
|
|
@ -476,12 +484,12 @@ public class IndexController {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 转换为最新拍购记录商品列表
|
|
|
|
* 转换为最新拍购记录商品列表
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private List<ProductJSON> convertToNewRecordProductList(List<ProductSpellbuyproductDTO> dtoList) {
|
|
|
|
private List<ProductJSON> convertToNewRecordProductList(List<SpellbuyrecordDTO> dtoList) {
|
|
|
|
List<ProductJSON> result = new ArrayList<>();
|
|
|
|
List<ProductJSON> result = new ArrayList<>();
|
|
|
|
if (dtoList == null) {
|
|
|
|
if (dtoList == null) {
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (ProductSpellbuyproductDTO dto : dtoList) {
|
|
|
|
for (SpellbuyrecordDTO dto : dtoList) {
|
|
|
|
ProductJSON json = new ProductJSON();
|
|
|
|
ProductJSON json = new ProductJSON();
|
|
|
|
json.setBuyer(UserNameUtil.userName(dto.getUser()));
|
|
|
|
json.setBuyer(UserNameUtil.userName(dto.getUser()));
|
|
|
|
json.setUserId(String.valueOf(dto.getUser().getUserId()));
|
|
|
|
json.setUserId(String.valueOf(dto.getUser().getUserId()));
|
|
|
|
@ -492,13 +500,10 @@ public class IndexController {
|
|
|
|
json.setProductName(productName.length() > 35 ? productName.substring(0, 35) + "..." : productName);
|
|
|
|
json.setProductName(productName.length() > 35 ? productName.substring(0, 35) + "..." : productName);
|
|
|
|
|
|
|
|
|
|
|
|
json.setProductPeriod(dto.getSpellbuyproduct().getProductPeriod());
|
|
|
|
json.setProductPeriod(dto.getSpellbuyproduct().getProductPeriod());
|
|
|
|
// json.setBuyCount(dto.getSpellbuyrecord().getBuyPrice());
|
|
|
|
json.setBuyCount(dto.getSpellbuyrecord().getBuyPrice());
|
|
|
|
json.setBuyCount(1);
|
|
|
|
|
|
|
|
json.setProductTitle(dto.getProduct().getProductTitle());
|
|
|
|
json.setProductTitle(dto.getProduct().getProductTitle());
|
|
|
|
// json.setBuyDate(dto.getSpellbuyrecord().getBuyDate());
|
|
|
|
json.setBuyDate(dto.getSpellbuyrecord().getBuyDate());
|
|
|
|
json.setBuyDate(String.valueOf(new Date()));
|
|
|
|
json.setProductStyle(String.valueOf(dto.getSpellbuyrecord().getSpellbuyRecordId()));
|
|
|
|
// json.setProductStyle(String.valueOf(dto.getSpellbuyrecord().getSpellbuyRecordId()));
|
|
|
|
|
|
|
|
json.setProductStyle(String.valueOf(1));
|
|
|
|
|
|
|
|
result.add(json);
|
|
|
|
result.add(json);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
@ -507,18 +512,16 @@ public class IndexController {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 转换为购买历史列表
|
|
|
|
* 转换为购买历史列表
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private List<BuyHistoryJSON> convertToBuyHistoryList(List<ProductSpellbuyproductDTO> dtoList) {
|
|
|
|
private List<BuyHistoryJSON> convertToBuyHistoryList(List<SpellbuyrecordDTO> dtoList) {
|
|
|
|
List<BuyHistoryJSON> result = new ArrayList<>();
|
|
|
|
List<BuyHistoryJSON> result = new ArrayList<>();
|
|
|
|
if (dtoList == null) {
|
|
|
|
if (dtoList == null) {
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (ProductSpellbuyproductDTO dto : dtoList) {
|
|
|
|
for (SpellbuyrecordDTO dto : dtoList) {
|
|
|
|
BuyHistoryJSON json = new BuyHistoryJSON();
|
|
|
|
BuyHistoryJSON json = new BuyHistoryJSON();
|
|
|
|
// json.setBuyCount(Long.parseLong(String.valueOf(dto.getSpellbuyrecord().getBuyPrice())));
|
|
|
|
json.setBuyCount(Long.parseLong(String.valueOf(dto.getSpellbuyrecord().getBuyPrice())));
|
|
|
|
json.setBuyCount(Long.parseLong(String.valueOf(1)));
|
|
|
|
|
|
|
|
json.setBuyStatus(dto.getSpellbuyproduct().getSpStatus());
|
|
|
|
json.setBuyStatus(dto.getSpellbuyproduct().getSpStatus());
|
|
|
|
// json.setHistoryId(dto.getSpellbuyrecord().getSpellbuyRecordId());
|
|
|
|
json.setHistoryId(dto.getSpellbuyrecord().getSpellbuyRecordId());
|
|
|
|
json.setHistoryId(1);
|
|
|
|
|
|
|
|
json.setProductId(dto.getSpellbuyproduct().getSpellbuyProductId());
|
|
|
|
json.setProductId(dto.getSpellbuyproduct().getSpellbuyProductId());
|
|
|
|
json.setProductImg(dto.getProduct().getHeadImage());
|
|
|
|
json.setProductImg(dto.getProduct().getHeadImage());
|
|
|
|
json.setProductName(dto.getProduct().getProductName());
|
|
|
|
json.setProductName(dto.getProduct().getProductName());
|
|
|
|
|