记得上下班打卡 | git大法好,push需谨慎

Commit a2a16461 authored by 胡佳晨's avatar 胡佳晨

修改bug

parent e5363362
package com.liquidnet.service.goblin.service.manage; package com.liquidnet.service.goblin.service.manage;
import com.github.pagehelper.PageInfo;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.manage.GoblinStorePurchaseCommonParam; import com.liquidnet.service.goblin.dto.manage.GoblinStorePurchaseCommonParam;
import com.liquidnet.service.goblin.dto.manage.GoblinStoreZhengzaiCommonParam; import com.liquidnet.service.goblin.dto.manage.GoblinStoreZhengzaiCommonParam;
...@@ -23,7 +24,7 @@ public interface IGoblinZhengzaiService { ...@@ -23,7 +24,7 @@ public interface IGoblinZhengzaiService {
* @param page 页数 * @param page 页数
* @return * @return
*/ */
ResponseDto<List<GoblinMarketSpuListVo>> zhengzaiSpuList(String marketId, String storeId, int page); ResponseDto<PageInfo<GoblinMarketSpuListVo>> zhengzaiSpuList(String marketId, String storeId, int page);
/** /**
* 获取活动内sku列表 * 获取活动内sku列表
......
package com.liquidnet.service.goblin.controller.Inner; package com.liquidnet.service.goblin.controller.Inner;
import com.github.pagehelper.PageInfo;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.manage.GoblinStoreZhengzaiCommonParam; import com.liquidnet.service.goblin.dto.manage.GoblinStoreZhengzaiCommonParam;
import com.liquidnet.service.goblin.dto.vo.*; import com.liquidnet.service.goblin.dto.vo.*;
...@@ -50,9 +51,9 @@ public class GoblinInnerZhengzaiController { ...@@ -50,9 +51,9 @@ public class GoblinInnerZhengzaiController {
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "selfMarketId", value = "官方活动id", example = "1"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "selfMarketId", value = "官方活动id", example = "1"),
@ApiImplicitParam(type = "form", required = true, dataType = "Integer", name = "page", value = "页数", example = "1") @ApiImplicitParam(type = "form", required = true, dataType = "Integer", name = "page", value = "页数", example = "1")
}) })
public ResponseDto<List<GoblinMarketSpuListVo>> zhengzaiStoreConfigSpuList(@RequestParam("storeId") @Valid String storeId, public ResponseDto<PageInfo<GoblinMarketSpuListVo>> zhengzaiStoreConfigSpuList(@RequestParam("storeId") @Valid String storeId,
@RequestParam("selfMarketId") @Valid String selfMarketId, @RequestParam("selfMarketId") @Valid String selfMarketId,
@RequestParam("page") @Valid int page) { @RequestParam("page") @Valid int page) {
return goblinZhengzaiService.zhengzaiSpuList(selfMarketId, storeId, page); return goblinZhengzaiService.zhengzaiSpuList(selfMarketId, storeId, page);
} }
......
package com.liquidnet.service.goblin.controller.manage; package com.liquidnet.service.goblin.controller.manage;
import com.github.pagehelper.PageInfo;
import com.github.xiaoymin.knife4j.annotations.ApiSupport; import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.manage.GoblinStoreZhengzaiCommonParam; import com.liquidnet.service.goblin.dto.manage.GoblinStoreZhengzaiCommonParam;
...@@ -58,9 +59,9 @@ public class GoblinZhengzaiController { ...@@ -58,9 +59,9 @@ public class GoblinZhengzaiController {
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "selfMarketId", value = "官方活动id", example = "1"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "selfMarketId", value = "官方活动id", example = "1"),
@ApiImplicitParam(type = "form", required = true, dataType = "Integer", name = "page", value = "页数", example = "1") @ApiImplicitParam(type = "form", required = true, dataType = "Integer", name = "page", value = "页数", example = "1")
}) })
public ResponseDto<List<GoblinMarketSpuListVo>> zhengzaiStoreConfigSpuList(@RequestParam("storeId") @Valid String storeId, public ResponseDto<PageInfo<GoblinMarketSpuListVo>> zhengzaiStoreConfigSpuList(@RequestParam("storeId") @Valid String storeId,
@RequestParam("selfMarketId") @Valid String selfMarketId, @RequestParam("selfMarketId") @Valid String selfMarketId,
@RequestParam("page") @Valid int page) { @RequestParam("page") @Valid int page) {
return goblinZhengzaiService.zhengzaiSpuList(selfMarketId, storeId, page); return goblinZhengzaiService.zhengzaiSpuList(selfMarketId, storeId, page);
} }
......
package com.liquidnet.service.goblin.service.impl.manage; package com.liquidnet.service.goblin.service.impl.manage;
import com.github.pagehelper.PageInfo;
import com.liquidnet.commons.lang.util.CollectionUtil; import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.DateUtil; import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.commons.lang.util.IDGenerator; import com.liquidnet.commons.lang.util.IDGenerator;
...@@ -75,22 +76,16 @@ public class GoblinZhengzaiServiceImpl implements IGoblinZhengzaiService { ...@@ -75,22 +76,16 @@ public class GoblinZhengzaiServiceImpl implements IGoblinZhengzaiService {
} }
@Override @Override
public ResponseDto<List<GoblinMarketSpuListVo>> zhengzaiSpuList(String marketId, String storeId, int page) { public ResponseDto<PageInfo<GoblinMarketSpuListVo>> zhengzaiSpuList(String marketId, String storeId, int page) {
int size = 20; int size = 20;
List<GoblinStoreMarketIsConfigVo> spuIds = redisUtils.getStoreMarketIsConfig(marketId, storeId); List<GoblinStoreMarketIsConfigVo> spuIds = redisUtils.getStoreMarketIsConfig(marketId, storeId);
List<String> marketSpuList = spuIds.stream().map(GoblinStoreMarketIsConfigVo::getMarketSpuId).collect(Collectors.toList());
List<GoblinMarketSpuListVo> voList = ObjectUtil.getGoblinMarketSpuListVoArrayList(); List<GoblinMarketSpuListVo> voList = ObjectUtil.getGoblinMarketSpuListVoArrayList();
int count = page * size;
int startCount = (page - 1) * size; int startCount = (page - 1) * size;
if (count >= marketSpuList.size()) { List<GoblinGoodsInfoVo> list = mongoUtils.marketSpuList(marketId, storeId, startCount, size);
count = marketSpuList.size(); for (GoblinGoodsInfoVo spuVo : list) {
}
for (int i = startCount; i < count; i++) {
GoblinMarketSpuListVo vo = GoblinMarketSpuListVo.getNew(); GoblinMarketSpuListVo vo = GoblinMarketSpuListVo.getNew();
String marketSpuId = marketSpuList.get(i);
GoblinGoodsInfoVo spuVo = redisUtils.getGoodsInfoVo(marketSpuId);
if (null != spuVo && spuVo.getDelFlg().equals("0") && spuVo.getShelvesStatus().equals("3")) { if (null != spuVo && spuVo.getDelFlg().equals("0") && spuVo.getShelvesStatus().equals("3")) {
vo.setMarketSpuId(marketSpuId.split(GoblinStatusConst.MarketPreStatus.MARKET_PRE_ZHENGZAI.getValue())[0]); vo.setMarketSpuId(spuVo.getSpuId().split(GoblinStatusConst.MarketPreStatus.MARKET_PRE_ZHENGZAI.getValue())[0]);
vo.setCoverPic(spuVo.getCoverPic()); vo.setCoverPic(spuVo.getCoverPic());
vo.setName(spuVo.getName()); vo.setName(spuVo.getName());
vo.setPriceGe(spuVo.getPriceGe()); vo.setPriceGe(spuVo.getPriceGe());
...@@ -98,7 +93,9 @@ public class GoblinZhengzaiServiceImpl implements IGoblinZhengzaiService { ...@@ -98,7 +93,9 @@ public class GoblinZhengzaiServiceImpl implements IGoblinZhengzaiService {
voList.add(vo); voList.add(vo);
} }
} }
return ResponseDto.success(voList); PageInfo pageInfo = new PageInfo(voList);
pageInfo.setTotal(spuIds.size());
return ResponseDto.success(pageInfo);
} }
@Override @Override
......
...@@ -793,6 +793,12 @@ public class GoblinMongoUtils { ...@@ -793,6 +793,12 @@ public class GoblinMongoUtils {
return mongoTemplate.findOne(Query.query(Criteria.where("backCode").is(backCode)), GoblinBackOrderVo.class, GoblinBackOrderVo.class.getSimpleName()); return mongoTemplate.findOne(Query.query(Criteria.where("backCode").is(backCode)), GoblinBackOrderVo.class, GoblinBackOrderVo.class.getSimpleName());
} }
//获取 正在下单活动内容列表
public List<GoblinGoodsInfoVo> marketSpuList(String marketId, String storeId, int start, int skip) {
List<GoblinGoodsInfoVo> list = mongoTemplate.find(Query.query(Criteria.where("storeId").is(storeId).and("marketId").is("ZZ" + marketId).and("delFlg").is("0").and("shelvesStatus").is("3")).with(Sort.by(Sort.Order.desc("createdAt"))).skip(start).limit(skip), GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName());
return list;
}
//店铺总收入 //店铺总收入
public String storeMoney(String storeId, String spuId) { public String storeMoney(String storeId, String spuId) {
String spuName = "店铺总收入"; String spuName = "店铺总收入";
...@@ -904,16 +910,7 @@ public class GoblinMongoUtils { ...@@ -904,16 +910,7 @@ public class GoblinMongoUtils {
//查询销量 //查询销量
int size = 20; int size = 20;
int skipCount = ((page - 1) * size); int skipCount = ((page - 1) * size);
Criteria criteria = Criteria.where("status").in( Criteria criteria = Criteria.where("spuId").is(spuId);
GoblinStatusConst.Status.ORDER_LOG_STATUS_11.getValue(), GoblinStatusConst.Status.ORDER_LOG_STATUS_12.getValue(),
GoblinStatusConst.Status.ORDER_LOG_STATUS_13.getValue(), GoblinStatusConst.Status.ORDER_LOG_STATUS_14.getValue(),
GoblinStatusConst.Status.ORDER_LOG_STATUS_15.getValue(), GoblinStatusConst.Status.ORDER_LOG_STATUS_16.getValue(),
GoblinStatusConst.Status.ORDER_LOG_STATUS_21.getValue(), GoblinStatusConst.Status.ORDER_LOG_STATUS_22.getValue(),
GoblinStatusConst.Status.ORDER_LOG_STATUS_23.getValue(), GoblinStatusConst.Status.ORDER_LOG_STATUS_24.getValue(),
GoblinStatusConst.Status.ORDER_LOG_STATUS_25.getValue(), GoblinStatusConst.Status.ORDER_LOG_STATUS_26.getValue(),
GoblinStatusConst.Status.ORDER_LOG_STATUS_27.getValue(), GoblinStatusConst.Status.ORDER_LOG_STATUS_28.getValue(),
GoblinStatusConst.Status.ORDER_LOG_STATUS_29.getValue()
).and("spuId").is(spuId);
if (st != null && et != null) { if (st != null && et != null) {
criteria = criteria.and("createdAt").gte(st).lt(et); criteria = criteria.and("createdAt").gte(st).lt(et);
} }
...@@ -923,18 +920,29 @@ public class GoblinMongoUtils { ...@@ -923,18 +920,29 @@ public class GoblinMongoUtils {
if (type != null) { if (type != null) {
switch (type) { switch (type) {
case 1: case 1:
criteria = criteria.and("orderType").is("order").and("status").is(1); criteria = criteria.and("orderType").is("order").and("status").is(11);
break; break;
case 2: case 2:
criteria = criteria.and("orderType").is("order").and("status").in(22, 28); criteria = criteria.and("orderType").is("order").and("status").in(22, 28);
break; break;
case 3: case 3:
criteria = criteria.and("orderType").is("zhengzai").and("status").is(1); criteria = criteria.and("orderType").is("zhengzai").and("status").is(11);
break; break;
case 4: case 4:
criteria = criteria.and("orderType").is("zhengzai").and("status").in(22, 28); criteria = criteria.and("orderType").is("zhengzai").and("status").in(22, 28);
break; break;
} }
}else{
criteria = criteria.and("status").in(
GoblinStatusConst.Status.ORDER_LOG_STATUS_11.getValue(), GoblinStatusConst.Status.ORDER_LOG_STATUS_12.getValue(),
GoblinStatusConst.Status.ORDER_LOG_STATUS_13.getValue(), GoblinStatusConst.Status.ORDER_LOG_STATUS_14.getValue(),
GoblinStatusConst.Status.ORDER_LOG_STATUS_15.getValue(), GoblinStatusConst.Status.ORDER_LOG_STATUS_16.getValue(),
GoblinStatusConst.Status.ORDER_LOG_STATUS_21.getValue(), GoblinStatusConst.Status.ORDER_LOG_STATUS_22.getValue(),
GoblinStatusConst.Status.ORDER_LOG_STATUS_23.getValue(), GoblinStatusConst.Status.ORDER_LOG_STATUS_24.getValue(),
GoblinStatusConst.Status.ORDER_LOG_STATUS_25.getValue(), GoblinStatusConst.Status.ORDER_LOG_STATUS_26.getValue(),
GoblinStatusConst.Status.ORDER_LOG_STATUS_27.getValue(), GoblinStatusConst.Status.ORDER_LOG_STATUS_28.getValue(),
GoblinStatusConst.Status.ORDER_LOG_STATUS_29.getValue()
);
} }
Query query = Query.query(criteria); Query query = Query.query(criteria);
query.skip(skipCount).limit(size); query.skip(skipCount).limit(size);
......
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