Commit db0c0a3a by wangchunyang
parents 6eab21f8 7555bfca
......@@ -151,7 +151,7 @@ export default {
},
/** 下载模板操作 */
importTemplate() {
this.download(this.templateUrl, {}, `${this.templateName}_${new Date().getTime()}.xlsx`)
this.download(this.templateUrl, {orderType: this.upload.orderType}, `${this.templateName}_${new Date().getTime()}.xlsx`)
},
// 文件上传中处理
handleFileUploadProgress(event, file, fileList) {
......
......@@ -94,6 +94,7 @@ export default {
grid: {
left: '3%',
right: '4%',
top: '3%',
bottom: '3%',
containLabel: true
},
......@@ -130,12 +131,12 @@ export default {
series: [{
name: '标准化',
type: 'bar',
barWidth: 16, // 柱子宽度
barWidth: '15', // 柱子宽度
label: {
show: true,
position: 'right', // 位置
color: 'rgba(102, 102, 102, 1)',
fontSize: 14,
fontSize: 12,
fontWeight: 'bold', // 加粗
distance: 5 // 距离
}, // 柱子上方的数值
......
......@@ -63,7 +63,7 @@
<div class="card-container-flex chart-container shadow flex1">
<div class="tip-title">
<div class="title-text">本月入库排名前10物料</div>
<div class="title-text">本月入库排名前5物料</div>
<el-radio-group v-model="rukuRankType" size="mini" @change="rukuRankTypeChange">
<el-radio-button label="count">按数量</el-radio-button>
<el-radio-button label="money">按金额</el-radio-button>
......@@ -75,7 +75,7 @@
</div>
<div class="card-container-flex chart-container shadow flex1 two">
<div class="tip-title">
<div class="title-text">本月出库排名前10物料</div>
<div class="title-text">本月出库排名前5物料</div>
<el-radio-group v-model="cukuRankType" size="mini" @change="cukuRankTypeChange">
<el-radio-button label="count">按数量</el-radio-button>
<el-radio-button label="money">按金额</el-radio-button>
......@@ -186,7 +186,7 @@ export default {
this.rukuList = data.map(item =>({
value:item.totalQuantity,
name:item.materialName
}))
})).splice(0,5).reverse()
})
}
if(this.rukuRankType === 'money'){
......@@ -196,7 +196,7 @@ export default {
this.rukuList = data.map(item =>({
value:item.totalMoney,
name:item.materialName
}))
})).splice(0,5).reverse()
})
}
},
......@@ -234,14 +234,14 @@ export default {
outboundOrdersTopTenByQuantity().then(res=>{
let data = res.rows
if(!data) return
this.cukuList = data
this.cukuList = data.splice(0,5).reverse()
})
}
if(this.cukuRankType === 'money'){
outboundOrdersTopTenByAmount().then(res=>{
let data = res.rows
if(!data) return
this.cukuList = data
this.cukuList = data.splice(0,5).reverse()
})
}
}
......
......@@ -443,7 +443,7 @@
title="导入"
import-url="/inventory/inbound/import"
template-url="/inventory/inbound/importTemplate"
template-name="入库单导入模板"
:template-name="getTemplateName()"
@success="getList"
:show-trdc-checkbox="true"
@orderTypeChange="handleOrderTypeChange"
......@@ -1051,6 +1051,15 @@ export default {
handleImport() {
this.$refs.import.show()
},
getTemplateName(){
if(this.form.orderTypeId === '1'){
return "入库单导入模板"
}else if(this.form.orderTypeId === '2'){
return "成品入库单导入模板"
}else if(this.form.orderTypeId === '3'){
return "退料TRDC入库单导入模板"
}
},
/** 处理明细项选择变化 */
handleItemsSelectionChange(selection) {
this.selectedItems = selection
......
......@@ -16,16 +16,15 @@
<!-- 页面容器 -->
<div class="page-container">
<!-- 物料查询表单 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="主订单号" prop="mainOrderId">
<!-- <el-form-item label="主订单号" prop="orderId">
<el-input
v-model="queryParams.mainOrderId"
v-model="queryParams.orderId"
placeholder="请输入主订单号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</el-form-item> -->
<el-form-item label="时间段" prop="dateRange">
<el-date-picker
v-model="queryParams.dateRange"
......@@ -253,7 +252,7 @@
style="width: 100%"
>
<el-table-column type="index" label="序号" width="60" align="center" />
<el-table-column label="主订单号" align="center" prop="mainOrderId" width="150" />
<el-table-column label="主订单号" align="center" prop="orderId" width="150" />
<el-table-column label="物料名称" align="center" prop="materialName" min-width="150" show-overflow-tooltip />
<el-table-column label="批次" align="center" prop="batchCode" width="120" />
<el-table-column label="仓库" align="center" prop="warehouseName" width="120" />
......@@ -314,7 +313,7 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 10,
mainOrderId: null,
orderId: null,
startDate: null,
endDate: null,
ownerId: null,
......@@ -339,7 +338,7 @@ export default {
detailQueryParams: {
pageNum: 1,
pageSize: 10,
mainOrderId: null,
orderId: null,
materialId: null,
warehouseId: null,
warehousesCode: null,
......@@ -466,7 +465,7 @@ export default {
this.detailQueryParams = {
pageNum: 1,
pageSize: 10,
mainOrderId: row.mainOrderId,
orderId: row.orderId,
materialId: row.materialId,
warehouseId: null,
warehousesCode: null,
......
......@@ -144,6 +144,7 @@
<el-table-column label="SAP物料号" align="center" prop="sapNo" width="150"/>
<!-- <el-table-column label="物料编码" align="center" prop="materialCode" width="120"/> -->
<el-table-column label="物料名称" align="center" prop="materialName" width="150"/>
<el-table-column label="物料英文名称" align="center" prop="materialEname" width="150"/>
<el-table-column label="TS Code" align="center" prop="tsCode" width="150"/>
<el-table-column label="物料分类" align="center" prop="categoryCode" >
<template slot-scope="scope">
......@@ -298,6 +299,9 @@
<el-form-item label="物料名称" prop="materialName">
<el-input v-model="form.materialName" placeholder="请输入物料名称" />
</el-form-item>
<el-form-item label="物料英文名称" prop="materialEname">
<el-input v-model="form.materialEname" placeholder="请输入物料英文名称" />
</el-form-item>
<el-form-item label="物料分类" prop="categoryCode">
<el-select v-model="form.categoryCode" placeholder="请选择物料分类" clearable>
<el-option
......@@ -444,6 +448,7 @@ export default {
id: null,
materialCode: null,
materialName: null,
materialEname: null,
sapNo: null,
tsCode: null,
categoryCode: null,
......@@ -654,7 +659,7 @@ export default {
.map(item => ({
...item,
// 兜底:如果映射表中没有,显示原始code并标注
displayCategory: this.categoryMap[item.categoryCode] || `${item.categoryCode}(未匹配分类)`
displayCategory: this.categoryMap[item.categoryCode] || `未匹配分类`
}));
this.total = total;
} catch (error) {
......
......@@ -251,7 +251,7 @@ export default {
.filter(item => item.isUsed !== 0 && item.isUsed !== '0')
.map(item => ({
...item,
displayCategory: this.categoryMap[item.categoryCode] || `${item.categoryCode}(未匹配分类)`
displayCategory: this.categoryMap[item.categoryCode] || `未匹配分类`
}));
this.total = response.total;
}).finally(() => {
......
......@@ -121,6 +121,41 @@
</div>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="计划数量" prop="plannedQuantity" required>
<el-input
v-model.number="currentSelectedRow.plannedQuantity"
type="number"
min="1"
:max="(currentSelectedRow.quantity || 0) - (currentSelectedRow.lockedQuantity || 0)"
@input="handleRowPlannedQtyInput(currentSelectedRow); syncDetails(false)"
placeholder="输入计划数量"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="单价" prop="unitPrice" required>
<el-input
v-model.number="currentSelectedRow.unitPrice"
placeholder="请输入单价"
type="number"
min="0"
step="0.01"
@input="syncDetails(false)"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="凭证号" prop="voucherNumber">
<el-input
v-model="currentSelectedRow.voucherNumber"
placeholder="请输入凭证号"
@input="syncDetails(false)"
/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" style="margin-top: 10px;">
<el-col :span="8">
<el-form-item label="约数" prop="divisor">
<el-input
v-model.number="currentSelectedRow.divisor"
......@@ -148,32 +183,6 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="计划数量" prop="plannedQuantity">
<el-input
v-model.number="currentSelectedRow.plannedQuantity"
type="number"
min="1"
:max="(currentSelectedRow.quantity || 0) - (currentSelectedRow.lockedQuantity || 0)"
@input="handleRowPlannedQtyInput(currentSelectedRow); syncDetails(false)"
placeholder="输入计划数量"
/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" style="margin-top: 10px;">
<el-col :span="8">
<el-form-item label="单价" prop="unitPrice">
<el-input
v-model.number="currentSelectedRow.unitPrice"
placeholder="请输入单价"
type="number"
min="0"
step="0.01"
@input="syncDetails(false)"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发货方" prop="shippedBy">
<el-input
v-model="currentSelectedRow.shippedBy"
......@@ -182,16 +191,8 @@
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="凭证号" prop="voucherNumber">
<el-input
v-model="currentSelectedRow.voucherNumber"
placeholder="请输入凭证号"
@input="syncDetails(false)"
/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" style="margin-top: 10px;">
<el-col :span="16">
<el-form-item label="备注" prop="remark">
......@@ -226,6 +227,7 @@
<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="plannedQuantity" label="计划数量" width="100" />
<el-table-column prop="actualQuantity" label="实际数量" width="100" fixed="right"/>
<el-table-column prop="unitPrice" label="单价" width="100" />
......@@ -637,31 +639,18 @@ syncDetails(strict = true) {
if (row.plannedQuantity > availableQty) {
rowErrors.push(`计划数量不能超过可用库存(${availableQty})`);
}
}else{
rowErrors.push(`请填写计划数量`);
}
// 3. 除数(有值才校验,无值不提示)
if (row.divisor !== null && row.divisor !== undefined) {
if (row.unitPrice !== null && row.unitPrice !== undefined) {
// 若有值但为0/负数,可补充校验(按需)
if (row.divisor <= 0) {
rowErrors.push('换算率(除数)必须大于0');
if (row.unitPrice <= 0) {
rowErrors.push('请填写单价');
}
}
// 4. 标签颜色(有值才校验,空字符串算不合规)
if (row.labelColor !== undefined && row.labelColor === '') {
rowErrors.push('请填写标签颜色');
}
// 5. 凭证号(有值才校验,空字符串算不合规)
if (row.voucherNumber !== undefined && row.voucherNumber === '') {
rowErrors.push('请填写凭证号');
}
// 6. 发货人(有值才校验,空字符串算不合规)
if (row.shippedBy !== undefined && row.shippedBy === '') {
rowErrors.push('请填写发货人');
}
// 收集当前行的错误(仅有值但不合规的字段)
if (rowErrors.length > 0) {
errorMessages.push(`${rowName}${rowErrors.join('、')}`);
......
......@@ -138,7 +138,15 @@
<el-table-column label="物料名称" align="center" prop="materialName" width="150" />
<el-table-column label="SAP物料号" align="center" prop="sapNo" width="120" />
<el-table-column label="TS Code" align="center" prop="tsCode" width="120" />
<el-table-column label="危险类别" align="center" prop="hazard" width="120" />
<el-table-column label="危险类别" align="center" prop="hazardId" width="120" >
<template slot-scope="scope">
<el-tag
:type="getDictListClass('danger_type',scope.row.hazardId)"
size="small">
{{ getDictLabel('danger_type',scope.row.hazardId) }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="规格型号" align="center" prop="specification" width="120" />
<el-table-column label="计量单位" align="center" prop="materialUnit" width="120" />
<el-table-column label="单位重量" align="center" prop="unitWeight" width="120" >
......@@ -232,7 +240,15 @@
<el-table-column label="物料名称" align="center" prop="materialName" width="150" />
<el-table-column label="SAP物料号" align="center" prop="sapNo" width="120" />
<el-table-column label="TS Code" align="center" prop="tsCode" width="120" />
<el-table-column label="危险类别" align="center" prop="hazard" width="120" />
<el-table-column label="危险类别" align="center" prop="hazardId" width="120" >
<template slot-scope="scope">
<el-tag
:type="getDictListClass('danger_type',scope.row.hazardId)"
size="small">
{{ getDictLabel('danger_type',scope.row.hazardId) }}
</el-tag>
</template>
</el-table-column>
<!-- <el-table-column label="规格型号" align="center" prop="specification" width="120" /> -->
<!-- <el-table-column label="入库单号" align="center" prop="orderId" width="150" /> -->
<el-table-column label="批次" align="center" prop="batchId" width="120" />
......@@ -265,6 +281,7 @@ import ImportExcel from "@/components/ImportExcel"
export default {
name: "InventoryDetail",
dicts: ['danger_type'],
components: {
RightToolbar,
PageTitle,
......@@ -333,6 +350,19 @@ export default {
this.getList()
},
methods: {
//从表格中的值当作键获取字典lebel
getDictLabel(dictType, value){
if(!value || !this.dict?.type?.[dictType]) return '-'
const dictItem = this.dict.type[dictType].find(item => item.value === value)
return dictItem?.label || '-'
},
//从表格中的值当作键获取字典listClass
getDictListClass(dictType, value){
if(!value || !this.dict?.type?.[dictType]) return '-'
const dictItem = this.dict.type[dictType].find(item => item.value === value)
return dictItem?.label || '-'
},
/** 查询库存明细列表 */
getList() {
this.loading = true
......
......@@ -36,14 +36,7 @@
@click="handleExport"
v-hasPermi="['inventory:warehouses:export']"
>导出</el-button>
<el-button
type="info"
plain
icon="el-icon-upload2"
size="medium"
@click="handleImport"
v-hasPermi="['inventory:warehouses:add']"
>导入</el-button>
</template>
</PageTitle>
......
package com.ruoyi.common.config;
/**
* 仓库配置类(存储默认仓库、常用仓库ID等)
*/
public class WarehouseConfig {
/**
* 默认出库仓库ID(核心默认值)
*/
public static final String DEFAULT_WAREHOUSE_ID = "572ba484-199c-45d9-9735-610928ed5c70";
}
\ No newline at end of file
......@@ -719,4 +719,5 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
}
return sb.toString();
}
}
\ No newline at end of file
......@@ -3,7 +3,7 @@ package com.ruoyi.inventory.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.inventory.domain.vo.InboundTemplateVO;
import com.ruoyi.inventory.domain.vo.inboundVO.InboundTemplateVO;
import com.ruoyi.inventory.domain.vo.OutboundOrdersSummaryVO;
import com.ruoyi.inventory.domain.vo.OutboundTemplateVO;
import org.springframework.security.access.prepost.PreAuthorize;
......
......@@ -6,7 +6,7 @@ import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.inventory.domain.Inventory;
import com.ruoyi.inventory.domain.vo.InboundTemplateVO;
import com.ruoyi.inventory.domain.vo.inboundVO.InboundTemplateVO;
import com.ruoyi.inventory.domain.vo.OutboundTemplateVO;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
......
......@@ -2,6 +2,7 @@ package com.ruoyi.inventory.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
......@@ -13,6 +14,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
* @author ruoyi
* @date 2025-12-02
*/
@Data
public class InventoryTransactions extends BaseEntity
{
private static final long serialVersionUID = 1L;
......@@ -91,218 +93,7 @@ public class InventoryTransactions extends BaseEntity
@Excel(name = "排序号")
private String updateUserCode;
public String getInventoryId() {
return inventoryId;
}
@Excel(name = "单价")
private String unitPrice;
public void setInventoryId(String inventoryId) {
this.inventoryId = inventoryId;
}
public void setId(String id)
{
this.id = id;
}
public String getId()
{
return id;
}
public void setTransactionType(Long transactionType)
{
this.transactionType = transactionType;
}
public Long getTransactionType()
{
return transactionType;
}
public void setReferenceId(String referenceId)
{
this.referenceId = referenceId;
}
public String getReferenceId()
{
return referenceId;
}
public void setReferenceItemId(String referenceItemId)
{
this.referenceItemId = referenceItemId;
}
public String getReferenceItemId()
{
return referenceItemId;
}
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 void setLocationId(String locationId)
{
this.locationId = locationId;
}
public String getLocationId()
{
return locationId;
}
public void setOwnerId(String ownerId)
{
this.ownerId = ownerId;
}
public String getOwnerId()
{
return ownerId;
}
public void setQuantityBefore(Long quantityBefore)
{
this.quantityBefore = quantityBefore;
}
public Long getQuantityBefore()
{
return quantityBefore;
}
public void setQuantityChange(Long quantityChange)
{
this.quantityChange = quantityChange;
}
public Long getQuantityChange()
{
return quantityChange;
}
public void setQuantityAfter(Long quantityAfter)
{
this.quantityAfter = quantityAfter;
}
public Long getQuantityAfter()
{
return quantityAfter;
}
public void setTransactionTime(Date transactionTime)
{
this.transactionTime = transactionTime;
}
public Date getTransactionTime()
{
return transactionTime;
}
public void setOperatedBy(String operatedBy)
{
this.operatedBy = operatedBy;
}
public String getOperatedBy()
{
return operatedBy;
}
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("transactionType", getTransactionType())
.append("referenceId", getReferenceId())
.append("referenceItemId", getReferenceItemId())
.append("materialId", getMaterialId())
.append("batchCode", getBatchCode())
.append("warehouseId", getWarehouseId())
.append("locationId", getLocationId())
.append("ownerId", getOwnerId())
.append("quantityBefore", getQuantityBefore())
.append("quantityChange", getQuantityChange())
.append("quantityAfter", getQuantityAfter())
.append("transactionTime", getTransactionTime())
.append("operatedBy", getOperatedBy())
.append("remark", getRemark())
.append("isUsed", getIsUsed())
.append("sortNo", getSortNo())
.append("createTime", getCreateTime())
.append("createUserCode", getCreateUserCode())
.append("updateTime", getUpdateTime())
.append("updateUserCode", getUpdateUserCode())
.toString();
}
}
......@@ -66,7 +66,7 @@ public class OutboundOrderItems extends BaseEntity
/** 单价 */
@Excel(name = "单价")
private Long unitPrice;
private Double unitPrice;
/** 计划数量 */
@Excel(name = "计划数量")
......@@ -117,5 +117,7 @@ public class OutboundOrderItems extends BaseEntity
@Excel(name = "排序号")
private String updateUserCode;
private String InventoryType;
}
\ No newline at end of file
......@@ -28,7 +28,7 @@ public class Owners extends BaseEntity
@Excel(name = "货主名称")
private String ownerName;
@Excel(name = "货主名称")
@Excel(name = "英文名称")
private String englishName;
/** 货主类型 1-供应商 2-客户 3-内部 检索条件 */
......
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 java.util.Date;
/**
* 入库单导入对象 inboundTemplate
*
* @author ruoyi
* @date 2025-12-02
*/
public class InboundTemplateVO extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 编号 */
private String id;
/** 入库日期 日期无时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "入库日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date inboundDate;
/** 货物ID 字典,检索条件 */
@Excel(name = "SAP No")
private String sapNo;
/** 货物名称 */
@Excel(name = "物料名称")
private String materialName;
/** 货物名称 */
@Excel(name = "TS Code")
private String tsCode;
/** 货主ID */
@Excel(name = "货主")
private String ownerId;
/** 批次ID 检索条件 */
@Excel(name = "批号")
private String batchId;
/** 计划数量 */
@Excel(name = "计划数量")
private Long plannedQuantity;
/** 入库单号 检索条件 */
@Excel(name = "单号")
private String orderId;
/** 系统编号 检索条件 */
@Excel(name = "系统编号")
private String systemNo;
/** 入库类型 字典,检索条件 */
// @Excel(name = "入库类型")
private String orderTypeId;
@Excel(name = "件重")
private Double unitWeight;
/** 约数 */
@Excel(name = "约数")
private Long divisor;
/** 实际件数 */
@Excel(name = "实际件数")
private Long actualPackages;
/** 实际数量 */
@Excel(name = "实发数量")
private Long actualQuantity;
/** 仓库ID 暂无用 */
@Excel(name = "仓库")
private String warehouseId;
/** 库位ID 检索条件 */
@Excel(name = "库位")
private String locationId;
/** 标签颜色 字典,检索条件 */
@Excel(name = "标签颜色")
private Long labelColor;
/** 凭证号 检索条件 */
@Excel(name = "凭证号")
private String voucherNumber;
/** 单价 */
@Excel(name = "单价")
private Long unitPrice;
/** 备注 */
@Excel(name = "备注")
private String remark;
/** 订单类型 字典,检索条件 */
@Excel(name = "订单类型")
private String orderType;
/** 收货人 */
@Excel(name = "收货人")
private String receivedBy;
/** 物料备注 */
@Excel(name = "物料备注")
private String remark2;
/** 负责人 暂无用 */
// @Excel(name = "负责人 暂无用")
private String opUserName;
/** 计划件数 暂无用 */
// @Excel(name = "件数")
private Long plannedPackages;
/** 排序号 */
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;
}
public String getTsCode() {
return tsCode;
}
public void setTsCode(String tsCode) {
this.tsCode = tsCode;
}
public Double getUnitWeight() {
return unitWeight;
}
public void setUnitWeight(Double unitWeight) {
this.unitWeight = unitWeight;
}
@Override
public String toString() {
return "InboundTemplateVO{" +
"id='" + id + '\'' +
", inboundDate=" + inboundDate +
", sapNo='" + sapNo + '\'' +
", materialName='" + materialName + '\'' +
", tsCode='" + tsCode + '\'' +
", batchId='" + batchId + '\'' +
", plannedQuantity=" + plannedQuantity +
", orderId='" + orderId + '\'' +
", systemNo='" + systemNo + '\'' +
", orderTypeId='" + orderTypeId + '\'' +
", unitWeight=" + unitWeight +
", divisor=" + divisor +
", actualPackages=" + actualPackages +
", actualQuantity=" + actualQuantity +
", warehouseId='" + warehouseId + '\'' +
", locationId='" + locationId + '\'' +
", labelColor=" + labelColor +
", voucherNumber='" + voucherNumber + '\'' +
", unitPrice=" + unitPrice +
", remark='" + remark + '\'' +
", orderType='" + orderType + '\'' +
", receivedBy='" + receivedBy + '\'' +
", remark2='" + remark2 + '\'' +
", ownerId='" + ownerId + '\'' +
", opUserName='" + opUserName + '\'' +
", plannedPackages=" + plannedPackages +
", sortNo=" + sortNo +
", createUserCode='" + createUserCode + '\'' +
", updateUserCode='" + updateUserCode + '\'' +
'}';
}
}
package com.ruoyi.inventory.domain.vo.inboundVO;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import java.util.Date;
@Data
public class InboundFinishTemplateVO extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 编号 */
private String id;
/** 入库日期 日期无时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date inboundDate;
/** 货物ID 字典,检索条件 */
@Excel(name = "SAP No")
private String sapNo;
/** 货物名称 */
@Excel(name = "物料名称")
private String materialName;
/** 货物名称 */
@Excel(name = "TS Code")
private String tsCode;
/** 批次ID 检索条件 */
@Excel(name = "批号")
private String batchId;
/** 计划数量 */
@Excel(name = "计划数量")
private Long plannedQuantity;
@Excel(name = "件重")
private Double packageWeight;
/** 约数 */
@Excel(name = "约数")
private Long divisor;
@Excel(name = "件数")
private Long actualPackages;
@Excel(name = "重量")
private Double unitWeight;
/** 实际数量 */
// @Excel(name = "实发数量")
private Long actualQuantity;
/** 库位 */
@Excel(name = "库位")
private String locationId;
/** 仓库ID 暂无用 */
@Excel(name = "仓库")
private String warehouseId;
/** 成品表里的第二个 "库位" */
@Excel(name = "库位")
private String remark2;
/** 库位ID 检索条件 */
// @Excel(name = "收货库位")
private String relocationId;
/** 标签颜色 字典,检索条件 */
@Excel(name = "标签颜色")
private Long labelColor;
/** 凭证号 检索条件 */
@Excel(name = "凭证号")
private String voucherNumber;
@Excel(name = "保温")
private String keepWarm;
@Excel(name = "危险类别")
private String hazardId;
/** 入库单号 检索条件 */
@Excel(name = "智观(客户订单号)")
private String orderId;
/** 系统编号 检索条件 */
@Excel(name = "客户订单号/PO号")
private String systemNo;
/** 货主ID */
@Excel(name = "货主")
private String ownerId;
/** 入库类型 字典,检索条件 */
@Excel(name = "贴标数量")
private String labelQuantity;
/** 订单类型 字典,检索条件 */
@Excel(name = "订单类型")
private String orderType;
@Excel(name = "单个件重")
private Double packageWeight2;
/** 单价 */
// @Excel(name = "单价")
private Long unitPrice;
/** 收货人 */
// @Excel(name = "收货人")
private String receivedBy;
/** 物料备注 */
// @Excel(name = "物料备注")
private String remark1;
/** 负责人 暂无用 */
// @Excel(name = "负责人 暂无用")
private String opUserName;
/** 计划件数 暂无用 */
// @Excel(name = "件数")
private Long plannedPackages;
/** 排序号 */
private Long sortNo;
/** 创建日期 */
private String createUserCode;
private String updateUserCode;
}
package com.ruoyi.inventory.domain.vo.inboundVO;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import java.util.Date;
@Data
public class InboundTRDCTemplateVO extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 编号 */
private String id;
/** 入库日期 日期无时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date inboundDate;
/** 货物ID 字典,检索条件 */
@Excel(name = "SAP No")
private String sapNo;
/** 货物名称 */
@Excel(name = "物料名称")
private String materialName;
/** 货物名称 */
@Excel(name = "TS Code")
private String tsCode;
/** 批次ID 检索条件 */
@Excel(name = "批号")
private String batchId;
/** 计划数量 */
@Excel(name = "计划数量")
private Long plannedQuantity;
@Excel(name = "件重")
private Double unitWeight;
/** 约数 */
@Excel(name = "约数")
private Long divisor;
/** 实际件数 */
@Excel(name = "件数")
private Long actualPackages;
/** 实际数量 */
@Excel(name = "实发数量")
private Long actualQuantity;
/** 库位ID 检索条件 */
@Excel(name = "库位")
private String locationId;
/** 仓库ID 暂无用 */
@Excel(name = "仓库")
private String warehouseId;
/** 备注 */
@Excel(name = "备注")
private String remark;
/** 库位ID 检索条件 */
// @Excel(name = "收货库位")
private String relocationId;
/** 标签颜色 字典,检索条件 */
@Excel(name = "标签颜色")
private Long labelColor;
/** 凭证号 检索条件 */
@Excel(name = "凭证号")
private String voucherNumber;
@Excel(name = "保温")
private String keepWarm;
@Excel(name = "危险类别")
private String hazardId;
/** 入库单号 检索条件 */
@Excel(name = "单号")
private String orderId;
/** 系统编号 检索条件 */
@Excel(name = "系统编号")
private String systemNo;
/** 货主ID */
@Excel(name = "货主")
private String ownerId;
/** 入库类型 字典,检索条件 */
@Excel(name = "贴标数量")
private String labelQuantity;
/** 订单类型 字典,检索条件 */
@Excel(name = "订单类型")
private String orderType;
@Excel(name = "单件重量")
private Double packageWeight;
/** 单价 */
// @Excel(name = "单价")
private Long unitPrice;
/** 收货人 */
// @Excel(name = "收货人")
private String receivedBy;
/** 物料备注 */
// @Excel(name = "物料备注")
private String remark2;
/** 负责人 暂无用 */
// @Excel(name = "负责人 暂无用")
private String opUserName;
/** 计划件数 暂无用 */
// @Excel(name = "件数")
private Long plannedPackages;
/** 排序号 */
private Long sortNo;
/** 创建日期 */
private String createUserCode;
private String updateUserCode;
}
package com.ruoyi.inventory.domain.vo.inboundVO;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import java.util.Date;
/**
* 入库单导入对象 inboundTemplate
*
* @author ZTW
* @date 2025-12-02
*/
@Data
public class InboundTemplateVO extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 编号 */
private String id;
/** 入库日期 日期无时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date inboundDate;
/** 货物ID 字典,检索条件 */
@Excel(name = "SAP No")
private String sapNo;
/** 货物名称 */
@Excel(name = "物料名称")
private String materialName;
/** 货物名称 */
@Excel(name = "TS Code")
private String tsCode;
/** 批次ID 检索条件 */
@Excel(name = "批号")
private String batchId;
/** 计划数量 */
@Excel(name = "计划数量")
private Long plannedQuantity;
@Excel(name = "件重")
private Double unitWeight;
/** 约数 */
@Excel(name = "约数")
private Long divisor;
/** 实际件数 */
@Excel(name = "件数")
private Long actualPackages;
/** 实际数量 */
@Excel(name = "实发数量")
private Long actualQuantity;
/** 库位ID 检索条件 */
@Excel(name = "库位")
private String locationId;
/** 仓库ID 暂无用 */
@Excel(name = "仓库")
private String warehouseId;
/** 备注 */
// @Excel(name = "备注")
private String remark;
/** 库位ID 检索条件 */
@Excel(name = "收货库位")
private String relocationId;
/** 标签颜色 字典,检索条件 */
@Excel(name = "标签颜色")
private Long labelColor;
/** 凭证号 检索条件 */
@Excel(name = "凭证号")
private String voucherNumber;
@Excel(name = "保温")
private String keepWarm;
@Excel(name = "危险类别")
private String hazardId;
/** 入库单号 检索条件 */
@Excel(name = "单号")
private String orderId;
/** 系统编号 检索条件 */
@Excel(name = "系统编号")
private String systemNo;
/** 货主ID */
@Excel(name = "货主")
private String ownerId;
/** 入库类型 字典,检索条件 */
@Excel(name = "贴标数量")
private String labelQuantity;
/** 订单类型 字典,检索条件 */
@Excel(name = "订单类型")
private String orderType;
@Excel(name = "单件重量")
private Double packageWeight;
/** 单价 */
// @Excel(name = "单价")
private Long unitPrice;
/** 收货人 */
// @Excel(name = "收货人")
private String receivedBy;
/** 物料备注 */
// @Excel(name = "物料备注")
private String remark2;
/** 负责人 暂无用 */
// @Excel(name = "负责人 暂无用")
private String opUserName;
/** 计划件数 暂无用 */
// @Excel(name = "件数")
private Long plannedPackages;
/** 排序号 */
private Long sortNo;
/** 创建日期 */
private String createUserCode;
private String updateUserCode;
}
......@@ -116,4 +116,6 @@ public interface InventoryMapper
public List<java.util.Map<String, String>> selectInventoryTopTenByAmount();
public List<java.util.Map<String, String>> selectInventoryTopTenByQuantity();
public void batchUpdateInventory(List<Inventory> inventoryList);
}
......@@ -2,10 +2,9 @@ package com.ruoyi.inventory.service;
import java.util.List;
import com.ruoyi.inventory.domain.InboundOrderItems;
import com.ruoyi.inventory.domain.InboundOrders;
import com.ruoyi.inventory.domain.vo.InboundMaterialTotalVO;
import com.ruoyi.inventory.domain.vo.InboundTemplateVO;
/**
* 入库单主Service接口
......@@ -69,7 +68,7 @@ public interface IInboundOrdersService
* @param inboundOrders,isUpdateSupport,operName 入库单数据信息
* @return 结果
*/
public String importInboundOrders(List<InboundTemplateVO> inboundOrders, Integer isUpdateSupport, String operName, Integer orderType);
public <T> String importInboundOrders(List<T> inboundOrders, Integer isUpdateSupport, String operName, Integer orderType);
/**
......
......@@ -2,10 +2,7 @@ package com.ruoyi.inventory.service;
import java.util.List;
import com.ruoyi.inventory.domain.OutboundOrderItems;
import com.ruoyi.inventory.domain.vo.InboundTemplateVO;
import com.ruoyi.inventory.domain.vo.OutboundOrdersSummaryVO;
import com.ruoyi.inventory.domain.vo.OutboundTemplateVO;
import org.springframework.transaction.annotation.Transactional;
/**
* 出库单明细Service接口
......
......@@ -159,14 +159,16 @@ public class InventoryServiceImpl implements IInventoryService
// 库存操作表插入数据
InventoryTransactions transactions = new InventoryTransactions();
transactions.setId(IdUtils.simpleUUID());
transactions.setTransactionType(2L);// 事务类型-盘点
transactions.setTransactionType(2L);// 事务类型-出库
transactions.setBatchCode(outboundOrderItem.getBatchCode());
transactions.setUnitPrice(String.valueOf(outboundOrderItem.getUnitPrice()));
transactions.setInventoryId(inventory.getId()); // 库存表Id
transactions.setReferenceId(outboundOrderItem.getOutboundOrderId()); //关联单号,相当于主记录-盘点主表
transactions.setReferenceItemId(outboundOrderItem.getId()); // 盘点子表id
transactions.setMaterialId(outboundOrderItem.getMaterialId());
transactions.setWarehouseId(outboundOrderItem.getWarehouseId());
transactions.setLocationId(outboundOrderItem.getLocationId());
OutboundOrders outboundOrders = outboundOrderMapper.selectOutboundOrdersById(outboundOrderItem.getWarehouseId());
OutboundOrders outboundOrders = outboundOrderMapper.selectOutboundOrdersById(outboundOrderItem.getOutboundOrderId());
transactions.setOwnerId(outboundOrders.getOwnerId());
transactions.setQuantityBefore(Long.valueOf(quantity));// 变更前数量
transactions.setQuantityAfter(inventory.getQuantity());// 变更后数量
......@@ -175,10 +177,7 @@ public class InventoryServiceImpl implements IInventoryService
transactions.setTransactionTime(nowDate);
transactions.setOperatedBy(SystemUtils.getUserName());
int inventoryTransactions = insertInventoryTransactions.insertInventoryTransactions(transactions);
if (inventoryTransactions < 0) {
return -1;
}
insertInventoryTransactions.insertInventoryTransactions(transactions);
}
RefreshInventory(inventoryIds);
}
......
......@@ -11,7 +11,7 @@ import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.inventory.domain.InboundOrderItems;
import com.ruoyi.inventory.domain.InboundOrders;
import com.ruoyi.inventory.domain.vo.InboundTemplateVO;
import com.ruoyi.inventory.domain.vo.inboundVO.InboundTemplateVO;
import com.ruoyi.inventory.domain.vo.OutboundOrdersSummaryVO;
import com.ruoyi.inventory.domain.vo.OutboundTemplateVO;
import org.springframework.beans.factory.annotation.Autowired;
......
......@@ -5,6 +5,7 @@ import java.util.Date;
import java.util.List;
import java.util.Map;
import com.ruoyi.common.config.WarehouseConfig;
import com.ruoyi.common.core.domain.entity.Materials;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils;
......@@ -50,8 +51,10 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
public StorageLocations selectStorageLocationsById(String id)
{
StorageLocations storageLocations = storageLocationsMapper.selectStorageLocationsById(id);
String[] AllowedCategoryIds = storageLocations.getAllowedCategoryIds().split(",");
String AllowedCategoryName = "";
if (storageLocations.getAllowedCategoryIds() != null) {
String[] AllowedCategoryIds = storageLocations.getAllowedCategoryIds().split(",");
if (AllowedCategoryIds != null && AllowedCategoryIds.length > 0) {
for (String AllowedCategoryId : AllowedCategoryIds) {
Materials materials = materialsMapper.selectMaterialsById(AllowedCategoryId);
if (materials != null && materials.getMaterialName() != null) {
......@@ -62,6 +65,8 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
AllowedCategoryName += categoryName;
}
}
}
}
storageLocations.setAllowedCategoryNames(AllowedCategoryName);
return storageLocations;
}
......@@ -260,6 +265,7 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
StorageLocations storageLocations = new StorageLocations();
// 拷贝基础属性
BeanUtils.copyProperties(templateVO, storageLocations);
storageLocations.setLocationName(templateVO.getLocationCode());
// 字段类型转换与赋值
storageLocations.setId(UUID.randomUUID().toString());
......@@ -274,7 +280,8 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
storageLocations.setCreateBy(operId);
storageLocations.setCreateTime(now);
storageLocations.setCreateUserCode(operId);
storageLocations.setWarehousesId("572ba484-199c-45d9-9735-610928ed5c70");
storageLocations.setWarehousesCode("固定仓库");
storageLocations.setWarehousesId(WarehouseConfig.DEFAULT_WAREHOUSE_ID);
// 设置默认值
if (storageLocations.getIsUsed() == null) {
......
......@@ -231,8 +231,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</insert>
<!-- 统计入库次数-->
<select id="countInboundOrders" resultType="int" parameterType="String">
select count(id)
......@@ -247,18 +245,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result column="total_money" property="totalMoney" jdbcType="DECIMAL"/>
</resultMap>
<select id="countInboundMaterialQuantity" resultMap="InboundMaterialTotalResultMap" parameterType="String">
select m.material_name,
SELECT t.material_name, t.total_quantity
FROM (
SELECT m.material_name,
COALESCE(SUM(ioi.actual_quantity), 0) as total_quantity
from materials as m
left join inbound_order_items as ioi
on m.id = ioi.material_id
left join inbound_orders as io
on io.id = ioi.inbound_order_id
and io.order_status = 2
group by m.id, m.material_name
order by total_quantity desc
FROM materials as m
LEFT JOIN inbound_order_items as ioi ON m.id = ioi.material_id
LEFT JOIN inbound_orders as io ON io.id = ioi.inbound_order_id AND io.order_status = 2
WHERE m.is_used = 1 AND m.is_active = 1
GROUP BY m.id, m.material_name
ORDER BY total_quantity DESC
LIMIT 10
) t
ORDER BY t.total_quantity ASC;
</select>
<select id="countInboundMaterialMoney" resultMap="InboundMaterialTotalResultMap" parameterType="String">
select t.material_name,t.total_money
from(
select m.material_name,
COALESCE(sum(ioi.actual_quantity * ioi.unit_price), 0) as total_money
from materials as m
......@@ -267,7 +270,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join inbound_orders as io
on io.id = ioi.inbound_order_id
and io.order_status = 2
group by m.id, m.material_name
where m.is_used = 1 and m.is_active = 1
group by m.id
order by total_money desc
limit 10
) t
order by total_money asc
</select>
</mapper>
\ No newline at end of file
......@@ -10,6 +10,7 @@
<result property="orderId" column="order_id" />
<result property="materialId" column="material_id" />
<result property="materialName" column="material_name"/>
<result property="hazardId" column="hazard_id" />
<result property="batchId" column="batch_id" />
<result property="warehousesCode" column="warehouses_code" />
<result property="warehousesName" column="warehouses_name"/>
......@@ -401,6 +402,7 @@
i.order_id,
i.material_id,
m.material_name,
m.hazard_id,
i.batch_id,
i.location_id,
sl.location_name,
......@@ -563,6 +565,9 @@ and inventory_status = '1'
and i.unit_price > 0
and i.last_inbound_time >= DATE_FORMAT(CURDATE(), '%Y-%m-01')
and i.last_inbound_time &lt; DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 1 MONTH), '%Y-%m-01')
where
m.is_used =1
and m.is_active =1
group by m.id, m.material_name
order by value desc, m.material_name asc
</select>
......@@ -577,6 +582,9 @@ and inventory_status = '1'
and i.is_used = 1
and i.last_inbound_time >= DATE_FORMAT(CURDATE(), '%Y-%m-01')
and i.last_inbound_time &lt; DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 1 MONTH), '%Y-%m-01')
where
m.is_used =1
and m.is_active =1
group by m.id, m.material_name
order by value desc, m.material_name asc
</select>
......
......@@ -87,6 +87,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createUserCode != null">create_user_code,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateUserCode != null">update_user_code,</if>
<if test="unitPrice != null">unit_price,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
......@@ -111,6 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createUserCode != null">#{createUserCode},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateUserCode != null">#{updateUserCode},</if>
<if test="unitPrice != null">#{unitPrice},</if>
</trim>
</insert>
......
......@@ -8,6 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="id" column="id" />
<result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" />
<result property="materialEname" column="material_ename" />
<result property="sapNo" column="sap_no" />
<result property="tsCode" column="ts_code" />
<result property="categoryCode" column="category_code" />
......@@ -36,7 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectMaterialsVo">
select id, material_code, material_name, sap_no, ts_code, category_code, hazard_id, specification, material_unit, unit_weight, package_weight, total_weight, volume, shelf_life_days, storage_temperature, special_requirements, is_batch_managed, is_serial_managed, min_stock_level, max_stock_level, is_used, is_active, risk_level, sort_no, create_time, create_user_code, update_time, update_user_code from materials
select id, material_code, material_name,material_ename, sap_no, ts_code, category_code, hazard_id, specification, material_unit, unit_weight, package_weight, total_weight, volume, shelf_life_days, storage_temperature, special_requirements, is_batch_managed, is_serial_managed, min_stock_level, max_stock_level, is_used, is_active, risk_level, sort_no, create_time, create_user_code, update_time, update_user_code from materials
</sql>
<select id="selectMaterialsList" parameterType="Materials" resultMap="MaterialsResult">
......@@ -101,6 +102,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="id != null">id,</if>
<if test="materialCode != null">material_code,</if>
<if test="materialName != null">material_name,</if>
<if test="materialEname != null">material_ename,</if>
<if test="sapNo != null">sap_no,</if>
<if test="tsCode != null">ts_code,</if>
<if test="categoryCode != null">category_code,</if>
......@@ -131,6 +133,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="id != null">#{id},</if>
<if test="materialCode != null">#{materialCode},</if>
<if test="materialName != null">#{materialName},</if>
<if test="materialEname != null">#{materialEname},</if>
<if test="sapNo != null">#{sapNo},</if>
<if test="tsCode != null">#{tsCode},</if>
<if test="categoryCode != null">#{categoryCode},</if>
......@@ -164,6 +167,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="SET" suffixOverrides=",">
<if test="materialCode != null">material_code = #{materialCode},</if>
<if test="materialName != null">material_name = #{materialName},</if>
<if test="materialEname != null">material_ename = #{materialEname},</if>
<if test="sapNo != null">sap_no = #{sapNo},</if>
<if test="tsCode != null">ts_code = #{tsCode},</if>
<if test="categoryCode != null">category_code = #{categoryCode},</if>
......
......@@ -315,6 +315,9 @@
and ooi.is_used = 1
and ooi.shipped_at >= DATE_FORMAT(CURDATE(), '%Y-%m-01 00:00:00')
and ooi.shipped_at &lt; DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 1 MONTH), '%Y-%m-01 00:00:00')
where
m.is_used =1
and m.is_active =1
group by m.id, m.material_name
order by value desc
limit 10;
......@@ -330,6 +333,9 @@
and ooi.is_used = 1
and ooi.shipped_at >= DATE_FORMAT(CURDATE(), '%Y-%m-01 00:00:00')
and ooi.shipped_at &lt; DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 1 MONTH), '%Y-%m-01 00:00:00')
where
m.is_used =1
and m.is_active =1
group by m.id, m.material_name
order by value desc
limit 10;
......@@ -338,4 +344,15 @@
select count(*) from outbound_orders where is_used = 1 and order_status=2 and inbound_date &gt;= DATE_FORMAT(CURDATE(), '%Y-%m-01')
and inbound_date &lt; DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 1 MONTH), '%Y-%m-01')
</select>
<update id="batchUpdateInventory">
<foreach collection="list" item="item" separator=";">
UPDATE inventory
SET quantity = #{item.quantity},
inventory_status = #{item.inventoryStatus},
update_by = #{item.updateBy},
update_time = #{item.updateTime}
WHERE id = #{item.id}
</foreach>
</update>
</mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论