|
|
@ -1,5 +1,7 @@
|
|
|
|
package com.bookstore.bookmall.ware.service.impl;
|
|
|
|
package com.bookstore.bookmall.ware.service.impl;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.bookstore.bookmall.ware.entity.WareSkuEntity;
|
|
|
|
|
|
|
|
import com.mysql.cj.util.StringUtils;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
@ -18,9 +20,34 @@ public class PurchaseDetailServiceImpl extends ServiceImpl<PurchaseDetailDao, Pu
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public PageUtils queryPage(Map<String, Object> params) {
|
|
|
|
public PageUtils queryPage(Map<String, Object> params) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// key: "华为" //检索关键字
|
|
|
|
|
|
|
|
// status: 1,
|
|
|
|
|
|
|
|
// wareId: 2,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QueryWrapper<PurchaseDetailEntity> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String key = (String)params.get("key");
|
|
|
|
|
|
|
|
if (!StringUtils.isNullOrEmpty(key)) {
|
|
|
|
|
|
|
|
queryWrapper.and((w)->{
|
|
|
|
|
|
|
|
w.eq("purchase_id", key).or().eq("sku_id",key);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String status = (String)params.get("status");
|
|
|
|
|
|
|
|
if (!StringUtils.isNullOrEmpty(status)) {
|
|
|
|
|
|
|
|
queryWrapper.eq("status", status);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String wareId = (String)params.get("wareId");
|
|
|
|
|
|
|
|
if (!StringUtils.isNullOrEmpty(wareId)) {
|
|
|
|
|
|
|
|
queryWrapper.eq("ware_id", wareId);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
IPage<PurchaseDetailEntity> page = this.page(
|
|
|
|
IPage<PurchaseDetailEntity> page = this.page(
|
|
|
|
new Query<PurchaseDetailEntity>().getPage(params),
|
|
|
|
new Query<PurchaseDetailEntity>().getPage(params),
|
|
|
|
new QueryWrapper<PurchaseDetailEntity>()
|
|
|
|
queryWrapper
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
return new PageUtils(page);
|
|
|
|
return new PageUtils(page);
|
|
|
|