库存添加字段;

This commit is contained in:
王奎兴
2026-01-23 15:33:46 +08:00
parent bf4b1d9568
commit 16c46565f5
9 changed files with 162 additions and 10 deletions
@@ -129,5 +129,23 @@ public class MaterialInventory extends BaseVOEntity {
@Excel(name = "盘点是否可用:0-禁用 1-可用")
private Integer isAble;
@ApiModelProperty("单位")
@Excel(name = "单位")
private String unit;
}
@ApiModelProperty("净重(KG)")
@Excel(name = "净重(KG)")
private BigDecimal netWeight;
@ApiModelProperty("毛重(KG)")
@Excel(name = "毛重(KG)")
private BigDecimal grossWeight;
@ApiModelProperty("体积")
@Excel(name = "体积")
private BigDecimal volume;
@ApiModelProperty("面积")
@Excel(name = "面积")
private BigDecimal area;
}
@@ -127,4 +127,25 @@ public class MaterialInventoryPO extends MaterialBasePO {
@ApiModelProperty("盘点是否可用:0-禁用 1-可用")
@Excel(name = "盘点是否可用:0-禁用 1-可用")
private Integer isAble;
}
@ApiModelProperty("单位")
@Excel(name = "单位")
private String unit;
@ApiModelProperty("净重(KG)")
@Excel(name = "净重(KG)")
private BigDecimal netWeight;
@ApiModelProperty("毛重(KG)")
@Excel(name = "毛重(KG)")
private BigDecimal grossWeight;
@ApiModelProperty("体积")
@Excel(name = "体积")
private BigDecimal volume;
@ApiModelProperty("面积")
@Excel(name = "面积")
private BigDecimal area;
}
@@ -147,4 +147,25 @@ public class MaterialInventoryQueryListPO extends MaterialBasePO {
@ApiModelProperty("盘点是否可用:0-禁用 1-可用")
@Excel(name = "盘点是否可用:0-禁用 1-可用")
private Integer isAble;
}
@ApiModelProperty("单位")
@Excel(name = "单位")
private String unit;
@ApiModelProperty("净重(KG)")
@Excel(name = "净重(KG)")
private BigDecimal netWeight;
@ApiModelProperty("毛重(KG)")
@Excel(name = "毛重(KG)")
private BigDecimal grossWeight;
@ApiModelProperty("体积")
@Excel(name = "体积")
private BigDecimal volume;
@ApiModelProperty("面积")
@Excel(name = "面积")
private BigDecimal area;
}
@@ -144,4 +144,25 @@ public class MaterialInventoryDO extends MaterialBaseDO {
@ApiModelProperty("物料/库位信息")
@Excel(name = "物料/库位信息")
private String storageInfo;
}
@ApiModelProperty("单位")
@Excel(name = "单位")
private String unit;
@ApiModelProperty("净重(KG)")
@Excel(name = "净重(KG)")
private BigDecimal netWeight;
@ApiModelProperty("毛重(KG)")
@Excel(name = "毛重(KG)")
private BigDecimal grossWeight;
@ApiModelProperty("体积")
@Excel(name = "体积")
private BigDecimal volume;
@ApiModelProperty("面积")
@Excel(name = "面积")
private BigDecimal area;
}
@@ -168,4 +168,25 @@ public class MaterialInventoryQueryListDO extends MaterialBaseDO {
@ApiModelProperty("物料/库位信息")
@Excel(name = "物料/库位信息")
private String storageInfo;
}
@ApiModelProperty("单位")
@Excel(name = "单位")
private String unit;
@ApiModelProperty("净重(KG)")
@Excel(name = "净重(KG)")
private BigDecimal netWeight;
@ApiModelProperty("毛重(KG)")
@Excel(name = "毛重(KG)")
private BigDecimal grossWeight;
@ApiModelProperty("体积")
@Excel(name = "体积")
private BigDecimal volume;
@ApiModelProperty("面积")
@Excel(name = "面积")
private BigDecimal area;
}
@@ -1,11 +1,18 @@
package com.mhd.wms.domain.stockOutOrder.repository.listener;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.alibaba.excel.metadata.data.ReadCellData;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.mhd.common.core.domain.po.SysDictDataVo;
import com.mhd.common.core.web.domain.AjaxResult;
import com.mhd.system.api.SystemServiceFeign;
import com.mhd.wms.domain.stockOutOrder.entity.StockOutOrder;
import com.mhd.wms.domain.stockOutOrder.repository.todo.StockOutOrderDO;
import lombok.Getter;
import org.springframework.beans.factory.annotation.Autowired;
import java.time.LocalDate;
import java.time.ZoneId;
@@ -25,6 +32,8 @@ public class HeaderListener extends AnalysisEventListener<Map<Integer, Object>>
private final StockOutOrderDO stockOutOrder = new StockOutOrderDO();
private int rowNum = 0;
private final DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
@Autowired
private SystemServiceFeign systemServiceFeign;
@Override
public void invoke(Map<Integer, Object> data, AnalysisContext context) {
@@ -46,6 +55,19 @@ public class HeaderListener extends AnalysisEventListener<Map<Integer, Object>>
stockOutOrder.setCarrier(getStringValue(rowData[2]));
stockOutOrder.setTel(getStringValue(rowData[5]));
stockOutOrder.setContainerNoName(getStringValue(rowData[12]));
if (ObjectUtil.isNotNull(getStringValue(rowData[12]))) {
stockOutOrder.setContainerNoName(getStringValue(rowData[12]));
AjaxResult transportMode = systemServiceFeign.selectListByDictType("cabinetNo");
if (ObjectUtil.isNotNull(transportMode) && transportMode.get("code").equals("200")) {
List<SysDictDataVo> transportModeList = JSON.parseArray(JSONObject.toJSONString(transportMode.get("data")), SysDictDataVo.class);
for (SysDictDataVo sysDictDataVo : transportModeList) {
if (getStringValue(rowData[12]).equals(sysDictDataVo.getDictLabel())) {
stockOutOrder.setContainerNo(sysDictDataVo.getDictValue());
break;
}
}
}
}
stockOutOrder.setDriverSign(getStringValue(rowData[16]));
break;
case 6: // 第7行:出仓日期、fax、运输方式、申报地关区
@@ -55,7 +77,19 @@ public class HeaderListener extends AnalysisEventListener<Map<Integer, Object>>
stockOutOrder.setOutboundDate(date);
}
stockOutOrder.setFax(getStringValue(rowData[5]));
stockOutOrder.setTransportModeName(getStringValue(rowData[12]));
if (ObjectUtil.isNotNull(getStringValue(rowData[12]))) {
stockOutOrder.setTransportModeName(getStringValue(rowData[12]));
AjaxResult transportMode = systemServiceFeign.selectListByDictType("transportMode");
if (ObjectUtil.isNotNull(transportMode) && transportMode.get("code").equals("200")) {
List<SysDictDataVo> transportModeList = JSON.parseArray(JSONObject.toJSONString(transportMode.get("data")), SysDictDataVo.class);
for (SysDictDataVo sysDictDataVo : transportModeList) {
if (getStringValue(rowData[12]).equals(sysDictDataVo.getDictLabel())) {
stockOutOrder.setTransportModeCode(sysDictDataVo.getDictValue());
break;
}
}
}
}
stockOutOrder.setDeclareCustoms(getStringValue(rowData[16]));
break;
case 7: // 第8行:生产商、客户名称、报关姓名及联系方式、完成时间
@@ -69,7 +103,19 @@ public class HeaderListener extends AnalysisEventListener<Map<Integer, Object>>
}
break;
case 8: // 第9行:监管方式、送货地址、海关是否查验货物、进出境关别
stockOutOrder.setSupervisionModeName(getStringValue(rowData[2]));
if (ObjectUtil.isNotNull(getStringValue(rowData[2]))) {
stockOutOrder.setSupervisionModeName(getStringValue(rowData[2]));
AjaxResult transportMode = systemServiceFeign.selectListByDictType("controlType");
if (ObjectUtil.isNotNull(transportMode) && transportMode.get("code").equals("200")) {
List<SysDictDataVo> transportModeList = JSON.parseArray(JSONObject.toJSONString(transportMode.get("data")), SysDictDataVo.class);
for (SysDictDataVo sysDictDataVo : transportModeList) {
if (getStringValue(rowData[2]).equals(sysDictDataVo.getDictLabel())) {
stockOutOrder.setSupervisionModeCode(sysDictDataVo.getDictValue());
break;
}
}
}
}
stockOutOrder.setDeliveryAddr(getStringValue(rowData[5]));
stockOutOrder.setCustomsInspectionFlag(getStringValue(rowData[12]));
stockOutOrder.setEntryExitCustoms(getStringValue(rowData[16]));
@@ -27,7 +27,11 @@ public class ItemListener extends AnalysisEventListener<Map<Integer, Object>> {
// 提取序号(第一列),过滤空行和标题行
String serialNoStr = getStringValue(rowData[0]);
String materialNo = getStringValue(rowData[1]);
String specificationModel = getStringValue(rowData[2]);
if (materialNo.isEmpty() && specificationModel.isEmpty()) {
return;
}
if (serialNoStr.isEmpty() || "序号".equals(serialNoStr) || !isSequenceNumber(serialNoStr)) {
return;
}
@@ -116,4 +116,4 @@ public class PickingOrderApi extends BaseController {
PickingOrderDO pickingOrderDO = pickingOrderAssembler.toDO(pickingOrderDTO);
return toAjax(pickingOrderApplicationService.completePicking(pickingOrderDO));
}
}
}
@@ -49,7 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
a.storage_section_id, a.storage_code, a.storage_name, a.storage_location_id, a.storage_location_code, a.storage_location_name, a.material_base_info_id,a.material_detail_id,
a.batch_number,a.material_status_code,a.material_status_name,a.container_id,a.container_code,a.container_type,a.container_type_name,IFNULL(a.freeze_quantity,0) freeze_quantity,a.is_able,
IFNULL(a.inventory_quantity,0) inventory_quantity, IFNULL(a.allocation_quantity,0) allocation_quantity, a.remark, a.create_time, a.create_by, a.create_by_name, a.update_time, a.update_by, a.update_by_name,
a.del_flag
a.del_flag,a.unit,a.area,a.NET_WEIGHT,a.GROSS_WEIGHT,a.VOLUME
</sql>
<sql id="selectMaterialInventoryPo1">