diff --git a/api-admin/src/main/java/com/glxp/api/admin/entity/inventory/InvProductEntity.java b/api-admin/src/main/java/com/glxp/api/admin/entity/inventory/InvProductEntity.java
index 22054812..f25b94a4 100644
--- a/api-admin/src/main/java/com/glxp/api/admin/entity/inventory/InvProductEntity.java
+++ b/api-admin/src/main/java/com/glxp/api/admin/entity/inventory/InvProductEntity.java
@@ -2,6 +2,8 @@ package com.glxp.api.admin.entity.inventory;
import lombok.Data;
+import java.util.Date;
+
@Data
public class InvProductEntity {
private Integer id;
@@ -23,6 +25,7 @@ public class InvProductEntity {
private String invStorageCode;
private String invWarehouseCode;
private String price;
+ private Date updateTime;
public Integer getInCount() {
if (inCount == null)
diff --git a/api-admin/src/main/java/com/glxp/api/admin/thread/InvProductsTrService.java b/api-admin/src/main/java/com/glxp/api/admin/thread/InvProductsTrService.java
index 26dcc9f3..7d19f258 100644
--- a/api-admin/src/main/java/com/glxp/api/admin/thread/InvProductsTrService.java
+++ b/api-admin/src/main/java/com/glxp/api/admin/thread/InvProductsTrService.java
@@ -99,6 +99,7 @@ public class InvProductsTrService {
, warehouseEntity.getLocStorageCode(), warehouseEntity.getInvWarehouseCode());
if (invPreProductEntity == null) {
invPreProductEntity = buildInvProduct(erpOrderEntity.getGoodsid(), erpOrderEntity, orderEntity, warehouseEntity);
+ invPreProductEntity.setUpdateTime(new Date());
invPreInProductService.insertInvProduct(invPreProductEntity);
} else {
int actCount = getActCount(warehouseEntity);
@@ -111,6 +112,7 @@ public class InvProductsTrService {
if (erpOrderEntity.getPrice() != null) {
invPreProductEntity.setPrice(erpOrderEntity.getPrice() + "");
}
+ invPreProductEntity.setUpdateTime(new Date());
invPreInProductService.updateInvProduct(invPreProductEntity);
}
} else if (bussinessTypeEntity.isAdvanceType()) {//预入库,则转存预入库
@@ -119,6 +121,7 @@ public class InvProductsTrService {
, warehouseEntity.getInvStorageCode(), warehouseEntity.getInvWarehouseCode());
if (invPreProductEntity == null) {
invPreProductEntity = buildInvProduct(erpOrderEntity.getGoodsid(), erpOrderEntity, orderEntity, warehouseEntity);
+ invPreProductEntity.setUpdateTime(new Date());
invPreProductService.insertInvProduct(invPreProductEntity);
} else {
int actCount = getActCount(warehouseEntity);
@@ -131,6 +134,7 @@ public class InvProductsTrService {
if (erpOrderEntity.getPrice() != null) {
invPreProductEntity.setPrice(erpOrderEntity.getPrice() + "");
}
+ invPreProductEntity.setUpdateTime(new Date());
invPreProductService.updateInvProduct(invPreProductEntity);
}
} else { //普通出入库
@@ -139,6 +143,7 @@ public class InvProductsTrService {
if (invProductEntity == null) {
invProductEntity = buildInvProduct(erpOrderEntity.getGoodsid(), erpOrderEntity, orderEntity, warehouseEntity);
invProductEntity.setUnitFk(orderEntity.getFromCorpId());
+ invProductEntity.setUpdateTime(new Date());
invProductService.insertInvProduct(invProductEntity);
} else {
int actCount = getActCount(warehouseEntity);
@@ -151,6 +156,7 @@ public class InvProductsTrService {
if (erpOrderEntity.getPrice() != null) {
invProductEntity.setPrice(erpOrderEntity.getPrice() + "");
}
+ invProductEntity.setUpdateTime(new Date());
invProductService.updateInvProduct(invProductEntity);
}
@@ -167,7 +173,7 @@ public class InvProductsTrService {
preInvEntity.setPrice(erpOrderEntity.getPrice() + "");
}
}
-
+ preInvEntity.setUpdateTime(new Date());
invPreInProductService.updateInvProduct(preInvEntity);
}
@@ -197,6 +203,7 @@ public class InvProductsTrService {
if (orderEntity.isPreCheck()) {
// insetInv(bussinessTypeEntity, invProductDetailEntities);//2.插入当前库存
+
invPreInProductDetailService.insertInvProducts(invProductDetailEntities);
}
}
diff --git a/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreInProductDao.xml b/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreInProductDao.xml
index 7204ffcf..248ffc14 100644
--- a/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreInProductDao.xml
+++ b/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreInProductDao.xml
@@ -190,7 +190,8 @@
GROUP BY #{groupType}
-
+ group by inv_prein_product.id
+ order by inv_prein_product.updateTime desc
diff --git a/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreProductDao.xml b/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreProductDao.xml
index 8e044a44..3e87028f 100644
--- a/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreProductDao.xml
+++ b/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreProductDao.xml
@@ -189,20 +189,21 @@
GROUP BY #{groupType}
-
+ group by inv_pre_product.id
+ order by inv_pre_product.updateTime desc
insert INTO inv_pre_product
(productsName, nameCode, relIdFk, ggxh, batchNo,
productionDate, expireDate, ylqxzcrbarmc, zczbhhzbapzbh,
- inCount, outCount, reCount, customerId, supId, unitFk, invStorageCode, invWarehouseCode,price)
+ inCount, outCount, reCount, customerId, supId, unitFk, invStorageCode, invWarehouseCode,price,updateTime)
values (#{productsName}, #{nameCode},
#{relIdFk}, #{ggxh}, #{batchNo},
#{productionDate}, #{expireDate},
#{ylqxzcrbarmc}, #{zczbhhzbapzbh},
#{inCount}, #{outCount}, #{reCount}, #{customerId}, #{supId}, #{unitFk}
- , #{invStorageCode}, #{invWarehouseCode},#{price})
+ , #{invStorageCode}, #{invWarehouseCode},#{price},#{updateTime})
@@ -233,6 +234,7 @@
invStorageCode=#{invStorageCode},
invWarehouseCode=#{invWarehouseCode},
price=#{price},
+ updateTime=#{updateTime},
WHERE id = #{id}
diff --git a/api-admin/src/main/resources/mybatis/mapper/inventory/InvProductDao.xml b/api-admin/src/main/resources/mybatis/mapper/inventory/InvProductDao.xml
index 8177ecc4..86466b70 100644
--- a/api-admin/src/main/resources/mybatis/mapper/inventory/InvProductDao.xml
+++ b/api-admin/src/main/resources/mybatis/mapper/inventory/InvProductDao.xml
@@ -185,6 +185,7 @@
GROUP BY #{groupType}
group by inv_product.id
+ order by inv_product.updateTime desc