库存管理的采购需求和采购单新增、修改、删除功能

develop
ddyd 1 week ago
parent a6aa6cae25
commit 3afa86cf41

@ -5,11 +5,7 @@ import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.bookstore.bookmall.ware.entity.PurchaseEntity;
import com.bookstore.bookmall.ware.service.PurchaseService;
@ -31,6 +27,26 @@ public class PurchaseController {
@Autowired
private PurchaseService purchaseService;
//合并采购需求
// /ware/purchase/merge
@PostMapping("/ware/purchase/merge")
//@RequiresPermissions("ware:purchase:list")
public R unreceivelist(@RequestParam Map<String, Object> params){
PageUtils page = purchaseService.queryPageUnreceivePurchase(params);
return R.ok().put("page", page);
}
//查询采购单
// /unreceive/list
@RequestMapping("/unreceive/list")
//@RequiresPermissions("ware:purchase:list")
public R unreceivelist(@RequestParam Map<String, Object> params){
PageUtils page = purchaseService.queryPageUnreceivePurchase(params);
return R.ok().put("page", page);
}
/**
*
*/

@ -16,5 +16,7 @@ import java.util.Map;
public interface PurchaseService extends IService<PurchaseEntity> {
PageUtils queryPage(Map<String, Object> params);
PageUtils queryPageUnreceivePurchase(Map<String, Object> params);
}

@ -1,5 +1,7 @@
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 java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -18,9 +20,34 @@ public class PurchaseDetailServiceImpl extends ServiceImpl<PurchaseDetailDao, Pu
@Override
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(
new Query<PurchaseDetailEntity>().getPage(params),
new QueryWrapper<PurchaseDetailEntity>()
queryWrapper
);
return new PageUtils(page);

@ -16,8 +16,12 @@ import com.bookstore.bookmall.ware.service.PurchaseService;
@Service("purchaseService")
public class PurchaseServiceImpl extends ServiceImpl<PurchaseDao, PurchaseEntity> implements PurchaseService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
IPage<PurchaseEntity> page = this.page(
new Query<PurchaseEntity>().getPage(params),
new QueryWrapper<PurchaseEntity>()
@ -26,4 +30,17 @@ public class PurchaseServiceImpl extends ServiceImpl<PurchaseDao, PurchaseEntity
return new PageUtils(page);
}
@Override
public PageUtils queryPageUnreceivePurchase(Map<String, Object> params) {
IPage<PurchaseEntity> page = this.page(
new Query<PurchaseEntity>().getPage(params),
new QueryWrapper<PurchaseEntity>().eq("status", 0)
.or().eq("status", 1)
);
return new PageUtils(page);
}
}

@ -1,5 +1,6 @@
package com.bookstore.bookmall.ware.service.impl;
import com.mysql.cj.util.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -18,9 +19,21 @@ public class WareInfoServiceImpl extends ServiceImpl<WareInfoDao, WareInfoEntity
@Override
public PageUtils queryPage(Map<String, Object> params) {
QueryWrapper<WareInfoEntity> wrapper = new QueryWrapper<>();
String key = (String) params.get("key");
if (!StringUtils.isNullOrEmpty(key)) {
wrapper.eq("id", key)
.or().like("name", key)
.or().like("address", key)
.or().eq("areacode",key);
};
IPage<WareInfoEntity> page = this.page(
new Query<WareInfoEntity>().getPage(params),
new QueryWrapper<WareInfoEntity>()
wrapper
);
return new PageUtils(page);

@ -1,5 +1,6 @@
package com.bookstore.bookmall.ware.service.impl;
import com.mysql.cj.util.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -18,9 +19,25 @@ public class WareSkuServiceImpl extends ServiceImpl<WareSkuDao, WareSkuEntity> i
@Override
public PageUtils queryPage(Map<String, Object> params) {
/*
skuId: ,//商品id
wareId: ,//仓库id
* */
QueryWrapper<WareSkuEntity> wareSkuEntityQueryWrapper = new QueryWrapper<>();
String skuId = (String)params.get("skuId");
if (!StringUtils.isNullOrEmpty(skuId)) {
wareSkuEntityQueryWrapper.eq("sku_id", skuId);
}
String wareId = (String)params.get("wareId");
if (!StringUtils.isNullOrEmpty(wareId)) {
wareSkuEntityQueryWrapper.eq("ware_id", wareId);
}
IPage<WareSkuEntity> page = this.page(
new Query<WareSkuEntity>().getPage(params),
new QueryWrapper<WareSkuEntity>()
wareSkuEntityQueryWrapper
);
return new PageUtils(page);

@ -0,0 +1,5 @@
package com.bookstore.bookmall.ware.vo;
public class MergeVo {
}

@ -18,4 +18,8 @@ mybatis-plus:
id-type: auto #主键自增
server:
port: 11000
port: 11000
logging:
level:
com.bookstore: debug
Loading…
Cancel
Save