Commit 676587af by zhangtw

统计加border属性

导入映射备注字段
parent 257fada7
......@@ -123,6 +123,7 @@
height="100%"
:data="inboundList"
@selection-change="handleSelectionChange"
border
:row-key="(row) => row.materialId + '_' + row.batchId +'_' + row.orderId + '_' + row.warehousesName + '_' + row.locationName"
>
<el-table-column label="物料SAPNO" align="center" prop="sapNo" min-width="200"/>
......
......@@ -397,6 +397,44 @@ export default {
}
},
computed: {
// columns() {
// return [
// { prop: 'sapNo', label: 'SapNo', width: '150', editable: false },
// { prop: 'materialName', label: '货物名称', width: '150', editable: false },
// {
// prop: 'warehousesName',
// label: '源仓库',
// width: '150',
// editable: true,
// idProp: 'warehouseId'
// },
// {
// prop: 'locationName',
// label: '库位',
// width: '150',
// editable: true,
// idProp: 'locationId',
// codeProp: 'locationCode'
// },
// { prop: 'plannedQuantity', label: '计划数量', width: '100', type: 'number', editable: true },
// { prop: 'actualQuantity', label: '实际数量', width: '100', type: 'number', editable: true },
// // { prop: 'plannedPackages', label: '计划件数', width: '100', type: 'number', editable: true },
// { prop: 'actualPackages', label: '实际件数', width: '100', type: 'number', editable: true },
// { prop: 'divisor', label: '约数', width: '100', type: 'number', editable: true },
// { prop: 'labelColor', label: '标签颜色', width: '100', type: 'select', editable: true,
// options: labelColorOptions.map(item => ({
// value: item.value,
// label: item.label,
// raw: item.raw // 如果需要保持 raw 数据
// }))
// },
// { prop: 'voucherNumber', label: '凭证号', width: '150', editable: true },
// { prop: 'unitPrice', label: '单价', width: '100', type: 'number', editable: true },
// { prop: 'receivedBy', label: '收货人', width: '150', editable: true },
// { prop: 'labelQuantity', label: '贴标数量', width: '150',type: 'number', editable: true },
// { prop: 'remark', label: this.getRemarkLabel(), minWidth: '150', editable: true },
// ]
// },
multiple() {
return this.selectedRows.length === 0
},
......@@ -467,6 +505,18 @@ export default {
this.handlePagination()
},
methods: {
getRemarkLabel(){
if (!this.displayData || !this.displayData.orderTypeId) {
return '备注'
}
if(this.displayData.orderTypeId === 1 || this.displayData.orderTypeId === '1'){
return '收获库位'
}else if(this.displayData.orderTypeId === 2 || this.displayData.orderTypeId === '2'){
return '库位'
}else{
return '备注'
}
},
// 根据字典类型和值,获取对应的listClass(标签样式)
getDictListClass(dictType, value) {
const dictList = this.dict.type[dictType] || []
......
......@@ -38,7 +38,7 @@ public class InboundFinishTemplateVO extends BaseEntity {
private Long plannedQuantity;
@Excel(name = "件重")
private Double packageWeight;
private Double packageWeight2;
/** 约数 */
@Excel(name = "约数")
......@@ -56,7 +56,7 @@ public class InboundFinishTemplateVO extends BaseEntity {
private Long actualQuantity;
/** 库位 */
@Excel(name = "库位")
// @Excel(name = "库位")
private String locationId;
/** 仓库ID 暂无用 */
......@@ -106,7 +106,7 @@ public class InboundFinishTemplateVO extends BaseEntity {
private String orderType;
@Excel(name = "单个件重")
private Double packageWeight2;
private Double packageWeight;
/** 单价 */
// @Excel(name = "单价")
......
......@@ -62,7 +62,7 @@ public class InboundTRDCTemplateVO extends BaseEntity {
/** 备注 */
@Excel(name = "备注")
private String remark;
private String remark2;
/** 库位ID 检索条件 */
// @Excel(name = "收货库位")
......@@ -115,7 +115,7 @@ public class InboundTRDCTemplateVO extends BaseEntity {
/** 物料备注 */
// @Excel(name = "物料备注")
private String remark2;
private String remark;
/** 负责人 暂无用 */
// @Excel(name = "负责人 暂无用")
......
......@@ -73,7 +73,7 @@ public class InboundTemplateVO extends BaseEntity {
/** 库位ID 检索条件 */
@Excel(name = "收货库位")
private String relocationId;
private String remark2;
/** 标签颜色 字典,检索条件 */
@Excel(name = "标签颜色")
......@@ -122,7 +122,7 @@ public class InboundTemplateVO extends BaseEntity {
/** 物料备注 */
// @Excel(name = "物料备注")
private String remark2;
// private String remark2;
/** 负责人 暂无用 */
// @Excel(name = "负责人 暂无用")
......
......@@ -78,6 +78,14 @@ public interface InboundOrdersMapper
public int deleteInboundOrderItemsByOrderIds(String[] ids);
/**
* 批量新增入库单
*
* @param inboundOrdersList 入库单明细列表
* @return 结果
*/
public int batchInboundOrders(List<InboundOrders> inboundOrdersList);
/**
* 批量新增入库单明细
*
* @param inboundOrderItemsList 入库单明细列表
......
......@@ -281,7 +281,7 @@ public class InboundOrdersServiceImpl implements IInboundOrdersService
));
// 兜底:若分组结果为空,返回空的不可变Map(避免后续判空)
orderGroupMap = Optional.ofNullable(orderGroupMap).orElse(Collections.emptyMap());
// List<InboundOrders> orderList = new ArrayList<>();
// 4. 遍历每个入库单分组处理
for (Map.Entry<String, List<T>> entry : orderGroupMap.entrySet()) {
String orderKey = entry.getKey();
......@@ -295,6 +295,7 @@ public class InboundOrdersServiceImpl implements IInboundOrdersService
}
List<T> voList = entry.getValue();
InboundOrders mainDO = null;
List<InboundOrderItems> itemDOList = new ArrayList<>();
List<Inventory> inventoryList = new ArrayList<>();
try {
......@@ -305,7 +306,7 @@ public class InboundOrdersServiceImpl implements IInboundOrdersService
query.setOrderId(orderId);
query.setBatchId(batchId);
List<InboundOrders> existMain = inboundOrdersMapper.selectInboundOrdersList(query);
System.out.println(existMain);
if (existMain != null && !existMain.isEmpty()) {
if (isUpdateSupport == 0) {
// 不支持更新,跳过该入库单
......@@ -370,6 +371,7 @@ public class InboundOrdersServiceImpl implements IInboundOrdersService
}
mainDO.setOwnerId(olist.get(0).getId());
// orderList.add(mainDO);
// 插入主表
inboundOrdersMapper.insertInboundOrders(mainDO);
totalMainSuccess++;
......@@ -404,7 +406,6 @@ public class InboundOrdersServiceImpl implements IInboundOrdersService
itemDO.setInboundOrderId(mainDO.getId()); // 关联主表ID(核心!)
itemDO.setSortNo(0L);
// 反射获取remark2并设置
String remark2 = "";
try {
......@@ -475,6 +476,19 @@ public class InboundOrdersServiceImpl implements IInboundOrdersService
itemDO.setLocationId(locationId);
}
itemDOList.add(itemDO);
Double unitWeight = 0.0;
try{
if(itemDO.getPackageWeight() != null && itemDO.getActualQuantity() != null && itemDO.getActualPackages() != null){
unitWeight = itemDO.getPackageWeight() / (itemDO.getActualQuantity() / itemDO.getActualPackages());
}else{
unitWeight = itemDO.getPackageWeight() != null ? itemDO.getPackageWeight() : 0.0;
}
}catch (Exception e){
log.error("导入明细失败-入库单【{}】-SAP【{}】,实发数量和实际件数为空", orderId, sapNo, e);
throw new ServiceException("实发数量和实际件数为空");
}
Inventory inventoryDO = new Inventory(
Long.parseLong(mainDO.getOrderTypeId()),
orderId,
......@@ -483,8 +497,8 @@ public class InboundOrdersServiceImpl implements IInboundOrdersService
itemDO.getWarehouseId(),
itemDO.getLocationId(),
mainDO.getOwnerId(),
itemDO.getActualQuantity(),
itemDO.getPackageWeight() / itemDO.getActualPackages(),
itemDO.getActualQuantity() == null ? 0L : itemDO.getActualQuantity(),
unitWeight,
1L,
itemDO.getUnitPrice()
);
......@@ -533,6 +547,12 @@ public class InboundOrdersServiceImpl implements IInboundOrdersService
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
}
}
// try{
// totalMainSuccess = inboundOrdersMapper.batchInboundOrders(orderList);
// }catch(Exception e){
// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
// throw new ServiceException("明细批量插入失败,成功" + totalMainSuccess + "条,总" + orderList.size() + "条");
// }
// 5. 结果汇总
if (totalMainFailure > 0 || totalItemFailure > 0) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论