库存产品信息新增更新时间,按时间排序

fengcang
anthonyywj2 3 years ago
parent 01decc48ce
commit b55f57bd40

@ -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)

@ -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);
}
}

@ -190,7 +190,8 @@
<if test="groupType != '' and groupType != null">
GROUP BY #{groupType}
</if>
group by inv_prein_product.id
order by inv_prein_product.updateTime desc
</select>
<insert id="insertInvProduct" keyProperty="id"
parameterType="com.glxp.api.admin.entity.inventory.InvProductEntity">

@ -189,20 +189,21 @@
<if test="groupType != '' and groupType != null">
GROUP BY #{groupType}
</if>
group by inv_pre_product.id
order by inv_pre_product.updateTime desc
</select>
<insert id="insertInvProduct" keyProperty="id"
parameterType="com.glxp.api.admin.entity.inventory.InvProductEntity">
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})
</insert>
@ -233,6 +234,7 @@
<if test="invStorageCode != null">invStorageCode=#{invStorageCode},</if>
<if test="invWarehouseCode != null">invWarehouseCode=#{invWarehouseCode},</if>
<if test="price != null">price=#{price},</if>
<if test="updateTime != null">updateTime=#{updateTime},</if>
</trim>
WHERE id = #{id}

@ -185,6 +185,7 @@
GROUP BY #{groupType}
</if>
group by inv_product.id
order by inv_product.updateTime desc
</select>
<select id="stockStatistics" resultType="com.glxp.api.admin.res.inventory.InvProductResponse"
@ -246,13 +247,13 @@
insert INTO inv_product
(productsName, nameCode, relIdFk, ggxh, batchNo,
productionDate, expireDate, ylqxzcrbarmc, zczbhhzbapzbh,
inCount, outCount, reCount, customerId, unitFk, supId, invStorageCode, invWarehouseCode,price)
inCount, outCount, reCount, customerId, unitFk, supId, invStorageCode, invWarehouseCode,price,updateTime)
values (#{productsName}, #{nameCode},
#{relIdFk}, #{ggxh}, #{batchNo},
#{productionDate}, #{expireDate},
#{ylqxzcrbarmc}, #{zczbhhzbapzbh},
#{inCount}, #{outCount}, #{reCount}, #{customerId}, #{unitFk}, #{supId}
, #{invStorageCode}, #{invWarehouseCode},#{price})
, #{invStorageCode}, #{invWarehouseCode},#{price},#{updateTime})
</insert>
@ -283,6 +284,8 @@
<if test="invStorageCode != null">invStorageCode=#{invStorageCode},</if>
<if test="invWarehouseCode != null">invWarehouseCode=#{invWarehouseCode},</if>
<if test="price != null">price=#{price},</if>
<if test="updateTime != null">updateTime=#{updateTime},</if>
</trim>
WHERE id = #{id}
</update>

@ -54,3 +54,15 @@ alter table `udiwms`.thr_order_upload Add column checkWebNew TINYINT(0) DEFAULT
alter table `udiwms`.thr_order_upload Add column checkChange TINYINT(0) DEFAULT NULL COMMENT '缺量补单';
alter table `udiwms`.thr_order_upload Add column checkSp TINYINT(0) DEFAULT NULL COMMENT '自助平台同步';
alter table `udiwms`.thr_order_upload Add column checkBalacne TINYINT(0) DEFAULT NULL COMMENT '平衡补单';
alter table `inv_product` Add column updateTime date DEFAULT NULL COMMENT '更新时间';
alter table `inv_pre_product` Add column updateTime date DEFAULT NULL COMMENT '更新时间';
alter table `inv_prein_product` Add column updateTime date DEFAULT NULL COMMENT '更新时间';
alter table inv_product add index orderTime (updateTime);
alter table inv_pre_product add index orderTime (updateTime);
alter table inv_pre_product add index orderTime (updateTime);

Loading…
Cancel
Save