From 9eaeeab4b33927fe0f9c428ebf44b62bd8788b0d Mon Sep 17 00:00:00 2001
From: jenkins <jenkins@example.com>
Date: 星期二, 19 五月 2026 21:42:21 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_New_pro' into dev_pro_河南鹤壁
---
src/main/java/com/ruoyi/sales/service/impl/SalesLedgerProductServiceImpl.java | 3 +++
src/main/java/com/ruoyi/stock/dto/StockOutRecordDto.java | 4 ++++
src/main/resources/mapper/stock/StockOutRecordMapper.xml | 6 ++++++
src/main/java/com/ruoyi/sales/dto/SalesLedgerImportDto.java | 4 ++++
src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java | 6 ++++--
src/main/java/com/ruoyi/sales/dto/SalesLedgerProductImportDto.java | 7 +++++--
src/main/resources/mapper/stock/StockInRecordMapper.xml | 6 ++++++
src/main/resources/static/销售台账导入模板.xlsx | 0
src/main/java/com/ruoyi/stock/dto/StockInRecordDto.java | 5 +++++
9 files changed, 37 insertions(+), 4 deletions(-)
diff --git a/src/main/java/com/ruoyi/sales/dto/SalesLedgerImportDto.java b/src/main/java/com/ruoyi/sales/dto/SalesLedgerImportDto.java
index 2430d10..0023e17 100644
--- a/src/main/java/com/ruoyi/sales/dto/SalesLedgerImportDto.java
+++ b/src/main/java/com/ruoyi/sales/dto/SalesLedgerImportDto.java
@@ -43,6 +43,10 @@
@Excel(name = "绛捐鏃ユ湡", width = 30, dateFormat = "yyyy-MM-dd")
private Date executionDate;
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ @Excel(name = "浜や粯鏃ユ湡", width = 30, dateFormat = "yyyy-MM-dd")
+ private Date deliveryDate;
+
@Schema(description = "浠樻鏂瑰紡")
@Excel(name = "浠樻鏂瑰紡")
private String paymentMethod;
diff --git a/src/main/java/com/ruoyi/sales/dto/SalesLedgerProductImportDto.java b/src/main/java/com/ruoyi/sales/dto/SalesLedgerProductImportDto.java
index 2c95909..9f05b60 100644
--- a/src/main/java/com/ruoyi/sales/dto/SalesLedgerProductImportDto.java
+++ b/src/main/java/com/ruoyi/sales/dto/SalesLedgerProductImportDto.java
@@ -73,6 +73,9 @@
@Excel(name = "鏄惁璐ㄦ", readConverterExp = "0=鍚�,1=鏄�")
private Boolean isChecked;
-
-
+ /**
+ * 鏄惁鐢熶骇
+ */
+ @Excel(name = "鏄惁鐢熶骇", readConverterExp = "0=鍚�,1=鏄�")
+ private Integer isProduction;
}
diff --git a/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerProductServiceImpl.java b/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerProductServiceImpl.java
index 8ce023b..a827cb8 100644
--- a/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerProductServiceImpl.java
+++ b/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerProductServiceImpl.java
@@ -285,6 +285,9 @@
* 鍒犻櫎鐢熶骇璁″垝
*/
public void deleteProductionData(List<Long> productIds) {
+ if (CollectionUtils.isEmpty(productIds)) {
+ return;
+ }
List<ProductionPlan> productionPlans = productionPlanMapper.selectList(
new LambdaQueryWrapper<ProductionPlan>()
.in(ProductionPlan::getSalesLedgerProductId, productIds.stream().map(Long::intValue).collect(Collectors.toList())));
diff --git a/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java b/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java
index a2f918b..768483f 100644
--- a/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java
+++ b/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java
@@ -370,6 +370,7 @@
SalesLedger salesLedger = new SalesLedger();
BeanUtils.copyProperties(salesLedgerImportDto, salesLedger);
salesLedger.setExecutionDate(DateUtils.toLocalDate(salesLedgerImportDto.getExecutionDate()));
+ salesLedger.setDeliveryDate(DateUtils.toLocalDate(salesLedgerImportDto.getDeliveryDate()));
// 閫氳繃瀹㈡埛鍚嶇О鏌ヨ瀹㈡埛ID锛屽鎴峰悎鍚屽彿
salesLedger.setCustomerId(customers.stream()
.filter(customer -> customer.getCustomerName().equals(salesLedger.getCustomerName()))
@@ -411,7 +412,7 @@
salesLedgerProduct.setNoInvoiceNum(salesLedgerProduct.getQuantity());
salesLedgerProduct.setNoInvoiceAmount(salesLedgerProduct.getTaxExclusiveTotalPrice());
list.stream()
- .filter(map -> map.get("productName").equals(salesLedgerProduct.getProductCategory()) && map.get("model").equals(salesLedgerProduct.getSpecificationModel()))
+ .filter(map -> Objects.equals(map.get("productName"), salesLedgerProduct.getProductCategory()) && Objects.equals(map.get("model"), salesLedgerProduct.getSpecificationModel()))
.findFirst()
.ifPresent(map -> {
salesLedgerProduct.setProductModelId(Long.parseLong(map.get("modelId").toString()));
@@ -431,6 +432,7 @@
salesLedgerProduct.setRegisterDate(LocalDateTime.now());
salesLedgerProduct.setApproveStatus(0);
salesLedgerProduct.setPendingInvoiceTotal(salesLedgerProductImportDto.getTaxInclusiveTotalPrice());
+ salesLedgerProduct.setIsProduction(salesLedgerProductImportDto.getIsProduction() == 1);
salesLedgerProductMapper.insert(salesLedgerProduct);
// 娣诲姞鐢熶骇鏁版嵁
salesLedgerProductServiceImpl.addProductionData(salesLedgerProduct);
@@ -440,8 +442,8 @@
return AjaxResult.success("瀵煎叆鎴愬姛");
} catch (Exception e) {
e.printStackTrace();
+ return AjaxResult.error("瀵煎叆澶辫触锛�" + e.getMessage());
}
- return AjaxResult.success("瀵煎叆澶辫触");
}
@Override
diff --git a/src/main/java/com/ruoyi/stock/dto/StockInRecordDto.java b/src/main/java/com/ruoyi/stock/dto/StockInRecordDto.java
index 56ad762..17d7e77 100644
--- a/src/main/java/com/ruoyi/stock/dto/StockInRecordDto.java
+++ b/src/main/java/com/ruoyi/stock/dto/StockInRecordDto.java
@@ -18,6 +18,11 @@
*/
private String model;
/**
+ * 鎵规鍙�
+ */
+ private String batchNo;
+
+ /**
* 浜у搧鍗曚綅
*/
private String unit;
diff --git a/src/main/java/com/ruoyi/stock/dto/StockOutRecordDto.java b/src/main/java/com/ruoyi/stock/dto/StockOutRecordDto.java
index 022be78..0419f2f 100644
--- a/src/main/java/com/ruoyi/stock/dto/StockOutRecordDto.java
+++ b/src/main/java/com/ruoyi/stock/dto/StockOutRecordDto.java
@@ -21,6 +21,10 @@
*/
private String model;
/**
+ * 鎵规鍙�
+ */
+ private String batchNo;
+ /**
* 浜у搧鍗曚綅
*/
private String unit;
diff --git a/src/main/resources/mapper/stock/StockInRecordMapper.xml b/src/main/resources/mapper/stock/StockInRecordMapper.xml
index 2327375..55e57a3 100644
--- a/src/main/resources/mapper/stock/StockInRecordMapper.xml
+++ b/src/main/resources/mapper/stock/StockInRecordMapper.xml
@@ -31,6 +31,12 @@
<if test="params.productName != null and params.productName != ''">
and p.product_name like concat('%',#{params.productName},'%')
</if>
+ <if test="params.model != null and params.model != ''">
+ and pm.model like concat('%',#{params.model},'%')
+ </if>
+ <if test="params.batchNo != null and params.batchNo != ''">
+ and sir.batch_no like concat('%',#{params.batchNo},'%')
+ </if>
<if test="params.type != null and params.type != ''">
and sir.type = #{params.type}
</if>
diff --git a/src/main/resources/mapper/stock/StockOutRecordMapper.xml b/src/main/resources/mapper/stock/StockOutRecordMapper.xml
index cf6f0ac..202de6b 100644
--- a/src/main/resources/mapper/stock/StockOutRecordMapper.xml
+++ b/src/main/resources/mapper/stock/StockOutRecordMapper.xml
@@ -46,6 +46,12 @@
<if test="params.productName != null and params.productName != ''">
and p.product_name like concat('%',#{params.productName},'%')
</if>
+ <if test="params.model != null and params.model != ''">
+ and pm.model like concat('%',#{params.model},'%')
+ </if>
+ <if test="params.batchNo != null and params.batchNo != ''">
+ and sor.batch_no like concat('%',#{params.batchNo},'%')
+ </if>
<if test="params.type != null and params.type != ''">
and sor.type = #{params.type}
</if>
diff --git "a/src/main/resources/static/\351\224\200\345\224\256\345\217\260\350\264\246\345\257\274\345\205\245\346\250\241\346\235\277.xlsx" "b/src/main/resources/static/\351\224\200\345\224\256\345\217\260\350\264\246\345\257\274\345\205\245\346\250\241\346\235\277.xlsx"
index 9558711..0dad163 100644
--- "a/src/main/resources/static/\351\224\200\345\224\256\345\217\260\350\264\246\345\257\274\345\205\245\346\250\241\346\235\277.xlsx"
+++ "b/src/main/resources/static/\351\224\200\345\224\256\345\217\260\350\264\246\345\257\274\345\205\245\346\250\241\346\235\277.xlsx"
Binary files differ
--
Gitblit v1.9.3