Commit c2162be0 by wangchunyang
parents b1240733 9e20d976
......@@ -74,7 +74,6 @@
align="center"
/>
<el-table-column type="index" label="序号" align="center"/>
<el-table-column label="物料ID" align="center" prop="id" />
<el-table-column label="SAP物料号" align="center" prop="sapNo" />
<el-table-column label="物料名称" align="center" prop="materialName" width="150"/>
<el-table-column label="TS Code" align="center" prop="tsCode" />
......
......@@ -83,7 +83,6 @@
<el-table-column prop="outboundOrderId" label="出库单号" width="150" />
<el-table-column prop="warehousesName" label="仓库名称" width="120" />
<el-table-column prop="locationName" label="库位名称" width="120" />
<el-table-column prop="locationId" label="库位ID" width="140" />
<el-table-column
prop="inventoryType"
label="库存类型"
......@@ -146,7 +145,7 @@
v-for="color in dict.type.label_color"
:key="color.value"
:label="color.label"
:value="color.value"
:value="Number(color.value)"
/>
</el-select>
</el-form-item>
......@@ -230,7 +229,6 @@
<el-table-column prop="batchId" label="批次ID" width="150" />
<el-table-column prop="warehousesName" label="仓库名称" width="120" />
<el-table-column prop="locationName" label="库位名称" width="120" />
<el-table-column prop="locationId" label="库位ID" width="140" />
<el-table-column prop="plannedQuantity" label="计划数量" width="100" />
<el-table-column prop="actualQuantity" label="实际数量" width="100" />
<el-table-column prop="unitPrice" label="单价" width="100" />
......
......@@ -158,12 +158,12 @@ public class OutboundOrdersController extends BaseController
@PreAuthorize("@ss.hasPermi('inventory:inbound:import')")
@Log(title = "入库信息导入", businessType = BusinessType.IMPORT)
@PostMapping("/import")
public AjaxResult importTemplate(MultipartFile file , boolean updateSupport) throws Exception
public AjaxResult importTemplate(MultipartFile file , boolean updateSupport,Integer orderType) throws Exception
{
ExcelUtil<OutboundTemplateVO> util = new ExcelUtil<OutboundTemplateVO>(OutboundTemplateVO.class);
List<OutboundTemplateVO> inboundOrders = util.importExcel(file.getInputStream());
String operName = getUsername();
String message = outboundOrdersService.importOutboundOrders(inboundOrders, updateSupport, operName);
String message = outboundOrdersService.importOutboundOrders(inboundOrders, updateSupport, operName,orderType);
return success(message);
}
}
......@@ -125,7 +125,13 @@ public class Inventory extends BaseEntity
/** 预警类型 */
private String alertType;
public String getWarehousesId() {
return warehousesId;
}
public void setWarehousesId(String warehousesId) {
this.warehousesId = warehousesId;
}
/** 最低库存 */
private Long minStockLevel;
......
......@@ -68,7 +68,6 @@ public class InboundOutboundStatisticsVO extends BaseEntity {
/** 库位ID */
private String locationId;
/** 物料编码/ID查询 */
private String materialCode;
......
......@@ -3,6 +3,7 @@ package com.ruoyi.inventory.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
......@@ -15,6 +16,7 @@ import java.util.Date;
* @author ruoyi
* @date 2025-12-10
*/
@Data
public class OutboundOrdersSummaryVO extends BaseEntity
{
private static final long serialVersionUID = 1L;
......@@ -56,6 +58,9 @@ public class OutboundOrdersSummaryVO extends BaseEntity
@Excel(name = "包装重量")
private BigDecimal packageWeight;
private String itemStatus;
private String unitPrice;
/** 总重量 */
@Excel(name = "总重量")
private BigDecimal totalWeight;
......@@ -124,265 +129,10 @@ public class OutboundOrdersSummaryVO extends BaseEntity
@JsonFormat(pattern = "yyyy-MM-dd")
private Date endDate;
/** 订单状态(检索条件) */
@Excel(name = "订单状态 字典,检索条件")
private Long orderStatus;
/** 库位ID(检索条件) */
@Excel(name = "库位ID 检索条件")
private String locationId;
// ========== Getter & Setter 方法 ==========
public String getMaterialId() {
return materialId;
}
public void setMaterialId(String materialId) {
this.materialId = materialId;
}
public String getMaterialName() {
return materialName;
}
public void setMaterialName(String materialName) {
this.materialName = materialName;
}
public String getSapNo() {
return sapNo;
}
public void setSapNo(String sapNo) {
this.sapNo = sapNo;
}
public String getTsCode() {
return tsCode;
}
public void setTsCode(String tsCode) {
this.tsCode = tsCode;
}
public String getHazardId() {
return hazardId;
}
public void setHazardId(String hazardId) {
this.hazardId = hazardId;
}
public String getSpecification() {
return specification;
}
public void setSpecification(String specification) {
this.specification = specification;
}
public String getMaterialUnit() {
return materialUnit;
}
public void setMaterialUnit(String materialUnit) {
this.materialUnit = materialUnit;
}
public BigDecimal getUnitWeight() {
return unitWeight;
}
public void setUnitWeight(BigDecimal unitWeight) {
this.unitWeight = unitWeight;
}
public BigDecimal getPackageWeight() {
return packageWeight;
}
public void setPackageWeight(BigDecimal packageWeight) {
this.packageWeight = packageWeight;
}
public BigDecimal getTotalWeight() {
return totalWeight;
}
public void setTotalWeight(BigDecimal totalWeight) {
this.totalWeight = totalWeight;
}
public BigDecimal getVolume() {
return volume;
}
public void setVolume(BigDecimal volume) {
this.volume = volume;
}
public Long getShelfLifeDays() {
return shelfLifeDays;
}
public void setShelfLifeDays(Long shelfLifeDays) {
this.shelfLifeDays = shelfLifeDays;
}
public String getStorageTemperature() {
return storageTemperature;
}
public void setStorageTemperature(String storageTemperature) {
this.storageTemperature = storageTemperature;
}
public String getSpecialRequirements() {
return specialRequirements;
}
public void setSpecialRequirements(String specialRequirements) {
this.specialRequirements = specialRequirements;
}
public Long getSortNo() {
return sortNo;
}
public void setSortNo(Long sortNo) {
this.sortNo = sortNo;
}
private String locationName;
public BigDecimal getPlannedQuantity() {
return plannedQuantity;
}
public void setPlannedQuantity(BigDecimal plannedQuantity) {
this.plannedQuantity = plannedQuantity;
}
public BigDecimal getActualQuantity() {
return actualQuantity;
}
public void setActualQuantity(BigDecimal actualQuantity) {
this.actualQuantity = actualQuantity;
}
public BigDecimal getTotalAmount() {
return totalAmount;
}
public void setTotalAmount(BigDecimal totalAmount) {
this.totalAmount = totalAmount;
}
public String getWarehouseId() {
return warehouseId;
}
public void setWarehouseId(String warehouseId) {
this.warehouseId = warehouseId;
}
public String getWarehouseName() {
return warehouseName;
}
public void setWarehouseName(String warehouseName) {
this.warehouseName = warehouseName;
}
public String getBatchCode() {
return batchCode;
}
public void setBatchCode(String batchCode) {
this.batchCode = batchCode;
}
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public String getMainOrderId() {
return mainOrderId;
}
public void setMainOrderId(String mainOrderId) {
this.mainOrderId = mainOrderId;
}
public Date getStartDate() {
return startDate;
}
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
public Date getEndDate() {
return endDate;
}
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
public Long getOrderStatus() {
return orderStatus;
}
public void setOrderStatus(Long orderStatus) {
this.orderStatus = orderStatus;
}
public String getLocationId() {
return locationId;
}
public void setLocationId(String locationId) {
this.locationId = locationId;
}
// ========== ToString 方法 ==========
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("materialId", getMaterialId())
.append("materialName", getMaterialName())
.append("sapNo", getSapNo())
.append("tsCode", getTsCode())
.append("hazardId", getHazardId())
.append("specification", getSpecification())
.append("materialUnit", getMaterialUnit())
.append("unitWeight", getUnitWeight())
.append("packageWeight", getPackageWeight())
.append("totalWeight", getTotalWeight())
.append("volume", getVolume())
.append("shelfLifeDays", getShelfLifeDays())
.append("storageTemperature", getStorageTemperature())
.append("specialRequirements", getSpecialRequirements())
.append("sortNo", getSortNo())
.append("plannedQuantity", getPlannedQuantity())
.append("actualQuantity", getActualQuantity())
.append("totalAmount", getTotalAmount())
.append("warehouseId", getWarehouseId())
.append("warehouseName", getWarehouseName())
.append("batchCode", getBatchCode())
.append("orderId", getOrderId())
.append("mainOrderId", getMainOrderId())
.append("startDate", getStartDate())
.append("endDate", getEndDate())
.append("orderStatus", getOrderStatus())
.append("locationId", getLocationId())
.append("remark", getRemark())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.toString();
}
}
\ No newline at end of file
......@@ -46,6 +46,6 @@ public class StorageLocationsLocationTemplateVO {
@Excel(name = "允许混放产品",dictType="yorn")
private String allowMixedProducts;
@Excel(name = "允许混放批次")
@Excel(name = "允许混放批次",dictType="yorn")
private String allowMixedBatches;
}
\ No newline at end of file
......@@ -78,5 +78,5 @@ public interface IOutboundOrdersService
public String outboundOrdersCount();
@Transactional(rollbackFor = Exception.class)
String importOutboundOrders(List<OutboundTemplateVO> inboundOrdersList, Boolean isUpdateSupport, String operName);
String importOutboundOrders(List<OutboundTemplateVO> inboundOrdersList, Boolean isUpdateSupport, String operName,Integer orderType);
}
......@@ -252,7 +252,7 @@ public class OutboundOrdersServiceImpl implements IOutboundOrdersService
@Transactional(rollbackFor = Exception.class)
@Override
public String importOutboundOrders(List<OutboundTemplateVO> inboundOrdersList, Boolean isUpdateSupport, String operName) {
public String importOutboundOrders(List<OutboundTemplateVO> inboundOrdersList, Boolean isUpdateSupport, String operName,Integer orderType) {
// 1. 基础空值校验(完全保留你的代码)
if (CollectionUtils.isEmpty(inboundOrdersList)) {
throw new ServiceException("导入数据不能为空!");
......@@ -348,6 +348,7 @@ public class OutboundOrdersServiceImpl implements IOutboundOrdersService
mainDO.setOrderStatus(3L);
mainDO.setCreateBy(operId);
mainDO.setCreateTime(now);
mainDO.setOrderType(Long.valueOf(orderType));
mainDO.setCreateUserCode(operId);
mainDO.setUpdateBy(operId);
mainDO.setUpdateTime(now);
......
......@@ -270,6 +270,7 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
storageLocations.setCreateBy(operId);
storageLocations.setCreateTime(now);
storageLocations.setCreateUserCode(operId);
storageLocations.setWarehousesId("572ba484-199c-45d9-9735-610928ed5c70");
// 设置默认值
if (storageLocations.getIsUsed() == null) {
......
......@@ -42,6 +42,12 @@
<result property="materialName" column="material_name" />
<result property="sapNo" column="sap_no" />
<result property="tsCode" column="ts_code" />
<result property="locationId" column="location_id" />
<result property="locationName" column="location_name" />
<result property="itemStatus" column="item_status" />
<result property="unitPrice" column="unit_price" />
<result property="hazardId" column="hazard_id" />
<result property="specification" column="specification" />
<result property="materialUnit" column="material_unit" />
......@@ -244,6 +250,8 @@
m.total_weight,
m.volume,
m.shelf_life_days,
oi.location_id,
sl.location_name as location_name,
m.storage_temperature,
m.special_requirements,
m.sort_no,
......@@ -254,7 +262,10 @@
w.warehouses_name as warehouse_name,
oi.batch_code,
oi.order_id,
o.order_id as main_order_id
oi.remark,
oi.unit_price,
o.order_id as main_order_id,
oi.item_status
from outbound_order_items oi
left join outbound_orders o on oi.outbound_order_id = o.id
left join materials m on oi.material_id = m.id
......@@ -269,7 +280,7 @@
<if test="endDate != null and endDate != ''"> and date_format(COALESCE(oi.shipped_at, o.inbound_date),'%Y-%m-%d') &lt;= #{endDate}</if>
<if test="warehouseId != null and warehouseId != ''"> and oi.warehouse_id = #{warehouseId}</if>
<if test="locationId != null and locationId != ''"> and oi.location_id = #{locationId}</if>
<if test="orderStatus != null "> and o.order_status = #{orderStatus}</if>
<if test="itemStatus != null "> and oi.item_status = #{itemStatus}</if>
</where>
group by oi.material_id, m.material_name, m.sap_no,
m.ts_code,
......
......@@ -108,6 +108,8 @@
<if test="pickingArea != null and pickingArea != ''"> and sl.picking_area = #{pickingArea}</if>
<if test="allowMixedProducts != null "> and sl.allow_mixed_products = #{allowMixedProducts}</if>
<if test="allowMixedBatches != null "> and sl.allow_mixed_batches = #{allowMixedBatches}</if>
<!-- 按sort_no降序排序 -->
order by sl.sort_no desc
</select>
<!-- 关联仓库表的列表查询(简化) -->
......@@ -129,6 +131,8 @@
<if test="pickingArea != null and pickingArea != ''"> and sl.picking_area = #{pickingArea}</if>
<if test="allowMixedProducts != null "> and sl.allow_mixed_products = #{allowMixedProducts}</if>
<if test="allowMixedBatches != null "> and sl.allow_mixed_batches = #{allowMixedBatches}</if>
<!-- 按sort_no降序排序 -->
order by sl.sort_no desc
</select>
<!-- 根据ID查询(调整:保留where,单独条件) -->
......@@ -156,7 +160,7 @@
where sl.is_used = 1
and sl.location_name = #{locationName}
and sl.warehouses_id = #{warehouseId}
limit 1
limit 1
</select>
<!-- 关联仓库表的ID查询 -->
......@@ -180,12 +184,16 @@
<select id="selectStorageLocationsByWarehousesCode" parameterType="String" resultMap="StorageLocationsResult">
<include refid="selectStorageLocationsVo"/>
and sl.warehouses_code = #{warehousesCode}
<!-- 按sort_no降序排序 -->
order by sl.sort_no desc
</select>
<!-- 关联仓库表的仓库编码查询(简化) -->
<select id="selectStorageLocationsByWarehousesCodeWithWarehouses" parameterType="String" resultMap="StorageLocationsWithWarehousesResult">
<include refid="selectStorageLocationsWithWarehousesVo"/>
and sl.warehouses_code = #{warehousesCode}
<!-- 按sort_no降序排序 -->
order by sl.sort_no desc
</select>
<!-- 根据仓库编码列表查询(简化) -->
......@@ -195,6 +203,8 @@
<foreach item="id" collection="list" open="(" separator="," close=")">
#{id}
</foreach>
<!-- 按sort_no降序排序 -->
order by sl.sort_no desc
</select>
<!-- 关联仓库表的编码列表查询(简化) -->
......@@ -204,12 +214,16 @@
<foreach item="id" collection="list" open="(" separator="," close=")">
#{id}
</foreach>
<!-- 按sort_no降序排序 -->
order by sl.sort_no desc
</select>
<!-- 获取库位表 的 location_code 编码 location_name 做成字典-->
<select id="getMapList" parameterType="StorageLocations" resultType="java.util.Map">
select id, IFNULL(location_name, '') as location_name from storage_locations where is_used = 1
<if test="warehousesCode != null and warehousesCode != ''"> and warehouses_id = #{warehousesCode}</if>
<!-- 按sort_no降序排序 -->
order by sort_no desc
</select>
<!-- 关联仓库的字典查询 -->
......@@ -219,6 +233,8 @@
left join warehouses w on sl.warehouses_code = w.warehouses_code
where sl.is_used = 1
<if test="warehousesCode != null and warehousesCode != ''"> and sl.warehouses_code = #{warehousesCode}</if>
<!-- 按sort_no降序排序 -->
order by sl.sort_no desc
</select>
<!-- 原有新增/更新/删除方法(仅添加新字段) -->
......@@ -393,6 +409,8 @@
<if test="pickingArea != null and pickingArea != ''"> and sl.picking_area = #{pickingArea}</if>
<if test="allowMixedProducts != null "> and sl.allow_mixed_products = #{allowMixedProducts}</if>
<if test="allowMixedBatches != null "> and sl.allow_mixed_batches = #{allowMixedBatches}</if>
<!-- 按sort_no降序排序 -->
order by sl.sort_no desc
</select>
<!-- 关联仓库的getStorageLocationsList -->
......@@ -414,6 +432,8 @@
<if test="pickingArea != null and pickingArea != ''"> and sl.picking_area = #{pickingArea}</if>
<if test="allowMixedProducts != null "> and sl.allow_mixed_products = #{allowMixedProducts}</if>
<if test="allowMixedBatches != null "> and sl.allow_mixed_batches = #{allowMixedBatches}</if>
<!-- 按sort_no降序排序 -->
order by sl.sort_no desc
</select>
</mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论