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" />
......
......@@ -74,10 +74,10 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="库类型" prop="orderTypeId">
<el-form-item label="库类型" prop="orderTypeId">
<el-input
v-model="queryParams.orderTypeId"
placeholder="请输入库类型"
placeholder="请输入库类型"
clearable
@keyup.enter.native="handleQuery"
/>
......@@ -192,7 +192,7 @@
<el-table-column type="selection" width="55" align="center" fixed />
<el-table-column label="出库单号" align="center" prop="orderId" width="150" fixed/>
<el-table-column label="系统编号" align="center" prop="systemNo" width="150" />
<el-table-column label="库类型" align="center" prop="orderTypeId" width="120">
<el-table-column label="库类型" align="center" prop="orderTypeId" width="120">
<template slot-scope="scope">
<dict-tag v-if="dict.type.outbound_order_type" :options="dict.type.outbound_order_type" :value="scope.row.orderTypeId"/>
<span v-else>-</span>
......@@ -201,7 +201,7 @@
<!-- 新增:订单类型列 -->
<el-table-column label="订单类型" align="center" prop="orderType" width="120">
<template slot-scope="scope">
<dict-tag v-if="dict.type.outbound_order_type" :options="dict.type.outbound_order_type" :value="scope.row.orderType"/>
<dict-tag v-if="dict.type.order_type" :options="dict.type.order_type" :value="scope.row.orderType"/>
<span v-else>-</span>
</template>
</el-table-column>
......@@ -299,7 +299,7 @@
<el-form-item label="入库类型" prop="orderTypeId">
<el-select v-model="form.orderTypeId" placeholder="请选择入库类型" :disabled="isViewDetail || formDisabled.orderTypeId" style="width: 100%">
<el-option
v-for="item in dict.type.inbound_order_type"
v-for="item in dict.type.outbound_order_type"
:key="item.value"
:label="item.label"
:value="item.value"
......@@ -314,7 +314,7 @@
<el-form-item label="订单类型" prop="orderType">
<el-select v-model="form.orderType" placeholder="请选择订单类型" :disabled="isViewDetail || formDisabled.orderType" style="width: 100%">
<el-option
v-for="item in dict.type.outbound_order_type"
v-for="item in dict.type.order_type"
:key="item.value"
:label="item.label"
:value="item.value"
......@@ -518,9 +518,12 @@
ref="import"
title="导入"
import-url="/inventory/orders/import"
template-url="inventory/orders/importTemplate"
template-name="owners_importTemplate"
template-url="/inventory/orders/importTemplate"
template-name="入库单导入模板"
@success="getList"
:show-trdc-checkbox="true"
@orderTypeChange="handleOrderTypeChange"
:orderTypeRequired="true"
/>
</div>
</template>
......@@ -534,10 +537,11 @@ import WarehouseSelector from "@/views/compononents/WarehouseSelector.vue"
import LocationSelector from "@/views/compononents/LocationSelector.vue"
import OwnerSelector from "@/views/compononents/OwnerSelector.vue"
import PageTitle from "@/components/PageTitle"
import ImportExcel from "@/components/ImportExcel/index"
export default {
name: "Orders",
dicts: ['outbound_order_type', 'inbound_order_type', 'inbound_order_status', 'label_color'],
dicts: ['outbound_order_type', 'inbound_order_type', 'inbound_order_status', 'label_color','order_type'],
components: {
OutboundOrderFormWithItems,
WarehouseSelector,
......@@ -677,6 +681,9 @@ export default {
},
methods: {
handleOrderTypeChange(selection) {
this.form.orderTypeId = selection
},
/** 打开导入弹窗 */
handleImport() {
this.$refs.import.show()
......@@ -934,8 +941,7 @@ handleOwnerSelected(owner) {
this.detailDialogOpen = true
})
},
// 修复:接收子组件提交的明细数据
handleDetailSubmit(details) {
handleDetailSubmit(details) {
// 确保是数组格式
const detailList = Array.isArray(details) ? details : [details];
if (detailList.length === 0) {
......@@ -983,7 +989,8 @@ handleOwnerSelected(owner) {
sortNo: 0,
remark: item.remark || '',
warehouseName: item.warehouseName || this.form.warehouseName || '',
locationName: item.locationName || ''
locationName: item.locationName || '',
batchCode: item.batchId || '' // 新增:将子组件的batchId赋值给batchCode
};
});
......@@ -1019,7 +1026,8 @@ handleOwnerSelected(owner) {
sortNo: 0,
remark: item.remark || '',
warehouseName: item.warehouseName || this.form.warehouseName || '',
locationName: item.locationName || ''
locationName: item.locationName || '',
batchCode: item.batchId || '' // 新增:将子组件的batchId赋值给batchCode
};
});
......@@ -1042,7 +1050,7 @@ handleOwnerSelected(owner) {
this.detailDialogOpen = false;
// 强制更新视图
this.$forceUpdate();
},
},
// 计算主表总数量和总金额
calcTotalQuantity() {
let totalPlanned = 0
......
......@@ -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) {
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.inventory.mapper.InventoryMapper">
<resultMap type="Inventory" id="InventoryResult">
......@@ -44,7 +44,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="unitWeight" column="unit_weight" />
<result property="packageWeight" column="package_weight" />
<result property="totalWeight" column="total_weight" />
<result property="volume" column="volume" />
<result property="shelfLifeDays" column="shelf_life_days" />
<result property="storageTemperature" column="storage_temperature" />
<result property="specialRequirements" column="special_requirements" />
......@@ -89,6 +88,52 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="unitPrice" column="unit_price" />
</resultMap>
<resultMap type="com.ruoyi.inventory.domain.vo.InventoryVo" id="InventoryVoResult">
<result property="id" column="id" />
<result property="inventoryType" column="inventory_type" />
<result property="orderId" column="order_id" />
<result property="materialId" column="material_id" />
<result property="batchId" column="batch_id" />
<result property="warehousesCode" column="warehouses_code" />
<result property="locationId" column="location_id" />
<result property="ownerId" column="owner_id" />
<result property="quantity" column="quantity" />
<result property="lockedQuantity" column="locked_quantity" />
<result property="unitWeight" column="unit_weight" />
<result property="totalWeight" column="total_weight" />
<result property="totalVolume" column="total_volume" />
<result property="productionDate" column="production_date" />
<result property="expirationDate" column="expiration_date" />
<result property="inventoryStatus" column="inventory_status" />
<result property="lastInboundTime" column="last_inbound_time" />
<result property="lastOutboundTime" column="last_outbound_time" />
<result property="isUsed" column="is_used" />
<result property="sortNo" column="sort_no" />
<result property="createTime" column="create_time" />
<result property="createUserCode" column="create_user_code" />
<result property="updateTime" column="update_time" />
<result property="updateUserCode" column="update_user_code" />
<result property="warehousesId" column="warehouses_id" />
<result property="materialName" column="material_name" />
<result property="minStockLevel" column="min_stock_level" jdbcType="BIGINT"/>
<result property="maxStockLevel" column="max_stock_level" jdbcType="BIGINT"/>
<result property="sapNo" column="sap_no" />
<result property="tsCode" column="ts_code" />
<result property="hazardId" column="hazard_id" />
<result property="specification" column="specification" />
<result property="materialUnit" column="material_unit" />
<result property="unitWeight" column="unit_weight" />
<result property="packageWeight" column="package_weight" />
<result property="totalWeight" column="total_weight" />
<result property="shelfLifeDays" column="shelf_life_days" />
<result property="storageTemperature" column="storage_temperature" />
<result property="specialRequirements" column="special_requirements" />
<result property="alterType" column="alterType" />
<result property="warehousesName" column="warehouses_name" />
<result property="locationName" column="location_name" />
<result property="ownerName" column="owner_name" />
</resultMap>
<resultMap type="com.ruoyi.inventory.domain.vo.InventorySummaryVO" id="InventorySummaryResult">
<result property="materialId" column="material_id" />
<result property="materialName" column="material_name" />
......@@ -102,7 +147,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="unitWeight" column="unit_weight" />
<result property="packageWeight" column="package_weight" />
<result property="totalWeight" column="total_weight" />
<result property="volume" column="volume" />
<result property="shelfLifeDays" column="shelf_life_days" />
<result property="storageTemperature" column="storage_temperature" />
<result property="specialRequirements" column="special_requirements" />
......@@ -157,7 +201,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
m.unit_weight,
m.package_weight,
m.total_weight,
m.volume,
m.shelf_life_days,
m.storage_temperature,
m.special_requirements,
......@@ -193,7 +236,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
m.unit_weight,
m.package_weight,
m.total_weight,
m.volume,
m.shelf_life_days,
m.storage_temperature,
m.special_requirements ) tab
......@@ -218,7 +260,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inventoryStatus != null "> and i.inventory_status = #{inventoryStatus}</if>
<if test="isUsed != null "> and i.is_used = #{isUsed}</if>
</where>
i.material_id, m.material_name, m.sap_no,
group by i.material_id, m.material_name, m.sap_no,
m.ts_code,
m.hazard_id,
m.specification,
......@@ -226,7 +268,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
m.unit_weight,
m.package_weight,
m.total_weight,
m.volume,
m.shelf_life_days,
m.storage_temperature,
m.special_requirements) tab
......@@ -268,7 +309,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
m.unit_weight,
m.package_weight,
m.total_weight,
m.volume,
m.shelf_life_days,
m.storage_temperature,
m.special_requirements,
......@@ -535,7 +575,7 @@ and inventory_status = '1'
#{id}
</foreach>
</delete>
<!-- 库存物料超出预警值统计-->
<!-- 库存物料超出预警值统计-->
<resultMap id="InventoryExceedWarnResultMap" type="com.ruoyi.inventory.domain.vo.InventoryExceedWarnVO">
<result column="material_name" property="materialName" jdbcType="VARCHAR"/>
<result column="category_name" property="categoryName" jdbcType="VARCHAR"/>
......
......@@ -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,单独条件) -->
......@@ -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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论