|
@@ -1,5 +1,6 @@
|
|
|
package com.imcs.admin.business.service.impl;
|
|
|
|
|
|
+import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
@@ -11,20 +12,25 @@ import com.imcs.admin.business.service.OrderService;
|
|
|
import com.imcs.admin.common.Result;
|
|
|
import com.imcs.admin.entity.*;
|
|
|
import com.imcs.admin.entity.assemble.PolicyInputResult;
|
|
|
+import com.imcs.admin.entity.assemble.PolicyOutResult;
|
|
|
+import com.imcs.admin.entity.assemble.RequiredMaterialDetail;
|
|
|
import com.imcs.admin.entity.query.PolicyInputQuery;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
@Transactional
|
|
|
@Service
|
|
|
public class OrderServiceImpl extends BaseServiceImpl implements OrderService {
|
|
|
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ ImportOrExportPolicyServiceImpl importOrExportPolicyService;
|
|
|
@Override
|
|
|
public Page getInList(WInventoryTransactionOrders order) {
|
|
|
Page page=new Page<>(order.getPage(),order.getSize());
|
|
@@ -243,19 +249,27 @@ public class OrderServiceImpl extends BaseServiceImpl implements OrderService {
|
|
|
LambdaQueryWrapper<WInventoryTransactionOrdersDetail> detailLambdaQueryWrapper = Wrappers.lambdaQuery(WInventoryTransactionOrdersDetail.class).eq(WInventoryTransactionOrdersDetail::getInventoryTransactionOrdersId,id);
|
|
|
List<WInventoryTransactionOrdersDetail> wInventoryTransactionOrdersDetails = ordersDetailDao.selectList(detailLambdaQueryWrapper);
|
|
|
wInventoryTransactionOrders.setDetailList(wInventoryTransactionOrdersDetails);
|
|
|
+
|
|
|
+
|
|
|
+ List<RequiredMaterialDetail> requiredMaterialDetails = BeanUtil.copyToList(wInventoryTransactionOrdersDetails, RequiredMaterialDetail.class);
|
|
|
+ Result exportPolicy = importOrExportPolicyService.findExportPolicy(requiredMaterialDetails);
|
|
|
+ Map<String , List<PolicyOutResult>> map=(Map<String , List<PolicyOutResult>>)exportPolicy.getData();
|
|
|
wInventoryTransactionOrdersDetails.stream().forEach(vo->{
|
|
|
- List<WInventoryManagement> inventoryList = wInventoryManagementDao.getPalletCode(vo.getMaterialCode());
|
|
|
- vo.setInventoryManagementList(inventoryList);
|
|
|
- if(CollectionUtil.isNotEmpty(inventoryList)){
|
|
|
+ List<PolicyOutResult> policyOutResults = map.get(vo.getMaterialCode());
|
|
|
+ vo.setInventoryManagementList(policyOutResults);
|
|
|
+ if(CollectionUtil.isNotEmpty(policyOutResults)){
|
|
|
|
|
|
//前端初始化 最多的一个库存
|
|
|
- vo.setStorageLocationCode(inventoryList.get(0).getStorageLocationCode());
|
|
|
- vo.setOutPalletCode(inventoryList.get(0).getPalletCode());
|
|
|
+ vo.setStorageLocationCode(policyOutResults.get(0).getStorageLocationCode());
|
|
|
+ vo.setOutPalletCode(policyOutResults.get(0).getPalletCode());
|
|
|
//库存数量
|
|
|
- vo.setAmount(inventoryList.get(0).getAmount());
|
|
|
+ vo.setAmount(policyOutResults.get(0).getAmount());
|
|
|
}
|
|
|
|
|
|
});
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
return wInventoryTransactionOrders;
|
|
|
}
|
|
|
}
|