优化商品库商品

This commit is contained in:
Richie 2025-05-19 12:24:45 +08:00
parent 21c4f4937b
commit ee20678e47
8 changed files with 29 additions and 19 deletions

View File

@ -4,6 +4,7 @@ package cn.qihangerp.module.goods.domain;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
@ -120,6 +121,7 @@ public class OGoods implements Serializable {
/** /**
* 预计采购价格 * 预计采购价格
*/ */
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#.##")
private BigDecimal purPrice; private BigDecimal purPrice;
/** /**
@ -130,6 +132,7 @@ public class OGoods implements Serializable {
/** /**
* 建议零售价 * 建议零售价
*/ */
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#.##")
private BigDecimal retailPrice; private BigDecimal retailPrice;
/** /**
@ -140,7 +143,7 @@ public class OGoods implements Serializable {
/** /**
* 供应商id * 供应商id
*/ */
private Long supplierId; private String supplierId;
/** /**
* 品牌id * 品牌id

View File

@ -53,12 +53,12 @@ public class OGoodsInventoryBatch implements Serializable {
/** /**
* 规格id * 规格id
*/ */
private String skuId; private Long skuId;
/** /**
* 商品id * 商品id
*/ */
private String goodsId; private Long goodsId;
/** /**
* sku编码 * sku编码

View File

@ -123,7 +123,7 @@ public class OGoodsServiceImpl extends ServiceImpl<OGoodsMapper, OGoods>
goods.setWholePrice(bo.getWholePrice()); goods.setWholePrice(bo.getWholePrice());
goods.setRetailPrice(bo.getRetailPrice()); goods.setRetailPrice(bo.getRetailPrice());
goods.setUnitCost(bo.getUnitCost()); goods.setUnitCost(bo.getUnitCost());
goods.setSupplierId(bo.getSupplierId()); goods.setSupplierId(bo.getSupplierId().toString());
goods.setBrandId(bo.getBrandId()); goods.setBrandId(bo.getBrandId());
goods.setLinkUrl(bo.getLinkUrl()); goods.setLinkUrl(bo.getLinkUrl());
goods.setLowQty(0); goods.setLowQty(0);

View File

@ -39,6 +39,11 @@
<artifactId>commons-lang3</artifactId> <artifactId>commons-lang3</artifactId>
<version>3.12.0</version> <version>3.12.0</version>
</dependency> </dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.16.1</version>
</dependency>
<dependency> <dependency>
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId> <artifactId>lombok</artifactId>

View File

@ -45,7 +45,7 @@ public class WmsStockInItem implements Serializable {
/** /**
* 商品id * 商品id
*/ */
private String goodsId; private Long goodsId;
/** /**
* 商品编码 * 商品编码
@ -65,7 +65,7 @@ public class WmsStockInItem implements Serializable {
/** /**
* 商品规格id * 商品规格id
*/ */
private String skuId; private Long skuId;
/** /**
* 商品规格编码 * 商品规格编码

View File

@ -4,8 +4,8 @@ import lombok.Data;
@Data @Data
public class StockInCreateItem { public class StockInCreateItem {
private String skuId; private Long skuId;
private String goodsId; private Long goodsId;
private Integer quantity; private Integer quantity;
private String skuCode; private String skuCode;
private String goodsName; private String goodsName;

View File

@ -73,7 +73,9 @@ public class WmsStockInServiceImpl extends ServiceImpl<WmsStockInMapper, WmsStoc
request.setStockInOperator(userName); request.setStockInOperator(userName);
} }
Map<String, List<StockInCreateItem>> goodsGroup = request.getItemList().stream().collect(Collectors.groupingBy(x -> x.getGoodsId())); Map<Long, List<StockInCreateItem>> goodsGroup =
request.getItemList().stream().collect
(Collectors.groupingBy(x -> x.getGoodsId()));
Long total = request.getItemList().stream().mapToLong(StockInCreateItem::getQuantity).sum(); Long total = request.getItemList().stream().mapToLong(StockInCreateItem::getQuantity).sum();
//添加主表信息 //添加主表信息
WmsStockIn insert = new WmsStockIn(); WmsStockIn insert = new WmsStockIn();

View File

@ -150,9 +150,9 @@
<el-table-column label="重量" align="center" prop="weight" /> <el-table-column label="重量" align="center" prop="weight" />
<el-table-column label="0启用 1禁用" align="center" prop="disable" /> <el-table-column label="0启用 1禁用" align="center" prop="disable" />
<el-table-column label="保质期" align="center" prop="period" /> --> <el-table-column label="保质期" align="center" prop="period" /> -->
<el-table-column label="预计采购价" align="center" prop="purPrice" /> <el-table-column label="采购价" align="center" prop="purPrice" />
<el-table-column label="建议批发价" align="center" prop="wholePrice" /> <!-- <el-table-column label="建议批发价" align="center" prop="wholePrice" />-->
<el-table-column label="建议零售价" align="center" prop="retailPrice" /> <el-table-column label="零售价" align="center" prop="retailPrice" />
<!-- <el-table-column label="单位成本" align="center" prop="unitCost" /> --> <!-- <el-table-column label="单位成本" align="center" prop="unitCost" /> -->
<el-table-column label="供应商" align="center" prop="supplierId" > <el-table-column label="供应商" align="center" prop="supplierId" >
<template slot-scope="scope"> <template slot-scope="scope">
@ -238,8 +238,8 @@
</el-table> </el-table>
</el-dialog> </el-dialog>
<!-- 添加或修改商品管理对话框 --> <!-- 添加或修改商品管理对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="130px">
<el-form-item label="商品名称" prop="name"> <el-form-item label="商品名称" prop="name">
<el-input v-model="form.name" placeholder="请输入商品名称" /> <el-input v-model="form.name" placeholder="请输入商品名称" />
</el-form-item> </el-form-item>
@ -289,13 +289,13 @@
<!-- <el-form-item label="保质期" prop="period">--> <!-- <el-form-item label="保质期" prop="period">-->
<!-- <el-input v-model="form.period" placeholder="请输入保质期" />--> <!-- <el-input v-model="form.period" placeholder="请输入保质期" />-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<el-form-item label="预计采购价" prop="purPrice"> <el-form-item label="采购价" prop="purPrice">
<el-input v-model="form.purPrice" placeholder="请输入预计采购价格" /> <el-input v-model="form.purPrice" placeholder="请输入预计采购价格" />
</el-form-item> </el-form-item>
<el-form-item label="建议批发价" prop="wholePrice"> <!-- <el-form-item label="建议批发价" prop="wholePrice">-->
<el-input v-model="form.wholePrice" placeholder="请输入建议批发价" /> <!-- <el-input v-model="form.wholePrice" placeholder="请输入建议批发价" />-->
</el-form-item> <!-- </el-form-item>-->
<el-form-item label="建议零售价" prop="retailPrice"> <el-form-item label="零售价" prop="retailPrice">
<el-input v-model="form.retailPrice" placeholder="请输入建议零售价" /> <el-input v-model="form.retailPrice" placeholder="请输入建议零售价" />
</el-form-item> </el-form-item>
<!-- <el-form-item label="单位成本" prop="unitCost">--> <!-- <el-form-item label="单位成本" prop="unitCost">-->