增加连带数据

This commit is contained in:
liumingxiy 2024-11-12 17:31:39 +08:00
parent d444af2eea
commit c4ee688bd0
2 changed files with 102 additions and 26 deletions

View File

@ -3,8 +3,8 @@ package com.ktg.mes.md.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ktg.common.annotation.Excel;
import com.ktg.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ktg.mes.wm.domain.WmStorageArea;
import com.ktg.mes.wm.domain.WmWarehouse;
import java.util.Date;
@ -110,6 +110,12 @@ public class WmsInventory extends BaseEntity {
*/
private String attr4;
private WmsInventoryPlan wmsStockPlan;
private WmWarehouse mWarehouse;
private WmStorageArea area;
private MdItem mdItem;
private MdUnitMeasure unit;
public Long getWmsInventoryId() {
return wmsInventoryId;
}
@ -238,29 +244,70 @@ public class WmsInventory extends BaseEntity {
this.attr4 = attr4;
}
public WmsInventoryPlan getWmsStockPlan() {
return wmsStockPlan;
}
public void setWmsStockPlan(WmsInventoryPlan wmsStockPlan) {
this.wmsStockPlan = wmsStockPlan;
}
public WmWarehouse getmWarehouse() {
return mWarehouse;
}
public void setmWarehouse(WmWarehouse mWarehouse) {
this.mWarehouse = mWarehouse;
}
public WmStorageArea getArea() {
return area;
}
public void setArea(WmStorageArea area) {
this.area = area;
}
public MdItem getMdItem() {
return mdItem;
}
public void setMdItem(MdItem mdItem) {
this.mdItem = mdItem;
}
public MdUnitMeasure getUnit() {
return unit;
}
public void setUnit(MdUnitMeasure unit) {
this.unit = unit;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("wmsInventoryId", getWmsInventoryId())
.append("wmsStockPlanId", getWmsStockPlanId())
.append("mWarehouseId", getmWarehouseId())
.append("areaId", getAreaId())
.append("mdItemId", getMdItemId())
.append("unitId", getUnitId())
.append("systemCount", getSystemCount())
.append("inventoryCount", getInventoryCount())
.append("inventoryTime", getInventoryTime())
.append("agCount", getAgCount())
.append("agTime", getAgTime())
.append("diffCount", getDiffCount())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("attr4", getAttr4())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
return "WmsInventory{" +
"wmsInventoryId=" + wmsInventoryId +
", wmsStockPlanId=" + wmsStockPlanId +
", mWarehouseId=" + mWarehouseId +
", areaId=" + areaId +
", mdItemId=" + mdItemId +
", unitId=" + unitId +
", systemCount=" + systemCount +
", inventoryCount=" + inventoryCount +
", inventoryTime=" + inventoryTime +
", agCount=" + agCount +
", agTime=" + agTime +
", diffCount=" + diffCount +
", attr1='" + attr1 + '\'' +
", attr2='" + attr2 + '\'' +
", attr3='" + attr3 + '\'' +
", attr4='" + attr4 + '\'' +
", wmsStockPlan=" + wmsStockPlan +
", mWarehouse=" + mWarehouse +
", area=" + area +
", mdItem=" + mdItem +
", unit=" + unit +
'}';
}
}

View File

@ -2,8 +2,13 @@ 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.mapper.MdItemMapper;
import com.ktg.mes.md.mapper.MdUnitMeasureMapper;
import com.ktg.mes.md.mapper.WmsInventoryMapper;
import com.ktg.mes.md.mapper.WmsInventoryPlanMapper;
import com.ktg.mes.md.service.IWmsInventoryService;
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;
@ -20,6 +25,16 @@ public class WmsInventoryServiceImpl implements IWmsInventoryService {
@Autowired
private WmsInventoryMapper wmsInventoryMapper;
private WmsInventoryPlanMapper wmsInventoryPlanMapper;
private WmWarehouseMapper wmWarehouseMapper;
private WmStorageAreaMapper wmStorageAreaMapper;
private MdItemMapper mdItemMapper;
private MdUnitMeasureMapper mdUnitMeasureMapper;
/**
* 查询盘点
*
@ -28,7 +43,13 @@ public class WmsInventoryServiceImpl implements IWmsInventoryService {
*/
@Override
public WmsInventory selectWmsInventoryByWmsInventoryId(Long wmsInventoryId) {
return wmsInventoryMapper.selectWmsInventoryByWmsInventoryId(wmsInventoryId);
WmsInventory wmsInventory = wmsInventoryMapper.selectWmsInventoryByWmsInventoryId(wmsInventoryId);
wmsInventory.setWmsStockPlan(wmsInventoryPlanMapper.selectWmsInventoryPlanByWmsStockPlanId(wmsInventory.getWmsStockPlanId()));
wmsInventory.setmWarehouse(wmWarehouseMapper.selectWmWarehouseByWarehouseId(wmsInventory.getmWarehouseId()));
wmsInventory.setArea(wmStorageAreaMapper.selectWmStorageAreaByAreaId(wmsInventory.getAreaId()));
wmsInventory.setMdItem(mdItemMapper.selectMdItemById(wmsInventory.getMdItemId()));
wmsInventory.setUnit(mdUnitMeasureMapper.selectMdUnitMeasureByMeasureId(wmsInventory.getUnitId()));
return wmsInventory;
}
/**
@ -39,7 +60,15 @@ public class WmsInventoryServiceImpl implements IWmsInventoryService {
*/
@Override
public List<WmsInventory> selectWmsInventoryList(WmsInventory wmsInventory) {
return wmsInventoryMapper.selectWmsInventoryList(wmsInventory);
List<WmsInventory> wmsInventoryList = wmsInventoryMapper.selectWmsInventoryList(wmsInventory);
wmsInventoryList.forEach(item -> {
item.setWmsStockPlan(wmsInventoryPlanMapper.selectWmsInventoryPlanByWmsStockPlanId(item.getWmsStockPlanId()));
item.setmWarehouse(wmWarehouseMapper.selectWmWarehouseByWarehouseId(item.getmWarehouseId()));
item.setArea(wmStorageAreaMapper.selectWmStorageAreaByAreaId(item.getAreaId()));
item.setMdItem(mdItemMapper.selectMdItemById(item.getMdItemId()));
item.setUnit(mdUnitMeasureMapper.selectMdUnitMeasureByMeasureId(item.getUnitId()));
});
return wmsInventoryList;
}
/**