|
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fjhx.sale.entity.documents.po.Documents;
|
|
|
import com.fjhx.sale.entity.pack.dto.PackShipmentDto;
|
|
|
import com.fjhx.sale.entity.pack.dto.PackShipmentSelectDto;
|
|
|
+import com.fjhx.sale.entity.pack.po.PackDetail;
|
|
|
import com.fjhx.sale.entity.pack.po.PackDetailGoods;
|
|
|
import com.fjhx.sale.entity.pack.po.PackShipment;
|
|
|
import com.fjhx.sale.entity.pack.vo.PackShipmentVo;
|
|
@@ -23,6 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -101,25 +103,29 @@ public class PackShipmentServiceImpl extends ServiceImpl<PackShipmentMapper, Pac
|
|
|
if (ObjectUtil.isEmpty(dto.getPackDetailIds())){
|
|
|
throw new ServiceException("参数缺失:包装明细单ID不能为null");
|
|
|
}
|
|
|
+ List<Map<String,Object>> list = new ArrayList<>();
|
|
|
String packDetailIds = dto.getPackDetailIds();
|
|
|
//获取到包装明细单ID列表
|
|
|
List<String> ids = Arrays.asList(packDetailIds.split(","));
|
|
|
- //查询自定义货物
|
|
|
- List<PackDetailGoods> goodsList = packDetailGoodsService.list(Wrappers.<PackDetailGoods>query().lambda().in(PackDetailGoods::getPackDetailId,ids));
|
|
|
- if(CollectionUtils.isNotEmpty(goodsList)){
|
|
|
- List<Map<String,Object>> list = new ArrayList<>();
|
|
|
- for(PackDetailGoods p : goodsList){
|
|
|
- Map<String,Object> map = new HashMap<>();
|
|
|
- map.put("businessId",p.getId());
|
|
|
- map.put("price",0);
|
|
|
- map.put("quantity",p.getQuantity());
|
|
|
- map.put("subDescription",p.getRemark());
|
|
|
- map.put("type","20");
|
|
|
- list.add(map);
|
|
|
+ for(String id : ids){
|
|
|
+ List<PackDetailGoods> goodsList = packDetailGoodsService.list(Wrappers.<PackDetailGoods>query().lambda().eq(PackDetailGoods::getPackDetailId,id));
|
|
|
+ if(CollectionUtils.isNotEmpty(goodsList)){
|
|
|
+ //添加货物
|
|
|
+ for(PackDetailGoods p : goodsList){
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
+ map.put("businessId",p.getId());
|
|
|
+ map.put("price",0);
|
|
|
+ map.put("quantity",p.getQuantity());
|
|
|
+ map.put("subDescription",p.getRemark());
|
|
|
+ map.put("type","20");
|
|
|
+ list.add(map);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ List<Map<String,Object>> productList = baseMapper.productDetailList(Arrays.asList(id));
|
|
|
+ list.addAll(productList);
|
|
|
}
|
|
|
- return list;
|
|
|
}
|
|
|
- return baseMapper.productDetailList(ids);
|
|
|
+ return list;
|
|
|
}
|
|
|
|
|
|
}
|