Commit ebf1004d by yubin

导入无库存插入-库存 加导入手动标识

parent 06bd89ab
...@@ -9,8 +9,9 @@ ...@@ -9,8 +9,9 @@
icon="el-icon-plus" icon="el-icon-plus"
size="medium" size="medium"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['inventory:orders:add']" v-hasPermi="['inventory:inbound:add']"
>新增</el-button> >新增</el-button>
<el-button <el-button
type="success" type="success"
plain plain
...@@ -18,16 +19,9 @@ ...@@ -18,16 +19,9 @@
size="medium" size="medium"
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['inventory:orders:edit']" v-hasPermi="['inventory:inbound:edit']"
>修改</el-button> >修改</el-button>
<el-button
type="success"
plain
icon="el-icon-edit"
size="medium"
@click="handleImport"
v-hasPermi="['inventory:orders:add']"
>导入</el-button>
<el-button <el-button
type="danger" type="danger"
plain plain
...@@ -35,15 +29,25 @@ ...@@ -35,15 +29,25 @@
size="medium" size="medium"
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['inventory:orders:remove']" v-hasPermi="['inventory:inbound:remove']"
>删除</el-button> >删除</el-button>
<el-button
type="warning"
plain
icon="el-icon-upload"
size="medium"
@click="handleImport"
v-hasPermi="['inventory:inbound:import']"
>导入</el-button>
<el-button <el-button
type="warning" type="warning"
plain plain
icon="el-icon-download" icon="el-icon-download"
size="medium" size="medium"
@click="handleExport" @click="handleExport"
v-hasPermi="['inventory:orders:export']" v-hasPermi="['inventory:inbound:export']"
>导出</el-button> >导出</el-button>
</template> </template>
</PageTitle> </PageTitle>
...@@ -106,32 +110,16 @@ ...@@ -106,32 +110,16 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="货主" prop="ownerId"> <!-- 【核心修改1】出库日期改为时间段选择器 -->
<el-input <el-form-item label="时间段" prop="dateRange">
v-model="queryOwnerName"
placeholder="请选择货主"
readonly
@focus="openOwnerSelector('query')"
@click="openOwnerSelector('query')"
:suffix-icon="''"
clearable
>
<template v-if="queryOwnerName" #suffix>
<i
class="el-icon-circle-close el-input__icon"
style="cursor: pointer;"
@click.stop="clearQueryOwner"
></i>
</template>
</el-input>
</el-form-item>
<el-form-item label="出库日期" prop="inboundDate">
<el-date-picker <el-date-picker
clearable clearable
v-model="queryParams.inboundDate" v-model="queryParams.dateRange"
type="date" type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
placeholder="请选择出库日期"
style="width: 100%" style="width: 100%"
/> />
</el-form-item> </el-form-item>
...@@ -150,14 +138,7 @@ ...@@ -150,14 +138,7 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="目的地" prop="destination">
<el-input
v-model="queryParams.destination"
placeholder="请输入目的地"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="仓库" prop="warehouseId"> <el-form-item label="仓库" prop="warehouseId">
<el-input <el-input
v-model="queryWarehouseName" v-model="queryWarehouseName"
...@@ -391,8 +372,6 @@ ...@@ -391,8 +372,6 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
...@@ -626,7 +605,7 @@ export default { ...@@ -626,7 +605,7 @@ export default {
ownerId: false, ownerId: false,
outboundOrderId: false outboundOrderId: false
}, },
// 查询参数 // 【核心修改2】查询参数:替换inboundDate为dateRange,新增startDate/endDate
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
...@@ -638,7 +617,9 @@ export default { ...@@ -638,7 +617,9 @@ export default {
warehouseId: null, warehouseId: null,
ownerId: null, ownerId: null,
orderStatus: null, orderStatus: null,
inboundDate: null, dateRange: null, // 日期范围选择器绑定
startDate: null, // 开始日期
endDate: null, // 结束日期
destination: null, destination: null,
totalPlannedQuantity: null, totalPlannedQuantity: null,
totalActualQuantity: null, totalActualQuantity: null,
...@@ -844,7 +825,8 @@ export default { ...@@ -844,7 +825,8 @@ export default {
}).catch(() => { }).catch(() => {
// 取消确认时不执行任何操作 // 取消确认时不执行任何操作
}) })
}, // 修复:获取要传递给子组件的初始化明细数据(按物料分组) },
// 修复:获取要传递给子组件的初始化明细数据(按物料分组)
getInitDetails() { getInitDetails() {
// 编辑场景:传递当前物料分组的所有明细(确保子组件反显) // 编辑场景:传递当前物料分组的所有明细(确保子组件反显)
if (this.isEditDetail && this.currentMaterialId) { if (this.isEditDetail && this.currentMaterialId) {
...@@ -876,7 +858,6 @@ export default { ...@@ -876,7 +858,6 @@ export default {
labelColor: Number(this.currentGroupData.items[0].labelColor) || 0, labelColor: Number(this.currentGroupData.items[0].labelColor) || 0,
unitPrice: Number(this.currentGroupData.items[0].unitPrice) || 0.00, unitPrice: Number(this.currentGroupData.items[0].unitPrice) || 0.00,
amount: Number(this.currentGroupData.items[0].amount) || 0.00, amount: Number(this.currentGroupData.items[0].amount) || 0.00,
itemStatus: Number(this.currentGroupData.items[0].itemStatus) || 1,
warehouseName: this.currentGroupData.items[0].warehouseName || '', warehouseName: this.currentGroupData.items[0].warehouseName || '',
locationName: this.currentGroupData.items[0].locationName || '' locationName: this.currentGroupData.items[0].locationName || ''
} }
...@@ -1147,14 +1128,21 @@ export default { ...@@ -1147,14 +1128,21 @@ export default {
this.tableKey += 1 this.tableKey += 1
}) })
}, },
/** 查询出库单主列表 */ /** 【核心修改3】查询出库单主列表 - 处理时间段参数 */
getList() { getList() {
this.loading = true this.loading = true
// 修改点1:查询时,将前端的orderId映射到后端的outboundOrderId参数 // 处理日期范围:将dateRange拆分为startDate/endDate
const { dateRange, ...restParams } = this.queryParams
const queryParams = { const queryParams = {
...this.queryParams, ...restParams,
outboundOrderId: this.queryParams.orderId // 映射查询参数 outboundOrderId: this.queryParams.orderId, // 映射查询参数
// 拆分日期范围
startDate: dateRange ? dateRange[0] : null,
endDate: dateRange ? dateRange[1] : null
} }
// 删除原inboundDate参数(如果存在)
delete queryParams.inboundDate
listOrders(queryParams).then(response => { listOrders(queryParams).then(response => {
// 修改点2:将后端返回的outboundOrderId映射为前端的orderId显示 // 修改点2:将后端返回的outboundOrderId映射为前端的orderId显示
this.ordersList = (response.rows || []).map(item => ({ this.ordersList = (response.rows || []).map(item => ({
...@@ -1238,7 +1226,7 @@ export default { ...@@ -1238,7 +1226,7 @@ export default {
this.queryParams.pageNum = 1 this.queryParams.pageNum = 1
this.getList() this.getList()
}, },
/** 重置按钮操作 */ /** 【核心修改4】重置按钮操作 - 重置日期范围 */
resetQuery() { resetQuery() {
// 检查ref存在性 // 检查ref存在性
if (this.$refs.queryForm) { if (this.$refs.queryForm) {
...@@ -1253,7 +1241,9 @@ export default { ...@@ -1253,7 +1241,9 @@ export default {
warehouseId: null, warehouseId: null,
ownerId: null, ownerId: null,
orderStatus: null, orderStatus: null,
inboundDate: null, dateRange: null, // 重置日期范围
startDate: null,
endDate: null,
destination: null, destination: null,
totalPlannedQuantity: null, totalPlannedQuantity: null,
totalActualQuantity: null, totalActualQuantity: null,
...@@ -1560,14 +1550,22 @@ export default { ...@@ -1560,14 +1550,22 @@ export default {
this.$modal.msgSuccess("删除成功") this.$modal.msgSuccess("删除成功")
}).catch(() => {}) }).catch(() => {})
}, },
/** 导出按钮操作 */ /** 【核心修改5】导出按钮操作 - 传递时间段参数 */
handleExport() { handleExport() {
// 处理日期范围参数
const { dateRange, ...restParams } = this.queryParams
// 适配导出参数,将orderId映射到outboundOrderId // 适配导出参数,将orderId映射到outboundOrderId
const exportParams = { const exportParams = {
...this.queryParams, ...restParams,
outboundOrderId: this.queryParams.orderId, // 映射导出参数 outboundOrderId: this.queryParams.orderId, // 映射导出参数
orderType: this.queryParams.orderType, // 新增:导出订单类型参数 orderType: this.queryParams.orderType, // 新增:导出订单类型参数
// 拆分日期范围
startDate: dateRange ? dateRange[0] : null,
endDate: dateRange ? dateRange[1] : null
} }
// 删除原inboundDate参数
delete exportParams.inboundDate
this.download('inventory/orders/export', exportParams, `orders_${new Date().getTime()}.xlsx`) this.download('inventory/orders/export', exportParams, `orders_${new Date().getTime()}.xlsx`)
} }
} }
......
...@@ -256,35 +256,43 @@ public class ExcelUtil<T> ...@@ -256,35 +256,43 @@ public class ExcelUtil<T>
} }
/** /**
* 彻底清理所有空白字符(包括空格、全角空格、不间断空格、零宽空格、换行、制表符等)
* @param str 待清理字符串
* @return 清理后的字符串
*/
private static String cleanBlankChars(String str) {
if (StringUtils.isBlank(str)) {
return "";
}
// 移除所有类型的空格(半角、全角、不间断空格),保留其他字符
return str.replaceAll("[\\s\u3000\u00A0]", "").trim();
}
/**
* 创建对象的子列表名称 * 创建对象的子列表名称
*/ */
public void createSubHead() public void createSubHead() {
{ if (isSubList()) {
if (isSubList())
{
Row subRow = sheet.createRow(rownum); Row subRow = sheet.createRow(rownum);
int column = 0; int column = 0;
int subFieldSize = subFields != null ? subFields.size() : 0; int subFieldSize = subFields != null ? subFields.size() : 0;
for (Object[] objects : fields) for (Object[] objects : fields) {
{
Field field = (Field) objects[0]; Field field = (Field) objects[0];
Excel attr = (Excel) objects[1]; Excel attr = (Excel) objects[1];
if (Collection.class.isAssignableFrom(field.getType())) // 子列表表头名称清理空白字符
{ String cleanAttrName = cleanBlankChars(attr.name());
if (Collection.class.isAssignableFrom(field.getType())) {
Cell cell = subRow.createCell(column); Cell cell = subRow.createCell(column);
cell.setCellValue(attr.name()); cell.setCellValue(cleanAttrName); // 使用清理后的名称
cell.setCellStyle(styles.get(StringUtils.format("header_{}_{}", attr.headerColor(), attr.headerBackgroundColor()))); cell.setCellStyle(styles.get(StringUtils.format("header_{}_{}", attr.headerColor(), attr.headerBackgroundColor())));
if (subFieldSize > 1) if (subFieldSize > 1) {
{
CellRangeAddress cellAddress = new CellRangeAddress(rownum, rownum, column, column + subFieldSize - 1); CellRangeAddress cellAddress = new CellRangeAddress(rownum, rownum, column, column + subFieldSize - 1);
sheet.addMergedRegion(cellAddress); sheet.addMergedRegion(cellAddress);
} }
column += subFieldSize; column += subFieldSize;
} } else {
else
{
Cell cell = subRow.createCell(column++); Cell cell = subRow.createCell(column++);
cell.setCellValue(attr.name()); cell.setCellValue(cleanAttrName); // 使用清理后的名称
cell.setCellStyle(styles.get(StringUtils.format("header_{}_{}", attr.headerColor(), attr.headerBackgroundColor()))); cell.setCellStyle(styles.get(StringUtils.format("header_{}_{}", attr.headerColor(), attr.headerBackgroundColor())));
} }
} }
...@@ -362,33 +370,47 @@ public class ExcelUtil<T> ...@@ -362,33 +370,47 @@ public class ExcelUtil<T>
int rows = sheet.getLastRowNum(); int rows = sheet.getLastRowNum();
if (rows > 0) if (rows > 0)
{ {
// 定义一个map用于存放excel列的序号和field.
Map<String, Integer> cellMap = new HashMap<String, Integer>(); Map<String, Integer> cellMap = new HashMap<String, Integer>();
// 获取表头
Row heard = sheet.getRow(titleNum); Row heard = sheet.getRow(titleNum);
for (int i = 0; i < heard.getPhysicalNumberOfCells(); i++) log.info("【导入调试】原始表头行单元格数量:{}", heard.getPhysicalNumberOfCells());
{
for (int i = 0; i < heard.getPhysicalNumberOfCells(); i++) {
Cell cell = heard.getCell(i); Cell cell = heard.getCell(i);
if (StringUtils.isNotNull(cell)) String originalValue = "";
{ String matchKey = "";
String value = this.getCellValue(heard, i).toString(); if (StringUtils.isNotNull(cell)) {
cellMap.put(value, i); originalValue = this.getCellValue(heard, i).toString();
} // 强制去空格(包括中间、开头、结尾的所有空格)
else matchKey = originalValue.replaceAll("\\s+", "").replaceAll("[\u3000\u00A0]", "").trim();
{ cellMap.put(matchKey, i);
cellMap.put(null, i); // 打印每一列的原始值和匹配key(关键调试日志)
} log.info("【导入调试】列{}:原始值=[{}] → 匹配key=[{}]", i, originalValue, matchKey);
} } else {
// 有数据时才处理 得到类的所有field. cellMap.put(matchKey, i);
log.info("【导入调试】列{}:空单元格 → 匹配key=[{}]", i, matchKey);
}
}
// 有数据时才处理 得到类的所有field.
List<Object[]> fields = this.getFields(); List<Object[]> fields = this.getFields();
Map<Integer, Object[]> fieldsMap = new HashMap<Integer, Object[]>(); Map<Integer, Object[]> fieldsMap = new HashMap<Integer, Object[]>();
for (Object[] objects : fields) // 打印所有注解字段(调试)
{ log.info("【导入调试】注解字段总数:{}", fields.size());
for (Object[] objects : fields) {
Excel attr = (Excel) objects[1]; Excel attr = (Excel) objects[1];
Integer column = cellMap.get(attr.name()); String originalAttrName = attr.name();
if (column != null) // 注解名称强制去空格(和表头用相同规则)
{ String attrMatchKey = originalAttrName.replaceAll("\\s+", "").replaceAll("[\u3000\u00A0]", "").trim();
// 打印注解的原始名称和匹配key
log.info("【导入调试】注解字段:原始名=[{}] → 匹配key=[{}]", originalAttrName, attrMatchKey);
Integer column = cellMap.get(attrMatchKey);
if (column != null) {
fieldsMap.put(column, objects); fieldsMap.put(column, objects);
log.info("【导入调试】匹配成功:注解[{}] → Excel列{}", originalAttrName, column);
} else {
log.warn("【导入调试】匹配失败:注解[{}](匹配key=[{}])未在Excel表头中找到", originalAttrName, attrMatchKey);
} }
} }
for (int i = titleNum + 1; i <= rows; i++) for (int i = titleNum + 1; i <= rows; i++)
...@@ -977,8 +999,8 @@ public class ExcelUtil<T> ...@@ -977,8 +999,8 @@ public class ExcelUtil<T>
{ {
// 创建列 // 创建列
Cell cell = row.createCell(column); Cell cell = row.createCell(column);
// 写入列信息 // 写入列信息(清理空白字符)
cell.setCellValue(attr.name()); cell.setCellValue(cleanBlankChars(attr.name()));
setDataValidation(attr, row, column); setDataValidation(attr, row, column);
cell.setCellStyle(styles.get(StringUtils.format("header_{}_{}", attr.headerColor(), attr.headerBackgroundColor()))); cell.setCellStyle(styles.get(StringUtils.format("header_{}_{}", attr.headerColor(), attr.headerBackgroundColor())));
if (isSubList()) if (isSubList())
...@@ -1601,26 +1623,21 @@ public class ExcelUtil<T> ...@@ -1601,26 +1623,21 @@ public class ExcelUtil<T>
} }
} }
// 多注解 // 多注解(Excels)处理
if (field.isAnnotationPresent(Excels.class)) if (field.isAnnotationPresent(Excels.class)) {
{
Excels attrs = field.getAnnotation(Excels.class); Excels attrs = field.getAnnotation(Excels.class);
Excel[] excels = attrs.value(); Excel[] excels = attrs.value();
for (Excel attr : excels) for (Excel attr : excels) {
{ // 注解名称先清理空白字符
if (StringUtils.isNotEmpty(includeFields)) String cleanAttrName = cleanBlankChars(attr.name());
{ if (StringUtils.isNotEmpty(includeFields)) {
if (ArrayUtils.contains(this.includeFields, field.getName() + "." + attr.targetAttr()) if (ArrayUtils.contains(this.includeFields, field.getName() + "." + attr.targetAttr())
&& (attr != null && (attr.type() == Type.ALL || attr.type() == type))) && (attr != null && (attr.type() == Type.ALL || attr.type() == type))) {
{
fields.add(new Object[] { field, attr }); fields.add(new Object[] { field, attr });
} }
} } else {
else
{
if (!ArrayUtils.contains(this.excludeFields, field.getName() + "." + attr.targetAttr()) if (!ArrayUtils.contains(this.excludeFields, field.getName() + "." + attr.targetAttr())
&& (attr != null && (attr.type() == Type.ALL || attr.type() == type))) && (attr != null && (attr.type() == Type.ALL || attr.type() == type))) {
{
fields.add(new Object[] { field, attr }); fields.add(new Object[] { field, attr });
} }
} }
...@@ -1914,12 +1931,12 @@ public class ExcelUtil<T> ...@@ -1914,12 +1931,12 @@ public class ExcelUtil<T>
return IntStream.range(0, headerRow.getLastCellNum()) return IntStream.range(0, headerRow.getLastCellNum())
.mapToObj(headerRow::getCell) .mapToObj(headerRow::getCell)
.map(cell -> { .map(cell -> {
// 单元格类型容错(数字/字符串统一转字符串)
if (cell == null) { if (cell == null) {
return ""; return "";
} }
// 统一转换为字符串并清理空白字符
cell.setCellType(CellType.STRING); cell.setCellType(CellType.STRING);
return StringUtils.trim(cell.getStringCellValue()); return cleanBlankChars(cell.getStringCellValue());
}) })
.filter(StringUtils::isNotBlank) .filter(StringUtils::isNotBlank)
.collect(Collectors.toList()); .collect(Collectors.toList());
...@@ -1928,7 +1945,4 @@ public class ExcelUtil<T> ...@@ -1928,7 +1945,4 @@ public class ExcelUtil<T>
return Collections.emptyList(); return Collections.emptyList();
} }
} }
} }
\ No newline at end of file
...@@ -59,6 +59,13 @@ public class OutboundOrders extends BaseEntity ...@@ -59,6 +59,13 @@ public class OutboundOrders extends BaseEntity
@Excel(name = "出库单状态1-草稿 2-已完成 3-已取消 字典,检索条件") @Excel(name = "出库单状态1-草稿 2-已完成 3-已取消 字典,检索条件")
private Long orderStatus; private Long orderStatus;
/** 开始日期(检索条件) */
@JsonFormat(pattern = "yyyy-MM-dd")
private Date startDate;
/** 结束日期(检索条件) */
@JsonFormat(pattern = "yyyy-MM-dd")
private Date endDate;
/** 出库日期 日期无时间 */ /** 出库日期 日期无时间 */
......
...@@ -9,13 +9,14 @@ ...@@ -9,13 +9,14 @@
<result property="orderId" column="order_id" /> <result property="orderId" column="order_id" />
<result property="systemNo" column="system_no" /> <result property="systemNo" column="system_no" />
<result property="orderTypeId" column="order_type_id" /> <result property="orderTypeId" column="order_type_id" />
<result property="orderType" column="order_type" /> <!-- 新增order_type字段映射 --> <result property="orderType" column="order_type" />
<result property="batchCode" column="batch_code" /> <result property="batchCode" column="batch_code" />
<result property="warehouseId" column="warehouse_id" /> <result property="warehouseId" column="warehouse_id" />
<result property="warehouseName" column="warehouse_name" /> <result property="warehouseName" column="warehouse_name" />
<result property="ownerId" column="owner_id" /> <result property="ownerId" column="owner_id" />
<result property="ownerName" column="owner_name" /> <result property="ownerName" column="owner_name" />
<result property="orderStatus" column="order_status" /> <result property="orderStatus" column="order_status" />
<!-- 保留原字段映射,新增startDate/endDate用于查询 -->
<result property="inboundDate" column="inbound_date" /> <result property="inboundDate" column="inbound_date" />
<result property="destination" column="destination" /> <result property="destination" column="destination" />
<result property="totalPlannedQuantity" column="total_planned_quantity" /> <result property="totalPlannedQuantity" column="total_planned_quantity" />
...@@ -75,7 +76,7 @@ ...@@ -75,7 +76,7 @@
oo.order_id, oo.order_id,
oo.system_no, oo.system_no,
oo.order_type_id, oo.order_type_id,
oo.order_type, -- 新增order_type字段查询 oo.order_type,
oo.batch_code, oo.batch_code,
oo.warehouse_id, oo.warehouse_id,
w.warehouses_name as warehouse_name, w.warehouses_name as warehouse_name,
...@@ -105,12 +106,14 @@ ...@@ -105,12 +106,14 @@
<if test="orderId != null and orderId != ''"> and oo.order_id = #{orderId}</if> <if test="orderId != null and orderId != ''"> and oo.order_id = #{orderId}</if>
<if test="systemNo != null and systemNo != ''"> and oo.system_no = #{systemNo}</if> <if test="systemNo != null and systemNo != ''"> and oo.system_no = #{systemNo}</if>
<if test="orderTypeId != null and orderTypeId != ''"> and oo.order_type_id = #{orderTypeId}</if> <if test="orderTypeId != null and orderTypeId != ''"> and oo.order_type_id = #{orderTypeId}</if>
<if test="orderType != null and orderType != ''"> and oo.order_type = #{orderType}</if> <!-- 新增order_type查询条件 --> <if test="orderType != null and orderType != ''"> and oo.order_type = #{orderType}</if>
<if test="batchCode != null and batchCode != ''"> and oo.batch_code = #{batchCode}</if> <if test="batchCode != null and batchCode != ''"> and oo.batch_code = #{batchCode}</if>
<if test="warehouseId != null and warehouseId != ''"> and oo.warehouse_id = #{warehouseId}</if> <if test="warehouseId != null and warehouseId != ''"> and oo.warehouse_id = #{warehouseId}</if>
<if test="ownerId != null and ownerId != ''"> and oo.owner_id = #{ownerId}</if> <if test="ownerId != null and ownerId != ''"> and oo.owner_id = #{ownerId}</if>
<if test="orderStatus != null "> and oo.order_status = #{orderStatus}</if> <if test="orderStatus != null "> and oo.order_status = #{orderStatus}</if>
<if test="inboundDate != null "> and oo.inbound_date = #{inboundDate}</if> <!-- 替换为时间段查询:startDate和endDate -->
<if test="startDate != null"> and oo.inbound_date &gt;= #{startDate}</if>
<if test="endDate != null"> and oo.inbound_date &lt;= #{endDate}</if>
<if test="destination != null and destination != ''"> and oo.destination = #{destination}</if> <if test="destination != null and destination != ''"> and oo.destination = #{destination}</if>
<if test="totalPlannedQuantity != null "> and oo.total_planned_quantity = #{totalPlannedQuantity}</if> <if test="totalPlannedQuantity != null "> and oo.total_planned_quantity = #{totalPlannedQuantity}</if>
<if test="totalActualQuantity != null "> and oo.total_actual_quantity = #{totalActualQuantity}</if> <if test="totalActualQuantity != null "> and oo.total_actual_quantity = #{totalActualQuantity}</if>
...@@ -126,7 +129,7 @@ ...@@ -126,7 +129,7 @@
oo.order_id, oo.order_id,
oo.system_no, oo.system_no,
oo.order_type_id, oo.order_type_id,
oo.order_type, -- 新增order_type字段查询 oo.order_type,
oo.batch_code, oo.batch_code,
oo.warehouse_id, oo.warehouse_id,
w.warehouses_name as warehouse_name, w.warehouses_name as warehouse_name,
...@@ -194,11 +197,12 @@ ...@@ -194,11 +197,12 @@
<if test="orderId != null">order_id,</if> <if test="orderId != null">order_id,</if>
<if test="systemNo != null">system_no,</if> <if test="systemNo != null">system_no,</if>
<if test="orderTypeId != null">order_type_id,</if> <if test="orderTypeId != null">order_type_id,</if>
<if test="orderType != null">order_type,</if> <!-- 新增order_type字段插入 --> <if test="orderType != null">order_type,</if>
<if test="batchCode != null">batch_code,</if> <if test="batchCode != null">batch_code,</if>
<if test="warehouseId != null">warehouse_id,</if> <if test="warehouseId != null">warehouse_id,</if>
<if test="ownerId != null">owner_id,</if> <if test="ownerId != null">owner_id,</if>
<if test="orderStatus != null">order_status,</if> <if test="orderStatus != null">order_status,</if>
<!-- 保留inboundDate字段的插入(业务字段仍需存储) -->
<if test="inboundDate != null">inbound_date,</if> <if test="inboundDate != null">inbound_date,</if>
<if test="destination != null">destination,</if> <if test="destination != null">destination,</if>
<if test="totalPlannedQuantity != null">total_planned_quantity,</if> <if test="totalPlannedQuantity != null">total_planned_quantity,</if>
...@@ -217,7 +221,7 @@ ...@@ -217,7 +221,7 @@
<if test="orderId != null">#{orderId},</if> <if test="orderId != null">#{orderId},</if>
<if test="systemNo != null">#{systemNo},</if> <if test="systemNo != null">#{systemNo},</if>
<if test="orderTypeId != null">#{orderTypeId},</if> <if test="orderTypeId != null">#{orderTypeId},</if>
<if test="orderType != null">#{orderType},</if> <!-- 新增order_type值插入 --> <if test="orderType != null">#{orderType},</if>
<if test="batchCode != null">#{batchCode},</if> <if test="batchCode != null">#{batchCode},</if>
<if test="warehouseId != null">#{warehouseId},</if> <if test="warehouseId != null">#{warehouseId},</if>
<if test="ownerId != null">#{ownerId},</if> <if test="ownerId != null">#{ownerId},</if>
...@@ -243,7 +247,7 @@ ...@@ -243,7 +247,7 @@
<if test="orderId != null">order_id = #{orderId},</if> <if test="orderId != null">order_id = #{orderId},</if>
<if test="systemNo != null">system_no = #{systemNo},</if> <if test="systemNo != null">system_no = #{systemNo},</if>
<if test="orderTypeId != null">order_type_id = #{orderTypeId},</if> <if test="orderTypeId != null">order_type_id = #{orderTypeId},</if>
<if test="orderType != null">order_type = #{orderType},</if> <!-- 新增order_type字段更新 --> <if test="orderType != null">order_type = #{orderType},</if>
<if test="batchCode != null">batch_code = #{batchCode},</if> <if test="batchCode != null">batch_code = #{batchCode},</if>
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if> <if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
<if test="ownerId != null">owner_id = #{ownerId},</if> <if test="ownerId != null">owner_id = #{ownerId},</if>
...@@ -304,7 +308,6 @@ ...@@ -304,7 +308,6 @@
</foreach> </foreach>
</insert> </insert>
<select id="SelectOutboundOrdersMaterialsTopTenByQuantity" resultType="java.util.Map"> <select id="SelectOutboundOrdersMaterialsTopTenByQuantity" resultType="java.util.Map">
select select
m.material_name as name, m.material_name as name,
...@@ -340,8 +343,10 @@ ...@@ -340,8 +343,10 @@
order by value desc order by value desc
limit 10; limit 10;
</select> </select>
<select id="outboundOrdersCount" resultType="String"> <select id="outboundOrdersCount" resultType="String">
select count(*) from outbound_orders where is_used = 1 and order_status=2 and inbound_date &gt;= DATE_FORMAT(CURDATE(), '%Y-%m-01') 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') and inbound_date &lt; DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 1 MONTH), '%Y-%m-01')
</select> </select>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论