Skip to content

Commit

Permalink
Merge pull request #353 from Jzow/master
Browse files Browse the repository at this point in the history
Fix known defects and issues
  • Loading branch information
Jzow authored Aug 15, 2024
2 parents 364622e + 6633ac8 commit 46355ba
Show file tree
Hide file tree
Showing 28 changed files with 552 additions and 276 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,9 @@ public interface ProductStockMapper extends BaseMapper<ProductStock> {
Page<ProductStockSkuVO> getProductStock(IPage<QueryProductStockDTO> pageObject, QueryProductStockDTO queryProductStockDTO);

List<ProductStockSkuVO> getProductStockList(QueryProductStockDTO queryProductStockDTO);

// 检查商品是否存在
Boolean productStockExist(Long productSkuId, Long warehouseId);

Boolean saveBatch(List<ProductStock> productStockList);
}
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,33 @@
</if>
</where>
</select>

<select id="productStockExist" resultType="boolean" parameterType="map">
SELECT COUNT(1) > 0
FROM product_stock
WHERE product_sku_id = #{productSkuId}
AND warehouse_id = #{warehouseId}
</select>

<insert id="saveBatch" parameterType="java.util.List">
INSERT INTO product_stock (id, tenant_id, product_sku_id, warehouse_id,
init_stock_quantity, high_stock_quantity, current_stock_quantity, create_time, update_time, create_by, update_by, delete_flag)
VALUES
<foreach collection="list" item="item" separator=",">
(
#{item.id},
#{item.tenantId},
#{item.productSkuId},
#{item.warehouseId},
#{item.initStockQuantity},
#{item.highStockQuantity},
#{item.currentStockQuantity},
#{item.createTime},
#{item.updateTime},
#{item.createBy},
#{item.updateBy},
#{item.deleteFlag}
)
</foreach>
</insert>
</mapper>
3 changes: 3 additions & 0 deletions core/domain/src/main/java/com/wansenai/bo/AllotStockBO.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ public class AllotStockBO {
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long productId;

@JsonSerialize(using = BigDecimalSerializerBO.class)
private BigDecimal salePrice;

private String productName;

private String productStandard;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import lombok.experimental.Accessors;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

Expand All @@ -33,7 +34,7 @@
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("warehouse_receipt_sub")
public class WarehouseReceiptSub {
public class WarehouseReceiptSub implements Serializable {

@Serial
private static final long serialVersionUID = 89161616161329L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ public boolean preHandle(HttpServletRequest request, HttpServletResponse respons
}
}
}
map.put("msg", "token无效");
map.put("code", "A0312");
// 这里先不做token的判断,不然首次前端加载会出现token无效给用户造成误解 2024-08-12
// map.put("msg", "token无效");
// map.put("code", "A0312");

String value = new ObjectMapper().writeValueAsString(map);
response.setContentType("application/json;charset=UTF-8");
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,7 @@ public Response<IPage<ProductStockSkuVO>> getProductStock(QueryProductStockDTO q

@Override
public Response<Page<StockFlowVO>> getStockFlow(QueryStockFlowDTO queryStockFlowDTO) {
var systemLanguage = userService.getUserSystemLanguage(userService.getCurrentUserId());
var retailData = receiptRetailSubService.lambdaQuery()
.eq(ReceiptRetailSub::getWarehouseId, queryStockFlowDTO.getWarehouseId())
.eq(ReceiptRetailSub::getProductBarcode, queryStockFlowDTO.getProductBarcode())
Expand Down Expand Up @@ -762,12 +763,13 @@ public Response<Page<StockFlowVO>> getStockFlow(QueryStockFlowDTO queryStockFlow
var stockFlowVO = StockFlowVO.builder()
.receiptNumber(receiptRetailMain.getReceiptNumber())
.receiptDate(receiptRetailMain.getReceiptDate())
.type(receiptRetailMain.getSubType())
.type(receiptRetailMain.getType())
.productNumber(item.getProductNumber())
.productBarcode(item.getProductBarcode())
.productName(commonService.getProductName(item.getProductId()))
.warehouseName(commonService.getWarehouseName(item.getWarehouseId()))
.build();

stockFlowVos.add(stockFlowVO);
}
});
Expand All @@ -781,12 +783,23 @@ public Response<Page<StockFlowVO>> getStockFlow(QueryStockFlowDTO queryStockFlow
var stockFlowVO = StockFlowVO.builder()
.receiptNumber(receiptSaleMain.getReceiptNumber())
.receiptDate(receiptSaleMain.getReceiptDate())
.type(receiptSaleMain.getSubType())
.productNumber(item.getProductNumber())
.productBarcode(item.getProductBarcode())
.productName(commonService.getProductName(item.getProductId()))
.warehouseName(commonService.getWarehouseName(item.getWarehouseId()))
.build();

if ("zh_CN".equals(systemLanguage)) {
stockFlowVO.setType(receiptSaleMain.getSubType());
} else {
if("销售订单".equals(receiptSaleMain.getSubType())) {
stockFlowVO.setType("Sales Order");
} else if("销售出库".equals(receiptSaleMain.getSubType())) {
stockFlowVO.setType("Sales Outbound");
} else {
stockFlowVO.setType("Sales Return");
}
}
stockFlowVos.add(stockFlowVO);
}
});
Expand All @@ -800,12 +813,22 @@ public Response<Page<StockFlowVO>> getStockFlow(QueryStockFlowDTO queryStockFlow
var stockFlowVO = StockFlowVO.builder()
.receiptNumber(receiptPurchaseMain.getReceiptNumber())
.receiptDate(receiptPurchaseMain.getReceiptDate())
.type(receiptPurchaseMain.getSubType())
.productNumber(item.getProductNumber())
.productBarcode(item.getProductBarcode())
.productName(commonService.getProductName(item.getProductId()))
.warehouseName(commonService.getWarehouseName(item.getWarehouseId()))
.build();
if ("zh_CN".equals(systemLanguage)) {
stockFlowVO.setType(receiptPurchaseMain.getSubType());
} else {
if("采购订单".equals(receiptPurchaseMain.getSubType())) {
stockFlowVO.setType("Purchase Order");
} else if("采购入库".equals(receiptPurchaseMain.getSubType())) {
stockFlowVO.setType("Purchase Inbound");
} else {
stockFlowVO.setType("Purchase Return");
}
}
stockFlowVos.add(stockFlowVO);
}
});
Expand Down
Loading

0 comments on commit 46355ba

Please sign in to comment.