Commit fde2e5ee by zhangtw

删除冗余代码

入库新增添加is_used字段
parent b2989e27
......@@ -607,7 +607,7 @@ export default {
}
},
mounted() {
console.log("dict:",this.dict)
},
created() {
this.getList()
......@@ -706,7 +706,7 @@ export default {
let id = row.id;
if(id === undefined){
id = this.ids
id = this.ids[0]
}
getInbound(id).then(response => {
if(response.data.orderStatus === 2){
......@@ -906,7 +906,6 @@ export default {
orderId: row.orderId
}
const response = await listInbound_itemsAndMname(queryForm)
console.log(response.rows)
row.inboundOrderItemsList = response.rows.map(item => {
return {
...item,
......@@ -915,10 +914,10 @@ export default {
inventoryStatus: 1,
ownerId: row.ownerId,
quantity: item.actualQuantity,
unitWeight: item.unitWeight
unitWeight: item.unitWeight,
isUsed: 1
};
})
console.log(row.inboundOrderItemsList)
// 第三步:确保数据存在后调用入库接口
if (!row.inboundOrderItemsList || row.inboundOrderItemsList.length === 0) {
this.$message.warning('暂无入库明细数据,无法确认入库')
......
......@@ -562,7 +562,6 @@ export default {
// 构建树形结构
this.categoryTreeData = this.buildTreeData(activeCategories)
console.log('分类树数据:', this.categoryTreeData)
}
} catch (error) {
console.error('获取分类树数据失败:', error)
......@@ -598,7 +597,7 @@ export default {
/** 处理树节点点击 */
handleTreeClick(data) {
console.log('点击树节点:', data)
this.currentNodeId = data.sid
// 更新查询参数,按选中的分类筛选物料
......
......@@ -276,7 +276,7 @@ export default {
dialogFormData: {
immediate: true,
handler(val) {
console.log(val)
this.form = { ...val }
}
},
......
......@@ -5,8 +5,9 @@ import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
import com.ruoyi.inventory.domain.*;
import com.ruoyi.inventory.domain.vo.InboundMaterialTotalVO;
import com.ruoyi.inventory.mapper.MaterialsMapper;
import com.ruoyi.inventory.mapper.*;
import org.apache.commons.lang3.SystemUtils;
import org.springframework.util.CollectionUtils;
import com.ruoyi.common.exception.ServiceException;
......@@ -21,9 +22,6 @@ import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.transaction.annotation.Transactional;
import com.ruoyi.inventory.domain.InboundOrderItems;
import com.ruoyi.inventory.mapper.InboundOrdersMapper;
import com.ruoyi.inventory.domain.InboundOrders;
import com.ruoyi.inventory.service.IInboundOrdersService;
/**
......@@ -39,6 +37,13 @@ public class InboundOrdersServiceImpl implements IInboundOrdersService
private InboundOrdersMapper inboundOrdersMapper;
@Autowired
private MaterialsMapper materialsMapper;
@Autowired
private OwnersMapper ownersMapper;
@Autowired
private WarehousesMapper warehousesMapper;
@Autowired
private StorageLocationsMapper storageLocationsMapper;
private static final Logger log = LoggerFactory.getLogger(InboundOrdersServiceImpl.class);
/**
......@@ -182,7 +187,9 @@ public class InboundOrdersServiceImpl implements IInboundOrdersService
Date now = DateUtils.getNowDate();
Long userId = SecurityUtils.getUserId();
String operId = userId.toString();
Warehouses warehouses = new Warehouses();
Owners owners = new Owners();
StorageLocations storageLocations = new StorageLocations();
// 3. 按入库单号分组(核心:同一入库单的多条明细归为一组)
Map<String, List<InboundTemplateVO>> orderGroupMap = inboundOrdersList.stream()
.filter(vo -> StringUtils.isNotBlank(vo.getOrderId())) // 过滤无入库单号的无效行
......@@ -234,10 +241,14 @@ public class InboundOrdersServiceImpl implements IInboundOrdersService
// mainDO.setUpdateBy(operId);
// mainDO.setUpdateTime(now);
// mainDO.setUpdateUserCode(operId);
owners.setOwnerName(mainDO.getOwnerName());
List<Owners> olist = ownersMapper.selectOwnersList(owners);
mainDO.setId(UUID.randomUUID().toString());
mainDO.setOrderId(orderId);
mainDO.setOrderTypeId(orderType+"");
mainDO.setOwnerId(olist.get(0).getId());
// 设置默认值
if (mainDO.getSortNo() == null) {
mainDO.setSortNo(0L);
......@@ -261,6 +272,8 @@ public class InboundOrdersServiceImpl implements IInboundOrdersService
itemDO.setCreateBy(operId);
itemDO.setCreateTime(now);
itemDO.setCreateUserCode(operId);
List<Warehouses> wlist = warehousesMapper.selectWarehousesList(warehouses);
List<StorageLocations> slist = storageLocationsMapper.selectStorageLocationsList(storageLocations);
itemDO.setId(UUID.randomUUID().toString());
Map<String,String> sapAndId = sapAndIdMap.get(vo.getSapNo());
......@@ -268,7 +281,8 @@ public class InboundOrdersServiceImpl implements IInboundOrdersService
itemDO.setOrderId(orderId); // 关联入库单号
itemDO.setBatchId(mainDO.getBatchId());
itemDO.setInboundOrderId(mainDO.getId()); // 关联主表ID(核心!)
itemDO.setWarehouseId(wlist.get(0).getId());
itemDO.setLocationId(slist.get(0).getId());
itemDO.setSortNo(0L);
// 校验物料字段(示例:必填sapNo)
if (StringUtils.isBlank(vo.getSapNo())) {
......@@ -315,6 +329,7 @@ public class InboundOrdersServiceImpl implements IInboundOrdersService
return finalSuccessMsg;
}
}
/**
* 统计本月入库数量
*
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论