Compare commits
2 Commits
06fba793ba
...
1d3e0fba6f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1d3e0fba6f | ||
|
|
444d1af15a |
@@ -29,9 +29,6 @@ public class WxXcxUtils {
|
||||
String result = HttpRequest.post(url).body(json.toString()).execute().body();
|
||||
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
/*JSONObject phoneInfo = jsonObject.getJSONObject("phone_info");
|
||||
System.out.println(phoneInfo+"==================================");
|
||||
String phoneNumber = phoneInfo.get("phoneNumber").toString();*/
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ public class TzProd extends TenantEntity {
|
||||
/**
|
||||
* 商品分类
|
||||
*/
|
||||
private Long categoryId;
|
||||
private String categoryId;
|
||||
|
||||
/**
|
||||
* 商品参数json
|
||||
|
||||
@@ -130,7 +130,7 @@ public class TzProdBo extends TenantEntity {
|
||||
/**
|
||||
* 商品分类
|
||||
*/
|
||||
private Long categoryId;
|
||||
private String categoryId;
|
||||
|
||||
/**
|
||||
* 商品参数json
|
||||
|
||||
@@ -145,7 +145,7 @@ public class TzProdVo implements Serializable {
|
||||
* 商品分类
|
||||
*/
|
||||
@ExcelProperty(value = "商品分类")
|
||||
private Long categoryId;
|
||||
private String categoryId;
|
||||
|
||||
/**
|
||||
* 商品参数json
|
||||
|
||||
@@ -105,7 +105,18 @@ public class TzProdServiceImpl extends MPJBaseServiceImpl<TzProdMapper,TzProd> i
|
||||
*/
|
||||
@Override
|
||||
public IPage<TzProdVo> pageByCategoryId(PageQuery pageQuery, List<Long> categoryId) {
|
||||
LambdaQueryWrapper<TzProd> lqw = new LambdaQueryWrapper<TzProd>().eq(TzProd::getStatus,1).in(categoryId != null,TzProd::getCategoryId,categoryId);
|
||||
// 构造查询条件
|
||||
LambdaQueryWrapper<TzProd> lqw = new LambdaQueryWrapper<TzProd>()
|
||||
.eq(TzProd::getStatus, 1)
|
||||
.and(wrapper -> {
|
||||
for (Long id : categoryId) {
|
||||
// 生成 FIND_IN_SET(id,category_id) 的SQL条件
|
||||
wrapper.or().apply("FIND_IN_SET({0}, category_id)", id);
|
||||
}
|
||||
})
|
||||
.orderByDesc(TzProd::getPutawayTime);
|
||||
|
||||
// 执行分页查询
|
||||
return baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
}
|
||||
|
||||
@@ -171,7 +182,10 @@ public class TzProdServiceImpl extends MPJBaseServiceImpl<TzProdMapper,TzProd> i
|
||||
lqw.like(StringUtils.isNotBlank(bo.getFactoryAddress()), TzProd::getFactoryAddress, bo.getFactoryAddress());
|
||||
lqw.eq(bo.getStatus() != null, TzProd::getStatus, bo.getStatus());
|
||||
lqw.eq(bo.getExamineFlag() != null, TzProd::getExamineFlag, bo.getExamineFlag());
|
||||
lqw.eq(bo.getCategoryId() != null, TzProd::getCategoryId, bo.getCategoryId());
|
||||
// lqw.like(bo.getCategoryId() != null, TzProd::getCategoryId, bo.getCategoryId());
|
||||
if(bo.getCategoryId() != null){
|
||||
lqw.or().apply("FIND_IN_SET({0}, t.category_id)", bo.getCategoryId());
|
||||
}
|
||||
lqw.between(params.get("beginTime") != null && params.get("endTime") != null,
|
||||
TzProd::getPutawayTime, params.get("beginTime"), params.get("endTime"));
|
||||
return lqw;
|
||||
|
||||
Reference in New Issue
Block a user