Commit 1cdb7159 by songyinghui

feat: 商品查询

parent e80e86b2
......@@ -11,9 +11,8 @@ import com.gic.haoban.manage.service.pojo.bo.content.InteractRecordBO;
import com.gic.haoban.manage.service.pojo.bo.content.InteractRecordExtendInfoBO;
import com.gic.haoban.manage.service.pojo.bo.content.PotentialCustomerBO;
import com.gic.haoban.manage.service.pojo.bo.content.context.InteractRecordMessageContext;
import com.gic.store.goods.dto.goods.GoodsSpuInfoDTO;
import com.gic.store.goods.dto.qdto.GoodsListQDTO;
import com.gic.store.goods.enums.GoodsStatusEnum;
import com.gic.store.goods.dto.goods.mall.MallGoodsInfoDTO;
import com.gic.store.goods.dto.qdto.mall.MallGoodsListQDTO;
import com.gic.store.goods.service.GoodsCenterApiService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
......@@ -118,12 +117,12 @@ public class InteractRecordBuilder {
if (CollectionUtils.isEmpty(visitGoodsIds)) {
return Collections.emptyList();
}
GoodsListQDTO goodsListQDTO = new GoodsListQDTO();
MallGoodsListQDTO goodsListQDTO = new MallGoodsListQDTO();
goodsListQDTO.setEnterpriseId(enterpriseId);
goodsListQDTO.setIncludeGoodsIds(visitGoodsIds);
goodsListQDTO.setExcludeStatus(Arrays.asList(GoodsStatusEnum.DELETED.getCode(), GoodsStatusEnum.BACK.getCode()));
goodsListQDTO.setPageSize(visitGoodsIds.size() + 1);
ServiceResponse<Page<GoodsSpuInfoDTO>> serviceResponse = goodsCenterApiService.queryStoreGoodsList(goodsListQDTO);
// 0删除 1仓库 2上架 3回收站
ServiceResponse<Page<MallGoodsInfoDTO>> serviceResponse = goodsCenterApiService.queryMallGoodsList(goodsListQDTO);
if (!serviceResponse.isSuccess()) {
log.info("查询商品异常 {}", JSON.toJSONString(serviceResponse));
return Collections.emptyList();
......@@ -132,9 +131,11 @@ public class InteractRecordBuilder {
log.info("查询商品为空 {}", JSON.toJSONString(serviceResponse));
return Collections.emptyList();
}
List<Integer> excludeStatus = Arrays.asList(0, 3);
return serviceResponse.getResult()
.getResult()
.stream()
.filter(item -> !excludeStatus.contains(item.getStatus()))
.map(item -> {
InteractRecordExtendInfoBO.ExtendGoodsInfo extendGoodsInfo = new InteractRecordExtendInfoBO.ExtendGoodsInfo();
extendGoodsInfo.setGoodsName(item.getGoodsName());
......
......@@ -48,7 +48,7 @@ public class InteractRecordTest {
String eid = "ff8080815dacd3a2015dacd3ef5c0000";
String wxEid = "ca66a01b79474c40b3e7c7f93daf1a3b";
String staffId = "e608b51b267e4943b87e222a343b4f25";
String clerkId = "fbc508e395f846ef9005852c420e1c4f";
String clerkId = "bcbfff6c8e2e40aaac795a99d0dde2aa";
String memberId = "ff8080818147efc8018148d1759903c8";
@Test
......
......@@ -12,6 +12,7 @@ import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.date.Week;
import cn.hutool.crypto.digest.MD5;
import com.alibaba.fastjson.JSONObject;
import com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum;
import com.gic.haoban.manage.api.enums.content.MaterialReportType;
......@@ -76,16 +77,8 @@ public class test {
@Test
public void timeTest(){
DateTime now = DateUtil.parse("2023-04-09 08:00:00", "yyyy-MM-dd HH:mm:ss");
int hour_sec = 30 * 60;
DateTime temp = cn.hutool.core.date.DateUtil.offsetSecond(now, -(hour_sec));
int hour = DateUtil.hour(temp, true);
System.out.println(hour);
Week week = DateUtil.dayOfWeekEnum(new Date());
System.out.println(week);
if (Week.MONDAY.equals(week)) {
System.out.println("周一");
}
String key = "czMYwiF1VNyNBn2dOS0Aie2vL8yo0W1F" + "bcbfff6c8e2e40aaac795a99d0dde2aa" + "521005558220738651" + "ff8080818147efc8018148d1759903c8";
System.out.println(MD5.create().digestHex(key));
}
}
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