|
@@ -17,14 +17,15 @@ import com.fjhx.sale.mapper.pack.PackShipmentMapper;
|
|
import com.fjhx.sale.service.documents.DocumentsService;
|
|
import com.fjhx.sale.service.documents.DocumentsService;
|
|
import com.fjhx.sale.service.pack.PackDetailGoodsService;
|
|
import com.fjhx.sale.service.pack.PackDetailGoodsService;
|
|
import com.fjhx.sale.service.pack.PackDetailProductService;
|
|
import com.fjhx.sale.service.pack.PackDetailProductService;
|
|
|
|
+import com.fjhx.sale.service.pack.PackDetailService;
|
|
import com.fjhx.sale.service.pack.PackShipmentService;
|
|
import com.fjhx.sale.service.pack.PackShipmentService;
|
|
import com.ruoyi.common.exception.ServiceException;
|
|
import com.ruoyi.common.exception.ServiceException;
|
|
import com.ruoyi.common.utils.wrapper.IWrapper;
|
|
import com.ruoyi.common.utils.wrapper.IWrapper;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
-import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -46,6 +47,9 @@ public class PackShipmentServiceImpl extends ServiceImpl<PackShipmentMapper, Pac
|
|
@Autowired
|
|
@Autowired
|
|
private DocumentsService documentsService;
|
|
private DocumentsService documentsService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private PackDetailService packDetailService;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public Page<PackShipmentVo> getPage(PackShipmentSelectDto dto) {
|
|
public Page<PackShipmentVo> getPage(PackShipmentSelectDto dto) {
|
|
IWrapper<PackShipment> wrapper = getWrapper();
|
|
IWrapper<PackShipment> wrapper = getWrapper();
|
|
@@ -108,20 +112,27 @@ public class PackShipmentServiceImpl extends ServiceImpl<PackShipmentMapper, Pac
|
|
//获取到包装明细单ID列表
|
|
//获取到包装明细单ID列表
|
|
List<String> ids = Arrays.asList(packDetailIds.split(","));
|
|
List<String> ids = Arrays.asList(packDetailIds.split(","));
|
|
for(String id : ids){
|
|
for(String id : ids){
|
|
- List<PackDetailGoods> goodsList = packDetailGoodsService.list(Wrappers.<PackDetailGoods>query().lambda().eq(PackDetailGoods::getPackDetailId,id));
|
|
|
|
|
|
+ PackDetail packDetail = packDetailService.getById(id);
|
|
|
|
+ List<PackDetailGoods> goodsList = packDetailGoodsService.list(Wrappers.<PackDetailGoods>query().lambda().eq(PackDetailGoods::getPackDetailId, id));
|
|
if(CollectionUtils.isNotEmpty(goodsList)){
|
|
if(CollectionUtils.isNotEmpty(goodsList)){
|
|
//添加货物
|
|
//添加货物
|
|
for(PackDetailGoods p : goodsList){
|
|
for(PackDetailGoods p : goodsList){
|
|
Map<String,Object> map = new HashMap<>();
|
|
Map<String,Object> map = new HashMap<>();
|
|
map.put("businessId",p.getId());
|
|
map.put("businessId",p.getId());
|
|
- map.put("price",0);
|
|
|
|
- map.put("quantity",p.getQuantity());
|
|
|
|
- map.put("subDescription",p.getRemark());
|
|
|
|
|
|
+ map.put("price", 0);
|
|
|
|
+ map.put("quantity", p.getQuantity().multiply(packDetail.getPackQuantity()));
|
|
|
|
+ map.put("subDescription", p.getRemark());
|
|
map.put("type","20");
|
|
map.put("type","20");
|
|
list.add(map);
|
|
list.add(map);
|
|
}
|
|
}
|
|
- }else{
|
|
|
|
- List<Map<String,Object>> productList = baseMapper.productDetailList(Arrays.asList(id));
|
|
|
|
|
|
+ }else {
|
|
|
|
+ List<Map<String, Object>> productList = baseMapper.productDetailList(Arrays.asList(id));
|
|
|
|
+ if (ObjectUtil.isNotEmpty(productList)) {
|
|
|
|
+ for (Map<String, Object> p : productList) {
|
|
|
|
+ String quantity = p.get("quantity").toString();
|
|
|
|
+ p.put("quantity", new BigDecimal(quantity).multiply(packDetail.getPackQuantity()));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
list.addAll(productList);
|
|
list.addAll(productList);
|
|
}
|
|
}
|
|
}
|
|
}
|