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

fengcang
anthonyywj2 3 years ago
parent 01decc48ce
commit b55f57bd40

@ -2,6 +2,8 @@ package com.glxp.api.admin.entity.inventory;
import lombok.Data; import lombok.Data;
import java.util.Date;
@Data @Data
public class InvProductEntity { public class InvProductEntity {
private Integer id; private Integer id;
@ -23,6 +25,7 @@ public class InvProductEntity {
private String invStorageCode; private String invStorageCode;
private String invWarehouseCode; private String invWarehouseCode;
private String price; private String price;
private Date updateTime;
public Integer getInCount() { public Integer getInCount() {
if (inCount == null) if (inCount == null)

@ -99,6 +99,7 @@ public class InvProductsTrService {
, warehouseEntity.getLocStorageCode(), warehouseEntity.getInvWarehouseCode()); , warehouseEntity.getLocStorageCode(), warehouseEntity.getInvWarehouseCode());
if (invPreProductEntity == null) { if (invPreProductEntity == null) {
invPreProductEntity = buildInvProduct(erpOrderEntity.getGoodsid(), erpOrderEntity, orderEntity, warehouseEntity); invPreProductEntity = buildInvProduct(erpOrderEntity.getGoodsid(), erpOrderEntity, orderEntity, warehouseEntity);
invPreProductEntity.setUpdateTime(new Date());
invPreInProductService.insertInvProduct(invPreProductEntity); invPreInProductService.insertInvProduct(invPreProductEntity);
} else { } else {
int actCount = getActCount(warehouseEntity); int actCount = getActCount(warehouseEntity);
@ -111,6 +112,7 @@ public class InvProductsTrService {
if (erpOrderEntity.getPrice() != null) { if (erpOrderEntity.getPrice() != null) {
invPreProductEntity.setPrice(erpOrderEntity.getPrice() + ""); invPreProductEntity.setPrice(erpOrderEntity.getPrice() + "");
} }
invPreProductEntity.setUpdateTime(new Date());
invPreInProductService.updateInvProduct(invPreProductEntity); invPreInProductService.updateInvProduct(invPreProductEntity);
} }
} else if (bussinessTypeEntity.isAdvanceType()) {//预入库,则转存预入库 } else if (bussinessTypeEntity.isAdvanceType()) {//预入库,则转存预入库
@ -119,6 +121,7 @@ public class InvProductsTrService {
, warehouseEntity.getInvStorageCode(), warehouseEntity.getInvWarehouseCode()); , warehouseEntity.getInvStorageCode(), warehouseEntity.getInvWarehouseCode());
if (invPreProductEntity == null) { if (invPreProductEntity == null) {
invPreProductEntity = buildInvProduct(erpOrderEntity.getGoodsid(), erpOrderEntity, orderEntity, warehouseEntity); invPreProductEntity = buildInvProduct(erpOrderEntity.getGoodsid(), erpOrderEntity, orderEntity, warehouseEntity);
invPreProductEntity.setUpdateTime(new Date());
invPreProductService.insertInvProduct(invPreProductEntity); invPreProductService.insertInvProduct(invPreProductEntity);
} else { } else {
int actCount = getActCount(warehouseEntity); int actCount = getActCount(warehouseEntity);
@ -131,6 +134,7 @@ public class InvProductsTrService {
if (erpOrderEntity.getPrice() != null) { if (erpOrderEntity.getPrice() != null) {
invPreProductEntity.setPrice(erpOrderEntity.getPrice() + ""); invPreProductEntity.setPrice(erpOrderEntity.getPrice() + "");
} }
invPreProductEntity.setUpdateTime(new Date());
invPreProductService.updateInvProduct(invPreProductEntity); invPreProductService.updateInvProduct(invPreProductEntity);
} }
} else { //普通出入库 } else { //普通出入库
@ -139,6 +143,7 @@ public class InvProductsTrService {
if (invProductEntity == null) { if (invProductEntity == null) {
invProductEntity = buildInvProduct(erpOrderEntity.getGoodsid(), erpOrderEntity, orderEntity, warehouseEntity); invProductEntity = buildInvProduct(erpOrderEntity.getGoodsid(), erpOrderEntity, orderEntity, warehouseEntity);
invProductEntity.setUnitFk(orderEntity.getFromCorpId()); invProductEntity.setUnitFk(orderEntity.getFromCorpId());
invProductEntity.setUpdateTime(new Date());
invProductService.insertInvProduct(invProductEntity); invProductService.insertInvProduct(invProductEntity);
} else { } else {
int actCount = getActCount(warehouseEntity); int actCount = getActCount(warehouseEntity);
@ -151,6 +156,7 @@ public class InvProductsTrService {
if (erpOrderEntity.getPrice() != null) { if (erpOrderEntity.getPrice() != null) {
invProductEntity.setPrice(erpOrderEntity.getPrice() + ""); invProductEntity.setPrice(erpOrderEntity.getPrice() + "");
} }
invProductEntity.setUpdateTime(new Date());
invProductService.updateInvProduct(invProductEntity); invProductService.updateInvProduct(invProductEntity);
} }
@ -167,7 +173,7 @@ public class InvProductsTrService {
preInvEntity.setPrice(erpOrderEntity.getPrice() + ""); preInvEntity.setPrice(erpOrderEntity.getPrice() + "");
} }
} }
preInvEntity.setUpdateTime(new Date());
invPreInProductService.updateInvProduct(preInvEntity); invPreInProductService.updateInvProduct(preInvEntity);
} }
@ -197,6 +203,7 @@ public class InvProductsTrService {
if (orderEntity.isPreCheck()) { if (orderEntity.isPreCheck()) {
// insetInv(bussinessTypeEntity, invProductDetailEntities);//2.插入当前库存 // insetInv(bussinessTypeEntity, invProductDetailEntities);//2.插入当前库存
invPreInProductDetailService.insertInvProducts(invProductDetailEntities); invPreInProductDetailService.insertInvProducts(invProductDetailEntities);
} }
} }

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

@ -189,20 +189,21 @@
<if test="groupType != '' and groupType != null"> <if test="groupType != '' and groupType != null">
GROUP BY #{groupType} GROUP BY #{groupType}
</if> </if>
group by inv_pre_product.id
order by inv_pre_product.updateTime desc
</select> </select>
<insert id="insertInvProduct" keyProperty="id" <insert id="insertInvProduct" keyProperty="id"
parameterType="com.glxp.api.admin.entity.inventory.InvProductEntity"> parameterType="com.glxp.api.admin.entity.inventory.InvProductEntity">
insert INTO inv_pre_product insert INTO inv_pre_product
(productsName, nameCode, relIdFk, ggxh, batchNo, (productsName, nameCode, relIdFk, ggxh, batchNo,
productionDate, expireDate, ylqxzcrbarmc, zczbhhzbapzbh, 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}, values (#{productsName}, #{nameCode},
#{relIdFk}, #{ggxh}, #{batchNo}, #{relIdFk}, #{ggxh}, #{batchNo},
#{productionDate}, #{expireDate}, #{productionDate}, #{expireDate},
#{ylqxzcrbarmc}, #{zczbhhzbapzbh}, #{ylqxzcrbarmc}, #{zczbhhzbapzbh},
#{inCount}, #{outCount}, #{reCount}, #{customerId}, #{supId}, #{unitFk} #{inCount}, #{outCount}, #{reCount}, #{customerId}, #{supId}, #{unitFk}
, #{invStorageCode}, #{invWarehouseCode},#{price}) , #{invStorageCode}, #{invWarehouseCode},#{price},#{updateTime})
</insert> </insert>
@ -233,6 +234,7 @@
<if test="invStorageCode != null">invStorageCode=#{invStorageCode},</if> <if test="invStorageCode != null">invStorageCode=#{invStorageCode},</if>
<if test="invWarehouseCode != null">invWarehouseCode=#{invWarehouseCode},</if> <if test="invWarehouseCode != null">invWarehouseCode=#{invWarehouseCode},</if>
<if test="price != null">price=#{price},</if> <if test="price != null">price=#{price},</if>
<if test="updateTime != null">updateTime=#{updateTime},</if>
</trim> </trim>
WHERE id = #{id} WHERE id = #{id}

@ -185,6 +185,7 @@
GROUP BY #{groupType} GROUP BY #{groupType}
</if> </if>
group by inv_product.id group by inv_product.id
order by inv_product.updateTime desc
</select> </select>
<select id="stockStatistics" resultType="com.glxp.api.admin.res.inventory.InvProductResponse" <select id="stockStatistics" resultType="com.glxp.api.admin.res.inventory.InvProductResponse"
@ -246,13 +247,13 @@
insert INTO inv_product insert INTO inv_product
(productsName, nameCode, relIdFk, ggxh, batchNo, (productsName, nameCode, relIdFk, ggxh, batchNo,
productionDate, expireDate, ylqxzcrbarmc, zczbhhzbapzbh, 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}, values (#{productsName}, #{nameCode},
#{relIdFk}, #{ggxh}, #{batchNo}, #{relIdFk}, #{ggxh}, #{batchNo},
#{productionDate}, #{expireDate}, #{productionDate}, #{expireDate},
#{ylqxzcrbarmc}, #{zczbhhzbapzbh}, #{ylqxzcrbarmc}, #{zczbhhzbapzbh},
#{inCount}, #{outCount}, #{reCount}, #{customerId}, #{unitFk}, #{supId} #{inCount}, #{outCount}, #{reCount}, #{customerId}, #{unitFk}, #{supId}
, #{invStorageCode}, #{invWarehouseCode},#{price}) , #{invStorageCode}, #{invWarehouseCode},#{price},#{updateTime})
</insert> </insert>
@ -283,6 +284,8 @@
<if test="invStorageCode != null">invStorageCode=#{invStorageCode},</if> <if test="invStorageCode != null">invStorageCode=#{invStorageCode},</if>
<if test="invWarehouseCode != null">invWarehouseCode=#{invWarehouseCode},</if> <if test="invWarehouseCode != null">invWarehouseCode=#{invWarehouseCode},</if>
<if test="price != null">price=#{price},</if> <if test="price != null">price=#{price},</if>
<if test="updateTime != null">updateTime=#{updateTime},</if>
</trim> </trim>
WHERE id = #{id} WHERE id = #{id}
</update> </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 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 checkSp TINYINT(0) DEFAULT NULL COMMENT '自助平台同步';
alter table `udiwms`.thr_order_upload Add column checkBalacne 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