Commit d5f05998 by yubin

Merge remote-tracking branch 'origin/master'

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