增加存在差异的盘点展示

This commit is contained in:
liumingxiy 2024-11-14 10:15:00 +08:00
parent a545cb9ae6
commit 89cf873277
4 changed files with 58 additions and 0 deletions

View File

@ -84,6 +84,10 @@ public class WmsInventoryPlan extends BaseEntity {
@Excel(name = "描述")
private String description;
private Integer deffCount;
private String isDeffCount;
/**
* 预留字段1
*/
@ -247,6 +251,22 @@ public class WmsInventoryPlan extends BaseEntity {
this.mWarehouse = mWarehouse;
}
public Integer getDeffCount() {
return deffCount;
}
public void setDeffCount(Integer deffCount) {
this.deffCount = deffCount;
}
public String getIsDeffCount() {
return isDeffCount;
}
public void setIsDeffCount(String isDeffCount) {
this.isDeffCount = isDeffCount;
}
@Override
public String toString() {
return "WmsInventoryPlan{" +
@ -261,6 +281,8 @@ public class WmsInventoryPlan extends BaseEntity {
", isag='" + isag + '\'' +
", status='" + status + '\'' +
", description='" + description + '\'' +
", deffCount=" + deffCount +
", isDeffCount='" + isDeffCount + '\'' +
", attr1='" + attr1 + '\'' +
", attr2='" + attr2 + '\'' +
", attr3='" + attr3 + '\'' +

View File

@ -18,6 +18,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
/**
* 盘点计划Service业务层处理
@ -73,6 +74,7 @@ public class WmsInventoryPlanServiceImpl implements IWmsInventoryPlanService {
*/
@Override
public List<WmsInventoryPlan> selectWmsInventoryPlanList(WmsInventoryPlan wmsInventoryPlan) {
System.out.println(wmsInventoryPlan.getIsDeffCount());
List<WmsInventoryPlan> wmsInventoryPlanList = wmsInventoryPlanMapper.selectWmsInventoryPlanList(wmsInventoryPlan);
wmsInventoryPlanList.forEach(item -> {
item.setmWarehouse(wmWarehouseMapper.selectWmWarehouseByWarehouseId(item.getmWarehouseId()));
@ -118,6 +120,16 @@ public class WmsInventoryPlanServiceImpl implements IWmsInventoryPlanService {
wmsInventory.setAgTime(null);
}
wmsInventoryMapper.updateWmsInventory(wmsInventory);
AtomicInteger deffCount = new AtomicInteger();
WmsInventory wmsInventoryQuery = new WmsInventory();
wmsInventoryQuery.setWmsStockPlanId(wmsInventory.getWmsStockPlanId());
List<WmsInventory> wmsInventoryList = wmsInventoryMapper.selectWmsInventoryList(wmsInventoryQuery);
wmsInventoryList.forEach(item -> {
deffCount.addAndGet(item.getDiffCount() == null ? 0 : item.getDiffCount());
});
wmsInventoryPlan.setDeffCount(deffCount.get());
});
return wmsInventoryPlanMapper.updateWmsInventoryPlan(wmsInventoryPlan);
}

View File

@ -2,6 +2,7 @@ package com.ktg.mes.md.service.impl;
import com.ktg.common.utils.DateUtils;
import com.ktg.mes.md.domain.WmsInventory;
import com.ktg.mes.md.domain.WmsInventoryPlan;
import com.ktg.mes.md.mapper.MdItemMapper;
import com.ktg.mes.md.mapper.MdUnitMeasureMapper;
import com.ktg.mes.md.mapper.WmsInventoryMapper;
@ -11,9 +12,11 @@ import com.ktg.mes.wm.mapper.WmStorageAreaMapper;
import com.ktg.mes.wm.mapper.WmWarehouseMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
/**
* 盘点Service业务层处理
@ -95,6 +98,7 @@ public class WmsInventoryServiceImpl implements IWmsInventoryService {
* @param wmsInventory 盘点
* @return 结果
*/
@Transactional
@Override
public int updateWmsInventory(WmsInventory wmsInventory) {
wmsInventory.setUpdateTime(DateUtils.getNowDate());
@ -108,6 +112,19 @@ public class WmsInventoryServiceImpl implements IWmsInventoryService {
} else {
wmsInventory.setAgTime(null);
}
AtomicInteger deffCount = new AtomicInteger();
WmsInventory wmsInventoryQuery = new WmsInventory();
wmsInventoryQuery.setWmsStockPlanId(wmsInventory.getWmsStockPlanId());
List<WmsInventory> wmsInventoryList = wmsInventoryMapper.selectWmsInventoryList(wmsInventoryQuery);
wmsInventoryList.forEach(item -> {
deffCount.addAndGet(item.getDiffCount() == null ? 0 : item.getDiffCount());
});
WmsInventoryPlan wmsInventoryPlan = wmsInventoryPlanMapper.selectWmsInventoryPlanByWmsStockPlanId(wmsInventory.getWmsStockPlanId());
wmsInventoryPlan.setDeffCount(deffCount.get());
wmsInventoryPlanMapper.updateWmsInventoryPlan(wmsInventoryPlan);
return wmsInventoryMapper.updateWmsInventory(wmsInventory);
}

View File

@ -16,6 +16,7 @@
<result property="isag" column="ISAG"/>
<result property="status" column="STATUS"/>
<result property="description" column="DESCRIPTION"/>
<result property="deffCount" column="DEFF_COUNT"/>
<result property="attr1" column="ATTR1"/>
<result property="attr2" column="ATTR2"/>
<result property="attr3" column="ATTR3"/>
@ -66,6 +67,7 @@
ISAG,
STATUS,
DESCRIPTION,
DEFF_COUNT,
ATTR1,
ATTR2,
ATTR3,
@ -90,6 +92,8 @@
<if test="isag != null and isag != ''">and ISAG = #{isag}</if>
<if test="status != null and status != ''">and STATUS = #{status}</if>
<if test="description != null and description != ''">and DESCRIPTION = #{description}</if>
<if test="deffCount != null and deffCount != ''">and DEFF_COUNT = #{deffCount}</if>
<if test="isDeffCount != null and isDeffCount != ''">and DEFF_COUNT > 0</if>
<if test="createBy != null and createBy != ''">and CREATE_BY = #{createBy}</if>
<if test="createTime != null ">and CREATE_TIME = #{createTime}</if>
<if test="updateBy != null and updateBy != ''">and UPDATE_BY = #{updateBy}</if>
@ -111,6 +115,7 @@
a.ISAG,
a.STATUS,
a.DESCRIPTION,
a.DEFF_COUNT,
a.ATTR1,
a.ATTR2,
a.ATTR3,
@ -158,6 +163,7 @@
<if test="isag != null">ISAG,</if>
<if test="status != null">STATUS,</if>
<if test="description != null">DESCRIPTION,</if>
<if test="deffCount != null">DEFF_COUNT,</if>
<if test="attr1 != null">ATTR1,</if>
<if test="attr2 != null">ATTR2,</if>
<if test="attr3 != null">ATTR3,</if>
@ -202,6 +208,7 @@
<if test="isag != null">ISAG = #{isag},</if>
<if test="status != null">STATUS = #{status},</if>
<if test="description != null">DESCRIPTION = #{description},</if>
<if test="deffCount != null">DEFF_COUNT = #{deffCount},</if>
<if test="attr1 != null">ATTR1 = #{attr1},</if>
<if test="attr2 != null">ATTR2 = #{attr2},</if>
<if test="attr3 != null">ATTR3 = #{attr3},</if>