Commit 69db319b by yubin

修bug

parent 6dd5c256
......@@ -58,7 +58,14 @@ export function listInboundOutboundStatistics(query) {
params: query
})
}
// 查询出入库统计列表详细
export function listInboundOutboundStatisticsList(query) {
return request({
url: '/inventory/items/getStatisticsInfo',
method: 'get',
params: query
})
}
// 导出出入库统计数据
export function exportInboundOutboundStatistics(query) {
return request({
......
......@@ -515,8 +515,9 @@
<div style="display: flex; align-items: center; flex-direction: column; gap: 8px;">
<el-input
v-model="form.allowedCategoryNames"
@click="initMaterialSelector"
@click="initMaterialSelector"
placeholder="请选择允许存放的物料"
readonly
style="width: 100%;"
/>
</div>
......
......@@ -80,7 +80,6 @@
>
<el-table-column prop="materialName" label="物料名称" width="180" />
<el-table-column prop="batchId" label="批次ID" width="150" />
<el-table-column prop="outboundOrderId" label="出库单号" width="150" />
<el-table-column prop="warehousesName" label="仓库名称" width="120" />
<el-table-column prop="locationName" label="库位名称" width="120" />
<el-table-column
......
......@@ -91,7 +91,7 @@
style="width: 100%"
>
<el-option
v-for="dict in dict.type.outbound_order_type"
v-for="dict in dict.type.inbound_outbound_type"
:key="dict.value"
:label="dict.label"
:value="Number(dict.value)"
......@@ -194,7 +194,7 @@
<el-table-column label="系统编号" align="center" prop="systemNo" width="150" />
<el-table-column label="出库类型" align="center" prop="orderTypeId" width="120">
<template slot-scope="scope">
<dict-tag v-if="dict.type.outbound_order_type" :options="dict.type.outbound_order_type" :value="scope.row.orderTypeId"/>
<dict-tag v-if="dict.type.inbound_outbound_type" :options="dict.type.inbound_outbound_type" :value="scope.row.orderTypeId"/>
<span v-else>-</span>
</template>
</el-table-column>
......@@ -296,10 +296,10 @@
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="库类型" prop="orderTypeId">
<el-select v-model="form.orderTypeId" placeholder="请选择库类型" :disabled="isViewDetail || formDisabled.orderTypeId" style="width: 100%">
<el-form-item label="库类型" prop="orderTypeId">
<el-select v-model="form.orderTypeId" placeholder="请选择库类型" :disabled="isViewDetail || formDisabled.orderTypeId" style="width: 100%">
<el-option
v-for="item in dict.type.outbound_order_type"
v-for="item in dict.type.inbound_outbound_type"
:key="item.value"
:label="item.label"
:value="item.value"
......@@ -405,7 +405,7 @@
</el-row>
<!-- 明细表格区域(按物料分组展示) -->
<el-divider content-position="center">库单明细信息</el-divider>
<el-divider content-position="center">库单明细信息</el-divider>
<!-- 物料分组操作区 - 仅编辑模式显示 -->
<el-row :gutter="10" class="mb8" v-if="!isViewDetail">
......@@ -519,7 +519,7 @@
title="导入"
import-url="/inventory/orders/import"
template-url="/inventory/orders/importTemplate"
template-name="库单导入模板"
template-name="库单导入模板"
@success="getList"
:show-trdc-checkbox="true"
@orderTypeChange="handleOrderTypeChange"
......@@ -541,7 +541,7 @@ import PageTitle from "@/components/PageTitle"
import ImportExcel from "@/components/ImportExcel/index"
export default {
name: "Orders",
dicts: ['outbound_order_type', 'inbound_order_type', 'outbound_order_status', 'label_color','order_type'],
dicts: ['inbound_outbound_type', 'inbound_order_type', 'outbound_order_status', 'label_color','order_type'],
components: {
OutboundOrderFormWithItems,
WarehouseSelector,
......@@ -800,6 +800,7 @@ handleOwnerSelected(owner) {
async handleShip(row) {
try {
// 调用ship接口提交数据到后端
console.log("handleShip",row)
await ship({
...row,
orderId: row.orderId, // 用户填写的出货单号
......@@ -830,9 +831,8 @@ handleOwnerSelected(owner) {
// 整组编辑方法
editGroupDetail(materialId) {
if (!this.outboundOrderItemsGroup[materialId]) return
this.isEditDetail = true
this.detailDialogTitle = `编辑物料${materialId}整组明细`
this.detailDialogTitle = `编辑物料${this.outboundOrderItemsGroup[materialId].materialName}整组明细`
this.currentMaterialId = materialId
// 传递整组数据到子组件
this.currentGroupData = { ...this.outboundOrderItemsGroup[materialId] }
......
......@@ -137,7 +137,7 @@
<dict-tag :options="dict.type.yes_no" :value="scope.row.isActive"/>
</template>
</el-table-column>
<el-table-column label="排序" align="center" prop="sortNo" />
<el-table-column label="创建日期" align="center" prop="createTime" width="160" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120" fixed="right">
<template slot-scope="scope">
......@@ -242,17 +242,13 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="排序" prop="sortNo">
<el-input-number v-model="form.sortNo" placeholder="请输入排序" :min="0" :step="1" style="width: 100%" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="税号" prop="taxNumber">
<el-input v-model="form.taxNumber" placeholder="请输入税号" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="银行账户" prop="bankAccount">
<el-input v-model="form.bankAccount" placeholder="请输入银行账户" />
......@@ -352,10 +348,6 @@ export default {
],
isActive: [
{ required: true, message: '是否激活不能为空', trigger: 'blur' }
],
sortNo: [
{ required: true, message: '排序不能为空', trigger: 'blur' },
{ type: 'number', message: '排序必须为数字值', trigger: 'blur' }
]
}
}
......
......@@ -59,10 +59,18 @@ public class OutboundOrderItemsController extends BaseController
public TableDataInfo getStatistics(OutboundOrdersSummaryVO outboundOrderItems)
{
startPage();
List<OutboundOrderItems> list = outboundOrderItemsService.selectOutboundOrderItemsStatistics(outboundOrderItems);
List<OutboundOrdersSummaryVO> list = outboundOrderItemsService.selectOutboundOrderItemsStatistics(outboundOrderItems);
return getDataTable(list);
}
@PreAuthorize("@ss.hasPermi('inventory:items:list')")
@GetMapping("/getStatisticsInfo")
public TableDataInfo getStatisticsInfo(OutboundOrderItems outboundOrderItems)
{
startPage();
List<OutboundOrderItems> list = outboundOrderItemsService.selectOutboundOrderItemsStatisticsList(outboundOrderItems);
return getDataTable(list);
}
/**
* 导出出库单明细列表
*/
......
......@@ -78,7 +78,7 @@ public class OutboundOrderItems extends BaseEntity
/** 约数 */
@Excel(name = "约数")
private double divisor;
private Double divisor;
/** 标签颜色 字典,检索条件 */
@Excel(name = "标签颜色 字典,检索条件")
......
......@@ -51,10 +51,10 @@ public class OutboundTemplateVO extends BaseEntity {
private Long plannedQuantity;
@Excel(name = "约数")
private double divisor;
private Double divisor;
/** 件重 */
@Excel(name = "件重")
private double pieceWeight;
private Double pieceWeight;
/** 件数(实际件数) */
@Excel(name = "件数")
......
......@@ -36,7 +36,9 @@ public interface OutboundOrderItemsMapper
* @param outboundOrderItems 出库单明细
* @return 出库单明细集合
*/
public List<OutboundOrderItems> selectOutboundOrderItemsStatistics(OutboundOrdersSummaryVO outboundOrderItems);
public List<OutboundOrdersSummaryVO> selectOutboundOrderItemsStatistics(OutboundOrdersSummaryVO outboundOrderItems);
public List<OutboundOrderItems> selectOutboundOrderItemsStatisticsList(OutboundOrderItems outboundOrderItems);
/**
* 新增出库单明细
*
......
......@@ -36,7 +36,7 @@ public interface IOutboundOrderItemsService
* @param outboundOrderItems 出库单明细
* @return 出库单明细集合
*/
public List<OutboundOrderItems> selectOutboundOrderItemsStatistics(OutboundOrdersSummaryVO outboundOrderItems);
public List<OutboundOrdersSummaryVO> selectOutboundOrderItemsStatistics(OutboundOrdersSummaryVO outboundOrderItems);
/**
* 新增出库单明细
*
......@@ -70,4 +70,5 @@ public interface IOutboundOrderItemsService
public int deleteOutboundOrderItemsById(String id);
public List<OutboundOrderItems> selectOutboundOrderItemsStatisticsList(OutboundOrderItems outboundOrderItems);
}
......@@ -145,11 +145,6 @@ public class InventoryServiceImpl implements IInventoryService
for (OutboundOrderItems outboundOrderItem : outboundOrderItems) {
OutboundOrderLog outboundOrderLog = outboundOrderLogMapper.selectOutboundOrderLogById(outboundOrderItem.getId());
// ========== 新增空值校验(兜底) ==========
if (outboundOrderLog == null) {
throw new ServiceException("明细ID【" + outboundOrderItem.getId() + "】对应的出库日志不存在");
}
// ==========================================
Inventory inventory =inventoryMapper.selectInventoryById(outboundOrderLog.getInventoryId());
inventory.setQuantity(inventory.getQuantity()-outboundOrderItem.getActualQuantity());
if (inventory.getQuantity()==0){
......
......@@ -64,11 +64,16 @@ public class OutboundOrderItemsServiceImpl implements IOutboundOrderItemsService
}
@Override
public List<OutboundOrderItems> selectOutboundOrderItemsStatistics(OutboundOrdersSummaryVO outboundOrderItems) {
List<OutboundOrderItems> list = outboundOrderItemsMapper.selectOutboundOrderItemsStatistics(outboundOrderItems);
public List<OutboundOrdersSummaryVO> selectOutboundOrderItemsStatistics(OutboundOrdersSummaryVO outboundOrderItems) {
List<OutboundOrdersSummaryVO> list = outboundOrderItemsMapper.selectOutboundOrderItemsStatistics(outboundOrderItems);
return list;
}
@Override
public List<OutboundOrderItems> selectOutboundOrderItemsStatisticsList(OutboundOrderItems outboundOrderItems) {
List<OutboundOrderItems> list = outboundOrderItemsMapper.selectOutboundOrderItemsStatisticsList(outboundOrderItems);
return list;
}
@Override
public int insertOutboundOrderItems(OutboundOrderItems outboundOrderItems)
......@@ -110,4 +115,5 @@ public class OutboundOrderItemsServiceImpl implements IOutboundOrderItemsService
}
}
......@@ -91,7 +91,7 @@ public class OutboundOrdersServiceImpl implements IOutboundOrdersService
public int insertOutboundOrders(OutboundOrders outboundOrders)
{
outboundOrders.setCreateTime(DateUtils.getNowDate());
outboundOrders.setCreateBy(SystemUtils.getUserName());
outboundOrders.setCreateUserCode(SystemUtils.getUserName());
outboundOrders.setId(UUID.randomUUID().toString());
int rows = outboundOrdersMapper.insertOutboundOrders(outboundOrders);
......@@ -113,7 +113,7 @@ public class OutboundOrdersServiceImpl implements IOutboundOrdersService
outboundOrderLogMapper.deleteOutboundOrderLogByOrdersId(outboundOrders.getId());
outboundOrders.setUpdateBy(SystemUtils.getUserName());
outboundOrders.setUpdateUserCode(SystemUtils.getUserName());
outboundOrders.setUpdateTime(DateUtils.getNowDate());
insertOutboundOrderItems(outboundOrders);
return outboundOrdersMapper.updateOutboundOrders(outboundOrders);
......@@ -152,6 +152,7 @@ public class OutboundOrdersServiceImpl implements IOutboundOrdersService
public int ship(OutboundOrders outboundOrders) {
OutboundOrderItems outboundOrderItems1 = new OutboundOrderItems();
outboundOrderItems1.setOutboundOrderId(outboundOrders.getId());
outboundOrderItems1.setDivisor(null);
List<OutboundOrderItems> outboundOrderItems = outboundOrderItemsMapper.selectOutboundOrderItemsList(outboundOrderItems1);
List<OutboundOrderItems> outboundOrderItems2 = outboundOrderItems;
OutboundOrderLog outboundOrderLog = new OutboundOrderLog();
......@@ -171,7 +172,7 @@ public class OutboundOrdersServiceImpl implements IOutboundOrdersService
outboundOrders.setId(outboundOrders.getId());
outboundOrders.setOrderStatus(2l);
outboundOrders.setUpdateTime(DateUtils.getNowDate());
outboundOrders.setUpdateBy(SystemUtils.getUserName());
outboundOrders.setUpdateUserCode(SystemUtils.getUserName());
outboundOrdersMapper.updateOutboundOrders(outboundOrders);
inventoryService.ship(outboundOrderItems2);
......
......@@ -250,6 +250,62 @@
m.total_weight,
m.volume,
m.shelf_life_days,
m.storage_temperature,
m.special_requirements,
m.sort_no,
sum(oi.planned_quantity) as planned_quantity,
sum(oi.actual_quantity) as actual_quantity,
sum(oi.unit_price * oi.actual_quantity) as total_amount
from outbound_order_items oi
left join outbound_orders o on oi.outbound_order_id = o.id
left join materials m on oi.material_id = m.id
left join warehouses w on oi.warehouse_id = w.id
left join storage_locations sl on oi.location_id = sl.id
<where>
oi.is_used = 1 and o.is_used = 1
<if test="orderId != null and orderId != ''"> and oi.order_id like concat('%', #{orderId}, '%')</if>
<if test="materialId != null and materialId != ''"> and oi.material_id = #{materialId}</if>
<if test="batchCode != null and batchCode != ''"> and oi.batch_code = #{batchCode}</if>
<if test="startDate != null and startDate != ''"> and date_format(COALESCE(oi.shipped_at, o.inbound_date),'%Y-%m-%d') &gt;= #{startDate}</if>
<if test="endDate != null and endDate != ''"> and date_format(COALESCE(oi.shipped_at, o.inbound_date),'%Y-%m-%d') &lt;= #{endDate}</if>
<if test="warehouseId != null and warehouseId != ''"> and oi.warehouse_id = #{warehouseId}</if>
<if test="locationId != null and locationId != ''"> and oi.location_id = #{locationId}</if>
<if test="itemStatus != null "> and oi.item_status = #{itemStatus}</if>
</where>
group by oi.material_id,
m.material_name,
m.sap_no,
m.ts_code,
m.hazard_id,
m.specification,
m.material_unit,
m.unit_weight,
m.package_weight,
m.total_weight,
m.volume,
m.shelf_life_days,
m.storage_temperature,
m.special_requirements,
m.sort_no
order by total_amount desc, m.sap_no, m.sort_no
</select>
<select id="selectOutboundOrderItemsStatisticsList"
parameterType="OutboundOrdersSummaryVO"
resultMap="OutboundOrderItemsResult">
select
oi.material_id,
m.material_name,
m.sap_no,
m.ts_code,
m.hazard_id,
m.specification,
m.material_unit,
m.unit_weight,
m.package_weight,
m.total_weight,
m.volume,
m.shelf_life_days,
oi.location_id,
sl.location_name as location_name,
m.storage_temperature,
......@@ -276,8 +332,6 @@
<if test="orderId != null and orderId != ''"> and oi.order_id like concat('%', #{orderId}, '%')</if>
<if test="materialId != null and materialId != ''"> and oi.material_id = #{materialId}</if>
<if test="batchCode != null and batchCode != ''"> and oi.batch_code = #{batchCode}</if>
<if test="startDate != null and startDate != ''"> and date_format(COALESCE(oi.shipped_at, o.inbound_date),'%Y-%m-%d') &gt;= #{startDate}</if>
<if test="endDate != null and endDate != ''"> and date_format(COALESCE(oi.shipped_at, o.inbound_date),'%Y-%m-%d') &lt;= #{endDate}</if>
<if test="warehouseId != null and warehouseId != ''"> and oi.warehouse_id = #{warehouseId}</if>
<if test="locationId != null and locationId != ''"> and oi.location_id = #{locationId}</if>
<if test="itemStatus != null "> and oi.item_status = #{itemStatus}</if>
......
......@@ -100,7 +100,7 @@
where oo.is_used = 1
</sql>
<select id="selectOutboundOrdersList" parameterType="OutboundOrders" resultMap="OutboundOrdersResult">
<select id="selectOutboundOrdersList" parameterType="OutboundOrders" resultMap="OutboundOrdersOutboundOrderItemsResult">
<include refid="selectOutboundOrdersVo"/>
<if test="orderId != null and orderId != ''"> and oo.order_id = #{orderId}</if>
<if test="systemNo != null and systemNo != ''"> and oo.system_no = #{systemNo}</if>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论