Commit 37ede93e by yubin

出库

parent c37e3e25
...@@ -50,3 +50,22 @@ export function delItems(id) { ...@@ -50,3 +50,22 @@ export function delItems(id) {
method: 'delete' method: 'delete'
}) })
} }
// 查询出入库统计列表
export function listInboundOutboundStatistics(query) {
return request({
url: '/inventory/items/getStatistics',
method: 'get',
params: query
})
}
// 导出出入库统计数据
export function exportInboundOutboundStatistics(query) {
return request({
url: '/inventory/items/inboundOutbound/export',
method: 'post',
params: query
})
}
...@@ -58,4 +58,18 @@ export function ship(data) { ...@@ -58,4 +58,18 @@ export function ship(data) {
method: 'post', method: 'post',
data: data data: data
}) })
}
export function outboundOrdersTopTenByQuantity() {
return request({
url: '/inventory/orders/outboundOrdersTopTenByQuantity',
method: 'post'
})
}
export function outboundOrdersTopTenByAmount() {
return request({
url: '/inventory/orders/outboundOrdersTopTenByAmount',
method: 'post'
})
} }
\ No newline at end of file
...@@ -191,7 +191,7 @@ ...@@ -191,7 +191,7 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20" style="margin-top: 10px;"> <el-row :gutter="20" style="margin-top: 10px;">
<el-col :span="8"> <!-- <el-col :span="8">
<el-form-item label="发货时间" prop="shippedAt"> <el-form-item label="发货时间" prop="shippedAt">
<el-date-picker <el-date-picker
v-model="currentSelectedRow.shippedAt" v-model="currentSelectedRow.shippedAt"
...@@ -201,7 +201,7 @@ ...@@ -201,7 +201,7 @@
@input="syncDetails(false)" @input="syncDetails(false)"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col> -->
<el-col :span="16"> <el-col :span="16">
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input <el-input
...@@ -232,7 +232,7 @@ ...@@ -232,7 +232,7 @@
> >
<el-table-column prop="inventoryId" label="库存ID" width="100" /> <el-table-column prop="inventoryId" label="库存ID" width="100" />
<el-table-column prop="batchId" label="批次ID" /> <el-table-column prop="batchId" label="批次ID" />
<el-table-column prop="warehouseId" label="仓库ID" /> <!-- <el-table-column prop="warehouseId" label="仓库ID" /> -->
<el-table-column prop="locationId" label="库位ID" /> <el-table-column prop="locationId" label="库位ID" />
<el-table-column prop="plannedQuantity" label="计划数量" /> <el-table-column prop="plannedQuantity" label="计划数量" />
<el-table-column prop="actualQuantity" label="实际数量" /> <el-table-column prop="actualQuantity" label="实际数量" />
...@@ -245,7 +245,7 @@ ...@@ -245,7 +245,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="voucherNumber" label="凭证号" /> <el-table-column prop="voucherNumber" label="凭证号" />
<el-table-column prop="shippedBy" label="发货方" /> <el-table-column prop="shippedBy" label="发货方" />
<el-table-column prop="shippedAt" label="发货时间" /> <!-- <el-table-column prop="shippedAt" label="发货时间" /> -->
<el-table-column prop="remark" label="备注" /> <el-table-column prop="remark" label="备注" />
<el-table-column label="操作" width="80"> <el-table-column label="操作" width="80">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -517,67 +517,58 @@ export default { ...@@ -517,67 +517,58 @@ export default {
}); });
} }
}, },
initEchoDetails() { initEchoDetails() {
console.log('【开始回显】inventoryList=', this.inventoryList, 'initDetails=', this.initDetails); console.log('【开始回显】inventoryList=', this.inventoryList, 'initDetails=', this.initDetails);
if (this.initDetails.length === 0 || this.inventoryList.length === 0) return; if (this.initDetails.length === 0 || this.inventoryList.length === 0) return;
// 清空原有数据 // 1. 先清空所有库存行的临时数据(避免残留)
this.inventoryList.forEach(row => { this.inventoryList.forEach(row => {
this.$set(row, 'actualQuantity', null); this.$set(row, 'actualQuantity', null);
this.$set(row, 'plannedQuantity', null); this.$set(row, 'plannedQuantity', null);
this.$set(row, 'divisor', null); this.$set(row, 'divisor', null);
this.$set(row, 'labelColor', ''); this.$set(row, 'labelColor', '');
this.$set(row, 'unitPrice', null); this.$set(row, 'unitPrice', null);
this.$set(row, 'shippedBy', ''); this.$set(row, 'shippedBy', '');
this.$set(row, 'shippedAt', ''); this.$set(row, 'voucherNumber', '');
this.$set(row, 'voucherNumber', ''); this.$set(row, 'remark', '');
this.$set(row, 'remark', ''); });
});
// 方案1:优先用inventoryId匹配 // 2. 遍历所有initDetails明细项,逐个匹配库存行并回显
let targetRow = null; this.initDetails.forEach(detail => {
const firstDetail = this.initDetails[0]; let targetRow = null;
targetRow = this.inventoryList.find(row => row.inventoryId === firstDetail.inventoryId); // 方案1:优先用inventoryId精确匹配(最可靠)
targetRow = this.inventoryList.find(row => row.inventoryId === detail.inventoryId);
// 方案2:兜底用batchId+warehouseId+locationId匹配
if (!targetRow) { // 方案2:兜底用batchId+warehouseId+locationId组合匹配
console.log('【兜底匹配】使用batchId+warehouseId+locationId匹配,明细=', firstDetail); if (!targetRow) {
targetRow = this.inventoryList.find(row => targetRow = this.inventoryList.find(row =>
row.batchId === firstDetail.batchId && row.batchId === detail.batchId &&
row.warehouseId === firstDetail.warehouseId && row.warehouseId === detail.warehouseId &&
row.locationId === firstDetail.locationId row.locationId === detail.locationId
); );
} }
// 方案3:终极兜底(强制赋值到第一行 // 方案3:终极兜底(如果允许“无匹配则不回显”,可去掉这一步
if (!targetRow) { if (!targetRow) {
console.log('【强制回显】无匹配字段,直接赋值到第一条库存行'); console.warn('【匹配失败】明细无对应库存行,detail.inventoryId=', detail.inventoryId);
targetRow = this.inventoryList[0]; return; // 跳过当前明细的回显
} }
console.log('【匹配明细】detail.inventoryId=', firstDetail.inventoryId, '匹配到的行=', targetRow); // 3. 给匹配到的库存行赋值回显数据
if (targetRow) { this.$set(targetRow, 'actualQuantity', detail.actualQuantity ?? null);
// 回显赋值(所有字段) this.$set(targetRow, 'plannedQuantity', detail.plannedQuantity ?? null);
this.$set(targetRow, 'actualQuantity', firstDetail.actualQuantity ?? null); this.$set(targetRow, 'divisor', detail.divisor ?? null);
this.$set(targetRow, 'plannedQuantity', firstDetail.plannedQuantity ?? null); this.$set(targetRow, 'labelColor', detail.labelColor ?? '');
this.$set(targetRow, 'divisor', firstDetail.divisor ?? null); this.$set(targetRow, 'unitPrice', detail.unitPrice ?? null);
this.$set(targetRow, 'labelColor', firstDetail.labelColor ?? ''); this.$set(targetRow, 'shippedBy', detail.shippedBy ?? '');
this.$set(targetRow, 'unitPrice', firstDetail.unitPrice ?? null); this.$set(targetRow, 'voucherNumber', detail.voucherNumber ?? '');
this.$set(targetRow, 'shippedBy', firstDetail.shippedBy ?? ''); this.$set(targetRow, 'remark', detail.remark ?? '');
this.$set(targetRow, 'shippedAt', firstDetail.shippedAt ?? ''); });
this.$set(targetRow, 'voucherNumber', firstDetail.voucherNumber ?? '');
this.$set(targetRow, 'remark', firstDetail.remark ?? '');
// 强制选中该行
this.currentSelectedRowId = targetRow.inventoryId;
} else {
console.warn('【匹配失败】无可用库存行进行回显');
}
// 同步明细数据 // 4. 同步明细数据(保持页面显示一致)
this.syncDetails(false); this.syncDetails(false);
console.log('【回显完成】inventoryList=', this.inventoryList); console.log('【回显完成】inventoryList=', this.inventoryList);
}, },
handleRowClick(row) { handleRowClick(row) {
if (!row) return; if (!row) return;
this.currentSelectedRowId = row.inventoryId; this.currentSelectedRowId = row.inventoryId;
...@@ -635,7 +626,7 @@ export default { ...@@ -635,7 +626,7 @@ export default {
row.labelColor !== '' || row.labelColor !== '' ||
row.unitPrice !== null || row.unitPrice !== null ||
row.shippedBy !== '' || row.shippedBy !== '' ||
row.shippedAt !== '' || // row.shippedAt !== '' ||
row.voucherNumber !== '' || row.voucherNumber !== '' ||
row.remark !== ''; row.remark !== '';
}); });
...@@ -655,7 +646,7 @@ export default { ...@@ -655,7 +646,7 @@ export default {
labelColor: row.labelColor, labelColor: row.labelColor,
unitPrice: row.unitPrice, unitPrice: row.unitPrice,
shippedBy: row.shippedBy, shippedBy: row.shippedBy,
shippedAt: row.shippedAt, // shippedAt: row.shippedAt,
voucherNumber: row.voucherNumber, voucherNumber: row.voucherNumber,
remark: row.remark remark: row.remark
}; };
...@@ -672,7 +663,7 @@ export default { ...@@ -672,7 +663,7 @@ export default {
this.$set(inventoryRow, 'labelColor', ''); this.$set(inventoryRow, 'labelColor', '');
this.$set(inventoryRow, 'unitPrice', null); this.$set(inventoryRow, 'unitPrice', null);
this.$set(inventoryRow, 'shippedBy', ''); this.$set(inventoryRow, 'shippedBy', '');
this.$set(inventoryRow, 'shippedAt', ''); // this.$set(inventoryRow, 'shippedAt', '');
this.$set(inventoryRow, 'voucherNumber', ''); this.$set(inventoryRow, 'voucherNumber', '');
this.$set(inventoryRow, 'remark', ''); this.$set(inventoryRow, 'remark', '');
if (this.currentSelectedRowId === row.inventoryId) { if (this.currentSelectedRowId === row.inventoryId) {
......
...@@ -170,19 +170,19 @@ ...@@ -170,19 +170,19 @@
<el-table-column label="系统编号" align="center" prop="systemNo" width="150" /> <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"> <template slot-scope="scope">
<dict-tag v-if="dict.type.inbound_order_type" :options="dict.type.inbound_order_type" :value="scope.row.orderTypeId"/> <dict-tag v-if="dict.type.outbound_order_type" :options="dict.type.outbound_order_type" :value="scope.row.orderTypeId"/>
<span v-else>-</span> <span v-else>-</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="批次ID" align="center" prop="batchCode" width="120" /> <el-table-column label="批次ID" align="center" prop="batchCode" width="120" />
<el-table-column label="仓库" align="center" prop="warehouseName" width="120"> <el-table-column label="仓库" align="center" prop="warehouseName" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.warehouseName || scope.row.warehouseId || '-' }} {{ scope.row.warehouseName || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="货主" align="center" prop="ownerName" width="120"> <el-table-column label="货主" align="center" prop="ownerName" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.ownerName || scope.row.ownerId || '-' }} {{ scope.row.ownerName || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="订单状态" align="center" prop="orderStatus" width="150"> <el-table-column label="订单状态" align="center" prop="orderStatus" width="150">
...@@ -477,7 +477,7 @@ import PageTitle from "@/components/PageTitle" ...@@ -477,7 +477,7 @@ import PageTitle from "@/components/PageTitle"
export default { export default {
name: "Orders", name: "Orders",
dicts: ['outbound_order_type', 'inbound_order_type', 'inbound_order_item_status', 'label_color'], dicts: ['outbound_order_type', 'inbound_order_type', 'inbound_order_status', 'label_color'],
components: { components: {
OutboundOrderFormWithItems, OutboundOrderFormWithItems,
WarehouseSelector, WarehouseSelector,
...@@ -1062,8 +1062,8 @@ handleOwnerSelected(owner) { ...@@ -1062,8 +1062,8 @@ handleOwnerSelected(owner) {
...item, ...item,
// 注意:这里orderId显示的是后端的outboundOrderId(即用户填写的出货单号) // 注意:这里orderId显示的是后端的outboundOrderId(即用户填写的出货单号)
orderId: item.outboundOrderId || item.orderId, orderId: item.outboundOrderId || item.orderId,
warehouseName: item.warehouseName || item.warehouseId, warehouseName: item.warehouseName,
ownerName: item.ownerName || item.ownerId ownerName: item.ownerName
})) }))
this.total = response.total || 0 this.total = response.total || 0
this.loading = false this.loading = false
......
package com.ruoyi.inventory.controller; package com.ruoyi.inventory.controller;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.UUID; import java.util.UUID;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.ruoyi.inventory.domain.OutboundOrderItems;
import com.ruoyi.inventory.domain.vo.InventoryExceedWarnVO; import com.ruoyi.inventory.domain.vo.InventoryExceedWarnVO;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -73,7 +75,7 @@ public class InventoryController extends BaseController ...@@ -73,7 +75,7 @@ public class InventoryController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('inventory:inventory:list')") @PreAuthorize("@ss.hasPermi('inventory:inventory:list')")
@PostMapping("/listByMaterialId") @PostMapping("/listByMaterialId")
public TableDataInfo listByMaterialId(@RequestBody Inventory inventory) public TableDataInfo listByMaterialId(@RequestBody OutboundOrderItems inventory)
{ {
startPage(); startPage();
List<Inventory> list = inventoryService.listByMatreialId(inventory); List<Inventory> list = inventoryService.listByMatreialId(inventory);
...@@ -178,4 +180,26 @@ public class InventoryController extends BaseController ...@@ -178,4 +180,26 @@ public class InventoryController extends BaseController
List<InventoryExceedWarnVO> list = inventoryService.selectInventoryExceedWarnList(); List<InventoryExceedWarnVO> list = inventoryService.selectInventoryExceedWarnList();
return getDataTable(list); return getDataTable(list);
} }
/**
* 本月库存物料top10库存
*/
@PostMapping("/inventoryTopTenByAmount")
public TableDataInfo inventoryTopTenByAmount()
{
startPage();
List<Map<String,String>> list = inventoryService.inventoryTopTenByAmount();
return getDataTable(list);
}
/**
* 本月库存物料top10金额
*/
@PostMapping("/inventoryTopTenByQuantity")
public TableDataInfo inventoryTopTenByQuantity()
{
startPage();
List<Map<String,String>> list = inventoryService.inventoryTopTenByQuantity();
return getDataTable(list);
}
} }
...@@ -3,7 +3,9 @@ package com.ruoyi.inventory.controller; ...@@ -3,7 +3,9 @@ package com.ruoyi.inventory.controller;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.ruoyi.inventory.domain.TO.OutboundOrderItemsStatisticsVO; import com.ruoyi.inventory.domain.vo.InboundTemplateVO;
import com.ruoyi.inventory.domain.vo.OutboundOrdersSummaryVO;
import com.ruoyi.inventory.domain.vo.OutboundTemplateVO;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -23,6 +25,7 @@ import com.ruoyi.inventory.domain.OutboundOrderItems; ...@@ -23,6 +25,7 @@ import com.ruoyi.inventory.domain.OutboundOrderItems;
import com.ruoyi.inventory.service.IOutboundOrderItemsService; import com.ruoyi.inventory.service.IOutboundOrderItemsService;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;
/** /**
* 出库单明细Controller * 出库单明细Controller
...@@ -53,7 +56,7 @@ public class OutboundOrderItemsController extends BaseController ...@@ -53,7 +56,7 @@ public class OutboundOrderItemsController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('inventory:items:list')") @PreAuthorize("@ss.hasPermi('inventory:items:list')")
@GetMapping("/getStatistics") @GetMapping("/getStatistics")
public TableDataInfo getStatistics(OutboundOrderItemsStatisticsVO outboundOrderItems) public TableDataInfo getStatistics(OutboundOrdersSummaryVO outboundOrderItems)
{ {
startPage(); startPage();
List<OutboundOrderItems> list = outboundOrderItemsService.selectOutboundOrderItemsStatistics(outboundOrderItems); List<OutboundOrderItems> list = outboundOrderItemsService.selectOutboundOrderItemsStatistics(outboundOrderItems);
...@@ -134,4 +137,30 @@ public class OutboundOrderItemsController extends BaseController ...@@ -134,4 +137,30 @@ public class OutboundOrderItemsController extends BaseController
{ {
return toAjax(outboundOrderItemsService.deleteOutboundOrderItemsByIds(ids)); return toAjax(outboundOrderItemsService.deleteOutboundOrderItemsByIds(ids));
} }
/**
* 下载入库单导入模板
*/
@PreAuthorize("@ss.hasPermi('inventory:inbound:importTemplate')")
@Log(title = "入库导入模板", businessType = BusinessType.IMPORT)
@PostMapping("/importTemplate")
public void importTemplate(HttpServletResponse response)
{
ExcelUtil<InboundTemplateVO> util = new ExcelUtil<InboundTemplateVO>(InboundTemplateVO.class);
util.importTemplateExcel(response, "入库单及入库物料明细信息");
}
/**
* 导入入库单物料明细
*/
@PreAuthorize("@ss.hasPermi('inventory:inbound:import')")
@Log(title = "入库信息导入", businessType = BusinessType.IMPORT)
@PostMapping("/import")
public AjaxResult importTemplate(MultipartFile file , boolean updateSupport) throws Exception
{
ExcelUtil<OutboundTemplateVO> util = new ExcelUtil<OutboundTemplateVO>(OutboundTemplateVO.class);
List<OutboundTemplateVO> inboundOrders = util.importExcel(file.getInputStream());
String operName = getUsername();
String message = outboundOrderItemsService.importOutoundOrders(inboundOrders, updateSupport, operName);
return success(message);
}
} }
package com.ruoyi.inventory.controller; package com.ruoyi.inventory.controller;
import java.util.List; import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.ruoyi.inventory.domain.Inventory; import com.ruoyi.inventory.domain.Inventory;
...@@ -110,8 +111,30 @@ public class OutboundOrdersController extends BaseController ...@@ -110,8 +111,30 @@ public class OutboundOrdersController extends BaseController
@PreAuthorize("@ss.hasPermi('inventory:orders:remove')") @PreAuthorize("@ss.hasPermi('inventory:orders:remove')")
@Log(title = "出库单主", businessType = BusinessType.DELETE) @Log(title = "出库单主", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids) public AjaxResult remove(@PathVariable String[] ids) {
{
return toAjax(outboundOrdersService.deleteOutboundOrdersByIds(ids)); return toAjax(outboundOrdersService.deleteOutboundOrdersByIds(ids));
} }
@PreAuthorize("@ss.hasPermi('inventory:orders:query')")
@PostMapping("/outboundOrdersTopTenByQuantity")
public TableDataInfo outboundOrdersTopTenByQuantity(){
List<Map<String,String>> resultMap = outboundOrdersService.outboundOrdersTopTenByQuantity();
return getDataTable( resultMap);
}
@PreAuthorize("@ss.hasPermi('inventory:orders:query')")
@PostMapping("/outboundOrdersTopTenByAmount")
public TableDataInfo outboundOrdersTopTenByAmount(){
List<Map<String,String>> resultMap = outboundOrdersService.outboundOrdersTopTenByAmount();
return getDataTable(resultMap);
}
@PreAuthorize("@ss.hasPermi('inventory:orders:query')")
@PostMapping("/outboundOrdersCount")
public AjaxResult outboundOrdersCount(){
String resultMap = outboundOrdersService.outboundOrdersCount();
return AjaxResult.success(resultMap);
}
} }
...@@ -33,10 +33,12 @@ public class OutboundOrderLog extends BaseEntity ...@@ -33,10 +33,12 @@ public class OutboundOrderLog extends BaseEntity
@Excel(name = "仓库ID") @Excel(name = "仓库ID")
private String warehouseId; private String warehouseId;
/** 批次ID */ /** 批次ID */
@Excel(name = "批次ID") @Excel(name = "批次ID")
private String batchCode; private String batchCode;
/** 实际入库数量 */ /** 实际入库数量 */
@Excel(name = "实际入库数量") @Excel(name = "实际入库数量")
private Long actualQuantity; private Long actualQuantity;
......
...@@ -10,7 +10,7 @@ import com.ruoyi.common.core.domain.BaseEntity; ...@@ -10,7 +10,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
/** /**
* 出库单主对象 outbound_orders * 出库单主对象 outbound_orders
* *
* @author ruoyi * @author ruoyi
* @date 2025-12-03 * @date 2025-12-03
*/ */
...@@ -41,10 +41,18 @@ public class OutboundOrders extends BaseEntity ...@@ -41,10 +41,18 @@ public class OutboundOrders extends BaseEntity
@Excel(name = "仓库ID 暂无用") @Excel(name = "仓库ID 暂无用")
private String warehouseId; private String warehouseId;
/** 仓库名称 暂无用 */
@Excel(name = "仓库ID 暂无用")
private String warehouseName;
/** 货主ID */ /** 货主ID */
@Excel(name = "货主ID") @Excel(name = "货主ID")
private String ownerId; private String ownerId;
/** 货主名称 */
@Excel(name = "货主ID")
private String ownerName;
/** 出库单状态1-草稿 2-已完成 3-已取消 字典,检索条件 */ /** 出库单状态1-草稿 2-已完成 3-已取消 字典,检索条件 */
@Excel(name = "出库单状态1-草稿 2-已完成 3-已取消 字典,检索条件") @Excel(name = "出库单状态1-草稿 2-已完成 3-已取消 字典,检索条件")
private Long orderStatus; private Long orderStatus;
...@@ -89,172 +97,172 @@ public class OutboundOrders extends BaseEntity ...@@ -89,172 +97,172 @@ public class OutboundOrders extends BaseEntity
/** 出库单明细信息 */ /** 出库单明细信息 */
private List<OutboundOrderItems> outboundOrderItemsList; private List<OutboundOrderItems> outboundOrderItemsList;
public void setId(String id) public void setId(String id)
{ {
this.id = id; this.id = id;
} }
public String getId() public String getId()
{ {
return id; return id;
} }
public void setOrderId(String orderId) public void setOrderId(String orderId)
{ {
this.orderId = orderId; this.orderId = orderId;
} }
public String getOrderId() public String getOrderId()
{ {
return orderId; return orderId;
} }
public void setSystemNo(String systemNo) public void setSystemNo(String systemNo)
{ {
this.systemNo = systemNo; this.systemNo = systemNo;
} }
public String getSystemNo() public String getSystemNo()
{ {
return systemNo; return systemNo;
} }
public void setOrderTypeId(String orderTypeId) public void setOrderTypeId(String orderTypeId)
{ {
this.orderTypeId = orderTypeId; this.orderTypeId = orderTypeId;
} }
public String getOrderTypeId() public String getOrderTypeId()
{ {
return orderTypeId; return orderTypeId;
} }
public void setBatchCode(String batchCode) public void setBatchCode(String batchCode)
{ {
this.batchCode = batchCode; this.batchCode = batchCode;
} }
public String getBatchCode() public String getBatchCode()
{ {
return batchCode; return batchCode;
} }
public void setWarehouseId(String warehouseId) public void setWarehouseId(String warehouseId)
{ {
this.warehouseId = warehouseId; this.warehouseId = warehouseId;
} }
public String getWarehouseId() public String getWarehouseId()
{ {
return warehouseId; return warehouseId;
} }
public void setOwnerId(String ownerId) public void setOwnerId(String ownerId)
{ {
this.ownerId = ownerId; this.ownerId = ownerId;
} }
public String getOwnerId() public String getOwnerId()
{ {
return ownerId; return ownerId;
} }
public void setOrderStatus(Long orderStatus) public void setOrderStatus(Long orderStatus)
{ {
this.orderStatus = orderStatus; this.orderStatus = orderStatus;
} }
public Long getOrderStatus() public Long getOrderStatus()
{ {
return orderStatus; return orderStatus;
} }
public void setInboundDate(Date inboundDate) public void setInboundDate(Date inboundDate)
{ {
this.inboundDate = inboundDate; this.inboundDate = inboundDate;
} }
public Date getInboundDate() public Date getInboundDate()
{ {
return inboundDate; return inboundDate;
} }
public void setDestination(String destination) public void setDestination(String destination)
{ {
this.destination = destination; this.destination = destination;
} }
public String getDestination() public String getDestination()
{ {
return destination; return destination;
} }
public void setTotalPlannedQuantity(Long totalPlannedQuantity) public void setTotalPlannedQuantity(Long totalPlannedQuantity)
{ {
this.totalPlannedQuantity = totalPlannedQuantity; this.totalPlannedQuantity = totalPlannedQuantity;
} }
public Long getTotalPlannedQuantity() public Long getTotalPlannedQuantity()
{ {
return totalPlannedQuantity; return totalPlannedQuantity;
} }
public void setTotalActualQuantity(Long totalActualQuantity) public void setTotalActualQuantity(Long totalActualQuantity)
{ {
this.totalActualQuantity = totalActualQuantity; this.totalActualQuantity = totalActualQuantity;
} }
public Long getTotalActualQuantity() public Long getTotalActualQuantity()
{ {
return totalActualQuantity; return totalActualQuantity;
} }
public void setTotalPackages(Long totalPackages) public void setTotalPackages(Long totalPackages)
{ {
this.totalPackages = totalPackages; this.totalPackages = totalPackages;
} }
public Long getTotalPackages() public Long getTotalPackages()
{ {
return totalPackages; return totalPackages;
} }
public void setIsUsed(Long isUsed) public void setIsUsed(Long isUsed)
{ {
this.isUsed = isUsed; this.isUsed = isUsed;
} }
public Long getIsUsed() public Long getIsUsed()
{ {
return isUsed; return isUsed;
} }
public void setSortNo(Long sortNo) public void setSortNo(Long sortNo)
{ {
this.sortNo = sortNo; this.sortNo = sortNo;
} }
public Long getSortNo() public Long getSortNo()
{ {
return sortNo; return sortNo;
} }
public void setCreateUserCode(String createUserCode) public void setCreateUserCode(String createUserCode)
{ {
this.createUserCode = createUserCode; this.createUserCode = createUserCode;
} }
public String getCreateUserCode() public String getCreateUserCode()
{ {
return createUserCode; return createUserCode;
} }
public void setUpdateUserCode(String updateUserCode) public void setUpdateUserCode(String updateUserCode)
{ {
this.updateUserCode = updateUserCode; this.updateUserCode = updateUserCode;
} }
public String getUpdateUserCode() public String getUpdateUserCode()
{ {
return updateUserCode; return updateUserCode;
} }
...@@ -269,30 +277,50 @@ public class OutboundOrders extends BaseEntity ...@@ -269,30 +277,50 @@ public class OutboundOrders extends BaseEntity
this.outboundOrderItemsList = outboundOrderItemsList; this.outboundOrderItemsList = outboundOrderItemsList;
} }
// 补充 warehouseName 的 getter/setter 方法
public String getWarehouseName() {
return warehouseName;
}
public void setWarehouseName(String warehouseName) {
this.warehouseName = warehouseName;
}
// 补充 ownerName 的 getter/setter 方法
public String getOwnerName() {
return ownerName;
}
public void setOwnerName(String ownerName) {
this.ownerName = ownerName;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId()) .append("id", getId())
.append("orderId", getOrderId()) .append("orderId", getOrderId())
.append("systemNo", getSystemNo()) .append("systemNo", getSystemNo())
.append("orderTypeId", getOrderTypeId()) .append("orderTypeId", getOrderTypeId())
.append("batchCode", getBatchCode()) .append("batchCode", getBatchCode())
.append("warehouseId", getWarehouseId()) .append("warehouseId", getWarehouseId())
.append("ownerId", getOwnerId()) .append("warehouseName", getWarehouseName()) // 新增
.append("orderStatus", getOrderStatus()) .append("ownerId", getOwnerId())
.append("inboundDate", getInboundDate()) .append("ownerName", getOwnerName()) // 新增
.append("destination", getDestination()) .append("orderStatus", getOrderStatus())
.append("totalPlannedQuantity", getTotalPlannedQuantity()) .append("inboundDate", getInboundDate())
.append("totalActualQuantity", getTotalActualQuantity()) .append("destination", getDestination())
.append("totalPackages", getTotalPackages()) .append("totalPlannedQuantity", getTotalPlannedQuantity())
.append("remark", getRemark()) .append("totalActualQuantity", getTotalActualQuantity())
.append("isUsed", getIsUsed()) .append("totalPackages", getTotalPackages())
.append("sortNo", getSortNo()) .append("remark", getRemark())
.append("createTime", getCreateTime()) .append("isUsed", getIsUsed())
.append("createUserCode", getCreateUserCode()) .append("sortNo", getSortNo())
.append("updateTime", getUpdateTime()) .append("createTime", getCreateTime())
.append("updateUserCode", getUpdateUserCode()) .append("createUserCode", getCreateUserCode())
.append("outboundOrderItemsList", getOutboundOrderItemsList()) .append("updateTime", getUpdateTime())
.toString(); .append("updateUserCode", getUpdateUserCode())
} .append("outboundOrderItemsList", getOutboundOrderItemsList())
} .toString();
}
}
\ No newline at end of file
package com.ruoyi.inventory.domain; package com.ruoyi.inventory.domain;
import lombok.Data;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
...@@ -10,7 +9,7 @@ import com.ruoyi.common.core.domain.BaseEntity; ...@@ -10,7 +9,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
/** /**
* 库位对象 storage_locations * 库位对象 storage_locations
* *
* @author ruoyi * @author ruoyi
* @date 2025-12-01 * @date 2025-12-01
*/ */
...@@ -74,14 +73,6 @@ public class StorageLocations extends BaseEntity ...@@ -74,14 +73,6 @@ public class StorageLocations extends BaseEntity
/** 允许存放的分类name(前端显示,逗号分隔) */ /** 允许存放的分类name(前端显示,逗号分隔) */
private String allowedCategoryNames; private String allowedCategoryNames;
public String getAllowedCategoryNames() {
return allowedCategoryNames;
}
public void setAllowedCategoryNames(String allowedCategoryNames) {
this.allowedCategoryNames = allowedCategoryNames;
}
/** 温区 */ /** 温区 */
@Excel(name = "温区") @Excel(name = "温区")
private String temperatureZone; private String temperatureZone;
...@@ -105,220 +96,254 @@ public class StorageLocations extends BaseEntity ...@@ -105,220 +96,254 @@ public class StorageLocations extends BaseEntity
/** 仓库id */ /** 仓库id */
private String warehousesId; private String warehousesId;
public void setId(String id) /** 仓库名称 */
private String warehousesName;
// ========== getter/setter 方法保持不变 ==========
public String getAllowedCategoryNames() {
return allowedCategoryNames;
}
public void setAllowedCategoryNames(String allowedCategoryNames) {
this.allowedCategoryNames = allowedCategoryNames;
}
public void setId(String id)
{ {
this.id = id; this.id = id;
} }
public String getId() public String getId()
{ {
return id; return id;
} }
public void setLocationCode(String locationCode) public String getWarehousesId() {
return warehousesId;
}
public void setWarehousesId(String warehousesId) {
this.warehousesId = warehousesId;
}
public String getWarehousesName() {
return warehousesName;
}
public void setWarehousesName(String warehousesName) {
this.warehousesName = warehousesName;
}
public void setLocationCode(String locationCode)
{ {
this.locationCode = locationCode; this.locationCode = locationCode;
} }
public String getLocationCode() public String getLocationCode()
{ {
return locationCode; return locationCode;
} }
public void setLocationName(String locationName) public void setLocationName(String locationName)
{ {
this.locationName = locationName; this.locationName = locationName;
} }
public String getLocationName() public String getLocationName()
{ {
return locationName; return locationName;
} }
public void setWarehousesCode(String warehousesCode) public void setWarehousesCode(String warehousesCode)
{ {
this.warehousesCode = warehousesCode; this.warehousesCode = warehousesCode;
} }
public String getWarehousesCode() public String getWarehousesCode()
{ {
return warehousesCode; return warehousesCode;
} }
public void setLocationType(Long locationType) public void setLocationType(Long locationType)
{ {
this.locationType = locationType; this.locationType = locationType;
} }
public Long getLocationType() public Long getLocationType()
{ {
return locationType; return locationType;
} }
public void setZoneCode(String zoneCode) public void setZoneCode(String zoneCode)
{ {
this.zoneCode = zoneCode; this.zoneCode = zoneCode;
} }
public String getZoneCode() public String getZoneCode()
{ {
return zoneCode; return zoneCode;
} }
public void setRowCode(String rowCode) public void setRowCode(String rowCode)
{ {
this.rowCode = rowCode; this.rowCode = rowCode;
} }
public String getRowCode() public String getRowCode()
{ {
return rowCode; return rowCode;
} }
public void setColumnCode(String columnCode) public void setColumnCode(String columnCode)
{ {
this.columnCode = columnCode; this.columnCode = columnCode;
} }
public String getColumnCode() public String getColumnCode()
{ {
return columnCode; return columnCode;
} }
public void setLayerCode(String layerCode) public void setLayerCode(String layerCode)
{ {
this.layerCode = layerCode; this.layerCode = layerCode;
} }
public String getLayerCode() public String getLayerCode()
{ {
return layerCode; return layerCode;
} }
public void setCapacity(Long capacity) public void setCapacity(Long capacity)
{ {
this.capacity = capacity; this.capacity = capacity;
} }
public Long getCapacity() public Long getCapacity()
{ {
return capacity; return capacity;
} }
public void setVolumeCapacity(Long volumeCapacity) public void setVolumeCapacity(Long volumeCapacity)
{ {
this.volumeCapacity = volumeCapacity; this.volumeCapacity = volumeCapacity;
} }
public Long getVolumeCapacity() public Long getVolumeCapacity()
{ {
return volumeCapacity; return volumeCapacity;
} }
public void setAllowedHazardLevels(String allowedHazardLevels) public void setAllowedHazardLevels(String allowedHazardLevels)
{ {
this.allowedHazardLevels = allowedHazardLevels; this.allowedHazardLevels = allowedHazardLevels;
} }
public String getAllowedHazardLevels() public String getAllowedHazardLevels()
{ {
return allowedHazardLevels; return allowedHazardLevels;
} }
public void setAllowedCategoryIds(String allowedCategoryIds) public void setAllowedCategoryIds(String allowedCategoryIds)
{ {
this.allowedCategoryIds = allowedCategoryIds; this.allowedCategoryIds = allowedCategoryIds;
} }
public String getAllowedCategoryIds() public String getAllowedCategoryIds()
{ {
return allowedCategoryIds; return allowedCategoryIds;
} }
public void setTemperatureZone(String temperatureZone) public void setTemperatureZone(String temperatureZone)
{ {
this.temperatureZone = temperatureZone; this.temperatureZone = temperatureZone;
} }
public String getTemperatureZone() public String getTemperatureZone()
{ {
return temperatureZone; return temperatureZone;
} }
public void setIsEnabled(Long isEnabled) public void setIsEnabled(Long isEnabled)
{ {
this.isEnabled = isEnabled; this.isEnabled = isEnabled;
} }
public Long getIsEnabled() public Long getIsEnabled()
{ {
return isEnabled; return isEnabled;
} }
public void setIsUsed(Long isUsed) public void setIsUsed(Long isUsed)
{ {
this.isUsed = isUsed; this.isUsed = isUsed;
} }
public Long getIsUsed() public Long getIsUsed()
{ {
return isUsed; return isUsed;
} }
public void setSortNo(Long sortNo) public void setSortNo(Long sortNo)
{ {
this.sortNo = sortNo; this.sortNo = sortNo;
} }
public Long getSortNo() public Long getSortNo()
{ {
return sortNo; return sortNo;
} }
public void setCreateUserCode(String createUserCode) public void setCreateUserCode(String createUserCode)
{ {
this.createUserCode = createUserCode; this.createUserCode = createUserCode;
} }
public String getCreateUserCode() public String getCreateUserCode()
{ {
return createUserCode; return createUserCode;
} }
public void setUpdateUserCode(String updateUserCode) public void setUpdateUserCode(String updateUserCode)
{ {
this.updateUserCode = updateUserCode; this.updateUserCode = updateUserCode;
} }
public String getUpdateUserCode() public String getUpdateUserCode()
{ {
return updateUserCode; return updateUserCode;
} }
/**
* 重写toString方法,补充所有新增字段
*/
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId()) .append("id", getId())
.append("locationCode", getLocationCode()) .append("locationCode", getLocationCode())
.append("locationName", getLocationName()) .append("locationName", getLocationName())
.append("warehousesCode", getWarehousesCode()) .append("warehousesCode", getWarehousesCode())
.append("locationType", getLocationType()) .append("warehousesId", getWarehousesId()) // 新增:仓库ID
.append("zoneCode", getZoneCode()) .append("warehousesName", getWarehousesName()) // 新增:仓库名称
.append("rowCode", getRowCode()) .append("locationType", getLocationType())
.append("columnCode", getColumnCode()) .append("zoneCode", getZoneCode())
.append("layerCode", getLayerCode()) .append("rowCode", getRowCode())
.append("capacity", getCapacity()) .append("columnCode", getColumnCode())
.append("volumeCapacity", getVolumeCapacity()) .append("layerCode", getLayerCode())
.append("allowedHazardLevels", getAllowedHazardLevels()) .append("capacity", getCapacity())
.append("allowedCategoryIds", getAllowedCategoryIds()) .append("volumeCapacity", getVolumeCapacity())
.append("temperatureZone", getTemperatureZone()) .append("allowedHazardLevels", getAllowedHazardLevels())
.append("isEnabled", getIsEnabled()) .append("allowedCategoryIds", getAllowedCategoryIds())
.append("isUsed", getIsUsed()) .append("allowedCategoryNames", getAllowedCategoryNames()) // 新增:分类名称
.append("sortNo", getSortNo()) .append("temperatureZone", getTemperatureZone())
.append("createTime", getCreateTime()) .append("isEnabled", getIsEnabled())
.append("createUserCode", getCreateUserCode()) .append("isUsed", getIsUsed())
.append("updateTime", getUpdateTime()) .append("sortNo", getSortNo())
.append("updateUserCode", getUpdateUserCode()) .append("createTime", getCreateTime())
.toString(); .append("createUserCode", getCreateUserCode())
} .append("updateTime", getUpdateTime())
} .append("updateUserCode", getUpdateUserCode())
.toString();
}
}
\ No newline at end of file
package com.ruoyi.inventory.domain.TO;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/**
* 出库单明细对象 outbound_order_items
*
* @author ruoyi
* @date 2025-12-03
*/
public class OutboundOrderItemsStatisticsVO extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 编号 */
private String id;
/** 出库单号 检索条件 */
@Excel(name = "出库单号 检索条件")
private String orderId;
/** 货物ID 字典,检索条件 */
@Excel(name = "货物ID 字典,检索条件")
private String materialId;
/** 货物ID 字典,检索条件 */
@Excel(name = "ID 字典,检索条件")
private String locationId;
/** 批次ID 检索条件 */
@Excel(name = "批次ID 检索条件")
private String batchCode;
/** 仓库ID 检索条件 */
@Excel(name = "仓库ID 检索条件")
private String warehouseId;
/** 库存ID */
private String inventoryId;
/** 出库单ID */
private String outboundOrderId;
/** 单价 */
@Excel(name = "单价")
private Long unitPrice;
/**
* amount(对应SQL:(unit_price*actual_quantity) AS amount)
*/
private String amount;
/** 计划数量 */
@Excel(name = "计划数量")
private Long plannedQuantity;
/** 实际数量 */
@Excel(name = "实际数量")
private Long actualQuantity;
/** 约数 */
@Excel(name = "约数")
private Long divisor;
/** 标签颜色 字典,检索条件 */
@Excel(name = "标签颜色 字典,检索条件")
private Long labelColor;
/** 凭证号 检索条件 */
@Excel(name = "凭证号 检索条件")
private String voucherNumber;
/** 状态1-待发货 2-部分发货 3-已完成 字典,检索条件 */
@Excel(name = "状态1-待发货 2-部分发货 3-已完成 字典,检索条件")
private Long itemStatus;
/** 发货时间 暂无用 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "发货时间 暂无用", width = 30, dateFormat = "yyyy-MM-dd")
private Date shippedAt;
private Date startDate;
private Date endDate;
/** 发货方 暂无用 */
@Excel(name = "发货方 暂无用")
private String shippedBy;
/** 应用数据1使用0删除 删除用 */
@Excel(name = "应用数据1使用0删除 删除用")
private Long isUsed;
/** 排序 */
@Excel(name = "排序")
private Long sortNo;
/** 创建日期 */
@Excel(name = "创建日期")
private String createUserCode;
/** 排序号 */
@Excel(name = "排序号")
private String updateUserCode;
public String getInventoryId() {
return inventoryId;
}
public void setInventoryId(String inventoryId) {
this.inventoryId = inventoryId;
}
public String getOutboundOrderId() {
return outboundOrderId;
}
public void setOutboundOrderId(String outboundOrderId) {
this.outboundOrderId = outboundOrderId;
}
public Long getUnitPrice() {
return unitPrice;
}
public void setUnitPrice(Long unitPrice) {
this.unitPrice = unitPrice;
}
public String getAmount() {
return amount;
}
public void setAmount(String amount) {
this.amount = amount;
}
public void setId(String id)
{
this.id = id;
}
public String getId()
{
return id;
}
public void setOrderId(String orderId)
{
this.orderId = orderId;
}
public String getOrderId()
{
return orderId;
}
public void setMaterialId(String materialId)
{
this.materialId = materialId;
}
public String getMaterialId()
{
return materialId;
}
public void setBatchCode(String batchCode)
{
this.batchCode = batchCode;
}
public String getBatchCode()
{
return batchCode;
}
public void setWarehouseId(String warehouseId)
{
this.warehouseId = warehouseId;
}
public String getWarehouseId()
{
return warehouseId;
}
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 void setLocationId(String locationId)
{
this.locationId = locationId;
}
public String getLocationId()
{
return locationId;
}
public void setPlannedQuantity(Long plannedQuantity)
{
this.plannedQuantity = plannedQuantity;
}
public Long getPlannedQuantity()
{
return plannedQuantity;
}
public void setActualQuantity(Long actualQuantity)
{
this.actualQuantity = actualQuantity;
}
public Long getActualQuantity()
{
return actualQuantity;
}
public void setDivisor(Long divisor)
{
this.divisor = divisor;
}
public Long getDivisor()
{
return divisor;
}
public void setLabelColor(Long labelColor)
{
this.labelColor = labelColor;
}
public Long getLabelColor()
{
return labelColor;
}
public void setVoucherNumber(String voucherNumber)
{
this.voucherNumber = voucherNumber;
}
public String getVoucherNumber()
{
return voucherNumber;
}
public void setItemStatus(Long itemStatus)
{
this.itemStatus = itemStatus;
}
public Long getItemStatus()
{
return itemStatus;
}
public void setShippedAt(Date shippedAt)
{
this.shippedAt = shippedAt;
}
public Date getShippedAt()
{
return shippedAt;
}
public void setShippedBy(String shippedBy)
{
this.shippedBy = shippedBy;
}
public String getShippedBy()
{
return shippedBy;
}
public void setIsUsed(Long isUsed)
{
this.isUsed = isUsed;
}
public Long getIsUsed()
{
return isUsed;
}
public void setSortNo(Long sortNo)
{
this.sortNo = sortNo;
}
public Long getSortNo()
{
return sortNo;
}
public void setCreateUserCode(String createUserCode)
{
this.createUserCode = createUserCode;
}
public String getCreateUserCode()
{
return createUserCode;
}
public void setUpdateUserCode(String updateUserCode)
{
this.updateUserCode = updateUserCode;
}
public String getUpdateUserCode()
{
return updateUserCode;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("orderId", getOrderId())
.append("materialId", getMaterialId())
.append("batchCode", getBatchCode())
.append("warehouseId", getWarehouseId())
.append("locationId", getLocationId())
.append("inventoryId", getInventoryId())
.append("outboundOrderId", getOutboundOrderId())
.append("unitPrice", getUnitPrice())
.append("plannedQuantity", getPlannedQuantity())
.append("actualQuantity", getActualQuantity())
.append("divisor", getDivisor())
.append("amount", getAmount())
.append("labelColor", getLabelColor())
.append("voucherNumber", getVoucherNumber())
.append("itemStatus", getItemStatus())
.append("shippedAt", getShippedAt())
.append("shippedBy", getShippedBy())
.append("remark", getRemark())
.append("endDate", getEndDate())
.append("startDate", getStartDate())
.append("sortNo", getSortNo())
.append("createTime", getCreateTime())
.append("createUserCode", getCreateUserCode())
.append("updateTime", getUpdateTime())
.append("updateUserCode", getUpdateUserCode())
.toString();
}
}
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 org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/**
* 出库单明细对象 outbound_order_items
*
* @author ruoyi
* @date 2025-12-03
*/
public class OutboundTemplateVO extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 编号 */
private String id;
/** 入库单号 检索条件 */
@Excel(name = "入库单号")
private String orderId;
/** 系统编号 检索条件 */
@Excel(name = "系统编号")
private String systemNo;
/** 入库类型 字典,检索条件 */
@Excel(name = "入库类型")
private String orderTypeId;
/** 批次ID 检索条件 */
@Excel(name = "批次ID")
private String batchId;
/** 入库日期 日期无时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "入库日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date inboundDate;
/** 订单类型 字典,检索条件 */
@Excel(name = "订单类型")
private String orderType;
/** 备注 */
@Excel(name = "备注")
private String remark;
/** 货主ID */
@Excel(name = "货主ID")
private String ownerId;
/** 仓库ID 暂无用 */
@Excel(name = "仓库ID")
private String warehouseId;
/** 库位ID 检索条件 */
@Excel(name = "库位ID")
private String locationId;
/** 货物ID 字典,检索条件 */
@Excel(name = "SAP号")
private String sapNo;
/** 货物ID 字典,检索条件 */
@Excel(name = "货物名称")
private String materialName;
/** 负责人 暂无用 */
// @Excel(name = "负责人 暂无用")
private String opUserName;
/** 计划数量 */
@Excel(name = "计划数量")
private Long plannedQuantity;
/** 实际数量 */
@Excel(name = "实际数量")
private Long actualQuantity;
/** 计划件数 暂无用 */
// @Excel(name = "计划件数")
private Long plannedPackages;
/** 实际件数 */
@Excel(name = "实际件数")
private Long actualPackages;
/** 约数 */
@Excel(name = "约数")
private Long divisor;
/** 标签颜色 字典,检索条件 */
@Excel(name = "标签颜色")
private Long labelColor;
/** 凭证号 检索条件 */
@Excel(name = "凭证号")
private String voucherNumber;
/** 单价 */
@Excel(name = "单价")
private Long unitPrice;
/** 收货人 */
@Excel(name = "收货人")
private String receivedBy;
/** 物料备注 */
@Excel(name = "物料备注")
private String remark2;
/** 排序号 */
private Long sortNo;
/** 创建日期 */
private String createUserCode;
private String updateUserCode;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public String getSystemNo() {
return systemNo;
}
public void setSystemNo(String systemNo) {
this.systemNo = systemNo;
}
public String getOrderTypeId() {
return orderTypeId;
}
public void setOrderTypeId(String orderTypeId) {
this.orderTypeId = orderTypeId;
}
public String getBatchId() {
return batchId;
}
public void setBatchId(String batchId) {
this.batchId = batchId;
}
public Date getInboundDate() {
return inboundDate;
}
public void setInboundDate(Date inboundDate) {
this.inboundDate = inboundDate;
}
public String getOrderType() {
return orderType;
}
public void setOrderType(String orderType) {
this.orderType = orderType;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getOwnerId() {
return ownerId;
}
public void setOwnerId(String ownerId) {
this.ownerId = ownerId;
}
public String getWarehouseId() {
return warehouseId;
}
public void setWarehouseId(String warehouseId) {
this.warehouseId = warehouseId;
}
public String getLocationId() {
return locationId;
}
public void setLocationId(String locationId) {
this.locationId = locationId;
}
public String getRemark2() {
return remark2;
}
public void setRemark2(String remark2) {
this.remark2 = remark2;
}
public String getSapNo() {
return sapNo;
}
public void setSapNo(String sapNo) {
this.sapNo = sapNo;
}
public String getMaterialName() {
return materialName;
}
public void setMaterialName(String materialName) {
this.materialName = materialName;
}
public String getOpUserName() {
return opUserName;
}
public void setOpUserName(String opUserName) {
this.opUserName = opUserName;
}
public Long getPlannedQuantity() {
return plannedQuantity;
}
public void setPlannedQuantity(Long plannedQuantity) {
this.plannedQuantity = plannedQuantity;
}
public Long getActualQuantity() {
return actualQuantity;
}
public void setActualQuantity(Long actualQuantity) {
this.actualQuantity = actualQuantity;
}
public Long getPlannedPackages() {
return plannedPackages;
}
public void setPlannedPackages(Long plannedPackages) {
this.plannedPackages = plannedPackages;
}
public Long getActualPackages() {
return actualPackages;
}
public void setActualPackages(Long actualPackages) {
this.actualPackages = actualPackages;
}
public Long getDivisor() {
return divisor;
}
public void setDivisor(Long divisor) {
this.divisor = divisor;
}
public Long getLabelColor() {
return labelColor;
}
public void setLabelColor(Long labelColor) {
this.labelColor = labelColor;
}
public String getVoucherNumber() {
return voucherNumber;
}
public void setVoucherNumber(String voucherNumber) {
this.voucherNumber = voucherNumber;
}
public Long getUnitPrice() {
return unitPrice;
}
public void setUnitPrice(Long unitPrice) {
this.unitPrice = unitPrice;
}
public String getReceivedBy() {
return receivedBy;
}
public void setReceivedBy(String receivedBy) {
this.receivedBy = receivedBy;
}
public String getCreateUserCode() {
return createUserCode;
}
public void setCreateUserCode(String createUserCode) {
this.createUserCode = createUserCode;
}
public String getUpdateUserCode() {
return updateUserCode;
}
public void setUpdateUserCode(String updateUserCode) {
this.updateUserCode = updateUserCode;
}
public Long getSortNo() {
return sortNo;
}
public void setSortNo(Long sortNo) {
this.sortNo = sortNo;
}
@Override
public String toString() {
return "InboundTemplateVO{" +
"id='" + id + '\'' +
", orderId='" + orderId + '\'' +
", systemNo='" + systemNo + '\'' +
", orderTypeId='" + orderTypeId + '\'' +
", batchId='" + batchId + '\'' +
", inboundDate=" + inboundDate +
", orderType='" + orderType + '\'' +
", remark1='" + remark + '\'' +
", ownerId='" + ownerId + '\'' +
", warehouseId='" + warehouseId + '\'' +
", locationId='" + locationId + '\'' +
", sapNo='" + sapNo + '\'' +
", materialName='" + materialName + '\'' +
", opUserName='" + opUserName + '\'' +
", plannedQuantity=" + plannedQuantity +
", actualQuantity=" + actualQuantity +
", plannedPackages=" + plannedPackages +
", actualPackages=" + actualPackages +
", divisor=" + divisor +
", labelColor=" + labelColor +
", voucherNumber='" + voucherNumber + '\'' +
", unitPrice=" + unitPrice +
", receivedBy='" + receivedBy + '\'' +
", remark2='" + remark2 + '\'' +
'}';
}
}
...@@ -105,4 +105,7 @@ public interface InventoryMapper ...@@ -105,4 +105,7 @@ public interface InventoryMapper
* @return 超出预警值物料信息集合 * @return 超出预警值物料信息集合
*/ */
public List<InventoryExceedWarnVO> selectInventoryExceedWarnList(); public List<InventoryExceedWarnVO> selectInventoryExceedWarnList();
public List<java.util.Map<String, String>> selectInventoryTopTenByAmount();
public List<java.util.Map<String, String>> selectInventoryTopTenByQuantity();
} }
package com.ruoyi.inventory.mapper; package com.ruoyi.inventory.mapper;
import java.util.List; import java.util.List;
import com.ruoyi.inventory.domain.InboundOrderItems;
import com.ruoyi.inventory.domain.OutboundOrderItems; import com.ruoyi.inventory.domain.OutboundOrderItems;
import com.ruoyi.inventory.domain.TO.OutboundOrderItemsStatisticsVO; import com.ruoyi.inventory.domain.vo.OutboundOrdersSummaryVO;
/** /**
* 出库单明细Mapper接口 * 出库单明细Mapper接口
...@@ -34,7 +36,7 @@ public interface OutboundOrderItemsMapper ...@@ -34,7 +36,7 @@ public interface OutboundOrderItemsMapper
* @param outboundOrderItems 出库单明细 * @param outboundOrderItems 出库单明细
* @return 出库单明细集合 * @return 出库单明细集合
*/ */
public List<OutboundOrderItems> selectOutboundOrderItemsStatistics(OutboundOrderItemsStatisticsVO outboundOrderItems); public List<OutboundOrderItems> selectOutboundOrderItemsStatistics(OutboundOrdersSummaryVO outboundOrderItems);
/** /**
* 新增出库单明细 * 新增出库单明细
* *
...@@ -66,4 +68,9 @@ public interface OutboundOrderItemsMapper ...@@ -66,4 +68,9 @@ public interface OutboundOrderItemsMapper
* @return 结果 * @return 结果
*/ */
public int deleteOutboundOrderItemsById(String[] ids); public int deleteOutboundOrderItemsById(String[] ids);
public int batchInsertOutboundOrderItems(List<InboundOrderItems> inboundOrderItems);
} }
package com.ruoyi.inventory.mapper; package com.ruoyi.inventory.mapper;
import java.util.List; import java.util.List;
import java.util.Map;
import com.ruoyi.inventory.domain.OutboundOrders; import com.ruoyi.inventory.domain.OutboundOrders;
import com.ruoyi.inventory.domain.OutboundOrderItems; import com.ruoyi.inventory.domain.OutboundOrderItems;
...@@ -84,4 +86,9 @@ public interface OutboundOrdersMapper ...@@ -84,4 +86,9 @@ public interface OutboundOrdersMapper
* @return 结果 * @return 结果
*/ */
public int deleteOutboundOrderItemsByOrderId(String id); public int deleteOutboundOrderItemsByOrderId(String id);
public List<Map<String,String>> SelectOutboundOrdersMaterialsTopTenByAmount();
public List<Map<String,String>> SelectOutboundOrdersMaterialsTopTenByQuantity();
public String outboundOrdersCount();
} }
...@@ -4,6 +4,7 @@ import java.util.List; ...@@ -4,6 +4,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import com.ruoyi.inventory.domain.StorageLocations; import com.ruoyi.inventory.domain.StorageLocations;
import io.lettuce.core.dynamic.annotation.Param;
import org.apache.ibatis.annotations.Update; import org.apache.ibatis.annotations.Update;
/** /**
...@@ -72,10 +73,10 @@ public interface StorageLocationsMapper ...@@ -72,10 +73,10 @@ public interface StorageLocationsMapper
/** /**
* 查询库位 * 查询库位
* *
* @param warehousesCode 库位主键 * @param warehousesCodes 库位主键
* @return 库位 * @return 库位
*/ */
public List<StorageLocations> selectStorageLocationsByWarehousesCodes(String[] warehousesCode); public List<StorageLocations> selectStorageLocationsByWarehousesCodes(List<String> warehousesCodes);
@Update("update storage_locations set is_enabled = 0 where warehouses_code=#{id}") @Update("update storage_locations set is_enabled = 0 where warehouses_code=#{id}")
......
package com.ruoyi.inventory.service; package com.ruoyi.inventory.service;
import java.util.List; import java.util.List;
import java.util.Map;
import com.ruoyi.common.annotation.SerialExecution; import com.ruoyi.common.annotation.SerialExecution;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
...@@ -115,4 +116,9 @@ public interface IInventoryService ...@@ -115,4 +116,9 @@ public interface IInventoryService
* @return 超出预警物料信息集合 * @return 超出预警物料信息集合
*/ */
public List<InventoryExceedWarnVO> selectInventoryExceedWarnList(); public List<InventoryExceedWarnVO> selectInventoryExceedWarnList();
public List<Map<String,String>> inventoryTopTenByAmount();
public List<Map<String,String>> inventoryTopTenByQuantity();
} }
...@@ -2,8 +2,10 @@ package com.ruoyi.inventory.service; ...@@ -2,8 +2,10 @@ package com.ruoyi.inventory.service;
import java.util.List; import java.util.List;
import com.ruoyi.inventory.domain.OutboundOrderItems; import com.ruoyi.inventory.domain.OutboundOrderItems;
import com.ruoyi.inventory.domain.OutboundOrderItems; import com.ruoyi.inventory.domain.vo.InboundTemplateVO;
import com.ruoyi.inventory.domain.TO.OutboundOrderItemsStatisticsVO; import com.ruoyi.inventory.domain.vo.OutboundOrdersSummaryVO;
import com.ruoyi.inventory.domain.vo.OutboundTemplateVO;
import org.springframework.transaction.annotation.Transactional;
/** /**
* 出库单明细Service接口 * 出库单明细Service接口
...@@ -34,7 +36,7 @@ public interface IOutboundOrderItemsService ...@@ -34,7 +36,7 @@ public interface IOutboundOrderItemsService
* @param outboundOrderItems 出库单明细 * @param outboundOrderItems 出库单明细
* @return 出库单明细集合 * @return 出库单明细集合
*/ */
public List<OutboundOrderItems> selectOutboundOrderItemsStatistics(OutboundOrderItemsStatisticsVO outboundOrderItems); public List<OutboundOrderItems> selectOutboundOrderItemsStatistics(OutboundOrdersSummaryVO outboundOrderItems);
/** /**
* 新增出库单明细 * 新增出库单明细
* *
...@@ -66,4 +68,8 @@ public interface IOutboundOrderItemsService ...@@ -66,4 +68,8 @@ public interface IOutboundOrderItemsService
* @return 结果 * @return 结果
*/ */
public int deleteOutboundOrderItemsById(String id); public int deleteOutboundOrderItemsById(String id);
@Transactional(rollbackFor = Exception.class)
String importOutoundOrders(List<OutboundTemplateVO> inboundOrdersList, Boolean isUpdateSupport, String operName);
} }
package com.ruoyi.inventory.service; package com.ruoyi.inventory.service;
import java.util.List; import java.util.List;
import java.util.Map;
import com.ruoyi.inventory.domain.OutboundOrders; import com.ruoyi.inventory.domain.OutboundOrders;
/** /**
...@@ -67,4 +69,9 @@ public interface IOutboundOrdersService ...@@ -67,4 +69,9 @@ public interface IOutboundOrdersService
*/ */
public int ship(OutboundOrders outboundOrders); public int ship(OutboundOrders outboundOrders);
public List<Map<String,String>> outboundOrdersTopTenByQuantity();
public List<Map<String,String>> outboundOrdersTopTenByAmount();
public String outboundOrdersCount();
} }
...@@ -38,7 +38,7 @@ public interface IStorageLocationsService ...@@ -38,7 +38,7 @@ public interface IStorageLocationsService
* @param warehousesCodes 库位主键 * @param warehousesCodes 库位主键
* @return 库位 * @return 库位
*/ */
public List<StorageLocations> selectStorageLocationsByWarehousesCodes(String[] warehousesCodes); public List<StorageLocations> selectStorageLocationsByWarehousesCodes(List<String> warehousesCodes);
/** /**
* 查询库位列表 * 查询库位列表
......
...@@ -155,7 +155,10 @@ public class InventoryServiceImpl implements IInventoryService ...@@ -155,7 +155,10 @@ public class InventoryServiceImpl implements IInventoryService
@Override @Override
public boolean inventoryLockValidation(List<OutboundOrderItems> outboundOrderItems) public boolean inventoryLockValidation(List<OutboundOrderItems> outboundOrderItems)
{ {
if (!outboundOrderItems.isEmpty()) { if (!outboundOrderItems.isEmpty()) {
List<String> inventoryIds = outboundOrderItems.stream().map(OutboundOrderItems::getInventoryId).collect(Collectors.toList());
RefreshInventory(inventoryIds);
for (OutboundOrderItems outboundOrderItem : outboundOrderItems) { for (OutboundOrderItems outboundOrderItem : outboundOrderItems) {
Inventory inventory = inventoryMapper.selectInventoryById(outboundOrderItem.getInventoryId()); Inventory inventory = inventoryMapper.selectInventoryById(outboundOrderItem.getInventoryId());
if (inventory.getLockedQuantity()+outboundOrderItem.getActualQuantity()>inventory.getQuantity()){ if (inventory.getLockedQuantity()+outboundOrderItem.getActualQuantity()>inventory.getQuantity()){
...@@ -268,4 +271,14 @@ public class InventoryServiceImpl implements IInventoryService ...@@ -268,4 +271,14 @@ public class InventoryServiceImpl implements IInventoryService
public List<InventoryExceedWarnVO> selectInventoryExceedWarnList() { public List<InventoryExceedWarnVO> selectInventoryExceedWarnList() {
return inventoryMapper.selectInventoryExceedWarnList(); return inventoryMapper.selectInventoryExceedWarnList();
} }
@Override
public List<Map<String, String>> inventoryTopTenByAmount() {
return inventoryMapper.selectInventoryTopTenByAmount();
}
@Override
public List<Map<String, String>> inventoryTopTenByQuantity() {
return inventoryMapper.selectInventoryTopTenByQuantity();
}
} }
...@@ -14,6 +14,7 @@ import org.springframework.beans.BeanUtils; ...@@ -14,6 +14,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Map;
import java.util.UUID; import java.util.UUID;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
...@@ -171,6 +172,23 @@ public class OutboundOrdersServiceImpl implements IOutboundOrdersService ...@@ -171,6 +172,23 @@ public class OutboundOrdersServiceImpl implements IOutboundOrdersService
return 1; return 1;
} }
@Override
public List<Map<String,String>> outboundOrdersTopTenByQuantity() {
List<Map<String,String>> o= outboundOrdersMapper.SelectOutboundOrdersMaterialsTopTenByQuantity();
return o;
}
@Override
public List<Map<String, String>> outboundOrdersTopTenByAmount() {
return outboundOrdersMapper.SelectOutboundOrdersMaterialsTopTenByAmount();
}
@Override
public String outboundOrdersCount() {
return outboundOrdersMapper.outboundOrdersCount();
}
/** /**
* 新增出库单明细信息 * 新增出库单明细信息
* *
...@@ -193,6 +211,7 @@ public class OutboundOrdersServiceImpl implements IOutboundOrdersService ...@@ -193,6 +211,7 @@ public class OutboundOrdersServiceImpl implements IOutboundOrdersService
// 2. 为明细设置订单ID和主键ID // 2. 为明细设置订单ID和主键ID
for (OutboundOrderItems items : outboundOrderItemsList) { for (OutboundOrderItems items : outboundOrderItemsList) {
items.setOutboundOrderId(id); items.setOutboundOrderId(id);
items.setOrderId(outboundOrders.getOrderId());
// 生成无横线的UUID作为主键 // 生成无横线的UUID作为主键
items.setId(UUID.randomUUID().toString().replace("-", "")); items.setId(UUID.randomUUID().toString().replace("-", ""));
} }
......
...@@ -65,11 +65,9 @@ public class OwnersServiceImpl implements IOwnersService ...@@ -65,11 +65,9 @@ public class OwnersServiceImpl implements IOwnersService
// 填充创建人、创建时间、修改人、修改时间 // 填充创建人、创建时间、修改人、修改时间
owners.setCreateBy(operId); owners.setCreateBy(operId);
owners.setCreateTime(now); owners.setCreateTime(now);
owners.setUpdateBy(operId);
owners.setUpdateTime(now);
// 填充创建用户编码和更新用户编码 // 填充创建用户编码和更新用户编码
owners.setCreateUserCode(operId); owners.setCreateUserCode(operId);
owners.setUpdateUserCode(operId);
// 设置默认值 // 设置默认值
if (owners.getIsActive() == null) if (owners.getIsActive() == null)
{ {
......
package com.ruoyi.inventory.service.impl; package com.ruoyi.inventory.service.impl;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.ruoyi.common.core.domain.entity.Materials; import com.ruoyi.common.core.domain.entity.Materials;
import com.ruoyi.common.core.domain.entity.MaterialsCategory;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.bean.BeanUtils; import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.common.utils.uuid.UUID; import com.ruoyi.common.utils.uuid.UUID;
import com.ruoyi.inventory.domain.StorageLocationsCategory; import com.ruoyi.inventory.domain.StorageLocationsCategory;
import com.ruoyi.inventory.mapper.MaterialsCategoryMapper;
import com.ruoyi.inventory.mapper.MaterialsMapper; import com.ruoyi.inventory.mapper.MaterialsMapper;
import com.ruoyi.inventory.mapper.StorageLocationsCategoryMapper; import com.ruoyi.inventory.mapper.StorageLocationsCategoryMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -19,8 +16,6 @@ import org.springframework.stereotype.Service; ...@@ -19,8 +16,6 @@ import org.springframework.stereotype.Service;
import com.ruoyi.inventory.mapper.StorageLocationsMapper; import com.ruoyi.inventory.mapper.StorageLocationsMapper;
import com.ruoyi.inventory.domain.StorageLocations; import com.ruoyi.inventory.domain.StorageLocations;
import com.ruoyi.inventory.service.IStorageLocationsService; import com.ruoyi.inventory.service.IStorageLocationsService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
/** /**
* 库位Service业务层处理 * 库位Service业务层处理
...@@ -56,7 +51,7 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService ...@@ -56,7 +51,7 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
} }
@Override @Override
public List<StorageLocations> selectStorageLocationsByWarehousesCodes(String[] warehousesCodes) { public List<StorageLocations> selectStorageLocationsByWarehousesCodes(List<String> warehousesCodes) {
return storageLocationsMapper.selectStorageLocationsByWarehousesCodes(warehousesCodes); return storageLocationsMapper.selectStorageLocationsByWarehousesCodes(warehousesCodes);
} }
...@@ -113,6 +108,7 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService ...@@ -113,6 +108,7 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
storageLocations.setCreateUserCode(String.valueOf(SecurityUtils.getUserId())); storageLocations.setCreateUserCode(String.valueOf(SecurityUtils.getUserId()));
storageLocationsCategory.setLocationCode(LocationsID); storageLocationsCategory.setLocationCode(LocationsID);
if (storageLocations.getAllowedCategoryIds() != null && !storageLocations.getAllowedCategoryIds().isEmpty()){ if (storageLocations.getAllowedCategoryIds() != null && !storageLocations.getAllowedCategoryIds().isEmpty()){
String[] CategoryId = storageLocations.getAllowedCategoryIds().split(","); String[] CategoryId = storageLocations.getAllowedCategoryIds().split(",");
for (String categoryId : CategoryId) { for (String categoryId : CategoryId) {
...@@ -223,6 +219,7 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService ...@@ -223,6 +219,7 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
*/ */
@Override @Override
public List<StorageLocations> getStorageLocationsList(StorageLocations storageLocations) { public List<StorageLocations> getStorageLocationsList(StorageLocations storageLocations) {
return storageLocationsMapper.getStorageLocationsList(storageLocations); List<StorageLocations> storageLocations1 =storageLocationsMapper.getStorageLocationsList(storageLocations);
return storageLocations1;
} }
} }
package com.ruoyi.inventory.service.impl; package com.ruoyi.inventory.service.impl;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;
...@@ -99,9 +100,17 @@ public class WarehousesServiceImpl implements IWarehousesService ...@@ -99,9 +100,17 @@ public class WarehousesServiceImpl implements IWarehousesService
@Override @Override
public int deleteWarehousesByIds(String[] ids) public int deleteWarehousesByIds(String[] ids)
{ {
List<String> WarehousesCodes = new ArrayList<>();
List<StorageLocations> storageLocations = storageLocationsService.selectStorageLocationsByWarehousesCodes(ids); for (String id : ids){
for (StorageLocations storageLocation : storageLocations) { Warehouses warehouses = selectWarehousesById(id);
String warehousesCode = warehouses.getWarehousesCode();
WarehousesCodes.add(warehousesCode);
}
List<StorageLocations> storageLocations = new ArrayList<>();
if (WarehousesCodes!=null && !WarehousesCodes.isEmpty()){
storageLocations= storageLocationsService.selectStorageLocationsByWarehousesCodes(WarehousesCodes);
}
for (StorageLocations storageLocation : storageLocations) {
storageLocationsService.deleteStorageLocationsById(storageLocation.getId()); storageLocationsService.deleteStorageLocationsById(storageLocation.getId());
} }
return warehousesMapper.deleteWarehousesByIds(ids); return warehousesMapper.deleteWarehousesByIds(ids);
......
...@@ -337,4 +337,28 @@ and inventory_status = '1' ...@@ -337,4 +337,28 @@ and inventory_status = '1'
where COALESCE(i.quantity, 0) &gt; COALESCE(m.max_stock_level, 999999) where COALESCE(i.quantity, 0) &gt; COALESCE(m.max_stock_level, 999999)
or COALESCE(i.quantity, 0) &lt; COALESCE(m.min_stock_level, 0) or COALESCE(i.quantity, 0) &lt; COALESCE(m.min_stock_level, 0)
</select> </select>
<select id="selectInventoryTopTenByAmount" resultType="java.util.Map">
select
m.material_name as name,
sum(i.quantity) as value
from inventory i
left join materials m on i.material_id = m.id
where i.is_used = 1 and i.production_date &gt;= DATE_FORMAT(CURDATE(), '%Y-%m-01')
and i.production_date &lt; DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 1 MONTH), '%Y-%m-01')
group by m.material_name
order by sum(i.quantity) desc
</select>
<select id="selectInventoryTopTenByQuantity" resultType="java.util.Map">
select
m.material_name as name,
sum(i.quantity)*i.unit_price as value
from inventory i
left join materials m on i.material_id = m.id
where i.is_used = 1 and i.production_date &gt;= DATE_FORMAT(CURDATE(), '%Y-%m-01')
and i.production_date &lt; DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 1 MONTH), '%Y-%m-01')
group by m.material_name
order by sum(i.quantity)*i.unit_price desc
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -84,11 +84,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -84,11 +84,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update> </update>
<delete id="deleteStorageLocationsCategoryById" parameterType="String"> <delete id="deleteStorageLocationsCategoryById" parameterType="String">
update storage_locations_category set is_used = 0 where id = #{id} delete from storage_locations_category where id = #{id}
</delete> </delete>
<delete id="deleteStorageLocationsCategoryByIds" parameterType="String"> <delete id="deleteStorageLocationsCategoryByIds" parameterType="String">
update storage_locations_category set is_used = 0 where id in delete from storage_locations_category where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论